From bd12a7c6d3fdcdf3ebe59a94f25bfdc3ab755d79 Mon Sep 17 00:00:00 2001 From: Jiahui Peng <46921893+Alancere@users.noreply.github.com> Date: Tue, 12 Apr 2022 20:14:53 +0800 Subject: [PATCH] Release refresh all package R6 (#17511) * [Release] sdk/resourcemanager/deploymentmanager/armdeploymentmanager/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/deviceupdate/armdeviceupdate/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/devops/armdevops/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/devtestlabs/armdevtestlabs/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/digitaltwins/armdigitaltwins/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/dns/armdns/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/dnsresolver/armdnsresolver/0.2.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * [Release] sdk/resourcemanager/domainservices/armdomainservices/0.3.0 generation from spec commit: d48ca7ed92cbb4f972eb6214bdb3200edaf78369 * Update README.md * update build constraint --- .../armdeploymentmanager/CHANGELOG.md | 132 + .../armdeploymentmanager/README.md | 12 +- .../armdeploymentmanager/autorest.md | 6 +- .../armdeploymentmanager/go.mod | 19 +- .../armdeploymentmanager/go.sum | 20 +- ...ted_example_artifactsources_client_test.go | 66 +- ...enerated_example_operations_client_test.go | 19 +- ..._generated_example_rollouts_client_test.go | 128 +- ..._generated_example_services_client_test.go | 64 +- ...d_example_servicetopologies_client_test.go | 62 +- ...erated_example_serviceunits_client_test.go | 73 +- .../ze_generated_example_steps_client_test.go | 116 +- .../zz_generated_artifactsources_client.go | 35 +- .../zz_generated_constants.go | 36 +- .../zz_generated_models.go | 775 +----- .../zz_generated_models_serde.go | 772 ++++++ .../zz_generated_operations_client.go | 29 +- .../zz_generated_pollers.go | 101 - .../zz_generated_polymorphic_helpers.go | 4 +- .../zz_generated_response_types.go | 256 +- .../zz_generated_rollouts_client.go | 61 +- .../zz_generated_services_client.go | 35 +- .../zz_generated_servicetopologies_client.go | 35 +- .../zz_generated_serviceunits_client.go | 57 +- .../zz_generated_steps_client.go | 35 +- .../zz_generated_time_rfc3339.go | 4 +- .../armdesktopvirtualization/CHANGELOG.md | 399 +++ .../armdesktopvirtualization/README.md | 12 +- .../armdesktopvirtualization/autorest.md | 6 +- .../armdesktopvirtualization/go.mod | 19 +- .../armdesktopvirtualization/go.sum | 20 +- ...d_example_applicationgroups_client_test.go | 139 +- ...erated_example_applications_client_test.go | 119 +- ..._generated_example_desktops_client_test.go | 62 +- ...generated_example_hostpools_client_test.go | 228 +- ...enerated_example_msiximages_client_test.go | 30 +- ...erated_example_msixpackages_client_test.go | 125 +- ...enerated_example_operations_client_test.go | 28 +- ..._privateendpointconnections_client_test.go | 148 +- ...xample_privatelinkresources_client_test.go | 52 +- ...erated_example_scalingplans_client_test.go | 203 +- ...erated_example_sessionhosts_client_test.go | 79 +- ...ated_example_startmenuitems_client_test.go | 28 +- ...erated_example_usersessions_client_test.go | 111 +- ...enerated_example_workspaces_client_test.go | 129 +- .../zz_generated_applicationgroups_client.go | 115 +- .../zz_generated_applications_client.go | 79 +- .../zz_generated_constants.go | 185 +- .../zz_generated_desktops_client.go | 71 +- .../zz_generated_hostpools_client.go | 119 +- .../zz_generated_models.go | 1099 +------- .../zz_generated_models_serde.go | 1062 +++++++ .../zz_generated_msiximages_client.go | 63 +- .../zz_generated_msixpackages_client.go | 79 +- .../zz_generated_operations_client.go | 63 +- .../zz_generated_pagers.go | 1205 -------- ...rated_privateendpointconnections_client.go | 123 +- ...z_generated_privatelinkresources_client.go | 99 +- .../zz_generated_response_types.go | 392 +-- .../zz_generated_scalingplans_client.go | 151 +- .../zz_generated_sessionhosts_client.go | 75 +- .../zz_generated_startmenuitems_client.go | 63 +- .../zz_generated_time_rfc3339.go | 4 +- .../zz_generated_usersessions_client.go | 115 +- .../zz_generated_workspaces_client.go | 115 +- .../CHANGELOG.md | 203 ++ .../armdeviceprovisioningservices/README.md | 12 +- .../armdeviceprovisioningservices/autorest.md | 6 +- .../armdeviceprovisioningservices/go.mod | 19 +- .../armdeviceprovisioningservices/go.sum | 20 +- ...ated_example_dpscertificate_client_test.go | 95 +- ...ated_example_iotdpsresource_client_test.go | 313 ++- ...enerated_example_operations_client_test.go | 28 +- .../zz_generated_constants.go | 72 +- .../zz_generated_dpscertificate_client.go | 51 +- .../zz_generated_iotdpsresource_client.go | 333 ++- .../zz_generated_models.go | 293 +- .../zz_generated_models_serde.go | 302 ++ .../zz_generated_operations_client.go | 63 +- .../zz_generated_pagers.go | 287 -- .../zz_generated_pollers.go | 230 -- .../zz_generated_response_types.go | 373 +-- .../zz_generated_time_rfc1123.go | 4 +- .../zz_generated_time_rfc3339.go | 85 + .../deviceupdate/armdeviceupdate/CHANGELOG.md | 246 ++ .../deviceupdate/armdeviceupdate/README.md | 12 +- .../deviceupdate/armdeviceupdate/autorest.md | 6 +- .../deviceupdate/armdeviceupdate/go.mod | 19 +- .../deviceupdate/armdeviceupdate/go.sum | 20 +- ..._generated_example_accounts_client_test.go | 137 +- ...erated_example_deviceupdate_client_test.go | 23 +- ...generated_example_instances_client_test.go | 122 +- ...enerated_example_operations_client_test.go | 28 +- ...teendpointconnectionproxies_client_test.go | 147 +- ..._privateendpointconnections_client_test.go | 82 +- ...xample_privatelinkresources_client_test.go | 44 +- .../zz_generated_accounts_client.go | 177 +- .../armdeviceupdate/zz_generated_client.go | 29 +- .../armdeviceupdate/zz_generated_constants.go | 66 +- .../zz_generated_instances_client.go | 119 +- .../armdeviceupdate/zz_generated_models.go | 372 +-- .../zz_generated_models_serde.go | 298 ++ .../zz_generated_operations_client.go | 61 +- .../armdeviceupdate/zz_generated_pagers.go | 233 -- .../armdeviceupdate/zz_generated_pollers.go | 402 --- ...privateendpointconnectionproxies_client.go | 172 +- ...rated_privateendpointconnections_client.go | 116 +- ...z_generated_privatelinkresources_client.go | 64 +- .../zz_generated_response_types.go | 537 +--- .../zz_generated_time_rfc3339.go | 4 +- .../devops/armdevops/CHANGELOG.md | 73 + .../devops/armdevops/README.md | 12 +- .../devops/armdevops/autorest.md | 6 +- sdk/resourcemanager/devops/armdevops/go.mod | 19 +- sdk/resourcemanager/devops/armdevops/go.sum | 20 +- ...enerated_example_operations_client_test.go | 28 +- ...generated_example_pipelines_client_test.go | 138 +- ...pipelinetemplatedefinitions_client_test.go | 28 +- .../armdevops/zz_generated_constants.go | 21 +- .../devops/armdevops/zz_generated_models.go | 133 +- .../armdevops/zz_generated_models_serde.go | 135 + .../zz_generated_operations_client.go | 61 +- .../devops/armdevops/zz_generated_pagers.go | 233 -- .../zz_generated_pipelines_client.go | 125 +- ...ated_pipelinetemplatedefinitions_client.go | 61 +- .../devops/armdevops/zz_generated_pollers.go | 58 - .../armdevops/zz_generated_response_types.go | 103 +- .../devtestlabs/armdevtestlabs/CHANGELOG.md | 1005 +++++++ .../devtestlabs/armdevtestlabs/README.md | 12 +- .../devtestlabs/armdevtestlabs/autorest.md | 6 +- .../devtestlabs/armdevtestlabs/go.mod | 19 +- .../devtestlabs/armdevtestlabs/go.sum | 20 +- ...erated_example_armtemplates_client_test.go | 43 +- ...generated_example_artifacts_client_test.go | 64 +- ...ted_example_artifactsources_client_test.go | 105 +- .../ze_generated_example_costs_client_test.go | 90 +- ...erated_example_customimages_client_test.go | 105 +- .../ze_generated_example_disks_client_test.go | 141 +- ...erated_example_environments_client_test.go | 99 +- ..._generated_example_formulas_client_test.go | 132 +- ...rated_example_galleryimages_client_test.go | 28 +- ...ted_example_globalschedules_client_test.go | 169 +- .../ze_generated_example_labs_client_test.go | 240 +- ...xample_notificationchannels_client_test.go | 111 +- ...enerated_example_operations_client_test.go | 19 +- ..._generated_example_policies_client_test.go | 103 +- ...enerated_example_policysets_client_test.go | 23 +- ..._example_provideroperations_client_test.go | 28 +- ...generated_example_schedules_client_test.go | 162 +- ...e_generated_example_secrets_client_test.go | 94 +- ...ated_example_servicefabrics_client_test.go | 154 +- ...mple_servicefabricschedules_client_test.go | 146 +- ...ated_example_servicerunners_client_test.go | 58 +- .../ze_generated_example_users_client_test.go | 115 +- ...ted_example_virtualmachines_client_test.go | 354 ++- ...ple_virtualmachineschedules_client_test.go | 138 +- ...ted_example_virtualnetworks_client_test.go | 101 +- .../zz_generated_armtemplates_client.go | 63 +- .../zz_generated_artifacts_client.go | 65 +- .../zz_generated_artifactsources_client.go | 69 +- .../armdevtestlabs/zz_generated_constants.go | 121 +- .../zz_generated_costs_client.go | 31 +- .../zz_generated_customimages_client.go | 113 +- .../zz_generated_disks_client.go | 161 +- .../zz_generated_environments_client.go | 113 +- .../zz_generated_formulas_client.go | 91 +- .../zz_generated_galleryimages_client.go | 61 +- .../zz_generated_globalschedules_client.go | 151 +- .../zz_generated_labs_client.go | 279 +- .../armdevtestlabs/zz_generated_models.go | 2166 +-------------- .../zz_generated_models_serde.go | 2034 ++++++++++++++ ...z_generated_notificationchannels_client.go | 71 +- .../zz_generated_operations_client.go | 29 +- .../armdevtestlabs/zz_generated_pagers.go | 1367 --------- .../zz_generated_policies_client.go | 69 +- .../zz_generated_policysets_client.go | 29 +- .../armdevtestlabs/zz_generated_pollers.go | 1821 ------------ .../zz_generated_provideroperations_client.go | 61 +- .../zz_generated_response_types.go | 2443 +---------------- .../zz_generated_schedules_client.go | 127 +- .../zz_generated_secrets_client.go | 91 +- .../zz_generated_servicefabrics_client.go | 163 +- ...generated_servicefabricschedules_client.go | 93 +- .../zz_generated_servicerunners_client.go | 33 +- .../zz_generated_time_rfc3339.go | 4 +- .../zz_generated_users_client.go | 113 +- .../zz_generated_virtualmachines_client.go | 381 ++- ...enerated_virtualmachineschedules_client.go | 93 +- .../zz_generated_virtualnetworks_client.go | 113 +- .../digitaltwins/armdigitaltwins/CHANGELOG.md | 242 ++ .../digitaltwins/armdigitaltwins/README.md | 12 +- .../digitaltwins/armdigitaltwins/autorest.md | 6 +- .../digitaltwins/armdigitaltwins/go.mod | 19 +- .../digitaltwins/armdigitaltwins/go.sum | 20 +- ...erated_example_digitaltwins_client_test.go | 150 +- ...xample_digitaltwinsendpoint_client_test.go | 91 +- ...enerated_example_operations_client_test.go | 28 +- ..._privateendpointconnections_client_test.go | 77 +- ...xample_privatelinkresources_client_test.go | 34 +- ...meseriesdatabaseconnections_client_test.go | 149 + .../armdigitaltwins/zz_generated_client.go | 185 +- .../armdigitaltwins/zz_generated_constants.go | 115 +- .../zz_generated_endpoint_client.go | 119 +- .../armdigitaltwins/zz_generated_models.go | 729 ++--- .../zz_generated_models_serde.go | 684 +++++ .../zz_generated_operations_client.go | 63 +- .../armdigitaltwins/zz_generated_pagers.go | 233 -- .../armdigitaltwins/zz_generated_pollers.go | 316 --- .../zz_generated_polymorphic_helpers.go | 22 +- ...rated_privateendpointconnections_client.go | 87 +- ...z_generated_privatelinkresources_client.go | 35 +- .../zz_generated_response_types.go | 431 +-- .../zz_generated_time_rfc3339.go | 4 +- ...ed_timeseriesdatabaseconnections_client.go | 318 +++ sdk/resourcemanager/dns/armdns/CHANGELOG.md | 98 + sdk/resourcemanager/dns/armdns/README.md | 12 +- sdk/resourcemanager/dns/armdns/autorest.md | 6 +- sdk/resourcemanager/dns/armdns/go.mod | 19 +- sdk/resourcemanager/dns/armdns/go.sum | 20 +- ...xample_dnsresourcereference_client_test.go | 21 +- ...enerated_example_recordsets_client_test.go | 93 +- .../ze_generated_example_zones_client_test.go | 122 +- .../dns/armdns/zz_generated_constants.go | 16 +- .../dns/armdns/zz_generated_models.go | 153 +- .../dns/armdns/zz_generated_models_serde.go | 156 ++ .../dns/armdns/zz_generated_pagers.go | 287 -- .../dns/armdns/zz_generated_pollers.go | 58 - .../armdns/zz_generated_recordsets_client.go | 137 +- .../zz_generated_resourcereference_client.go | 29 +- .../dns/armdns/zz_generated_response_types.go | 141 +- .../dns/armdns/zz_generated_zones_client.go | 125 +- .../dnsresolver/armdnsresolver/CHANGELOG.md | 340 +++ .../dnsresolver/armdnsresolver/README.md | 12 +- .../dnsresolver/armdnsresolver/autorest.md | 6 +- .../dnsresolver/armdnsresolver/go.mod | 19 +- .../dnsresolver/armdnsresolver/go.sum | 17 +- ...ample_dnsforwardingrulesets_client_test.go | 161 +- ...erated_example_dnsresolvers_client_test.go | 159 +- ...ted_example_forwardingrules_client_test.go | 103 +- ...ed_example_inboundendpoints_client_test.go | 115 +- ...d_example_outboundendpoints_client_test.go | 111 +- ...example_virtualnetworklinks_client_test.go | 109 +- .../armdnsresolver/zz_generated_constants.go | 31 +- ..._generated_dnsforwardingrulesets_client.go | 199 +- .../zz_generated_dnsresolvers_client.go | 199 +- .../zz_generated_forwardingrules_client.go | 65 +- .../zz_generated_inboundendpoints_client.go | 131 +- .../armdnsresolver/zz_generated_models.go | 353 +-- .../zz_generated_models_serde.go | 316 +++ .../zz_generated_outboundendpoints_client.go | 131 +- .../armdnsresolver/zz_generated_pagers.go | 557 ---- .../armdnsresolver/zz_generated_pollers.go | 660 ----- .../zz_generated_response_types.go | 825 +----- .../zz_generated_time_rfc3339.go | 4 +- ...zz_generated_virtualnetworklinks_client.go | 131 +- .../armdomainservices/CHANGELOG.md | 157 ++ .../armdomainservices/README.md | 12 +- .../armdomainservices/autorest.md | 6 +- .../domainservices/armdomainservices/go.mod | 19 +- .../domainservices/armdomainservices/go.sum | 20 +- ...ple_domainserviceoperations_client_test.go | 28 +- ...ated_example_domainservices_client_test.go | 196 +- ...nerated_example_oucontainer_client_test.go | 112 +- ...ample_oucontaineroperations_client_test.go | 28 +- .../armdomainservices/zz_generated_client.go | 169 +- .../zz_generated_constants.go | 76 +- ...enerated_domainserviceoperations_client.go | 61 +- .../armdomainservices/zz_generated_models.go | 444 +-- .../zz_generated_models_serde.go | 430 +++ .../zz_generated_oucontainer_client.go | 135 +- ..._generated_oucontaineroperations_client.go | 61 +- .../armdomainservices/zz_generated_pagers.go | 287 -- .../armdomainservices/zz_generated_pollers.go | 273 -- .../zz_generated_response_types.go | 334 +-- .../zz_generated_time_rfc1123.go | 4 +- .../zz_generated_time_rfc3339.go | 4 +- 276 files changed, 20434 insertions(+), 27086 deletions(-) create mode 100644 sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_pollers.go create mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_pagers.go create mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_pagers.go delete mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_pollers.go create mode 100644 sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc3339.go create mode 100644 sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_pagers.go delete mode 100644 sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_pollers.go create mode 100644 sdk/resourcemanager/devops/armdevops/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/devops/armdevops/zz_generated_pagers.go delete mode 100644 sdk/resourcemanager/devops/armdevops/zz_generated_pollers.go create mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_pagers.go delete mode 100644 sdk/resourcemanager/devtestlabs/armdevtestlabs/zz_generated_pollers.go create mode 100644 sdk/resourcemanager/digitaltwins/armdigitaltwins/ze_generated_example_timeseriesdatabaseconnections_client_test.go create mode 100644 sdk/resourcemanager/digitaltwins/armdigitaltwins/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/digitaltwins/armdigitaltwins/zz_generated_pagers.go delete mode 100644 sdk/resourcemanager/digitaltwins/armdigitaltwins/zz_generated_pollers.go create mode 100644 sdk/resourcemanager/digitaltwins/armdigitaltwins/zz_generated_timeseriesdatabaseconnections_client.go create mode 100644 sdk/resourcemanager/dns/armdns/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/dns/armdns/zz_generated_pagers.go delete mode 100644 sdk/resourcemanager/dns/armdns/zz_generated_pollers.go create mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_pagers.go delete mode 100644 sdk/resourcemanager/dnsresolver/armdnsresolver/zz_generated_pollers.go create mode 100644 sdk/resourcemanager/domainservices/armdomainservices/zz_generated_models_serde.go delete mode 100644 sdk/resourcemanager/domainservices/armdomainservices/zz_generated_pagers.go delete mode 100644 sdk/resourcemanager/domainservices/armdomainservices/zz_generated_pollers.go diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/CHANGELOG.md b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/CHANGELOG.md index 95068360fd2e..0db5a8d3c3d0 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/CHANGELOG.md +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/CHANGELOG.md @@ -1,5 +1,137 @@ # Release History +## 0.3.0 (2022-04-11) +### Breaking Changes + +- Function `NewArtifactSourcesClient` return value(s) have been changed from `(*ArtifactSourcesClient)` to `(*ArtifactSourcesClient, error)` +- Function `NewRolloutsClient` return value(s) have been changed from `(*RolloutsClient)` to `(*RolloutsClient, error)` +- Function `NewServiceTopologiesClient` return value(s) have been changed from `(*ServiceTopologiesClient)` to `(*ServiceTopologiesClient, error)` +- Function `NewStepsClient` return value(s) have been changed from `(*StepsClient)` to `(*StepsClient, error)` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `*RolloutsClient.BeginCreateOrUpdate` return value(s) have been changed from `(RolloutsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[RolloutsClientCreateOrUpdateResponse], error)` +- Function `*ServiceUnitsClient.BeginCreateOrUpdate` return value(s) have been changed from `(ServiceUnitsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[ServiceUnitsClientCreateOrUpdateResponse], error)` +- Function `NewServicesClient` return value(s) have been changed from `(*ServicesClient)` to `(*ServicesClient, error)` +- Function `NewServiceUnitsClient` return value(s) have been changed from `(*ServiceUnitsClient)` to `(*ServiceUnitsClient, error)` +- Type of `Operation.Properties` has been changed from `map[string]interface{}` to `interface{}` +- Function `*ServiceUnitsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*ServiceUnitsClientCreateOrUpdatePoller.Poll` has been removed +- Function `RestAuthLocation.ToPtr` has been removed +- Function `*RolloutsClientCreateOrUpdatePoller.Done` has been removed +- Function `DeploymentMode.ToPtr` has been removed +- Function `ServiceUnitsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*ServiceUnitsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `RolloutsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `RestAuthType.ToPtr` has been removed +- Function `StepType.ToPtr` has been removed +- Function `*RolloutsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*RolloutsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*ServiceUnitsClientCreateOrUpdatePoller.Done` has been removed +- Function `*ServiceUnitsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `RestMatchQuantifier.ToPtr` has been removed +- Function `RestRequestMethod.ToPtr` has been removed +- Function `*RolloutsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*RolloutsClientCreateOrUpdatePoller.Poll` has been removed +- Struct `ArtifactSourcesClientCreateOrUpdateResult` has been removed +- Struct `ArtifactSourcesClientGetResult` has been removed +- Struct `ArtifactSourcesClientListResult` has been removed +- Struct `OperationsClientListResult` has been removed +- Struct `RolloutsClientCancelResult` has been removed +- Struct `RolloutsClientCreateOrUpdatePoller` has been removed +- Struct `RolloutsClientCreateOrUpdatePollerResponse` has been removed +- Struct `RolloutsClientCreateOrUpdateResult` has been removed +- Struct `RolloutsClientGetResult` has been removed +- Struct `RolloutsClientListResult` has been removed +- Struct `RolloutsClientRestartResult` has been removed +- Struct `ServiceTopologiesClientCreateOrUpdateResult` has been removed +- Struct `ServiceTopologiesClientGetResult` has been removed +- Struct `ServiceTopologiesClientListResult` has been removed +- Struct `ServiceUnitsClientCreateOrUpdatePoller` has been removed +- Struct `ServiceUnitsClientCreateOrUpdatePollerResponse` has been removed +- Struct `ServiceUnitsClientCreateOrUpdateResult` has been removed +- Struct `ServiceUnitsClientGetResult` has been removed +- Struct `ServiceUnitsClientListResult` has been removed +- Struct `ServicesClientCreateOrUpdateResult` has been removed +- Struct `ServicesClientGetResult` has been removed +- Struct `ServicesClientListResult` has been removed +- Struct `StepsClientCreateOrUpdateResult` has been removed +- Struct `StepsClientGetResult` has been removed +- Struct `StepsClientListResult` has been removed +- Field `RawResponse` of struct `ServiceUnitsClientDeleteResponse` has been removed +- Field `RolloutsClientListResult` of struct `RolloutsClientListResponse` has been removed +- Field `RawResponse` of struct `RolloutsClientListResponse` has been removed +- Field `ArtifactSourcesClientCreateOrUpdateResult` of struct `ArtifactSourcesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientCreateOrUpdateResponse` has been removed +- Field `RolloutsClientCreateOrUpdateResult` of struct `RolloutsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `RolloutsClientCreateOrUpdateResponse` has been removed +- Field `ServicesClientListResult` of struct `ServicesClientListResponse` has been removed +- Field `RawResponse` of struct `ServicesClientListResponse` has been removed +- Field `StepsClientCreateOrUpdateResult` of struct `StepsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `StepsClientCreateOrUpdateResponse` has been removed +- Field `ArtifactSourcesClientListResult` of struct `ArtifactSourcesClientListResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientListResponse` has been removed +- Field `ServiceTopologiesClientListResult` of struct `ServiceTopologiesClientListResponse` has been removed +- Field `RawResponse` of struct `ServiceTopologiesClientListResponse` has been removed +- Field `ServiceUnitsClientCreateOrUpdateResult` of struct `ServiceUnitsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceUnitsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientDeleteResponse` has been removed +- Field `RawResponse` of struct `ServicesClientDeleteResponse` has been removed +- Field `StepsClientGetResult` of struct `StepsClientGetResponse` has been removed +- Field `RawResponse` of struct `StepsClientGetResponse` has been removed +- Field `ServiceUnitsClientListResult` of struct `ServiceUnitsClientListResponse` has been removed +- Field `RawResponse` of struct `ServiceUnitsClientListResponse` has been removed +- Field `RolloutsClientRestartResult` of struct `RolloutsClientRestartResponse` has been removed +- Field `RawResponse` of struct `RolloutsClientRestartResponse` has been removed +- Field `ServicesClientCreateOrUpdateResult` of struct `ServicesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ServicesClientCreateOrUpdateResponse` has been removed +- Field `RolloutsClientCancelResult` of struct `RolloutsClientCancelResponse` has been removed +- Field `RawResponse` of struct `RolloutsClientCancelResponse` has been removed +- Field `RawResponse` of struct `ServiceTopologiesClientDeleteResponse` has been removed +- Field `RawResponse` of struct `RolloutsClientDeleteResponse` has been removed +- Field `ServiceTopologiesClientGetResult` of struct `ServiceTopologiesClientGetResponse` has been removed +- Field `RawResponse` of struct `ServiceTopologiesClientGetResponse` has been removed +- Field `RolloutsClientGetResult` of struct `RolloutsClientGetResponse` has been removed +- Field `RawResponse` of struct `RolloutsClientGetResponse` has been removed +- Field `StepsClientListResult` of struct `StepsClientListResponse` has been removed +- Field `RawResponse` of struct `StepsClientListResponse` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `StepsClientDeleteResponse` has been removed +- Field `ServiceTopologiesClientCreateOrUpdateResult` of struct `ServiceTopologiesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceTopologiesClientCreateOrUpdateResponse` has been removed +- Field `ServicesClientGetResult` of struct `ServicesClientGetResponse` has been removed +- Field `RawResponse` of struct `ServicesClientGetResponse` has been removed +- Field `ArtifactSourcesClientGetResult` of struct `ArtifactSourcesClientGetResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientGetResponse` has been removed +- Field `ServiceUnitsClientGetResult` of struct `ServiceUnitsClientGetResponse` has been removed +- Field `RawResponse` of struct `ServiceUnitsClientGetResponse` has been removed + +### Features Added + +- New anonymous field `Rollout` in struct `RolloutsClientGetResponse` +- New anonymous field `ServiceTopologyResource` in struct `ServiceTopologiesClientGetResponse` +- New anonymous field `Rollout` in struct `RolloutsClientCancelResponse` +- New field `ArtifactSourceArray` in struct `ArtifactSourcesClientListResponse` +- New anonymous field `ServiceUnitResource` in struct `ServiceUnitsClientGetResponse` +- New anonymous field `RolloutRequest` in struct `RolloutsClientCreateOrUpdateResponse` +- New anonymous field `StepResource` in struct `StepsClientCreateOrUpdateResponse` +- New anonymous field `ServiceTopologyResource` in struct `ServiceTopologiesClientCreateOrUpdateResponse` +- New field `ServiceResourceArray` in struct `ServicesClientListResponse` +- New anonymous field `ArtifactSource` in struct `ArtifactSourcesClientGetResponse` +- New field `StepResourceArray` in struct `StepsClientListResponse` +- New field `ResumeToken` in struct `ServiceUnitsClientBeginCreateOrUpdateOptions` +- New anonymous field `ServiceResource` in struct `ServicesClientCreateOrUpdateResponse` +- New anonymous field `StepResource` in struct `StepsClientGetResponse` +- New anonymous field `OperationsList` in struct `OperationsClientListResponse` +- New anonymous field `ArtifactSource` in struct `ArtifactSourcesClientCreateOrUpdateResponse` +- New field `RolloutArray` in struct `RolloutsClientListResponse` +- New anonymous field `ServiceUnitResource` in struct `ServiceUnitsClientCreateOrUpdateResponse` +- New anonymous field `Rollout` in struct `RolloutsClientRestartResponse` +- New field `ServiceUnitResourceArray` in struct `ServiceUnitsClientListResponse` +- New anonymous field `ServiceResource` in struct `ServicesClientGetResponse` +- New field `ResumeToken` in struct `RolloutsClientBeginCreateOrUpdateOptions` +- New field `ServiceTopologyResourceArray` in struct `ServiceTopologiesClientListResponse` + + ## 0.2.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/README.md b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/README.md index e50cb1d5f97c..ea9a11e84e3b 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/README.md +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/README.md @@ -11,7 +11,7 @@ The `armdeploymentmanager` module provides operations for working with Azure Dep ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.16 or above +- Go 1.18 or above ## Install the package @@ -38,16 +38,18 @@ For more information on authentication, please see the documentation for `aziden Azure Deployment manager 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 := armdeploymentmanager.NewServiceTopologiesClient(, cred, nil) +client, err := armdeploymentmanager.NewServiceTopologiesClient(, 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{ - Host: arm.AzureChina, +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, } -client := armdeploymentmanager.NewServiceTopologiesClient(, cred, &options) +client, err := armdeploymentmanager.NewServiceTopologiesClient(, cred, &options) ``` ## Provide Feedback diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/autorest.md b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/autorest.md index d0f5b79ad52d..7f753035d992 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/autorest.md +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/deploymentmanager/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/deploymentmanager/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/deploymentmanager/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/deploymentmanager/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.1 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/go.mod b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/go.mod index 7fe63502ca68..b1bafd5c77ed 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/go.mod +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/go.mod @@ -1,8 +1,21 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deploymentmanager/armdeploymentmanager -go 1.16 +go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect + github.com/golang-jwt/jwt v3.2.1+incompatible // indirect + github.com/google/uuid v1.1.1 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect + golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/go.sum b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/go.sum index 2ce51d3b8174..56d1c32628ae 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/go.sum +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/go.sum @@ -1,18 +1,18 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= 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/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -32,21 +32,16 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -56,4 +51,3 @@ 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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_artifactsources_client_test.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_artifactsources_client_test.go index a838e56d2279..d86424cdd9b8 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_artifactsources_client_test.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_artifactsources_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,84 +17,110 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deploymentmanager/armdeploymentmanager" ) -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_createorupdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_createorupdate.json func ExampleArtifactSourcesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewArtifactSourcesClient("", cred, nil) + client, err := armdeploymentmanager.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.CreateOrUpdate(ctx, "", "", &armdeploymentmanager.ArtifactSourcesClientCreateOrUpdateOptions{ArtifactSourceInfo: &armdeploymentmanager.ArtifactSource{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{}, Properties: &armdeploymentmanager.ArtifactSourceProperties{ Authentication: &armdeploymentmanager.SasAuthentication{ - Type: to.StringPtr(""), + Type: to.Ptr(""), Properties: &armdeploymentmanager.SasProperties{ - SasURI: to.StringPtr(""), + SasURI: to.Ptr(""), }, }, - SourceType: to.StringPtr(""), + SourceType: to.Ptr(""), }, }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_get.json func ExampleArtifactSourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewArtifactSourcesClient("", cred, nil) + client, err := armdeploymentmanager.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ArtifactSourcesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsource_delete.json func ExampleArtifactSourcesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewArtifactSourcesClient("", cred, nil) + client, err := armdeploymentmanager.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsources_list.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/artifactsources_list.json func ExampleArtifactSourcesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewArtifactSourcesClient("", cred, nil) + client, err := armdeploymentmanager.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.List(ctx, "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ArtifactSourcesClientListResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_operations_client_test.go index 68212f07bd7f..c773dcab907b 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_operations_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,18 +16,25 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deploymentmanager/armdeploymentmanager" ) -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/operations_list.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/operations_list.json func ExampleOperationsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewOperationsClient(cred, nil) + client, err := armdeploymentmanager.NewOperationsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.List(ctx, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.OperationsClientListResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_rollouts_client_test.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_rollouts_client_test.go index 736afeae81d1..3bcebf53cf07 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_rollouts_client_test.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_rollouts_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,158 +19,200 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deploymentmanager/armdeploymentmanager" ) -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_createorupdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_createorupdate.json func ExampleRolloutsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewRolloutsClient("", cred, nil) + client, err := armdeploymentmanager.NewRolloutsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", &armdeploymentmanager.RolloutsClientBeginCreateOrUpdateOptions{RolloutRequest: &armdeploymentmanager.RolloutRequest{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{}, Identity: &armdeploymentmanager.Identity{ - Type: to.StringPtr(""), + Type: to.Ptr(""), IdentityIDs: []*string{ - to.StringPtr("/subscriptions/caac1590-e859-444f-a9e0-62091c0f5929/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userassignedidentities/myuseridentity")}, + to.Ptr("/subscriptions/caac1590-e859-444f-a9e0-62091c0f5929/resourceGroups/myResourceGroup/providers/Microsoft.ManagedIdentity/userassignedidentities/myuseridentity")}, }, Properties: &armdeploymentmanager.RolloutRequestProperties{ - ArtifactSourceID: to.StringPtr(""), - BuildVersion: to.StringPtr(""), + ArtifactSourceID: to.Ptr(""), + BuildVersion: to.Ptr(""), StepGroups: []*armdeploymentmanager.StepGroup{ { - Name: to.StringPtr(""), - DeploymentTargetID: to.StringPtr(""), + Name: to.Ptr(""), + DeploymentTargetID: to.Ptr(""), PostDeploymentSteps: []*armdeploymentmanager.PrePostStep{ { - StepID: to.StringPtr(""), + StepID: to.Ptr(""), }}, PreDeploymentSteps: []*armdeploymentmanager.PrePostStep{ { - StepID: to.StringPtr(""), + StepID: to.Ptr(""), }, { - StepID: to.StringPtr(""), + StepID: to.Ptr(""), }}, }, { - Name: to.StringPtr(""), + Name: to.Ptr(""), DependsOnStepGroups: []*string{ - to.StringPtr("FirstRegion")}, - DeploymentTargetID: to.StringPtr(""), + to.Ptr("FirstRegion")}, + DeploymentTargetID: to.Ptr(""), PostDeploymentSteps: []*armdeploymentmanager.PrePostStep{ { - StepID: to.StringPtr(""), + StepID: to.Ptr(""), }}, PreDeploymentSteps: []*armdeploymentmanager.PrePostStep{ { - StepID: to.StringPtr(""), + StepID: to.Ptr(""), }, { - StepID: to.StringPtr(""), + StepID: to.Ptr(""), }}, }}, - TargetServiceTopologyID: to.StringPtr(""), + TargetServiceTopologyID: to.Ptr(""), }, }, + ResumeToken: "", }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_get.json func ExampleRolloutsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewRolloutsClient("", cred, nil) + client, err := armdeploymentmanager.NewRolloutsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", &armdeploymentmanager.RolloutsClientGetOptions{RetryAttempt: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.RolloutsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_delete.json func ExampleRolloutsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewRolloutsClient("", cred, nil) + client, err := armdeploymentmanager.NewRolloutsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_post_cancel.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_post_cancel.json func ExampleRolloutsClient_Cancel() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewRolloutsClient("", cred, nil) + client, err := armdeploymentmanager.NewRolloutsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Cancel(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.RolloutsClientCancelResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_post_restart.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollout_post_restart.json func ExampleRolloutsClient_Restart() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewRolloutsClient("", cred, nil) + client, err := armdeploymentmanager.NewRolloutsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Restart(ctx, "", "", - &armdeploymentmanager.RolloutsClientRestartOptions{SkipSucceeded: to.BoolPtr(true)}) + &armdeploymentmanager.RolloutsClientRestartOptions{SkipSucceeded: to.Ptr(true)}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.RolloutsClientRestartResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollouts_list.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/rollouts_list.json func ExampleRolloutsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewRolloutsClient("", cred, nil) + client, err := armdeploymentmanager.NewRolloutsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.List(ctx, "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.RolloutsClientListResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_services_client_test.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_services_client_test.go index cc7c5a92bec3..042c168a5184 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_services_client_test.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_services_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,83 +17,109 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deploymentmanager/armdeploymentmanager" ) -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_createorupdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_createorupdate.json func ExampleServicesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServicesClient("", cred, nil) + client, err := armdeploymentmanager.NewServicesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.CreateOrUpdate(ctx, "", "", "", armdeploymentmanager.ServiceResource{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{}, Properties: &armdeploymentmanager.ServiceResourceProperties{ - TargetLocation: to.StringPtr(""), - TargetSubscriptionID: to.StringPtr(""), + TargetLocation: to.Ptr(""), + TargetSubscriptionID: to.Ptr(""), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_get.json func ExampleServicesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServicesClient("", cred, nil) + client, err := armdeploymentmanager.NewServicesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ServicesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/service_delete.json func ExampleServicesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServicesClient("", cred, nil) + client, err := armdeploymentmanager.NewServicesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/services_list.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/services_list.json func ExampleServicesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServicesClient("", cred, nil) + client, err := armdeploymentmanager.NewServicesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.List(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ServicesClientListResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_servicetopologies_client_test.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_servicetopologies_client_test.go index 6068fe793ef0..003c1852c853 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_servicetopologies_client_test.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_servicetopologies_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,78 +17,104 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deploymentmanager/armdeploymentmanager" ) -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_createorupdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_createorupdate.json func ExampleServiceTopologiesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServiceTopologiesClient("", cred, nil) + client, err := armdeploymentmanager.NewServiceTopologiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.CreateOrUpdate(ctx, "", "", armdeploymentmanager.ServiceTopologyResource{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{}, Properties: &armdeploymentmanager.ServiceTopologyResourceProperties{ - ArtifactSourceID: to.StringPtr(""), + ArtifactSourceID: to.Ptr(""), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_get.json func ExampleServiceTopologiesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServiceTopologiesClient("", cred, nil) + client, err := armdeploymentmanager.NewServiceTopologiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ServiceTopologiesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopology_delete.json func ExampleServiceTopologiesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServiceTopologiesClient("", cred, nil) + client, err := armdeploymentmanager.NewServiceTopologiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopologies_list.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/servicetopologies_list.json func ExampleServiceTopologiesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServiceTopologiesClient("", cred, nil) + client, err := armdeploymentmanager.NewServiceTopologiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.List(ctx, "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ServiceTopologiesClientListResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_serviceunits_client_test.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_serviceunits_client_test.go index bd31b9642be2..05511da9652a 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_serviceunits_client_test.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_serviceunits_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,49 +19,61 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deploymentmanager/armdeploymentmanager" ) -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_createorupdate_noartifactsource.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_createorupdate_noartifactsource.json func ExampleServiceUnitsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServiceUnitsClient("", cred, nil) + client, err := armdeploymentmanager.NewServiceUnitsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", "", "", armdeploymentmanager.ServiceUnitResource{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{}, Properties: &armdeploymentmanager.ServiceUnitResourceProperties{ Artifacts: &armdeploymentmanager.ServiceUnitArtifacts{ - ParametersURI: to.StringPtr(""), - TemplateURI: to.StringPtr(""), + ParametersURI: to.Ptr(""), + TemplateURI: to.Ptr(""), }, - DeploymentMode: armdeploymentmanager.DeploymentModeIncremental.ToPtr(), - TargetResourceGroup: to.StringPtr(""), + DeploymentMode: to.Ptr(armdeploymentmanager.DeploymentModeIncremental), + TargetResourceGroup: to.Ptr(""), }, }, - nil) + &armdeploymentmanager.ServiceUnitsClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_get.json func ExampleServiceUnitsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServiceUnitsClient("", cred, nil) + client, err := armdeploymentmanager.NewServiceUnitsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", @@ -69,19 +81,26 @@ func ExampleServiceUnitsClient_Get() { "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ServiceUnitsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunit_delete.json func ExampleServiceUnitsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServiceUnitsClient("", cred, nil) + client, err := armdeploymentmanager.NewServiceUnitsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", @@ -89,25 +108,33 @@ func ExampleServiceUnitsClient_Delete() { "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunits_list.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/serviceunits_list.json func ExampleServiceUnitsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewServiceUnitsClient("", cred, nil) + client, err := armdeploymentmanager.NewServiceUnitsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.List(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ServiceUnitsClientListResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_steps_client_test.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_steps_client_test.go index 3981caf25af7..61f4e6f4fbd4 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_steps_client_test.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/ze_generated_example_steps_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,74 +17,79 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deploymentmanager/armdeploymentmanager" ) -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_health_check_createorupdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_health_check_createorupdate.json func ExampleStepsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewStepsClient("", cred, nil) + client, err := armdeploymentmanager.NewStepsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.CreateOrUpdate(ctx, "", "", &armdeploymentmanager.StepsClientCreateOrUpdateOptions{StepInfo: &armdeploymentmanager.StepResource{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{}, Properties: &armdeploymentmanager.HealthCheckStepProperties{ - StepType: armdeploymentmanager.StepTypeHealthCheck.ToPtr(), + StepType: to.Ptr(armdeploymentmanager.StepTypeHealthCheck), Attributes: &armdeploymentmanager.RestHealthCheckStepAttributes{ - Type: to.StringPtr(""), - HealthyStateDuration: to.StringPtr(""), - MaxElasticDuration: to.StringPtr(""), - WaitDuration: to.StringPtr(""), + Type: to.Ptr(""), + HealthyStateDuration: to.Ptr(""), + MaxElasticDuration: to.Ptr(""), + WaitDuration: to.Ptr(""), Properties: &armdeploymentmanager.RestParameters{ HealthChecks: []*armdeploymentmanager.RestHealthCheck{ { - Name: to.StringPtr(""), + Name: to.Ptr(""), Response: &armdeploymentmanager.RestResponse{ Regex: &armdeploymentmanager.RestResponseRegex{ - MatchQuantifier: armdeploymentmanager.RestMatchQuantifierAll.ToPtr(), + MatchQuantifier: to.Ptr(armdeploymentmanager.RestMatchQuantifierAll), Matches: []*string{ - to.StringPtr("(?i)Contoso-App"), - to.StringPtr("(?i)\"health_status\":((.|\n)*)\"(green|yellow)\""), - to.StringPtr("(?mi)^(\"application_host\": 94781052)$")}, + to.Ptr("(?i)Contoso-App"), + to.Ptr("(?i)\"health_status\":((.|\n)*)\"(green|yellow)\""), + to.Ptr("(?mi)^(\"application_host\": 94781052)$")}, }, SuccessStatusCodes: []*string{ - to.StringPtr("OK")}, + to.Ptr("OK")}, }, Request: &armdeploymentmanager.RestRequest{ - Method: armdeploymentmanager.RestRequestMethodGET.ToPtr(), + Method: to.Ptr(armdeploymentmanager.RestRequestMethodGET), Authentication: &armdeploymentmanager.APIKeyAuthentication{ - Type: armdeploymentmanager.RestAuthTypeAPIKey.ToPtr(), - Name: to.StringPtr(""), - In: armdeploymentmanager.RestAuthLocationQuery.ToPtr(), - Value: to.StringPtr(""), + Type: to.Ptr(armdeploymentmanager.RestAuthTypeAPIKey), + Name: to.Ptr(""), + In: to.Ptr(armdeploymentmanager.RestAuthLocationQuery), + Value: to.Ptr(""), }, - URI: to.StringPtr(""), + URI: to.Ptr(""), }, }, { - Name: to.StringPtr(""), + Name: to.Ptr(""), Response: &armdeploymentmanager.RestResponse{ Regex: &armdeploymentmanager.RestResponseRegex{ - MatchQuantifier: armdeploymentmanager.RestMatchQuantifierAll.ToPtr(), + MatchQuantifier: to.Ptr(armdeploymentmanager.RestMatchQuantifierAll), Matches: []*string{ - to.StringPtr("(?i)Contoso-Service-EndToEnd"), - to.StringPtr("(?i)\"health_status\":((.|\n)*)\"(green)\"")}, + to.Ptr("(?i)Contoso-Service-EndToEnd"), + to.Ptr("(?i)\"health_status\":((.|\n)*)\"(green)\"")}, }, SuccessStatusCodes: []*string{ - to.StringPtr("OK")}, + to.Ptr("OK")}, }, Request: &armdeploymentmanager.RestRequest{ - Method: armdeploymentmanager.RestRequestMethodGET.ToPtr(), + Method: to.Ptr(armdeploymentmanager.RestRequestMethodGET), Authentication: &armdeploymentmanager.APIKeyAuthentication{ - Type: armdeploymentmanager.RestAuthTypeAPIKey.ToPtr(), - Name: to.StringPtr(""), - In: armdeploymentmanager.RestAuthLocationHeader.ToPtr(), - Value: to.StringPtr(""), + Type: to.Ptr(armdeploymentmanager.RestAuthTypeAPIKey), + Name: to.Ptr(""), + In: to.Ptr(armdeploymentmanager.RestAuthLocationHeader), + Value: to.Ptr(""), }, - URI: to.StringPtr(""), + URI: to.Ptr(""), }, }}, }, @@ -93,58 +98,79 @@ func ExampleStepsClient_CreateOrUpdate() { }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_get.json func ExampleStepsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewStepsClient("", cred, nil) + client, err := armdeploymentmanager.NewStepsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.StepsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/step_delete.json func ExampleStepsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewStepsClient("", cred, nil) + client, err := armdeploymentmanager.NewStepsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/steps_list.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deploymentmanager/resource-manager/Microsoft.DeploymentManager/preview/2019-11-01-preview/examples/steps_list.json func ExampleStepsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeploymentmanager.NewStepsClient("", cred, nil) + client, err := armdeploymentmanager.NewStepsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.List(ctx, "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.StepsClientListResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_artifactsources_client.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_artifactsources_client.go index 286a22b274ee..385e856d1d2b 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_artifactsources_client.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_artifactsources_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -34,20 +35,24 @@ type ArtifactSourcesClient struct { // 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 NewArtifactSourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ArtifactSourcesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewArtifactSourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ArtifactSourcesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &ArtifactSourcesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Synchronously creates a new artifact source or updates an existing artifact source. @@ -102,7 +107,7 @@ func (client *ArtifactSourcesClient) createOrUpdateCreateRequest(ctx context.Con // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *ArtifactSourcesClient) createOrUpdateHandleResponse(resp *http.Response) (ArtifactSourcesClientCreateOrUpdateResponse, error) { - result := ArtifactSourcesClientCreateOrUpdateResponse{RawResponse: resp} + result := ArtifactSourcesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactSource); err != nil { return ArtifactSourcesClientCreateOrUpdateResponse{}, err } @@ -126,7 +131,7 @@ func (client *ArtifactSourcesClient) Delete(ctx context.Context, resourceGroupNa if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ArtifactSourcesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ArtifactSourcesClientDeleteResponse{RawResponse: resp}, nil + return ArtifactSourcesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -203,7 +208,7 @@ func (client *ArtifactSourcesClient) getCreateRequest(ctx context.Context, resou // getHandleResponse handles the Get response. func (client *ArtifactSourcesClient) getHandleResponse(resp *http.Response) (ArtifactSourcesClientGetResponse, error) { - result := ArtifactSourcesClientGetResponse{RawResponse: resp} + result := ArtifactSourcesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactSource); err != nil { return ArtifactSourcesClientGetResponse{}, err } @@ -253,7 +258,7 @@ func (client *ArtifactSourcesClient) listCreateRequest(ctx context.Context, reso // listHandleResponse handles the List response. func (client *ArtifactSourcesClient) listHandleResponse(resp *http.Response) (ArtifactSourcesClientListResponse, error) { - result := ArtifactSourcesClientListResponse{RawResponse: resp} + result := ArtifactSourcesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ArtifactSourceArray); err != nil { return ArtifactSourcesClientListResponse{}, err } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_constants.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_constants.go index 2ebf0411a1ab..f5bd386547fe 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_constants.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -10,7 +10,7 @@ package armdeploymentmanager const ( moduleName = "armdeploymentmanager" - moduleVersion = "v0.2.1" + moduleVersion = "v0.3.0" ) // DeploymentMode - Describes the type of ARM deployment to be performed on the resource. @@ -29,11 +29,6 @@ func PossibleDeploymentModeValues() []DeploymentMode { } } -// ToPtr returns a *DeploymentMode pointing to the current value. -func (c DeploymentMode) ToPtr() *DeploymentMode { - return &c -} - // RestAuthLocation - The location of the authentication key/value pair in the request. type RestAuthLocation string @@ -50,11 +45,6 @@ func PossibleRestAuthLocationValues() []RestAuthLocation { } } -// ToPtr returns a *RestAuthLocation pointing to the current value. -func (c RestAuthLocation) ToPtr() *RestAuthLocation { - return &c -} - // RestAuthType - The authentication type. type RestAuthType string @@ -71,11 +61,6 @@ func PossibleRestAuthTypeValues() []RestAuthType { } } -// ToPtr returns a *RestAuthType pointing to the current value. -func (c RestAuthType) ToPtr() *RestAuthType { - return &c -} - // RestMatchQuantifier - Indicates whether any or all of the expressions should match with the response content. type RestMatchQuantifier string @@ -92,11 +77,6 @@ func PossibleRestMatchQuantifierValues() []RestMatchQuantifier { } } -// ToPtr returns a *RestMatchQuantifier pointing to the current value. -func (c RestMatchQuantifier) ToPtr() *RestMatchQuantifier { - return &c -} - // RestRequestMethod - The HTTP method to use for the request. type RestRequestMethod string @@ -113,11 +93,6 @@ func PossibleRestRequestMethodValues() []RestRequestMethod { } } -// ToPtr returns a *RestRequestMethod pointing to the current value. -func (c RestRequestMethod) ToPtr() *RestRequestMethod { - return &c -} - // StepType - The type of step. type StepType string @@ -133,8 +108,3 @@ func PossibleStepTypeValues() []StepType { StepTypeHealthCheck, } } - -// ToPtr returns a *StepType pointing to the current value. -func (c StepType) ToPtr() *StepType { - return &c -} diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_models.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_models.go index 38bfdc512032..d8a7b4d58844 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_models.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,12 +8,7 @@ package armdeploymentmanager -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "time" -) +import "time" // APIKeyAuthentication - ApiKey authentication gives a name and a value that can be included in either the request header // or query parameters. @@ -31,52 +26,6 @@ type APIKeyAuthentication struct { Value *string `json:"value,omitempty"` } -// GetRestRequestAuthentication implements the RestRequestAuthenticationClassification interface for type APIKeyAuthentication. -func (a *APIKeyAuthentication) GetRestRequestAuthentication() *RestRequestAuthentication { - return &RestRequestAuthentication{ - Type: a.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type APIKeyAuthentication. -func (a APIKeyAuthentication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "in", a.In) - populate(objectMap, "name", a.Name) - objectMap["type"] = RestAuthTypeAPIKey - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type APIKeyAuthentication. -func (a *APIKeyAuthentication) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "in": - err = unpopulate(val, &a.In) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &a.Name) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &a.Type) - delete(rawMsg, key) - case "value": - err = unpopulate(val, &a.Value) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ArtifactSource - The resource that defines the source location where the artifacts are located. type ArtifactSource struct { // REQUIRED; The geo-location where the resource lives @@ -98,18 +47,6 @@ type ArtifactSource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ArtifactSource. -func (a ArtifactSource) 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) -} - // ArtifactSourceProperties - The properties that define the artifact source. type ArtifactSourceProperties struct { // REQUIRED; The authentication method to use to access the artifact source. @@ -126,41 +63,6 @@ type ArtifactSourceProperties struct { ArtifactRoot *string `json:"artifactRoot,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ArtifactSourceProperties. -func (a ArtifactSourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "artifactRoot", a.ArtifactRoot) - populate(objectMap, "authentication", a.Authentication) - populate(objectMap, "sourceType", a.SourceType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceProperties. -func (a *ArtifactSourceProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactRoot": - err = unpopulate(val, &a.ArtifactRoot) - delete(rawMsg, key) - case "authentication": - a.Authentication, err = unmarshalAuthenticationClassification(val) - delete(rawMsg, key) - case "sourceType": - err = unpopulate(val, &a.SourceType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ArtifactSourcePropertiesAutoGenerated - The properties that define the source location where the artifacts are located. type ArtifactSourcePropertiesAutoGenerated struct { // REQUIRED; The authentication method to use to access the artifact source. @@ -177,41 +79,6 @@ type ArtifactSourcePropertiesAutoGenerated struct { ArtifactRoot *string `json:"artifactRoot,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ArtifactSourcePropertiesAutoGenerated. -func (a ArtifactSourcePropertiesAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "artifactRoot", a.ArtifactRoot) - populate(objectMap, "authentication", a.Authentication) - populate(objectMap, "sourceType", a.SourceType) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourcePropertiesAutoGenerated. -func (a *ArtifactSourcePropertiesAutoGenerated) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "artifactRoot": - err = unpopulate(val, &a.ArtifactRoot) - delete(rawMsg, key) - case "authentication": - a.Authentication, err = unmarshalAuthenticationClassification(val) - delete(rawMsg, key) - case "sourceType": - err = unpopulate(val, &a.SourceType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ArtifactSourcesClientCreateOrUpdateOptions contains the optional parameters for the ArtifactSourcesClient.CreateOrUpdate // method. type ArtifactSourcesClientCreateOrUpdateOptions struct { @@ -249,9 +116,6 @@ type Authentication struct { Type *string `json:"type,omitempty"` } -// GetAuthentication implements the AuthenticationClassification interface for type Authentication. -func (a *Authentication) GetAuthentication() *Authentication { return a } - // CloudError - The error information object. type CloudError struct { // The properties that define the error. @@ -273,16 +137,6 @@ type CloudErrorBody struct { Message *string `json:"message,omitempty" azure:"ro"` } -// 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) -} - // HealthCheckStepAttributesClassification provides polymorphic access to related types. // Call the interface's GetHealthCheckStepAttributes() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -311,11 +165,6 @@ type HealthCheckStepAttributes struct { WaitDuration *string `json:"waitDuration,omitempty"` } -// GetHealthCheckStepAttributes implements the HealthCheckStepAttributesClassification interface for type HealthCheckStepAttributes. -func (h *HealthCheckStepAttributes) GetHealthCheckStepAttributes() *HealthCheckStepAttributes { - return h -} - // HealthCheckStepProperties - Defines the properties of a health check step. type HealthCheckStepProperties struct { // REQUIRED; The health check step attributes @@ -325,44 +174,6 @@ type HealthCheckStepProperties struct { StepType *StepType `json:"stepType,omitempty"` } -// GetStepProperties implements the StepPropertiesClassification interface for type HealthCheckStepProperties. -func (h *HealthCheckStepProperties) GetStepProperties() *StepProperties { - return &StepProperties{ - StepType: h.StepType, - } -} - -// MarshalJSON implements the json.Marshaller interface for type HealthCheckStepProperties. -func (h HealthCheckStepProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "attributes", h.Attributes) - objectMap["stepType"] = StepTypeHealthCheck - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheckStepProperties. -func (h *HealthCheckStepProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "attributes": - h.Attributes, err = unmarshalHealthCheckStepAttributesClassification(val) - delete(rawMsg, key) - case "stepType": - err = unpopulate(val, &h.StepType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Identity for the resource. type Identity struct { // REQUIRED; The list of identities. @@ -372,14 +183,6 @@ type Identity struct { Type *string `json:"type,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type Identity. -func (i Identity) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identityIds", i.IdentityIDs) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - // Message - Supplementary contextual messages during a rollout. type Message struct { // READ-ONLY; The actual message text. @@ -389,37 +192,6 @@ type Message struct { TimeStamp *time.Time `json:"timeStamp,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Message. -func (m Message) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "message", m.Message) - populateTimeRFC3339(objectMap, "timeStamp", m.TimeStamp) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type Message. -func (m *Message) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "message": - err = unpopulate(val, &m.Message) - delete(rawMsg, key) - case "timeStamp": - err = unpopulateTimeRFC3339(val, &m.TimeStamp) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Operation - Represents an operation that can be performed on the service. type Operation struct { // The display name of the operation. @@ -432,7 +204,7 @@ type Operation struct { Origin *string `json:"origin,omitempty"` // The properties of the operation. - Properties map[string]interface{} `json:"properties,omitempty"` + Properties interface{} `json:"properties,omitempty"` } // OperationDetail - The detail about an operation. @@ -537,72 +309,12 @@ type RestHealthCheckStepAttributes struct { WaitDuration *string `json:"waitDuration,omitempty"` } -// GetHealthCheckStepAttributes implements the HealthCheckStepAttributesClassification interface for type RestHealthCheckStepAttributes. -func (r *RestHealthCheckStepAttributes) GetHealthCheckStepAttributes() *HealthCheckStepAttributes { - return &HealthCheckStepAttributes{ - Type: r.Type, - WaitDuration: r.WaitDuration, - MaxElasticDuration: r.MaxElasticDuration, - HealthyStateDuration: r.HealthyStateDuration, - } -} - -// MarshalJSON implements the json.Marshaller interface for type RestHealthCheckStepAttributes. -func (r RestHealthCheckStepAttributes) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "healthyStateDuration", r.HealthyStateDuration) - populate(objectMap, "maxElasticDuration", r.MaxElasticDuration) - populate(objectMap, "properties", r.Properties) - objectMap["type"] = "REST" - populate(objectMap, "waitDuration", r.WaitDuration) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestHealthCheckStepAttributes. -func (r *RestHealthCheckStepAttributes) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "healthyStateDuration": - err = unpopulate(val, &r.HealthyStateDuration) - delete(rawMsg, key) - case "maxElasticDuration": - err = unpopulate(val, &r.MaxElasticDuration) - delete(rawMsg, key) - case "properties": - err = unpopulate(val, &r.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &r.Type) - delete(rawMsg, key) - case "waitDuration": - err = unpopulate(val, &r.WaitDuration) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RestParameters - The parameters for the REST health check. type RestParameters struct { // REQUIRED; The list of checks that form the health check step. HealthChecks []*RestHealthCheck `json:"healthChecks,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RestParameters. -func (r RestParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "healthChecks", r.HealthChecks) - return json.Marshal(objectMap) -} - // RestRequest - The properties that make up a REST request type RestRequest struct { // REQUIRED; The authentication information required in the request to the health provider. @@ -615,41 +327,6 @@ type RestRequest struct { URI *string `json:"uri,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RestRequest. -func (r RestRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authentication", r.Authentication) - populate(objectMap, "method", r.Method) - populate(objectMap, "uri", r.URI) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RestRequest. -func (r *RestRequest) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "authentication": - r.Authentication, err = unmarshalRestRequestAuthenticationClassification(val) - delete(rawMsg, key) - case "method": - err = unpopulate(val, &r.Method) - delete(rawMsg, key) - case "uri": - err = unpopulate(val, &r.URI) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RestRequestAuthenticationClassification provides polymorphic access to related types. // Call the interface's GetRestRequestAuthentication() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -665,11 +342,6 @@ type RestRequestAuthentication struct { Type *RestAuthType `json:"type,omitempty"` } -// GetRestRequestAuthentication implements the RestRequestAuthenticationClassification interface for type RestRequestAuthentication. -func (r *RestRequestAuthentication) GetRestRequestAuthentication() *RestRequestAuthentication { - return r -} - // RestResponse - The properties that make up the expected REST response type RestResponse struct { // The regular expressions to match the response content with. @@ -681,14 +353,6 @@ type RestResponse struct { SuccessStatusCodes []*string `json:"successStatusCodes,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RestResponse. -func (r RestResponse) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "regex", r.Regex) - populate(objectMap, "successStatusCodes", r.SuccessStatusCodes) - return json.Marshal(objectMap) -} - // RestResponseRegex - The regular expressions to match the response content with. type RestResponseRegex struct { // Indicates whether any or all of the expressions should match with the response content. @@ -698,14 +362,6 @@ type RestResponseRegex struct { Matches []*string `json:"matches,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RestResponseRegex. -func (r RestResponseRegex) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "matchQuantifier", r.MatchQuantifier) - populate(objectMap, "matches", r.Matches) - return json.Marshal(objectMap) -} - // Rollout - Defines the rollout. type Rollout struct { // REQUIRED; The geo-location where the resource lives @@ -730,19 +386,6 @@ type Rollout struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Rollout. -func (r Rollout) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "identity", r.Identity) - 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) -} - // RolloutIdentityAuthentication - RolloutIdentity uses the user-assigned managed identity authentication context specified // in the Identity property during rollout creation. type RolloutIdentityAuthentication struct { @@ -750,40 +393,6 @@ type RolloutIdentityAuthentication struct { Type *RestAuthType `json:"type,omitempty"` } -// GetRestRequestAuthentication implements the RestRequestAuthenticationClassification interface for type RolloutIdentityAuthentication. -func (r *RolloutIdentityAuthentication) GetRestRequestAuthentication() *RestRequestAuthentication { - return &RestRequestAuthentication{ - Type: r.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type RolloutIdentityAuthentication. -func (r RolloutIdentityAuthentication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - objectMap["type"] = RestAuthTypeRolloutIdentity - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RolloutIdentityAuthentication. -func (r *RolloutIdentityAuthentication) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "type": - err = unpopulate(val, &r.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RolloutOperationInfo - Detailed runtime information of the rollout. type RolloutOperationInfo struct { // READ-ONLY; The start time of the rollout in UTC. This property will not be set if the rollout has not completed yet. @@ -804,49 +413,6 @@ type RolloutOperationInfo struct { StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RolloutOperationInfo. -func (r RolloutOperationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "endTime", r.EndTime) - populate(objectMap, "error", r.Error) - populate(objectMap, "retryAttempt", r.RetryAttempt) - populate(objectMap, "skipSucceededOnRetry", r.SkipSucceededOnRetry) - populateTimeRFC3339(objectMap, "startTime", r.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RolloutOperationInfo. -func (r *RolloutOperationInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "endTime": - err = unpopulateTimeRFC3339(val, &r.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, &r.Error) - delete(rawMsg, key) - case "retryAttempt": - err = unpopulate(val, &r.RetryAttempt) - delete(rawMsg, key) - case "skipSucceededOnRetry": - err = unpopulate(val, &r.SkipSucceededOnRetry) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &r.StartTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RolloutProperties - The properties that define a rollout. type RolloutProperties struct { // REQUIRED; The version of the build being deployed. @@ -874,20 +440,6 @@ type RolloutProperties struct { TotalRetryAttempts *int32 `json:"totalRetryAttempts,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RolloutProperties. -func (r RolloutProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "artifactSourceId", r.ArtifactSourceID) - populate(objectMap, "buildVersion", r.BuildVersion) - populate(objectMap, "operationInfo", r.OperationInfo) - populate(objectMap, "services", r.Services) - populate(objectMap, "status", r.Status) - populate(objectMap, "stepGroups", r.StepGroups) - populate(objectMap, "targetServiceTopologyId", r.TargetServiceTopologyID) - populate(objectMap, "totalRetryAttempts", r.TotalRetryAttempts) - return json.Marshal(objectMap) -} - // RolloutPropertiesAutoGenerated - Defines the properties of a rollout. type RolloutPropertiesAutoGenerated struct { // READ-ONLY; Operational information of the rollout. @@ -903,16 +455,6 @@ type RolloutPropertiesAutoGenerated struct { TotalRetryAttempts *int32 `json:"totalRetryAttempts,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RolloutPropertiesAutoGenerated. -func (r RolloutPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "operationInfo", r.OperationInfo) - populate(objectMap, "services", r.Services) - populate(objectMap, "status", r.Status) - populate(objectMap, "totalRetryAttempts", r.TotalRetryAttempts) - return json.Marshal(objectMap) -} - // RolloutRequest - Defines the PUT rollout request body. type RolloutRequest struct { // REQUIRED; Identity for the resource. @@ -937,19 +479,6 @@ type RolloutRequest struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RolloutRequest. -func (r RolloutRequest) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", r.ID) - populate(objectMap, "identity", r.Identity) - 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) -} - // RolloutRequestProperties - The properties for defining a rollout. type RolloutRequestProperties struct { // REQUIRED; The version of the build being deployed. @@ -965,16 +494,6 @@ type RolloutRequestProperties struct { ArtifactSourceID *string `json:"artifactSourceId,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RolloutRequestProperties. -func (r RolloutRequestProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "artifactSourceId", r.ArtifactSourceID) - populate(objectMap, "buildVersion", r.BuildVersion) - populate(objectMap, "stepGroups", r.StepGroups) - populate(objectMap, "targetServiceTopologyId", r.TargetServiceTopologyID) - return json.Marshal(objectMap) -} - // RolloutStep - Defines a specific step on a target service unit. type RolloutStep struct { // REQUIRED; Name of the step. @@ -996,20 +515,10 @@ type RolloutStep struct { Status *string `json:"status,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type RolloutStep. -func (r RolloutStep) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "messages", r.Messages) - populate(objectMap, "name", r.Name) - populate(objectMap, "operationInfo", r.OperationInfo) - populate(objectMap, "resourceOperations", r.ResourceOperations) - populate(objectMap, "status", r.Status) - populate(objectMap, "stepGroup", r.StepGroup) - return json.Marshal(objectMap) -} - // RolloutsClientBeginCreateOrUpdateOptions contains the optional parameters for the RolloutsClient.BeginCreateOrUpdate method. type RolloutsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string // Source rollout request object that defines the rollout. RolloutRequest *RolloutRequest } @@ -1052,44 +561,6 @@ type SasAuthentication struct { Properties *SasProperties `json:"properties,omitempty"` } -// GetAuthentication implements the AuthenticationClassification interface for type SasAuthentication. -func (s *SasAuthentication) GetAuthentication() *Authentication { - return &Authentication{ - Type: s.Type, - } -} - -// MarshalJSON implements the json.Marshaller interface for type SasAuthentication. -func (s SasAuthentication) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - objectMap["type"] = "Sas" - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SasAuthentication. -func (s *SasAuthentication) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "properties": - err = unpopulate(val, &s.Properties) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &s.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SasProperties - The properties that define SAS authentication. type SasProperties struct { // REQUIRED; The SAS URI to the Azure Storage blob container. Any offset from the root of the container to where the artifacts @@ -1112,16 +583,6 @@ type Service struct { ServiceUnits []*ServiceUnit `json:"serviceUnits,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type Service. -func (s Service) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "name", s.Name) - populate(objectMap, "serviceUnits", s.ServiceUnits) - populate(objectMap, "targetLocation", s.TargetLocation) - populate(objectMap, "targetSubscriptionId", s.TargetSubscriptionID) - return json.Marshal(objectMap) -} - // ServiceProperties - The properties of a service. type ServiceProperties struct { // REQUIRED; The Azure location to which the resources in the service belong to or should be deployed to. @@ -1152,18 +613,6 @@ type ServiceResource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ServiceResource. -func (s ServiceResource) 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) -} - // ServiceResourceProperties - The properties that define a service in a service topology. type ServiceResourceProperties struct { // REQUIRED; The Azure location to which the resources in the service belong to or should be deployed to. @@ -1221,18 +670,6 @@ type ServiceTopologyResource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ServiceTopologyResource. -func (s ServiceTopologyResource) 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) -} - // ServiceTopologyResourceProperties - The properties that define the service topology. type ServiceTopologyResourceProperties struct { // The resource Id of the artifact source that contains the artifacts that can be referenced in the service units. @@ -1257,17 +694,6 @@ type ServiceUnit struct { Steps []*RolloutStep `json:"steps,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ServiceUnit. -func (s ServiceUnit) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "artifacts", s.Artifacts) - populate(objectMap, "deploymentMode", s.DeploymentMode) - populate(objectMap, "name", s.Name) - populate(objectMap, "steps", s.Steps) - populate(objectMap, "targetResourceGroup", s.TargetResourceGroup) - return json.Marshal(objectMap) -} - // ServiceUnitArtifacts - Defines the artifacts of a service unit. type ServiceUnitArtifacts struct { // The path to the ARM parameters file relative to the artifact source. @@ -1316,18 +742,6 @@ type ServiceUnitResource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ServiceUnitResource. -func (s ServiceUnitResource) 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) -} - // ServiceUnitResourceProperties - The properties that define the service unit. type ServiceUnitResourceProperties struct { // REQUIRED; Describes the type of ARM deployment to be performed on the resource. @@ -1343,7 +757,8 @@ type ServiceUnitResourceProperties struct { // ServiceUnitsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceUnitsClient.BeginCreateOrUpdate // method. type ServiceUnitsClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // ServiceUnitsClientDeleteOptions contains the optional parameters for the ServiceUnitsClient.Delete method. @@ -1400,17 +815,6 @@ type StepGroup struct { PreDeploymentSteps []*PrePostStep `json:"preDeploymentSteps,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type StepGroup. -func (s StepGroup) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "dependsOnStepGroups", s.DependsOnStepGroups) - populate(objectMap, "deploymentTargetId", s.DeploymentTargetID) - populate(objectMap, "name", s.Name) - populate(objectMap, "postDeploymentSteps", s.PostDeploymentSteps) - populate(objectMap, "preDeploymentSteps", s.PreDeploymentSteps) - return json.Marshal(objectMap) -} - // StepOperationInfo - Detailed information of a specific step run. type StepOperationInfo struct { // The errors, if any, for the action. @@ -1432,53 +836,6 @@ type StepOperationInfo struct { StartTime *time.Time `json:"startTime,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type StepOperationInfo. -func (s StepOperationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "correlationId", s.CorrelationID) - populate(objectMap, "deploymentName", s.DeploymentName) - populateTimeRFC3339(objectMap, "endTime", s.EndTime) - populate(objectMap, "error", s.Error) - populateTimeRFC3339(objectMap, "lastUpdatedTime", s.LastUpdatedTime) - populateTimeRFC3339(objectMap, "startTime", s.StartTime) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StepOperationInfo. -func (s *StepOperationInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "correlationId": - err = unpopulate(val, &s.CorrelationID) - delete(rawMsg, key) - case "deploymentName": - err = unpopulate(val, &s.DeploymentName) - delete(rawMsg, key) - case "endTime": - err = unpopulateTimeRFC3339(val, &s.EndTime) - delete(rawMsg, key) - case "error": - err = unpopulate(val, &s.Error) - delete(rawMsg, key) - case "lastUpdatedTime": - err = unpopulateTimeRFC3339(val, &s.LastUpdatedTime) - delete(rawMsg, key) - case "startTime": - err = unpopulateTimeRFC3339(val, &s.StartTime) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // StepPropertiesClassification provides polymorphic access to related types. // Call the interface's GetStepProperties() method to access the common type. // Use a type switch to determine the concrete type. The possible types are: @@ -1494,9 +851,6 @@ type StepProperties struct { StepType *StepType `json:"stepType,omitempty"` } -// GetStepProperties implements the StepPropertiesClassification interface for type StepProperties. -func (s *StepProperties) GetStepProperties() *StepProperties { return s } - // StepResource - The resource representation of a rollout step. type StepResource struct { // REQUIRED; The geo-location where the resource lives @@ -1518,53 +872,6 @@ type StepResource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type StepResource. -func (s StepResource) 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) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type StepResource. -func (s *StepResource) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "id": - err = unpopulate(val, &s.ID) - delete(rawMsg, key) - case "location": - err = unpopulate(val, &s.Location) - delete(rawMsg, key) - case "name": - err = unpopulate(val, &s.Name) - delete(rawMsg, key) - case "properties": - s.Properties, err = unmarshalStepPropertiesClassification(val) - delete(rawMsg, key) - case "tags": - err = unpopulate(val, &s.Tags) - delete(rawMsg, key) - case "type": - err = unpopulate(val, &s.Type) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // StepsClientCreateOrUpdateOptions contains the optional parameters for the StepsClient.CreateOrUpdate method. type StepsClientCreateOrUpdateOptions struct { // The step object. @@ -1605,17 +912,6 @@ type TrackedResource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - // WaitStepAttributes - The parameters for the wait step. type WaitStepAttributes struct { // REQUIRED; The duration in ISO 8601 format of how long the wait should be. @@ -1630,58 +926,3 @@ type WaitStepProperties struct { // REQUIRED; The type of step. StepType *StepType `json:"stepType,omitempty"` } - -// GetStepProperties implements the StepPropertiesClassification interface for type WaitStepProperties. -func (w *WaitStepProperties) GetStepProperties() *StepProperties { - return &StepProperties{ - StepType: w.StepType, - } -} - -// MarshalJSON implements the json.Marshaller interface for type WaitStepProperties. -func (w WaitStepProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "attributes", w.Attributes) - objectMap["stepType"] = StepTypeWait - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStepProperties. -func (w *WaitStepProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "attributes": - err = unpopulate(val, &w.Attributes) - delete(rawMsg, key) - case "stepType": - err = unpopulate(val, &w.StepType) - delete(rawMsg, key) - } - if err != nil { - return 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, v interface{}) error { - if data == nil { - return nil - } - return json.Unmarshal(data, v) -} diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_models_serde.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_models_serde.go new file mode 100644 index 000000000000..80b15f89a3fd --- /dev/null +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_models_serde.go @@ -0,0 +1,772 @@ +//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 armdeploymentmanager + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// GetRestRequestAuthentication implements the RestRequestAuthenticationClassification interface for type APIKeyAuthentication. +func (a *APIKeyAuthentication) GetRestRequestAuthentication() *RestRequestAuthentication { + return &RestRequestAuthentication{ + Type: a.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type APIKeyAuthentication. +func (a APIKeyAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "in", a.In) + populate(objectMap, "name", a.Name) + objectMap["type"] = RestAuthTypeAPIKey + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type APIKeyAuthentication. +func (a *APIKeyAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "in": + err = unpopulate(val, &a.In) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &a.Name) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &a.Type) + delete(rawMsg, key) + case "value": + err = unpopulate(val, &a.Value) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArtifactSource. +func (a ArtifactSource) 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) +} + +// MarshalJSON implements the json.Marshaller interface for type ArtifactSourceProperties. +func (a ArtifactSourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "artifactRoot", a.ArtifactRoot) + populate(objectMap, "authentication", a.Authentication) + populate(objectMap, "sourceType", a.SourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourceProperties. +func (a *ArtifactSourceProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "artifactRoot": + err = unpopulate(val, &a.ArtifactRoot) + delete(rawMsg, key) + case "authentication": + a.Authentication, err = unmarshalAuthenticationClassification(val) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, &a.SourceType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ArtifactSourcePropertiesAutoGenerated. +func (a ArtifactSourcePropertiesAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "artifactRoot", a.ArtifactRoot) + populate(objectMap, "authentication", a.Authentication) + populate(objectMap, "sourceType", a.SourceType) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ArtifactSourcePropertiesAutoGenerated. +func (a *ArtifactSourcePropertiesAutoGenerated) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "artifactRoot": + err = unpopulate(val, &a.ArtifactRoot) + delete(rawMsg, key) + case "authentication": + a.Authentication, err = unmarshalAuthenticationClassification(val) + delete(rawMsg, key) + case "sourceType": + err = unpopulate(val, &a.SourceType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetAuthentication implements the AuthenticationClassification interface for type Authentication. +func (a *Authentication) GetAuthentication() *Authentication { return a } + +// 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) +} + +// GetHealthCheckStepAttributes implements the HealthCheckStepAttributesClassification interface for type HealthCheckStepAttributes. +func (h *HealthCheckStepAttributes) GetHealthCheckStepAttributes() *HealthCheckStepAttributes { + return h +} + +// GetStepProperties implements the StepPropertiesClassification interface for type HealthCheckStepProperties. +func (h *HealthCheckStepProperties) GetStepProperties() *StepProperties { + return &StepProperties{ + StepType: h.StepType, + } +} + +// MarshalJSON implements the json.Marshaller interface for type HealthCheckStepProperties. +func (h HealthCheckStepProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "attributes", h.Attributes) + objectMap["stepType"] = StepTypeHealthCheck + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type HealthCheckStepProperties. +func (h *HealthCheckStepProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "attributes": + h.Attributes, err = unmarshalHealthCheckStepAttributesClassification(val) + delete(rawMsg, key) + case "stepType": + err = unpopulate(val, &h.StepType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identityIds", i.IdentityIDs) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Message. +func (m Message) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "message", m.Message) + populateTimeRFC3339(objectMap, "timeStamp", m.TimeStamp) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type Message. +func (m *Message) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "message": + err = unpopulate(val, &m.Message) + delete(rawMsg, key) + case "timeStamp": + err = unpopulateTimeRFC3339(val, &m.TimeStamp) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetHealthCheckStepAttributes implements the HealthCheckStepAttributesClassification interface for type RestHealthCheckStepAttributes. +func (r *RestHealthCheckStepAttributes) GetHealthCheckStepAttributes() *HealthCheckStepAttributes { + return &HealthCheckStepAttributes{ + Type: r.Type, + WaitDuration: r.WaitDuration, + MaxElasticDuration: r.MaxElasticDuration, + HealthyStateDuration: r.HealthyStateDuration, + } +} + +// MarshalJSON implements the json.Marshaller interface for type RestHealthCheckStepAttributes. +func (r RestHealthCheckStepAttributes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "healthyStateDuration", r.HealthyStateDuration) + populate(objectMap, "maxElasticDuration", r.MaxElasticDuration) + populate(objectMap, "properties", r.Properties) + objectMap["type"] = "REST" + populate(objectMap, "waitDuration", r.WaitDuration) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestHealthCheckStepAttributes. +func (r *RestHealthCheckStepAttributes) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "healthyStateDuration": + err = unpopulate(val, &r.HealthyStateDuration) + delete(rawMsg, key) + case "maxElasticDuration": + err = unpopulate(val, &r.MaxElasticDuration) + delete(rawMsg, key) + case "properties": + err = unpopulate(val, &r.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &r.Type) + delete(rawMsg, key) + case "waitDuration": + err = unpopulate(val, &r.WaitDuration) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RestParameters. +func (r RestParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "healthChecks", r.HealthChecks) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RestRequest. +func (r RestRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authentication", r.Authentication) + populate(objectMap, "method", r.Method) + populate(objectMap, "uri", r.URI) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RestRequest. +func (r *RestRequest) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "authentication": + r.Authentication, err = unmarshalRestRequestAuthenticationClassification(val) + delete(rawMsg, key) + case "method": + err = unpopulate(val, &r.Method) + delete(rawMsg, key) + case "uri": + err = unpopulate(val, &r.URI) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetRestRequestAuthentication implements the RestRequestAuthenticationClassification interface for type RestRequestAuthentication. +func (r *RestRequestAuthentication) GetRestRequestAuthentication() *RestRequestAuthentication { + return r +} + +// MarshalJSON implements the json.Marshaller interface for type RestResponse. +func (r RestResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "regex", r.Regex) + populate(objectMap, "successStatusCodes", r.SuccessStatusCodes) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RestResponseRegex. +func (r RestResponseRegex) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "matchQuantifier", r.MatchQuantifier) + populate(objectMap, "matches", r.Matches) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Rollout. +func (r Rollout) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + 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) +} + +// GetRestRequestAuthentication implements the RestRequestAuthenticationClassification interface for type RolloutIdentityAuthentication. +func (r *RolloutIdentityAuthentication) GetRestRequestAuthentication() *RestRequestAuthentication { + return &RestRequestAuthentication{ + Type: r.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type RolloutIdentityAuthentication. +func (r RolloutIdentityAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["type"] = RestAuthTypeRolloutIdentity + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RolloutIdentityAuthentication. +func (r *RolloutIdentityAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "type": + err = unpopulate(val, &r.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RolloutOperationInfo. +func (r RolloutOperationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "endTime", r.EndTime) + populate(objectMap, "error", r.Error) + populate(objectMap, "retryAttempt", r.RetryAttempt) + populate(objectMap, "skipSucceededOnRetry", r.SkipSucceededOnRetry) + populateTimeRFC3339(objectMap, "startTime", r.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RolloutOperationInfo. +func (r *RolloutOperationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "endTime": + err = unpopulateTimeRFC3339(val, &r.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, &r.Error) + delete(rawMsg, key) + case "retryAttempt": + err = unpopulate(val, &r.RetryAttempt) + delete(rawMsg, key) + case "skipSucceededOnRetry": + err = unpopulate(val, &r.SkipSucceededOnRetry) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &r.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RolloutProperties. +func (r RolloutProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "artifactSourceId", r.ArtifactSourceID) + populate(objectMap, "buildVersion", r.BuildVersion) + populate(objectMap, "operationInfo", r.OperationInfo) + populate(objectMap, "services", r.Services) + populate(objectMap, "status", r.Status) + populate(objectMap, "stepGroups", r.StepGroups) + populate(objectMap, "targetServiceTopologyId", r.TargetServiceTopologyID) + populate(objectMap, "totalRetryAttempts", r.TotalRetryAttempts) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RolloutPropertiesAutoGenerated. +func (r RolloutPropertiesAutoGenerated) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "operationInfo", r.OperationInfo) + populate(objectMap, "services", r.Services) + populate(objectMap, "status", r.Status) + populate(objectMap, "totalRetryAttempts", r.TotalRetryAttempts) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RolloutRequest. +func (r RolloutRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + 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 RolloutRequestProperties. +func (r RolloutRequestProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "artifactSourceId", r.ArtifactSourceID) + populate(objectMap, "buildVersion", r.BuildVersion) + populate(objectMap, "stepGroups", r.StepGroups) + populate(objectMap, "targetServiceTopologyId", r.TargetServiceTopologyID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RolloutStep. +func (r RolloutStep) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "messages", r.Messages) + populate(objectMap, "name", r.Name) + populate(objectMap, "operationInfo", r.OperationInfo) + populate(objectMap, "resourceOperations", r.ResourceOperations) + populate(objectMap, "status", r.Status) + populate(objectMap, "stepGroup", r.StepGroup) + return json.Marshal(objectMap) +} + +// GetAuthentication implements the AuthenticationClassification interface for type SasAuthentication. +func (s *SasAuthentication) GetAuthentication() *Authentication { + return &Authentication{ + Type: s.Type, + } +} + +// MarshalJSON implements the json.Marshaller interface for type SasAuthentication. +func (s SasAuthentication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", s.Properties) + objectMap["type"] = "Sas" + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SasAuthentication. +func (s *SasAuthentication) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "properties": + err = unpopulate(val, &s.Properties) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &s.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "name", s.Name) + populate(objectMap, "serviceUnits", s.ServiceUnits) + populate(objectMap, "targetLocation", s.TargetLocation) + populate(objectMap, "targetSubscriptionId", s.TargetSubscriptionID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceResource. +func (s ServiceResource) 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 ServiceTopologyResource. +func (s ServiceTopologyResource) 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 ServiceUnit. +func (s ServiceUnit) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "artifacts", s.Artifacts) + populate(objectMap, "deploymentMode", s.DeploymentMode) + populate(objectMap, "name", s.Name) + populate(objectMap, "steps", s.Steps) + populate(objectMap, "targetResourceGroup", s.TargetResourceGroup) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceUnitResource. +func (s ServiceUnitResource) 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 StepGroup. +func (s StepGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "dependsOnStepGroups", s.DependsOnStepGroups) + populate(objectMap, "deploymentTargetId", s.DeploymentTargetID) + populate(objectMap, "name", s.Name) + populate(objectMap, "postDeploymentSteps", s.PostDeploymentSteps) + populate(objectMap, "preDeploymentSteps", s.PreDeploymentSteps) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type StepOperationInfo. +func (s StepOperationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "correlationId", s.CorrelationID) + populate(objectMap, "deploymentName", s.DeploymentName) + populateTimeRFC3339(objectMap, "endTime", s.EndTime) + populate(objectMap, "error", s.Error) + populateTimeRFC3339(objectMap, "lastUpdatedTime", s.LastUpdatedTime) + populateTimeRFC3339(objectMap, "startTime", s.StartTime) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StepOperationInfo. +func (s *StepOperationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "correlationId": + err = unpopulate(val, &s.CorrelationID) + delete(rawMsg, key) + case "deploymentName": + err = unpopulate(val, &s.DeploymentName) + delete(rawMsg, key) + case "endTime": + err = unpopulateTimeRFC3339(val, &s.EndTime) + delete(rawMsg, key) + case "error": + err = unpopulate(val, &s.Error) + delete(rawMsg, key) + case "lastUpdatedTime": + err = unpopulateTimeRFC3339(val, &s.LastUpdatedTime) + delete(rawMsg, key) + case "startTime": + err = unpopulateTimeRFC3339(val, &s.StartTime) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// GetStepProperties implements the StepPropertiesClassification interface for type StepProperties. +func (s *StepProperties) GetStepProperties() *StepProperties { return s } + +// MarshalJSON implements the json.Marshaller interface for type StepResource. +func (s StepResource) 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) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type StepResource. +func (s *StepResource) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "id": + err = unpopulate(val, &s.ID) + delete(rawMsg, key) + case "location": + err = unpopulate(val, &s.Location) + delete(rawMsg, key) + case "name": + err = unpopulate(val, &s.Name) + delete(rawMsg, key) + case "properties": + s.Properties, err = unmarshalStepPropertiesClassification(val) + delete(rawMsg, key) + case "tags": + err = unpopulate(val, &s.Tags) + delete(rawMsg, key) + case "type": + err = unpopulate(val, &s.Type) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +// GetStepProperties implements the StepPropertiesClassification interface for type WaitStepProperties. +func (w *WaitStepProperties) GetStepProperties() *StepProperties { + return &StepProperties{ + StepType: w.StepType, + } +} + +// MarshalJSON implements the json.Marshaller interface for type WaitStepProperties. +func (w WaitStepProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "attributes", w.Attributes) + objectMap["stepType"] = StepTypeWait + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type WaitStepProperties. +func (w *WaitStepProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "attributes": + err = unpopulate(val, &w.Attributes) + delete(rawMsg, key) + case "stepType": + err = unpopulate(val, &w.StepType) + delete(rawMsg, key) + } + if err != nil { + return 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, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_operations_client.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_operations_client.go index 9a781b0978ac..da1dc47350d5 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_operations_client.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -13,6 +13,7 @@ import ( "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" @@ -28,19 +29,23 @@ type OperationsClient struct { // 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 { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - Lists the supported operations. @@ -77,7 +82,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationsList); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_pollers.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_pollers.go deleted file mode 100644 index 592dc2f8395e..000000000000 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_pollers.go +++ /dev/null @@ -1,101 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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 armdeploymentmanager - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "net/http" -) - -// RolloutsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type RolloutsClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *RolloutsClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *RolloutsClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final RolloutsClientCreateOrUpdateResponse will be returned. -func (p *RolloutsClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (RolloutsClientCreateOrUpdateResponse, error) { - respType := RolloutsClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.RolloutRequest) - if err != nil { - return RolloutsClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *RolloutsClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// ServiceUnitsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type ServiceUnitsClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *ServiceUnitsClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *ServiceUnitsClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final ServiceUnitsClientCreateOrUpdateResponse will be returned. -func (p *ServiceUnitsClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (ServiceUnitsClientCreateOrUpdateResponse, error) { - respType := ServiceUnitsClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.ServiceUnitResource) - if err != nil { - return ServiceUnitsClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *ServiceUnitsClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_polymorphic_helpers.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_polymorphic_helpers.go index dcac2266480d..48dfc26592a3 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_polymorphic_helpers.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_polymorphic_helpers.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_response_types.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_response_types.go index 73553b17e424..c1bdece8d6ba 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_response_types.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,383 +8,143 @@ package armdeploymentmanager -import ( - "context" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "net/http" - "time" -) - // ArtifactSourcesClientCreateOrUpdateResponse contains the response from method ArtifactSourcesClient.CreateOrUpdate. type ArtifactSourcesClientCreateOrUpdateResponse struct { - ArtifactSourcesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ArtifactSourcesClientCreateOrUpdateResult contains the result from method ArtifactSourcesClient.CreateOrUpdate. -type ArtifactSourcesClientCreateOrUpdateResult struct { ArtifactSource } // ArtifactSourcesClientDeleteResponse contains the response from method ArtifactSourcesClient.Delete. type ArtifactSourcesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ArtifactSourcesClientGetResponse contains the response from method ArtifactSourcesClient.Get. type ArtifactSourcesClientGetResponse struct { - ArtifactSourcesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ArtifactSourcesClientGetResult contains the result from method ArtifactSourcesClient.Get. -type ArtifactSourcesClientGetResult struct { ArtifactSource } // ArtifactSourcesClientListResponse contains the response from method ArtifactSourcesClient.List. type ArtifactSourcesClientListResponse struct { - ArtifactSourcesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ArtifactSourcesClientListResult contains the result from method ArtifactSourcesClient.List. -type ArtifactSourcesClientListResult struct { // The list of artifact sources. ArtifactSourceArray []*ArtifactSource } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { OperationsList } // RolloutsClientCancelResponse contains the response from method RolloutsClient.Cancel. type RolloutsClientCancelResponse struct { - RolloutsClientCancelResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// RolloutsClientCancelResult contains the result from method RolloutsClient.Cancel. -type RolloutsClientCancelResult struct { Rollout } -// RolloutsClientCreateOrUpdatePollerResponse contains the response from method RolloutsClient.CreateOrUpdate. -type RolloutsClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *RolloutsClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l RolloutsClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (RolloutsClientCreateOrUpdateResponse, error) { - respType := RolloutsClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.RolloutRequest) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a RolloutsClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *RolloutsClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *RolloutsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("RolloutsClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &RolloutsClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // RolloutsClientCreateOrUpdateResponse contains the response from method RolloutsClient.CreateOrUpdate. type RolloutsClientCreateOrUpdateResponse struct { - RolloutsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// RolloutsClientCreateOrUpdateResult contains the result from method RolloutsClient.CreateOrUpdate. -type RolloutsClientCreateOrUpdateResult struct { RolloutRequest } // RolloutsClientDeleteResponse contains the response from method RolloutsClient.Delete. type RolloutsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // RolloutsClientGetResponse contains the response from method RolloutsClient.Get. type RolloutsClientGetResponse struct { - RolloutsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// RolloutsClientGetResult contains the result from method RolloutsClient.Get. -type RolloutsClientGetResult struct { Rollout } // RolloutsClientListResponse contains the response from method RolloutsClient.List. type RolloutsClientListResponse struct { - RolloutsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// RolloutsClientListResult contains the result from method RolloutsClient.List. -type RolloutsClientListResult struct { // The list of rollouts. RolloutArray []*Rollout } // RolloutsClientRestartResponse contains the response from method RolloutsClient.Restart. type RolloutsClientRestartResponse struct { - RolloutsClientRestartResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// RolloutsClientRestartResult contains the result from method RolloutsClient.Restart. -type RolloutsClientRestartResult struct { Rollout } // ServiceTopologiesClientCreateOrUpdateResponse contains the response from method ServiceTopologiesClient.CreateOrUpdate. type ServiceTopologiesClientCreateOrUpdateResponse struct { - ServiceTopologiesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServiceTopologiesClientCreateOrUpdateResult contains the result from method ServiceTopologiesClient.CreateOrUpdate. -type ServiceTopologiesClientCreateOrUpdateResult struct { ServiceTopologyResource } // ServiceTopologiesClientDeleteResponse contains the response from method ServiceTopologiesClient.Delete. type ServiceTopologiesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ServiceTopologiesClientGetResponse contains the response from method ServiceTopologiesClient.Get. type ServiceTopologiesClientGetResponse struct { - ServiceTopologiesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServiceTopologiesClientGetResult contains the result from method ServiceTopologiesClient.Get. -type ServiceTopologiesClientGetResult struct { ServiceTopologyResource } // ServiceTopologiesClientListResponse contains the response from method ServiceTopologiesClient.List. type ServiceTopologiesClientListResponse struct { - ServiceTopologiesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServiceTopologiesClientListResult contains the result from method ServiceTopologiesClient.List. -type ServiceTopologiesClientListResult struct { // The list of service topologies. ServiceTopologyResourceArray []*ServiceTopologyResource } -// ServiceUnitsClientCreateOrUpdatePollerResponse contains the response from method ServiceUnitsClient.CreateOrUpdate. -type ServiceUnitsClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *ServiceUnitsClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l ServiceUnitsClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (ServiceUnitsClientCreateOrUpdateResponse, error) { - respType := ServiceUnitsClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.ServiceUnitResource) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a ServiceUnitsClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *ServiceUnitsClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *ServiceUnitsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("ServiceUnitsClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &ServiceUnitsClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // ServiceUnitsClientCreateOrUpdateResponse contains the response from method ServiceUnitsClient.CreateOrUpdate. type ServiceUnitsClientCreateOrUpdateResponse struct { - ServiceUnitsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServiceUnitsClientCreateOrUpdateResult contains the result from method ServiceUnitsClient.CreateOrUpdate. -type ServiceUnitsClientCreateOrUpdateResult struct { ServiceUnitResource } // ServiceUnitsClientDeleteResponse contains the response from method ServiceUnitsClient.Delete. type ServiceUnitsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ServiceUnitsClientGetResponse contains the response from method ServiceUnitsClient.Get. type ServiceUnitsClientGetResponse struct { - ServiceUnitsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServiceUnitsClientGetResult contains the result from method ServiceUnitsClient.Get. -type ServiceUnitsClientGetResult struct { ServiceUnitResource } // ServiceUnitsClientListResponse contains the response from method ServiceUnitsClient.List. type ServiceUnitsClientListResponse struct { - ServiceUnitsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServiceUnitsClientListResult contains the result from method ServiceUnitsClient.List. -type ServiceUnitsClientListResult struct { // The list of service units. ServiceUnitResourceArray []*ServiceUnitResource } // ServicesClientCreateOrUpdateResponse contains the response from method ServicesClient.CreateOrUpdate. type ServicesClientCreateOrUpdateResponse struct { - ServicesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServicesClientCreateOrUpdateResult contains the result from method ServicesClient.CreateOrUpdate. -type ServicesClientCreateOrUpdateResult struct { ServiceResource } // ServicesClientDeleteResponse contains the response from method ServicesClient.Delete. type ServicesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ServicesClientGetResponse contains the response from method ServicesClient.Get. type ServicesClientGetResponse struct { - ServicesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServicesClientGetResult contains the result from method ServicesClient.Get. -type ServicesClientGetResult struct { ServiceResource } // ServicesClientListResponse contains the response from method ServicesClient.List. type ServicesClientListResponse struct { - ServicesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ServicesClientListResult contains the result from method ServicesClient.List. -type ServicesClientListResult struct { // The list of services. ServiceResourceArray []*ServiceResource } // StepsClientCreateOrUpdateResponse contains the response from method StepsClient.CreateOrUpdate. type StepsClientCreateOrUpdateResponse struct { - StepsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StepsClientCreateOrUpdateResult contains the result from method StepsClient.CreateOrUpdate. -type StepsClientCreateOrUpdateResult struct { StepResource } // StepsClientDeleteResponse contains the response from method StepsClient.Delete. type StepsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // StepsClientGetResponse contains the response from method StepsClient.Get. type StepsClientGetResponse struct { - StepsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StepsClientGetResult contains the result from method StepsClient.Get. -type StepsClientGetResult struct { StepResource } // StepsClientListResponse contains the response from method StepsClient.List. type StepsClientListResponse struct { - StepsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StepsClientListResult contains the result from method StepsClient.List. -type StepsClientListResult struct { // The list of steps. StepResourceArray []*StepResource } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_rollouts_client.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_rollouts_client.go index d35672c9fc72..3962b188e253 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_rollouts_client.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_rollouts_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -35,20 +36,24 @@ type RolloutsClient struct { // 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 NewRolloutsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *RolloutsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewRolloutsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*RolloutsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &RolloutsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // Cancel - Only running rollouts can be canceled. @@ -99,7 +104,7 @@ func (client *RolloutsClient) cancelCreateRequest(ctx context.Context, resourceG // cancelHandleResponse handles the Cancel response. func (client *RolloutsClient) cancelHandleResponse(resp *http.Response) (RolloutsClientCancelResponse, error) { - result := RolloutsClientCancelResponse{RawResponse: resp} + result := RolloutsClientCancelResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Rollout); err != nil { return RolloutsClientCancelResponse{}, err } @@ -113,22 +118,16 @@ func (client *RolloutsClient) cancelHandleResponse(resp *http.Response) (Rollout // rolloutName - The rollout name. // options - RolloutsClientBeginCreateOrUpdateOptions contains the optional parameters for the RolloutsClient.BeginCreateOrUpdate // method. -func (client *RolloutsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, rolloutName string, options *RolloutsClientBeginCreateOrUpdateOptions) (RolloutsClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, resourceGroupName, rolloutName, options) - if err != nil { - return RolloutsClientCreateOrUpdatePollerResponse{}, err - } - result := RolloutsClientCreateOrUpdatePollerResponse{ - RawResponse: resp, +func (client *RolloutsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, rolloutName string, options *RolloutsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[RolloutsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, rolloutName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[RolloutsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[RolloutsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("RolloutsClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return RolloutsClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &RolloutsClientCreateOrUpdatePoller{ - pt: pt, - } - return result, nil } // CreateOrUpdate - This is an asynchronous operation and can be polled to completion using the location header returned by @@ -195,7 +194,7 @@ func (client *RolloutsClient) Delete(ctx context.Context, resourceGroupName stri if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return RolloutsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return RolloutsClientDeleteResponse{RawResponse: resp}, nil + return RolloutsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -275,7 +274,7 @@ func (client *RolloutsClient) getCreateRequest(ctx context.Context, resourceGrou // getHandleResponse handles the Get response. func (client *RolloutsClient) getHandleResponse(resp *http.Response) (RolloutsClientGetResponse, error) { - result := RolloutsClientGetResponse{RawResponse: resp} + result := RolloutsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Rollout); err != nil { return RolloutsClientGetResponse{}, err } @@ -325,7 +324,7 @@ func (client *RolloutsClient) listCreateRequest(ctx context.Context, resourceGro // listHandleResponse handles the List response. func (client *RolloutsClient) listHandleResponse(resp *http.Response) (RolloutsClientListResponse, error) { - result := RolloutsClientListResponse{RawResponse: resp} + result := RolloutsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RolloutArray); err != nil { return RolloutsClientListResponse{}, err } @@ -383,7 +382,7 @@ func (client *RolloutsClient) restartCreateRequest(ctx context.Context, resource // restartHandleResponse handles the Restart response. func (client *RolloutsClient) restartHandleResponse(resp *http.Response) (RolloutsClientRestartResponse, error) { - result := RolloutsClientRestartResponse{RawResponse: resp} + result := RolloutsClientRestartResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Rollout); err != nil { return RolloutsClientRestartResponse{}, err } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_services_client.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_services_client.go index 833090155007..28ca522fff57 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_services_client.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_services_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -34,20 +35,24 @@ type ServicesClient struct { // 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 NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServicesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewServicesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServicesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &ServicesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Synchronously creates a new service or updates an existing service. @@ -104,7 +109,7 @@ func (client *ServicesClient) createOrUpdateCreateRequest(ctx context.Context, r // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *ServicesClient) createOrUpdateHandleResponse(resp *http.Response) (ServicesClientCreateOrUpdateResponse, error) { - result := ServicesClientCreateOrUpdateResponse{RawResponse: resp} + result := ServicesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ServiceResource); err != nil { return ServicesClientCreateOrUpdateResponse{}, err } @@ -129,7 +134,7 @@ func (client *ServicesClient) Delete(ctx context.Context, resourceGroupName stri if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ServicesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ServicesClientDeleteResponse{RawResponse: resp}, nil + return ServicesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -215,7 +220,7 @@ func (client *ServicesClient) getCreateRequest(ctx context.Context, resourceGrou // getHandleResponse handles the Get response. func (client *ServicesClient) getHandleResponse(resp *http.Response) (ServicesClientGetResponse, error) { - result := ServicesClientGetResponse{RawResponse: resp} + result := ServicesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ServiceResource); err != nil { return ServicesClientGetResponse{}, err } @@ -270,7 +275,7 @@ func (client *ServicesClient) listCreateRequest(ctx context.Context, resourceGro // listHandleResponse handles the List response. func (client *ServicesClient) listHandleResponse(resp *http.Response) (ServicesClientListResponse, error) { - result := ServicesClientListResponse{RawResponse: resp} + result := ServicesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ServiceResourceArray); err != nil { return ServicesClientListResponse{}, err } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_servicetopologies_client.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_servicetopologies_client.go index c771f42752f4..2630c4486e1c 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_servicetopologies_client.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_servicetopologies_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -34,20 +35,24 @@ type ServiceTopologiesClient struct { // 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 NewServiceTopologiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServiceTopologiesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewServiceTopologiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceTopologiesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &ServiceTopologiesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Synchronously creates a new service topology or updates an existing service topology. @@ -100,7 +105,7 @@ func (client *ServiceTopologiesClient) createOrUpdateCreateRequest(ctx context.C // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *ServiceTopologiesClient) createOrUpdateHandleResponse(resp *http.Response) (ServiceTopologiesClientCreateOrUpdateResponse, error) { - result := ServiceTopologiesClientCreateOrUpdateResponse{RawResponse: resp} + result := ServiceTopologiesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ServiceTopologyResource); err != nil { return ServiceTopologiesClientCreateOrUpdateResponse{}, err } @@ -125,7 +130,7 @@ func (client *ServiceTopologiesClient) Delete(ctx context.Context, resourceGroup if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ServiceTopologiesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ServiceTopologiesClientDeleteResponse{RawResponse: resp}, nil + return ServiceTopologiesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -202,7 +207,7 @@ func (client *ServiceTopologiesClient) getCreateRequest(ctx context.Context, res // getHandleResponse handles the Get response. func (client *ServiceTopologiesClient) getHandleResponse(resp *http.Response) (ServiceTopologiesClientGetResponse, error) { - result := ServiceTopologiesClientGetResponse{RawResponse: resp} + result := ServiceTopologiesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ServiceTopologyResource); err != nil { return ServiceTopologiesClientGetResponse{}, err } @@ -252,7 +257,7 @@ func (client *ServiceTopologiesClient) listCreateRequest(ctx context.Context, re // listHandleResponse handles the List response. func (client *ServiceTopologiesClient) listHandleResponse(resp *http.Response) (ServiceTopologiesClientListResponse, error) { - result := ServiceTopologiesClientListResponse{RawResponse: resp} + result := ServiceTopologiesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ServiceTopologyResourceArray); err != nil { return ServiceTopologiesClientListResponse{}, err } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_serviceunits_client.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_serviceunits_client.go index 333025f4abbd..785b3cfae22c 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_serviceunits_client.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_serviceunits_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -34,20 +35,24 @@ type ServiceUnitsClient struct { // 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 NewServiceUnitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ServiceUnitsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewServiceUnitsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ServiceUnitsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &ServiceUnitsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - This is an asynchronous operation and can be polled to completion using the operation resource returned @@ -60,22 +65,16 @@ func NewServiceUnitsClient(subscriptionID string, credential azcore.TokenCredent // serviceUnitInfo - The service unit resource object. // options - ServiceUnitsClientBeginCreateOrUpdateOptions contains the optional parameters for the ServiceUnitsClient.BeginCreateOrUpdate // method. -func (client *ServiceUnitsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceTopologyName string, serviceName string, serviceUnitName string, serviceUnitInfo ServiceUnitResource, options *ServiceUnitsClientBeginCreateOrUpdateOptions) (ServiceUnitsClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, serviceUnitInfo, options) - if err != nil { - return ServiceUnitsClientCreateOrUpdatePollerResponse{}, err - } - result := ServiceUnitsClientCreateOrUpdatePollerResponse{ - RawResponse: resp, +func (client *ServiceUnitsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, serviceTopologyName string, serviceName string, serviceUnitName string, serviceUnitInfo ServiceUnitResource, options *ServiceUnitsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[ServiceUnitsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, serviceTopologyName, serviceName, serviceUnitName, serviceUnitInfo, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[ServiceUnitsClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[ServiceUnitsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("ServiceUnitsClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return ServiceUnitsClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &ServiceUnitsClientCreateOrUpdatePoller{ - pt: pt, - } - return result, nil } // CreateOrUpdate - This is an asynchronous operation and can be polled to completion using the operation resource returned @@ -149,7 +148,7 @@ func (client *ServiceUnitsClient) Delete(ctx context.Context, resourceGroupName if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ServiceUnitsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ServiceUnitsClientDeleteResponse{RawResponse: resp}, nil + return ServiceUnitsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -244,7 +243,7 @@ func (client *ServiceUnitsClient) getCreateRequest(ctx context.Context, resource // getHandleResponse handles the Get response. func (client *ServiceUnitsClient) getHandleResponse(resp *http.Response) (ServiceUnitsClientGetResponse, error) { - result := ServiceUnitsClientGetResponse{RawResponse: resp} + result := ServiceUnitsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ServiceUnitResource); err != nil { return ServiceUnitsClientGetResponse{}, err } @@ -304,7 +303,7 @@ func (client *ServiceUnitsClient) listCreateRequest(ctx context.Context, resourc // listHandleResponse handles the List response. func (client *ServiceUnitsClient) listHandleResponse(resp *http.Response) (ServiceUnitsClientListResponse, error) { - result := ServiceUnitsClientListResponse{RawResponse: resp} + result := ServiceUnitsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ServiceUnitResourceArray); err != nil { return ServiceUnitsClientListResponse{}, err } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_steps_client.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_steps_client.go index 5f66ca029898..36dc711213cd 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_steps_client.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_steps_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -34,20 +35,24 @@ type StepsClient struct { // 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 NewStepsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *StepsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewStepsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StepsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &StepsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Synchronously creates a new step or updates an existing step. @@ -101,7 +106,7 @@ func (client *StepsClient) createOrUpdateCreateRequest(ctx context.Context, reso // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *StepsClient) createOrUpdateHandleResponse(resp *http.Response) (StepsClientCreateOrUpdateResponse, error) { - result := StepsClientCreateOrUpdateResponse{RawResponse: resp} + result := StepsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.StepResource); err != nil { return StepsClientCreateOrUpdateResponse{}, err } @@ -125,7 +130,7 @@ func (client *StepsClient) Delete(ctx context.Context, resourceGroupName string, if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return StepsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return StepsClientDeleteResponse{RawResponse: resp}, nil + return StepsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -202,7 +207,7 @@ func (client *StepsClient) getCreateRequest(ctx context.Context, resourceGroupNa // getHandleResponse handles the Get response. func (client *StepsClient) getHandleResponse(resp *http.Response) (StepsClientGetResponse, error) { - result := StepsClientGetResponse{RawResponse: resp} + result := StepsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.StepResource); err != nil { return StepsClientGetResponse{}, err } @@ -252,7 +257,7 @@ func (client *StepsClient) listCreateRequest(ctx context.Context, resourceGroupN // listHandleResponse handles the List response. func (client *StepsClient) listHandleResponse(resp *http.Response) (StepsClientListResponse, error) { - result := StepsClientListResponse{RawResponse: resp} + result := StepsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.StepResourceArray); err != nil { return StepsClientListResponse{}, err } diff --git a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_time_rfc3339.go b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_time_rfc3339.go index 02984674a1cb..bbed07394e91 100644 --- a/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/deploymentmanager/armdeploymentmanager/zz_generated_time_rfc3339.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md index 4b1e5da612ea..9aaa3199f98e 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/CHANGELOG.md @@ -1,5 +1,404 @@ # Release History +## 0.3.0 (2022-04-11) +### Breaking Changes + +- Function `NewStartMenuItemsClient` return value(s) have been changed from `(*StartMenuItemsClient)` to `(*StartMenuItemsClient, error)` +- Function `NewPrivateEndpointConnectionsClient` return value(s) have been changed from `(*PrivateEndpointConnectionsClient)` to `(*PrivateEndpointConnectionsClient, error)` +- Function `*PrivateLinkResourcesClient.ListByHostPool` return value(s) have been changed from `(*PrivateLinkResourcesClientListByHostPoolPager)` to `(*runtime.Pager[PrivateLinkResourcesClientListByHostPoolResponse])` +- Function `*HostPoolsClient.List` return value(s) have been changed from `(*HostPoolsClientListPager)` to `(*runtime.Pager[HostPoolsClientListResponse])` +- Function `NewPrivateLinkResourcesClient` return value(s) have been changed from `(*PrivateLinkResourcesClient)` to `(*PrivateLinkResourcesClient, error)` +- Function `NewMsixImagesClient` return value(s) have been changed from `(*MsixImagesClient)` to `(*MsixImagesClient, error)` +- Function `*ApplicationGroupsClient.ListByResourceGroup` return value(s) have been changed from `(*ApplicationGroupsClientListByResourceGroupPager)` to `(*runtime.Pager[ApplicationGroupsClientListByResourceGroupResponse])` +- Function `NewDesktopsClient` return value(s) have been changed from `(*DesktopsClient)` to `(*DesktopsClient, error)` +- Function `*UserSessionsClient.List` return value(s) have been changed from `(*UserSessionsClientListPager)` to `(*runtime.Pager[UserSessionsClientListResponse])` +- Function `NewSessionHostsClient` return value(s) have been changed from `(*SessionHostsClient)` to `(*SessionHostsClient, error)` +- Function `*ScalingPlansClient.ListByResourceGroup` return value(s) have been changed from `(*ScalingPlansClientListByResourceGroupPager)` to `(*runtime.Pager[ScalingPlansClientListByResourceGroupResponse])` +- Function `*OperationsClient.List` return value(s) have been changed from `(*OperationsClientListPager)` to `(*runtime.Pager[OperationsClientListResponse])` +- Function `*MSIXPackagesClient.List` return value(s) have been changed from `(*MSIXPackagesClientListPager)` to `(*runtime.Pager[MSIXPackagesClientListResponse])` +- Function `NewUserSessionsClient` return value(s) have been changed from `(*UserSessionsClient)` to `(*UserSessionsClient, error)` +- Function `*StartMenuItemsClient.List` return value(s) have been changed from `(*StartMenuItemsClientListPager)` to `(*runtime.Pager[StartMenuItemsClientListResponse])` +- Function `*HostPoolsClient.ListByResourceGroup` return value(s) have been changed from `(*HostPoolsClientListByResourceGroupPager)` to `(*runtime.Pager[HostPoolsClientListByResourceGroupResponse])` +- Function `*MsixImagesClient.Expand` return value(s) have been changed from `(*MsixImagesClientExpandPager)` to `(*runtime.Pager[MsixImagesClientExpandResponse])` +- Function `NewHostPoolsClient` return value(s) have been changed from `(*HostPoolsClient)` to `(*HostPoolsClient, error)` +- Function `*ApplicationsClient.List` return value(s) have been changed from `(*ApplicationsClientListPager)` to `(*runtime.Pager[ApplicationsClientListResponse])` +- Function `*UserSessionsClient.ListByHostPool` return value(s) have been changed from `(*UserSessionsClientListByHostPoolPager)` to `(*runtime.Pager[UserSessionsClientListByHostPoolResponse])` +- Function `*PrivateEndpointConnectionsClient.ListByWorkspace` return value(s) have been changed from `(*PrivateEndpointConnectionsClientListByWorkspacePager)` to `(*runtime.Pager[PrivateEndpointConnectionsClientListByWorkspaceResponse])` +- Function `*WorkspacesClient.ListBySubscription` return value(s) have been changed from `(*WorkspacesClientListBySubscriptionPager)` to `(*runtime.Pager[WorkspacesClientListBySubscriptionResponse])` +- Function `NewApplicationGroupsClient` return value(s) have been changed from `(*ApplicationGroupsClient)` to `(*ApplicationGroupsClient, error)` +- Function `NewMSIXPackagesClient` return value(s) have been changed from `(*MSIXPackagesClient)` to `(*MSIXPackagesClient, error)` +- Function `*PrivateLinkResourcesClient.ListByWorkspace` return value(s) have been changed from `(*PrivateLinkResourcesClientListByWorkspacePager)` to `(*runtime.Pager[PrivateLinkResourcesClientListByWorkspaceResponse])` +- Function `*SessionHostsClient.List` return value(s) have been changed from `(*SessionHostsClientListPager)` to `(*runtime.Pager[SessionHostsClientListResponse])` +- Function `NewWorkspacesClient` return value(s) have been changed from `(*WorkspacesClient)` to `(*WorkspacesClient, error)` +- Function `*DesktopsClient.List` return value(s) have been changed from `(*DesktopsClientListPager)` to `(*runtime.Pager[DesktopsClientListResponse])` +- Function `NewApplicationsClient` return value(s) have been changed from `(*ApplicationsClient)` to `(*ApplicationsClient, error)` +- Function `*ApplicationGroupsClient.ListBySubscription` return value(s) have been changed from `(*ApplicationGroupsClientListBySubscriptionPager)` to `(*runtime.Pager[ApplicationGroupsClientListBySubscriptionResponse])` +- Function `NewScalingPlansClient` return value(s) have been changed from `(*ScalingPlansClient)` to `(*ScalingPlansClient, error)` +- Function `*ScalingPlansClient.ListBySubscription` return value(s) have been changed from `(*ScalingPlansClientListBySubscriptionPager)` to `(*runtime.Pager[ScalingPlansClientListBySubscriptionResponse])` +- Function `*PrivateEndpointConnectionsClient.ListByHostPool` return value(s) have been changed from `(*PrivateEndpointConnectionsClientListByHostPoolPager)` to `(*runtime.Pager[PrivateEndpointConnectionsClientListByHostPoolResponse])` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `*WorkspacesClient.ListByResourceGroup` return value(s) have been changed from `(*WorkspacesClientListByResourceGroupPager)` to `(*runtime.Pager[WorkspacesClientListByResourceGroupResponse])` +- Function `*ScalingPlansClient.ListByHostPool` return value(s) have been changed from `(*ScalingPlansClientListByHostPoolPager)` to `(*runtime.Pager[ScalingPlansClientListByHostPoolResponse])` +- Type of `HostPoolPatchProperties.PublicNetworkAccess` has been changed from `*PublicNetworkAccess` to `*HostpoolPublicNetworkAccess` +- Type of `HostPoolProperties.PublicNetworkAccess` has been changed from `*PublicNetworkAccess` to `*HostpoolPublicNetworkAccess` +- Function `*DesktopsClientListPager.Err` has been removed +- Function `*MsixImagesClientExpandPager.PageResponse` has been removed +- Function `*MsixImagesClientExpandPager.NextPage` has been removed +- Function `*OperationsClientListPager.PageResponse` has been removed +- Function `*WorkspacesClientListBySubscriptionPager.NextPage` has been removed +- Function `*HostPoolsClientListPager.NextPage` has been removed +- Function `*UserSessionsClientListPager.Err` has been removed +- Function `HealthCheckName.ToPtr` has been removed +- Function `*PrivateLinkResourcesClientListByHostPoolPager.PageResponse` has been removed +- Function `*UserSessionsClientListPager.NextPage` has been removed +- Function `*PrivateLinkResourcesClientListByWorkspacePager.PageResponse` has been removed +- Function `*WorkspacesClientListByResourceGroupPager.PageResponse` has been removed +- Function `*UserSessionsClientListByHostPoolPager.NextPage` has been removed +- Function `CreatedByType.ToPtr` has been removed +- Function `ScalingScheduleDaysOfWeekItem.ToPtr` has been removed +- Function `*ScalingPlansClientListByResourceGroupPager.PageResponse` has been removed +- Function `*UserSessionsClientListByHostPoolPager.Err` has been removed +- Function `ApplicationType.ToPtr` has been removed +- Function `*OperationsClientListPager.NextPage` has been removed +- Function `ScalingHostPoolType.ToPtr` has been removed +- Function `*WorkspacesClientListBySubscriptionPager.PageResponse` has been removed +- Function `*ApplicationGroupsClientListByResourceGroupPager.PageResponse` has been removed +- Function `PersonalDesktopAssignmentType.ToPtr` has been removed +- Function `HostPoolType.ToPtr` has been removed +- Function `*HostPoolsClientListByResourceGroupPager.NextPage` has been removed +- Function `*OperationsClientListPager.Err` has been removed +- Function `*ApplicationGroupsClientListBySubscriptionPager.Err` has been removed +- Function `*StartMenuItemsClientListPager.PageResponse` has been removed +- Function `*PrivateEndpointConnectionsClientListByHostPoolPager.Err` has been removed +- Function `*PrivateLinkResourcesClientListByHostPoolPager.NextPage` has been removed +- Function `Status.ToPtr` has been removed +- Function `*ScalingPlansClientListByHostPoolPager.NextPage` has been removed +- Function `*WorkspacesClientListByResourceGroupPager.Err` has been removed +- Function `*SessionHostsClientListPager.PageResponse` has been removed +- Function `*DesktopsClientListPager.NextPage` has been removed +- Function `*ScalingPlansClientListByHostPoolPager.Err` has been removed +- Function `*MSIXPackagesClientListPager.PageResponse` has been removed +- Function `ApplicationGroupType.ToPtr` has been removed +- Function `PrivateEndpointConnectionProvisioningState.ToPtr` has been removed +- Function `*PrivateEndpointConnectionsClientListByHostPoolPager.NextPage` has been removed +- Function `*DesktopsClientListPager.PageResponse` has been removed +- Function `SKUTier.ToPtr` has been removed +- Function `PrivateEndpointServiceConnectionStatus.ToPtr` has been removed +- Function `*MSIXPackagesClientListPager.Err` has been removed +- Function `*StartMenuItemsClientListPager.NextPage` has been removed +- Function `*PrivateLinkResourcesClientListByWorkspacePager.Err` has been removed +- Function `SessionHostLoadBalancingAlgorithm.ToPtr` has been removed +- Function `UpdateState.ToPtr` has been removed +- Function `PreferredAppGroupType.ToPtr` has been removed +- Function `*ScalingPlansClientListByResourceGroupPager.NextPage` has been removed +- Function `*ApplicationGroupsClientListByResourceGroupPager.NextPage` has been removed +- Function `*ApplicationsClientListPager.NextPage` has been removed +- Function `*HostPoolsClientListByResourceGroupPager.PageResponse` has been removed +- Function `CommandLineSetting.ToPtr` has been removed +- Function `*ApplicationGroupsClientListBySubscriptionPager.NextPage` has been removed +- Function `*PrivateEndpointConnectionsClientListByWorkspacePager.NextPage` has been removed +- Function `*WorkspacesClientListBySubscriptionPager.Err` has been removed +- Function `SessionState.ToPtr` has been removed +- Function `LoadBalancerType.ToPtr` has been removed +- Function `*HostPoolsClientListByResourceGroupPager.Err` has been removed +- Function `*ScalingPlansClientListBySubscriptionPager.PageResponse` has been removed +- Function `*ScalingPlansClientListBySubscriptionPager.NextPage` has been removed +- Function `*ScalingPlansClientListByResourceGroupPager.Err` has been removed +- Function `*SessionHostsClientListPager.NextPage` has been removed +- Function `*MSIXPackagesClientListPager.NextPage` has been removed +- Function `SSOSecretType.ToPtr` has been removed +- Function `*PrivateLinkResourcesClientListByWorkspacePager.NextPage` has been removed +- Function `*MsixImagesClientExpandPager.Err` has been removed +- Function `Operation.ToPtr` has been removed +- Function `HealthCheckResult.ToPtr` has been removed +- Function `*HostPoolsClientListPager.PageResponse` has been removed +- Function `RemoteApplicationType.ToPtr` has been removed +- Function `*WorkspacesClientListByResourceGroupPager.NextPage` has been removed +- Function `*UserSessionsClientListPager.PageResponse` has been removed +- Function `*ApplicationGroupsClientListByResourceGroupPager.Err` has been removed +- Function `*HostPoolsClientListPager.Err` has been removed +- Function `RegistrationTokenOperation.ToPtr` has been removed +- Function `*UserSessionsClientListByHostPoolPager.PageResponse` has been removed +- Function `*PrivateLinkResourcesClientListByHostPoolPager.Err` has been removed +- Function `*PrivateEndpointConnectionsClientListByWorkspacePager.PageResponse` has been removed +- Function `PublicNetworkAccess.ToPtr` has been removed +- Function `*ApplicationsClientListPager.Err` has been removed +- Function `*PrivateEndpointConnectionsClientListByWorkspacePager.Err` has been removed +- Function `*SessionHostsClientListPager.Err` has been removed +- Function `*ScalingPlansClientListByHostPoolPager.PageResponse` has been removed +- Function `*PrivateEndpointConnectionsClientListByHostPoolPager.PageResponse` has been removed +- Function `*ApplicationsClientListPager.PageResponse` has been removed +- Function `*StartMenuItemsClientListPager.Err` has been removed +- Function `StopHostsWhen.ToPtr` has been removed +- Function `*ApplicationGroupsClientListBySubscriptionPager.PageResponse` has been removed +- Function `*ScalingPlansClientListBySubscriptionPager.Err` has been removed +- Struct `ApplicationGroupsClientCreateOrUpdateResult` has been removed +- Struct `ApplicationGroupsClientGetResult` has been removed +- Struct `ApplicationGroupsClientListByResourceGroupPager` has been removed +- Struct `ApplicationGroupsClientListByResourceGroupResult` has been removed +- Struct `ApplicationGroupsClientListBySubscriptionPager` has been removed +- Struct `ApplicationGroupsClientListBySubscriptionResult` has been removed +- Struct `ApplicationGroupsClientUpdateResult` has been removed +- Struct `ApplicationsClientCreateOrUpdateResult` has been removed +- Struct `ApplicationsClientGetResult` has been removed +- Struct `ApplicationsClientListPager` has been removed +- Struct `ApplicationsClientListResult` has been removed +- Struct `ApplicationsClientUpdateResult` has been removed +- Struct `DesktopsClientGetResult` has been removed +- Struct `DesktopsClientListPager` has been removed +- Struct `DesktopsClientListResult` has been removed +- Struct `DesktopsClientUpdateResult` has been removed +- Struct `HostPoolsClientCreateOrUpdateResult` has been removed +- Struct `HostPoolsClientGetResult` has been removed +- Struct `HostPoolsClientListByResourceGroupPager` has been removed +- Struct `HostPoolsClientListByResourceGroupResult` has been removed +- Struct `HostPoolsClientListPager` has been removed +- Struct `HostPoolsClientListResult` has been removed +- Struct `HostPoolsClientRetrieveRegistrationTokenResult` has been removed +- Struct `HostPoolsClientUpdateResult` has been removed +- Struct `MSIXPackagesClientCreateOrUpdateResult` has been removed +- Struct `MSIXPackagesClientGetResult` has been removed +- Struct `MSIXPackagesClientListPager` has been removed +- Struct `MSIXPackagesClientListResult` has been removed +- Struct `MSIXPackagesClientUpdateResult` has been removed +- Struct `MsixImagesClientExpandPager` has been removed +- Struct `MsixImagesClientExpandResult` has been removed +- Struct `OperationsClientListPager` has been removed +- Struct `OperationsClientListResult` has been removed +- Struct `PrivateEndpointConnectionsClientGetByHostPoolResult` has been removed +- Struct `PrivateEndpointConnectionsClientGetByWorkspaceResult` has been removed +- Struct `PrivateEndpointConnectionsClientListByHostPoolPager` has been removed +- Struct `PrivateEndpointConnectionsClientListByHostPoolResult` has been removed +- Struct `PrivateEndpointConnectionsClientListByWorkspacePager` has been removed +- Struct `PrivateEndpointConnectionsClientListByWorkspaceResult` has been removed +- Struct `PrivateEndpointConnectionsClientUpdateByHostPoolResult` has been removed +- Struct `PrivateEndpointConnectionsClientUpdateByWorkspaceResult` has been removed +- Struct `PrivateLinkResourcesClientListByHostPoolPager` has been removed +- Struct `PrivateLinkResourcesClientListByHostPoolResult` has been removed +- Struct `PrivateLinkResourcesClientListByWorkspacePager` has been removed +- Struct `PrivateLinkResourcesClientListByWorkspaceResult` has been removed +- Struct `ScalingPlansClientCreateResult` has been removed +- Struct `ScalingPlansClientGetResult` has been removed +- Struct `ScalingPlansClientListByHostPoolPager` has been removed +- Struct `ScalingPlansClientListByHostPoolResult` has been removed +- Struct `ScalingPlansClientListByResourceGroupPager` has been removed +- Struct `ScalingPlansClientListByResourceGroupResult` has been removed +- Struct `ScalingPlansClientListBySubscriptionPager` has been removed +- Struct `ScalingPlansClientListBySubscriptionResult` has been removed +- Struct `ScalingPlansClientUpdateResult` has been removed +- Struct `SessionHostsClientGetResult` has been removed +- Struct `SessionHostsClientListPager` has been removed +- Struct `SessionHostsClientListResult` has been removed +- Struct `SessionHostsClientUpdateResult` has been removed +- Struct `StartMenuItemsClientListPager` has been removed +- Struct `StartMenuItemsClientListResult` has been removed +- Struct `UserSessionsClientGetResult` has been removed +- Struct `UserSessionsClientListByHostPoolPager` has been removed +- Struct `UserSessionsClientListByHostPoolResult` has been removed +- Struct `UserSessionsClientListPager` has been removed +- Struct `UserSessionsClientListResult` has been removed +- Struct `WorkspacesClientCreateOrUpdateResult` has been removed +- Struct `WorkspacesClientGetResult` has been removed +- Struct `WorkspacesClientListByResourceGroupPager` has been removed +- Struct `WorkspacesClientListByResourceGroupResult` has been removed +- Struct `WorkspacesClientListBySubscriptionPager` has been removed +- Struct `WorkspacesClientListBySubscriptionResult` has been removed +- Struct `WorkspacesClientUpdateResult` has been removed +- Field `PrivateEndpointConnectionsClientListByWorkspaceResult` of struct `PrivateEndpointConnectionsClientListByWorkspaceResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientListByWorkspaceResponse` has been removed +- Field `MSIXPackagesClientListResult` of struct `MSIXPackagesClientListResponse` has been removed +- Field `RawResponse` of struct `MSIXPackagesClientListResponse` has been removed +- Field `SessionHostsClientListResult` of struct `SessionHostsClientListResponse` has been removed +- Field `RawResponse` of struct `SessionHostsClientListResponse` has been removed +- Field `RawResponse` of struct `UserSessionsClientDeleteResponse` has been removed +- Field `PrivateEndpointConnectionsClientGetByHostPoolResult` of struct `PrivateEndpointConnectionsClientGetByHostPoolResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientGetByHostPoolResponse` has been removed +- Field `UserSessionsClientListResult` of struct `UserSessionsClientListResponse` has been removed +- Field `RawResponse` of struct `UserSessionsClientListResponse` has been removed +- Field `WorkspacesClientUpdateResult` of struct `WorkspacesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `WorkspacesClientUpdateResponse` has been removed +- Field `DesktopsClientUpdateResult` of struct `DesktopsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `DesktopsClientUpdateResponse` has been removed +- Field `HostPoolsClientRetrieveRegistrationTokenResult` of struct `HostPoolsClientRetrieveRegistrationTokenResponse` has been removed +- Field `RawResponse` of struct `HostPoolsClientRetrieveRegistrationTokenResponse` has been removed +- Field `WorkspacesClientListByResourceGroupResult` of struct `WorkspacesClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `WorkspacesClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `HostPoolsClientDeleteResponse` has been removed +- Field `MsixImagesClientExpandResult` of struct `MsixImagesClientExpandResponse` has been removed +- Field `RawResponse` of struct `MsixImagesClientExpandResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientDeleteByWorkspaceResponse` has been removed +- Field `HostPoolsClientListResult` of struct `HostPoolsClientListResponse` has been removed +- Field `RawResponse` of struct `HostPoolsClientListResponse` has been removed +- Field `ApplicationGroupsClientListBySubscriptionResult` of struct `ApplicationGroupsClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `ApplicationGroupsClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientDeleteByHostPoolResponse` has been removed +- Field `PrivateEndpointConnectionsClientUpdateByHostPoolResult` of struct `PrivateEndpointConnectionsClientUpdateByHostPoolResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientUpdateByHostPoolResponse` has been removed +- Field `StartMenuItemsClientListResult` of struct `StartMenuItemsClientListResponse` has been removed +- Field `RawResponse` of struct `StartMenuItemsClientListResponse` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `ApplicationsClientListResult` of struct `ApplicationsClientListResponse` has been removed +- Field `RawResponse` of struct `ApplicationsClientListResponse` has been removed +- Field `PrivateEndpointConnectionsClientListByHostPoolResult` of struct `PrivateEndpointConnectionsClientListByHostPoolResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientListByHostPoolResponse` has been removed +- Field `PrivateLinkResourcesClientListByWorkspaceResult` of struct `PrivateLinkResourcesClientListByWorkspaceResponse` has been removed +- Field `RawResponse` of struct `PrivateLinkResourcesClientListByWorkspaceResponse` has been removed +- Field `RawResponse` of struct `MSIXPackagesClientDeleteResponse` has been removed +- Field `ApplicationGroupsClientGetResult` of struct `ApplicationGroupsClientGetResponse` has been removed +- Field `RawResponse` of struct `ApplicationGroupsClientGetResponse` has been removed +- Field `HostPoolsClientListByResourceGroupResult` of struct `HostPoolsClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `HostPoolsClientListByResourceGroupResponse` has been removed +- Field `SessionHostsClientUpdateResult` of struct `SessionHostsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `SessionHostsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `WorkspacesClientDeleteResponse` has been removed +- Field `ApplicationGroupsClientListByResourceGroupResult` of struct `ApplicationGroupsClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `ApplicationGroupsClientListByResourceGroupResponse` has been removed +- Field `ApplicationsClientGetResult` of struct `ApplicationsClientGetResponse` has been removed +- Field `RawResponse` of struct `ApplicationsClientGetResponse` has been removed +- Field `ScalingPlansClientListBySubscriptionResult` of struct `ScalingPlansClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `ScalingPlansClientListBySubscriptionResponse` has been removed +- Field `SessionHostsClientGetResult` of struct `SessionHostsClientGetResponse` has been removed +- Field `RawResponse` of struct `SessionHostsClientGetResponse` has been removed +- Field `WorkspacesClientCreateOrUpdateResult` of struct `WorkspacesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `WorkspacesClientCreateOrUpdateResponse` has been removed +- Field `DesktopsClientGetResult` of struct `DesktopsClientGetResponse` has been removed +- Field `RawResponse` of struct `DesktopsClientGetResponse` has been removed +- Field `MSIXPackagesClientCreateOrUpdateResult` of struct `MSIXPackagesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `MSIXPackagesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `UserSessionsClientSendMessageResponse` has been removed +- Field `ApplicationGroupsClientCreateOrUpdateResult` of struct `ApplicationGroupsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ApplicationGroupsClientCreateOrUpdateResponse` has been removed +- Field `ScalingPlansClientUpdateResult` of struct `ScalingPlansClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ScalingPlansClientUpdateResponse` has been removed +- Field `ScalingPlansClientGetResult` of struct `ScalingPlansClientGetResponse` has been removed +- Field `RawResponse` of struct `ScalingPlansClientGetResponse` has been removed +- Field `PrivateEndpointConnectionsClientGetByWorkspaceResult` of struct `PrivateEndpointConnectionsClientGetByWorkspaceResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientGetByWorkspaceResponse` has been removed +- Field `RawResponse` of struct `ApplicationGroupsClientDeleteResponse` has been removed +- Field `ApplicationsClientUpdateResult` of struct `ApplicationsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ApplicationsClientUpdateResponse` has been removed +- Field `ApplicationsClientCreateOrUpdateResult` of struct `ApplicationsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ApplicationsClientCreateOrUpdateResponse` has been removed +- Field `UserSessionsClientListByHostPoolResult` of struct `UserSessionsClientListByHostPoolResponse` has been removed +- Field `RawResponse` of struct `UserSessionsClientListByHostPoolResponse` has been removed +- Field `HostPoolsClientGetResult` of struct `HostPoolsClientGetResponse` has been removed +- Field `RawResponse` of struct `HostPoolsClientGetResponse` has been removed +- Field `HostPoolsClientCreateOrUpdateResult` of struct `HostPoolsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `HostPoolsClientCreateOrUpdateResponse` has been removed +- Field `ScalingPlansClientListByResourceGroupResult` of struct `ScalingPlansClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `ScalingPlansClientListByResourceGroupResponse` has been removed +- Field `HostPoolsClientUpdateResult` of struct `HostPoolsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `HostPoolsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ApplicationsClientDeleteResponse` has been removed +- Field `WorkspacesClientListBySubscriptionResult` of struct `WorkspacesClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `WorkspacesClientListBySubscriptionResponse` has been removed +- Field `MSIXPackagesClientGetResult` of struct `MSIXPackagesClientGetResponse` has been removed +- Field `RawResponse` of struct `MSIXPackagesClientGetResponse` has been removed +- Field `ScalingPlansClientListByHostPoolResult` of struct `ScalingPlansClientListByHostPoolResponse` has been removed +- Field `RawResponse` of struct `ScalingPlansClientListByHostPoolResponse` has been removed +- Field `PrivateLinkResourcesClientListByHostPoolResult` of struct `PrivateLinkResourcesClientListByHostPoolResponse` has been removed +- Field `RawResponse` of struct `PrivateLinkResourcesClientListByHostPoolResponse` has been removed +- Field `UserSessionsClientGetResult` of struct `UserSessionsClientGetResponse` has been removed +- Field `RawResponse` of struct `UserSessionsClientGetResponse` has been removed +- Field `RawResponse` of struct `UserSessionsClientDisconnectResponse` has been removed +- Field `RawResponse` of struct `ScalingPlansClientDeleteResponse` has been removed +- Field `DesktopsClientListResult` of struct `DesktopsClientListResponse` has been removed +- Field `RawResponse` of struct `DesktopsClientListResponse` has been removed +- Field `RawResponse` of struct `SessionHostsClientDeleteResponse` has been removed +- Field `ScalingPlansClientCreateResult` of struct `ScalingPlansClientCreateResponse` has been removed +- Field `RawResponse` of struct `ScalingPlansClientCreateResponse` has been removed +- Field `PrivateEndpointConnectionsClientUpdateByWorkspaceResult` of struct `PrivateEndpointConnectionsClientUpdateByWorkspaceResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientUpdateByWorkspaceResponse` has been removed +- Field `WorkspacesClientGetResult` of struct `WorkspacesClientGetResponse` has been removed +- Field `RawResponse` of struct `WorkspacesClientGetResponse` has been removed +- Field `MSIXPackagesClientUpdateResult` of struct `MSIXPackagesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `MSIXPackagesClientUpdateResponse` has been removed +- Field `ApplicationGroupsClientUpdateResult` of struct `ApplicationGroupsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ApplicationGroupsClientUpdateResponse` has been removed + +### Features Added + +- New const `HostpoolPublicNetworkAccessEnabledForClientsOnly` +- New const `DayOfWeekWednesday` +- New const `DayOfWeekFriday` +- New const `SessionHostComponentUpdateTypeScheduled` +- New const `HostpoolPublicNetworkAccessEnabled` +- New const `DayOfWeekMonday` +- New const `SessionHostComponentUpdateTypeDefault` +- New const `DayOfWeekTuesday` +- New const `DayOfWeekThursday` +- New const `DayOfWeekSaturday` +- New const `DayOfWeekSunday` +- New const `HostpoolPublicNetworkAccessEnabledForSessionHostsOnly` +- New const `HostpoolPublicNetworkAccessDisabled` +- New function `PossibleHostpoolPublicNetworkAccessValues() []HostpoolPublicNetworkAccess` +- New function `AgentUpdatePatchProperties.MarshalJSON() ([]byte, error)` +- New function `PossibleDayOfWeekValues() []DayOfWeek` +- New function `PossibleSessionHostComponentUpdateTypeValues() []SessionHostComponentUpdateType` +- New function `AgentUpdateProperties.MarshalJSON() ([]byte, error)` +- New struct `AgentUpdatePatchProperties` +- New struct `AgentUpdateProperties` +- New struct `MaintenanceWindowPatchProperties` +- New struct `MaintenanceWindowProperties` +- New anonymous field `ScalingPlan` in struct `ScalingPlansClientGetResponse` +- New anonymous field `RegistrationInfo` in struct `HostPoolsClientRetrieveRegistrationTokenResponse` +- New field `FriendlyName` in struct `SessionHostProperties` +- New anonymous field `PrivateEndpointConnectionWithSystemData` in struct `PrivateEndpointConnectionsClientUpdateByHostPoolResponse` +- New anonymous field `ApplicationGroup` in struct `ApplicationGroupsClientGetResponse` +- New anonymous field `StartMenuItemList` in struct `StartMenuItemsClientListResponse` +- New anonymous field `Workspace` in struct `WorkspacesClientCreateOrUpdateResponse` +- New anonymous field `WorkspaceList` in struct `WorkspacesClientListByResourceGroupResponse` +- New field `PrivateEndpointConnections` in struct `HostPoolProperties` +- New field `AgentUpdate` in struct `HostPoolProperties` +- New anonymous field `ResourceProviderOperationList` in struct `OperationsClientListResponse` +- New anonymous field `MSIXPackage` in struct `MSIXPackagesClientUpdateResponse` +- New anonymous field `ApplicationGroup` in struct `ApplicationGroupsClientCreateOrUpdateResponse` +- New anonymous field `UserSession` in struct `UserSessionsClientGetResponse` +- New anonymous field `ApplicationGroupList` in struct `ApplicationGroupsClientListBySubscriptionResponse` +- New anonymous field `Desktop` in struct `DesktopsClientUpdateResponse` +- New anonymous field `PrivateEndpointConnectionWithSystemData` in struct `PrivateEndpointConnectionsClientGetByWorkspaceResponse` +- New field `PrivateEndpointConnections` in struct `WorkspaceProperties` +- New anonymous field `PrivateLinkResourceListResult` in struct `PrivateLinkResourcesClientListByWorkspaceResponse` +- New anonymous field `ScalingPlanList` in struct `ScalingPlansClientListBySubscriptionResponse` +- New anonymous field `PrivateEndpointConnectionListResultWithSystemData` in struct `PrivateEndpointConnectionsClientListByHostPoolResponse` +- New anonymous field `MSIXPackageList` in struct `MSIXPackagesClientListResponse` +- New anonymous field `HostPool` in struct `HostPoolsClientGetResponse` +- New field `FriendlyName` in struct `SessionHostPatchProperties` +- New anonymous field `HostPoolList` in struct `HostPoolsClientListResponse` +- New anonymous field `SessionHost` in struct `SessionHostsClientUpdateResponse` +- New anonymous field `Application` in struct `ApplicationsClientGetResponse` +- New anonymous field `MSIXPackage` in struct `MSIXPackagesClientGetResponse` +- New anonymous field `PrivateLinkResourceListResult` in struct `PrivateLinkResourcesClientListByHostPoolResponse` +- New anonymous field `ScalingPlan` in struct `ScalingPlansClientUpdateResponse` +- New anonymous field `ScalingPlan` in struct `ScalingPlansClientCreateResponse` +- New anonymous field `Desktop` in struct `DesktopsClientGetResponse` +- New anonymous field `UserSessionList` in struct `UserSessionsClientListByHostPoolResponse` +- New anonymous field `HostPool` in struct `HostPoolsClientUpdateResponse` +- New anonymous field `DesktopList` in struct `DesktopsClientListResponse` +- New anonymous field `Application` in struct `ApplicationsClientUpdateResponse` +- New anonymous field `HostPoolList` in struct `HostPoolsClientListByResourceGroupResponse` +- New anonymous field `ScalingPlanList` in struct `ScalingPlansClientListByResourceGroupResponse` +- New anonymous field `Workspace` in struct `WorkspacesClientGetResponse` +- New anonymous field `ScalingPlanList` in struct `ScalingPlansClientListByHostPoolResponse` +- New anonymous field `PrivateEndpointConnectionListResultWithSystemData` in struct `PrivateEndpointConnectionsClientListByWorkspaceResponse` +- New anonymous field `ApplicationGroup` in struct `ApplicationGroupsClientUpdateResponse` +- New anonymous field `Workspace` in struct `WorkspacesClientUpdateResponse` +- New anonymous field `SessionHost` in struct `SessionHostsClientGetResponse` +- New anonymous field `ExpandMsixImageList` in struct `MsixImagesClientExpandResponse` +- New anonymous field `HostPool` in struct `HostPoolsClientCreateOrUpdateResponse` +- New anonymous field `WorkspaceList` in struct `WorkspacesClientListBySubscriptionResponse` +- New anonymous field `PrivateEndpointConnectionWithSystemData` in struct `PrivateEndpointConnectionsClientGetByHostPoolResponse` +- New anonymous field `SessionHostList` in struct `SessionHostsClientListResponse` +- New field `AgentUpdate` in struct `HostPoolPatchProperties` +- New anonymous field `MSIXPackage` in struct `MSIXPackagesClientCreateOrUpdateResponse` +- New anonymous field `ApplicationGroupList` in struct `ApplicationGroupsClientListByResourceGroupResponse` +- New anonymous field `ApplicationList` in struct `ApplicationsClientListResponse` +- New anonymous field `Application` in struct `ApplicationsClientCreateOrUpdateResponse` +- New anonymous field `PrivateEndpointConnectionWithSystemData` in struct `PrivateEndpointConnectionsClientUpdateByWorkspaceResponse` +- New anonymous field `UserSessionList` in struct `UserSessionsClientListResponse` + + ## 0.2.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md index 97e16f5e573b..2c552fcdd681 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/README.md @@ -11,7 +11,7 @@ The `armdesktopvirtualization` module provides operations for working with Azure ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.16 or above +- Go 1.18 or above ## Install the package @@ -38,16 +38,18 @@ For more information on authentication, please see the documentation for `aziden Azure Virtual Desktop 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 := armdesktopvirtualization.NewWorkspacesClient(, cred, nil) +client, err := armdesktopvirtualization.NewWorkspacesClient(, 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{ - Host: arm.AzureChina, +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, } -client := armdesktopvirtualization.NewWorkspacesClient(, cred, &options) +client, err := armdesktopvirtualization.NewWorkspacesClient(, cred, &options) ``` ## Provide Feedback diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md index 0d527c8e6a6b..ee54e47c5f34 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/desktopvirtualization/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/desktopvirtualization/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/desktopvirtualization/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/desktopvirtualization/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.1 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod index 61b89e056422..bff318fe4f54 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.mod @@ -1,8 +1,21 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization -go 1.16 +go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect + github.com/golang-jwt/jwt v3.2.1+incompatible // indirect + github.com/google/uuid v1.1.1 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect + golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum index 2ce51d3b8174..56d1c32628ae 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/go.sum @@ -1,18 +1,18 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= 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/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -32,21 +32,16 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -56,4 +51,3 @@ 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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go index f4d0ab805615..05452457e6c7 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applicationgroups_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,147 +17,182 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ApplicationGroup_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_Get.json func ExampleApplicationGroupsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ApplicationGroupsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ApplicationGroup_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_Create.json func ExampleApplicationGroupsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", armdesktopvirtualization.ApplicationGroup{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{ - "tag1": to.StringPtr("value1"), - "tag2": to.StringPtr("value2"), + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), }, Properties: &armdesktopvirtualization.ApplicationGroupProperties{ - Description: to.StringPtr(""), - ApplicationGroupType: armdesktopvirtualization.ApplicationGroupType("RemoteApp").ToPtr(), - FriendlyName: to.StringPtr(""), - HostPoolArmPath: to.StringPtr(""), + Description: to.Ptr(""), + ApplicationGroupType: to.Ptr(armdesktopvirtualization.ApplicationGroupTypeRemoteApp), + FriendlyName: to.Ptr(""), + HostPoolArmPath: to.Ptr(""), MigrationRequest: &armdesktopvirtualization.MigrationRequestProperties{ - MigrationPath: to.StringPtr(""), - Operation: armdesktopvirtualization.Operation("Start").ToPtr(), + MigrationPath: to.Ptr(""), + Operation: to.Ptr(armdesktopvirtualization.OperationStart), }, }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ApplicationGroupsClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ApplicationGroup_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_Delete.json func ExampleApplicationGroupsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ApplicationGroup_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_Update.json func ExampleApplicationGroupsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", &armdesktopvirtualization.ApplicationGroupsClientUpdateOptions{ApplicationGroup: &armdesktopvirtualization.ApplicationGroupPatch{ Properties: &armdesktopvirtualization.ApplicationGroupPatchProperties{ - Description: to.StringPtr(""), - FriendlyName: to.StringPtr(""), + Description: to.Ptr(""), + FriendlyName: to.Ptr(""), }, Tags: map[string]*string{ - "tag1": to.StringPtr("value1"), - "tag2": to.StringPtr("value2"), + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), }, }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ApplicationGroupsClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ApplicationGroup_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_ListByResourceGroup.json func ExampleApplicationGroupsClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByResourceGroup("", - &armdesktopvirtualization.ApplicationGroupsClientListByResourceGroupOptions{Filter: to.StringPtr("")}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + &armdesktopvirtualization.ApplicationGroupsClientListByResourceGroupOptions{Filter: to.Ptr("")}) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ApplicationGroup_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ApplicationGroup_ListBySubscription.json func ExampleApplicationGroupsClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) - pager := client.ListBySubscription(&armdesktopvirtualization.ApplicationGroupsClientListBySubscriptionOptions{Filter: to.StringPtr("")}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + client, err := armdesktopvirtualization.NewApplicationGroupsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } + pager := client.ListBySubscription(&armdesktopvirtualization.ApplicationGroupsClientListBySubscriptionOptions{Filter: to.Ptr("")}) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go index 3388c0159090..495fe799532f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_applications_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,127 +17,158 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Application_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_Get.json func ExampleApplicationsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ApplicationsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Application_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_Create.json func ExampleApplicationsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", "", armdesktopvirtualization.Application{ Properties: &armdesktopvirtualization.ApplicationProperties{ - Description: to.StringPtr(""), - CommandLineArguments: to.StringPtr(""), - CommandLineSetting: armdesktopvirtualization.CommandLineSetting("Allow").ToPtr(), - FilePath: to.StringPtr(""), - FriendlyName: to.StringPtr(""), - IconIndex: to.Int32Ptr(1), - IconPath: to.StringPtr(""), - ShowInPortal: to.BoolPtr(true), + Description: to.Ptr(""), + CommandLineArguments: to.Ptr(""), + CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), + FilePath: to.Ptr(""), + FriendlyName: to.Ptr(""), + IconIndex: to.Ptr[int32](1), + IconPath: to.Ptr(""), + ShowInPortal: to.Ptr(true), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ApplicationsClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Application_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_Delete.json func ExampleApplicationsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Application_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_Update.json func ExampleApplicationsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", "", &armdesktopvirtualization.ApplicationsClientUpdateOptions{Application: &armdesktopvirtualization.ApplicationPatch{ Properties: &armdesktopvirtualization.ApplicationPatchProperties{ - Description: to.StringPtr(""), - ApplicationType: armdesktopvirtualization.RemoteApplicationType("InBuilt").ToPtr(), - CommandLineArguments: to.StringPtr(""), - CommandLineSetting: armdesktopvirtualization.CommandLineSetting("Allow").ToPtr(), - FilePath: to.StringPtr(""), - FriendlyName: to.StringPtr(""), - IconIndex: to.Int32Ptr(1), - IconPath: to.StringPtr(""), - ShowInPortal: to.BoolPtr(true), + Description: to.Ptr(""), + ApplicationType: to.Ptr(armdesktopvirtualization.RemoteApplicationTypeInBuilt), + CommandLineArguments: to.Ptr(""), + CommandLineSetting: to.Ptr(armdesktopvirtualization.CommandLineSettingAllow), + FilePath: to.Ptr(""), + FriendlyName: to.Ptr(""), + IconIndex: to.Ptr[int32](1), + IconPath: to.Ptr(""), + ShowInPortal: to.Ptr(true), }, }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ApplicationsClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Application_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Application_List.json func ExampleApplicationsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + client, err := armdesktopvirtualization.NewApplicationsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go index 5ca558169e67..fa4b1fa0e22a 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_desktops_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,71 +17,89 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Desktop_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Desktop_Get.json func ExampleDesktopsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewDesktopsClient("", cred, nil) + client, err := armdesktopvirtualization.NewDesktopsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DesktopsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Desktop_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Desktop_Update.json func ExampleDesktopsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewDesktopsClient("", cred, nil) + client, err := armdesktopvirtualization.NewDesktopsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", "", &armdesktopvirtualization.DesktopsClientUpdateOptions{Desktop: &armdesktopvirtualization.DesktopPatch{ Properties: &armdesktopvirtualization.DesktopPatchProperties{ - Description: to.StringPtr(""), - FriendlyName: to.StringPtr(""), + Description: to.Ptr(""), + FriendlyName: to.Ptr(""), }, }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DesktopsClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Desktop_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Desktop_List.json func ExampleDesktopsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewDesktopsClient("", cred, nil) + client, err := armdesktopvirtualization.NewDesktopsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go index 0bbeaa5df95a..823069792bf5 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_hostpools_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,193 +19,263 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/HostPool_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_Get.json func ExampleHostPoolsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + client, err := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.HostPoolsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/HostPool_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_Create.json func ExampleHostPoolsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + client, err := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", armdesktopvirtualization.HostPool{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{ - "tag1": to.StringPtr("value1"), - "tag2": to.StringPtr("value2"), + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), }, Properties: &armdesktopvirtualization.HostPoolProperties{ - Description: to.StringPtr(""), - FriendlyName: to.StringPtr(""), - HostPoolType: armdesktopvirtualization.HostPoolType("Pooled").ToPtr(), - LoadBalancerType: armdesktopvirtualization.LoadBalancerType("BreadthFirst").ToPtr(), - MaxSessionLimit: to.Int32Ptr(999999), + Description: to.Ptr(""), + AgentUpdate: &armdesktopvirtualization.AgentUpdateProperties{ + Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), + MaintenanceWindowTimeZone: to.Ptr(""), + MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowProperties{ + { + DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), + Hour: to.Ptr[int32](7), + }, + { + DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), + Hour: to.Ptr[int32](8), + }}, + UseSessionHostLocalTime: to.Ptr(false), + }, + FriendlyName: to.Ptr(""), + HostPoolType: to.Ptr(armdesktopvirtualization.HostPoolTypePooled), + LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), + MaxSessionLimit: to.Ptr[int32](999999), MigrationRequest: &armdesktopvirtualization.MigrationRequestProperties{ - MigrationPath: to.StringPtr(""), - Operation: armdesktopvirtualization.Operation("Start").ToPtr(), + MigrationPath: to.Ptr(""), + Operation: to.Ptr(armdesktopvirtualization.OperationStart), }, - PersonalDesktopAssignmentType: armdesktopvirtualization.PersonalDesktopAssignmentType("Automatic").ToPtr(), - PreferredAppGroupType: armdesktopvirtualization.PreferredAppGroupType("Desktop").ToPtr(), - PublicNetworkAccess: armdesktopvirtualization.PublicNetworkAccess("Enabled").ToPtr(), + PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), + PreferredAppGroupType: to.Ptr(armdesktopvirtualization.PreferredAppGroupTypeDesktop), + PublicNetworkAccess: to.Ptr(armdesktopvirtualization.HostpoolPublicNetworkAccessEnabled), RegistrationInfo: &armdesktopvirtualization.RegistrationInfo{ - ExpirationTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T14:01:54.9571247Z"); return t }()), - RegistrationTokenOperation: armdesktopvirtualization.RegistrationTokenOperation("Update").ToPtr(), + ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T14:01:54.9571247Z"); return t }()), + RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), }, - SsoClientID: to.StringPtr(""), - SsoClientSecretKeyVaultPath: to.StringPtr(""), - SsoSecretType: armdesktopvirtualization.SSOSecretType("SharedKey").ToPtr(), - SsoadfsAuthority: to.StringPtr(""), - StartVMOnConnect: to.BoolPtr(false), - VMTemplate: to.StringPtr(""), + SsoClientID: to.Ptr(""), + SsoClientSecretKeyVaultPath: to.Ptr(""), + SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), + SsoadfsAuthority: to.Ptr(""), + StartVMOnConnect: to.Ptr(false), + VMTemplate: to.Ptr(""), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.HostPoolsClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/HostPool_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_Delete.json func ExampleHostPoolsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + client, err := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", - &armdesktopvirtualization.HostPoolsClientDeleteOptions{Force: to.BoolPtr(true)}) + &armdesktopvirtualization.HostPoolsClientDeleteOptions{Force: to.Ptr(true)}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/HostPool_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_Update.json func ExampleHostPoolsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + client, err := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", &armdesktopvirtualization.HostPoolsClientUpdateOptions{HostPool: &armdesktopvirtualization.HostPoolPatch{ Properties: &armdesktopvirtualization.HostPoolPatchProperties{ - Description: to.StringPtr(""), - FriendlyName: to.StringPtr(""), - LoadBalancerType: armdesktopvirtualization.LoadBalancerType("BreadthFirst").ToPtr(), - MaxSessionLimit: to.Int32Ptr(999999), - PersonalDesktopAssignmentType: armdesktopvirtualization.PersonalDesktopAssignmentType("Automatic").ToPtr(), - PublicNetworkAccess: armdesktopvirtualization.PublicNetworkAccess("Enabled").ToPtr(), + Description: to.Ptr(""), + AgentUpdate: &armdesktopvirtualization.AgentUpdatePatchProperties{ + Type: to.Ptr(armdesktopvirtualization.SessionHostComponentUpdateTypeScheduled), + MaintenanceWindowTimeZone: to.Ptr(""), + MaintenanceWindows: []*armdesktopvirtualization.MaintenanceWindowPatchProperties{ + { + DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekFriday), + Hour: to.Ptr[int32](7), + }, + { + DayOfWeek: to.Ptr(armdesktopvirtualization.DayOfWeekSaturday), + Hour: to.Ptr[int32](8), + }}, + UseSessionHostLocalTime: to.Ptr(false), + }, + FriendlyName: to.Ptr(""), + LoadBalancerType: to.Ptr(armdesktopvirtualization.LoadBalancerTypeBreadthFirst), + MaxSessionLimit: to.Ptr[int32](999999), + PersonalDesktopAssignmentType: to.Ptr(armdesktopvirtualization.PersonalDesktopAssignmentTypeAutomatic), + PublicNetworkAccess: to.Ptr(armdesktopvirtualization.HostpoolPublicNetworkAccessEnabled), RegistrationInfo: &armdesktopvirtualization.RegistrationInfoPatch{ - ExpirationTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T15:01:54.9571247Z"); return t }()), - RegistrationTokenOperation: armdesktopvirtualization.RegistrationTokenOperation("Update").ToPtr(), + ExpirationTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-10-01T15:01:54.9571247Z"); return t }()), + RegistrationTokenOperation: to.Ptr(armdesktopvirtualization.RegistrationTokenOperationUpdate), }, - SsoClientID: to.StringPtr(""), - SsoClientSecretKeyVaultPath: to.StringPtr(""), - SsoSecretType: armdesktopvirtualization.SSOSecretType("SharedKey").ToPtr(), - SsoadfsAuthority: to.StringPtr(""), - StartVMOnConnect: to.BoolPtr(false), - VMTemplate: to.StringPtr(""), + SsoClientID: to.Ptr(""), + SsoClientSecretKeyVaultPath: to.Ptr(""), + SsoSecretType: to.Ptr(armdesktopvirtualization.SSOSecretTypeSharedKey), + SsoadfsAuthority: to.Ptr(""), + StartVMOnConnect: to.Ptr(false), + VMTemplate: to.Ptr(""), }, Tags: map[string]*string{ - "tag1": to.StringPtr("value1"), - "tag2": to.StringPtr("value2"), + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), }, }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.HostPoolsClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/HostPool_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_ListByResourceGroup.json func ExampleHostPoolsClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + client, err := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByResourceGroup("", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/HostPool_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPool_List.json func ExampleHostPoolsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + client, err := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/HostPools_RetrieveRegistrationToken_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/HostPools_RetrieveRegistrationToken_Post.json func ExampleHostPoolsClient_RetrieveRegistrationToken() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + client, err := armdesktopvirtualization.NewHostPoolsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.RetrieveRegistrationToken(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.HostPoolsClientRetrieveRegistrationTokenResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go index b6f9d68c7e34..adf0657d9431 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msiximages_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,30 +17,34 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/MsixImage_Expand_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixImage_Expand_Post.json func ExampleMsixImagesClient_Expand() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewMsixImagesClient("", cred, nil) + client, err := armdesktopvirtualization.NewMsixImagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.Expand("", "", armdesktopvirtualization.MSIXImageURI{ - URI: to.StringPtr(""), + URI: to.Ptr(""), }, nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go index caa04156f466..7db1d284d7ce 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_msixpackages_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,138 +19,169 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/MsixPackage_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_Get.json func ExampleMSIXPackagesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + client, err := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.MSIXPackagesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/MsixPackage_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_Create.json func ExampleMSIXPackagesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + client, err := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", "", armdesktopvirtualization.MSIXPackage{ Properties: &armdesktopvirtualization.MSIXPackageProperties{ - DisplayName: to.StringPtr(""), - ImagePath: to.StringPtr(""), - IsActive: to.BoolPtr(false), - IsRegularRegistration: to.BoolPtr(false), - LastUpdated: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.9571247Z"); return t }()), + DisplayName: to.Ptr(""), + ImagePath: to.Ptr(""), + IsActive: to.Ptr(false), + IsRegularRegistration: to.Ptr(false), + LastUpdated: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2008-09-22T14:01:54.9571247Z"); return t }()), PackageApplications: []*armdesktopvirtualization.MsixPackageApplications{ { - Description: to.StringPtr(""), - AppID: to.StringPtr(""), - AppUserModelID: to.StringPtr(""), - FriendlyName: to.StringPtr(""), - IconImageName: to.StringPtr(""), + Description: to.Ptr(""), + AppID: to.Ptr(""), + AppUserModelID: to.Ptr(""), + FriendlyName: to.Ptr(""), + IconImageName: to.Ptr(""), RawIcon: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), RawPNG: []byte("VGhpcyBpcyBhIHN0cmluZyB0byBoYXNo"), }}, PackageDependencies: []*armdesktopvirtualization.MsixPackageDependencies{ { - DependencyName: to.StringPtr(""), - MinVersion: to.StringPtr(""), - Publisher: to.StringPtr(""), + DependencyName: to.Ptr(""), + MinVersion: to.Ptr(""), + Publisher: to.Ptr(""), }}, - PackageFamilyName: to.StringPtr(""), - PackageName: to.StringPtr(""), - PackageRelativePath: to.StringPtr(""), - Version: to.StringPtr(""), + PackageFamilyName: to.Ptr(""), + PackageName: to.Ptr(""), + PackageRelativePath: to.Ptr(""), + Version: to.Ptr(""), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.MSIXPackagesClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/MsixPackage_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_Delete.json func ExampleMSIXPackagesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + client, err := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/MsixPackage_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_Update.json func ExampleMSIXPackagesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + client, err := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", "", &armdesktopvirtualization.MSIXPackagesClientUpdateOptions{MsixPackage: &armdesktopvirtualization.MSIXPackagePatch{ Properties: &armdesktopvirtualization.MSIXPackagePatchProperties{ - DisplayName: to.StringPtr(""), - IsActive: to.BoolPtr(true), - IsRegularRegistration: to.BoolPtr(false), + DisplayName: to.Ptr(""), + IsActive: to.Ptr(true), + IsRegularRegistration: to.Ptr(false), }, }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.MSIXPackagesClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/MsixPackage_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/MsixPackage_List.json func ExampleMSIXPackagesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + client, err := armdesktopvirtualization.NewMSIXPackagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go index 757b5bedbd6a..84438addfd51 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_operations_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,25 +16,29 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/OperationDescription_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/OperationDescription_List.json func ExampleOperationsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewOperationsClient(cred, nil) + client, err := armdesktopvirtualization.NewOperationsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go index bc4646035d8f..836765290045 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privateendpointconnections_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,76 +17,98 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateEndpointConnection_ListByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_ListByHostPool.json func ExamplePrivateEndpointConnectionsClient_ListByHostPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByHostPool("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateEndpointConnection_GetByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_GetByHostPool.json func ExamplePrivateEndpointConnectionsClient_GetByHostPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.GetByHostPool(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientGetByHostPoolResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateEndpointConnection_DeleteByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_DeleteByHostPool.json func ExamplePrivateEndpointConnectionsClient_DeleteByHostPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.DeleteByHostPool(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateEndpointConnection_UpdateByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_UpdateByHostPool.json func ExamplePrivateEndpointConnectionsClient_UpdateByHostPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.UpdateByHostPool(ctx, "", "", @@ -94,89 +116,113 @@ func ExamplePrivateEndpointConnectionsClient_UpdateByHostPool() { armdesktopvirtualization.PrivateEndpointConnection{ Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - Description: to.StringPtr(""), - ActionsRequired: to.StringPtr(""), - Status: armdesktopvirtualization.PrivateEndpointServiceConnectionStatus("Approved").ToPtr(), + Description: to.Ptr(""), + ActionsRequired: to.Ptr(""), + Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), }, }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientUpdateByHostPoolResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateEndpointConnection_ListByWorkspace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_ListByWorkspace.json func ExamplePrivateEndpointConnectionsClient_ListByWorkspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByWorkspace("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateEndpointConnection_GetByWorkspace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_GetByWorkspace.json func ExamplePrivateEndpointConnectionsClient_GetByWorkspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.GetByWorkspace(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientGetByWorkspaceResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateEndpointConnection_DeleteByWorkspace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_DeleteByWorkspace.json func ExamplePrivateEndpointConnectionsClient_DeleteByWorkspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.DeleteByWorkspace(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateEndpointConnection_UpdateByWorkspace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateEndpointConnection_UpdateByWorkspace.json func ExamplePrivateEndpointConnectionsClient_UpdateByWorkspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.UpdateByWorkspace(ctx, "", "", @@ -184,15 +230,17 @@ func ExamplePrivateEndpointConnectionsClient_UpdateByWorkspace() { armdesktopvirtualization.PrivateEndpointConnection{ Properties: &armdesktopvirtualization.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armdesktopvirtualization.PrivateLinkServiceConnectionState{ - Description: to.StringPtr(""), - ActionsRequired: to.StringPtr(""), - Status: armdesktopvirtualization.PrivateEndpointServiceConnectionStatus("Approved").ToPtr(), + Description: to.Ptr(""), + ActionsRequired: to.Ptr(""), + Status: to.Ptr(armdesktopvirtualization.PrivateEndpointServiceConnectionStatusApproved), }, }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientUpdateByWorkspaceResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go index 8c0c9354748a..13420f0974ae 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_privatelinkresources_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,52 +16,60 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateLinkResources_ListByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateLinkResources_ListByHostPool.json func ExamplePrivateLinkResourcesClient_ListByHostPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateLinkResourcesClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateLinkResourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByHostPool("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/PrivateLinkResources_ListByWorkspace.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/PrivateLinkResources_ListByWorkspace.json func ExamplePrivateLinkResourcesClient_ListByWorkspace() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewPrivateLinkResourcesClient("", cred, nil) + client, err := armdesktopvirtualization.NewPrivateLinkResourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByWorkspace("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go index ad2efc4b537f..090652f1dc57 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_scalingplans_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,201 +17,240 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ScalingPlan_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_Get.json func ExampleScalingPlansClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + client, err := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ScalingPlansClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ScalingPlan_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_Create.json func ExampleScalingPlansClient_Create() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + client, err := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Create(ctx, "", "", armdesktopvirtualization.ScalingPlan{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{ - "tag1": to.StringPtr("value1"), - "tag2": to.StringPtr("value2"), + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), }, Properties: &armdesktopvirtualization.ScalingPlanProperties{ - Description: to.StringPtr(""), - ExclusionTag: to.StringPtr(""), - FriendlyName: to.StringPtr(""), + Description: to.Ptr(""), + ExclusionTag: to.Ptr(""), + FriendlyName: to.Ptr(""), HostPoolReferences: []*armdesktopvirtualization.ScalingHostPoolReference{ { - HostPoolArmPath: to.StringPtr(""), - ScalingPlanEnabled: to.BoolPtr(true), + HostPoolArmPath: to.Ptr(""), + ScalingPlanEnabled: to.Ptr(true), }}, - HostPoolType: armdesktopvirtualization.ScalingHostPoolType("Pooled").ToPtr(), + HostPoolType: to.Ptr(armdesktopvirtualization.ScalingHostPoolTypePooled), Schedules: []*armdesktopvirtualization.ScalingSchedule{ { - Name: to.StringPtr(""), + Name: to.Ptr(""), DaysOfWeek: []*armdesktopvirtualization.ScalingScheduleDaysOfWeekItem{ - armdesktopvirtualization.ScalingScheduleDaysOfWeekItem("Monday").ToPtr(), - armdesktopvirtualization.ScalingScheduleDaysOfWeekItem("Tuesday").ToPtr(), - armdesktopvirtualization.ScalingScheduleDaysOfWeekItem("Wednesday").ToPtr(), - armdesktopvirtualization.ScalingScheduleDaysOfWeekItem("Thursday").ToPtr(), - armdesktopvirtualization.ScalingScheduleDaysOfWeekItem("Friday").ToPtr()}, - OffPeakLoadBalancingAlgorithm: armdesktopvirtualization.SessionHostLoadBalancingAlgorithm("DepthFirst").ToPtr(), + to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemMonday), + to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemTuesday), + to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemWednesday), + to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemThursday), + to.Ptr(armdesktopvirtualization.ScalingScheduleDaysOfWeekItemFriday)}, + OffPeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), OffPeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Int32Ptr(20), - Minute: to.Int32Ptr(0), + Hour: to.Ptr[int32](20), + Minute: to.Ptr[int32](0), }, - PeakLoadBalancingAlgorithm: armdesktopvirtualization.SessionHostLoadBalancingAlgorithm("BreadthFirst").ToPtr(), + PeakLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmBreadthFirst), PeakStartTime: &armdesktopvirtualization.Time{ - Hour: to.Int32Ptr(8), - Minute: to.Int32Ptr(0), + Hour: to.Ptr[int32](8), + Minute: to.Ptr[int32](0), }, - RampDownCapacityThresholdPct: to.Int32Ptr(50), - RampDownForceLogoffUsers: to.BoolPtr(true), - RampDownLoadBalancingAlgorithm: armdesktopvirtualization.SessionHostLoadBalancingAlgorithm("DepthFirst").ToPtr(), - RampDownMinimumHostsPct: to.Int32Ptr(20), - RampDownNotificationMessage: to.StringPtr(""), + RampDownCapacityThresholdPct: to.Ptr[int32](50), + RampDownForceLogoffUsers: to.Ptr(true), + RampDownLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), + RampDownMinimumHostsPct: to.Ptr[int32](20), + RampDownNotificationMessage: to.Ptr(""), RampDownStartTime: &armdesktopvirtualization.Time{ - Hour: to.Int32Ptr(18), - Minute: to.Int32Ptr(0), + Hour: to.Ptr[int32](18), + Minute: to.Ptr[int32](0), }, - RampDownWaitTimeMinutes: to.Int32Ptr(30), - RampUpCapacityThresholdPct: to.Int32Ptr(80), - RampUpLoadBalancingAlgorithm: armdesktopvirtualization.SessionHostLoadBalancingAlgorithm("DepthFirst").ToPtr(), - RampUpMinimumHostsPct: to.Int32Ptr(20), + RampDownWaitTimeMinutes: to.Ptr[int32](30), + RampUpCapacityThresholdPct: to.Ptr[int32](80), + RampUpLoadBalancingAlgorithm: to.Ptr(armdesktopvirtualization.SessionHostLoadBalancingAlgorithmDepthFirst), + RampUpMinimumHostsPct: to.Ptr[int32](20), RampUpStartTime: &armdesktopvirtualization.Time{ - Hour: to.Int32Ptr(6), - Minute: to.Int32Ptr(0), + Hour: to.Ptr[int32](6), + Minute: to.Ptr[int32](0), }, }}, - TimeZone: to.StringPtr(""), + TimeZone: to.Ptr(""), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ScalingPlansClientCreateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ScalingPlan_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_Delete.json func ExampleScalingPlansClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + client, err := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ScalingPlan_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_Update.json func ExampleScalingPlansClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + client, err := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", &armdesktopvirtualization.ScalingPlansClientUpdateOptions{ScalingPlan: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ScalingPlansClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ScalingPlan_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_ListByResourceGroup.json func ExampleScalingPlansClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + client, err := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByResourceGroup("", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ScalingPlan_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_ListBySubscription.json func ExampleScalingPlansClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + client, err := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListBySubscription(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/ScalingPlan_ListByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/ScalingPlan_ListByHostPool.json func ExampleScalingPlansClient_ListByHostPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + client, err := armdesktopvirtualization.NewScalingPlansClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByHostPool("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go index 7e72250bc390..81c7df696ad7 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_sessionhosts_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,90 +17,115 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/SessionHost_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/SessionHost_Get.json func ExampleSessionHostsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewSessionHostsClient("", cred, nil) + client, err := armdesktopvirtualization.NewSessionHostsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.SessionHostsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/SessionHost_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/SessionHost_Delete.json func ExampleSessionHostsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewSessionHostsClient("", cred, nil) + client, err := armdesktopvirtualization.NewSessionHostsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", "", - &armdesktopvirtualization.SessionHostsClientDeleteOptions{Force: to.BoolPtr(true)}) + &armdesktopvirtualization.SessionHostsClientDeleteOptions{Force: to.Ptr(true)}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/SessionHost_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/SessionHost_Update.json func ExampleSessionHostsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewSessionHostsClient("", cred, nil) + client, err := armdesktopvirtualization.NewSessionHostsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", "", - &armdesktopvirtualization.SessionHostsClientUpdateOptions{Force: to.BoolPtr(true), + &armdesktopvirtualization.SessionHostsClientUpdateOptions{Force: to.Ptr(true), SessionHost: &armdesktopvirtualization.SessionHostPatch{ Properties: &armdesktopvirtualization.SessionHostPatchProperties{ - AllowNewSession: to.BoolPtr(true), - AssignedUser: to.StringPtr(""), + AllowNewSession: to.Ptr(true), + AssignedUser: to.Ptr(""), + FriendlyName: to.Ptr(""), }, }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.SessionHostsClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/SessionHost_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/SessionHost_List.json func ExampleSessionHostsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewSessionHostsClient("", cred, nil) + client, err := armdesktopvirtualization.NewSessionHostsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go index 2a4164961315..7a644e92c175 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_startmenuitems_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,27 +16,31 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/StartMenuItem_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/StartMenuItem_List.json func ExampleStartMenuItemsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewStartMenuItemsClient("", cred, nil) + client, err := armdesktopvirtualization.NewStartMenuItemsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go index 3529bd7ffb65..3ac50ba4390a 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_usersessions_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,39 +17,48 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/UserSession_ListByHostPool.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_ListByHostPool.json func ExampleUserSessionsClient_ListByHostPool() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByHostPool("", "", - &armdesktopvirtualization.UserSessionsClientListByHostPoolOptions{Filter: to.StringPtr("")}) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + &armdesktopvirtualization.UserSessionsClientListByHostPoolOptions{Filter: to.Ptr("")}) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/UserSession_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_Get.json func ExampleUserSessionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", @@ -57,64 +66,81 @@ func ExampleUserSessionsClient_Get() { "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.UserSessionsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/UserSession_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_Delete.json func ExampleUserSessionsClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", "", "", - &armdesktopvirtualization.UserSessionsClientDeleteOptions{Force: to.BoolPtr(true)}) + &armdesktopvirtualization.UserSessionsClientDeleteOptions{Force: to.Ptr(true)}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/UserSession_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_List.json func ExampleUserSessionsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/UserSession_Disconnect_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_Disconnect_Post.json func ExampleUserSessionsClient_Disconnect() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Disconnect(ctx, "", "", @@ -122,29 +148,36 @@ func ExampleUserSessionsClient_Disconnect() { "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/UserSession_SendMessage_Post.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/UserSession_SendMessage_Post.json func ExampleUserSessionsClient_SendMessage() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + client, err := armdesktopvirtualization.NewUserSessionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.SendMessage(ctx, "", "", "", "", &armdesktopvirtualization.UserSessionsClientSendMessageOptions{SendMessage: &armdesktopvirtualization.SendMessage{ - MessageBody: to.StringPtr(""), - MessageTitle: to.StringPtr(""), + MessageBody: to.Ptr(""), + MessageTitle: to.Ptr(""), }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go index d7d5456994ae..bbbc4c8df598 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/ze_generated_example_workspaces_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,142 +17,177 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization" ) -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Workspace_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_Get.json func ExampleWorkspacesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + client, err := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.WorkspacesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Workspace_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_Create.json func ExampleWorkspacesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + client, err := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", armdesktopvirtualization.Workspace{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{ - "tag1": to.StringPtr("value1"), - "tag2": to.StringPtr("value2"), + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), }, Properties: &armdesktopvirtualization.WorkspaceProperties{ - Description: to.StringPtr(""), - FriendlyName: to.StringPtr(""), + Description: to.Ptr(""), + FriendlyName: to.Ptr(""), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.WorkspacesClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Workspace_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_Delete.json func ExampleWorkspacesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + client, err := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Workspace_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_Update.json func ExampleWorkspacesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + client, err := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", &armdesktopvirtualization.WorkspacesClientUpdateOptions{Workspace: &armdesktopvirtualization.WorkspacePatch{ Properties: &armdesktopvirtualization.WorkspacePatchProperties{ - Description: to.StringPtr(""), - FriendlyName: to.StringPtr(""), - PublicNetworkAccess: armdesktopvirtualization.PublicNetworkAccess("Enabled").ToPtr(), + Description: to.Ptr(""), + FriendlyName: to.Ptr(""), + PublicNetworkAccess: to.Ptr(armdesktopvirtualization.PublicNetworkAccessEnabled), }, Tags: map[string]*string{ - "tag1": to.StringPtr("value1"), - "tag2": to.StringPtr("value2"), + "tag1": to.Ptr("value1"), + "tag2": to.Ptr("value2"), }, }, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.WorkspacesClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Workspace_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_ListByResourceGroup.json func ExampleWorkspacesClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + client, err := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByResourceGroup("", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2021-09-03-preview/examples/Workspace_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/desktopvirtualization/resource-manager/Microsoft.DesktopVirtualization/preview/2022-02-10-preview/examples/Workspace_ListBySubscription.json func ExampleWorkspacesClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + client, err := armdesktopvirtualization.NewWorkspacesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListBySubscription(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go index 504c34308a40..2eae10ebc08c 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applicationgroups_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type ApplicationGroupsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewApplicationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ApplicationGroupsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewApplicationGroupsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationGroupsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &ApplicationGroupsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Create or update an applicationGroup. @@ -91,7 +96,7 @@ func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, applicationGroup) @@ -99,7 +104,7 @@ func (client *ApplicationGroupsClient) createOrUpdateCreateRequest(ctx context.C // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *ApplicationGroupsClient) createOrUpdateHandleResponse(resp *http.Response) (ApplicationGroupsClientCreateOrUpdateResponse, error) { - result := ApplicationGroupsClientCreateOrUpdateResponse{RawResponse: resp} + result := ApplicationGroupsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGroup); err != nil { return ApplicationGroupsClientCreateOrUpdateResponse{}, err } @@ -124,7 +129,7 @@ func (client *ApplicationGroupsClient) Delete(ctx context.Context, resourceGroup if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ApplicationGroupsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ApplicationGroupsClientDeleteResponse{RawResponse: resp}, nil + return ApplicationGroupsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -147,7 +152,7 @@ func (client *ApplicationGroupsClient) deleteCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -193,7 +198,7 @@ func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -201,7 +206,7 @@ func (client *ApplicationGroupsClient) getCreateRequest(ctx context.Context, res // getHandleResponse handles the Get response. func (client *ApplicationGroupsClient) getHandleResponse(resp *http.Response) (ApplicationGroupsClientGetResponse, error) { - result := ApplicationGroupsClientGetResponse{RawResponse: resp} + result := ApplicationGroupsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGroup); err != nil { return ApplicationGroupsClientGetResponse{}, err } @@ -213,16 +218,32 @@ func (client *ApplicationGroupsClient) getHandleResponse(resp *http.Response) (A // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ApplicationGroupsClientListByResourceGroupOptions contains the optional parameters for the ApplicationGroupsClient.ListByResourceGroup // method. -func (client *ApplicationGroupsClient) ListByResourceGroup(resourceGroupName string, options *ApplicationGroupsClientListByResourceGroupOptions) *ApplicationGroupsClientListByResourceGroupPager { - return &ApplicationGroupsClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *ApplicationGroupsClient) ListByResourceGroup(resourceGroupName string, options *ApplicationGroupsClientListByResourceGroupOptions) *runtime.Pager[ApplicationGroupsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[ApplicationGroupsClientListByResourceGroupResponse]{ + More: func(page ApplicationGroupsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ApplicationGroupsClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ApplicationGroupList.NextLink) + Fetcher: func(ctx context.Context, page *ApplicationGroupsClientListByResourceGroupResponse) (ApplicationGroupsClientListByResourceGroupResponse, 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 ApplicationGroupsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ApplicationGroupsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGroupsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -241,7 +262,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupCreateRequest(ctx cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -252,7 +273,7 @@ func (client *ApplicationGroupsClient) listByResourceGroupCreateRequest(ctx cont // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *ApplicationGroupsClient) listByResourceGroupHandleResponse(resp *http.Response) (ApplicationGroupsClientListByResourceGroupResponse, error) { - result := ApplicationGroupsClientListByResourceGroupResponse{RawResponse: resp} + result := ApplicationGroupsClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGroupList); err != nil { return ApplicationGroupsClientListByResourceGroupResponse{}, err } @@ -263,16 +284,32 @@ func (client *ApplicationGroupsClient) listByResourceGroupHandleResponse(resp *h // If the operation fails it returns an *azcore.ResponseError type. // options - ApplicationGroupsClientListBySubscriptionOptions contains the optional parameters for the ApplicationGroupsClient.ListBySubscription // method. -func (client *ApplicationGroupsClient) ListBySubscription(options *ApplicationGroupsClientListBySubscriptionOptions) *ApplicationGroupsClientListBySubscriptionPager { - return &ApplicationGroupsClientListBySubscriptionPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) +func (client *ApplicationGroupsClient) ListBySubscription(options *ApplicationGroupsClientListBySubscriptionOptions) *runtime.Pager[ApplicationGroupsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PageProcessor[ApplicationGroupsClientListBySubscriptionResponse]{ + More: func(page ApplicationGroupsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ApplicationGroupsClientListBySubscriptionResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ApplicationGroupList.NextLink) + Fetcher: func(ctx context.Context, page *ApplicationGroupsClientListBySubscriptionResponse) (ApplicationGroupsClientListBySubscriptionResponse, 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 ApplicationGroupsClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ApplicationGroupsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationGroupsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) }, - } + }) } // listBySubscriptionCreateRequest creates the ListBySubscription request. @@ -287,7 +324,7 @@ func (client *ApplicationGroupsClient) listBySubscriptionCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -298,7 +335,7 @@ func (client *ApplicationGroupsClient) listBySubscriptionCreateRequest(ctx conte // listBySubscriptionHandleResponse handles the ListBySubscription response. func (client *ApplicationGroupsClient) listBySubscriptionHandleResponse(resp *http.Response) (ApplicationGroupsClientListBySubscriptionResponse, error) { - result := ApplicationGroupsClientListBySubscriptionResponse{RawResponse: resp} + result := ApplicationGroupsClientListBySubscriptionResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGroupList); err != nil { return ApplicationGroupsClientListBySubscriptionResponse{}, err } @@ -346,7 +383,7 @@ func (client *ApplicationGroupsClient) updateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.ApplicationGroup != nil { @@ -357,7 +394,7 @@ func (client *ApplicationGroupsClient) updateCreateRequest(ctx context.Context, // updateHandleResponse handles the Update response. func (client *ApplicationGroupsClient) updateHandleResponse(resp *http.Response) (ApplicationGroupsClientUpdateResponse, error) { - result := ApplicationGroupsClientUpdateResponse{RawResponse: resp} + result := ApplicationGroupsClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationGroup); err != nil { return ApplicationGroupsClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go index e9fa563e998e..c301fd7c85ae 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_applications_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type ApplicationsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ApplicationsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewApplicationsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ApplicationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &ApplicationsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Create or update an application. @@ -96,7 +101,7 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, application) @@ -104,7 +109,7 @@ func (client *ApplicationsClient) createOrUpdateCreateRequest(ctx context.Contex // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *ApplicationsClient) createOrUpdateHandleResponse(resp *http.Response) (ApplicationsClientCreateOrUpdateResponse, error) { - result := ApplicationsClientCreateOrUpdateResponse{RawResponse: resp} + result := ApplicationsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Application); err != nil { return ApplicationsClientCreateOrUpdateResponse{}, err } @@ -129,7 +134,7 @@ func (client *ApplicationsClient) Delete(ctx context.Context, resourceGroupName if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ApplicationsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ApplicationsClientDeleteResponse{RawResponse: resp}, nil + return ApplicationsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -156,7 +161,7 @@ func (client *ApplicationsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -207,7 +212,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -215,7 +220,7 @@ func (client *ApplicationsClient) getCreateRequest(ctx context.Context, resource // getHandleResponse handles the Get response. func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (ApplicationsClientGetResponse, error) { - result := ApplicationsClientGetResponse{RawResponse: resp} + result := ApplicationsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Application); err != nil { return ApplicationsClientGetResponse{}, err } @@ -227,16 +232,32 @@ func (client *ApplicationsClient) getHandleResponse(resp *http.Response) (Applic // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - ApplicationsClientListOptions contains the optional parameters for the ApplicationsClient.List method. -func (client *ApplicationsClient) List(resourceGroupName string, applicationGroupName string, options *ApplicationsClientListOptions) *ApplicationsClientListPager { - return &ApplicationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, applicationGroupName, options) +func (client *ApplicationsClient) List(resourceGroupName string, applicationGroupName string, options *ApplicationsClientListOptions) *runtime.Pager[ApplicationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[ApplicationsClientListResponse]{ + More: func(page ApplicationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ApplicationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ApplicationList.NextLink) + Fetcher: func(ctx context.Context, page *ApplicationsClientListResponse) (ApplicationsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, applicationGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ApplicationsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ApplicationsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ApplicationsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -259,7 +280,7 @@ func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -267,7 +288,7 @@ func (client *ApplicationsClient) listCreateRequest(ctx context.Context, resourc // listHandleResponse handles the List response. func (client *ApplicationsClient) listHandleResponse(resp *http.Response) (ApplicationsClientListResponse, error) { - result := ApplicationsClientListResponse{RawResponse: resp} + result := ApplicationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ApplicationList); err != nil { return ApplicationsClientListResponse{}, err } @@ -319,7 +340,7 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.Application != nil { @@ -330,7 +351,7 @@ func (client *ApplicationsClient) updateCreateRequest(ctx context.Context, resou // updateHandleResponse handles the Update response. func (client *ApplicationsClient) updateHandleResponse(resp *http.Response) (ApplicationsClientUpdateResponse, error) { - result := ApplicationsClientUpdateResponse{RawResponse: resp} + result := ApplicationsClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Application); err != nil { return ApplicationsClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go index e94087b6c680..e8a19d8becc6 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -10,7 +10,7 @@ package armdesktopvirtualization const ( moduleName = "armdesktopvirtualization" - moduleVersion = "v0.2.1" + moduleVersion = "v0.3.0" ) // ApplicationGroupType - Resource Type of ApplicationGroup. @@ -29,11 +29,6 @@ func PossibleApplicationGroupTypeValues() []ApplicationGroupType { } } -// ToPtr returns a *ApplicationGroupType pointing to the current value. -func (c ApplicationGroupType) ToPtr() *ApplicationGroupType { - return &c -} - // ApplicationType - Application type of application. type ApplicationType string @@ -50,11 +45,6 @@ func PossibleApplicationTypeValues() []ApplicationType { } } -// ToPtr returns a *ApplicationType pointing to the current value. -func (c ApplicationType) ToPtr() *ApplicationType { - return &c -} - // CommandLineSetting - Specifies whether this published application can be launched with command line arguments provided // by the client, command line arguments specified at publish time, or no command line arguments at all. type CommandLineSetting string @@ -74,11 +64,6 @@ func PossibleCommandLineSettingValues() []CommandLineSetting { } } -// ToPtr returns a *CommandLineSetting pointing to the current value. -func (c CommandLineSetting) ToPtr() *CommandLineSetting { - return &c -} - // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -99,9 +84,30 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// ToPtr returns a *CreatedByType pointing to the current value. -func (c CreatedByType) ToPtr() *CreatedByType { - return &c +// DayOfWeek - Day of the week. +type DayOfWeek string + +const ( + DayOfWeekMonday DayOfWeek = "Monday" + DayOfWeekTuesday DayOfWeek = "Tuesday" + DayOfWeekWednesday DayOfWeek = "Wednesday" + DayOfWeekThursday DayOfWeek = "Thursday" + DayOfWeekFriday DayOfWeek = "Friday" + DayOfWeekSaturday DayOfWeek = "Saturday" + DayOfWeekSunday DayOfWeek = "Sunday" +) + +// PossibleDayOfWeekValues returns the possible values for the DayOfWeek const type. +func PossibleDayOfWeekValues() []DayOfWeek { + return []DayOfWeek{ + DayOfWeekMonday, + DayOfWeekTuesday, + DayOfWeekWednesday, + DayOfWeekThursday, + DayOfWeekFriday, + DayOfWeekSaturday, + DayOfWeekSunday, + } } // HealthCheckName - Represents the name of the health check operation performed. @@ -171,11 +177,6 @@ func PossibleHealthCheckNameValues() []HealthCheckName { } } -// ToPtr returns a *HealthCheckName pointing to the current value. -func (c HealthCheckName) ToPtr() *HealthCheckName { - return &c -} - // HealthCheckResult - Represents the Health state of the health check we performed. type HealthCheckResult string @@ -200,11 +201,6 @@ func PossibleHealthCheckResultValues() []HealthCheckResult { } } -// ToPtr returns a *HealthCheckResult pointing to the current value. -func (c HealthCheckResult) ToPtr() *HealthCheckResult { - return &c -} - // HostPoolType - HostPool type for desktop. type HostPoolType string @@ -229,9 +225,25 @@ func PossibleHostPoolTypeValues() []HostPoolType { } } -// ToPtr returns a *HostPoolType pointing to the current value. -func (c HostPoolType) ToPtr() *HostPoolType { - return &c +// HostpoolPublicNetworkAccess - Enabled allows this resource to be accessed from both public and private networks, Disabled +// allows this resource to only be accessed via private endpoints +type HostpoolPublicNetworkAccess string + +const ( + HostpoolPublicNetworkAccessDisabled HostpoolPublicNetworkAccess = "Disabled" + HostpoolPublicNetworkAccessEnabled HostpoolPublicNetworkAccess = "Enabled" + HostpoolPublicNetworkAccessEnabledForClientsOnly HostpoolPublicNetworkAccess = "EnabledForClientsOnly" + HostpoolPublicNetworkAccessEnabledForSessionHostsOnly HostpoolPublicNetworkAccess = "EnabledForSessionHostsOnly" +) + +// PossibleHostpoolPublicNetworkAccessValues returns the possible values for the HostpoolPublicNetworkAccess const type. +func PossibleHostpoolPublicNetworkAccessValues() []HostpoolPublicNetworkAccess { + return []HostpoolPublicNetworkAccess{ + HostpoolPublicNetworkAccessDisabled, + HostpoolPublicNetworkAccessEnabled, + HostpoolPublicNetworkAccessEnabledForClientsOnly, + HostpoolPublicNetworkAccessEnabledForSessionHostsOnly, + } } // LoadBalancerType - The type of the load balancer. @@ -252,11 +264,6 @@ func PossibleLoadBalancerTypeValues() []LoadBalancerType { } } -// ToPtr returns a *LoadBalancerType pointing to the current value. -func (c LoadBalancerType) ToPtr() *LoadBalancerType { - return &c -} - // Operation - The type of operation for migration. type Operation string @@ -284,11 +291,6 @@ func PossibleOperationValues() []Operation { } } -// ToPtr returns a *Operation pointing to the current value. -func (c Operation) ToPtr() *Operation { - return &c -} - // PersonalDesktopAssignmentType - PersonalDesktopAssignment type for HostPool. type PersonalDesktopAssignmentType string @@ -305,11 +307,6 @@ func PossiblePersonalDesktopAssignmentTypeValues() []PersonalDesktopAssignmentTy } } -// ToPtr returns a *PersonalDesktopAssignmentType pointing to the current value. -func (c PersonalDesktopAssignmentType) ToPtr() *PersonalDesktopAssignmentType { - return &c -} - // PreferredAppGroupType - The type of preferred application group type, default to Desktop Application Group type PreferredAppGroupType string @@ -328,11 +325,6 @@ func PossiblePreferredAppGroupTypeValues() []PreferredAppGroupType { } } -// ToPtr returns a *PreferredAppGroupType pointing to the current value. -func (c PreferredAppGroupType) ToPtr() *PreferredAppGroupType { - return &c -} - // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -353,11 +345,6 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin } } -// ToPtr returns a *PrivateEndpointConnectionProvisioningState pointing to the current value. -func (c PrivateEndpointConnectionProvisioningState) ToPtr() *PrivateEndpointConnectionProvisioningState { - return &c -} - // PrivateEndpointServiceConnectionStatus - The private endpoint connection status. type PrivateEndpointServiceConnectionStatus string @@ -376,11 +363,6 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer } } -// ToPtr returns a *PrivateEndpointServiceConnectionStatus pointing to the current value. -func (c PrivateEndpointServiceConnectionStatus) ToPtr() *PrivateEndpointServiceConnectionStatus { - return &c -} - // PublicNetworkAccess - Enabled allows this resource to be accessed from both public and private networks, Disabled allows // this resource to only be accessed via private endpoints type PublicNetworkAccess string @@ -398,11 +380,6 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { } } -// ToPtr returns a *PublicNetworkAccess pointing to the current value. -func (c PublicNetworkAccess) ToPtr() *PublicNetworkAccess { - return &c -} - // RegistrationTokenOperation - The type of resetting the token. type RegistrationTokenOperation string @@ -421,11 +398,6 @@ func PossibleRegistrationTokenOperationValues() []RegistrationTokenOperation { } } -// ToPtr returns a *RegistrationTokenOperation pointing to the current value. -func (c RegistrationTokenOperation) ToPtr() *RegistrationTokenOperation { - return &c -} - // RemoteApplicationType - Resource Type of Application. type RemoteApplicationType string @@ -442,11 +414,6 @@ func PossibleRemoteApplicationTypeValues() []RemoteApplicationType { } } -// ToPtr returns a *RemoteApplicationType pointing to the current value. -func (c RemoteApplicationType) ToPtr() *RemoteApplicationType { - return &c -} - // SKUTier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but // is not required on a PUT. type SKUTier string @@ -468,11 +435,6 @@ func PossibleSKUTierValues() []SKUTier { } } -// ToPtr returns a *SKUTier pointing to the current value. -func (c SKUTier) ToPtr() *SKUTier { - return &c -} - // SSOSecretType - The type of single sign on Secret Type. type SSOSecretType string @@ -493,11 +455,6 @@ func PossibleSSOSecretTypeValues() []SSOSecretType { } } -// ToPtr returns a *SSOSecretType pointing to the current value. -func (c SSOSecretType) ToPtr() *SSOSecretType { - return &c -} - // ScalingHostPoolType - HostPool type for desktop. type ScalingHostPoolType string @@ -513,11 +470,6 @@ func PossibleScalingHostPoolTypeValues() []ScalingHostPoolType { } } -// ToPtr returns a *ScalingHostPoolType pointing to the current value. -func (c ScalingHostPoolType) ToPtr() *ScalingHostPoolType { - return &c -} - type ScalingScheduleDaysOfWeekItem string const ( @@ -543,9 +495,23 @@ func PossibleScalingScheduleDaysOfWeekItemValues() []ScalingScheduleDaysOfWeekIt } } -// ToPtr returns a *ScalingScheduleDaysOfWeekItem pointing to the current value. -func (c ScalingScheduleDaysOfWeekItem) ToPtr() *ScalingScheduleDaysOfWeekItem { - return &c +// SessionHostComponentUpdateType - The type of maintenance for session host components. +type SessionHostComponentUpdateType string + +const ( + // SessionHostComponentUpdateTypeDefault - Agent and other agent side components are delivery schedule is controlled by WVD + // Infra. + SessionHostComponentUpdateTypeDefault SessionHostComponentUpdateType = "Default" + // SessionHostComponentUpdateTypeScheduled - TenantAdmin have opted in for Scheduled Component Update feature. + SessionHostComponentUpdateTypeScheduled SessionHostComponentUpdateType = "Scheduled" +) + +// PossibleSessionHostComponentUpdateTypeValues returns the possible values for the SessionHostComponentUpdateType const type. +func PossibleSessionHostComponentUpdateTypeValues() []SessionHostComponentUpdateType { + return []SessionHostComponentUpdateType{ + SessionHostComponentUpdateTypeDefault, + SessionHostComponentUpdateTypeScheduled, + } } // SessionHostLoadBalancingAlgorithm - Load balancing algorithm for ramp up period. @@ -564,11 +530,6 @@ func PossibleSessionHostLoadBalancingAlgorithmValues() []SessionHostLoadBalancin } } -// ToPtr returns a *SessionHostLoadBalancingAlgorithm pointing to the current value. -func (c SessionHostLoadBalancingAlgorithm) ToPtr() *SessionHostLoadBalancingAlgorithm { - return &c -} - // SessionState - State of user session. type SessionState string @@ -593,11 +554,6 @@ func PossibleSessionStateValues() []SessionState { } } -// ToPtr returns a *SessionState pointing to the current value. -func (c SessionState) ToPtr() *SessionState { - return &c -} - // Status - Status for a SessionHost. type Status string @@ -650,11 +606,6 @@ func PossibleStatusValues() []Status { } } -// ToPtr returns a *Status pointing to the current value. -func (c Status) ToPtr() *Status { - return &c -} - // StopHostsWhen - Specifies when to stop hosts during ramp down period. type StopHostsWhen string @@ -671,11 +622,6 @@ func PossibleStopHostsWhenValues() []StopHostsWhen { } } -// ToPtr returns a *StopHostsWhen pointing to the current value. -func (c StopHostsWhen) ToPtr() *StopHostsWhen { - return &c -} - // UpdateState - Update state of a SessionHost. type UpdateState string @@ -697,8 +643,3 @@ func PossibleUpdateStateValues() []UpdateState { UpdateStateSucceeded, } } - -// ToPtr returns a *UpdateState pointing to the current value. -func (c UpdateState) ToPtr() *UpdateState { - return &c -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go index 06637c4017a4..4d1f247b4e1d 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_desktops_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type DesktopsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewDesktopsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DesktopsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewDesktopsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DesktopsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &DesktopsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Get a desktop. @@ -94,7 +99,7 @@ func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGrou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -102,7 +107,7 @@ func (client *DesktopsClient) getCreateRequest(ctx context.Context, resourceGrou // getHandleResponse handles the Get response. func (client *DesktopsClient) getHandleResponse(resp *http.Response) (DesktopsClientGetResponse, error) { - result := DesktopsClientGetResponse{RawResponse: resp} + result := DesktopsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Desktop); err != nil { return DesktopsClientGetResponse{}, err } @@ -114,16 +119,32 @@ func (client *DesktopsClient) getHandleResponse(resp *http.Response) (DesktopsCl // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - DesktopsClientListOptions contains the optional parameters for the DesktopsClient.List method. -func (client *DesktopsClient) List(resourceGroupName string, applicationGroupName string, options *DesktopsClientListOptions) *DesktopsClientListPager { - return &DesktopsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, applicationGroupName, options) +func (client *DesktopsClient) List(resourceGroupName string, applicationGroupName string, options *DesktopsClientListOptions) *runtime.Pager[DesktopsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[DesktopsClientListResponse]{ + More: func(page DesktopsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp DesktopsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.DesktopList.NextLink) + Fetcher: func(ctx context.Context, page *DesktopsClientListResponse) (DesktopsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, applicationGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return DesktopsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return DesktopsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return DesktopsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -146,7 +167,7 @@ func (client *DesktopsClient) listCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -154,7 +175,7 @@ func (client *DesktopsClient) listCreateRequest(ctx context.Context, resourceGro // listHandleResponse handles the List response. func (client *DesktopsClient) listHandleResponse(resp *http.Response) (DesktopsClientListResponse, error) { - result := DesktopsClientListResponse{RawResponse: resp} + result := DesktopsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.DesktopList); err != nil { return DesktopsClientListResponse{}, err } @@ -206,7 +227,7 @@ func (client *DesktopsClient) updateCreateRequest(ctx context.Context, resourceG return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.Desktop != nil { @@ -217,7 +238,7 @@ func (client *DesktopsClient) updateCreateRequest(ctx context.Context, resourceG // updateHandleResponse handles the Update response. func (client *DesktopsClient) updateHandleResponse(resp *http.Response) (DesktopsClientUpdateResponse, error) { - result := DesktopsClientUpdateResponse{RawResponse: resp} + result := DesktopsClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Desktop); err != nil { return DesktopsClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go index 97e7c58bb6a9..571b5ec54fcd 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_hostpools_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -34,20 +35,24 @@ type HostPoolsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewHostPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *HostPoolsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewHostPoolsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*HostPoolsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &HostPoolsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Create or update a host pool. @@ -92,7 +97,7 @@ func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, hostPool) @@ -100,7 +105,7 @@ func (client *HostPoolsClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *HostPoolsClient) createOrUpdateHandleResponse(resp *http.Response) (HostPoolsClientCreateOrUpdateResponse, error) { - result := HostPoolsClientCreateOrUpdateResponse{RawResponse: resp} + result := HostPoolsClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.HostPool); err != nil { return HostPoolsClientCreateOrUpdateResponse{}, err } @@ -124,7 +129,7 @@ func (client *HostPoolsClient) Delete(ctx context.Context, resourceGroupName str if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return HostPoolsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return HostPoolsClientDeleteResponse{RawResponse: resp}, nil + return HostPoolsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -147,7 +152,7 @@ func (client *HostPoolsClient) deleteCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -196,7 +201,7 @@ func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -204,7 +209,7 @@ func (client *HostPoolsClient) getCreateRequest(ctx context.Context, resourceGro // getHandleResponse handles the Get response. func (client *HostPoolsClient) getHandleResponse(resp *http.Response) (HostPoolsClientGetResponse, error) { - result := HostPoolsClientGetResponse{RawResponse: resp} + result := HostPoolsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.HostPool); err != nil { return HostPoolsClientGetResponse{}, err } @@ -214,16 +219,32 @@ func (client *HostPoolsClient) getHandleResponse(resp *http.Response) (HostPools // List - List hostPools in subscription. // If the operation fails it returns an *azcore.ResponseError type. // options - HostPoolsClientListOptions contains the optional parameters for the HostPoolsClient.List method. -func (client *HostPoolsClient) List(options *HostPoolsClientListOptions) *HostPoolsClientListPager { - return &HostPoolsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *HostPoolsClient) List(options *HostPoolsClientListOptions) *runtime.Pager[HostPoolsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[HostPoolsClientListResponse]{ + More: func(page HostPoolsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp HostPoolsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.HostPoolList.NextLink) + Fetcher: func(ctx context.Context, page *HostPoolsClientListResponse) (HostPoolsClientListResponse, 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 HostPoolsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return HostPoolsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HostPoolsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -238,7 +259,7 @@ func (client *HostPoolsClient) listCreateRequest(ctx context.Context, options *H return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -246,7 +267,7 @@ func (client *HostPoolsClient) listCreateRequest(ctx context.Context, options *H // listHandleResponse handles the List response. func (client *HostPoolsClient) listHandleResponse(resp *http.Response) (HostPoolsClientListResponse, error) { - result := HostPoolsClientListResponse{RawResponse: resp} + result := HostPoolsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.HostPoolList); err != nil { return HostPoolsClientListResponse{}, err } @@ -258,16 +279,32 @@ func (client *HostPoolsClient) listHandleResponse(resp *http.Response) (HostPool // resourceGroupName - The name of the resource group. The name is case insensitive. // options - HostPoolsClientListByResourceGroupOptions contains the optional parameters for the HostPoolsClient.ListByResourceGroup // method. -func (client *HostPoolsClient) ListByResourceGroup(resourceGroupName string, options *HostPoolsClientListByResourceGroupOptions) *HostPoolsClientListByResourceGroupPager { - return &HostPoolsClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *HostPoolsClient) ListByResourceGroup(resourceGroupName string, options *HostPoolsClientListByResourceGroupOptions) *runtime.Pager[HostPoolsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[HostPoolsClientListByResourceGroupResponse]{ + More: func(page HostPoolsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp HostPoolsClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.HostPoolList.NextLink) + Fetcher: func(ctx context.Context, page *HostPoolsClientListByResourceGroupResponse) (HostPoolsClientListByResourceGroupResponse, 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 HostPoolsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return HostPoolsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return HostPoolsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -286,7 +323,7 @@ func (client *HostPoolsClient) listByResourceGroupCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -294,7 +331,7 @@ func (client *HostPoolsClient) listByResourceGroupCreateRequest(ctx context.Cont // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *HostPoolsClient) listByResourceGroupHandleResponse(resp *http.Response) (HostPoolsClientListByResourceGroupResponse, error) { - result := HostPoolsClientListByResourceGroupResponse{RawResponse: resp} + result := HostPoolsClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.HostPoolList); err != nil { return HostPoolsClientListByResourceGroupResponse{}, err } @@ -342,7 +379,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -350,7 +387,7 @@ func (client *HostPoolsClient) retrieveRegistrationTokenCreateRequest(ctx contex // retrieveRegistrationTokenHandleResponse handles the RetrieveRegistrationToken response. func (client *HostPoolsClient) retrieveRegistrationTokenHandleResponse(resp *http.Response) (HostPoolsClientRetrieveRegistrationTokenResponse, error) { - result := HostPoolsClientRetrieveRegistrationTokenResponse{RawResponse: resp} + result := HostPoolsClientRetrieveRegistrationTokenResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.RegistrationInfo); err != nil { return HostPoolsClientRetrieveRegistrationTokenResponse{}, err } @@ -397,7 +434,7 @@ func (client *HostPoolsClient) updateCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.HostPool != nil { @@ -408,7 +445,7 @@ func (client *HostPoolsClient) updateCreateRequest(ctx context.Context, resource // updateHandleResponse handles the Update response. func (client *HostPoolsClient) updateHandleResponse(resp *http.Response) (HostPoolsClientUpdateResponse, error) { - result := HostPoolsClientUpdateResponse{RawResponse: resp} + result := HostPoolsClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.HostPool); err != nil { return HostPoolsClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go index 6514ffccabfe..d4eb3b057242 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,13 +8,39 @@ package armdesktopvirtualization -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "reflect" - "time" -) +import "time" + +// AgentUpdatePatchProperties - The session host configuration for updating agent, monitoring agent, and stack component. +type AgentUpdatePatchProperties struct { + // Time zone for maintenance as defined in https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. + // Must be set if useLocalTime is true. + MaintenanceWindowTimeZone *string `json:"maintenanceWindowTimeZone,omitempty"` + + // List of maintenance windows. Maintenance windows are 2 hours long. + MaintenanceWindows []*MaintenanceWindowPatchProperties `json:"maintenanceWindows,omitempty"` + + // The type of maintenance for session host components. + Type *SessionHostComponentUpdateType `json:"type,omitempty"` + + // Whether to use localTime of the virtual machine. + UseSessionHostLocalTime *bool `json:"useSessionHostLocalTime,omitempty"` +} + +// AgentUpdateProperties - The session host configuration for updating agent, monitoring agent, and stack component. +type AgentUpdateProperties struct { + // Time zone for maintenance as defined in https://docs.microsoft.com/en-us/dotnet/api/system.timezoneinfo.findsystemtimezonebyid?view=net-5.0. + // Must be set if useLocalTime is true. + MaintenanceWindowTimeZone *string `json:"maintenanceWindowTimeZone,omitempty"` + + // List of maintenance windows. Maintenance windows are 2 hours long. + MaintenanceWindows []*MaintenanceWindowProperties `json:"maintenanceWindows,omitempty"` + + // The type of maintenance for session host components. + Type *SessionHostComponentUpdateType `json:"type,omitempty"` + + // Whether to use localTime of the virtual machine. + UseSessionHostLocalTime *bool `json:"useSessionHostLocalTime,omitempty"` +} // Application - Schema for Application properties. type Application struct { @@ -77,25 +103,6 @@ type ApplicationGroup struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroup. -func (a ApplicationGroup) 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, "kind", a.Kind) - populate(objectMap, "location", a.Location) - populate(objectMap, "managedBy", a.ManagedBy) - populate(objectMap, "name", a.Name) - populate(objectMap, "plan", a.Plan) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "sku", a.SKU) - populate(objectMap, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - // ApplicationGroupList - List of ApplicationGroup definitions. type ApplicationGroupList struct { // List of ApplicationGroup definitions. @@ -105,14 +112,6 @@ type ApplicationGroupList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupList. -func (a ApplicationGroupList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - // ApplicationGroupPatch - ApplicationGroup properties that can be patched. type ApplicationGroupPatch struct { // ApplicationGroup properties that can be patched. @@ -131,17 +130,6 @@ type ApplicationGroupPatch struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPatch. -func (a ApplicationGroupPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", a.ID) - populate(objectMap, "name", a.Name) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - // ApplicationGroupPatchProperties - ApplicationGroup properties that can be patched. type ApplicationGroupPatchProperties struct { // Description of ApplicationGroup. @@ -223,14 +211,6 @@ type ApplicationList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ApplicationList. -func (a ApplicationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - // ApplicationPatch - Application properties that can be patched. type ApplicationPatch struct { // Detailed properties for Application @@ -240,14 +220,6 @@ type ApplicationPatch struct { Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ApplicationPatch. -func (a ApplicationPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", a.Properties) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - // ApplicationPatchProperties - Application properties that can be patched. type ApplicationPatchProperties struct { // Resource Type of Application. @@ -331,85 +303,6 @@ type ApplicationProperties struct { ObjectID *string `json:"objectId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ApplicationProperties. -func (a ApplicationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationType", a.ApplicationType) - populate(objectMap, "commandLineArguments", a.CommandLineArguments) - populate(objectMap, "commandLineSetting", a.CommandLineSetting) - populate(objectMap, "description", a.Description) - populate(objectMap, "filePath", a.FilePath) - populate(objectMap, "friendlyName", a.FriendlyName) - populateByteArray(objectMap, "iconContent", a.IconContent, runtime.Base64StdFormat) - populate(objectMap, "iconHash", a.IconHash) - populate(objectMap, "iconIndex", a.IconIndex) - populate(objectMap, "iconPath", a.IconPath) - populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) - populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) - populate(objectMap, "objectId", a.ObjectID) - populate(objectMap, "showInPortal", a.ShowInPortal) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProperties. -func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "applicationType": - err = unpopulate(val, &a.ApplicationType) - delete(rawMsg, key) - case "commandLineArguments": - err = unpopulate(val, &a.CommandLineArguments) - delete(rawMsg, key) - case "commandLineSetting": - err = unpopulate(val, &a.CommandLineSetting) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &a.Description) - delete(rawMsg, key) - case "filePath": - err = unpopulate(val, &a.FilePath) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &a.FriendlyName) - delete(rawMsg, key) - case "iconContent": - err = runtime.DecodeByteArray(string(val), &a.IconContent, runtime.Base64StdFormat) - delete(rawMsg, key) - case "iconHash": - err = unpopulate(val, &a.IconHash) - delete(rawMsg, key) - case "iconIndex": - err = unpopulate(val, &a.IconIndex) - delete(rawMsg, key) - case "iconPath": - err = unpopulate(val, &a.IconPath) - delete(rawMsg, key) - case "msixPackageApplicationId": - err = unpopulate(val, &a.MsixPackageApplicationID) - delete(rawMsg, key) - case "msixPackageFamilyName": - err = unpopulate(val, &a.MsixPackageFamilyName) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, &a.ObjectID) - delete(rawMsg, key) - case "showInPortal": - err = unpopulate(val, &a.ShowInPortal) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // ApplicationsClientCreateOrUpdateOptions contains the optional parameters for the ApplicationsClient.CreateOrUpdate method. type ApplicationsClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -478,14 +371,6 @@ type DesktopList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type DesktopList. -func (d DesktopList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", d.NextLink) - populate(objectMap, "value", d.Value) - return json.Marshal(objectMap) -} - // DesktopPatch - Desktop properties that can be patched. type DesktopPatch struct { // Detailed properties for Desktop @@ -495,14 +380,6 @@ type DesktopPatch struct { Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type DesktopPatch. -func (d DesktopPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", d.Properties) - populate(objectMap, "tags", d.Tags) - return json.Marshal(objectMap) -} - // DesktopPatchProperties - Desktop properties that can be patched. type DesktopPatchProperties struct { // Description of Desktop. @@ -530,49 +407,6 @@ type DesktopProperties struct { ObjectID *string `json:"objectId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type DesktopProperties. -func (d DesktopProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", d.Description) - populate(objectMap, "friendlyName", d.FriendlyName) - populateByteArray(objectMap, "iconContent", d.IconContent, runtime.Base64StdFormat) - populate(objectMap, "iconHash", d.IconHash) - populate(objectMap, "objectId", d.ObjectID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopProperties. -func (d *DesktopProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "description": - err = unpopulate(val, &d.Description) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &d.FriendlyName) - delete(rawMsg, key) - case "iconContent": - err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) - delete(rawMsg, key) - case "iconHash": - err = unpopulate(val, &d.IconHash) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, &d.ObjectID) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // DesktopsClientGetOptions contains the optional parameters for the DesktopsClient.Get method. type DesktopsClientGetOptions struct { // placeholder for future optional parameters @@ -613,14 +447,6 @@ type ExpandMsixImageList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageList. -func (e ExpandMsixImageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", e.NextLink) - populate(objectMap, "value", e.Value) - return json.Marshal(objectMap) -} - // ExpandMsixImageProperties - Schema for Expand MSIX Image properties. type ExpandMsixImageProperties struct { // User friendly Name to be displayed in the portal. @@ -663,81 +489,6 @@ type ExpandMsixImageProperties struct { Version *string `json:"version,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageProperties. -func (e ExpandMsixImageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", e.DisplayName) - populate(objectMap, "imagePath", e.ImagePath) - populate(objectMap, "isActive", e.IsActive) - populate(objectMap, "isRegularRegistration", e.IsRegularRegistration) - populateTimeRFC3339(objectMap, "lastUpdated", e.LastUpdated) - populate(objectMap, "packageAlias", e.PackageAlias) - populate(objectMap, "packageApplications", e.PackageApplications) - populate(objectMap, "packageDependencies", e.PackageDependencies) - populate(objectMap, "packageFamilyName", e.PackageFamilyName) - populate(objectMap, "packageFullName", e.PackageFullName) - populate(objectMap, "packageName", e.PackageName) - populate(objectMap, "packageRelativePath", e.PackageRelativePath) - populate(objectMap, "version", e.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageProperties. -func (e *ExpandMsixImageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "displayName": - err = unpopulate(val, &e.DisplayName) - delete(rawMsg, key) - case "imagePath": - err = unpopulate(val, &e.ImagePath) - delete(rawMsg, key) - case "isActive": - err = unpopulate(val, &e.IsActive) - delete(rawMsg, key) - case "isRegularRegistration": - err = unpopulate(val, &e.IsRegularRegistration) - delete(rawMsg, key) - case "lastUpdated": - err = unpopulateTimeRFC3339(val, &e.LastUpdated) - delete(rawMsg, key) - case "packageAlias": - err = unpopulate(val, &e.PackageAlias) - delete(rawMsg, key) - case "packageApplications": - err = unpopulate(val, &e.PackageApplications) - delete(rawMsg, key) - case "packageDependencies": - err = unpopulate(val, &e.PackageDependencies) - delete(rawMsg, key) - case "packageFamilyName": - err = unpopulate(val, &e.PackageFamilyName) - delete(rawMsg, key) - case "packageFullName": - err = unpopulate(val, &e.PackageFullName) - delete(rawMsg, key) - case "packageName": - err = unpopulate(val, &e.PackageName) - delete(rawMsg, key) - case "packageRelativePath": - err = unpopulate(val, &e.PackageRelativePath) - delete(rawMsg, key) - case "version": - err = unpopulate(val, &e.Version) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // HostPool - Represents a HostPool definition. type HostPool struct { // REQUIRED; Detailed properties for HostPool @@ -781,25 +532,6 @@ type HostPool struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type HostPool. -func (h HostPool) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", h.Etag) - populate(objectMap, "id", h.ID) - populate(objectMap, "identity", h.Identity) - populate(objectMap, "kind", h.Kind) - populate(objectMap, "location", h.Location) - populate(objectMap, "managedBy", h.ManagedBy) - populate(objectMap, "name", h.Name) - populate(objectMap, "plan", h.Plan) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "sku", h.SKU) - populate(objectMap, "systemData", h.SystemData) - populate(objectMap, "tags", h.Tags) - populate(objectMap, "type", h.Type) - return json.Marshal(objectMap) -} - // HostPoolList - List of HostPool definitions. type HostPoolList struct { // List of HostPool definitions. @@ -809,14 +541,6 @@ type HostPoolList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type HostPoolList. -func (h HostPoolList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", h.NextLink) - populate(objectMap, "value", h.Value) - return json.Marshal(objectMap) -} - // HostPoolPatch - HostPool properties that can be patched. type HostPoolPatch struct { // HostPool properties that can be patched. @@ -835,19 +559,11 @@ type HostPoolPatch struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type HostPoolPatch. -func (h HostPoolPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", h.ID) - populate(objectMap, "name", h.Name) - populate(objectMap, "properties", h.Properties) - populate(objectMap, "tags", h.Tags) - populate(objectMap, "type", h.Type) - return json.Marshal(objectMap) -} - // HostPoolPatchProperties - Properties of HostPool. type HostPoolPatchProperties struct { + // The session host configuration for updating agent, monitoring agent, and stack component. + AgentUpdate *AgentUpdatePatchProperties `json:"agentUpdate,omitempty"` + // Custom rdp property of HostPool. CustomRdpProperty *string `json:"customRdpProperty,omitempty"` @@ -870,7 +586,7 @@ type HostPoolPatchProperties struct { PreferredAppGroupType *PreferredAppGroupType `json:"preferredAppGroupType,omitempty"` // Enabled to allow this resource to be access from the public network - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + PublicNetworkAccess *HostpoolPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` // The registration info of HostPool. RegistrationInfo *RegistrationInfoPatch `json:"registrationInfo,omitempty"` @@ -911,6 +627,9 @@ type HostPoolProperties struct { // REQUIRED; The type of preferred application group type, default to Desktop Application Group PreferredAppGroupType *PreferredAppGroupType `json:"preferredAppGroupType,omitempty"` + // The session host configuration for updating agent, monitoring agent, and stack component. + AgentUpdate *AgentUpdateProperties `json:"agentUpdate,omitempty"` + // Custom rdp property of HostPool. CustomRdpProperty *string `json:"customRdpProperty,omitempty"` @@ -931,7 +650,7 @@ type HostPoolProperties struct { // Enabled allows this resource to be accessed from both public and private networks, Disabled allows this resource to only // be accessed via private endpoints - PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + PublicNetworkAccess *HostpoolPublicNetworkAccess `json:"publicNetworkAccess,omitempty"` // The registration info of HostPool. RegistrationInfo *RegistrationInfo `json:"registrationInfo,omitempty"` @@ -968,34 +687,9 @@ type HostPoolProperties struct { // READ-ONLY; ObjectId of HostPool. (internal use) ObjectID *string `json:"objectId,omitempty" azure:"ro"` -} -// MarshalJSON implements the json.Marshaller interface for type HostPoolProperties. -func (h HostPoolProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGroupReferences", h.ApplicationGroupReferences) - populate(objectMap, "cloudPcResource", h.CloudPcResource) - populate(objectMap, "customRdpProperty", h.CustomRdpProperty) - populate(objectMap, "description", h.Description) - populate(objectMap, "friendlyName", h.FriendlyName) - populate(objectMap, "hostPoolType", h.HostPoolType) - populate(objectMap, "loadBalancerType", h.LoadBalancerType) - populate(objectMap, "maxSessionLimit", h.MaxSessionLimit) - populate(objectMap, "migrationRequest", h.MigrationRequest) - populate(objectMap, "objectId", h.ObjectID) - populate(objectMap, "personalDesktopAssignmentType", h.PersonalDesktopAssignmentType) - populate(objectMap, "preferredAppGroupType", h.PreferredAppGroupType) - populate(objectMap, "publicNetworkAccess", h.PublicNetworkAccess) - populate(objectMap, "registrationInfo", h.RegistrationInfo) - populate(objectMap, "ring", h.Ring) - populate(objectMap, "ssoClientId", h.SsoClientID) - populate(objectMap, "ssoClientSecretKeyVaultPath", h.SsoClientSecretKeyVaultPath) - populate(objectMap, "ssoSecretType", h.SsoSecretType) - populate(objectMap, "ssoadfsAuthority", h.SsoadfsAuthority) - populate(objectMap, "startVMOnConnect", h.StartVMOnConnect) - populate(objectMap, "vmTemplate", h.VMTemplate) - populate(objectMap, "validationEnvironment", h.ValidationEnvironment) - return json.Marshal(objectMap) + // READ-ONLY; List of private endpoint connection associated with the specified resource + PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` } // HostPoolsClientCreateOrUpdateOptions contains the optional parameters for the HostPoolsClient.CreateOrUpdate method. @@ -1094,14 +788,6 @@ type MSIXPackageList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MSIXPackageList. -func (m MSIXPackageList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", m.NextLink) - populate(objectMap, "value", m.Value) - return json.Marshal(objectMap) -} - // MSIXPackagePatch - MSIX Package properties that can be patched. type MSIXPackagePatch struct { // Detailed properties for MSIX Package @@ -1117,16 +803,6 @@ type MSIXPackagePatch struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type MSIXPackagePatch. -func (m MSIXPackagePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", m.ID) - populate(objectMap, "name", m.Name) - populate(objectMap, "properties", m.Properties) - populate(objectMap, "type", m.Type) - return json.Marshal(objectMap) -} - // MSIXPackagePatchProperties - MSIX Package properties that can be patched. type MSIXPackagePatchProperties struct { // Display name for MSIX Package. @@ -1175,73 +851,6 @@ type MSIXPackageProperties struct { Version *string `json:"version,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MSIXPackageProperties. -func (m MSIXPackageProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "displayName", m.DisplayName) - populate(objectMap, "imagePath", m.ImagePath) - populate(objectMap, "isActive", m.IsActive) - populate(objectMap, "isRegularRegistration", m.IsRegularRegistration) - populateTimeRFC3339(objectMap, "lastUpdated", m.LastUpdated) - populate(objectMap, "packageApplications", m.PackageApplications) - populate(objectMap, "packageDependencies", m.PackageDependencies) - populate(objectMap, "packageFamilyName", m.PackageFamilyName) - populate(objectMap, "packageName", m.PackageName) - populate(objectMap, "packageRelativePath", m.PackageRelativePath) - populate(objectMap, "version", m.Version) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackageProperties. -func (m *MSIXPackageProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "displayName": - err = unpopulate(val, &m.DisplayName) - delete(rawMsg, key) - case "imagePath": - err = unpopulate(val, &m.ImagePath) - delete(rawMsg, key) - case "isActive": - err = unpopulate(val, &m.IsActive) - delete(rawMsg, key) - case "isRegularRegistration": - err = unpopulate(val, &m.IsRegularRegistration) - delete(rawMsg, key) - case "lastUpdated": - err = unpopulateTimeRFC3339(val, &m.LastUpdated) - delete(rawMsg, key) - case "packageApplications": - err = unpopulate(val, &m.PackageApplications) - delete(rawMsg, key) - case "packageDependencies": - err = unpopulate(val, &m.PackageDependencies) - delete(rawMsg, key) - case "packageFamilyName": - err = unpopulate(val, &m.PackageFamilyName) - delete(rawMsg, key) - case "packageName": - err = unpopulate(val, &m.PackageName) - delete(rawMsg, key) - case "packageRelativePath": - err = unpopulate(val, &m.PackageRelativePath) - delete(rawMsg, key) - case "version": - err = unpopulate(val, &m.Version) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MSIXPackagesClientCreateOrUpdateOptions contains the optional parameters for the MSIXPackagesClient.CreateOrUpdate method. type MSIXPackagesClientCreateOrUpdateOptions struct { // placeholder for future optional parameters @@ -1268,6 +877,24 @@ type MSIXPackagesClientUpdateOptions struct { MsixPackage *MSIXPackagePatch } +// MaintenanceWindowPatchProperties - Maintenance window starting hour and day of week. +type MaintenanceWindowPatchProperties struct { + // Day of the week. + DayOfWeek *DayOfWeek `json:"dayOfWeek,omitempty"` + + // The update start hour of the day. (0 - 23) + Hour *int32 `json:"hour,omitempty"` +} + +// MaintenanceWindowProperties - Maintenance window starting hour and day of week. +type MaintenanceWindowProperties struct { + // Day of the week. + DayOfWeek *DayOfWeek `json:"dayOfWeek,omitempty"` + + // The update start hour of the day. (0 - 23) + Hour *int32 `json:"hour,omitempty"` +} + // MigrationRequestProperties - Properties for arm migration. type MigrationRequestProperties struct { // The path to the legacy object to migrate. @@ -1306,57 +933,6 @@ type MsixPackageApplications struct { RawPNG []byte `json:"rawPng,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type MsixPackageApplications. -func (m MsixPackageApplications) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "appId", m.AppID) - populate(objectMap, "appUserModelID", m.AppUserModelID) - populate(objectMap, "description", m.Description) - populate(objectMap, "friendlyName", m.FriendlyName) - populate(objectMap, "iconImageName", m.IconImageName) - populateByteArray(objectMap, "rawIcon", m.RawIcon, runtime.Base64StdFormat) - populateByteArray(objectMap, "rawPng", m.RawPNG, runtime.Base64StdFormat) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type MsixPackageApplications. -func (m *MsixPackageApplications) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "appId": - err = unpopulate(val, &m.AppID) - delete(rawMsg, key) - case "appUserModelID": - err = unpopulate(val, &m.AppUserModelID) - delete(rawMsg, key) - case "description": - err = unpopulate(val, &m.Description) - delete(rawMsg, key) - case "friendlyName": - err = unpopulate(val, &m.FriendlyName) - delete(rawMsg, key) - case "iconImageName": - err = unpopulate(val, &m.IconImageName) - delete(rawMsg, key) - case "rawIcon": - err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) - delete(rawMsg, key) - case "rawPng": - err = runtime.DecodeByteArray(string(val), &m.RawPNG, runtime.Base64StdFormat) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // MsixPackageDependencies - Schema for MSIX Package Dependencies properties. type MsixPackageDependencies struct { // Name of package dependency. @@ -1430,14 +1006,6 @@ type PrivateEndpointConnectionListResultWithSystemData struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResultWithSystemData. -func (p PrivateEndpointConnectionListResultWithSystemData) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. @@ -1540,14 +1108,6 @@ type PrivateLinkResourceListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PrivateLinkResourceProperties - Properties of a private link resource. type PrivateLinkResourceProperties struct { // The private link resource Private link DNS zone name. @@ -1560,15 +1120,6 @@ type PrivateLinkResourceProperties struct { RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - // PrivateLinkResourcesClientListByHostPoolOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByHostPool // method. type PrivateLinkResourcesClientListByHostPoolOptions struct { @@ -1606,41 +1157,6 @@ type RegistrationInfo struct { Token *string `json:"token,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RegistrationInfo. -func (r RegistrationInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) - populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) - populate(objectMap, "token", r.Token) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationInfo. -func (r *RegistrationInfo) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "expirationTime": - err = unpopulateTimeRFC3339(val, &r.ExpirationTime) - delete(rawMsg, key) - case "registrationTokenOperation": - err = unpopulate(val, &r.RegistrationTokenOperation) - delete(rawMsg, key) - case "token": - err = unpopulate(val, &r.Token) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // RegistrationInfoPatch - Represents a RegistrationInfo definition. type RegistrationInfoPatch struct { // Expiration time of registration token. @@ -1650,37 +1166,6 @@ type RegistrationInfoPatch struct { RegistrationTokenOperation *RegistrationTokenOperation `json:"registrationTokenOperation,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type RegistrationInfoPatch. -func (r RegistrationInfoPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) - populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationInfoPatch. -func (r *RegistrationInfoPatch) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "expirationTime": - err = unpopulateTimeRFC3339(val, &r.ExpirationTime) - delete(rawMsg, key) - case "registrationTokenOperation": - err = unpopulate(val, &r.RegistrationTokenOperation) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Resource - Common fields that are returned in the response for all Azure Resource Manager resources type Resource struct { // READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -1732,23 +1217,6 @@ type ResourceModelWithAllowedPropertySet struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySet. -func (r ResourceModelWithAllowedPropertySet) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", r.Etag) - populate(objectMap, "id", r.ID) - populate(objectMap, "identity", r.Identity) - populate(objectMap, "kind", r.Kind) - populate(objectMap, "location", r.Location) - populate(objectMap, "managedBy", r.ManagedBy) - populate(objectMap, "name", r.Name) - populate(objectMap, "plan", r.Plan) - populate(objectMap, "sku", r.SKU) - populate(objectMap, "tags", r.Tags) - populate(objectMap, "type", r.Type) - return json.Marshal(objectMap) -} - type ResourceModelWithAllowedPropertySetIdentity struct { // The identity type. Type *string `json:"type,omitempty"` @@ -1836,14 +1304,6 @@ type ResourceProviderOperationList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList. -func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", r.NextLink) - populate(objectMap, "value", r.Value) - return json.Marshal(objectMap) -} - // SKU - The resource model definition representing SKU type SKU struct { // REQUIRED; The name of the SKU. Ex - P3. It is typically a letter+number code @@ -1917,25 +1377,6 @@ type ScalingPlan struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlan. -func (s ScalingPlan) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", s.Etag) - populate(objectMap, "id", s.ID) - populate(objectMap, "identity", s.Identity) - populate(objectMap, "kind", s.Kind) - populate(objectMap, "location", s.Location) - populate(objectMap, "managedBy", s.ManagedBy) - populate(objectMap, "name", s.Name) - populate(objectMap, "plan", s.Plan) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "sku", s.SKU) - populate(objectMap, "systemData", s.SystemData) - populate(objectMap, "tags", s.Tags) - populate(objectMap, "type", s.Type) - return json.Marshal(objectMap) -} - // ScalingPlanList - List of scaling plan definitions. type ScalingPlanList struct { // List of scaling plan definitions. @@ -1945,14 +1386,6 @@ type ScalingPlanList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanList. -func (s ScalingPlanList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // ScalingPlanPatch - Scaling plan properties that can be patched. type ScalingPlanPatch struct { // Detailed properties for scaling plan @@ -1962,14 +1395,6 @@ type ScalingPlanPatch struct { Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatch. -func (s ScalingPlanPatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", s.Properties) - populate(objectMap, "tags", s.Tags) - return json.Marshal(objectMap) -} - // ScalingPlanPatchProperties - Scaling plan properties. type ScalingPlanPatchProperties struct { // Description of scaling plan. @@ -1991,18 +1416,6 @@ type ScalingPlanPatchProperties struct { TimeZone *string `json:"timeZone,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatchProperties. -func (s ScalingPlanPatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", s.Description) - populate(objectMap, "exclusionTag", s.ExclusionTag) - populate(objectMap, "friendlyName", s.FriendlyName) - populate(objectMap, "hostPoolReferences", s.HostPoolReferences) - populate(objectMap, "schedules", s.Schedules) - populate(objectMap, "timeZone", s.TimeZone) - return json.Marshal(objectMap) -} - // ScalingPlanProperties - Scaling plan properties. type ScalingPlanProperties struct { // Description of scaling plan. @@ -2030,20 +1443,6 @@ type ScalingPlanProperties struct { ObjectID *string `json:"objectId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ScalingPlanProperties. -func (s ScalingPlanProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", s.Description) - populate(objectMap, "exclusionTag", s.ExclusionTag) - populate(objectMap, "friendlyName", s.FriendlyName) - populate(objectMap, "hostPoolReferences", s.HostPoolReferences) - populate(objectMap, "hostPoolType", s.HostPoolType) - populate(objectMap, "objectId", s.ObjectID) - populate(objectMap, "schedules", s.Schedules) - populate(objectMap, "timeZone", s.TimeZone) - return json.Marshal(objectMap) -} - // ScalingPlansClientCreateOptions contains the optional parameters for the ScalingPlansClient.Create method. type ScalingPlansClientCreateOptions struct { // placeholder for future optional parameters @@ -2139,30 +1538,6 @@ type ScalingSchedule struct { RampUpStartTime *Time `json:"rampUpStartTime,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ScalingSchedule. -func (s ScalingSchedule) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "daysOfWeek", s.DaysOfWeek) - populate(objectMap, "name", s.Name) - populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) - populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) - populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) - populate(objectMap, "peakStartTime", s.PeakStartTime) - populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) - populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) - populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) - populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) - populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) - populate(objectMap, "rampDownStartTime", s.RampDownStartTime) - populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) - populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) - populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) - populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) - populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) - populate(objectMap, "rampUpStartTime", s.RampUpStartTime) - return json.Marshal(objectMap) -} - // SendMessage - Represents message sent to a UserSession. type SendMessage struct { // Body of message. @@ -2178,13 +1553,6 @@ type ServiceSpecification struct { LogSpecifications []*LogSpecification `json:"logSpecifications,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. -func (s ServiceSpecification) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "logSpecifications", s.LogSpecifications) - return json.Marshal(objectMap) -} - // SessionHost - Represents a SessionHost definition. type SessionHost struct { // Detailed properties for SessionHost @@ -2215,41 +1583,6 @@ type SessionHostHealthCheckFailureDetails struct { Message *string `json:"message,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SessionHostHealthCheckFailureDetails. -func (s SessionHostHealthCheckFailureDetails) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "errorCode", s.ErrorCode) - populateTimeRFC3339(objectMap, "lastHealthCheckDateTime", s.LastHealthCheckDateTime) - populate(objectMap, "message", s.Message) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckFailureDetails. -func (s *SessionHostHealthCheckFailureDetails) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "errorCode": - err = unpopulate(val, &s.ErrorCode) - delete(rawMsg, key) - case "lastHealthCheckDateTime": - err = unpopulateTimeRFC3339(val, &s.LastHealthCheckDateTime) - delete(rawMsg, key) - case "message": - err = unpopulate(val, &s.Message) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SessionHostHealthCheckReport - The report for session host information. type SessionHostHealthCheckReport struct { // READ-ONLY; Additional detailed information on the failure. @@ -2271,14 +1604,6 @@ type SessionHostList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SessionHostList. -func (s SessionHostList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // SessionHostPatch - SessionHost properties that can be patched. type SessionHostPatch struct { // Detailed properties for SessionHost @@ -2294,16 +1619,6 @@ type SessionHostPatch struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SessionHostPatch. -func (s SessionHostPatch) 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) -} - // SessionHostPatchProperties - SessionHost properties that can be patched. type SessionHostPatchProperties struct { // Allow a new session. @@ -2311,6 +1626,9 @@ type SessionHostPatchProperties struct { // User assigned to SessionHost. AssignedUser *string `json:"assignedUser,omitempty"` + + // Friendly name of SessionHost + FriendlyName *string `json:"friendlyName,omitempty"` } // SessionHostProperties - Schema for SessionHost properties. @@ -2324,6 +1642,9 @@ type SessionHostProperties struct { // User assigned to SessionHost. AssignedUser *string `json:"assignedUser,omitempty"` + // Friendly name of SessionHost + FriendlyName *string `json:"friendlyName,omitempty"` + // Last heart beat from SessionHost. LastHeartBeat *time.Time `json:"lastHeartBeat,omitempty"` @@ -2364,93 +1685,6 @@ type SessionHostProperties struct { VirtualMachineID *string `json:"virtualMachineId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SessionHostProperties. -func (s SessionHostProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "agentVersion", s.AgentVersion) - populate(objectMap, "allowNewSession", s.AllowNewSession) - populate(objectMap, "assignedUser", s.AssignedUser) - populateTimeRFC3339(objectMap, "lastHeartBeat", s.LastHeartBeat) - populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) - populate(objectMap, "osVersion", s.OSVersion) - populate(objectMap, "objectId", s.ObjectID) - populate(objectMap, "resourceId", s.ResourceID) - populate(objectMap, "sessionHostHealthCheckResults", s.SessionHostHealthCheckResults) - populate(objectMap, "sessions", s.Sessions) - populate(objectMap, "status", s.Status) - populateTimeRFC3339(objectMap, "statusTimestamp", s.StatusTimestamp) - populate(objectMap, "sxSStackVersion", s.SxSStackVersion) - populate(objectMap, "updateErrorMessage", s.UpdateErrorMessage) - populate(objectMap, "updateState", s.UpdateState) - populate(objectMap, "virtualMachineId", s.VirtualMachineID) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostProperties. -func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "agentVersion": - err = unpopulate(val, &s.AgentVersion) - delete(rawMsg, key) - case "allowNewSession": - err = unpopulate(val, &s.AllowNewSession) - delete(rawMsg, key) - case "assignedUser": - err = unpopulate(val, &s.AssignedUser) - delete(rawMsg, key) - case "lastHeartBeat": - err = unpopulateTimeRFC3339(val, &s.LastHeartBeat) - delete(rawMsg, key) - case "lastUpdateTime": - err = unpopulateTimeRFC3339(val, &s.LastUpdateTime) - delete(rawMsg, key) - case "osVersion": - err = unpopulate(val, &s.OSVersion) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, &s.ObjectID) - delete(rawMsg, key) - case "resourceId": - err = unpopulate(val, &s.ResourceID) - delete(rawMsg, key) - case "sessionHostHealthCheckResults": - err = unpopulate(val, &s.SessionHostHealthCheckResults) - delete(rawMsg, key) - case "sessions": - err = unpopulate(val, &s.Sessions) - delete(rawMsg, key) - case "status": - err = unpopulate(val, &s.Status) - delete(rawMsg, key) - case "statusTimestamp": - err = unpopulateTimeRFC3339(val, &s.StatusTimestamp) - delete(rawMsg, key) - case "sxSStackVersion": - err = unpopulate(val, &s.SxSStackVersion) - delete(rawMsg, key) - case "updateErrorMessage": - err = unpopulate(val, &s.UpdateErrorMessage) - delete(rawMsg, key) - case "updateState": - err = unpopulate(val, &s.UpdateState) - delete(rawMsg, key) - case "virtualMachineId": - err = unpopulate(val, &s.VirtualMachineID) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // SessionHostsClientDeleteOptions contains the optional parameters for the SessionHostsClient.Delete method. type SessionHostsClientDeleteOptions struct { // Force flag to force sessionHost deletion even when userSession exists. @@ -2499,14 +1733,6 @@ type StartMenuItemList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type StartMenuItemList. -func (s StartMenuItemList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) -} - // StartMenuItemProperties - Schema for StartMenuItem properties. type StartMenuItemProperties struct { // Alias of StartMenuItem. @@ -2551,53 +1777,6 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } -// 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 err - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // Time - The time for a scaling action to occur. type Time struct { // REQUIRED; The hour. @@ -2634,14 +1813,6 @@ type UserSessionList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type UserSessionList. -func (u UserSessionList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", u.NextLink) - populate(objectMap, "value", u.Value) - return json.Marshal(objectMap) -} - // UserSessionProperties - Schema for UserSession properties. type UserSessionProperties struct { // The active directory user name. @@ -2663,53 +1834,6 @@ type UserSessionProperties struct { ObjectID *string `json:"objectId,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type UserSessionProperties. -func (u UserSessionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "activeDirectoryUserName", u.ActiveDirectoryUserName) - populate(objectMap, "applicationType", u.ApplicationType) - populateTimeRFC3339(objectMap, "createTime", u.CreateTime) - populate(objectMap, "objectId", u.ObjectID) - populate(objectMap, "sessionState", u.SessionState) - populate(objectMap, "userPrincipalName", u.UserPrincipalName) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type UserSessionProperties. -func (u *UserSessionProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "activeDirectoryUserName": - err = unpopulate(val, &u.ActiveDirectoryUserName) - delete(rawMsg, key) - case "applicationType": - err = unpopulate(val, &u.ApplicationType) - delete(rawMsg, key) - case "createTime": - err = unpopulateTimeRFC3339(val, &u.CreateTime) - delete(rawMsg, key) - case "objectId": - err = unpopulate(val, &u.ObjectID) - delete(rawMsg, key) - case "sessionState": - err = unpopulate(val, &u.SessionState) - delete(rawMsg, key) - case "userPrincipalName": - err = unpopulate(val, &u.UserPrincipalName) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // UserSessionsClientDeleteOptions contains the optional parameters for the UserSessionsClient.Delete method. type UserSessionsClientDeleteOptions struct { // Force flag to login off userSession. @@ -2787,25 +1911,6 @@ type Workspace struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Workspace. -func (w Workspace) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "etag", w.Etag) - populate(objectMap, "id", w.ID) - populate(objectMap, "identity", w.Identity) - populate(objectMap, "kind", w.Kind) - populate(objectMap, "location", w.Location) - populate(objectMap, "managedBy", w.ManagedBy) - populate(objectMap, "name", w.Name) - populate(objectMap, "plan", w.Plan) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "sku", w.SKU) - populate(objectMap, "systemData", w.SystemData) - populate(objectMap, "tags", w.Tags) - populate(objectMap, "type", w.Type) - return json.Marshal(objectMap) -} - // WorkspaceList - List of Workspace definitions. type WorkspaceList struct { // List of Workspace definitions. @@ -2815,14 +1920,6 @@ type WorkspaceList struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type WorkspaceList. -func (w WorkspaceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", w.NextLink) - populate(objectMap, "value", w.Value) - return json.Marshal(objectMap) -} - // WorkspacePatch - Workspace properties that can be patched. type WorkspacePatch struct { // Detailed properties for Workspace @@ -2832,14 +1929,6 @@ type WorkspacePatch struct { Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type WorkspacePatch. -func (w WorkspacePatch) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "properties", w.Properties) - populate(objectMap, "tags", w.Tags) - return json.Marshal(objectMap) -} - // WorkspacePatchProperties - Workspace properties that can be patched. type WorkspacePatchProperties struct { // List of applicationGroup links. @@ -2855,16 +1944,6 @@ type WorkspacePatchProperties struct { PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type WorkspacePatchProperties. -func (w WorkspacePatchProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) - populate(objectMap, "description", w.Description) - populate(objectMap, "friendlyName", w.FriendlyName) - populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) - return json.Marshal(objectMap) -} - // WorkspaceProperties - Schema for Workspace properties. type WorkspaceProperties struct { // List of applicationGroup resource Ids. @@ -2885,18 +1964,9 @@ type WorkspaceProperties struct { // READ-ONLY; ObjectId of Workspace. (internal use) ObjectID *string `json:"objectId,omitempty" azure:"ro"` -} -// MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. -func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) - populate(objectMap, "cloudPcResource", w.CloudPcResource) - populate(objectMap, "description", w.Description) - populate(objectMap, "friendlyName", w.FriendlyName) - populate(objectMap, "objectId", w.ObjectID) - populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) - return json.Marshal(objectMap) + // READ-ONLY; List of private endpoint connection associated with the specified resource + PrivateEndpointConnections []*PrivateEndpointConnection `json:"privateEndpointConnections,omitempty" azure:"ro"` } // WorkspacesClientCreateOrUpdateOptions contains the optional parameters for the WorkspacesClient.CreateOrUpdate method. @@ -2931,30 +2001,3 @@ type WorkspacesClientUpdateOptions struct { // Object containing Workspace definitions. Workspace *WorkspacePatch } - -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 populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { - if azcore.IsNullValue(b) { - m[k] = nil - } else if len(b) == 0 { - return - } else { - m[k] = runtime.EncodeByteArray(b, f) - } -} - -func unpopulate(data json.RawMessage, v interface{}) error { - if data == nil { - return nil - } - return json.Unmarshal(data, v) -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go new file mode 100644 index 000000000000..3ba462cb65c5 --- /dev/null +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_models_serde.go @@ -0,0 +1,1062 @@ +//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 armdesktopvirtualization + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type AgentUpdatePatchProperties. +func (a AgentUpdatePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maintenanceWindowTimeZone", a.MaintenanceWindowTimeZone) + populate(objectMap, "maintenanceWindows", a.MaintenanceWindows) + populate(objectMap, "type", a.Type) + populate(objectMap, "useSessionHostLocalTime", a.UseSessionHostLocalTime) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AgentUpdateProperties. +func (a AgentUpdateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "maintenanceWindowTimeZone", a.MaintenanceWindowTimeZone) + populate(objectMap, "maintenanceWindows", a.MaintenanceWindows) + populate(objectMap, "type", a.Type) + populate(objectMap, "useSessionHostLocalTime", a.UseSessionHostLocalTime) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroup. +func (a ApplicationGroup) 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, "kind", a.Kind) + populate(objectMap, "location", a.Location) + populate(objectMap, "managedBy", a.ManagedBy) + populate(objectMap, "name", a.Name) + populate(objectMap, "plan", a.Plan) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "sku", a.SKU) + populate(objectMap, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupList. +func (a ApplicationGroupList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationGroupPatch. +func (a ApplicationGroupPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", a.ID) + populate(objectMap, "name", a.Name) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationList. +func (a ApplicationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationPatch. +func (a ApplicationPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", a.Properties) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ApplicationProperties. +func (a ApplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationType", a.ApplicationType) + populate(objectMap, "commandLineArguments", a.CommandLineArguments) + populate(objectMap, "commandLineSetting", a.CommandLineSetting) + populate(objectMap, "description", a.Description) + populate(objectMap, "filePath", a.FilePath) + populate(objectMap, "friendlyName", a.FriendlyName) + populateByteArray(objectMap, "iconContent", a.IconContent, runtime.Base64StdFormat) + populate(objectMap, "iconHash", a.IconHash) + populate(objectMap, "iconIndex", a.IconIndex) + populate(objectMap, "iconPath", a.IconPath) + populate(objectMap, "msixPackageApplicationId", a.MsixPackageApplicationID) + populate(objectMap, "msixPackageFamilyName", a.MsixPackageFamilyName) + populate(objectMap, "objectId", a.ObjectID) + populate(objectMap, "showInPortal", a.ShowInPortal) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ApplicationProperties. +func (a *ApplicationProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "applicationType": + err = unpopulate(val, &a.ApplicationType) + delete(rawMsg, key) + case "commandLineArguments": + err = unpopulate(val, &a.CommandLineArguments) + delete(rawMsg, key) + case "commandLineSetting": + err = unpopulate(val, &a.CommandLineSetting) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &a.Description) + delete(rawMsg, key) + case "filePath": + err = unpopulate(val, &a.FilePath) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &a.FriendlyName) + delete(rawMsg, key) + case "iconContent": + err = runtime.DecodeByteArray(string(val), &a.IconContent, runtime.Base64StdFormat) + delete(rawMsg, key) + case "iconHash": + err = unpopulate(val, &a.IconHash) + delete(rawMsg, key) + case "iconIndex": + err = unpopulate(val, &a.IconIndex) + delete(rawMsg, key) + case "iconPath": + err = unpopulate(val, &a.IconPath) + delete(rawMsg, key) + case "msixPackageApplicationId": + err = unpopulate(val, &a.MsixPackageApplicationID) + delete(rawMsg, key) + case "msixPackageFamilyName": + err = unpopulate(val, &a.MsixPackageFamilyName) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, &a.ObjectID) + delete(rawMsg, key) + case "showInPortal": + err = unpopulate(val, &a.ShowInPortal) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type DesktopList. +func (d DesktopList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", d.NextLink) + populate(objectMap, "value", d.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type DesktopPatch. +func (d DesktopPatch) 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 DesktopProperties. +func (d DesktopProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", d.Description) + populate(objectMap, "friendlyName", d.FriendlyName) + populateByteArray(objectMap, "iconContent", d.IconContent, runtime.Base64StdFormat) + populate(objectMap, "iconHash", d.IconHash) + populate(objectMap, "objectId", d.ObjectID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type DesktopProperties. +func (d *DesktopProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "description": + err = unpopulate(val, &d.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &d.FriendlyName) + delete(rawMsg, key) + case "iconContent": + err = runtime.DecodeByteArray(string(val), &d.IconContent, runtime.Base64StdFormat) + delete(rawMsg, key) + case "iconHash": + err = unpopulate(val, &d.IconHash) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, &d.ObjectID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageList. +func (e ExpandMsixImageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", e.NextLink) + populate(objectMap, "value", e.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ExpandMsixImageProperties. +func (e ExpandMsixImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", e.DisplayName) + populate(objectMap, "imagePath", e.ImagePath) + populate(objectMap, "isActive", e.IsActive) + populate(objectMap, "isRegularRegistration", e.IsRegularRegistration) + populateTimeRFC3339(objectMap, "lastUpdated", e.LastUpdated) + populate(objectMap, "packageAlias", e.PackageAlias) + populate(objectMap, "packageApplications", e.PackageApplications) + populate(objectMap, "packageDependencies", e.PackageDependencies) + populate(objectMap, "packageFamilyName", e.PackageFamilyName) + populate(objectMap, "packageFullName", e.PackageFullName) + populate(objectMap, "packageName", e.PackageName) + populate(objectMap, "packageRelativePath", e.PackageRelativePath) + populate(objectMap, "version", e.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type ExpandMsixImageProperties. +func (e *ExpandMsixImageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, &e.DisplayName) + delete(rawMsg, key) + case "imagePath": + err = unpopulate(val, &e.ImagePath) + delete(rawMsg, key) + case "isActive": + err = unpopulate(val, &e.IsActive) + delete(rawMsg, key) + case "isRegularRegistration": + err = unpopulate(val, &e.IsRegularRegistration) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulateTimeRFC3339(val, &e.LastUpdated) + delete(rawMsg, key) + case "packageAlias": + err = unpopulate(val, &e.PackageAlias) + delete(rawMsg, key) + case "packageApplications": + err = unpopulate(val, &e.PackageApplications) + delete(rawMsg, key) + case "packageDependencies": + err = unpopulate(val, &e.PackageDependencies) + delete(rawMsg, key) + case "packageFamilyName": + err = unpopulate(val, &e.PackageFamilyName) + delete(rawMsg, key) + case "packageFullName": + err = unpopulate(val, &e.PackageFullName) + delete(rawMsg, key) + case "packageName": + err = unpopulate(val, &e.PackageName) + delete(rawMsg, key) + case "packageRelativePath": + err = unpopulate(val, &e.PackageRelativePath) + delete(rawMsg, key) + case "version": + err = unpopulate(val, &e.Version) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type HostPool. +func (h HostPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", h.Etag) + populate(objectMap, "id", h.ID) + populate(objectMap, "identity", h.Identity) + populate(objectMap, "kind", h.Kind) + populate(objectMap, "location", h.Location) + populate(objectMap, "managedBy", h.ManagedBy) + populate(objectMap, "name", h.Name) + populate(objectMap, "plan", h.Plan) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "sku", h.SKU) + populate(objectMap, "systemData", h.SystemData) + populate(objectMap, "tags", h.Tags) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolList. +func (h HostPoolList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", h.NextLink) + populate(objectMap, "value", h.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolPatch. +func (h HostPoolPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", h.ID) + populate(objectMap, "name", h.Name) + populate(objectMap, "properties", h.Properties) + populate(objectMap, "tags", h.Tags) + populate(objectMap, "type", h.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type HostPoolProperties. +func (h HostPoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentUpdate", h.AgentUpdate) + populate(objectMap, "applicationGroupReferences", h.ApplicationGroupReferences) + populate(objectMap, "cloudPcResource", h.CloudPcResource) + populate(objectMap, "customRdpProperty", h.CustomRdpProperty) + populate(objectMap, "description", h.Description) + populate(objectMap, "friendlyName", h.FriendlyName) + populate(objectMap, "hostPoolType", h.HostPoolType) + populate(objectMap, "loadBalancerType", h.LoadBalancerType) + populate(objectMap, "maxSessionLimit", h.MaxSessionLimit) + populate(objectMap, "migrationRequest", h.MigrationRequest) + populate(objectMap, "objectId", h.ObjectID) + populate(objectMap, "personalDesktopAssignmentType", h.PersonalDesktopAssignmentType) + populate(objectMap, "preferredAppGroupType", h.PreferredAppGroupType) + populate(objectMap, "privateEndpointConnections", h.PrivateEndpointConnections) + populate(objectMap, "publicNetworkAccess", h.PublicNetworkAccess) + populate(objectMap, "registrationInfo", h.RegistrationInfo) + populate(objectMap, "ring", h.Ring) + populate(objectMap, "ssoClientId", h.SsoClientID) + populate(objectMap, "ssoClientSecretKeyVaultPath", h.SsoClientSecretKeyVaultPath) + populate(objectMap, "ssoSecretType", h.SsoSecretType) + populate(objectMap, "ssoadfsAuthority", h.SsoadfsAuthority) + populate(objectMap, "startVMOnConnect", h.StartVMOnConnect) + populate(objectMap, "vmTemplate", h.VMTemplate) + populate(objectMap, "validationEnvironment", h.ValidationEnvironment) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MSIXPackageList. +func (m MSIXPackageList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", m.NextLink) + populate(objectMap, "value", m.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MSIXPackagePatch. +func (m MSIXPackagePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", m.ID) + populate(objectMap, "name", m.Name) + populate(objectMap, "properties", m.Properties) + populate(objectMap, "type", m.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type MSIXPackageProperties. +func (m MSIXPackageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "displayName", m.DisplayName) + populate(objectMap, "imagePath", m.ImagePath) + populate(objectMap, "isActive", m.IsActive) + populate(objectMap, "isRegularRegistration", m.IsRegularRegistration) + populateTimeRFC3339(objectMap, "lastUpdated", m.LastUpdated) + populate(objectMap, "packageApplications", m.PackageApplications) + populate(objectMap, "packageDependencies", m.PackageDependencies) + populate(objectMap, "packageFamilyName", m.PackageFamilyName) + populate(objectMap, "packageName", m.PackageName) + populate(objectMap, "packageRelativePath", m.PackageRelativePath) + populate(objectMap, "version", m.Version) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MSIXPackageProperties. +func (m *MSIXPackageProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "displayName": + err = unpopulate(val, &m.DisplayName) + delete(rawMsg, key) + case "imagePath": + err = unpopulate(val, &m.ImagePath) + delete(rawMsg, key) + case "isActive": + err = unpopulate(val, &m.IsActive) + delete(rawMsg, key) + case "isRegularRegistration": + err = unpopulate(val, &m.IsRegularRegistration) + delete(rawMsg, key) + case "lastUpdated": + err = unpopulateTimeRFC3339(val, &m.LastUpdated) + delete(rawMsg, key) + case "packageApplications": + err = unpopulate(val, &m.PackageApplications) + delete(rawMsg, key) + case "packageDependencies": + err = unpopulate(val, &m.PackageDependencies) + delete(rawMsg, key) + case "packageFamilyName": + err = unpopulate(val, &m.PackageFamilyName) + delete(rawMsg, key) + case "packageName": + err = unpopulate(val, &m.PackageName) + delete(rawMsg, key) + case "packageRelativePath": + err = unpopulate(val, &m.PackageRelativePath) + delete(rawMsg, key) + case "version": + err = unpopulate(val, &m.Version) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type MsixPackageApplications. +func (m MsixPackageApplications) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "appId", m.AppID) + populate(objectMap, "appUserModelID", m.AppUserModelID) + populate(objectMap, "description", m.Description) + populate(objectMap, "friendlyName", m.FriendlyName) + populate(objectMap, "iconImageName", m.IconImageName) + populateByteArray(objectMap, "rawIcon", m.RawIcon, runtime.Base64StdFormat) + populateByteArray(objectMap, "rawPng", m.RawPNG, runtime.Base64StdFormat) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type MsixPackageApplications. +func (m *MsixPackageApplications) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "appId": + err = unpopulate(val, &m.AppID) + delete(rawMsg, key) + case "appUserModelID": + err = unpopulate(val, &m.AppUserModelID) + delete(rawMsg, key) + case "description": + err = unpopulate(val, &m.Description) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &m.FriendlyName) + delete(rawMsg, key) + case "iconImageName": + err = unpopulate(val, &m.IconImageName) + delete(rawMsg, key) + case "rawIcon": + err = runtime.DecodeByteArray(string(val), &m.RawIcon, runtime.Base64StdFormat) + delete(rawMsg, key) + case "rawPng": + err = runtime.DecodeByteArray(string(val), &m.RawPNG, runtime.Base64StdFormat) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResultWithSystemData. +func (p PrivateEndpointConnectionListResultWithSystemData) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RegistrationInfo. +func (r RegistrationInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) + populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) + populate(objectMap, "token", r.Token) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationInfo. +func (r *RegistrationInfo) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationTime": + err = unpopulateTimeRFC3339(val, &r.ExpirationTime) + delete(rawMsg, key) + case "registrationTokenOperation": + err = unpopulate(val, &r.RegistrationTokenOperation) + delete(rawMsg, key) + case "token": + err = unpopulate(val, &r.Token) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type RegistrationInfoPatch. +func (r RegistrationInfoPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateTimeRFC3339(objectMap, "expirationTime", r.ExpirationTime) + populate(objectMap, "registrationTokenOperation", r.RegistrationTokenOperation) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type RegistrationInfoPatch. +func (r *RegistrationInfoPatch) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "expirationTime": + err = unpopulateTimeRFC3339(val, &r.ExpirationTime) + delete(rawMsg, key) + case "registrationTokenOperation": + err = unpopulate(val, &r.RegistrationTokenOperation) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceModelWithAllowedPropertySet. +func (r ResourceModelWithAllowedPropertySet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", r.Etag) + populate(objectMap, "id", r.ID) + populate(objectMap, "identity", r.Identity) + populate(objectMap, "kind", r.Kind) + populate(objectMap, "location", r.Location) + populate(objectMap, "managedBy", r.ManagedBy) + populate(objectMap, "name", r.Name) + populate(objectMap, "plan", r.Plan) + populate(objectMap, "sku", r.SKU) + populate(objectMap, "tags", r.Tags) + populate(objectMap, "type", r.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ResourceProviderOperationList. +func (r ResourceProviderOperationList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", r.NextLink) + populate(objectMap, "value", r.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlan. +func (s ScalingPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", s.Etag) + populate(objectMap, "id", s.ID) + populate(objectMap, "identity", s.Identity) + populate(objectMap, "kind", s.Kind) + populate(objectMap, "location", s.Location) + populate(objectMap, "managedBy", s.ManagedBy) + populate(objectMap, "name", s.Name) + populate(objectMap, "plan", s.Plan) + populate(objectMap, "properties", s.Properties) + populate(objectMap, "sku", s.SKU) + populate(objectMap, "systemData", s.SystemData) + populate(objectMap, "tags", s.Tags) + populate(objectMap, "type", s.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanList. +func (s ScalingPlanList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanPatch. +func (s ScalingPlanPatch) 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 ScalingPlanPatchProperties. +func (s ScalingPlanPatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populate(objectMap, "exclusionTag", s.ExclusionTag) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "hostPoolReferences", s.HostPoolReferences) + populate(objectMap, "schedules", s.Schedules) + populate(objectMap, "timeZone", s.TimeZone) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingPlanProperties. +func (s ScalingPlanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", s.Description) + populate(objectMap, "exclusionTag", s.ExclusionTag) + populate(objectMap, "friendlyName", s.FriendlyName) + populate(objectMap, "hostPoolReferences", s.HostPoolReferences) + populate(objectMap, "hostPoolType", s.HostPoolType) + populate(objectMap, "objectId", s.ObjectID) + populate(objectMap, "schedules", s.Schedules) + populate(objectMap, "timeZone", s.TimeZone) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ScalingSchedule. +func (s ScalingSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "daysOfWeek", s.DaysOfWeek) + populate(objectMap, "name", s.Name) + populate(objectMap, "offPeakLoadBalancingAlgorithm", s.OffPeakLoadBalancingAlgorithm) + populate(objectMap, "offPeakStartTime", s.OffPeakStartTime) + populate(objectMap, "peakLoadBalancingAlgorithm", s.PeakLoadBalancingAlgorithm) + populate(objectMap, "peakStartTime", s.PeakStartTime) + populate(objectMap, "rampDownCapacityThresholdPct", s.RampDownCapacityThresholdPct) + populate(objectMap, "rampDownForceLogoffUsers", s.RampDownForceLogoffUsers) + populate(objectMap, "rampDownLoadBalancingAlgorithm", s.RampDownLoadBalancingAlgorithm) + populate(objectMap, "rampDownMinimumHostsPct", s.RampDownMinimumHostsPct) + populate(objectMap, "rampDownNotificationMessage", s.RampDownNotificationMessage) + populate(objectMap, "rampDownStartTime", s.RampDownStartTime) + populate(objectMap, "rampDownStopHostsWhen", s.RampDownStopHostsWhen) + populate(objectMap, "rampDownWaitTimeMinutes", s.RampDownWaitTimeMinutes) + populate(objectMap, "rampUpCapacityThresholdPct", s.RampUpCapacityThresholdPct) + populate(objectMap, "rampUpLoadBalancingAlgorithm", s.RampUpLoadBalancingAlgorithm) + populate(objectMap, "rampUpMinimumHostsPct", s.RampUpMinimumHostsPct) + populate(objectMap, "rampUpStartTime", s.RampUpStartTime) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ServiceSpecification. +func (s ServiceSpecification) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "logSpecifications", s.LogSpecifications) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostHealthCheckFailureDetails. +func (s SessionHostHealthCheckFailureDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "errorCode", s.ErrorCode) + populateTimeRFC3339(objectMap, "lastHealthCheckDateTime", s.LastHealthCheckDateTime) + populate(objectMap, "message", s.Message) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostHealthCheckFailureDetails. +func (s *SessionHostHealthCheckFailureDetails) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "errorCode": + err = unpopulate(val, &s.ErrorCode) + delete(rawMsg, key) + case "lastHealthCheckDateTime": + err = unpopulateTimeRFC3339(val, &s.LastHealthCheckDateTime) + delete(rawMsg, key) + case "message": + err = unpopulate(val, &s.Message) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostList. +func (s SessionHostList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostPatch. +func (s SessionHostPatch) 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) +} + +// MarshalJSON implements the json.Marshaller interface for type SessionHostProperties. +func (s SessionHostProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "agentVersion", s.AgentVersion) + populate(objectMap, "allowNewSession", s.AllowNewSession) + populate(objectMap, "assignedUser", s.AssignedUser) + populate(objectMap, "friendlyName", s.FriendlyName) + populateTimeRFC3339(objectMap, "lastHeartBeat", s.LastHeartBeat) + populateTimeRFC3339(objectMap, "lastUpdateTime", s.LastUpdateTime) + populate(objectMap, "osVersion", s.OSVersion) + populate(objectMap, "objectId", s.ObjectID) + populate(objectMap, "resourceId", s.ResourceID) + populate(objectMap, "sessionHostHealthCheckResults", s.SessionHostHealthCheckResults) + populate(objectMap, "sessions", s.Sessions) + populate(objectMap, "status", s.Status) + populateTimeRFC3339(objectMap, "statusTimestamp", s.StatusTimestamp) + populate(objectMap, "sxSStackVersion", s.SxSStackVersion) + populate(objectMap, "updateErrorMessage", s.UpdateErrorMessage) + populate(objectMap, "updateState", s.UpdateState) + populate(objectMap, "virtualMachineId", s.VirtualMachineID) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type SessionHostProperties. +func (s *SessionHostProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "agentVersion": + err = unpopulate(val, &s.AgentVersion) + delete(rawMsg, key) + case "allowNewSession": + err = unpopulate(val, &s.AllowNewSession) + delete(rawMsg, key) + case "assignedUser": + err = unpopulate(val, &s.AssignedUser) + delete(rawMsg, key) + case "friendlyName": + err = unpopulate(val, &s.FriendlyName) + delete(rawMsg, key) + case "lastHeartBeat": + err = unpopulateTimeRFC3339(val, &s.LastHeartBeat) + delete(rawMsg, key) + case "lastUpdateTime": + err = unpopulateTimeRFC3339(val, &s.LastUpdateTime) + delete(rawMsg, key) + case "osVersion": + err = unpopulate(val, &s.OSVersion) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, &s.ObjectID) + delete(rawMsg, key) + case "resourceId": + err = unpopulate(val, &s.ResourceID) + delete(rawMsg, key) + case "sessionHostHealthCheckResults": + err = unpopulate(val, &s.SessionHostHealthCheckResults) + delete(rawMsg, key) + case "sessions": + err = unpopulate(val, &s.Sessions) + delete(rawMsg, key) + case "status": + err = unpopulate(val, &s.Status) + delete(rawMsg, key) + case "statusTimestamp": + err = unpopulateTimeRFC3339(val, &s.StatusTimestamp) + delete(rawMsg, key) + case "sxSStackVersion": + err = unpopulate(val, &s.SxSStackVersion) + delete(rawMsg, key) + case "updateErrorMessage": + err = unpopulate(val, &s.UpdateErrorMessage) + delete(rawMsg, key) + case "updateState": + err = unpopulate(val, &s.UpdateState) + delete(rawMsg, key) + case "virtualMachineId": + err = unpopulate(val, &s.VirtualMachineID) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type StartMenuItemList. +func (s StartMenuItemList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// 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 err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type UserSessionList. +func (u UserSessionList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", u.NextLink) + populate(objectMap, "value", u.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type UserSessionProperties. +func (u UserSessionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "activeDirectoryUserName", u.ActiveDirectoryUserName) + populate(objectMap, "applicationType", u.ApplicationType) + populateTimeRFC3339(objectMap, "createTime", u.CreateTime) + populate(objectMap, "objectId", u.ObjectID) + populate(objectMap, "sessionState", u.SessionState) + populate(objectMap, "userPrincipalName", u.UserPrincipalName) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type UserSessionProperties. +func (u *UserSessionProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "activeDirectoryUserName": + err = unpopulate(val, &u.ActiveDirectoryUserName) + delete(rawMsg, key) + case "applicationType": + err = unpopulate(val, &u.ApplicationType) + delete(rawMsg, key) + case "createTime": + err = unpopulateTimeRFC3339(val, &u.CreateTime) + delete(rawMsg, key) + case "objectId": + err = unpopulate(val, &u.ObjectID) + delete(rawMsg, key) + case "sessionState": + err = unpopulate(val, &u.SessionState) + delete(rawMsg, key) + case "userPrincipalName": + err = unpopulate(val, &u.UserPrincipalName) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "etag", w.Etag) + populate(objectMap, "id", w.ID) + populate(objectMap, "identity", w.Identity) + populate(objectMap, "kind", w.Kind) + populate(objectMap, "location", w.Location) + populate(objectMap, "managedBy", w.ManagedBy) + populate(objectMap, "name", w.Name) + populate(objectMap, "plan", w.Plan) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "sku", w.SKU) + populate(objectMap, "systemData", w.SystemData) + populate(objectMap, "tags", w.Tags) + populate(objectMap, "type", w.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceList. +func (w WorkspaceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", w.NextLink) + populate(objectMap, "value", w.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePatch. +func (w WorkspacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "properties", w.Properties) + populate(objectMap, "tags", w.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspacePatchProperties. +func (w WorkspacePatchProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) + populate(objectMap, "description", w.Description) + populate(objectMap, "friendlyName", w.FriendlyName) + populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type WorkspaceProperties. +func (w WorkspaceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "applicationGroupReferences", w.ApplicationGroupReferences) + populate(objectMap, "cloudPcResource", w.CloudPcResource) + populate(objectMap, "description", w.Description) + populate(objectMap, "friendlyName", w.FriendlyName) + populate(objectMap, "objectId", w.ObjectID) + populate(objectMap, "privateEndpointConnections", w.PrivateEndpointConnections) + populate(objectMap, "publicNetworkAccess", w.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +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 populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go index be61f1c14bfc..3c757ecf4106 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msiximages_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type MsixImagesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *MsixImagesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MsixImagesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &MsixImagesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // Expand - Expands and Lists MSIX packages in an Image, given the Image Path. @@ -55,16 +60,32 @@ func NewMsixImagesClient(subscriptionID string, credential azcore.TokenCredentia // hostPoolName - The name of the host pool within the specified resource group // msixImageURI - Object containing URI to MSIX Image // options - MsixImagesClientExpandOptions contains the optional parameters for the MsixImagesClient.Expand method. -func (client *MsixImagesClient) Expand(resourceGroupName string, hostPoolName string, msixImageURI MSIXImageURI, options *MsixImagesClientExpandOptions) *MsixImagesClientExpandPager { - return &MsixImagesClientExpandPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.expandCreateRequest(ctx, resourceGroupName, hostPoolName, msixImageURI, options) +func (client *MsixImagesClient) Expand(resourceGroupName string, hostPoolName string, msixImageURI MSIXImageURI, options *MsixImagesClientExpandOptions) *runtime.Pager[MsixImagesClientExpandResponse] { + return runtime.NewPager(runtime.PageProcessor[MsixImagesClientExpandResponse]{ + More: func(page MsixImagesClientExpandResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp MsixImagesClientExpandResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ExpandMsixImageList.NextLink) + Fetcher: func(ctx context.Context, page *MsixImagesClientExpandResponse) (MsixImagesClientExpandResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.expandCreateRequest(ctx, resourceGroupName, hostPoolName, msixImageURI, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return MsixImagesClientExpandResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MsixImagesClientExpandResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MsixImagesClientExpandResponse{}, runtime.NewResponseError(resp) + } + return client.expandHandleResponse(resp) }, - } + }) } // expandCreateRequest creates the Expand request. @@ -87,7 +108,7 @@ func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, msixImageURI) @@ -95,7 +116,7 @@ func (client *MsixImagesClient) expandCreateRequest(ctx context.Context, resourc // expandHandleResponse handles the Expand response. func (client *MsixImagesClient) expandHandleResponse(resp *http.Response) (MsixImagesClientExpandResponse, error) { - result := MsixImagesClientExpandResponse{RawResponse: resp} + result := MsixImagesClientExpandResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ExpandMsixImageList); err != nil { return MsixImagesClientExpandResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go index c89c4a63c571..29529196c3b1 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_msixpackages_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type MSIXPackagesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewMSIXPackagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *MSIXPackagesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewMSIXPackagesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*MSIXPackagesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &MSIXPackagesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Create or update a MSIX package. @@ -96,7 +101,7 @@ func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, msixPackage) @@ -104,7 +109,7 @@ func (client *MSIXPackagesClient) createOrUpdateCreateRequest(ctx context.Contex // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *MSIXPackagesClient) createOrUpdateHandleResponse(resp *http.Response) (MSIXPackagesClientCreateOrUpdateResponse, error) { - result := MSIXPackagesClientCreateOrUpdateResponse{RawResponse: resp} + result := MSIXPackagesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MSIXPackage); err != nil { return MSIXPackagesClientCreateOrUpdateResponse{}, err } @@ -129,7 +134,7 @@ func (client *MSIXPackagesClient) Delete(ctx context.Context, resourceGroupName if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return MSIXPackagesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return MSIXPackagesClientDeleteResponse{RawResponse: resp}, nil + return MSIXPackagesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -156,7 +161,7 @@ func (client *MSIXPackagesClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -207,7 +212,7 @@ func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -215,7 +220,7 @@ func (client *MSIXPackagesClient) getCreateRequest(ctx context.Context, resource // getHandleResponse handles the Get response. func (client *MSIXPackagesClient) getHandleResponse(resp *http.Response) (MSIXPackagesClientGetResponse, error) { - result := MSIXPackagesClientGetResponse{RawResponse: resp} + result := MSIXPackagesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MSIXPackage); err != nil { return MSIXPackagesClientGetResponse{}, err } @@ -227,16 +232,32 @@ func (client *MSIXPackagesClient) getHandleResponse(resp *http.Response) (MSIXPa // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - MSIXPackagesClientListOptions contains the optional parameters for the MSIXPackagesClient.List method. -func (client *MSIXPackagesClient) List(resourceGroupName string, hostPoolName string, options *MSIXPackagesClientListOptions) *MSIXPackagesClientListPager { - return &MSIXPackagesClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, hostPoolName, options) +func (client *MSIXPackagesClient) List(resourceGroupName string, hostPoolName string, options *MSIXPackagesClientListOptions) *runtime.Pager[MSIXPackagesClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[MSIXPackagesClientListResponse]{ + More: func(page MSIXPackagesClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp MSIXPackagesClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.MSIXPackageList.NextLink) + Fetcher: func(ctx context.Context, page *MSIXPackagesClientListResponse) (MSIXPackagesClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, hostPoolName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return MSIXPackagesClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return MSIXPackagesClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return MSIXPackagesClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -259,7 +280,7 @@ func (client *MSIXPackagesClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -267,7 +288,7 @@ func (client *MSIXPackagesClient) listCreateRequest(ctx context.Context, resourc // listHandleResponse handles the List response. func (client *MSIXPackagesClient) listHandleResponse(resp *http.Response) (MSIXPackagesClientListResponse, error) { - result := MSIXPackagesClientListResponse{RawResponse: resp} + result := MSIXPackagesClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MSIXPackageList); err != nil { return MSIXPackagesClientListResponse{}, err } @@ -319,7 +340,7 @@ func (client *MSIXPackagesClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.MsixPackage != nil { @@ -330,7 +351,7 @@ func (client *MSIXPackagesClient) updateCreateRequest(ctx context.Context, resou // updateHandleResponse handles the Update response. func (client *MSIXPackagesClient) updateHandleResponse(resp *http.Response) (MSIXPackagesClientUpdateResponse, error) { - result := MSIXPackagesClientUpdateResponse{RawResponse: resp} + result := MSIXPackagesClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.MSIXPackage); err != nil { return MSIXPackagesClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go index b688b40374f8..bc77ca6be9ea 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -13,6 +13,7 @@ import ( "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" @@ -28,34 +29,54 @@ type OperationsClient struct { // 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 { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - List all of the available operations the Desktop Virtualization resource provider supports. // If the operation fails it returns an *azcore.ResponseError type. // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager { - return &OperationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *OperationsClient) List(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp OperationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ResourceProviderOperationList.NextLink) + 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. @@ -66,7 +87,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -74,7 +95,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ResourceProviderOperationList); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_pagers.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_pagers.go deleted file mode 100644 index 9553ba33f0af..000000000000 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_pagers.go +++ /dev/null @@ -1,1205 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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 armdesktopvirtualization - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// ApplicationGroupsClientListByResourceGroupPager provides operations for iterating over paged responses. -type ApplicationGroupsClientListByResourceGroupPager struct { - client *ApplicationGroupsClient - current ApplicationGroupsClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ApplicationGroupsClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ApplicationGroupsClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ApplicationGroupsClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ApplicationGroupList.NextLink == nil || len(*p.current.ApplicationGroupList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ApplicationGroupsClientListByResourceGroupResponse page. -func (p *ApplicationGroupsClientListByResourceGroupPager) PageResponse() ApplicationGroupsClientListByResourceGroupResponse { - return p.current -} - -// ApplicationGroupsClientListBySubscriptionPager provides operations for iterating over paged responses. -type ApplicationGroupsClientListBySubscriptionPager struct { - client *ApplicationGroupsClient - current ApplicationGroupsClientListBySubscriptionResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ApplicationGroupsClientListBySubscriptionResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ApplicationGroupsClientListBySubscriptionPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ApplicationGroupsClientListBySubscriptionPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ApplicationGroupList.NextLink == nil || len(*p.current.ApplicationGroupList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listBySubscriptionHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ApplicationGroupsClientListBySubscriptionResponse page. -func (p *ApplicationGroupsClientListBySubscriptionPager) PageResponse() ApplicationGroupsClientListBySubscriptionResponse { - return p.current -} - -// ApplicationsClientListPager provides operations for iterating over paged responses. -type ApplicationsClientListPager struct { - client *ApplicationsClient - current ApplicationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ApplicationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ApplicationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ApplicationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ApplicationList.NextLink == nil || len(*p.current.ApplicationList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ApplicationsClientListResponse page. -func (p *ApplicationsClientListPager) PageResponse() ApplicationsClientListResponse { - return p.current -} - -// DesktopsClientListPager provides operations for iterating over paged responses. -type DesktopsClientListPager struct { - client *DesktopsClient - current DesktopsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, DesktopsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *DesktopsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *DesktopsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.DesktopList.NextLink == nil || len(*p.current.DesktopList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current DesktopsClientListResponse page. -func (p *DesktopsClientListPager) PageResponse() DesktopsClientListResponse { - return p.current -} - -// HostPoolsClientListByResourceGroupPager provides operations for iterating over paged responses. -type HostPoolsClientListByResourceGroupPager struct { - client *HostPoolsClient - current HostPoolsClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, HostPoolsClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *HostPoolsClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *HostPoolsClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.HostPoolList.NextLink == nil || len(*p.current.HostPoolList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current HostPoolsClientListByResourceGroupResponse page. -func (p *HostPoolsClientListByResourceGroupPager) PageResponse() HostPoolsClientListByResourceGroupResponse { - return p.current -} - -// HostPoolsClientListPager provides operations for iterating over paged responses. -type HostPoolsClientListPager struct { - client *HostPoolsClient - current HostPoolsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, HostPoolsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *HostPoolsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *HostPoolsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.HostPoolList.NextLink == nil || len(*p.current.HostPoolList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current HostPoolsClientListResponse page. -func (p *HostPoolsClientListPager) PageResponse() HostPoolsClientListResponse { - return p.current -} - -// MSIXPackagesClientListPager provides operations for iterating over paged responses. -type MSIXPackagesClientListPager struct { - client *MSIXPackagesClient - current MSIXPackagesClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, MSIXPackagesClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *MSIXPackagesClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *MSIXPackagesClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.MSIXPackageList.NextLink == nil || len(*p.current.MSIXPackageList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current MSIXPackagesClientListResponse page. -func (p *MSIXPackagesClientListPager) PageResponse() MSIXPackagesClientListResponse { - return p.current -} - -// MsixImagesClientExpandPager provides operations for iterating over paged responses. -type MsixImagesClientExpandPager struct { - client *MsixImagesClient - current MsixImagesClientExpandResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, MsixImagesClientExpandResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *MsixImagesClientExpandPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *MsixImagesClientExpandPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ExpandMsixImageList.NextLink == nil || len(*p.current.ExpandMsixImageList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.expandHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current MsixImagesClientExpandResponse page. -func (p *MsixImagesClientExpandPager) PageResponse() MsixImagesClientExpandResponse { - return p.current -} - -// OperationsClientListPager provides operations for iterating over paged responses. -type OperationsClientListPager struct { - client *OperationsClient - current OperationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OperationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *OperationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *OperationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ResourceProviderOperationList.NextLink == nil || len(*p.current.ResourceProviderOperationList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current OperationsClientListResponse page. -func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse { - return p.current -} - -// PrivateEndpointConnectionsClientListByHostPoolPager provides operations for iterating over paged responses. -type PrivateEndpointConnectionsClientListByHostPoolPager struct { - client *PrivateEndpointConnectionsClient - current PrivateEndpointConnectionsClientListByHostPoolResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, PrivateEndpointConnectionsClientListByHostPoolResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *PrivateEndpointConnectionsClientListByHostPoolPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *PrivateEndpointConnectionsClientListByHostPoolPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.PrivateEndpointConnectionListResultWithSystemData.NextLink == nil || len(*p.current.PrivateEndpointConnectionListResultWithSystemData.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByHostPoolHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current PrivateEndpointConnectionsClientListByHostPoolResponse page. -func (p *PrivateEndpointConnectionsClientListByHostPoolPager) PageResponse() PrivateEndpointConnectionsClientListByHostPoolResponse { - return p.current -} - -// PrivateEndpointConnectionsClientListByWorkspacePager provides operations for iterating over paged responses. -type PrivateEndpointConnectionsClientListByWorkspacePager struct { - client *PrivateEndpointConnectionsClient - current PrivateEndpointConnectionsClientListByWorkspaceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, PrivateEndpointConnectionsClientListByWorkspaceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *PrivateEndpointConnectionsClientListByWorkspacePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *PrivateEndpointConnectionsClientListByWorkspacePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.PrivateEndpointConnectionListResultWithSystemData.NextLink == nil || len(*p.current.PrivateEndpointConnectionListResultWithSystemData.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByWorkspaceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current PrivateEndpointConnectionsClientListByWorkspaceResponse page. -func (p *PrivateEndpointConnectionsClientListByWorkspacePager) PageResponse() PrivateEndpointConnectionsClientListByWorkspaceResponse { - return p.current -} - -// PrivateLinkResourcesClientListByHostPoolPager provides operations for iterating over paged responses. -type PrivateLinkResourcesClientListByHostPoolPager struct { - client *PrivateLinkResourcesClient - current PrivateLinkResourcesClientListByHostPoolResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, PrivateLinkResourcesClientListByHostPoolResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *PrivateLinkResourcesClientListByHostPoolPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *PrivateLinkResourcesClientListByHostPoolPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.PrivateLinkResourceListResult.NextLink == nil || len(*p.current.PrivateLinkResourceListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByHostPoolHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current PrivateLinkResourcesClientListByHostPoolResponse page. -func (p *PrivateLinkResourcesClientListByHostPoolPager) PageResponse() PrivateLinkResourcesClientListByHostPoolResponse { - return p.current -} - -// PrivateLinkResourcesClientListByWorkspacePager provides operations for iterating over paged responses. -type PrivateLinkResourcesClientListByWorkspacePager struct { - client *PrivateLinkResourcesClient - current PrivateLinkResourcesClientListByWorkspaceResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, PrivateLinkResourcesClientListByWorkspaceResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *PrivateLinkResourcesClientListByWorkspacePager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *PrivateLinkResourcesClientListByWorkspacePager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.PrivateLinkResourceListResult.NextLink == nil || len(*p.current.PrivateLinkResourceListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByWorkspaceHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current PrivateLinkResourcesClientListByWorkspaceResponse page. -func (p *PrivateLinkResourcesClientListByWorkspacePager) PageResponse() PrivateLinkResourcesClientListByWorkspaceResponse { - return p.current -} - -// ScalingPlansClientListByHostPoolPager provides operations for iterating over paged responses. -type ScalingPlansClientListByHostPoolPager struct { - client *ScalingPlansClient - current ScalingPlansClientListByHostPoolResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ScalingPlansClientListByHostPoolResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ScalingPlansClientListByHostPoolPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ScalingPlansClientListByHostPoolPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ScalingPlanList.NextLink == nil || len(*p.current.ScalingPlanList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByHostPoolHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ScalingPlansClientListByHostPoolResponse page. -func (p *ScalingPlansClientListByHostPoolPager) PageResponse() ScalingPlansClientListByHostPoolResponse { - return p.current -} - -// ScalingPlansClientListByResourceGroupPager provides operations for iterating over paged responses. -type ScalingPlansClientListByResourceGroupPager struct { - client *ScalingPlansClient - current ScalingPlansClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ScalingPlansClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ScalingPlansClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ScalingPlansClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ScalingPlanList.NextLink == nil || len(*p.current.ScalingPlanList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ScalingPlansClientListByResourceGroupResponse page. -func (p *ScalingPlansClientListByResourceGroupPager) PageResponse() ScalingPlansClientListByResourceGroupResponse { - return p.current -} - -// ScalingPlansClientListBySubscriptionPager provides operations for iterating over paged responses. -type ScalingPlansClientListBySubscriptionPager struct { - client *ScalingPlansClient - current ScalingPlansClientListBySubscriptionResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, ScalingPlansClientListBySubscriptionResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *ScalingPlansClientListBySubscriptionPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *ScalingPlansClientListBySubscriptionPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ScalingPlanList.NextLink == nil || len(*p.current.ScalingPlanList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listBySubscriptionHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current ScalingPlansClientListBySubscriptionResponse page. -func (p *ScalingPlansClientListBySubscriptionPager) PageResponse() ScalingPlansClientListBySubscriptionResponse { - return p.current -} - -// SessionHostsClientListPager provides operations for iterating over paged responses. -type SessionHostsClientListPager struct { - client *SessionHostsClient - current SessionHostsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, SessionHostsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *SessionHostsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *SessionHostsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.SessionHostList.NextLink == nil || len(*p.current.SessionHostList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current SessionHostsClientListResponse page. -func (p *SessionHostsClientListPager) PageResponse() SessionHostsClientListResponse { - return p.current -} - -// StartMenuItemsClientListPager provides operations for iterating over paged responses. -type StartMenuItemsClientListPager struct { - client *StartMenuItemsClient - current StartMenuItemsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, StartMenuItemsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *StartMenuItemsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *StartMenuItemsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.StartMenuItemList.NextLink == nil || len(*p.current.StartMenuItemList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current StartMenuItemsClientListResponse page. -func (p *StartMenuItemsClientListPager) PageResponse() StartMenuItemsClientListResponse { - return p.current -} - -// UserSessionsClientListByHostPoolPager provides operations for iterating over paged responses. -type UserSessionsClientListByHostPoolPager struct { - client *UserSessionsClient - current UserSessionsClientListByHostPoolResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, UserSessionsClientListByHostPoolResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *UserSessionsClientListByHostPoolPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *UserSessionsClientListByHostPoolPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.UserSessionList.NextLink == nil || len(*p.current.UserSessionList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByHostPoolHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current UserSessionsClientListByHostPoolResponse page. -func (p *UserSessionsClientListByHostPoolPager) PageResponse() UserSessionsClientListByHostPoolResponse { - return p.current -} - -// UserSessionsClientListPager provides operations for iterating over paged responses. -type UserSessionsClientListPager struct { - client *UserSessionsClient - current UserSessionsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, UserSessionsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *UserSessionsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *UserSessionsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.UserSessionList.NextLink == nil || len(*p.current.UserSessionList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current UserSessionsClientListResponse page. -func (p *UserSessionsClientListPager) PageResponse() UserSessionsClientListResponse { - return p.current -} - -// WorkspacesClientListByResourceGroupPager provides operations for iterating over paged responses. -type WorkspacesClientListByResourceGroupPager struct { - client *WorkspacesClient - current WorkspacesClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, WorkspacesClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *WorkspacesClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *WorkspacesClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.WorkspaceList.NextLink == nil || len(*p.current.WorkspaceList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current WorkspacesClientListByResourceGroupResponse page. -func (p *WorkspacesClientListByResourceGroupPager) PageResponse() WorkspacesClientListByResourceGroupResponse { - return p.current -} - -// WorkspacesClientListBySubscriptionPager provides operations for iterating over paged responses. -type WorkspacesClientListBySubscriptionPager struct { - client *WorkspacesClient - current WorkspacesClientListBySubscriptionResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, WorkspacesClientListBySubscriptionResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *WorkspacesClientListBySubscriptionPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *WorkspacesClientListBySubscriptionPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.WorkspaceList.NextLink == nil || len(*p.current.WorkspaceList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listBySubscriptionHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current WorkspacesClientListBySubscriptionResponse page. -func (p *WorkspacesClientListBySubscriptionPager) PageResponse() WorkspacesClientListBySubscriptionResponse { - return p.current -} diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go index 1b49b9d03b58..a057df4e5f57 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privateendpointconnections_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type PrivateEndpointConnectionsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateEndpointConnectionsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &PrivateEndpointConnectionsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // DeleteByHostPool - Remove a connection. @@ -68,7 +73,7 @@ func (client *PrivateEndpointConnectionsClient) DeleteByHostPool(ctx context.Con if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, runtime.NewResponseError(resp) } - return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{RawResponse: resp}, nil + return PrivateEndpointConnectionsClientDeleteByHostPoolResponse{}, nil } // deleteByHostPoolCreateRequest creates the DeleteByHostPool request. @@ -95,7 +100,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByHostPoolCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -120,7 +125,7 @@ func (client *PrivateEndpointConnectionsClient) DeleteByWorkspace(ctx context.Co if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, runtime.NewResponseError(resp) } - return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{RawResponse: resp}, nil + return PrivateEndpointConnectionsClientDeleteByWorkspaceResponse{}, nil } // deleteByWorkspaceCreateRequest creates the DeleteByWorkspace request. @@ -147,7 +152,7 @@ func (client *PrivateEndpointConnectionsClient) deleteByWorkspaceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -199,7 +204,7 @@ func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -207,7 +212,7 @@ func (client *PrivateEndpointConnectionsClient) getByHostPoolCreateRequest(ctx c // getByHostPoolHandleResponse handles the GetByHostPool response. func (client *PrivateEndpointConnectionsClient) getByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetByHostPoolResponse, error) { - result := PrivateEndpointConnectionsClientGetByHostPoolResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientGetByHostPoolResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { return PrivateEndpointConnectionsClientGetByHostPoolResponse{}, err } @@ -260,7 +265,7 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -268,7 +273,7 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceCreateRequest(ctx // getByWorkspaceHandleResponse handles the GetByWorkspace response. func (client *PrivateEndpointConnectionsClient) getByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetByWorkspaceResponse, error) { - result := PrivateEndpointConnectionsClientGetByWorkspaceResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientGetByWorkspaceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { return PrivateEndpointConnectionsClientGetByWorkspaceResponse{}, err } @@ -281,16 +286,32 @@ func (client *PrivateEndpointConnectionsClient) getByWorkspaceHandleResponse(res // hostPoolName - The name of the host pool within the specified resource group // options - PrivateEndpointConnectionsClientListByHostPoolOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByHostPool // method. -func (client *PrivateEndpointConnectionsClient) ListByHostPool(resourceGroupName string, hostPoolName string, options *PrivateEndpointConnectionsClientListByHostPoolOptions) *PrivateEndpointConnectionsClientListByHostPoolPager { - return &PrivateEndpointConnectionsClientListByHostPoolPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) +func (client *PrivateEndpointConnectionsClient) ListByHostPool(resourceGroupName string, hostPoolName string, options *PrivateEndpointConnectionsClientListByHostPoolOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByHostPoolResponse] { + return runtime.NewPager(runtime.PageProcessor[PrivateEndpointConnectionsClientListByHostPoolResponse]{ + More: func(page PrivateEndpointConnectionsClientListByHostPoolResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp PrivateEndpointConnectionsClientListByHostPoolResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateEndpointConnectionListResultWithSystemData.NextLink) + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListByHostPoolResponse) (PrivateEndpointConnectionsClientListByHostPoolResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return client.listByHostPoolHandleResponse(resp) }, - } + }) } // listByHostPoolCreateRequest creates the ListByHostPool request. @@ -313,7 +334,7 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -321,7 +342,7 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolCreateRequest(ctx // listByHostPoolHandleResponse handles the ListByHostPool response. func (client *PrivateEndpointConnectionsClient) listByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByHostPoolResponse, error) { - result := PrivateEndpointConnectionsClientListByHostPoolResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientListByHostPoolResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResultWithSystemData); err != nil { return PrivateEndpointConnectionsClientListByHostPoolResponse{}, err } @@ -334,16 +355,32 @@ func (client *PrivateEndpointConnectionsClient) listByHostPoolHandleResponse(res // workspaceName - The name of the workspace // options - PrivateEndpointConnectionsClientListByWorkspaceOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByWorkspace // method. -func (client *PrivateEndpointConnectionsClient) ListByWorkspace(resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListByWorkspaceOptions) *PrivateEndpointConnectionsClientListByWorkspacePager { - return &PrivateEndpointConnectionsClientListByWorkspacePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *PrivateEndpointConnectionsClient) ListByWorkspace(resourceGroupName string, workspaceName string, options *PrivateEndpointConnectionsClientListByWorkspaceOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByWorkspaceResponse] { + return runtime.NewPager(runtime.PageProcessor[PrivateEndpointConnectionsClientListByWorkspaceResponse]{ + More: func(page PrivateEndpointConnectionsClientListByWorkspaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp PrivateEndpointConnectionsClientListByWorkspaceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateEndpointConnectionListResultWithSystemData.NextLink) + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListByWorkspaceResponse) (PrivateEndpointConnectionsClientListByWorkspaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByWorkspaceHandleResponse(resp) }, - } + }) } // listByWorkspaceCreateRequest creates the ListByWorkspace request. @@ -366,7 +403,7 @@ func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -374,7 +411,7 @@ func (client *PrivateEndpointConnectionsClient) listByWorkspaceCreateRequest(ctx // listByWorkspaceHandleResponse handles the ListByWorkspace response. func (client *PrivateEndpointConnectionsClient) listByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByWorkspaceResponse, error) { - result := PrivateEndpointConnectionsClientListByWorkspaceResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientListByWorkspaceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResultWithSystemData); err != nil { return PrivateEndpointConnectionsClientListByWorkspaceResponse{}, err } @@ -428,7 +465,7 @@ func (client *PrivateEndpointConnectionsClient) updateByHostPoolCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, connection) @@ -436,7 +473,7 @@ func (client *PrivateEndpointConnectionsClient) updateByHostPoolCreateRequest(ct // updateByHostPoolHandleResponse handles the UpdateByHostPool response. func (client *PrivateEndpointConnectionsClient) updateByHostPoolHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientUpdateByHostPoolResponse, error) { - result := PrivateEndpointConnectionsClientUpdateByHostPoolResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientUpdateByHostPoolResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { return PrivateEndpointConnectionsClientUpdateByHostPoolResponse{}, err } @@ -490,7 +527,7 @@ func (client *PrivateEndpointConnectionsClient) updateByWorkspaceCreateRequest(c return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, connection) @@ -498,7 +535,7 @@ func (client *PrivateEndpointConnectionsClient) updateByWorkspaceCreateRequest(c // updateByWorkspaceHandleResponse handles the UpdateByWorkspace response. func (client *PrivateEndpointConnectionsClient) updateByWorkspaceHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientUpdateByWorkspaceResponse, error) { - result := PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionWithSystemData); err != nil { return PrivateEndpointConnectionsClientUpdateByWorkspaceResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go index bc23109326a4..76bc88c0ed20 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_privatelinkresources_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type PrivateLinkResourcesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateLinkResourcesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &PrivateLinkResourcesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // ListByHostPool - List the private link resources available for this hostpool. @@ -55,16 +60,32 @@ func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.Toke // hostPoolName - The name of the host pool within the specified resource group // options - PrivateLinkResourcesClientListByHostPoolOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByHostPool // method. -func (client *PrivateLinkResourcesClient) ListByHostPool(resourceGroupName string, hostPoolName string, options *PrivateLinkResourcesClientListByHostPoolOptions) *PrivateLinkResourcesClientListByHostPoolPager { - return &PrivateLinkResourcesClientListByHostPoolPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) +func (client *PrivateLinkResourcesClient) ListByHostPool(resourceGroupName string, hostPoolName string, options *PrivateLinkResourcesClientListByHostPoolOptions) *runtime.Pager[PrivateLinkResourcesClientListByHostPoolResponse] { + return runtime.NewPager(runtime.PageProcessor[PrivateLinkResourcesClientListByHostPoolResponse]{ + More: func(page PrivateLinkResourcesClientListByHostPoolResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp PrivateLinkResourcesClientListByHostPoolResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateLinkResourceListResult.NextLink) + Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByHostPoolResponse) (PrivateLinkResourcesClientListByHostPoolResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkResourcesClientListByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateLinkResourcesClientListByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkResourcesClientListByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return client.listByHostPoolHandleResponse(resp) }, - } + }) } // listByHostPoolCreateRequest creates the ListByHostPool request. @@ -87,7 +108,7 @@ func (client *PrivateLinkResourcesClient) listByHostPoolCreateRequest(ctx contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -95,7 +116,7 @@ func (client *PrivateLinkResourcesClient) listByHostPoolCreateRequest(ctx contex // listByHostPoolHandleResponse handles the ListByHostPool response. func (client *PrivateLinkResourcesClient) listByHostPoolHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByHostPoolResponse, error) { - result := PrivateLinkResourcesClientListByHostPoolResponse{RawResponse: resp} + result := PrivateLinkResourcesClientListByHostPoolResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { return PrivateLinkResourcesClientListByHostPoolResponse{}, err } @@ -108,16 +129,32 @@ func (client *PrivateLinkResourcesClient) listByHostPoolHandleResponse(resp *htt // workspaceName - The name of the workspace // options - PrivateLinkResourcesClientListByWorkspaceOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByWorkspace // method. -func (client *PrivateLinkResourcesClient) ListByWorkspace(resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListByWorkspaceOptions) *PrivateLinkResourcesClientListByWorkspacePager { - return &PrivateLinkResourcesClientListByWorkspacePager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options) +func (client *PrivateLinkResourcesClient) ListByWorkspace(resourceGroupName string, workspaceName string, options *PrivateLinkResourcesClientListByWorkspaceOptions) *runtime.Pager[PrivateLinkResourcesClientListByWorkspaceResponse] { + return runtime.NewPager(runtime.PageProcessor[PrivateLinkResourcesClientListByWorkspaceResponse]{ + More: func(page PrivateLinkResourcesClientListByWorkspaceResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp PrivateLinkResourcesClientListByWorkspaceResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.PrivateLinkResourceListResult.NextLink) + Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByWorkspaceResponse) (PrivateLinkResourcesClientListByWorkspaceResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByWorkspaceCreateRequest(ctx, resourceGroupName, workspaceName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return PrivateLinkResourcesClientListByWorkspaceResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateLinkResourcesClientListByWorkspaceResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkResourcesClientListByWorkspaceResponse{}, runtime.NewResponseError(resp) + } + return client.listByWorkspaceHandleResponse(resp) }, - } + }) } // listByWorkspaceCreateRequest creates the ListByWorkspace request. @@ -140,7 +177,7 @@ func (client *PrivateLinkResourcesClient) listByWorkspaceCreateRequest(ctx conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -148,7 +185,7 @@ func (client *PrivateLinkResourcesClient) listByWorkspaceCreateRequest(ctx conte // listByWorkspaceHandleResponse handles the ListByWorkspace response. func (client *PrivateLinkResourcesClient) listByWorkspaceHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByWorkspaceResponse, error) { - result := PrivateLinkResourcesClientListByWorkspaceResponse{RawResponse: resp} + result := PrivateLinkResourcesClientListByWorkspaceResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { return PrivateLinkResourcesClientListByWorkspaceResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go index 3d099c9b2158..c24e32c275bf 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,676 +8,312 @@ package armdesktopvirtualization -import "net/http" - // ApplicationGroupsClientCreateOrUpdateResponse contains the response from method ApplicationGroupsClient.CreateOrUpdate. type ApplicationGroupsClientCreateOrUpdateResponse struct { - ApplicationGroupsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationGroupsClientCreateOrUpdateResult contains the result from method ApplicationGroupsClient.CreateOrUpdate. -type ApplicationGroupsClientCreateOrUpdateResult struct { ApplicationGroup } // ApplicationGroupsClientDeleteResponse contains the response from method ApplicationGroupsClient.Delete. type ApplicationGroupsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ApplicationGroupsClientGetResponse contains the response from method ApplicationGroupsClient.Get. type ApplicationGroupsClientGetResponse struct { - ApplicationGroupsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationGroupsClientGetResult contains the result from method ApplicationGroupsClient.Get. -type ApplicationGroupsClientGetResult struct { ApplicationGroup } // ApplicationGroupsClientListByResourceGroupResponse contains the response from method ApplicationGroupsClient.ListByResourceGroup. type ApplicationGroupsClientListByResourceGroupResponse struct { - ApplicationGroupsClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationGroupsClientListByResourceGroupResult contains the result from method ApplicationGroupsClient.ListByResourceGroup. -type ApplicationGroupsClientListByResourceGroupResult struct { ApplicationGroupList } // ApplicationGroupsClientListBySubscriptionResponse contains the response from method ApplicationGroupsClient.ListBySubscription. type ApplicationGroupsClientListBySubscriptionResponse struct { - ApplicationGroupsClientListBySubscriptionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationGroupsClientListBySubscriptionResult contains the result from method ApplicationGroupsClient.ListBySubscription. -type ApplicationGroupsClientListBySubscriptionResult struct { ApplicationGroupList } // ApplicationGroupsClientUpdateResponse contains the response from method ApplicationGroupsClient.Update. type ApplicationGroupsClientUpdateResponse struct { - ApplicationGroupsClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationGroupsClientUpdateResult contains the result from method ApplicationGroupsClient.Update. -type ApplicationGroupsClientUpdateResult struct { ApplicationGroup } // ApplicationsClientCreateOrUpdateResponse contains the response from method ApplicationsClient.CreateOrUpdate. type ApplicationsClientCreateOrUpdateResponse struct { - ApplicationsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationsClientCreateOrUpdateResult contains the result from method ApplicationsClient.CreateOrUpdate. -type ApplicationsClientCreateOrUpdateResult struct { Application } // ApplicationsClientDeleteResponse contains the response from method ApplicationsClient.Delete. type ApplicationsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ApplicationsClientGetResponse contains the response from method ApplicationsClient.Get. type ApplicationsClientGetResponse struct { - ApplicationsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationsClientGetResult contains the result from method ApplicationsClient.Get. -type ApplicationsClientGetResult struct { Application } // ApplicationsClientListResponse contains the response from method ApplicationsClient.List. type ApplicationsClientListResponse struct { - ApplicationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationsClientListResult contains the result from method ApplicationsClient.List. -type ApplicationsClientListResult struct { ApplicationList } // ApplicationsClientUpdateResponse contains the response from method ApplicationsClient.Update. type ApplicationsClientUpdateResponse struct { - ApplicationsClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ApplicationsClientUpdateResult contains the result from method ApplicationsClient.Update. -type ApplicationsClientUpdateResult struct { Application } // DesktopsClientGetResponse contains the response from method DesktopsClient.Get. type DesktopsClientGetResponse struct { - DesktopsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DesktopsClientGetResult contains the result from method DesktopsClient.Get. -type DesktopsClientGetResult struct { Desktop } // DesktopsClientListResponse contains the response from method DesktopsClient.List. type DesktopsClientListResponse struct { - DesktopsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DesktopsClientListResult contains the result from method DesktopsClient.List. -type DesktopsClientListResult struct { DesktopList } // DesktopsClientUpdateResponse contains the response from method DesktopsClient.Update. type DesktopsClientUpdateResponse struct { - DesktopsClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DesktopsClientUpdateResult contains the result from method DesktopsClient.Update. -type DesktopsClientUpdateResult struct { Desktop } // HostPoolsClientCreateOrUpdateResponse contains the response from method HostPoolsClient.CreateOrUpdate. type HostPoolsClientCreateOrUpdateResponse struct { - HostPoolsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// HostPoolsClientCreateOrUpdateResult contains the result from method HostPoolsClient.CreateOrUpdate. -type HostPoolsClientCreateOrUpdateResult struct { HostPool } // HostPoolsClientDeleteResponse contains the response from method HostPoolsClient.Delete. type HostPoolsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // HostPoolsClientGetResponse contains the response from method HostPoolsClient.Get. type HostPoolsClientGetResponse struct { - HostPoolsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// HostPoolsClientGetResult contains the result from method HostPoolsClient.Get. -type HostPoolsClientGetResult struct { HostPool } // HostPoolsClientListByResourceGroupResponse contains the response from method HostPoolsClient.ListByResourceGroup. type HostPoolsClientListByResourceGroupResponse struct { - HostPoolsClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// HostPoolsClientListByResourceGroupResult contains the result from method HostPoolsClient.ListByResourceGroup. -type HostPoolsClientListByResourceGroupResult struct { HostPoolList } // HostPoolsClientListResponse contains the response from method HostPoolsClient.List. type HostPoolsClientListResponse struct { - HostPoolsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// HostPoolsClientListResult contains the result from method HostPoolsClient.List. -type HostPoolsClientListResult struct { HostPoolList } // HostPoolsClientRetrieveRegistrationTokenResponse contains the response from method HostPoolsClient.RetrieveRegistrationToken. type HostPoolsClientRetrieveRegistrationTokenResponse struct { - HostPoolsClientRetrieveRegistrationTokenResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// HostPoolsClientRetrieveRegistrationTokenResult contains the result from method HostPoolsClient.RetrieveRegistrationToken. -type HostPoolsClientRetrieveRegistrationTokenResult struct { RegistrationInfo } // HostPoolsClientUpdateResponse contains the response from method HostPoolsClient.Update. type HostPoolsClientUpdateResponse struct { - HostPoolsClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// HostPoolsClientUpdateResult contains the result from method HostPoolsClient.Update. -type HostPoolsClientUpdateResult struct { HostPool } // MSIXPackagesClientCreateOrUpdateResponse contains the response from method MSIXPackagesClient.CreateOrUpdate. type MSIXPackagesClientCreateOrUpdateResponse struct { - MSIXPackagesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MSIXPackagesClientCreateOrUpdateResult contains the result from method MSIXPackagesClient.CreateOrUpdate. -type MSIXPackagesClientCreateOrUpdateResult struct { MSIXPackage } // MSIXPackagesClientDeleteResponse contains the response from method MSIXPackagesClient.Delete. type MSIXPackagesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // MSIXPackagesClientGetResponse contains the response from method MSIXPackagesClient.Get. type MSIXPackagesClientGetResponse struct { - MSIXPackagesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MSIXPackagesClientGetResult contains the result from method MSIXPackagesClient.Get. -type MSIXPackagesClientGetResult struct { MSIXPackage } // MSIXPackagesClientListResponse contains the response from method MSIXPackagesClient.List. type MSIXPackagesClientListResponse struct { - MSIXPackagesClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MSIXPackagesClientListResult contains the result from method MSIXPackagesClient.List. -type MSIXPackagesClientListResult struct { MSIXPackageList } // MSIXPackagesClientUpdateResponse contains the response from method MSIXPackagesClient.Update. type MSIXPackagesClientUpdateResponse struct { - MSIXPackagesClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MSIXPackagesClientUpdateResult contains the result from method MSIXPackagesClient.Update. -type MSIXPackagesClientUpdateResult struct { MSIXPackage } // MsixImagesClientExpandResponse contains the response from method MsixImagesClient.Expand. type MsixImagesClientExpandResponse struct { - MsixImagesClientExpandResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// MsixImagesClientExpandResult contains the result from method MsixImagesClient.Expand. -type MsixImagesClientExpandResult struct { ExpandMsixImageList } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { ResourceProviderOperationList } // PrivateEndpointConnectionsClientDeleteByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.DeleteByHostPool. type PrivateEndpointConnectionsClientDeleteByHostPoolResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // PrivateEndpointConnectionsClientDeleteByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.DeleteByWorkspace. type PrivateEndpointConnectionsClientDeleteByWorkspaceResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // PrivateEndpointConnectionsClientGetByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.GetByHostPool. type PrivateEndpointConnectionsClientGetByHostPoolResponse struct { - PrivateEndpointConnectionsClientGetByHostPoolResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientGetByHostPoolResult contains the result from method PrivateEndpointConnectionsClient.GetByHostPool. -type PrivateEndpointConnectionsClientGetByHostPoolResult struct { PrivateEndpointConnectionWithSystemData } // PrivateEndpointConnectionsClientGetByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.GetByWorkspace. type PrivateEndpointConnectionsClientGetByWorkspaceResponse struct { - PrivateEndpointConnectionsClientGetByWorkspaceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientGetByWorkspaceResult contains the result from method PrivateEndpointConnectionsClient.GetByWorkspace. -type PrivateEndpointConnectionsClientGetByWorkspaceResult struct { PrivateEndpointConnectionWithSystemData } // PrivateEndpointConnectionsClientListByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.ListByHostPool. type PrivateEndpointConnectionsClientListByHostPoolResponse struct { - PrivateEndpointConnectionsClientListByHostPoolResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientListByHostPoolResult contains the result from method PrivateEndpointConnectionsClient.ListByHostPool. -type PrivateEndpointConnectionsClientListByHostPoolResult struct { PrivateEndpointConnectionListResultWithSystemData } // PrivateEndpointConnectionsClientListByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.ListByWorkspace. type PrivateEndpointConnectionsClientListByWorkspaceResponse struct { - PrivateEndpointConnectionsClientListByWorkspaceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientListByWorkspaceResult contains the result from method PrivateEndpointConnectionsClient.ListByWorkspace. -type PrivateEndpointConnectionsClientListByWorkspaceResult struct { PrivateEndpointConnectionListResultWithSystemData } // PrivateEndpointConnectionsClientUpdateByHostPoolResponse contains the response from method PrivateEndpointConnectionsClient.UpdateByHostPool. type PrivateEndpointConnectionsClientUpdateByHostPoolResponse struct { - PrivateEndpointConnectionsClientUpdateByHostPoolResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientUpdateByHostPoolResult contains the result from method PrivateEndpointConnectionsClient.UpdateByHostPool. -type PrivateEndpointConnectionsClientUpdateByHostPoolResult struct { PrivateEndpointConnectionWithSystemData } // PrivateEndpointConnectionsClientUpdateByWorkspaceResponse contains the response from method PrivateEndpointConnectionsClient.UpdateByWorkspace. type PrivateEndpointConnectionsClientUpdateByWorkspaceResponse struct { - PrivateEndpointConnectionsClientUpdateByWorkspaceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientUpdateByWorkspaceResult contains the result from method PrivateEndpointConnectionsClient.UpdateByWorkspace. -type PrivateEndpointConnectionsClientUpdateByWorkspaceResult struct { PrivateEndpointConnectionWithSystemData } // PrivateLinkResourcesClientListByHostPoolResponse contains the response from method PrivateLinkResourcesClient.ListByHostPool. type PrivateLinkResourcesClientListByHostPoolResponse struct { - PrivateLinkResourcesClientListByHostPoolResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateLinkResourcesClientListByHostPoolResult contains the result from method PrivateLinkResourcesClient.ListByHostPool. -type PrivateLinkResourcesClientListByHostPoolResult struct { PrivateLinkResourceListResult } // PrivateLinkResourcesClientListByWorkspaceResponse contains the response from method PrivateLinkResourcesClient.ListByWorkspace. type PrivateLinkResourcesClientListByWorkspaceResponse struct { - PrivateLinkResourcesClientListByWorkspaceResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateLinkResourcesClientListByWorkspaceResult contains the result from method PrivateLinkResourcesClient.ListByWorkspace. -type PrivateLinkResourcesClientListByWorkspaceResult struct { PrivateLinkResourceListResult } // ScalingPlansClientCreateResponse contains the response from method ScalingPlansClient.Create. type ScalingPlansClientCreateResponse struct { - ScalingPlansClientCreateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ScalingPlansClientCreateResult contains the result from method ScalingPlansClient.Create. -type ScalingPlansClientCreateResult struct { ScalingPlan } // ScalingPlansClientDeleteResponse contains the response from method ScalingPlansClient.Delete. type ScalingPlansClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // ScalingPlansClientGetResponse contains the response from method ScalingPlansClient.Get. type ScalingPlansClientGetResponse struct { - ScalingPlansClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ScalingPlansClientGetResult contains the result from method ScalingPlansClient.Get. -type ScalingPlansClientGetResult struct { ScalingPlan } // ScalingPlansClientListByHostPoolResponse contains the response from method ScalingPlansClient.ListByHostPool. type ScalingPlansClientListByHostPoolResponse struct { - ScalingPlansClientListByHostPoolResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ScalingPlansClientListByHostPoolResult contains the result from method ScalingPlansClient.ListByHostPool. -type ScalingPlansClientListByHostPoolResult struct { ScalingPlanList } // ScalingPlansClientListByResourceGroupResponse contains the response from method ScalingPlansClient.ListByResourceGroup. type ScalingPlansClientListByResourceGroupResponse struct { - ScalingPlansClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ScalingPlansClientListByResourceGroupResult contains the result from method ScalingPlansClient.ListByResourceGroup. -type ScalingPlansClientListByResourceGroupResult struct { ScalingPlanList } // ScalingPlansClientListBySubscriptionResponse contains the response from method ScalingPlansClient.ListBySubscription. type ScalingPlansClientListBySubscriptionResponse struct { - ScalingPlansClientListBySubscriptionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ScalingPlansClientListBySubscriptionResult contains the result from method ScalingPlansClient.ListBySubscription. -type ScalingPlansClientListBySubscriptionResult struct { ScalingPlanList } // ScalingPlansClientUpdateResponse contains the response from method ScalingPlansClient.Update. type ScalingPlansClientUpdateResponse struct { - ScalingPlansClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ScalingPlansClientUpdateResult contains the result from method ScalingPlansClient.Update. -type ScalingPlansClientUpdateResult struct { ScalingPlan } // SessionHostsClientDeleteResponse contains the response from method SessionHostsClient.Delete. type SessionHostsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // SessionHostsClientGetResponse contains the response from method SessionHostsClient.Get. type SessionHostsClientGetResponse struct { - SessionHostsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SessionHostsClientGetResult contains the result from method SessionHostsClient.Get. -type SessionHostsClientGetResult struct { SessionHost } // SessionHostsClientListResponse contains the response from method SessionHostsClient.List. type SessionHostsClientListResponse struct { - SessionHostsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SessionHostsClientListResult contains the result from method SessionHostsClient.List. -type SessionHostsClientListResult struct { SessionHostList } // SessionHostsClientUpdateResponse contains the response from method SessionHostsClient.Update. type SessionHostsClientUpdateResponse struct { - SessionHostsClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// SessionHostsClientUpdateResult contains the result from method SessionHostsClient.Update. -type SessionHostsClientUpdateResult struct { SessionHost } // StartMenuItemsClientListResponse contains the response from method StartMenuItemsClient.List. type StartMenuItemsClientListResponse struct { - StartMenuItemsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// StartMenuItemsClientListResult contains the result from method StartMenuItemsClient.List. -type StartMenuItemsClientListResult struct { StartMenuItemList } // UserSessionsClientDeleteResponse contains the response from method UserSessionsClient.Delete. type UserSessionsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // UserSessionsClientDisconnectResponse contains the response from method UserSessionsClient.Disconnect. type UserSessionsClientDisconnectResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // UserSessionsClientGetResponse contains the response from method UserSessionsClient.Get. type UserSessionsClientGetResponse struct { - UserSessionsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// UserSessionsClientGetResult contains the result from method UserSessionsClient.Get. -type UserSessionsClientGetResult struct { UserSession } // UserSessionsClientListByHostPoolResponse contains the response from method UserSessionsClient.ListByHostPool. type UserSessionsClientListByHostPoolResponse struct { - UserSessionsClientListByHostPoolResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// UserSessionsClientListByHostPoolResult contains the result from method UserSessionsClient.ListByHostPool. -type UserSessionsClientListByHostPoolResult struct { UserSessionList } // UserSessionsClientListResponse contains the response from method UserSessionsClient.List. type UserSessionsClientListResponse struct { - UserSessionsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// UserSessionsClientListResult contains the result from method UserSessionsClient.List. -type UserSessionsClientListResult struct { UserSessionList } // UserSessionsClientSendMessageResponse contains the response from method UserSessionsClient.SendMessage. type UserSessionsClientSendMessageResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // WorkspacesClientCreateOrUpdateResponse contains the response from method WorkspacesClient.CreateOrUpdate. type WorkspacesClientCreateOrUpdateResponse struct { - WorkspacesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WorkspacesClientCreateOrUpdateResult contains the result from method WorkspacesClient.CreateOrUpdate. -type WorkspacesClientCreateOrUpdateResult struct { Workspace } // WorkspacesClientDeleteResponse contains the response from method WorkspacesClient.Delete. type WorkspacesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // WorkspacesClientGetResponse contains the response from method WorkspacesClient.Get. type WorkspacesClientGetResponse struct { - WorkspacesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WorkspacesClientGetResult contains the result from method WorkspacesClient.Get. -type WorkspacesClientGetResult struct { Workspace } // WorkspacesClientListByResourceGroupResponse contains the response from method WorkspacesClient.ListByResourceGroup. type WorkspacesClientListByResourceGroupResponse struct { - WorkspacesClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WorkspacesClientListByResourceGroupResult contains the result from method WorkspacesClient.ListByResourceGroup. -type WorkspacesClientListByResourceGroupResult struct { WorkspaceList } // WorkspacesClientListBySubscriptionResponse contains the response from method WorkspacesClient.ListBySubscription. type WorkspacesClientListBySubscriptionResponse struct { - WorkspacesClientListBySubscriptionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WorkspacesClientListBySubscriptionResult contains the result from method WorkspacesClient.ListBySubscription. -type WorkspacesClientListBySubscriptionResult struct { WorkspaceList } // WorkspacesClientUpdateResponse contains the response from method WorkspacesClient.Update. type WorkspacesClientUpdateResponse struct { - WorkspacesClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// WorkspacesClientUpdateResult contains the result from method WorkspacesClient.Update. -type WorkspacesClientUpdateResult struct { Workspace } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go index 2139ae91da30..641d671c2733 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_scalingplans_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type ScalingPlansClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewScalingPlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *ScalingPlansClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewScalingPlansClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*ScalingPlansClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &ScalingPlansClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // Create - Create or update a scaling plan. @@ -90,7 +95,7 @@ func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, scalingPlan) @@ -98,7 +103,7 @@ func (client *ScalingPlansClient) createCreateRequest(ctx context.Context, resou // createHandleResponse handles the Create response. func (client *ScalingPlansClient) createHandleResponse(resp *http.Response) (ScalingPlansClientCreateResponse, error) { - result := ScalingPlansClientCreateResponse{RawResponse: resp} + result := ScalingPlansClientCreateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlan); err != nil { return ScalingPlansClientCreateResponse{}, err } @@ -122,7 +127,7 @@ func (client *ScalingPlansClient) Delete(ctx context.Context, resourceGroupName if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return ScalingPlansClientDeleteResponse{}, runtime.NewResponseError(resp) } - return ScalingPlansClientDeleteResponse{RawResponse: resp}, nil + return ScalingPlansClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -145,7 +150,7 @@ func (client *ScalingPlansClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -191,7 +196,7 @@ func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -199,7 +204,7 @@ func (client *ScalingPlansClient) getCreateRequest(ctx context.Context, resource // getHandleResponse handles the Get response. func (client *ScalingPlansClient) getHandleResponse(resp *http.Response) (ScalingPlansClientGetResponse, error) { - result := ScalingPlansClientGetResponse{RawResponse: resp} + result := ScalingPlansClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlan); err != nil { return ScalingPlansClientGetResponse{}, err } @@ -212,16 +217,32 @@ func (client *ScalingPlansClient) getHandleResponse(resp *http.Response) (Scalin // hostPoolName - The name of the host pool within the specified resource group // options - ScalingPlansClientListByHostPoolOptions contains the optional parameters for the ScalingPlansClient.ListByHostPool // method. -func (client *ScalingPlansClient) ListByHostPool(resourceGroupName string, hostPoolName string, options *ScalingPlansClientListByHostPoolOptions) *ScalingPlansClientListByHostPoolPager { - return &ScalingPlansClientListByHostPoolPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) +func (client *ScalingPlansClient) ListByHostPool(resourceGroupName string, hostPoolName string, options *ScalingPlansClientListByHostPoolOptions) *runtime.Pager[ScalingPlansClientListByHostPoolResponse] { + return runtime.NewPager(runtime.PageProcessor[ScalingPlansClientListByHostPoolResponse]{ + More: func(page ScalingPlansClientListByHostPoolResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ScalingPlansClientListByHostPoolResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ScalingPlanList.NextLink) + Fetcher: func(ctx context.Context, page *ScalingPlansClientListByHostPoolResponse) (ScalingPlansClientListByHostPoolResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return ScalingPlansClientListByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ScalingPlansClientListByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ScalingPlansClientListByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return client.listByHostPoolHandleResponse(resp) }, - } + }) } // listByHostPoolCreateRequest creates the ListByHostPool request. @@ -244,7 +265,7 @@ func (client *ScalingPlansClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -252,7 +273,7 @@ func (client *ScalingPlansClient) listByHostPoolCreateRequest(ctx context.Contex // listByHostPoolHandleResponse handles the ListByHostPool response. func (client *ScalingPlansClient) listByHostPoolHandleResponse(resp *http.Response) (ScalingPlansClientListByHostPoolResponse, error) { - result := ScalingPlansClientListByHostPoolResponse{RawResponse: resp} + result := ScalingPlansClientListByHostPoolResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlanList); err != nil { return ScalingPlansClientListByHostPoolResponse{}, err } @@ -264,16 +285,32 @@ func (client *ScalingPlansClient) listByHostPoolHandleResponse(resp *http.Respon // resourceGroupName - The name of the resource group. The name is case insensitive. // options - ScalingPlansClientListByResourceGroupOptions contains the optional parameters for the ScalingPlansClient.ListByResourceGroup // method. -func (client *ScalingPlansClient) ListByResourceGroup(resourceGroupName string, options *ScalingPlansClientListByResourceGroupOptions) *ScalingPlansClientListByResourceGroupPager { - return &ScalingPlansClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *ScalingPlansClient) ListByResourceGroup(resourceGroupName string, options *ScalingPlansClientListByResourceGroupOptions) *runtime.Pager[ScalingPlansClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[ScalingPlansClientListByResourceGroupResponse]{ + More: func(page ScalingPlansClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ScalingPlansClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ScalingPlanList.NextLink) + Fetcher: func(ctx context.Context, page *ScalingPlansClientListByResourceGroupResponse) (ScalingPlansClientListByResourceGroupResponse, 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 ScalingPlansClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ScalingPlansClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ScalingPlansClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -292,7 +329,7 @@ func (client *ScalingPlansClient) listByResourceGroupCreateRequest(ctx context.C return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -300,7 +337,7 @@ func (client *ScalingPlansClient) listByResourceGroupCreateRequest(ctx context.C // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *ScalingPlansClient) listByResourceGroupHandleResponse(resp *http.Response) (ScalingPlansClientListByResourceGroupResponse, error) { - result := ScalingPlansClientListByResourceGroupResponse{RawResponse: resp} + result := ScalingPlansClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlanList); err != nil { return ScalingPlansClientListByResourceGroupResponse{}, err } @@ -311,16 +348,32 @@ func (client *ScalingPlansClient) listByResourceGroupHandleResponse(resp *http.R // If the operation fails it returns an *azcore.ResponseError type. // options - ScalingPlansClientListBySubscriptionOptions contains the optional parameters for the ScalingPlansClient.ListBySubscription // method. -func (client *ScalingPlansClient) ListBySubscription(options *ScalingPlansClientListBySubscriptionOptions) *ScalingPlansClientListBySubscriptionPager { - return &ScalingPlansClientListBySubscriptionPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) +func (client *ScalingPlansClient) ListBySubscription(options *ScalingPlansClientListBySubscriptionOptions) *runtime.Pager[ScalingPlansClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PageProcessor[ScalingPlansClientListBySubscriptionResponse]{ + More: func(page ScalingPlansClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp ScalingPlansClientListBySubscriptionResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ScalingPlanList.NextLink) + Fetcher: func(ctx context.Context, page *ScalingPlansClientListBySubscriptionResponse) (ScalingPlansClientListBySubscriptionResponse, 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 ScalingPlansClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return ScalingPlansClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return ScalingPlansClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) }, - } + }) } // listBySubscriptionCreateRequest creates the ListBySubscription request. @@ -335,7 +388,7 @@ func (client *ScalingPlansClient) listBySubscriptionCreateRequest(ctx context.Co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -343,7 +396,7 @@ func (client *ScalingPlansClient) listBySubscriptionCreateRequest(ctx context.Co // listBySubscriptionHandleResponse handles the ListBySubscription response. func (client *ScalingPlansClient) listBySubscriptionHandleResponse(resp *http.Response) (ScalingPlansClientListBySubscriptionResponse, error) { - result := ScalingPlansClientListBySubscriptionResponse{RawResponse: resp} + result := ScalingPlansClientListBySubscriptionResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlanList); err != nil { return ScalingPlansClientListBySubscriptionResponse{}, err } @@ -390,7 +443,7 @@ func (client *ScalingPlansClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.ScalingPlan != nil { @@ -401,7 +454,7 @@ func (client *ScalingPlansClient) updateCreateRequest(ctx context.Context, resou // updateHandleResponse handles the Update response. func (client *ScalingPlansClient) updateHandleResponse(resp *http.Response) (ScalingPlansClientUpdateResponse, error) { - result := ScalingPlansClientUpdateResponse{RawResponse: resp} + result := ScalingPlansClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ScalingPlan); err != nil { return ScalingPlansClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go index 41780ef94a19..da0094ed4f49 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_sessionhosts_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -34,20 +35,24 @@ type SessionHostsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewSessionHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *SessionHostsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewSessionHostsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*SessionHostsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &SessionHostsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // Delete - Remove a SessionHost. @@ -68,7 +73,7 @@ func (client *SessionHostsClient) Delete(ctx context.Context, resourceGroupName if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return SessionHostsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return SessionHostsClientDeleteResponse{RawResponse: resp}, nil + return SessionHostsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -95,7 +100,7 @@ func (client *SessionHostsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -149,7 +154,7 @@ func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -157,7 +162,7 @@ func (client *SessionHostsClient) getCreateRequest(ctx context.Context, resource // getHandleResponse handles the Get response. func (client *SessionHostsClient) getHandleResponse(resp *http.Response) (SessionHostsClientGetResponse, error) { - result := SessionHostsClientGetResponse{RawResponse: resp} + result := SessionHostsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SessionHost); err != nil { return SessionHostsClientGetResponse{}, err } @@ -169,16 +174,32 @@ func (client *SessionHostsClient) getHandleResponse(resp *http.Response) (Sessio // resourceGroupName - The name of the resource group. The name is case insensitive. // hostPoolName - The name of the host pool within the specified resource group // options - SessionHostsClientListOptions contains the optional parameters for the SessionHostsClient.List method. -func (client *SessionHostsClient) List(resourceGroupName string, hostPoolName string, options *SessionHostsClientListOptions) *SessionHostsClientListPager { - return &SessionHostsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, hostPoolName, options) +func (client *SessionHostsClient) List(resourceGroupName string, hostPoolName string, options *SessionHostsClientListOptions) *runtime.Pager[SessionHostsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[SessionHostsClientListResponse]{ + More: func(page SessionHostsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp SessionHostsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SessionHostList.NextLink) + Fetcher: func(ctx context.Context, page *SessionHostsClientListResponse) (SessionHostsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, hostPoolName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return SessionHostsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return SessionHostsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return SessionHostsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -201,7 +222,7 @@ func (client *SessionHostsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -209,7 +230,7 @@ func (client *SessionHostsClient) listCreateRequest(ctx context.Context, resourc // listHandleResponse handles the List response. func (client *SessionHostsClient) listHandleResponse(resp *http.Response) (SessionHostsClientListResponse, error) { - result := SessionHostsClientListResponse{RawResponse: resp} + result := SessionHostsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SessionHostList); err != nil { return SessionHostsClientListResponse{}, err } @@ -261,7 +282,7 @@ func (client *SessionHostsClient) updateCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -275,7 +296,7 @@ func (client *SessionHostsClient) updateCreateRequest(ctx context.Context, resou // updateHandleResponse handles the Update response. func (client *SessionHostsClient) updateHandleResponse(resp *http.Response) (SessionHostsClientUpdateResponse, error) { - result := SessionHostsClientUpdateResponse{RawResponse: resp} + result := SessionHostsClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SessionHost); err != nil { return SessionHostsClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go index b495cb157894..3bf5d0662a5f 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_startmenuitems_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type StartMenuItemsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *StartMenuItemsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*StartMenuItemsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &StartMenuItemsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - List start menu items in the given application group. @@ -54,16 +59,32 @@ func NewStartMenuItemsClient(subscriptionID string, credential azcore.TokenCrede // resourceGroupName - The name of the resource group. The name is case insensitive. // applicationGroupName - The name of the application group // options - StartMenuItemsClientListOptions contains the optional parameters for the StartMenuItemsClient.List method. -func (client *StartMenuItemsClient) List(resourceGroupName string, applicationGroupName string, options *StartMenuItemsClientListOptions) *StartMenuItemsClientListPager { - return &StartMenuItemsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, applicationGroupName, options) +func (client *StartMenuItemsClient) List(resourceGroupName string, applicationGroupName string, options *StartMenuItemsClientListOptions) *runtime.Pager[StartMenuItemsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[StartMenuItemsClientListResponse]{ + More: func(page StartMenuItemsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp StartMenuItemsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.StartMenuItemList.NextLink) + Fetcher: func(ctx context.Context, page *StartMenuItemsClientListResponse) (StartMenuItemsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, applicationGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return StartMenuItemsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return StartMenuItemsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return StartMenuItemsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -86,7 +107,7 @@ func (client *StartMenuItemsClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -94,7 +115,7 @@ func (client *StartMenuItemsClient) listCreateRequest(ctx context.Context, resou // listHandleResponse handles the List response. func (client *StartMenuItemsClient) listHandleResponse(resp *http.Response) (StartMenuItemsClientListResponse, error) { - result := StartMenuItemsClientListResponse{RawResponse: resp} + result := StartMenuItemsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.StartMenuItemList); err != nil { return StartMenuItemsClientListResponse{}, err } diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_time_rfc3339.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_time_rfc3339.go index 4ddf19869891..9a156a75186b 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_time_rfc3339.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go index dc896c3fb8f9..89ae05c3c1cc 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_usersessions_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -34,20 +35,24 @@ type UserSessionsClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewUserSessionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *UserSessionsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewUserSessionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*UserSessionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &UserSessionsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // Delete - Remove a userSession. @@ -69,7 +74,7 @@ func (client *UserSessionsClient) Delete(ctx context.Context, resourceGroupName if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return UserSessionsClientDeleteResponse{}, runtime.NewResponseError(resp) } - return UserSessionsClientDeleteResponse{RawResponse: resp}, nil + return UserSessionsClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -100,7 +105,7 @@ func (client *UserSessionsClient) deleteCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Force != nil { reqQP.Set("force", strconv.FormatBool(*options.Force)) } @@ -128,7 +133,7 @@ func (client *UserSessionsClient) Disconnect(ctx context.Context, resourceGroupN if !runtime.HasStatusCode(resp, http.StatusOK) { return UserSessionsClientDisconnectResponse{}, runtime.NewResponseError(resp) } - return UserSessionsClientDisconnectResponse{RawResponse: resp}, nil + return UserSessionsClientDisconnectResponse{}, nil } // disconnectCreateRequest creates the Disconnect request. @@ -159,7 +164,7 @@ func (client *UserSessionsClient) disconnectCreateRequest(ctx context.Context, r return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -215,7 +220,7 @@ func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resource return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -223,7 +228,7 @@ func (client *UserSessionsClient) getCreateRequest(ctx context.Context, resource // getHandleResponse handles the Get response. func (client *UserSessionsClient) getHandleResponse(resp *http.Response) (UserSessionsClientGetResponse, error) { - result := UserSessionsClientGetResponse{RawResponse: resp} + result := UserSessionsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.UserSession); err != nil { return UserSessionsClientGetResponse{}, err } @@ -236,16 +241,32 @@ func (client *UserSessionsClient) getHandleResponse(resp *http.Response) (UserSe // hostPoolName - The name of the host pool within the specified resource group // sessionHostName - The name of the session host within the specified host pool // options - UserSessionsClientListOptions contains the optional parameters for the UserSessionsClient.List method. -func (client *UserSessionsClient) List(resourceGroupName string, hostPoolName string, sessionHostName string, options *UserSessionsClientListOptions) *UserSessionsClientListPager { - return &UserSessionsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, resourceGroupName, hostPoolName, sessionHostName, options) +func (client *UserSessionsClient) List(resourceGroupName string, hostPoolName string, sessionHostName string, options *UserSessionsClientListOptions) *runtime.Pager[UserSessionsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[UserSessionsClientListResponse]{ + More: func(page UserSessionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp UserSessionsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.UserSessionList.NextLink) + Fetcher: func(ctx context.Context, page *UserSessionsClientListResponse) (UserSessionsClientListResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listCreateRequest(ctx, resourceGroupName, hostPoolName, sessionHostName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return UserSessionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return UserSessionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UserSessionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -272,7 +293,7 @@ func (client *UserSessionsClient) listCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -280,7 +301,7 @@ func (client *UserSessionsClient) listCreateRequest(ctx context.Context, resourc // listHandleResponse handles the List response. func (client *UserSessionsClient) listHandleResponse(resp *http.Response) (UserSessionsClientListResponse, error) { - result := UserSessionsClientListResponse{RawResponse: resp} + result := UserSessionsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.UserSessionList); err != nil { return UserSessionsClientListResponse{}, err } @@ -293,16 +314,32 @@ func (client *UserSessionsClient) listHandleResponse(resp *http.Response) (UserS // hostPoolName - The name of the host pool within the specified resource group // options - UserSessionsClientListByHostPoolOptions contains the optional parameters for the UserSessionsClient.ListByHostPool // method. -func (client *UserSessionsClient) ListByHostPool(resourceGroupName string, hostPoolName string, options *UserSessionsClientListByHostPoolOptions) *UserSessionsClientListByHostPoolPager { - return &UserSessionsClientListByHostPoolPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) +func (client *UserSessionsClient) ListByHostPool(resourceGroupName string, hostPoolName string, options *UserSessionsClientListByHostPoolOptions) *runtime.Pager[UserSessionsClientListByHostPoolResponse] { + return runtime.NewPager(runtime.PageProcessor[UserSessionsClientListByHostPoolResponse]{ + More: func(page UserSessionsClientListByHostPoolResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp UserSessionsClientListByHostPoolResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.UserSessionList.NextLink) + Fetcher: func(ctx context.Context, page *UserSessionsClientListByHostPoolResponse) (UserSessionsClientListByHostPoolResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByHostPoolCreateRequest(ctx, resourceGroupName, hostPoolName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return UserSessionsClientListByHostPoolResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return UserSessionsClientListByHostPoolResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return UserSessionsClientListByHostPoolResponse{}, runtime.NewResponseError(resp) + } + return client.listByHostPoolHandleResponse(resp) }, - } + }) } // listByHostPoolCreateRequest creates the ListByHostPool request. @@ -325,7 +362,7 @@ func (client *UserSessionsClient) listByHostPoolCreateRequest(ctx context.Contex return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") if options != nil && options.Filter != nil { reqQP.Set("$filter", *options.Filter) } @@ -336,7 +373,7 @@ func (client *UserSessionsClient) listByHostPoolCreateRequest(ctx context.Contex // listByHostPoolHandleResponse handles the ListByHostPool response. func (client *UserSessionsClient) listByHostPoolHandleResponse(resp *http.Response) (UserSessionsClientListByHostPoolResponse, error) { - result := UserSessionsClientListByHostPoolResponse{RawResponse: resp} + result := UserSessionsClientListByHostPoolResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.UserSessionList); err != nil { return UserSessionsClientListByHostPoolResponse{}, err } @@ -363,7 +400,7 @@ func (client *UserSessionsClient) SendMessage(ctx context.Context, resourceGroup if !runtime.HasStatusCode(resp, http.StatusOK) { return UserSessionsClientSendMessageResponse{}, runtime.NewResponseError(resp) } - return UserSessionsClientSendMessageResponse{RawResponse: resp}, nil + return UserSessionsClientSendMessageResponse{}, nil } // sendMessageCreateRequest creates the SendMessage request. @@ -394,7 +431,7 @@ func (client *UserSessionsClient) sendMessageCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.SendMessage != nil { diff --git a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go index ffdcee91cdd0..3301995b3e63 100644 --- a/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go +++ b/sdk/resourcemanager/desktopvirtualization/armdesktopvirtualization/zz_generated_workspaces_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type WorkspacesClient struct { // subscriptionID - The ID of the target subscription. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *WorkspacesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewWorkspacesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*WorkspacesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &WorkspacesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Create or update a workspace. @@ -91,7 +96,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, workspace) @@ -99,7 +104,7 @@ func (client *WorkspacesClient) createOrUpdateCreateRequest(ctx context.Context, // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *WorkspacesClient) createOrUpdateHandleResponse(resp *http.Response) (WorkspacesClientCreateOrUpdateResponse, error) { - result := WorkspacesClientCreateOrUpdateResponse{RawResponse: resp} + result := WorkspacesClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Workspace); err != nil { return WorkspacesClientCreateOrUpdateResponse{}, err } @@ -123,7 +128,7 @@ func (client *WorkspacesClient) Delete(ctx context.Context, resourceGroupName st if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return WorkspacesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return WorkspacesClientDeleteResponse{RawResponse: resp}, nil + return WorkspacesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -146,7 +151,7 @@ func (client *WorkspacesClient) deleteCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -192,7 +197,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -200,7 +205,7 @@ func (client *WorkspacesClient) getCreateRequest(ctx context.Context, resourceGr // getHandleResponse handles the Get response. func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (WorkspacesClientGetResponse, error) { - result := WorkspacesClientGetResponse{RawResponse: resp} + result := WorkspacesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Workspace); err != nil { return WorkspacesClientGetResponse{}, err } @@ -212,16 +217,32 @@ func (client *WorkspacesClient) getHandleResponse(resp *http.Response) (Workspac // resourceGroupName - The name of the resource group. The name is case insensitive. // options - WorkspacesClientListByResourceGroupOptions contains the optional parameters for the WorkspacesClient.ListByResourceGroup // method. -func (client *WorkspacesClient) ListByResourceGroup(resourceGroupName string, options *WorkspacesClientListByResourceGroupOptions) *WorkspacesClientListByResourceGroupPager { - return &WorkspacesClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *WorkspacesClient) ListByResourceGroup(resourceGroupName string, options *WorkspacesClientListByResourceGroupOptions) *runtime.Pager[WorkspacesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[WorkspacesClientListByResourceGroupResponse]{ + More: func(page WorkspacesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp WorkspacesClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.WorkspaceList.NextLink) + Fetcher: func(ctx context.Context, page *WorkspacesClientListByResourceGroupResponse) (WorkspacesClientListByResourceGroupResponse, 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 WorkspacesClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -240,7 +261,7 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -248,7 +269,7 @@ func (client *WorkspacesClient) listByResourceGroupCreateRequest(ctx context.Con // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Response) (WorkspacesClientListByResourceGroupResponse, error) { - result := WorkspacesClientListByResourceGroupResponse{RawResponse: resp} + result := WorkspacesClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceList); err != nil { return WorkspacesClientListByResourceGroupResponse{}, err } @@ -259,16 +280,32 @@ func (client *WorkspacesClient) listByResourceGroupHandleResponse(resp *http.Res // If the operation fails it returns an *azcore.ResponseError type. // options - WorkspacesClientListBySubscriptionOptions contains the optional parameters for the WorkspacesClient.ListBySubscription // method. -func (client *WorkspacesClient) ListBySubscription(options *WorkspacesClientListBySubscriptionOptions) *WorkspacesClientListBySubscriptionPager { - return &WorkspacesClientListBySubscriptionPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) +func (client *WorkspacesClient) ListBySubscription(options *WorkspacesClientListBySubscriptionOptions) *runtime.Pager[WorkspacesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PageProcessor[WorkspacesClientListBySubscriptionResponse]{ + More: func(page WorkspacesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp WorkspacesClientListBySubscriptionResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.WorkspaceList.NextLink) + Fetcher: func(ctx context.Context, page *WorkspacesClientListBySubscriptionResponse) (WorkspacesClientListBySubscriptionResponse, 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 WorkspacesClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return WorkspacesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return WorkspacesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) }, - } + }) } // listBySubscriptionCreateRequest creates the ListBySubscription request. @@ -283,7 +320,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -291,7 +328,7 @@ func (client *WorkspacesClient) listBySubscriptionCreateRequest(ctx context.Cont // listBySubscriptionHandleResponse handles the ListBySubscription response. func (client *WorkspacesClient) listBySubscriptionHandleResponse(resp *http.Response) (WorkspacesClientListBySubscriptionResponse, error) { - result := WorkspacesClientListBySubscriptionResponse{RawResponse: resp} + result := WorkspacesClientListBySubscriptionResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.WorkspaceList); err != nil { return WorkspacesClientListBySubscriptionResponse{}, err } @@ -338,7 +375,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2021-09-03-preview") + reqQP.Set("api-version", "2022-02-10-preview") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") if options != nil && options.Workspace != nil { @@ -349,7 +386,7 @@ func (client *WorkspacesClient) updateCreateRequest(ctx context.Context, resourc // updateHandleResponse handles the Update response. func (client *WorkspacesClient) updateHandleResponse(resp *http.Response) (WorkspacesClientUpdateResponse, error) { - result := WorkspacesClientUpdateResponse{RawResponse: resp} + result := WorkspacesClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Workspace); err != nil { return WorkspacesClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/CHANGELOG.md b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/CHANGELOG.md index c1cf25e38ace..2103235af219 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/CHANGELOG.md +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/CHANGELOG.md @@ -1,5 +1,208 @@ # Release History +## 0.3.0 (2022-04-11) +### Breaking Changes + +- Function `*IotDpsResourceClient.BeginDelete` return value(s) have been changed from `(IotDpsResourceClientDeletePollerResponse, error)` to `(*armruntime.Poller[IotDpsResourceClientDeleteResponse], error)` +- Function `*IotDpsResourceClient.BeginDeletePrivateEndpointConnection` return value(s) have been changed from `(IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse, error)` to `(*armruntime.Poller[IotDpsResourceClientDeletePrivateEndpointConnectionResponse], error)` +- Function `*IotDpsResourceClient.ListByResourceGroup` return value(s) have been changed from `(*IotDpsResourceClientListByResourceGroupPager)` to `(*runtime.Pager[IotDpsResourceClientListByResourceGroupResponse])` +- Function `NewDpsCertificateClient` return value(s) have been changed from `(*DpsCertificateClient)` to `(*DpsCertificateClient, error)` +- Function `*IotDpsResourceClient.ListBySubscription` return value(s) have been changed from `(*IotDpsResourceClientListBySubscriptionPager)` to `(*runtime.Pager[IotDpsResourceClientListBySubscriptionResponse])` +- Function `*OperationsClient.List` return value(s) have been changed from `(*OperationsClientListPager)` to `(*runtime.Pager[OperationsClientListResponse])` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `*IotDpsResourceClient.ListValidSKUs` return value(s) have been changed from `(*IotDpsResourceClientListValidSKUsPager)` to `(*runtime.Pager[IotDpsResourceClientListValidSKUsResponse])` +- Function `NewIotDpsResourceClient` return value(s) have been changed from `(*IotDpsResourceClient)` to `(*IotDpsResourceClient, error)` +- Function `*IotDpsResourceClient.BeginCreateOrUpdatePrivateEndpointConnection` return value(s) have been changed from `(IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse, error)` to `(*armruntime.Poller[IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse], error)` +- Function `*IotDpsResourceClient.ListKeys` return value(s) have been changed from `(*IotDpsResourceClientListKeysPager)` to `(*runtime.Pager[IotDpsResourceClientListKeysResponse])` +- Function `*IotDpsResourceClient.BeginUpdate` return value(s) have been changed from `(IotDpsResourceClientUpdatePollerResponse, error)` to `(*armruntime.Poller[IotDpsResourceClientUpdateResponse], error)` +- Function `*IotDpsResourceClient.BeginCreateOrUpdate` return value(s) have been changed from `(IotDpsResourceClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[IotDpsResourceClientCreateOrUpdateResponse], error)` +- Function `*IotDpsResourceClientListKeysPager.Err` has been removed +- Function `CertificatePurpose.ToPtr` has been removed +- Function `*IotDpsResourceClientUpdatePollerResponse.Resume` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePoller.Poll` has been removed +- Function `IotDpsSKU.ToPtr` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller.Done` has been removed +- Function `*IotDpsResourceClientDeletePoller.FinalResponse` has been removed +- Function `*IotDpsResourceClientListValidSKUsPager.NextPage` has been removed +- Function `IPFilterActionType.ToPtr` has been removed +- Function `*IotDpsResourceClientListBySubscriptionPager.PageResponse` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse.Resume` has been removed +- Function `*IotDpsResourceClientListBySubscriptionPager.NextPage` has been removed +- Function `*IotDpsResourceClientListByResourceGroupPager.Err` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller.Poll` has been removed +- Function `NameUnavailabilityReason.ToPtr` has been removed +- Function `*OperationsClientListPager.PageResponse` has been removed +- Function `State.ToPtr` has been removed +- Function `IotDpsResourceClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*IotDpsResourceClientDeletePrivateEndpointConnectionPoller.ResumeToken` has been removed +- Function `*IotDpsResourceClientDeletePrivateEndpointConnectionPoller.Done` has been removed +- Function `*IotDpsResourceClientDeletePoller.ResumeToken` has been removed +- Function `*IotDpsResourceClientDeletePrivateEndpointConnectionPoller.FinalResponse` has been removed +- Function `*IotDpsResourceClientListByResourceGroupPager.PageResponse` has been removed +- Function `IotDpsResourceClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse.Resume` has been removed +- Function `*IotDpsResourceClientUpdatePoller.FinalResponse` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `PrivateLinkServiceConnectionStatus.ToPtr` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller.FinalResponse` has been removed +- Function `*IotDpsResourceClientListBySubscriptionPager.Err` has been removed +- Function `*OperationsClientListPager.Err` has been removed +- Function `AccessRightsDescription.ToPtr` has been removed +- Function `AllocationPolicy.ToPtr` has been removed +- Function `*IotDpsResourceClientDeletePoller.Done` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller.ResumeToken` has been removed +- Function `*IotDpsResourceClientListValidSKUsPager.PageResponse` has been removed +- Function `*IotDpsResourceClientListValidSKUsPager.Err` has been removed +- Function `*IotDpsResourceClientListKeysPager.PageResponse` has been removed +- Function `*IotDpsResourceClientUpdatePoller.ResumeToken` has been removed +- Function `IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse.PollUntilDone` has been removed +- Function `IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse.PollUntilDone` has been removed +- Function `PublicNetworkAccess.ToPtr` has been removed +- Function `*IotDpsResourceClientDeletePrivateEndpointConnectionPoller.Poll` has been removed +- Function `IPFilterTargetType.ToPtr` has been removed +- Function `*IotDpsResourceClientUpdatePoller.Poll` has been removed +- Function `*OperationsClientListPager.NextPage` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*IotDpsResourceClientListByResourceGroupPager.NextPage` has been removed +- Function `*IotDpsResourceClientUpdatePoller.Done` has been removed +- Function `*IotDpsResourceClientListKeysPager.NextPage` has been removed +- Function `*IotDpsResourceClientDeletePollerResponse.Resume` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePoller.Done` has been removed +- Function `*IotDpsResourceClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*IotDpsResourceClientDeletePoller.Poll` has been removed +- Function `IotDpsResourceClientUpdatePollerResponse.PollUntilDone` has been removed +- Struct `DpsCertificateClientCreateOrUpdateResult` has been removed +- Struct `DpsCertificateClientGenerateVerificationCodeResult` has been removed +- Struct `DpsCertificateClientGetResult` has been removed +- Struct `DpsCertificateClientListResult` has been removed +- Struct `DpsCertificateClientVerifyCertificateResult` has been removed +- Struct `IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResult` has been removed +- Struct `IotDpsResourceClientCreateOrUpdatePoller` has been removed +- Struct `IotDpsResourceClientCreateOrUpdatePollerResponse` has been removed +- Struct `IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller` has been removed +- Struct `IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse` has been removed +- Struct `IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResult` has been removed +- Struct `IotDpsResourceClientCreateOrUpdateResult` has been removed +- Struct `IotDpsResourceClientDeletePoller` has been removed +- Struct `IotDpsResourceClientDeletePollerResponse` has been removed +- Struct `IotDpsResourceClientDeletePrivateEndpointConnectionPoller` has been removed +- Struct `IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse` has been removed +- Struct `IotDpsResourceClientDeletePrivateEndpointConnectionResult` has been removed +- Struct `IotDpsResourceClientGetOperationResultResult` has been removed +- Struct `IotDpsResourceClientGetPrivateEndpointConnectionResult` has been removed +- Struct `IotDpsResourceClientGetPrivateLinkResourcesResult` has been removed +- Struct `IotDpsResourceClientGetResult` has been removed +- Struct `IotDpsResourceClientListByResourceGroupPager` has been removed +- Struct `IotDpsResourceClientListByResourceGroupResult` has been removed +- Struct `IotDpsResourceClientListBySubscriptionPager` has been removed +- Struct `IotDpsResourceClientListBySubscriptionResult` has been removed +- Struct `IotDpsResourceClientListKeysForKeyNameResult` has been removed +- Struct `IotDpsResourceClientListKeysPager` has been removed +- Struct `IotDpsResourceClientListKeysResult` has been removed +- Struct `IotDpsResourceClientListPrivateEndpointConnectionsResult` has been removed +- Struct `IotDpsResourceClientListPrivateLinkResourcesResult` has been removed +- Struct `IotDpsResourceClientListValidSKUsPager` has been removed +- Struct `IotDpsResourceClientListValidSKUsResult` has been removed +- Struct `IotDpsResourceClientUpdatePoller` has been removed +- Struct `IotDpsResourceClientUpdatePollerResponse` has been removed +- Struct `IotDpsResourceClientUpdateResult` has been removed +- Struct `OperationsClientListPager` has been removed +- Struct `OperationsClientListResult` has been removed +- Field `IotDpsResourceClientListByResourceGroupResult` of struct `IotDpsResourceClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientListByResourceGroupResponse` has been removed +- Field `DpsCertificateClientGenerateVerificationCodeResult` of struct `DpsCertificateClientGenerateVerificationCodeResponse` has been removed +- Field `RawResponse` of struct `DpsCertificateClientGenerateVerificationCodeResponse` has been removed +- Field `DpsCertificateClientCreateOrUpdateResult` of struct `DpsCertificateClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `DpsCertificateClientCreateOrUpdateResponse` has been removed +- Field `DpsCertificateClientListResult` of struct `DpsCertificateClientListResponse` has been removed +- Field `RawResponse` of struct `DpsCertificateClientListResponse` has been removed +- Field `IotDpsResourceClientGetPrivateEndpointConnectionResult` of struct `IotDpsResourceClientGetPrivateEndpointConnectionResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientGetPrivateEndpointConnectionResponse` has been removed +- Field `IotDpsResourceClientGetOperationResultResult` of struct `IotDpsResourceClientGetOperationResultResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientGetOperationResultResponse` has been removed +- Field `IotDpsResourceClientListKeysForKeyNameResult` of struct `IotDpsResourceClientListKeysForKeyNameResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientListKeysForKeyNameResponse` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResult` of struct `IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse` has been removed +- Field `DpsCertificateClientVerifyCertificateResult` of struct `DpsCertificateClientVerifyCertificateResponse` has been removed +- Field `RawResponse` of struct `DpsCertificateClientVerifyCertificateResponse` has been removed +- Field `IotDpsResourceClientListKeysResult` of struct `IotDpsResourceClientListKeysResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientListKeysResponse` has been removed +- Field `IotDpsResourceClientListValidSKUsResult` of struct `IotDpsResourceClientListValidSKUsResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientListValidSKUsResponse` has been removed +- Field `DpsCertificateClientGetResult` of struct `DpsCertificateClientGetResponse` has been removed +- Field `RawResponse` of struct `DpsCertificateClientGetResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientDeleteResponse` has been removed +- Field `IotDpsResourceClientDeletePrivateEndpointConnectionResult` of struct `IotDpsResourceClientDeletePrivateEndpointConnectionResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientDeletePrivateEndpointConnectionResponse` has been removed +- Field `IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResult` of struct `IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse` has been removed +- Field `IotDpsResourceClientListPrivateEndpointConnectionsResult` of struct `IotDpsResourceClientListPrivateEndpointConnectionsResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientListPrivateEndpointConnectionsResponse` has been removed +- Field `RawResponse` of struct `DpsCertificateClientDeleteResponse` has been removed +- Field `IotDpsResourceClientUpdateResult` of struct `IotDpsResourceClientUpdateResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientUpdateResponse` has been removed +- Field `IotDpsResourceClientGetResult` of struct `IotDpsResourceClientGetResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientGetResponse` has been removed +- Field `IotDpsResourceClientCreateOrUpdateResult` of struct `IotDpsResourceClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientCreateOrUpdateResponse` has been removed +- Field `IotDpsResourceClientListBySubscriptionResult` of struct `IotDpsResourceClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientListBySubscriptionResponse` has been removed +- Field `IotDpsResourceClientGetPrivateLinkResourcesResult` of struct `IotDpsResourceClientGetPrivateLinkResourcesResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientGetPrivateLinkResourcesResponse` has been removed +- Field `IotDpsResourceClientListPrivateLinkResourcesResult` of struct `IotDpsResourceClientListPrivateLinkResourcesResponse` has been removed +- Field `RawResponse` of struct `IotDpsResourceClientListPrivateLinkResourcesResponse` has been removed + +### Features Added + +- New const `CreatedByTypeUser` +- New const `CreatedByTypeApplication` +- New const `CreatedByTypeManagedIdentity` +- New const `CreatedByTypeKey` +- New function `*timeRFC3339.UnmarshalJSON([]byte) error` +- New function `*timeRFC3339.Parse(string) error` +- New function `*timeRFC3339.UnmarshalText([]byte) error` +- New function `SystemData.MarshalJSON() ([]byte, error)` +- New function `timeRFC3339.MarshalJSON() ([]byte, error)` +- New function `PossibleCreatedByTypeValues() []CreatedByType` +- New function `*SystemData.UnmarshalJSON([]byte) error` +- New function `timeRFC3339.MarshalText() ([]byte, error)` +- New struct `SystemData` +- New anonymous field `ProvisioningServiceDescription` in struct `IotDpsResourceClientUpdateResponse` +- New field `SystemData` in struct `PrivateEndpointConnection` +- New anonymous field `AsyncOperationResult` in struct `IotDpsResourceClientGetOperationResultResponse` +- New anonymous field `NameAvailabilityInfo` in struct `IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse` +- New anonymous field `CertificateResponse` in struct `DpsCertificateClientGetResponse` +- New anonymous field `ProvisioningServiceDescriptionListResult` in struct `IotDpsResourceClientListBySubscriptionResponse` +- New field `ResumeToken` in struct `IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions` +- New field `ResumeToken` in struct `IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions` +- New anonymous field `ProvisioningServiceDescription` in struct `IotDpsResourceClientGetResponse` +- New field `SystemData` in struct `CertificateResponse` +- New field `ResumeToken` in struct `IotDpsResourceClientBeginUpdateOptions` +- New anonymous field `CertificateListDescription` in struct `DpsCertificateClientListResponse` +- New anonymous field `PrivateEndpointConnection` in struct `IotDpsResourceClientDeletePrivateEndpointConnectionResponse` +- New anonymous field `GroupIDInformation` in struct `IotDpsResourceClientGetPrivateLinkResourcesResponse` +- New field `EnableDataResidency` in struct `IotDpsPropertiesDescription` +- New anonymous field `ProvisioningServiceDescriptionListResult` in struct `IotDpsResourceClientListByResourceGroupResponse` +- New field `PrivateEndpointConnectionArray` in struct `IotDpsResourceClientListPrivateEndpointConnectionsResponse` +- New anonymous field `VerificationCodeResponse` in struct `DpsCertificateClientGenerateVerificationCodeResponse` +- New field `SystemData` in struct `ProvisioningServiceDescription` +- New anonymous field `IotDpsSKUDefinitionListResult` in struct `IotDpsResourceClientListValidSKUsResponse` +- New anonymous field `CertificateResponse` in struct `DpsCertificateClientVerifyCertificateResponse` +- New anonymous field `SharedAccessSignatureAuthorizationRuleListResult` in struct `IotDpsResourceClientListKeysResponse` +- New anonymous field `PrivateEndpointConnection` in struct `IotDpsResourceClientGetPrivateEndpointConnectionResponse` +- New field `ResumeToken` in struct `IotDpsResourceClientBeginCreateOrUpdateOptions` +- New anonymous field `ProvisioningServiceDescription` in struct `IotDpsResourceClientCreateOrUpdateResponse` +- New anonymous field `SharedAccessSignatureAuthorizationRuleAccessRightsDescription` in struct `IotDpsResourceClientListKeysForKeyNameResponse` +- New field `ResumeToken` in struct `IotDpsResourceClientBeginDeleteOptions` +- New anonymous field `PrivateLinkResources` in struct `IotDpsResourceClientListPrivateLinkResourcesResponse` +- New anonymous field `PrivateEndpointConnection` in struct `IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New anonymous field `CertificateResponse` in struct `DpsCertificateClientCreateOrUpdateResponse` + + ## 0.2.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/README.md b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/README.md index f148eb541271..93081889668c 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/README.md +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/README.md @@ -11,7 +11,7 @@ The `armdeviceprovisioningservices` module provides operations for working with ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.16 or above +- Go 1.18 or above ## Install the package @@ -38,16 +38,18 @@ For more information on authentication, please see the documentation for `aziden Azure Device Provisioning Service 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 := armdeviceprovisioningservices.NewIotDpsResourceClient(, cred, nil) +client, err := armdeviceprovisioningservices.NewIotDpsResourceClient(, 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{ - Host: arm.AzureChina, +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, } -client := armdeviceprovisioningservices.NewIotDpsResourceClient(, cred, &options) +client, err := armdeviceprovisioningservices.NewIotDpsResourceClient(, cred, &options) ``` ## Provide Feedback diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/autorest.md b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/autorest.md index ccd4753e3143..fe24d8f8f2f0 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/autorest.md +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/deviceprovisioningservices/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/deviceprovisioningservices/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/deviceprovisioningservices/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/deviceprovisioningservices/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.1 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.mod b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.mod index 5815c78e4fe6..42b58bb75899 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.mod +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.mod @@ -1,8 +1,21 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices -go 1.16 +go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect + github.com/golang-jwt/jwt v3.2.1+incompatible // indirect + github.com/google/uuid v1.1.1 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect + golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.sum b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.sum index 2ce51d3b8174..56d1c32628ae 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.sum +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/go.sum @@ -1,18 +1,18 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= 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/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -32,21 +32,16 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -56,4 +51,3 @@ 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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_dpscertificate_client_test.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_dpscertificate_client_test.go index 4922fe9875da..2701fa588b2c 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_dpscertificate_client_test.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_dpscertificate_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,55 +17,74 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices" ) -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSGetCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetCertificate.json func ExampleDpsCertificateClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", &armdeviceprovisioningservices.DpsCertificateClientGetOptions{IfMatch: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DpsCertificateClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSCertificateCreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCertificateCreateOrUpdate.json func ExampleDpsCertificateClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", "", armdeviceprovisioningservices.CertificateBodyDescription{ - Certificate: to.StringPtr(""), + Certificate: to.Ptr(""), }, &armdeviceprovisioningservices.DpsCertificateClientCreateOrUpdateOptions{IfMatch: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DpsCertificateClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSDeleteCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDeleteCertificate.json func ExampleDpsCertificateClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", @@ -80,36 +99,49 @@ func ExampleDpsCertificateClient_Delete() { CertificateNonce: nil, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSGetCertificates.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetCertificates.json func ExampleDpsCertificateClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.List(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DpsCertificateClientListResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSGenerateVerificationCode.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGenerateVerificationCode.json func ExampleDpsCertificateClient_GenerateVerificationCode() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.GenerateVerificationCode(ctx, "", "", @@ -124,26 +156,33 @@ func ExampleDpsCertificateClient_GenerateVerificationCode() { CertificateNonce: nil, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DpsCertificateClientGenerateVerificationCodeResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSVerifyCertificate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSVerifyCertificate.json func ExampleDpsCertificateClient_VerifyCertificate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewDpsCertificateClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.VerifyCertificate(ctx, "", "", "", "", armdeviceprovisioningservices.VerificationCodeRequest{ - Certificate: to.StringPtr(""), + Certificate: to.Ptr(""), }, &armdeviceprovisioningservices.DpsCertificateClientVerifyCertificateOptions{CertificateName1: nil, CertificateIsVerified: nil, @@ -154,7 +193,9 @@ func ExampleDpsCertificateClient_VerifyCertificate() { CertificateNonce: nil, }) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DpsCertificateClientVerifyCertificateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_iotdpsresource_client_test.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_iotdpsresource_client_test.go index 52f6989239f3..1831673d81d7 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_iotdpsresource_client_test.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_iotdpsresource_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,158 +19,203 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices" ) -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSGet.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGet.json func ExampleIotDpsResourceClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSCreate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCreate.json func ExampleIotDpsResourceClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", armdeviceprovisioningservices.ProvisioningServiceDescription{ - Location: to.StringPtr(""), - Tags: map[string]*string{}, - Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{}, + Location: to.Ptr(""), + Tags: map[string]*string{}, + Properties: &armdeviceprovisioningservices.IotDpsPropertiesDescription{ + EnableDataResidency: to.Ptr(false), + }, SKU: &armdeviceprovisioningservices.IotDpsSKUInfo{ - Name: armdeviceprovisioningservices.IotDpsSKU("S1").ToPtr(), - Capacity: to.Int64Ptr(1), + Name: to.Ptr(armdeviceprovisioningservices.IotDpsSKUS1), + Capacity: to.Ptr[int64](1), }, }, - nil) + &armdeviceprovisioningservices.IotDpsResourceClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSPatch.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSPatch.json func ExampleIotDpsResourceClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginUpdate(ctx, "", "", armdeviceprovisioningservices.TagsResource{ Tags: map[string]*string{ - "foo": to.StringPtr("bar"), + "foo": to.Ptr("bar"), }, }, - nil) + &armdeviceprovisioningservices.IotDpsResourceClientBeginUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSDelete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDelete.json func ExampleIotDpsResourceClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDelete(ctx, "", "", - nil) + &armdeviceprovisioningservices.IotDpsResourceClientBeginDeleteOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListBySubscription.json func ExampleIotDpsResourceClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListBySubscription(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListByResourceGroup.json func ExampleIotDpsResourceClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByResourceGroup("", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSGetOperationResult.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetOperationResult.json func ExampleIotDpsResourceClient_GetOperationResult() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.GetOperationResult(ctx, "", "", @@ -178,156 +223,209 @@ func ExampleIotDpsResourceClient_GetOperationResult() { "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientGetOperationResultResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSCheckNameAvailability.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCheckNameAvailability.json func ExampleIotDpsResourceClient_CheckProvisioningServiceNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CheckProvisioningServiceNameAvailability(ctx, armdeviceprovisioningservices.OperationInputs{ - Name: to.StringPtr(""), + Name: to.Ptr(""), }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSListKeys.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListKeys.json func ExampleIotDpsResourceClient_ListKeys() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListKeys("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSGetKey.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetKey.json func ExampleIotDpsResourceClient_ListKeysForKeyName() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.ListKeysForKeyName(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientListKeysForKeyNameResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSListPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListPrivateLinkResources.json func ExampleIotDpsResourceClient_ListPrivateLinkResources() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.ListPrivateLinkResources(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientListPrivateLinkResourcesResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSGetPrivateLinkResources.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetPrivateLinkResources.json func ExampleIotDpsResourceClient_GetPrivateLinkResources() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.GetPrivateLinkResources(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientGetPrivateLinkResourcesResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSListPrivateEndpointConnections.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSListPrivateEndpointConnections.json func ExampleIotDpsResourceClient_ListPrivateEndpointConnections() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.ListPrivateEndpointConnections(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientListPrivateEndpointConnectionsResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSGetPrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSGetPrivateEndpointConnection.json func ExampleIotDpsResourceClient_GetPrivateEndpointConnection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.GetPrivateEndpointConnection(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientGetPrivateEndpointConnectionResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSCreateOrUpdatePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSCreateOrUpdatePrivateEndpointConnection.json func ExampleIotDpsResourceClient_BeginCreateOrUpdatePrivateEndpointConnection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdatePrivateEndpointConnection(ctx, "", "", @@ -335,41 +433,52 @@ func ExampleIotDpsResourceClient_BeginCreateOrUpdatePrivateEndpointConnection() armdeviceprovisioningservices.PrivateEndpointConnection{ Properties: &armdeviceprovisioningservices.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armdeviceprovisioningservices.PrivateLinkServiceConnectionState{ - Description: to.StringPtr(""), - Status: armdeviceprovisioningservices.PrivateLinkServiceConnectionStatus("Approved").ToPtr(), + Description: to.Ptr(""), + Status: to.Ptr(armdeviceprovisioningservices.PrivateLinkServiceConnectionStatusApproved), }, }, }, - nil) + &armdeviceprovisioningservices.IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSDeletePrivateEndpointConnection.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSDeletePrivateEndpointConnection.json func ExampleIotDpsResourceClient_BeginDeletePrivateEndpointConnection() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + client, err := armdeviceprovisioningservices.NewIotDpsResourceClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDeletePrivateEndpointConnection(ctx, "", "", "", - nil) + &armdeviceprovisioningservices.IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.IotDpsResourceClientDeletePrivateEndpointConnectionResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_operations_client_test.go index 11225b57a96c..be8e0b8d3224 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/ze_generated_example_operations_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,25 +16,29 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices" ) -// x-ms-original-file: specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2020-03-01/examples/DPSOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceprovisioningservices/resource-manager/Microsoft.Devices/stable/2021-10-15/examples/DPSOperations.json func ExampleOperationsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceprovisioningservices.NewOperationsClient(cred, nil) + client, err := armdeviceprovisioningservices.NewOperationsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_constants.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_constants.go index 7ac599b424c2..7a6db462ee77 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_constants.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -10,7 +10,7 @@ package armdeviceprovisioningservices const ( moduleName = "armdeviceprovisioningservices" - moduleVersion = "v0.2.1" + moduleVersion = "v0.3.0" ) // AccessRightsDescription - Rights that this key has. @@ -37,11 +37,6 @@ func PossibleAccessRightsDescriptionValues() []AccessRightsDescription { } } -// ToPtr returns a *AccessRightsDescription pointing to the current value. -func (c AccessRightsDescription) ToPtr() *AccessRightsDescription { - return &c -} - // AllocationPolicy - Allocation policy to be used by this provisioning service. type AllocationPolicy string @@ -60,11 +55,6 @@ func PossibleAllocationPolicyValues() []AllocationPolicy { } } -// ToPtr returns a *AllocationPolicy pointing to the current value. -func (c AllocationPolicy) ToPtr() *AllocationPolicy { - return &c -} - type CertificatePurpose string const ( @@ -80,9 +70,24 @@ func PossibleCertificatePurposeValues() []CertificatePurpose { } } -// ToPtr returns a *CertificatePurpose pointing to the current value. -func (c CertificatePurpose) ToPtr() *CertificatePurpose { - return &c +// 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, + } } // IPFilterActionType - The desired action for requests captured by this rule. @@ -101,11 +106,6 @@ func PossibleIPFilterActionTypeValues() []IPFilterActionType { } } -// ToPtr returns a *IPFilterActionType pointing to the current value. -func (c IPFilterActionType) ToPtr() *IPFilterActionType { - return &c -} - // IPFilterTargetType - Target for requests captured by this rule. type IPFilterTargetType string @@ -124,11 +124,6 @@ func PossibleIPFilterTargetTypeValues() []IPFilterTargetType { } } -// ToPtr returns a *IPFilterTargetType pointing to the current value. -func (c IPFilterTargetType) ToPtr() *IPFilterTargetType { - return &c -} - // IotDpsSKU - Sku name. type IotDpsSKU string @@ -143,11 +138,6 @@ func PossibleIotDpsSKUValues() []IotDpsSKU { } } -// ToPtr returns a *IotDpsSKU pointing to the current value. -func (c IotDpsSKU) ToPtr() *IotDpsSKU { - return &c -} - // NameUnavailabilityReason - specifies the reason a name is unavailable type NameUnavailabilityReason string @@ -164,11 +154,6 @@ func PossibleNameUnavailabilityReasonValues() []NameUnavailabilityReason { } } -// ToPtr returns a *NameUnavailabilityReason pointing to the current value. -func (c NameUnavailabilityReason) ToPtr() *NameUnavailabilityReason { - return &c -} - // PrivateLinkServiceConnectionStatus - The status of a private endpoint connection type PrivateLinkServiceConnectionStatus string @@ -189,11 +174,6 @@ func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConn } } -// ToPtr returns a *PrivateLinkServiceConnectionStatus pointing to the current value. -func (c PrivateLinkServiceConnectionStatus) ToPtr() *PrivateLinkServiceConnectionStatus { - return &c -} - // PublicNetworkAccess - Whether requests from Public Network are allowed type PublicNetworkAccess string @@ -210,11 +190,6 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { } } -// ToPtr returns a *PublicNetworkAccess pointing to the current value. -func (c PublicNetworkAccess) ToPtr() *PublicNetworkAccess { - return &c -} - // State - Current state of the provisioning service. type State string @@ -250,8 +225,3 @@ func PossibleStateValues() []State { StateTransitioning, } } - -// ToPtr returns a *State pointing to the current value. -func (c State) ToPtr() *State { - return &c -} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_dpscertificate_client.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_dpscertificate_client.go index 43be48a32585..7794bb9531b0 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_dpscertificate_client.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_dpscertificate_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -15,6 +15,7 @@ import ( "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" @@ -36,20 +37,24 @@ type DpsCertificateClient struct { // subscriptionID - The subscription identifier. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewDpsCertificateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *DpsCertificateClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewDpsCertificateClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*DpsCertificateClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &DpsCertificateClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CreateOrUpdate - Add new certificate or update an existing certificate. @@ -99,7 +104,7 @@ func (client *DpsCertificateClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header.Set("If-Match", *options.IfMatch) @@ -110,7 +115,7 @@ func (client *DpsCertificateClient) createOrUpdateCreateRequest(ctx context.Cont // createOrUpdateHandleResponse handles the CreateOrUpdate response. func (client *DpsCertificateClient) createOrUpdateHandleResponse(resp *http.Response) (DpsCertificateClientCreateOrUpdateResponse, error) { - result := DpsCertificateClientCreateOrUpdateResponse{RawResponse: resp} + result := DpsCertificateClientCreateOrUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.CertificateResponse); err != nil { return DpsCertificateClientCreateOrUpdateResponse{}, err } @@ -137,7 +142,7 @@ func (client *DpsCertificateClient) Delete(ctx context.Context, resourceGroupNam if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return DpsCertificateClientDeleteResponse{}, runtime.NewResponseError(resp) } - return DpsCertificateClientDeleteResponse{RawResponse: resp}, nil + return DpsCertificateClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -188,7 +193,7 @@ func (client *DpsCertificateClient) deleteCreateRequest(ctx context.Context, res if options != nil && options.CertificateNonce != nil { reqQP.Set("certificate.nonce", *options.CertificateNonce) } - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("If-Match", ifMatch) req.Raw().Header.Set("Accept", "application/json") @@ -267,7 +272,7 @@ func (client *DpsCertificateClient) generateVerificationCodeCreateRequest(ctx co if options != nil && options.CertificateNonce != nil { reqQP.Set("certificate.nonce", *options.CertificateNonce) } - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("If-Match", ifMatch) req.Raw().Header.Set("Accept", "application/json") @@ -276,7 +281,7 @@ func (client *DpsCertificateClient) generateVerificationCodeCreateRequest(ctx co // generateVerificationCodeHandleResponse handles the GenerateVerificationCode response. func (client *DpsCertificateClient) generateVerificationCodeHandleResponse(resp *http.Response) (DpsCertificateClientGenerateVerificationCodeResponse, error) { - result := DpsCertificateClientGenerateVerificationCodeResponse{RawResponse: resp} + result := DpsCertificateClientGenerateVerificationCodeResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.VerificationCodeResponse); err != nil { return DpsCertificateClientGenerateVerificationCodeResponse{}, err } @@ -328,7 +333,7 @@ func (client *DpsCertificateClient) getCreateRequest(ctx context.Context, certif return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() if options != nil && options.IfMatch != nil { req.Raw().Header.Set("If-Match", *options.IfMatch) @@ -339,7 +344,7 @@ func (client *DpsCertificateClient) getCreateRequest(ctx context.Context, certif // getHandleResponse handles the Get response. func (client *DpsCertificateClient) getHandleResponse(resp *http.Response) (DpsCertificateClientGetResponse, error) { - result := DpsCertificateClientGetResponse{RawResponse: resp} + result := DpsCertificateClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.CertificateResponse); err != nil { return DpsCertificateClientGetResponse{}, err } @@ -386,7 +391,7 @@ func (client *DpsCertificateClient) listCreateRequest(ctx context.Context, resou return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -394,7 +399,7 @@ func (client *DpsCertificateClient) listCreateRequest(ctx context.Context, resou // listHandleResponse handles the List response. func (client *DpsCertificateClient) listHandleResponse(resp *http.Response) (DpsCertificateClientListResponse, error) { - result := DpsCertificateClientListResponse{RawResponse: resp} + result := DpsCertificateClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.CertificateListDescription); err != nil { return DpsCertificateClientListResponse{}, err } @@ -474,7 +479,7 @@ func (client *DpsCertificateClient) verifyCertificateCreateRequest(ctx context.C if options != nil && options.CertificateNonce != nil { reqQP.Set("certificate.nonce", *options.CertificateNonce) } - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("If-Match", ifMatch) req.Raw().Header.Set("Accept", "application/json") @@ -483,7 +488,7 @@ func (client *DpsCertificateClient) verifyCertificateCreateRequest(ctx context.C // verifyCertificateHandleResponse handles the VerifyCertificate response. func (client *DpsCertificateClient) verifyCertificateHandleResponse(resp *http.Response) (DpsCertificateClientVerifyCertificateResponse, error) { - result := DpsCertificateClientVerifyCertificateResponse{RawResponse: resp} + result := DpsCertificateClientVerifyCertificateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.CertificateResponse); err != nil { return DpsCertificateClientVerifyCertificateResponse{}, err } diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_iotdpsresource_client.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_iotdpsresource_client.go index 17c98c7d5e26..0a04652afffb 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_iotdpsresource_client.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_iotdpsresource_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type IotDpsResourceClient struct { // subscriptionID - The subscription identifier. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewIotDpsResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *IotDpsResourceClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewIotDpsResourceClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*IotDpsResourceClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &IotDpsResourceClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CheckProvisioningServiceNameAvailability - Check if a provisioning service name is available. This will validate if the @@ -82,7 +87,7 @@ func (client *IotDpsResourceClient) checkProvisioningServiceNameAvailabilityCrea return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, arguments) @@ -90,7 +95,7 @@ func (client *IotDpsResourceClient) checkProvisioningServiceNameAvailabilityCrea // checkProvisioningServiceNameAvailabilityHandleResponse handles the CheckProvisioningServiceNameAvailability response. func (client *IotDpsResourceClient) checkProvisioningServiceNameAvailabilityHandleResponse(resp *http.Response) (IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse, error) { - result := IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse{RawResponse: resp} + result := IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.NameAvailabilityInfo); err != nil { return IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse{}, err } @@ -106,22 +111,16 @@ func (client *IotDpsResourceClient) checkProvisioningServiceNameAvailabilityHand // iotDpsDescription - Description of the provisioning service to create or update. // options - IotDpsResourceClientBeginCreateOrUpdateOptions contains the optional parameters for the IotDpsResourceClient.BeginCreateOrUpdate // method. -func (client *IotDpsResourceClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, iotDpsDescription ProvisioningServiceDescription, options *IotDpsResourceClientBeginCreateOrUpdateOptions) (IotDpsResourceClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, resourceGroupName, provisioningServiceName, iotDpsDescription, options) - if err != nil { - return IotDpsResourceClientCreateOrUpdatePollerResponse{}, err - } - result := IotDpsResourceClientCreateOrUpdatePollerResponse{ - RawResponse: resp, +func (client *IotDpsResourceClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, iotDpsDescription ProvisioningServiceDescription, options *IotDpsResourceClientBeginCreateOrUpdateOptions) (*armruntime.Poller[IotDpsResourceClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, provisioningServiceName, iotDpsDescription, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[IotDpsResourceClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[IotDpsResourceClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("IotDpsResourceClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return IotDpsResourceClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &IotDpsResourceClientCreateOrUpdatePoller{ - pt: pt, - } - return result, nil } // CreateOrUpdate - Create or update the metadata of the provisioning service. The usual pattern to modify a property is to @@ -163,7 +162,7 @@ func (client *IotDpsResourceClient) createOrUpdateCreateRequest(ctx context.Cont return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, iotDpsDescription) @@ -178,22 +177,16 @@ func (client *IotDpsResourceClient) createOrUpdateCreateRequest(ctx context.Cont // privateEndpointConnection - The private endpoint connection with updated properties // options - IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions contains the optional parameters for // the IotDpsResourceClient.BeginCreateOrUpdatePrivateEndpointConnection method. -func (client *IotDpsResourceClient) BeginCreateOrUpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions) (IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse, error) { - resp, err := client.createOrUpdatePrivateEndpointConnection(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) - if err != nil { - return IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse{}, err +func (client *IotDpsResourceClient) BeginCreateOrUpdatePrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions) (*armruntime.Poller[IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdatePrivateEndpointConnection(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse](options.ResumeToken, client.pl, nil) } - result := IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("IotDpsResourceClient.CreateOrUpdatePrivateEndpointConnection", "", resp, client.pl) - if err != nil { - return IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse{}, err - } - result.Poller = &IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller{ - pt: pt, - } - return result, nil } // CreateOrUpdatePrivateEndpointConnection - Create or update the status of a private endpoint connection with the specified @@ -238,7 +231,7 @@ func (client *IotDpsResourceClient) createOrUpdatePrivateEndpointConnectionCreat return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, privateEndpointConnection) @@ -250,22 +243,16 @@ func (client *IotDpsResourceClient) createOrUpdatePrivateEndpointConnectionCreat // resourceGroupName - Resource group identifier. // options - IotDpsResourceClientBeginDeleteOptions contains the optional parameters for the IotDpsResourceClient.BeginDelete // method. -func (client *IotDpsResourceClient) BeginDelete(ctx context.Context, provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientBeginDeleteOptions) (IotDpsResourceClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, provisioningServiceName, resourceGroupName, options) - if err != nil { - return IotDpsResourceClientDeletePollerResponse{}, err - } - result := IotDpsResourceClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("IotDpsResourceClient.Delete", "", resp, client.pl) - if err != nil { - return IotDpsResourceClientDeletePollerResponse{}, err +func (client *IotDpsResourceClient) BeginDelete(ctx context.Context, provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientBeginDeleteOptions) (*armruntime.Poller[IotDpsResourceClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, provisioningServiceName, resourceGroupName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[IotDpsResourceClientDeleteResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[IotDpsResourceClientDeleteResponse](options.ResumeToken, client.pl, nil) } - result.Poller = &IotDpsResourceClientDeletePoller{ - pt: pt, - } - return result, nil } // Delete - Deletes the Provisioning Service. @@ -305,7 +292,7 @@ func (client *IotDpsResourceClient) deleteCreateRequest(ctx context.Context, pro return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -318,22 +305,16 @@ func (client *IotDpsResourceClient) deleteCreateRequest(ctx context.Context, pro // privateEndpointConnectionName - The name of the private endpoint connection // options - IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the IotDpsResourceClient.BeginDeletePrivateEndpointConnection // method. -func (client *IotDpsResourceClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions) (IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse, error) { - resp, err := client.deletePrivateEndpointConnection(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) - if err != nil { - return IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse{}, err +func (client *IotDpsResourceClient) BeginDeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, options *IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions) (*armruntime.Poller[IotDpsResourceClientDeletePrivateEndpointConnectionResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deletePrivateEndpointConnection(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[IotDpsResourceClientDeletePrivateEndpointConnectionResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[IotDpsResourceClientDeletePrivateEndpointConnectionResponse](options.ResumeToken, client.pl, nil) } - result := IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("IotDpsResourceClient.DeletePrivateEndpointConnection", "", resp, client.pl) - if err != nil { - return IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse{}, err - } - result.Poller = &IotDpsResourceClientDeletePrivateEndpointConnectionPoller{ - pt: pt, - } - return result, nil } // DeletePrivateEndpointConnection - Delete private endpoint connection with the specified name @@ -377,7 +358,7 @@ func (client *IotDpsResourceClient) deletePrivateEndpointConnectionCreateRequest return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -423,7 +404,7 @@ func (client *IotDpsResourceClient) getCreateRequest(ctx context.Context, provis return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -431,7 +412,7 @@ func (client *IotDpsResourceClient) getCreateRequest(ctx context.Context, provis // getHandleResponse handles the Get response. func (client *IotDpsResourceClient) getHandleResponse(resp *http.Response) (IotDpsResourceClientGetResponse, error) { - result := IotDpsResourceClientGetResponse{RawResponse: resp} + result := IotDpsResourceClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ProvisioningServiceDescription); err != nil { return IotDpsResourceClientGetResponse{}, err } @@ -486,7 +467,7 @@ func (client *IotDpsResourceClient) getOperationResultCreateRequest(ctx context. } reqQP := req.Raw().URL.Query() reqQP.Set("asyncinfo", asyncinfo) - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -494,7 +475,7 @@ func (client *IotDpsResourceClient) getOperationResultCreateRequest(ctx context. // getOperationResultHandleResponse handles the GetOperationResult response. func (client *IotDpsResourceClient) getOperationResultHandleResponse(resp *http.Response) (IotDpsResourceClientGetOperationResultResponse, error) { - result := IotDpsResourceClientGetOperationResultResponse{RawResponse: resp} + result := IotDpsResourceClientGetOperationResultResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AsyncOperationResult); err != nil { return IotDpsResourceClientGetOperationResultResponse{}, err } @@ -547,7 +528,7 @@ func (client *IotDpsResourceClient) getPrivateEndpointConnectionCreateRequest(ct return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -555,7 +536,7 @@ func (client *IotDpsResourceClient) getPrivateEndpointConnectionCreateRequest(ct // getPrivateEndpointConnectionHandleResponse handles the GetPrivateEndpointConnection response. func (client *IotDpsResourceClient) getPrivateEndpointConnectionHandleResponse(resp *http.Response) (IotDpsResourceClientGetPrivateEndpointConnectionResponse, error) { - result := IotDpsResourceClientGetPrivateEndpointConnectionResponse{RawResponse: resp} + result := IotDpsResourceClientGetPrivateEndpointConnectionResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { return IotDpsResourceClientGetPrivateEndpointConnectionResponse{}, err } @@ -608,7 +589,7 @@ func (client *IotDpsResourceClient) getPrivateLinkResourcesCreateRequest(ctx con return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -616,7 +597,7 @@ func (client *IotDpsResourceClient) getPrivateLinkResourcesCreateRequest(ctx con // getPrivateLinkResourcesHandleResponse handles the GetPrivateLinkResources response. func (client *IotDpsResourceClient) getPrivateLinkResourcesHandleResponse(resp *http.Response) (IotDpsResourceClientGetPrivateLinkResourcesResponse, error) { - result := IotDpsResourceClientGetPrivateLinkResourcesResponse{RawResponse: resp} + result := IotDpsResourceClientGetPrivateLinkResourcesResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.GroupIDInformation); err != nil { return IotDpsResourceClientGetPrivateLinkResourcesResponse{}, err } @@ -628,16 +609,32 @@ func (client *IotDpsResourceClient) getPrivateLinkResourcesHandleResponse(resp * // resourceGroupName - Resource group identifier. // options - IotDpsResourceClientListByResourceGroupOptions contains the optional parameters for the IotDpsResourceClient.ListByResourceGroup // method. -func (client *IotDpsResourceClient) ListByResourceGroup(resourceGroupName string, options *IotDpsResourceClientListByResourceGroupOptions) *IotDpsResourceClientListByResourceGroupPager { - return &IotDpsResourceClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *IotDpsResourceClient) ListByResourceGroup(resourceGroupName string, options *IotDpsResourceClientListByResourceGroupOptions) *runtime.Pager[IotDpsResourceClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[IotDpsResourceClientListByResourceGroupResponse]{ + More: func(page IotDpsResourceClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp IotDpsResourceClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ProvisioningServiceDescriptionListResult.NextLink) + Fetcher: func(ctx context.Context, page *IotDpsResourceClientListByResourceGroupResponse) (IotDpsResourceClientListByResourceGroupResponse, 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 IotDpsResourceClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IotDpsResourceClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IotDpsResourceClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -656,7 +653,7 @@ func (client *IotDpsResourceClient) listByResourceGroupCreateRequest(ctx context return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -664,7 +661,7 @@ func (client *IotDpsResourceClient) listByResourceGroupCreateRequest(ctx context // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *IotDpsResourceClient) listByResourceGroupHandleResponse(resp *http.Response) (IotDpsResourceClientListByResourceGroupResponse, error) { - result := IotDpsResourceClientListByResourceGroupResponse{RawResponse: resp} + result := IotDpsResourceClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ProvisioningServiceDescriptionListResult); err != nil { return IotDpsResourceClientListByResourceGroupResponse{}, err } @@ -675,16 +672,32 @@ func (client *IotDpsResourceClient) listByResourceGroupHandleResponse(resp *http // If the operation fails it returns an *azcore.ResponseError type. // options - IotDpsResourceClientListBySubscriptionOptions contains the optional parameters for the IotDpsResourceClient.ListBySubscription // method. -func (client *IotDpsResourceClient) ListBySubscription(options *IotDpsResourceClientListBySubscriptionOptions) *IotDpsResourceClientListBySubscriptionPager { - return &IotDpsResourceClientListBySubscriptionPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) +func (client *IotDpsResourceClient) ListBySubscription(options *IotDpsResourceClientListBySubscriptionOptions) *runtime.Pager[IotDpsResourceClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PageProcessor[IotDpsResourceClientListBySubscriptionResponse]{ + More: func(page IotDpsResourceClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp IotDpsResourceClientListBySubscriptionResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.ProvisioningServiceDescriptionListResult.NextLink) + Fetcher: func(ctx context.Context, page *IotDpsResourceClientListBySubscriptionResponse) (IotDpsResourceClientListBySubscriptionResponse, 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 IotDpsResourceClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IotDpsResourceClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IotDpsResourceClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) }, - } + }) } // listBySubscriptionCreateRequest creates the ListBySubscription request. @@ -699,7 +712,7 @@ func (client *IotDpsResourceClient) listBySubscriptionCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -707,7 +720,7 @@ func (client *IotDpsResourceClient) listBySubscriptionCreateRequest(ctx context. // listBySubscriptionHandleResponse handles the ListBySubscription response. func (client *IotDpsResourceClient) listBySubscriptionHandleResponse(resp *http.Response) (IotDpsResourceClientListBySubscriptionResponse, error) { - result := IotDpsResourceClientListBySubscriptionResponse{RawResponse: resp} + result := IotDpsResourceClientListBySubscriptionResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.ProvisioningServiceDescriptionListResult); err != nil { return IotDpsResourceClientListBySubscriptionResponse{}, err } @@ -719,16 +732,32 @@ func (client *IotDpsResourceClient) listBySubscriptionHandleResponse(resp *http. // provisioningServiceName - The provisioning service name to get the shared access keys for. // resourceGroupName - resource group name // options - IotDpsResourceClientListKeysOptions contains the optional parameters for the IotDpsResourceClient.ListKeys method. -func (client *IotDpsResourceClient) ListKeys(provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientListKeysOptions) *IotDpsResourceClientListKeysPager { - return &IotDpsResourceClientListKeysPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listKeysCreateRequest(ctx, provisioningServiceName, resourceGroupName, options) +func (client *IotDpsResourceClient) ListKeys(provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientListKeysOptions) *runtime.Pager[IotDpsResourceClientListKeysResponse] { + return runtime.NewPager(runtime.PageProcessor[IotDpsResourceClientListKeysResponse]{ + More: func(page IotDpsResourceClientListKeysResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp IotDpsResourceClientListKeysResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.SharedAccessSignatureAuthorizationRuleListResult.NextLink) + Fetcher: func(ctx context.Context, page *IotDpsResourceClientListKeysResponse) (IotDpsResourceClientListKeysResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listKeysCreateRequest(ctx, provisioningServiceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IotDpsResourceClientListKeysResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IotDpsResourceClientListKeysResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IotDpsResourceClientListKeysResponse{}, runtime.NewResponseError(resp) + } + return client.listKeysHandleResponse(resp) }, - } + }) } // listKeysCreateRequest creates the ListKeys request. @@ -751,7 +780,7 @@ func (client *IotDpsResourceClient) listKeysCreateRequest(ctx context.Context, p return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -759,7 +788,7 @@ func (client *IotDpsResourceClient) listKeysCreateRequest(ctx context.Context, p // listKeysHandleResponse handles the ListKeys response. func (client *IotDpsResourceClient) listKeysHandleResponse(resp *http.Response) (IotDpsResourceClientListKeysResponse, error) { - result := IotDpsResourceClientListKeysResponse{RawResponse: resp} + result := IotDpsResourceClientListKeysResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SharedAccessSignatureAuthorizationRuleListResult); err != nil { return IotDpsResourceClientListKeysResponse{}, err } @@ -812,7 +841,7 @@ func (client *IotDpsResourceClient) listKeysForKeyNameCreateRequest(ctx context. return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -820,7 +849,7 @@ func (client *IotDpsResourceClient) listKeysForKeyNameCreateRequest(ctx context. // listKeysForKeyNameHandleResponse handles the ListKeysForKeyName response. func (client *IotDpsResourceClient) listKeysForKeyNameHandleResponse(resp *http.Response) (IotDpsResourceClientListKeysForKeyNameResponse, error) { - result := IotDpsResourceClientListKeysForKeyNameResponse{RawResponse: resp} + result := IotDpsResourceClientListKeysForKeyNameResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.SharedAccessSignatureAuthorizationRuleAccessRightsDescription); err != nil { return IotDpsResourceClientListKeysForKeyNameResponse{}, err } @@ -868,7 +897,7 @@ func (client *IotDpsResourceClient) listPrivateEndpointConnectionsCreateRequest( return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -876,7 +905,7 @@ func (client *IotDpsResourceClient) listPrivateEndpointConnectionsCreateRequest( // listPrivateEndpointConnectionsHandleResponse handles the ListPrivateEndpointConnections response. func (client *IotDpsResourceClient) listPrivateEndpointConnectionsHandleResponse(resp *http.Response) (IotDpsResourceClientListPrivateEndpointConnectionsResponse, error) { - result := IotDpsResourceClientListPrivateEndpointConnectionsResponse{RawResponse: resp} + result := IotDpsResourceClientListPrivateEndpointConnectionsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionArray); err != nil { return IotDpsResourceClientListPrivateEndpointConnectionsResponse{}, err } @@ -924,7 +953,7 @@ func (client *IotDpsResourceClient) listPrivateLinkResourcesCreateRequest(ctx co return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -932,7 +961,7 @@ func (client *IotDpsResourceClient) listPrivateLinkResourcesCreateRequest(ctx co // listPrivateLinkResourcesHandleResponse handles the ListPrivateLinkResources response. func (client *IotDpsResourceClient) listPrivateLinkResourcesHandleResponse(resp *http.Response) (IotDpsResourceClientListPrivateLinkResourcesResponse, error) { - result := IotDpsResourceClientListPrivateLinkResourcesResponse{RawResponse: resp} + result := IotDpsResourceClientListPrivateLinkResourcesResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResources); err != nil { return IotDpsResourceClientListPrivateLinkResourcesResponse{}, err } @@ -945,16 +974,32 @@ func (client *IotDpsResourceClient) listPrivateLinkResourcesHandleResponse(resp // resourceGroupName - Name of resource group. // options - IotDpsResourceClientListValidSKUsOptions contains the optional parameters for the IotDpsResourceClient.ListValidSKUs // method. -func (client *IotDpsResourceClient) ListValidSKUs(provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientListValidSKUsOptions) *IotDpsResourceClientListValidSKUsPager { - return &IotDpsResourceClientListValidSKUsPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listValidSKUsCreateRequest(ctx, provisioningServiceName, resourceGroupName, options) +func (client *IotDpsResourceClient) ListValidSKUs(provisioningServiceName string, resourceGroupName string, options *IotDpsResourceClientListValidSKUsOptions) *runtime.Pager[IotDpsResourceClientListValidSKUsResponse] { + return runtime.NewPager(runtime.PageProcessor[IotDpsResourceClientListValidSKUsResponse]{ + More: func(page IotDpsResourceClientListValidSKUsResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp IotDpsResourceClientListValidSKUsResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.IotDpsSKUDefinitionListResult.NextLink) + Fetcher: func(ctx context.Context, page *IotDpsResourceClientListValidSKUsResponse) (IotDpsResourceClientListValidSKUsResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listValidSKUsCreateRequest(ctx, provisioningServiceName, resourceGroupName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return IotDpsResourceClientListValidSKUsResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return IotDpsResourceClientListValidSKUsResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return IotDpsResourceClientListValidSKUsResponse{}, runtime.NewResponseError(resp) + } + return client.listValidSKUsHandleResponse(resp) }, - } + }) } // listValidSKUsCreateRequest creates the ListValidSKUs request. @@ -977,7 +1022,7 @@ func (client *IotDpsResourceClient) listValidSKUsCreateRequest(ctx context.Conte return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -985,7 +1030,7 @@ func (client *IotDpsResourceClient) listValidSKUsCreateRequest(ctx context.Conte // listValidSKUsHandleResponse handles the ListValidSKUs response. func (client *IotDpsResourceClient) listValidSKUsHandleResponse(resp *http.Response) (IotDpsResourceClientListValidSKUsResponse, error) { - result := IotDpsResourceClientListValidSKUsResponse{RawResponse: resp} + result := IotDpsResourceClientListValidSKUsResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.IotDpsSKUDefinitionListResult); err != nil { return IotDpsResourceClientListValidSKUsResponse{}, err } @@ -999,22 +1044,16 @@ func (client *IotDpsResourceClient) listValidSKUsHandleResponse(resp *http.Respo // provisioningServiceTags - Updated tag information to set into the provisioning service instance. // options - IotDpsResourceClientBeginUpdateOptions contains the optional parameters for the IotDpsResourceClient.BeginUpdate // method. -func (client *IotDpsResourceClient) BeginUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, provisioningServiceTags TagsResource, options *IotDpsResourceClientBeginUpdateOptions) (IotDpsResourceClientUpdatePollerResponse, error) { - resp, err := client.update(ctx, resourceGroupName, provisioningServiceName, provisioningServiceTags, options) - if err != nil { - return IotDpsResourceClientUpdatePollerResponse{}, err - } - result := IotDpsResourceClientUpdatePollerResponse{ - RawResponse: resp, +func (client *IotDpsResourceClient) BeginUpdate(ctx context.Context, resourceGroupName string, provisioningServiceName string, provisioningServiceTags TagsResource, options *IotDpsResourceClientBeginUpdateOptions) (*armruntime.Poller[IotDpsResourceClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, provisioningServiceName, provisioningServiceTags, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[IotDpsResourceClientUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[IotDpsResourceClientUpdateResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("IotDpsResourceClient.Update", "", resp, client.pl) - if err != nil { - return IotDpsResourceClientUpdatePollerResponse{}, err - } - result.Poller = &IotDpsResourceClientUpdatePoller{ - pt: pt, - } - return result, nil } // Update - Update an existing provisioning service's tags. to update other fields use the CreateOrUpdate method @@ -1054,7 +1093,7 @@ func (client *IotDpsResourceClient) updateCreateRequest(ctx context.Context, res return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, runtime.MarshalAsJSON(req, provisioningServiceTags) diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models.go index 2639c3032705..3b9c5d0bdc4e 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,13 +8,7 @@ package armdeviceprovisioningservices -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "reflect" - "time" -) +import "time" // AsyncOperationResult - Result of a long running operation. type AsyncOperationResult struct { @@ -40,13 +34,6 @@ type CertificateListDescription struct { Value []*CertificateResponse `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type CertificateListDescription. -func (c CertificateListDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", c.Value) - return json.Marshal(objectMap) -} - // CertificateProperties - The description of an X509 CA Certificate. type CertificateProperties struct { // READ-ONLY; base-64 representation of X509 certificate .cer file or just .pem file content. @@ -71,57 +58,6 @@ type CertificateProperties struct { Updated *time.Time `json:"updated,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. -func (c CertificateProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateByteArray(objectMap, "certificate", c.Certificate, runtime.Base64StdFormat) - populateTimeRFC1123(objectMap, "created", c.Created) - populateTimeRFC1123(objectMap, "expiry", c.Expiry) - populate(objectMap, "isVerified", c.IsVerified) - populate(objectMap, "subject", c.Subject) - populate(objectMap, "thumbprint", c.Thumbprint) - populateTimeRFC1123(objectMap, "updated", c.Updated) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. -func (c *CertificateProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "certificate": - err = runtime.DecodeByteArray(string(val), &c.Certificate, runtime.Base64StdFormat) - delete(rawMsg, key) - case "created": - err = unpopulateTimeRFC1123(val, &c.Created) - delete(rawMsg, key) - case "expiry": - err = unpopulateTimeRFC1123(val, &c.Expiry) - delete(rawMsg, key) - case "isVerified": - err = unpopulate(val, &c.IsVerified) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, &c.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, &c.Thumbprint) - delete(rawMsg, key) - case "updated": - err = unpopulateTimeRFC1123(val, &c.Updated) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // CertificateResponse - The X509 Certificate. type CertificateResponse struct { // properties of a certificate @@ -136,6 +72,9 @@ type CertificateResponse struct { // READ-ONLY; The name of the certificate. Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // READ-ONLY; The resource type. Type *string `json:"type,omitempty" azure:"ro"` } @@ -274,15 +213,6 @@ type GroupIDInformationProperties struct { RequiredZoneNames []*string `json:"requiredZoneNames,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type GroupIDInformationProperties. -func (g GroupIDInformationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", g.GroupID) - populate(objectMap, "requiredMembers", g.RequiredMembers) - populate(objectMap, "requiredZoneNames", g.RequiredZoneNames) - return json.Marshal(objectMap) -} - // IPFilterRule - The IP filter rules for a provisioning Service. type IPFilterRule struct { // REQUIRED; The desired action for requests captured by this rule. @@ -307,6 +237,9 @@ type IotDpsPropertiesDescription struct { // List of authorization keys for a provisioning service. AuthorizationPolicies []*SharedAccessSignatureAuthorizationRuleAccessRightsDescription `json:"authorizationPolicies,omitempty"` + // Optional. Indicates if the DPS instance has Data Residency enabled, removing the cross geo-pair disaster recovery. + EnableDataResidency *bool `json:"enableDataResidency,omitempty"` + // The IP filter rules. IPFilterRules []*IPFilterRule `json:"ipFilterRules,omitempty"` @@ -335,49 +268,37 @@ type IotDpsPropertiesDescription struct { ServiceOperationsHostName *string `json:"serviceOperationsHostName,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IotDpsPropertiesDescription. -func (i IotDpsPropertiesDescription) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "allocationPolicy", i.AllocationPolicy) - populate(objectMap, "authorizationPolicies", i.AuthorizationPolicies) - populate(objectMap, "deviceProvisioningHostName", i.DeviceProvisioningHostName) - populate(objectMap, "idScope", i.IDScope) - populate(objectMap, "ipFilterRules", i.IPFilterRules) - populate(objectMap, "iotHubs", i.IotHubs) - populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) - populate(objectMap, "provisioningState", i.ProvisioningState) - populate(objectMap, "publicNetworkAccess", i.PublicNetworkAccess) - populate(objectMap, "serviceOperationsHostName", i.ServiceOperationsHostName) - populate(objectMap, "state", i.State) - return json.Marshal(objectMap) -} - // IotDpsResourceClientBeginCreateOrUpdateOptions contains the optional parameters for the IotDpsResourceClient.BeginCreateOrUpdate // method. type IotDpsResourceClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions contains the optional parameters for the IotDpsResourceClient.BeginCreateOrUpdatePrivateEndpointConnection // method. type IotDpsResourceClientBeginCreateOrUpdatePrivateEndpointConnectionOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // IotDpsResourceClientBeginDeleteOptions contains the optional parameters for the IotDpsResourceClient.BeginDelete method. type IotDpsResourceClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions contains the optional parameters for the IotDpsResourceClient.BeginDeletePrivateEndpointConnection // method. type IotDpsResourceClientBeginDeletePrivateEndpointConnectionOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // IotDpsResourceClientBeginUpdateOptions contains the optional parameters for the IotDpsResourceClient.BeginUpdate method. type IotDpsResourceClientBeginUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // IotDpsResourceClientCheckProvisioningServiceNameAvailabilityOptions contains the optional parameters for the IotDpsResourceClient.CheckProvisioningServiceNameAvailability @@ -464,14 +385,6 @@ type IotDpsSKUDefinitionListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type IotDpsSKUDefinitionListResult. -func (i IotDpsSKUDefinitionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - // IotDpsSKUInfo - List of possible provisioning service SKUs. type IotDpsSKUInfo struct { // The number of units to provision @@ -551,14 +464,6 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty" azure:"ro"` } -// 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) -} - // OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -581,6 +486,9 @@ type PrivateEndpointConnection struct { // READ-ONLY; The resource name. Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // READ-ONLY; The resource type. Type *string `json:"type,omitempty" azure:"ro"` } @@ -600,13 +508,6 @@ type PrivateLinkResources struct { Value []*GroupIDInformation `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResources. -func (p PrivateLinkResources) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PrivateLinkServiceConnectionState - The current state of a private endpoint connection type PrivateLinkServiceConnectionState struct { // REQUIRED; The description for the current state of a private endpoint connection @@ -643,24 +544,13 @@ type ProvisioningServiceDescription struct { // READ-ONLY; The resource name. Name *string `json:"name,omitempty" azure:"ro"` + // READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` + // READ-ONLY; The resource type. Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ProvisioningServiceDescription. -func (p ProvisioningServiceDescription) 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, "sku", p.SKU) - populate(objectMap, "tags", p.Tags) - populate(objectMap, "type", p.Type) - return json.Marshal(objectMap) -} - // ProvisioningServiceDescriptionListResult - List of provisioning service descriptions. type ProvisioningServiceDescriptionListResult struct { // List of provisioning service descriptions. @@ -670,14 +560,6 @@ type ProvisioningServiceDescriptionListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ProvisioningServiceDescriptionListResult. -func (p ProvisioningServiceDescriptionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // Resource - The common properties of an Azure resource. type Resource struct { // REQUIRED; The resource location. @@ -696,17 +578,6 @@ type Resource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// 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) -} - // SharedAccessSignatureAuthorizationRuleAccessRightsDescription - Description of the shared access key. type SharedAccessSignatureAuthorizationRuleAccessRightsDescription struct { // REQUIRED; Name of the key. @@ -731,12 +602,25 @@ type SharedAccessSignatureAuthorizationRuleListResult struct { NextLink *string `json:"nextLink,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type SharedAccessSignatureAuthorizationRuleListResult. -func (s SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", s.NextLink) - populate(objectMap, "value", s.Value) - return json.Marshal(objectMap) +// 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 timestamp of resource last modification (UTC) + 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"` } // TagsResource - A container holding only the Tags for a resource, allowing the user to update the tags on a Provisioning @@ -746,13 +630,6 @@ type TagsResource struct { Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TagsResource. -func (t TagsResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - // VerificationCodeRequest - The JSON-serialized leaf certificate type VerificationCodeRequest struct { // base-64 representation of X509 certificate .cer file or just .pem file content. @@ -801,85 +678,3 @@ type VerificationCodeResponseProperties struct { // Verification code. VerificationCode *string `json:"verificationCode,omitempty"` } - -// MarshalJSON implements the json.Marshaller interface for type VerificationCodeResponseProperties. -func (v VerificationCodeResponseProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populateByteArray(objectMap, "certificate", v.Certificate, runtime.Base64StdFormat) - populate(objectMap, "created", v.Created) - populate(objectMap, "expiry", v.Expiry) - populate(objectMap, "isVerified", v.IsVerified) - populate(objectMap, "subject", v.Subject) - populate(objectMap, "thumbprint", v.Thumbprint) - populate(objectMap, "updated", v.Updated) - populate(objectMap, "verificationCode", v.VerificationCode) - return json.Marshal(objectMap) -} - -// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationCodeResponseProperties. -func (v *VerificationCodeResponseProperties) UnmarshalJSON(data []byte) error { - var rawMsg map[string]json.RawMessage - if err := json.Unmarshal(data, &rawMsg); err != nil { - return err - } - for key, val := range rawMsg { - var err error - switch key { - case "certificate": - err = runtime.DecodeByteArray(string(val), &v.Certificate, runtime.Base64StdFormat) - delete(rawMsg, key) - case "created": - err = unpopulate(val, &v.Created) - delete(rawMsg, key) - case "expiry": - err = unpopulate(val, &v.Expiry) - delete(rawMsg, key) - case "isVerified": - err = unpopulate(val, &v.IsVerified) - delete(rawMsg, key) - case "subject": - err = unpopulate(val, &v.Subject) - delete(rawMsg, key) - case "thumbprint": - err = unpopulate(val, &v.Thumbprint) - delete(rawMsg, key) - case "updated": - err = unpopulate(val, &v.Updated) - delete(rawMsg, key) - case "verificationCode": - err = unpopulate(val, &v.VerificationCode) - delete(rawMsg, key) - } - if err != nil { - return 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 populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { - if azcore.IsNullValue(b) { - m[k] = nil - } else if len(b) == 0 { - return - } else { - m[k] = runtime.EncodeByteArray(b, f) - } -} - -func unpopulate(data json.RawMessage, v interface{}) error { - if data == nil { - return nil - } - return json.Unmarshal(data, v) -} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models_serde.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models_serde.go new file mode 100644 index 000000000000..41b735358df1 --- /dev/null +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_models_serde.go @@ -0,0 +1,302 @@ +//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 armdeviceprovisioningservices + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type CertificateListDescription. +func (c CertificateListDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", c.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type CertificateProperties. +func (c CertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateByteArray(objectMap, "certificate", c.Certificate, runtime.Base64StdFormat) + populateTimeRFC1123(objectMap, "created", c.Created) + populateTimeRFC1123(objectMap, "expiry", c.Expiry) + populate(objectMap, "isVerified", c.IsVerified) + populate(objectMap, "subject", c.Subject) + populate(objectMap, "thumbprint", c.Thumbprint) + populateTimeRFC1123(objectMap, "updated", c.Updated) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type CertificateProperties. +func (c *CertificateProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "certificate": + err = runtime.DecodeByteArray(string(val), &c.Certificate, runtime.Base64StdFormat) + delete(rawMsg, key) + case "created": + err = unpopulateTimeRFC1123(val, &c.Created) + delete(rawMsg, key) + case "expiry": + err = unpopulateTimeRFC1123(val, &c.Expiry) + delete(rawMsg, key) + case "isVerified": + err = unpopulate(val, &c.IsVerified) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, &c.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, &c.Thumbprint) + delete(rawMsg, key) + case "updated": + err = unpopulateTimeRFC1123(val, &c.Updated) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type GroupIDInformationProperties. +func (g GroupIDInformationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", g.GroupID) + populate(objectMap, "requiredMembers", g.RequiredMembers) + populate(objectMap, "requiredZoneNames", g.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type IotDpsPropertiesDescription. +func (i IotDpsPropertiesDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "allocationPolicy", i.AllocationPolicy) + populate(objectMap, "authorizationPolicies", i.AuthorizationPolicies) + populate(objectMap, "deviceProvisioningHostName", i.DeviceProvisioningHostName) + populate(objectMap, "enableDataResidency", i.EnableDataResidency) + populate(objectMap, "idScope", i.IDScope) + populate(objectMap, "ipFilterRules", i.IPFilterRules) + populate(objectMap, "iotHubs", i.IotHubs) + populate(objectMap, "privateEndpointConnections", i.PrivateEndpointConnections) + populate(objectMap, "provisioningState", i.ProvisioningState) + populate(objectMap, "publicNetworkAccess", i.PublicNetworkAccess) + populate(objectMap, "serviceOperationsHostName", i.ServiceOperationsHostName) + populate(objectMap, "state", i.State) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type IotDpsSKUDefinitionListResult. +func (i IotDpsSKUDefinitionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// 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) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResources. +func (p PrivateLinkResources) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningServiceDescription. +func (p ProvisioningServiceDescription) 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, "sku", p.SKU) + populate(objectMap, "systemData", p.SystemData) + populate(objectMap, "tags", p.Tags) + populate(objectMap, "type", p.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ProvisioningServiceDescriptionListResult. +func (p ProvisioningServiceDescriptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// 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) +} + +// MarshalJSON implements the json.Marshaller interface for type SharedAccessSignatureAuthorizationRuleListResult. +func (s SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", s.NextLink) + populate(objectMap, "value", s.Value) + return json.Marshal(objectMap) +} + +// 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 err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagsResource. +func (t TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type VerificationCodeResponseProperties. +func (v VerificationCodeResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populateByteArray(objectMap, "certificate", v.Certificate, runtime.Base64StdFormat) + populate(objectMap, "created", v.Created) + populate(objectMap, "expiry", v.Expiry) + populate(objectMap, "isVerified", v.IsVerified) + populate(objectMap, "subject", v.Subject) + populate(objectMap, "thumbprint", v.Thumbprint) + populate(objectMap, "updated", v.Updated) + populate(objectMap, "verificationCode", v.VerificationCode) + return json.Marshal(objectMap) +} + +// UnmarshalJSON implements the json.Unmarshaller interface for type VerificationCodeResponseProperties. +func (v *VerificationCodeResponseProperties) UnmarshalJSON(data []byte) error { + var rawMsg map[string]json.RawMessage + if err := json.Unmarshal(data, &rawMsg); err != nil { + return err + } + for key, val := range rawMsg { + var err error + switch key { + case "certificate": + err = runtime.DecodeByteArray(string(val), &v.Certificate, runtime.Base64StdFormat) + delete(rawMsg, key) + case "created": + err = unpopulate(val, &v.Created) + delete(rawMsg, key) + case "expiry": + err = unpopulate(val, &v.Expiry) + delete(rawMsg, key) + case "isVerified": + err = unpopulate(val, &v.IsVerified) + delete(rawMsg, key) + case "subject": + err = unpopulate(val, &v.Subject) + delete(rawMsg, key) + case "thumbprint": + err = unpopulate(val, &v.Thumbprint) + delete(rawMsg, key) + case "updated": + err = unpopulate(val, &v.Updated) + delete(rawMsg, key) + case "verificationCode": + err = unpopulate(val, &v.VerificationCode) + delete(rawMsg, key) + } + if err != nil { + return 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 populateByteArray(m map[string]interface{}, k string, b []byte, f runtime.Base64Encoding) { + if azcore.IsNullValue(b) { + m[k] = nil + } else if len(b) == 0 { + return + } else { + m[k] = runtime.EncodeByteArray(b, f) + } +} + +func unpopulate(data json.RawMessage, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_operations_client.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_operations_client.go index 9c04b12369b3..dd810997cfaa 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_operations_client.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -13,6 +13,7 @@ import ( "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" @@ -28,34 +29,54 @@ type OperationsClient struct { // 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 { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - Lists all of the available Microsoft.Devices REST API operations. // If the operation fails it returns an *azcore.ResponseError type. // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager { - return &OperationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *OperationsClient) List(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp OperationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OperationListResult.NextLink) + 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. @@ -66,7 +87,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * return nil, err } reqQP := req.Raw().URL.Query() - reqQP.Set("api-version", "2020-03-01") + reqQP.Set("api-version", "2021-10-15") req.Raw().URL.RawQuery = reqQP.Encode() req.Raw().Header.Set("Accept", "application/json") return req, nil @@ -74,7 +95,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_pagers.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_pagers.go deleted file mode 100644 index 73e169630a01..000000000000 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_pagers.go +++ /dev/null @@ -1,287 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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 armdeviceprovisioningservices - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// IotDpsResourceClientListByResourceGroupPager provides operations for iterating over paged responses. -type IotDpsResourceClientListByResourceGroupPager struct { - client *IotDpsResourceClient - current IotDpsResourceClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, IotDpsResourceClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *IotDpsResourceClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *IotDpsResourceClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ProvisioningServiceDescriptionListResult.NextLink == nil || len(*p.current.ProvisioningServiceDescriptionListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current IotDpsResourceClientListByResourceGroupResponse page. -func (p *IotDpsResourceClientListByResourceGroupPager) PageResponse() IotDpsResourceClientListByResourceGroupResponse { - return p.current -} - -// IotDpsResourceClientListBySubscriptionPager provides operations for iterating over paged responses. -type IotDpsResourceClientListBySubscriptionPager struct { - client *IotDpsResourceClient - current IotDpsResourceClientListBySubscriptionResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, IotDpsResourceClientListBySubscriptionResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *IotDpsResourceClientListBySubscriptionPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *IotDpsResourceClientListBySubscriptionPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.ProvisioningServiceDescriptionListResult.NextLink == nil || len(*p.current.ProvisioningServiceDescriptionListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listBySubscriptionHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current IotDpsResourceClientListBySubscriptionResponse page. -func (p *IotDpsResourceClientListBySubscriptionPager) PageResponse() IotDpsResourceClientListBySubscriptionResponse { - return p.current -} - -// IotDpsResourceClientListKeysPager provides operations for iterating over paged responses. -type IotDpsResourceClientListKeysPager struct { - client *IotDpsResourceClient - current IotDpsResourceClientListKeysResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, IotDpsResourceClientListKeysResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *IotDpsResourceClientListKeysPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *IotDpsResourceClientListKeysPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.SharedAccessSignatureAuthorizationRuleListResult.NextLink == nil || len(*p.current.SharedAccessSignatureAuthorizationRuleListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listKeysHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current IotDpsResourceClientListKeysResponse page. -func (p *IotDpsResourceClientListKeysPager) PageResponse() IotDpsResourceClientListKeysResponse { - return p.current -} - -// IotDpsResourceClientListValidSKUsPager provides operations for iterating over paged responses. -type IotDpsResourceClientListValidSKUsPager struct { - client *IotDpsResourceClient - current IotDpsResourceClientListValidSKUsResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, IotDpsResourceClientListValidSKUsResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *IotDpsResourceClientListValidSKUsPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *IotDpsResourceClientListValidSKUsPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.IotDpsSKUDefinitionListResult.NextLink == nil || len(*p.current.IotDpsSKUDefinitionListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listValidSKUsHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current IotDpsResourceClientListValidSKUsResponse page. -func (p *IotDpsResourceClientListValidSKUsPager) PageResponse() IotDpsResourceClientListValidSKUsResponse { - return p.current -} - -// OperationsClientListPager provides operations for iterating over paged responses. -type OperationsClientListPager struct { - client *OperationsClient - current OperationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OperationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *OperationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *OperationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OperationListResult.NextLink == nil || len(*p.current.OperationListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current OperationsClientListResponse page. -func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse { - return p.current -} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_pollers.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_pollers.go deleted file mode 100644 index 2c46599bee2e..000000000000 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_pollers.go +++ /dev/null @@ -1,230 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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 armdeviceprovisioningservices - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "net/http" -) - -// IotDpsResourceClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type IotDpsResourceClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *IotDpsResourceClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *IotDpsResourceClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final IotDpsResourceClientCreateOrUpdateResponse will be returned. -func (p *IotDpsResourceClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (IotDpsResourceClientCreateOrUpdateResponse, error) { - respType := IotDpsResourceClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.ProvisioningServiceDescription) - if err != nil { - return IotDpsResourceClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *IotDpsResourceClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller provides polling facilities until the operation reaches a terminal state. -type IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse will be returned. -func (p *IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller) FinalResponse(ctx context.Context) (IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse, error) { - respType := IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.PrivateEndpointConnection) - if err != nil { - return IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// IotDpsResourceClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type IotDpsResourceClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *IotDpsResourceClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *IotDpsResourceClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final IotDpsResourceClientDeleteResponse will be returned. -func (p *IotDpsResourceClientDeletePoller) FinalResponse(ctx context.Context) (IotDpsResourceClientDeleteResponse, error) { - respType := IotDpsResourceClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return IotDpsResourceClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *IotDpsResourceClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// IotDpsResourceClientDeletePrivateEndpointConnectionPoller provides polling facilities until the operation reaches a terminal state. -type IotDpsResourceClientDeletePrivateEndpointConnectionPoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *IotDpsResourceClientDeletePrivateEndpointConnectionPoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *IotDpsResourceClientDeletePrivateEndpointConnectionPoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final IotDpsResourceClientDeletePrivateEndpointConnectionResponse will be returned. -func (p *IotDpsResourceClientDeletePrivateEndpointConnectionPoller) FinalResponse(ctx context.Context) (IotDpsResourceClientDeletePrivateEndpointConnectionResponse, error) { - respType := IotDpsResourceClientDeletePrivateEndpointConnectionResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.PrivateEndpointConnection) - if err != nil { - return IotDpsResourceClientDeletePrivateEndpointConnectionResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *IotDpsResourceClientDeletePrivateEndpointConnectionPoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// IotDpsResourceClientUpdatePoller provides polling facilities until the operation reaches a terminal state. -type IotDpsResourceClientUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *IotDpsResourceClientUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *IotDpsResourceClientUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final IotDpsResourceClientUpdateResponse will be returned. -func (p *IotDpsResourceClientUpdatePoller) FinalResponse(ctx context.Context) (IotDpsResourceClientUpdateResponse, error) { - respType := IotDpsResourceClientUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.ProvisioningServiceDescription) - if err != nil { - return IotDpsResourceClientUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *IotDpsResourceClientUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_response_types.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_response_types.go index 0689368d12eb..d21478f2db81 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_response_types.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,488 +8,123 @@ package armdeviceprovisioningservices -import ( - "context" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "net/http" - "time" -) - // DpsCertificateClientCreateOrUpdateResponse contains the response from method DpsCertificateClient.CreateOrUpdate. type DpsCertificateClientCreateOrUpdateResponse struct { - DpsCertificateClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DpsCertificateClientCreateOrUpdateResult contains the result from method DpsCertificateClient.CreateOrUpdate. -type DpsCertificateClientCreateOrUpdateResult struct { CertificateResponse } // DpsCertificateClientDeleteResponse contains the response from method DpsCertificateClient.Delete. type DpsCertificateClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // DpsCertificateClientGenerateVerificationCodeResponse contains the response from method DpsCertificateClient.GenerateVerificationCode. type DpsCertificateClientGenerateVerificationCodeResponse struct { - DpsCertificateClientGenerateVerificationCodeResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DpsCertificateClientGenerateVerificationCodeResult contains the result from method DpsCertificateClient.GenerateVerificationCode. -type DpsCertificateClientGenerateVerificationCodeResult struct { VerificationCodeResponse } // DpsCertificateClientGetResponse contains the response from method DpsCertificateClient.Get. type DpsCertificateClientGetResponse struct { - DpsCertificateClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DpsCertificateClientGetResult contains the result from method DpsCertificateClient.Get. -type DpsCertificateClientGetResult struct { CertificateResponse } // DpsCertificateClientListResponse contains the response from method DpsCertificateClient.List. type DpsCertificateClientListResponse struct { - DpsCertificateClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DpsCertificateClientListResult contains the result from method DpsCertificateClient.List. -type DpsCertificateClientListResult struct { CertificateListDescription } // DpsCertificateClientVerifyCertificateResponse contains the response from method DpsCertificateClient.VerifyCertificate. type DpsCertificateClientVerifyCertificateResponse struct { - DpsCertificateClientVerifyCertificateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// DpsCertificateClientVerifyCertificateResult contains the result from method DpsCertificateClient.VerifyCertificate. -type DpsCertificateClientVerifyCertificateResult struct { CertificateResponse } // IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse contains the response from method IotDpsResourceClient.CheckProvisioningServiceNameAvailability. type IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResponse struct { - IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResult contains the result from method IotDpsResourceClient.CheckProvisioningServiceNameAvailability. -type IotDpsResourceClientCheckProvisioningServiceNameAvailabilityResult struct { NameAvailabilityInfo } -// IotDpsResourceClientCreateOrUpdatePollerResponse contains the response from method IotDpsResourceClient.CreateOrUpdate. -type IotDpsResourceClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *IotDpsResourceClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l IotDpsResourceClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (IotDpsResourceClientCreateOrUpdateResponse, error) { - respType := IotDpsResourceClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.ProvisioningServiceDescription) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a IotDpsResourceClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *IotDpsResourceClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *IotDpsResourceClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("IotDpsResourceClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &IotDpsResourceClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - -// IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse contains the response from method IotDpsResourceClient.CreateOrUpdatePrivateEndpointConnection. -type IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse struct { - // Poller contains an initialized poller. - Poller *IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse, error) { - respType := IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.PrivateEndpointConnection) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse from the provided client -// and resume token. -func (l *IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPollerResponse) Resume(ctx context.Context, client *IotDpsResourceClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("IotDpsResourceClient.CreateOrUpdatePrivateEndpointConnection", token, client.pl) - if err != nil { - return err - } - poller := &IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse contains the response from method IotDpsResourceClient.CreateOrUpdatePrivateEndpointConnection. type IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResponse struct { - IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResult contains the result from method IotDpsResourceClient.CreateOrUpdatePrivateEndpointConnection. -type IotDpsResourceClientCreateOrUpdatePrivateEndpointConnectionResult struct { PrivateEndpointConnection } // IotDpsResourceClientCreateOrUpdateResponse contains the response from method IotDpsResourceClient.CreateOrUpdate. type IotDpsResourceClientCreateOrUpdateResponse struct { - IotDpsResourceClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientCreateOrUpdateResult contains the result from method IotDpsResourceClient.CreateOrUpdate. -type IotDpsResourceClientCreateOrUpdateResult struct { ProvisioningServiceDescription } -// IotDpsResourceClientDeletePollerResponse contains the response from method IotDpsResourceClient.Delete. -type IotDpsResourceClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *IotDpsResourceClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l IotDpsResourceClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (IotDpsResourceClientDeleteResponse, error) { - respType := IotDpsResourceClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a IotDpsResourceClientDeletePollerResponse from the provided client and resume token. -func (l *IotDpsResourceClientDeletePollerResponse) Resume(ctx context.Context, client *IotDpsResourceClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("IotDpsResourceClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &IotDpsResourceClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - -// IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse contains the response from method IotDpsResourceClient.DeletePrivateEndpointConnection. -type IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse struct { - // Poller contains an initialized poller. - Poller *IotDpsResourceClientDeletePrivateEndpointConnectionPoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (IotDpsResourceClientDeletePrivateEndpointConnectionResponse, error) { - respType := IotDpsResourceClientDeletePrivateEndpointConnectionResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.PrivateEndpointConnection) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse from the provided client and resume -// token. -func (l *IotDpsResourceClientDeletePrivateEndpointConnectionPollerResponse) Resume(ctx context.Context, client *IotDpsResourceClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("IotDpsResourceClient.DeletePrivateEndpointConnection", token, client.pl) - if err != nil { - return err - } - poller := &IotDpsResourceClientDeletePrivateEndpointConnectionPoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // IotDpsResourceClientDeletePrivateEndpointConnectionResponse contains the response from method IotDpsResourceClient.DeletePrivateEndpointConnection. type IotDpsResourceClientDeletePrivateEndpointConnectionResponse struct { - IotDpsResourceClientDeletePrivateEndpointConnectionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientDeletePrivateEndpointConnectionResult contains the result from method IotDpsResourceClient.DeletePrivateEndpointConnection. -type IotDpsResourceClientDeletePrivateEndpointConnectionResult struct { PrivateEndpointConnection } // IotDpsResourceClientDeleteResponse contains the response from method IotDpsResourceClient.Delete. type IotDpsResourceClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // IotDpsResourceClientGetOperationResultResponse contains the response from method IotDpsResourceClient.GetOperationResult. type IotDpsResourceClientGetOperationResultResponse struct { - IotDpsResourceClientGetOperationResultResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientGetOperationResultResult contains the result from method IotDpsResourceClient.GetOperationResult. -type IotDpsResourceClientGetOperationResultResult struct { AsyncOperationResult } // IotDpsResourceClientGetPrivateEndpointConnectionResponse contains the response from method IotDpsResourceClient.GetPrivateEndpointConnection. type IotDpsResourceClientGetPrivateEndpointConnectionResponse struct { - IotDpsResourceClientGetPrivateEndpointConnectionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientGetPrivateEndpointConnectionResult contains the result from method IotDpsResourceClient.GetPrivateEndpointConnection. -type IotDpsResourceClientGetPrivateEndpointConnectionResult struct { PrivateEndpointConnection } // IotDpsResourceClientGetPrivateLinkResourcesResponse contains the response from method IotDpsResourceClient.GetPrivateLinkResources. type IotDpsResourceClientGetPrivateLinkResourcesResponse struct { - IotDpsResourceClientGetPrivateLinkResourcesResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientGetPrivateLinkResourcesResult contains the result from method IotDpsResourceClient.GetPrivateLinkResources. -type IotDpsResourceClientGetPrivateLinkResourcesResult struct { GroupIDInformation } // IotDpsResourceClientGetResponse contains the response from method IotDpsResourceClient.Get. type IotDpsResourceClientGetResponse struct { - IotDpsResourceClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientGetResult contains the result from method IotDpsResourceClient.Get. -type IotDpsResourceClientGetResult struct { ProvisioningServiceDescription } // IotDpsResourceClientListByResourceGroupResponse contains the response from method IotDpsResourceClient.ListByResourceGroup. type IotDpsResourceClientListByResourceGroupResponse struct { - IotDpsResourceClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientListByResourceGroupResult contains the result from method IotDpsResourceClient.ListByResourceGroup. -type IotDpsResourceClientListByResourceGroupResult struct { ProvisioningServiceDescriptionListResult } // IotDpsResourceClientListBySubscriptionResponse contains the response from method IotDpsResourceClient.ListBySubscription. type IotDpsResourceClientListBySubscriptionResponse struct { - IotDpsResourceClientListBySubscriptionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientListBySubscriptionResult contains the result from method IotDpsResourceClient.ListBySubscription. -type IotDpsResourceClientListBySubscriptionResult struct { ProvisioningServiceDescriptionListResult } // IotDpsResourceClientListKeysForKeyNameResponse contains the response from method IotDpsResourceClient.ListKeysForKeyName. type IotDpsResourceClientListKeysForKeyNameResponse struct { - IotDpsResourceClientListKeysForKeyNameResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientListKeysForKeyNameResult contains the result from method IotDpsResourceClient.ListKeysForKeyName. -type IotDpsResourceClientListKeysForKeyNameResult struct { SharedAccessSignatureAuthorizationRuleAccessRightsDescription } // IotDpsResourceClientListKeysResponse contains the response from method IotDpsResourceClient.ListKeys. type IotDpsResourceClientListKeysResponse struct { - IotDpsResourceClientListKeysResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientListKeysResult contains the result from method IotDpsResourceClient.ListKeys. -type IotDpsResourceClientListKeysResult struct { SharedAccessSignatureAuthorizationRuleListResult } // IotDpsResourceClientListPrivateEndpointConnectionsResponse contains the response from method IotDpsResourceClient.ListPrivateEndpointConnections. type IotDpsResourceClientListPrivateEndpointConnectionsResponse struct { - IotDpsResourceClientListPrivateEndpointConnectionsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientListPrivateEndpointConnectionsResult contains the result from method IotDpsResourceClient.ListPrivateEndpointConnections. -type IotDpsResourceClientListPrivateEndpointConnectionsResult struct { // The list of private endpoint connections for a provisioning service PrivateEndpointConnectionArray []*PrivateEndpointConnection } // IotDpsResourceClientListPrivateLinkResourcesResponse contains the response from method IotDpsResourceClient.ListPrivateLinkResources. type IotDpsResourceClientListPrivateLinkResourcesResponse struct { - IotDpsResourceClientListPrivateLinkResourcesResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientListPrivateLinkResourcesResult contains the result from method IotDpsResourceClient.ListPrivateLinkResources. -type IotDpsResourceClientListPrivateLinkResourcesResult struct { PrivateLinkResources } // IotDpsResourceClientListValidSKUsResponse contains the response from method IotDpsResourceClient.ListValidSKUs. type IotDpsResourceClientListValidSKUsResponse struct { - IotDpsResourceClientListValidSKUsResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientListValidSKUsResult contains the result from method IotDpsResourceClient.ListValidSKUs. -type IotDpsResourceClientListValidSKUsResult struct { IotDpsSKUDefinitionListResult } -// IotDpsResourceClientUpdatePollerResponse contains the response from method IotDpsResourceClient.Update. -type IotDpsResourceClientUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *IotDpsResourceClientUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l IotDpsResourceClientUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (IotDpsResourceClientUpdateResponse, error) { - respType := IotDpsResourceClientUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.ProvisioningServiceDescription) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a IotDpsResourceClientUpdatePollerResponse from the provided client and resume token. -func (l *IotDpsResourceClientUpdatePollerResponse) Resume(ctx context.Context, client *IotDpsResourceClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("IotDpsResourceClient.Update", token, client.pl) - if err != nil { - return err - } - poller := &IotDpsResourceClientUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // IotDpsResourceClientUpdateResponse contains the response from method IotDpsResourceClient.Update. type IotDpsResourceClientUpdateResponse struct { - IotDpsResourceClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// IotDpsResourceClientUpdateResult contains the result from method IotDpsResourceClient.Update. -type IotDpsResourceClientUpdateResult struct { ProvisioningServiceDescription } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { OperationListResult } diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc1123.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc1123.go index 0bdf82f51e62..06ce535d783f 100644 --- a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc1123.go +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc1123.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. diff --git a/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc3339.go b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc3339.go new file mode 100644 index 000000000000..a838cef8afcb --- /dev/null +++ b/sdk/resourcemanager/deviceprovisioningservices/armdeviceprovisioningservices/zz_generated_time_rfc3339.go @@ -0,0 +1,85 @@ +//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 armdeviceprovisioningservices + +import ( + "encoding/json" + "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, 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 err + } + *t = (*time.Time)(&aux) + return nil +} diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/CHANGELOG.md b/sdk/resourcemanager/deviceupdate/armdeviceupdate/CHANGELOG.md index c46a2db7107c..e344d8185ac7 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/CHANGELOG.md +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/CHANGELOG.md @@ -1,5 +1,251 @@ # Release History +## 0.3.0 (2022-04-11) +### Breaking Changes + +- Function `NewPrivateEndpointConnectionProxiesClient` return value(s) have been changed from `(*PrivateEndpointConnectionProxiesClient)` to `(*PrivateEndpointConnectionProxiesClient, error)` +- Function `*AccountsClient.BeginDelete` return value(s) have been changed from `(AccountsClientDeletePollerResponse, error)` to `(*armruntime.Poller[AccountsClientDeleteResponse], error)` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `NewPrivateLinkResourcesClient` return value(s) have been changed from `(*PrivateLinkResourcesClient)` to `(*PrivateLinkResourcesClient, error)` +- Function `*PrivateEndpointConnectionProxiesClient.BeginDelete` return value(s) have been changed from `(PrivateEndpointConnectionProxiesClientDeletePollerResponse, error)` to `(*armruntime.Poller[PrivateEndpointConnectionProxiesClientDeleteResponse], error)` +- Function `*PrivateEndpointConnectionsClient.BeginDelete` return value(s) have been changed from `(PrivateEndpointConnectionsClientDeletePollerResponse, error)` to `(*armruntime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error)` +- Function `NewClient` return value(s) have been changed from `(*Client)` to `(*Client, error)` +- Function `NewAccountsClient` return value(s) have been changed from `(*AccountsClient)` to `(*AccountsClient, error)` +- Function `NewPrivateEndpointConnectionsClient` return value(s) have been changed from `(*PrivateEndpointConnectionsClient)` to `(*PrivateEndpointConnectionsClient, error)` +- Function `*InstancesClient.BeginCreate` return value(s) have been changed from `(InstancesClientCreatePollerResponse, error)` to `(*armruntime.Poller[InstancesClientCreateResponse], error)` +- Function `*InstancesClient.BeginDelete` return value(s) have been changed from `(InstancesClientDeletePollerResponse, error)` to `(*armruntime.Poller[InstancesClientDeleteResponse], error)` +- Function `*PrivateEndpointConnectionProxiesClient.ListByAccount` parameter(s) have been changed from `(context.Context, string, string, *PrivateEndpointConnectionProxiesClientListByAccountOptions)` to `(string, string, *PrivateEndpointConnectionProxiesClientListByAccountOptions)` +- Function `*PrivateEndpointConnectionProxiesClient.ListByAccount` return value(s) have been changed from `(PrivateEndpointConnectionProxiesClientListByAccountResponse, error)` to `(*runtime.Pager[PrivateEndpointConnectionProxiesClientListByAccountResponse])` +- Function `*OperationsClient.List` return value(s) have been changed from `(*OperationsClientListPager)` to `(*runtime.Pager[OperationsClientListResponse])` +- Function `*AccountsClient.BeginCreate` return value(s) have been changed from `(AccountsClientCreatePollerResponse, error)` to `(*armruntime.Poller[AccountsClientCreateResponse], error)` +- Function `*PrivateLinkResourcesClient.ListByAccount` parameter(s) have been changed from `(context.Context, string, string, *PrivateLinkResourcesClientListByAccountOptions)` to `(string, string, *PrivateLinkResourcesClientListByAccountOptions)` +- Function `*PrivateLinkResourcesClient.ListByAccount` return value(s) have been changed from `(PrivateLinkResourcesClientListByAccountResponse, error)` to `(*runtime.Pager[PrivateLinkResourcesClientListByAccountResponse])` +- Function `*PrivateEndpointConnectionsClient.BeginCreateOrUpdate` return value(s) have been changed from `(PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error)` +- Function `NewInstancesClient` return value(s) have been changed from `(*InstancesClient)` to `(*InstancesClient, error)` +- Function `*AccountsClient.ListByResourceGroup` return value(s) have been changed from `(*AccountsClientListByResourceGroupPager)` to `(*runtime.Pager[AccountsClientListByResourceGroupResponse])` +- Function `*AccountsClient.ListBySubscription` return value(s) have been changed from `(*AccountsClientListBySubscriptionPager)` to `(*runtime.Pager[AccountsClientListBySubscriptionResponse])` +- Function `*AccountsClient.BeginUpdate` return value(s) have been changed from `(AccountsClientUpdatePollerResponse, error)` to `(*armruntime.Poller[AccountsClientUpdateResponse], error)` +- Function `*PrivateEndpointConnectionProxiesClient.BeginCreateOrUpdate` return value(s) have been changed from `(PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse], error)` +- Function `*InstancesClient.ListByAccount` return value(s) have been changed from `(*InstancesClientListByAccountPager)` to `(*runtime.Pager[InstancesClientListByAccountResponse])` +- Function `*PrivateEndpointConnectionsClient.ListByAccount` parameter(s) have been changed from `(context.Context, string, string, *PrivateEndpointConnectionsClientListByAccountOptions)` to `(string, string, *PrivateEndpointConnectionsClientListByAccountOptions)` +- Function `*PrivateEndpointConnectionsClient.ListByAccount` return value(s) have been changed from `(PrivateEndpointConnectionsClientListByAccountResponse, error)` to `(*runtime.Pager[PrivateEndpointConnectionsClientListByAccountResponse])` +- Type of `ErrorAdditionalInfo.Info` has been changed from `map[string]interface{}` to `interface{}` +- Function `*AccountsClientDeletePoller.ResumeToken` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePoller.Done` has been removed +- Function `*InstancesClientCreatePoller.FinalResponse` has been removed +- Function `PublicNetworkAccess.ToPtr` has been removed +- Function `*AccountsClientListByResourceGroupPager.NextPage` has been removed +- Function `AccountsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*InstancesClientDeletePoller.FinalResponse` has been removed +- Function `*InstancesClientCreatePoller.Done` has been removed +- Function `*PrivateEndpointConnectionsClientCreateOrUpdatePoller.Done` has been removed +- Function `*InstancesClientDeletePollerResponse.Resume` has been removed +- Function `AccountsClientCreatePollerResponse.PollUntilDone` has been removed +- Function `*AccountsClientUpdatePoller.FinalResponse` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePoller.FinalResponse` has been removed +- Function `PrivateEndpointConnectionProxiesClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*InstancesClientListByAccountPager.PageResponse` has been removed +- Function `CreatedByType.ToPtr` has been removed +- Function `*InstancesClientCreatePoller.ResumeToken` has been removed +- Function `*AccountsClientDeletePoller.Poll` has been removed +- Function `ActionType.ToPtr` has been removed +- Function `*PrivateEndpointConnectionsClientCreateOrUpdatePoller.Poll` has been removed +- Function `*AccountsClientListBySubscriptionPager.PageResponse` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePoller.Poll` has been removed +- Function `*PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*AccountsClientCreatePoller.Poll` has been removed +- Function `*OperationsClientListPager.NextPage` has been removed +- Function `*PrivateEndpointConnectionProxiesClientDeletePoller.ResumeToken` has been removed +- Function `*AccountsClientUpdatePoller.ResumeToken` has been removed +- Function `*PrivateEndpointConnectionProxiesClientDeletePollerResponse.Resume` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePoller.ResumeToken` has been removed +- Function `*AccountsClientListBySubscriptionPager.NextPage` has been removed +- Function `*PrivateEndpointConnectionsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `AccountsClientUpdatePollerResponse.PollUntilDone` has been removed +- Function `*InstancesClientListByAccountPager.NextPage` has been removed +- Function `*AccountsClientListByResourceGroupPager.Err` has been removed +- Function `*InstancesClientDeletePoller.Poll` has been removed +- Function `Origin.ToPtr` has been removed +- Function `*AccountsClientCreatePollerResponse.Resume` has been removed +- Function `AuthenticationType.ToPtr` has been removed +- Function `*InstancesClientCreatePoller.Poll` has been removed +- Function `PrivateEndpointConnectionProxyProvisioningState.ToPtr` has been removed +- Function `*PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `InstancesClientCreatePollerResponse.PollUntilDone` has been removed +- Function `*OperationsClientListPager.PageResponse` has been removed +- Function `*AccountsClientUpdatePoller.Poll` has been removed +- Function `ManagedServiceIdentityType.ToPtr` has been removed +- Function `*PrivateEndpointConnectionsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*AccountsClientCreatePoller.FinalResponse` has been removed +- Function `*AccountsClientCreatePoller.Done` has been removed +- Function `*PrivateEndpointConnectionProxiesClientDeletePoller.Poll` has been removed +- Function `*PrivateEndpointConnectionProxiesClientDeletePoller.FinalResponse` has been removed +- Function `CheckNameAvailabilityReason.ToPtr` has been removed +- Function `*PrivateEndpointConnectionProxiesClientDeletePoller.Done` has been removed +- Function `*AccountsClientListByResourceGroupPager.PageResponse` has been removed +- Function `ProvisioningState.ToPtr` has been removed +- Function `*PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `InstancesClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*AccountsClientDeletePollerResponse.Resume` has been removed +- Function `*PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller.Done` has been removed +- Function `*PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller.Poll` has been removed +- Function `PrivateEndpointConnectionsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*AccountsClientDeletePoller.Done` has been removed +- Function `*AccountsClientListBySubscriptionPager.Err` has been removed +- Function `*AccountsClientUpdatePoller.Done` has been removed +- Function `PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*AccountsClientCreatePoller.ResumeToken` has been removed +- Function `PrivateEndpointConnectionProvisioningState.ToPtr` has been removed +- Function `*AccountsClientUpdatePollerResponse.Resume` has been removed +- Function `*InstancesClientListByAccountPager.Err` has been removed +- Function `GroupIDProvisioningState.ToPtr` has been removed +- Function `*InstancesClientCreatePollerResponse.Resume` has been removed +- Function `*InstancesClientDeletePoller.ResumeToken` has been removed +- Function `*AccountsClientDeletePoller.FinalResponse` has been removed +- Function `*PrivateEndpointConnectionsClientDeletePollerResponse.Resume` has been removed +- Function `*InstancesClientDeletePoller.Done` has been removed +- Function `*OperationsClientListPager.Err` has been removed +- Function `PrivateEndpointServiceConnectionStatus.ToPtr` has been removed +- Struct `AccountsClientCreatePoller` has been removed +- Struct `AccountsClientCreatePollerResponse` has been removed +- Struct `AccountsClientCreateResult` has been removed +- Struct `AccountsClientDeletePoller` has been removed +- Struct `AccountsClientDeletePollerResponse` has been removed +- Struct `AccountsClientGetResult` has been removed +- Struct `AccountsClientHeadResult` has been removed +- Struct `AccountsClientListByResourceGroupPager` has been removed +- Struct `AccountsClientListByResourceGroupResult` has been removed +- Struct `AccountsClientListBySubscriptionPager` has been removed +- Struct `AccountsClientListBySubscriptionResult` has been removed +- Struct `AccountsClientUpdatePoller` has been removed +- Struct `AccountsClientUpdatePollerResponse` has been removed +- Struct `AccountsClientUpdateResult` has been removed +- Struct `ClientCheckNameAvailabilityResult` has been removed +- Struct `InstancesClientCreatePoller` has been removed +- Struct `InstancesClientCreatePollerResponse` has been removed +- Struct `InstancesClientCreateResult` has been removed +- Struct `InstancesClientDeletePoller` has been removed +- Struct `InstancesClientDeletePollerResponse` has been removed +- Struct `InstancesClientGetResult` has been removed +- Struct `InstancesClientHeadResult` has been removed +- Struct `InstancesClientListByAccountPager` has been removed +- Struct `InstancesClientListByAccountResult` has been removed +- Struct `InstancesClientUpdateResult` has been removed +- Struct `OperationsClientListPager` has been removed +- Struct `OperationsClientListResult` has been removed +- Struct `PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller` has been removed +- Struct `PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse` has been removed +- Struct `PrivateEndpointConnectionProxiesClientCreateOrUpdateResult` has been removed +- Struct `PrivateEndpointConnectionProxiesClientDeletePoller` has been removed +- Struct `PrivateEndpointConnectionProxiesClientDeletePollerResponse` has been removed +- Struct `PrivateEndpointConnectionProxiesClientGetResult` has been removed +- Struct `PrivateEndpointConnectionProxiesClientListByAccountResult` has been removed +- Struct `PrivateEndpointConnectionsClientCreateOrUpdatePoller` has been removed +- Struct `PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse` has been removed +- Struct `PrivateEndpointConnectionsClientCreateOrUpdateResult` has been removed +- Struct `PrivateEndpointConnectionsClientDeletePoller` has been removed +- Struct `PrivateEndpointConnectionsClientDeletePollerResponse` has been removed +- Struct `PrivateEndpointConnectionsClientGetResult` has been removed +- Struct `PrivateEndpointConnectionsClientListByAccountResult` has been removed +- Struct `PrivateLinkResourcesClientGetResult` has been removed +- Struct `PrivateLinkResourcesClientListByAccountResult` has been removed +- Field `RawResponse` of struct `AccountsClientDeleteResponse` has been removed +- Field `AccountsClientListBySubscriptionResult` of struct `AccountsClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `AccountsClientListBySubscriptionResponse` has been removed +- Field `AccountsClientCreateResult` of struct `AccountsClientCreateResponse` has been removed +- Field `RawResponse` of struct `AccountsClientCreateResponse` has been removed +- Field `PrivateEndpointConnectionsClientGetResult` of struct `PrivateEndpointConnectionsClientGetResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientGetResponse` has been removed +- Field `PrivateEndpointConnectionsClientListByAccountResult` of struct `PrivateEndpointConnectionsClientListByAccountResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientListByAccountResponse` has been removed +- Field `ClientCheckNameAvailabilityResult` of struct `ClientCheckNameAvailabilityResponse` has been removed +- Field `RawResponse` of struct `ClientCheckNameAvailabilityResponse` has been removed +- Field `PrivateLinkResourcesClientListByAccountResult` of struct `PrivateLinkResourcesClientListByAccountResponse` has been removed +- Field `RawResponse` of struct `PrivateLinkResourcesClientListByAccountResponse` has been removed +- Field `InstancesClientHeadResult` of struct `InstancesClientHeadResponse` has been removed +- Field `RawResponse` of struct `InstancesClientHeadResponse` has been removed +- Field `ProvisioningState` of struct `PrivateEndpointConnectionProxy` has been removed +- Field `InstancesClientUpdateResult` of struct `InstancesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `InstancesClientUpdateResponse` has been removed +- Field `PrivateEndpointConnectionProxiesClientGetResult` of struct `PrivateEndpointConnectionProxiesClientGetResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionProxiesClientGetResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionProxiesClientDeleteResponse` has been removed +- Field `AccountsClientListByResourceGroupResult` of struct `AccountsClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `AccountsClientListByResourceGroupResponse` has been removed +- Field `AccountsClientGetResult` of struct `AccountsClientGetResponse` has been removed +- Field `RawResponse` of struct `AccountsClientGetResponse` has been removed +- Field `PrivateLinkResourcesClientGetResult` of struct `PrivateLinkResourcesClientGetResponse` has been removed +- Field `RawResponse` of struct `PrivateLinkResourcesClientGetResponse` has been removed +- Field `InstancesClientCreateResult` of struct `InstancesClientCreateResponse` has been removed +- Field `RawResponse` of struct `InstancesClientCreateResponse` has been removed +- Field `PrivateEndpointConnectionsClientCreateOrUpdateResult` of struct `PrivateEndpointConnectionsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionsClientDeleteResponse` has been removed +- Field `PrivateEndpointConnectionProxiesClientCreateOrUpdateResult` of struct `PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse` has been removed +- Field `AccountsClientHeadResult` of struct `AccountsClientHeadResponse` has been removed +- Field `RawResponse` of struct `AccountsClientHeadResponse` has been removed +- Field `InstancesClientListByAccountResult` of struct `InstancesClientListByAccountResponse` has been removed +- Field `RawResponse` of struct `InstancesClientListByAccountResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionProxiesClientValidateResponse` has been removed +- Field `RemotePrivateEndpoint` of struct `PrivateEndpointConnectionProxyProperties` has been removed +- Field `Status` of struct `PrivateEndpointConnectionProxyProperties` has been removed +- Field `ETag` of struct `PrivateEndpointConnectionProxyProperties` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `PrivateEndpointConnectionProxiesClientListByAccountResult` of struct `PrivateEndpointConnectionProxiesClientListByAccountResponse` has been removed +- Field `RawResponse` of struct `PrivateEndpointConnectionProxiesClientListByAccountResponse` has been removed +- Field `RawResponse` of struct `InstancesClientDeleteResponse` has been removed +- Field `InstancesClientGetResult` of struct `InstancesClientGetResponse` has been removed +- Field `RawResponse` of struct `InstancesClientGetResponse` has been removed +- Field `AccountsClientUpdateResult` of struct `AccountsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `AccountsClientUpdateResponse` has been removed + +### Features Added + +- New function `*PrivateEndpointConnectionProxiesClient.UpdatePrivateEndpointProperties(context.Context, string, string, string, PrivateEndpointUpdate, *PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesOptions) (PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse, error)` +- New struct `PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesOptions` +- New struct `PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse` +- New struct `PrivateEndpointConnectionProxyPropertiesAutoGenerated` +- New struct `PrivateEndpointUpdate` +- New anonymous field `Account` in struct `AccountsClientGetResponse` +- New anonymous field `Instance` in struct `InstancesClientUpdateResponse` +- New field `ImmutableResourceID` in struct `RemotePrivateEndpoint` +- New field `ImmutableSubscriptionID` in struct `RemotePrivateEndpoint` +- New field `Location` in struct `RemotePrivateEndpoint` +- New field `ResumeToken` in struct `InstancesClientBeginCreateOptions` +- New field `ResumeToken` in struct `InstancesClientBeginDeleteOptions` +- New field `ResumeToken` in struct `PrivateEndpointConnectionProxiesClientBeginCreateOrUpdateOptions` +- New anonymous field `Account` in struct `AccountsClientUpdateResponse` +- New anonymous field `PrivateLinkResourceListResult` in struct `PrivateLinkResourcesClientListByAccountResponse` +- New anonymous field `PrivateEndpointConnectionProxy` in struct `PrivateEndpointConnectionProxiesClientGetResponse` +- New anonymous field `PrivateEndpointConnectionListResult` in struct `PrivateEndpointConnectionsClientListByAccountResponse` +- New field `Success` in struct `AccountsClientHeadResponse` +- New field `Success` in struct `InstancesClientHeadResponse` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New field `ResumeToken` in struct `AccountsClientBeginDeleteOptions` +- New anonymous field `GroupInformation` in struct `PrivateLinkResourcesClientGetResponse` +- New field `ResumeToken` in struct `AccountsClientBeginUpdateOptions` +- New field `ResumeToken` in struct `PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions` +- New anonymous field `AccountList` in struct `AccountsClientListBySubscriptionResponse` +- New anonymous field `Instance` in struct `InstancesClientGetResponse` +- New anonymous field `PrivateEndpointConnectionProxyListResult` in struct `PrivateEndpointConnectionProxiesClientListByAccountResponse` +- New anonymous field `PrivateEndpointConnection` in struct `PrivateEndpointConnectionsClientCreateOrUpdateResponse` +- New anonymous field `CheckNameAvailabilityResponse` in struct `ClientCheckNameAvailabilityResponse` +- New anonymous field `Instance` in struct `InstancesClientCreateResponse` +- New anonymous field `Account` in struct `AccountsClientCreateResponse` +- New field `ResumeToken` in struct `AccountsClientBeginCreateOptions` +- New anonymous field `PrivateEndpointConnectionProxy` in struct `PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse` +- New field `Properties` in struct `PrivateEndpointConnectionProxy` +- New anonymous field `PrivateEndpointConnection` in struct `PrivateEndpointConnectionsClientGetResponse` +- New field `ResumeToken` in struct `PrivateEndpointConnectionProxiesClientBeginDeleteOptions` +- New anonymous field `AccountList` in struct `AccountsClientListByResourceGroupResponse` +- New anonymous field `InstanceList` in struct `InstancesClientListByAccountResponse` +- New field `ResumeToken` in struct `PrivateEndpointConnectionsClientBeginDeleteOptions` + + ## 0.2.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/README.md b/sdk/resourcemanager/deviceupdate/armdeviceupdate/README.md index 0d58659874a4..bfa7bbaa7171 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/README.md +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/README.md @@ -11,7 +11,7 @@ The `armdeviceupdate` module provides operations for working with Azure Device U ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.16 or above +- Go 1.18 or above ## Install the package @@ -38,16 +38,18 @@ For more information on authentication, please see the documentation for `aziden Azure Device Update 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 := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient(, cred, nil) +client, err := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient(, 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{ - Host: arm.AzureChina, +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, } -client := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient(, cred, &options) +client, err := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient(, cred, &options) ``` ## Provide Feedback diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/autorest.md b/sdk/resourcemanager/deviceupdate/armdeviceupdate/autorest.md index c0874e1b0058..34153f59a3f8 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/autorest.md +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/deviceupdate/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/deviceupdate/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/deviceupdate/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/deviceupdate/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.1 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/go.mod b/sdk/resourcemanager/deviceupdate/armdeviceupdate/go.mod index 2bdf39bb99c2..53d2469481b6 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/go.mod +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/go.mod @@ -1,8 +1,21 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceupdate/armdeviceupdate -go 1.16 +go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect + github.com/golang-jwt/jwt v3.2.1+incompatible // indirect + github.com/google/uuid v1.1.1 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect + golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/go.sum b/sdk/resourcemanager/deviceupdate/armdeviceupdate/go.sum index 2ce51d3b8174..56d1c32628ae 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/go.sum +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/go.sum @@ -1,18 +1,18 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= 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/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -32,21 +32,16 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -56,4 +51,3 @@ 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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_accounts_client_test.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_accounts_client_test.go index 6594c5dcb3ac..58f91cb0947e 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_accounts_client_test.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_accounts_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,157 +19,200 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceupdate/armdeviceupdate" ) -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_List.json func ExampleAccountsClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewAccountsClient("", cred, nil) + client, err := armdeviceupdate.NewAccountsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListBySubscription(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_List.json func ExampleAccountsClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewAccountsClient("", cred, nil) + client, err := armdeviceupdate.NewAccountsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByResourceGroup("", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Get.json func ExampleAccountsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewAccountsClient("", cred, nil) + client, err := armdeviceupdate.NewAccountsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.AccountsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Head.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Head.json func ExampleAccountsClient_Head() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewAccountsClient("", cred, nil) + client, err := armdeviceupdate.NewAccountsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Head(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Create.json func ExampleAccountsClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewAccountsClient("", cred, nil) + client, err := armdeviceupdate.NewAccountsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreate(ctx, "", "", armdeviceupdate.Account{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Properties: &armdeviceupdate.AccountProperties{}, }, - nil) + &armdeviceupdate.AccountsClientBeginCreateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Delete.json func ExampleAccountsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewAccountsClient("", cred, nil) + client, err := armdeviceupdate.NewAccountsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDelete(ctx, "", "", - nil) + &armdeviceupdate.AccountsClientBeginDeleteOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Accounts/Accounts_Update.json func ExampleAccountsClient_BeginUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewAccountsClient("", cred, nil) + client, err := armdeviceupdate.NewAccountsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginUpdate(ctx, "", "", armdeviceupdate.AccountUpdate{ Tags: map[string]*string{ - "tagKey": to.StringPtr("tagValue"), + "tagKey": to.Ptr("tagValue"), }, }, - nil) + &armdeviceupdate.AccountsClientBeginUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.AccountsClientUpdateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_deviceupdate_client_test.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_deviceupdate_client_test.go index 7a173e020c5f..4d7d39355527 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_deviceupdate_client_test.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_deviceupdate_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,22 +17,29 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceupdate/armdeviceupdate" ) -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/CheckNameAvailability_AlreadyExists.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/CheckNameAvailability_AlreadyExists.json func ExampleClient_CheckNameAvailability() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewClient("", cred, nil) + client, err := armdeviceupdate.NewClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CheckNameAvailability(ctx, armdeviceupdate.CheckNameAvailabilityRequest{ - Name: to.StringPtr(""), - Type: to.StringPtr(""), + Name: to.Ptr(""), + Type: to.Ptr(""), }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ClientCheckNameAvailabilityResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_instances_client_test.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_instances_client_test.go index 04a6e084c378..d5c56f3fbd0d 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_instances_client_test.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_instances_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,149 +19,187 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceupdate/armdeviceupdate" ) -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_ListByAccount.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_ListByAccount.json func ExampleInstancesClient_ListByAccount() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewInstancesClient("", cred, nil) + client, err := armdeviceupdate.NewInstancesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByAccount("", "", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Get.json func ExampleInstancesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewInstancesClient("", cred, nil) + client, err := armdeviceupdate.NewInstancesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.InstancesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Head.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Head.json func ExampleInstancesClient_Head() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewInstancesClient("", cred, nil) + client, err := armdeviceupdate.NewInstancesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Head(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Create.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Create.json func ExampleInstancesClient_BeginCreate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewInstancesClient("", cred, nil) + client, err := armdeviceupdate.NewInstancesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreate(ctx, "", "", "", armdeviceupdate.Instance{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Properties: &armdeviceupdate.InstanceProperties{ DiagnosticStorageProperties: &armdeviceupdate.DiagnosticStorageProperties{ - AuthenticationType: armdeviceupdate.AuthenticationType("KeyBased").ToPtr(), - ConnectionString: to.StringPtr(""), - ResourceID: to.StringPtr(""), + AuthenticationType: to.Ptr(armdeviceupdate.AuthenticationTypeKeyBased), + ConnectionString: to.Ptr(""), + ResourceID: to.Ptr(""), }, - EnableDiagnostics: to.BoolPtr(false), + EnableDiagnostics: to.Ptr(false), IotHubs: []*armdeviceupdate.IotHubSettings{ { - EventHubConnectionString: to.StringPtr(""), - IoTHubConnectionString: to.StringPtr(""), - ResourceID: to.StringPtr(""), + EventHubConnectionString: to.Ptr(""), + IoTHubConnectionString: to.Ptr(""), + ResourceID: to.Ptr(""), }}, }, }, - nil) + &armdeviceupdate.InstancesClientBeginCreateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Delete.json func ExampleInstancesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewInstancesClient("", cred, nil) + client, err := armdeviceupdate.NewInstancesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDelete(ctx, "", "", "", - nil) + &armdeviceupdate.InstancesClientBeginDeleteOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Instances/Instances_Update.json func ExampleInstancesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewInstancesClient("", cred, nil) + client, err := armdeviceupdate.NewInstancesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", "", armdeviceupdate.TagUpdate{ Tags: map[string]*string{ - "tagKey": to.StringPtr("tagValue"), + "tagKey": to.Ptr("tagValue"), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.InstancesClientUpdateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_operations_client_test.go index 9d5561869cfa..dd0f832eabbe 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_operations_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,25 +16,29 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceupdate/armdeviceupdate" ) -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Operations_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/Operations_List.json func ExampleOperationsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewOperationsClient(cred, nil) + client, err := armdeviceupdate.NewOperationsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privateendpointconnectionproxies_client_test.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privateendpointconnectionproxies_client_test.go index 7c12816e885c..1ff9fc0a2b17 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privateendpointconnectionproxies_client_test.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privateendpointconnectionproxies_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,135 +19,210 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceupdate/armdeviceupdate" ) -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_ListByAccount.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_ListByAccount.json func ExamplePrivateEndpointConnectionProxiesClient_ListByAccount() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) - res, err := client.ListByAccount(ctx, - "", + client, err := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } + pager := client.ListByAccount("", "", nil) - if err != nil { - log.Fatal(err) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + return + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionProxiesClientListByAccountResult) } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_Validate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_Validate.json func ExamplePrivateEndpointConnectionProxiesClient_Validate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + client, err := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Validate(ctx, "", "", "", armdeviceupdate.PrivateEndpointConnectionProxy{ RemotePrivateEndpoint: &armdeviceupdate.RemotePrivateEndpoint{ - ID: to.StringPtr(""), + ID: to.Ptr(""), + ImmutableResourceID: to.Ptr(""), + ImmutableSubscriptionID: to.Ptr(""), + Location: to.Ptr(""), ManualPrivateLinkServiceConnections: []*armdeviceupdate.PrivateLinkServiceConnection{ { - Name: to.StringPtr(""), + Name: to.Ptr(""), GroupIDs: []*string{ - to.StringPtr("DeviceUpdate")}, - RequestMessage: to.StringPtr(""), + to.Ptr("DeviceUpdate")}, + RequestMessage: to.Ptr(""), }}, PrivateLinkServiceProxies: []*armdeviceupdate.PrivateLinkServiceProxy{ { GroupConnectivityInformation: []*armdeviceupdate.GroupConnectivityInformation{}, - ID: to.StringPtr(""), + ID: to.Ptr(""), }}, }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return + } +} + +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_PrivateEndpointUpdate.json +func ExamplePrivateEndpointConnectionProxiesClient_UpdatePrivateEndpointProperties() { + cred, err := azidentity.NewDefaultAzureCredential(nil) + if err != nil { + log.Fatalf("failed to obtain a credential: %v", err) + return + } + ctx := context.Background() + client, err := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } + _, err = client.UpdatePrivateEndpointProperties(ctx, + "", + "", + "", + armdeviceupdate.PrivateEndpointUpdate{ + ID: to.Ptr(""), + ImmutableResourceID: to.Ptr(""), + ImmutableSubscriptionID: to.Ptr(""), + Location: to.Ptr(""), + VnetTrafficTag: to.Ptr(""), + }, + nil) + if err != nil { + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_Get.json func ExamplePrivateEndpointConnectionProxiesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + client, err := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionProxiesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_CreateOrUpdate.json func ExamplePrivateEndpointConnectionProxiesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + client, err := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", "", armdeviceupdate.PrivateEndpointConnectionProxy{ RemotePrivateEndpoint: &armdeviceupdate.RemotePrivateEndpoint{ - ID: to.StringPtr(""), + ID: to.Ptr(""), + ImmutableResourceID: to.Ptr(""), + ImmutableSubscriptionID: to.Ptr(""), + Location: to.Ptr(""), ManualPrivateLinkServiceConnections: []*armdeviceupdate.PrivateLinkServiceConnection{ { - Name: to.StringPtr(""), + Name: to.Ptr(""), GroupIDs: []*string{ - to.StringPtr("DeviceUpdate")}, - RequestMessage: to.StringPtr(""), + to.Ptr("DeviceUpdate")}, + RequestMessage: to.Ptr(""), }}, PrivateLinkServiceProxies: []*armdeviceupdate.PrivateLinkServiceProxy{ { GroupConnectivityInformation: []*armdeviceupdate.GroupConnectivityInformation{}, - ID: to.StringPtr(""), + ID: to.Ptr(""), }}, }, }, - nil) + &armdeviceupdate.PrivateEndpointConnectionProxiesClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnectionProxies/PrivateEndpointConnectionProxy_Delete.json func ExamplePrivateEndpointConnectionProxiesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + client, err := armdeviceupdate.NewPrivateEndpointConnectionProxiesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDelete(ctx, "", "", "", - nil) + &armdeviceupdate.PrivateEndpointConnectionProxiesClientBeginDeleteOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privateendpointconnections_client_test.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privateendpointconnections_client_test.go index 93b7e50cbd8b..56bc789d8501 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privateendpointconnections_client_test.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privateendpointconnections_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,51 +19,74 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceupdate/armdeviceupdate" ) -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnections/PrivateEndpointConnection_ListByAccount.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnections/PrivateEndpointConnection_ListByAccount.json func ExamplePrivateEndpointConnectionsClient_ListByAccount() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionsClient("", cred, nil) - res, err := client.ListByAccount(ctx, - "", + client, err := armdeviceupdate.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } + pager := client.ListByAccount("", "", nil) - if err != nil { - log.Fatal(err) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + return + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientListByAccountResult) } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnections/PrivateEndpointConnection_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnections/PrivateEndpointConnection_Get.json func ExamplePrivateEndpointConnectionsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdeviceupdate.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PrivateEndpointConnectionsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnections/PrivateEndpointConnection_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnections/PrivateEndpointConnection_CreateOrUpdate.json func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdeviceupdate.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", @@ -71,39 +94,48 @@ func ExamplePrivateEndpointConnectionsClient_BeginCreateOrUpdate() { armdeviceupdate.PrivateEndpointConnection{ Properties: &armdeviceupdate.PrivateEndpointConnectionProperties{ PrivateLinkServiceConnectionState: &armdeviceupdate.PrivateLinkServiceConnectionState{ - Description: to.StringPtr(""), - Status: armdeviceupdate.PrivateEndpointServiceConnectionStatus("Approved").ToPtr(), + Description: to.Ptr(""), + Status: to.Ptr(armdeviceupdate.PrivateEndpointServiceConnectionStatusApproved), }, }, }, - nil) + &armdeviceupdate.PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnections/PrivateEndpointConnection_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateEndpointConnections/PrivateEndpointConnection_Delete.json func ExamplePrivateEndpointConnectionsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateEndpointConnectionsClient("", cred, nil) + client, err := armdeviceupdate.NewPrivateEndpointConnectionsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDelete(ctx, "", "", "", - nil) + &armdeviceupdate.PrivateEndpointConnectionsClientBeginDeleteOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privatelinkresources_client_test.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privatelinkresources_client_test.go index 0c547c10c6a8..90b918bfcd02 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privatelinkresources_client_test.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/ze_generated_example_privatelinkresources_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,39 +16,57 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/deviceupdate/armdeviceupdate" ) -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateLinkResources/PrivateLinkResources_ListByAccount.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateLinkResources/PrivateLinkResources_ListByAccount.json func ExamplePrivateLinkResourcesClient_ListByAccount() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateLinkResourcesClient("", cred, nil) - res, err := client.ListByAccount(ctx, - "", + client, err := armdeviceupdate.NewPrivateLinkResourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } + pager := client.ListByAccount("", "", nil) - if err != nil { - log.Fatal(err) + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { + log.Fatalf("failed to advance page: %v", err) + return + } + for _, v := range nextResult.Value { + // TODO: use page item + _ = v + } } - log.Printf("Response result: %#v\n", res.PrivateLinkResourcesClientListByAccountResult) } -// x-ms-original-file: specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateLinkResources/PrivateLinkResources_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/deviceupdate/resource-manager/Microsoft.DeviceUpdate/preview/2020-03-01-preview/examples/PrivateLinkResources/PrivateLinkResources_Get.json func ExamplePrivateLinkResourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdeviceupdate.NewPrivateLinkResourcesClient("", cred, nil) + client, err := armdeviceupdate.NewPrivateLinkResourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PrivateLinkResourcesClientGetResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_accounts_client.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_accounts_client.go index 9f903c4fb921..44e6cd1f27c2 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_accounts_client.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_accounts_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type AccountsClient struct { // subscriptionID - The Azure subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *AccountsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*AccountsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &AccountsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreate - Creates or updates Account. @@ -55,22 +60,18 @@ func NewAccountsClient(subscriptionID string, credential azcore.TokenCredential, // accountName - Account name. // account - Account details. // options - AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method. -func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, account Account, options *AccountsClientBeginCreateOptions) (AccountsClientCreatePollerResponse, error) { - resp, err := client.create(ctx, resourceGroupName, accountName, account, options) - if err != nil { - return AccountsClientCreatePollerResponse{}, err - } - result := AccountsClientCreatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("AccountsClient.Create", "azure-async-operation", resp, client.pl) - if err != nil { - return AccountsClientCreatePollerResponse{}, err - } - result.Poller = &AccountsClientCreatePoller{ - pt: pt, +func (client *AccountsClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, account Account, options *AccountsClientBeginCreateOptions) (*armruntime.Poller[AccountsClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, accountName, account, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[AccountsClientCreateResponse]{ + FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + }) + } else { + return armruntime.NewPollerFromResumeToken[AccountsClientCreateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Create - Creates or updates Account. @@ -121,22 +122,18 @@ func (client *AccountsClient) createCreateRequest(ctx context.Context, resourceG // resourceGroupName - The resource group name. // accountName - Account name. // options - AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. -func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (AccountsClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, options) - if err != nil { - return AccountsClientDeletePollerResponse{}, err - } - result := AccountsClientDeletePollerResponse{ - RawResponse: resp, +func (client *AccountsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, options *AccountsClientBeginDeleteOptions) (*armruntime.Poller[AccountsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[AccountsClientDeleteResponse]{ + FinalStateVia: armruntime.FinalStateViaLocation, + }) + } else { + return armruntime.NewPollerFromResumeToken[AccountsClientDeleteResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("AccountsClient.Delete", "location", resp, client.pl) - if err != nil { - return AccountsClientDeletePollerResponse{}, err - } - result.Poller = &AccountsClientDeletePoller{ - pt: pt, - } - return result, nil } // Delete - Deletes account. @@ -230,7 +227,7 @@ func (client *AccountsClient) getCreateRequest(ctx context.Context, resourceGrou // getHandleResponse handles the Get response. func (client *AccountsClient) getHandleResponse(resp *http.Response) (AccountsClientGetResponse, error) { - result := AccountsClientGetResponse{RawResponse: resp} + result := AccountsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Account); err != nil { return AccountsClientGetResponse{}, err } @@ -250,7 +247,7 @@ func (client *AccountsClient) Head(ctx context.Context, resourceGroupName string if err != nil { return AccountsClientHeadResponse{}, err } - result := AccountsClientHeadResponse{RawResponse: resp} + result := AccountsClientHeadResponse{} if resp.StatusCode >= 200 && resp.StatusCode < 300 { result.Success = true } @@ -288,16 +285,32 @@ func (client *AccountsClient) headCreateRequest(ctx context.Context, resourceGro // resourceGroupName - The resource group name. // options - AccountsClientListByResourceGroupOptions contains the optional parameters for the AccountsClient.ListByResourceGroup // method. -func (client *AccountsClient) ListByResourceGroup(resourceGroupName string, options *AccountsClientListByResourceGroupOptions) *AccountsClientListByResourceGroupPager { - return &AccountsClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *AccountsClient) ListByResourceGroup(resourceGroupName string, options *AccountsClientListByResourceGroupOptions) *runtime.Pager[AccountsClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[AccountsClientListByResourceGroupResponse]{ + More: func(page AccountsClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AccountsClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AccountList.NextLink) + Fetcher: func(ctx context.Context, page *AccountsClientListByResourceGroupResponse) (AccountsClientListByResourceGroupResponse, 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 AccountsClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AccountsClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AccountsClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -324,7 +337,7 @@ func (client *AccountsClient) listByResourceGroupCreateRequest(ctx context.Conte // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Response) (AccountsClientListByResourceGroupResponse, error) { - result := AccountsClientListByResourceGroupResponse{RawResponse: resp} + result := AccountsClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AccountList); err != nil { return AccountsClientListByResourceGroupResponse{}, err } @@ -335,16 +348,32 @@ func (client *AccountsClient) listByResourceGroupHandleResponse(resp *http.Respo // If the operation fails it returns an *azcore.ResponseError type. // options - AccountsClientListBySubscriptionOptions contains the optional parameters for the AccountsClient.ListBySubscription // method. -func (client *AccountsClient) ListBySubscription(options *AccountsClientListBySubscriptionOptions) *AccountsClientListBySubscriptionPager { - return &AccountsClientListBySubscriptionPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) +func (client *AccountsClient) ListBySubscription(options *AccountsClientListBySubscriptionOptions) *runtime.Pager[AccountsClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PageProcessor[AccountsClientListBySubscriptionResponse]{ + More: func(page AccountsClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp AccountsClientListBySubscriptionResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.AccountList.NextLink) + Fetcher: func(ctx context.Context, page *AccountsClientListBySubscriptionResponse) (AccountsClientListBySubscriptionResponse, 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 AccountsClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return AccountsClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return AccountsClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) }, - } + }) } // listBySubscriptionCreateRequest creates the ListBySubscription request. @@ -367,7 +396,7 @@ func (client *AccountsClient) listBySubscriptionCreateRequest(ctx context.Contex // listBySubscriptionHandleResponse handles the ListBySubscription response. func (client *AccountsClient) listBySubscriptionHandleResponse(resp *http.Response) (AccountsClientListBySubscriptionResponse, error) { - result := AccountsClientListBySubscriptionResponse{RawResponse: resp} + result := AccountsClientListBySubscriptionResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.AccountList); err != nil { return AccountsClientListBySubscriptionResponse{}, err } @@ -380,22 +409,18 @@ func (client *AccountsClient) listBySubscriptionHandleResponse(resp *http.Respon // accountName - Account name. // accountUpdatePayload - Updated Account. // options - AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. -func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, accountUpdatePayload AccountUpdate, options *AccountsClientBeginUpdateOptions) (AccountsClientUpdatePollerResponse, error) { - resp, err := client.update(ctx, resourceGroupName, accountName, accountUpdatePayload, options) - if err != nil { - return AccountsClientUpdatePollerResponse{}, err +func (client *AccountsClient) BeginUpdate(ctx context.Context, resourceGroupName string, accountName string, accountUpdatePayload AccountUpdate, options *AccountsClientBeginUpdateOptions) (*armruntime.Poller[AccountsClientUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.update(ctx, resourceGroupName, accountName, accountUpdatePayload, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[AccountsClientUpdateResponse]{ + FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + }) + } else { + return armruntime.NewPollerFromResumeToken[AccountsClientUpdateResponse](options.ResumeToken, client.pl, nil) } - result := AccountsClientUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("AccountsClient.Update", "azure-async-operation", resp, client.pl) - if err != nil { - return AccountsClientUpdatePollerResponse{}, err - } - result.Poller = &AccountsClientUpdatePoller{ - pt: pt, - } - return result, nil } // Update - Updates account's patchable properties diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_client.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_client.go index 79bd8a77e55e..0502e5823ee9 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_client.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type Client struct { // subscriptionID - The Azure subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *Client { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*Client, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &Client{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // CheckNameAvailability - Checks ADU resource name availability. @@ -88,7 +93,7 @@ func (client *Client) checkNameAvailabilityCreateRequest(ctx context.Context, re // checkNameAvailabilityHandleResponse handles the CheckNameAvailability response. func (client *Client) checkNameAvailabilityHandleResponse(resp *http.Response) (ClientCheckNameAvailabilityResponse, error) { - result := ClientCheckNameAvailabilityResponse{RawResponse: resp} + result := ClientCheckNameAvailabilityResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.CheckNameAvailabilityResponse); err != nil { return ClientCheckNameAvailabilityResponse{}, err } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_constants.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_constants.go index 96a247169d1b..9f27a7bd6474 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_constants.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -10,7 +10,7 @@ package armdeviceupdate const ( moduleName = "armdeviceupdate" - moduleVersion = "v0.2.1" + moduleVersion = "v0.3.0" ) // ActionType - Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. @@ -27,11 +27,6 @@ func PossibleActionTypeValues() []ActionType { } } -// ToPtr returns a *ActionType pointing to the current value. -func (c ActionType) ToPtr() *ActionType { - return &c -} - // AuthenticationType - Authentication Type type AuthenticationType string @@ -46,11 +41,6 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { } } -// ToPtr returns a *AuthenticationType pointing to the current value. -func (c AuthenticationType) ToPtr() *AuthenticationType { - return &c -} - // CheckNameAvailabilityReason - The reason why the given name is not available. type CheckNameAvailabilityReason string @@ -67,11 +57,6 @@ func PossibleCheckNameAvailabilityReasonValues() []CheckNameAvailabilityReason { } } -// ToPtr returns a *CheckNameAvailabilityReason pointing to the current value. -func (c CheckNameAvailabilityReason) ToPtr() *CheckNameAvailabilityReason { - return &c -} - // CreatedByType - The type of identity that created the resource. type CreatedByType string @@ -92,11 +77,6 @@ func PossibleCreatedByTypeValues() []CreatedByType { } } -// ToPtr returns a *CreatedByType pointing to the current value. -func (c CreatedByType) ToPtr() *CreatedByType { - return &c -} - // GroupIDProvisioningState - The provisioning state of private link group ID. type GroupIDProvisioningState string @@ -115,11 +95,6 @@ func PossibleGroupIDProvisioningStateValues() []GroupIDProvisioningState { } } -// ToPtr returns a *GroupIDProvisioningState pointing to the current value. -func (c GroupIDProvisioningState) ToPtr() *GroupIDProvisioningState { - return &c -} - // ManagedServiceIdentityType - Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). type ManagedServiceIdentityType string @@ -140,11 +115,6 @@ func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { } } -// ToPtr returns a *ManagedServiceIdentityType pointing to the current value. -func (c ManagedServiceIdentityType) ToPtr() *ManagedServiceIdentityType { - return &c -} - // Origin - The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default // value is "user,system" type Origin string @@ -164,11 +134,6 @@ func PossibleOriginValues() []Origin { } } -// ToPtr returns a *Origin pointing to the current value. -func (c Origin) ToPtr() *Origin { - return &c -} - // PrivateEndpointConnectionProvisioningState - The current provisioning state. type PrivateEndpointConnectionProvisioningState string @@ -189,11 +154,6 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin } } -// ToPtr returns a *PrivateEndpointConnectionProvisioningState pointing to the current value. -func (c PrivateEndpointConnectionProvisioningState) ToPtr() *PrivateEndpointConnectionProvisioningState { - return &c -} - // PrivateEndpointConnectionProxyProvisioningState - The current provisioning state. type PrivateEndpointConnectionProxyProvisioningState string @@ -214,11 +174,6 @@ func PossiblePrivateEndpointConnectionProxyProvisioningStateValues() []PrivateEn } } -// ToPtr returns a *PrivateEndpointConnectionProxyProvisioningState pointing to the current value. -func (c PrivateEndpointConnectionProxyProvisioningState) ToPtr() *PrivateEndpointConnectionProxyProvisioningState { - return &c -} - // PrivateEndpointServiceConnectionStatus - The private endpoint connection status. type PrivateEndpointServiceConnectionStatus string @@ -237,11 +192,6 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer } } -// ToPtr returns a *PrivateEndpointServiceConnectionStatus pointing to the current value. -func (c PrivateEndpointServiceConnectionStatus) ToPtr() *PrivateEndpointServiceConnectionStatus { - return &c -} - // ProvisioningState - Provisioning state. type ProvisioningState string @@ -266,11 +216,6 @@ func PossibleProvisioningStateValues() []ProvisioningState { } } -// ToPtr returns a *ProvisioningState pointing to the current value. -func (c ProvisioningState) ToPtr() *ProvisioningState { - return &c -} - // PublicNetworkAccess - Whether or not public network access is allowed for the account. type PublicNetworkAccess string @@ -286,8 +231,3 @@ func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { PublicNetworkAccessEnabled, } } - -// ToPtr returns a *PublicNetworkAccess pointing to the current value. -func (c PublicNetworkAccess) ToPtr() *PublicNetworkAccess { - return &c -} diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_instances_client.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_instances_client.go index e22c7a67ae36..86ec55336b79 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_instances_client.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_instances_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type InstancesClient struct { // subscriptionID - The Azure subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *InstancesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewInstancesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*InstancesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &InstancesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreate - Creates or updates instance. @@ -56,22 +61,18 @@ func NewInstancesClient(subscriptionID string, credential azcore.TokenCredential // instanceName - Instance name. // instance - Instance details. // options - InstancesClientBeginCreateOptions contains the optional parameters for the InstancesClient.BeginCreate method. -func (client *InstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, instanceName string, instance Instance, options *InstancesClientBeginCreateOptions) (InstancesClientCreatePollerResponse, error) { - resp, err := client.create(ctx, resourceGroupName, accountName, instanceName, instance, options) - if err != nil { - return InstancesClientCreatePollerResponse{}, err - } - result := InstancesClientCreatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("InstancesClient.Create", "azure-async-operation", resp, client.pl) - if err != nil { - return InstancesClientCreatePollerResponse{}, err - } - result.Poller = &InstancesClientCreatePoller{ - pt: pt, +func (client *InstancesClient) BeginCreate(ctx context.Context, resourceGroupName string, accountName string, instanceName string, instance Instance, options *InstancesClientBeginCreateOptions) (*armruntime.Poller[InstancesClientCreateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.create(ctx, resourceGroupName, accountName, instanceName, instance, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[InstancesClientCreateResponse]{ + FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + }) + } else { + return armruntime.NewPollerFromResumeToken[InstancesClientCreateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Create - Creates or updates instance. @@ -127,22 +128,18 @@ func (client *InstancesClient) createCreateRequest(ctx context.Context, resource // accountName - Account name. // instanceName - Instance name. // options - InstancesClientBeginDeleteOptions contains the optional parameters for the InstancesClient.BeginDelete method. -func (client *InstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, instanceName string, options *InstancesClientBeginDeleteOptions) (InstancesClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, instanceName, options) - if err != nil { - return InstancesClientDeletePollerResponse{}, err - } - result := InstancesClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("InstancesClient.Delete", "location", resp, client.pl) - if err != nil { - return InstancesClientDeletePollerResponse{}, err - } - result.Poller = &InstancesClientDeletePoller{ - pt: pt, +func (client *InstancesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, instanceName string, options *InstancesClientBeginDeleteOptions) (*armruntime.Poller[InstancesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, instanceName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[InstancesClientDeleteResponse]{ + FinalStateVia: armruntime.FinalStateViaLocation, + }) + } else { + return armruntime.NewPollerFromResumeToken[InstancesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes instance. @@ -245,7 +242,7 @@ func (client *InstancesClient) getCreateRequest(ctx context.Context, resourceGro // getHandleResponse handles the Get response. func (client *InstancesClient) getHandleResponse(resp *http.Response) (InstancesClientGetResponse, error) { - result := InstancesClientGetResponse{RawResponse: resp} + result := InstancesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Instance); err != nil { return InstancesClientGetResponse{}, err } @@ -266,7 +263,7 @@ func (client *InstancesClient) Head(ctx context.Context, resourceGroupName strin if err != nil { return InstancesClientHeadResponse{}, err } - result := InstancesClientHeadResponse{RawResponse: resp} + result := InstancesClientHeadResponse{} if resp.StatusCode >= 200 && resp.StatusCode < 300 { result.Success = true } @@ -308,16 +305,32 @@ func (client *InstancesClient) headCreateRequest(ctx context.Context, resourceGr // resourceGroupName - The resource group name. // accountName - Account name. // options - InstancesClientListByAccountOptions contains the optional parameters for the InstancesClient.ListByAccount method. -func (client *InstancesClient) ListByAccount(resourceGroupName string, accountName string, options *InstancesClientListByAccountOptions) *InstancesClientListByAccountPager { - return &InstancesClientListByAccountPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) +func (client *InstancesClient) ListByAccount(resourceGroupName string, accountName string, options *InstancesClientListByAccountOptions) *runtime.Pager[InstancesClientListByAccountResponse] { + return runtime.NewPager(runtime.PageProcessor[InstancesClientListByAccountResponse]{ + More: func(page InstancesClientListByAccountResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp InstancesClientListByAccountResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.InstanceList.NextLink) + Fetcher: func(ctx context.Context, page *InstancesClientListByAccountResponse) (InstancesClientListByAccountResponse, error) { + var req *policy.Request + var err error + if page == nil { + req, err = client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) + } else { + req, err = runtime.NewRequest(ctx, http.MethodGet, *page.NextLink) + } + if err != nil { + return InstancesClientListByAccountResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return InstancesClientListByAccountResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return InstancesClientListByAccountResponse{}, runtime.NewResponseError(resp) + } + return client.listByAccountHandleResponse(resp) }, - } + }) } // listByAccountCreateRequest creates the ListByAccount request. @@ -348,7 +361,7 @@ func (client *InstancesClient) listByAccountCreateRequest(ctx context.Context, r // listByAccountHandleResponse handles the ListByAccount response. func (client *InstancesClient) listByAccountHandleResponse(resp *http.Response) (InstancesClientListByAccountResponse, error) { - result := InstancesClientListByAccountResponse{RawResponse: resp} + result := InstancesClientListByAccountResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.InstanceList); err != nil { return InstancesClientListByAccountResponse{}, err } @@ -409,7 +422,7 @@ func (client *InstancesClient) updateCreateRequest(ctx context.Context, resource // updateHandleResponse handles the Update response. func (client *InstancesClient) updateHandleResponse(resp *http.Response) (InstancesClientUpdateResponse, error) { - result := InstancesClientUpdateResponse{RawResponse: resp} + result := InstancesClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Instance); err != nil { return InstancesClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_models.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_models.go index d9011c981360..5695ef72fc00 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_models.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,12 +8,7 @@ package armdeviceupdate -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" - "time" -) +import "time" // Account - Device Update account details. type Account struct { @@ -42,20 +37,6 @@ type Account struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Account. -func (a Account) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - 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, "systemData", a.SystemData) - populate(objectMap, "tags", a.Tags) - populate(objectMap, "type", a.Type) - return json.Marshal(objectMap) -} - // AccountList - List of Accounts. type AccountList struct { // The link used to get the next page of Accounts list. @@ -65,14 +46,6 @@ type AccountList struct { Value []*Account `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AccountList. -func (a AccountList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", a.NextLink) - populate(objectMap, "value", a.Value) - return json.Marshal(objectMap) -} - // AccountProperties - Device Update account properties. type AccountProperties struct { // List of private endpoint connections associated with the account. @@ -88,16 +61,6 @@ type AccountProperties struct { ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type AccountProperties. -func (a AccountProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "hostName", a.HostName) - populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) - populate(objectMap, "provisioningState", a.ProvisioningState) - populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess) - return json.Marshal(objectMap) -} - // AccountUpdate - Request payload used to update and existing Accounts. type AccountUpdate struct { // The type of identity used for the resource. @@ -110,28 +73,22 @@ type AccountUpdate struct { Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type AccountUpdate. -func (a AccountUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "identity", a.Identity) - populate(objectMap, "location", a.Location) - populate(objectMap, "tags", a.Tags) - return json.Marshal(objectMap) -} - // AccountsClientBeginCreateOptions contains the optional parameters for the AccountsClient.BeginCreate method. type AccountsClientBeginCreateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // AccountsClientBeginDeleteOptions contains the optional parameters for the AccountsClient.BeginDelete method. type AccountsClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // AccountsClientBeginUpdateOptions contains the optional parameters for the AccountsClient.BeginUpdate method. type AccountsClientBeginUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // AccountsClientGetOptions contains the optional parameters for the AccountsClient.Get method. @@ -213,7 +170,7 @@ type DiagnosticStorageProperties struct { // ErrorAdditionalInfo - The resource management error additional info. type ErrorAdditionalInfo struct { // READ-ONLY; The additional info. - Info map[string]interface{} `json:"info,omitempty" azure:"ro"` + Info interface{} `json:"info,omitempty" azure:"ro"` // READ-ONLY; The additional info type. Type *string `json:"type,omitempty" azure:"ro"` @@ -237,17 +194,6 @@ type ErrorDetail struct { Target *string `json:"target,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. -func (e ErrorDetail) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "additionalInfo", e.AdditionalInfo) - populate(objectMap, "code", e.Code) - populate(objectMap, "details", e.Details) - populate(objectMap, "message", e.Message) - populate(objectMap, "target", e.Target) - return json.Marshal(objectMap) -} - // ErrorResponse - Common error response for all Azure Resource Manager APIs to return error details for failed operations. // (This also follows the OData error response format.). type ErrorResponse struct { @@ -276,18 +222,6 @@ type GroupConnectivityInformation struct { MemberName *string `json:"memberName,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type GroupConnectivityInformation. -func (g GroupConnectivityInformation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "customerVisibleFqdns", g.CustomerVisibleFqdns) - populate(objectMap, "groupId", g.GroupID) - populate(objectMap, "internalFqdn", g.InternalFqdn) - populate(objectMap, "memberName", g.MemberName) - populate(objectMap, "privateLinkServiceArmRegion", g.PrivateLinkServiceArmRegion) - populate(objectMap, "redirectMapId", g.RedirectMapID) - return json.Marshal(objectMap) -} - // GroupInformation - The group information for creating a private endpoint on an Account type GroupInformation struct { // REQUIRED; The properties for a group information object @@ -321,16 +255,6 @@ type GroupInformationProperties struct { RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type GroupInformationProperties. -func (g GroupInformationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", g.GroupID) - populate(objectMap, "provisioningState", g.ProvisioningState) - populate(objectMap, "requiredMembers", g.RequiredMembers) - populate(objectMap, "requiredZoneNames", g.RequiredZoneNames) - return json.Marshal(objectMap) -} - // Instance - Device Update instance details. type Instance struct { // REQUIRED; The geo-location where the resource lives @@ -355,19 +279,6 @@ type Instance struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Instance. -func (i Instance) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", i.ID) - populate(objectMap, "location", i.Location) - populate(objectMap, "name", i.Name) - populate(objectMap, "properties", i.Properties) - populate(objectMap, "systemData", i.SystemData) - populate(objectMap, "tags", i.Tags) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - // InstanceList - List of Instances. type InstanceList struct { // The link used to get the next page of Instances list. @@ -377,14 +288,6 @@ type InstanceList struct { Value []*Instance `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type InstanceList. -func (i InstanceList) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", i.NextLink) - populate(objectMap, "value", i.Value) - return json.Marshal(objectMap) -} - // InstanceProperties - Device Update instance properties. type InstanceProperties struct { // Customer-initiated diagnostic log collection storage properties @@ -403,25 +306,16 @@ type InstanceProperties struct { ProvisioningState *ProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type InstanceProperties. -func (i InstanceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "accountName", i.AccountName) - populate(objectMap, "diagnosticStorageProperties", i.DiagnosticStorageProperties) - populate(objectMap, "enableDiagnostics", i.EnableDiagnostics) - populate(objectMap, "iotHubs", i.IotHubs) - populate(objectMap, "provisioningState", i.ProvisioningState) - return json.Marshal(objectMap) -} - // InstancesClientBeginCreateOptions contains the optional parameters for the InstancesClient.BeginCreate method. type InstancesClientBeginCreateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // InstancesClientBeginDeleteOptions contains the optional parameters for the InstancesClient.BeginDelete method. type InstancesClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // InstancesClientGetOptions contains the optional parameters for the InstancesClient.Get method. @@ -476,16 +370,6 @@ type ManagedServiceIdentity struct { TenantID *string `json:"tenantId,omitempty" azure:"ro"` } -// 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) -} - // Operation - Details of a REST API operation, returned from the Resource Provider Operations API type Operation struct { // Localized display information for this particular operation. @@ -535,14 +419,6 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty" azure:"ro"` } -// 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) -} - // OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -578,13 +454,6 @@ type PrivateEndpointConnectionListResult struct { Value []*PrivateEndpointConnection `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. -func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PrivateEndpointConnectionProperties - Properties of the PrivateEndpointConnectProperties. type PrivateEndpointConnectionProperties struct { // REQUIRED; A collection of information about the state of the connection between service consumer and provider. @@ -600,26 +469,18 @@ type PrivateEndpointConnectionProperties struct { ProvisioningState *PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. -func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "privateEndpoint", p.PrivateEndpoint) - populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) - populate(objectMap, "provisioningState", p.ProvisioningState) - return json.Marshal(objectMap) -} - // PrivateEndpointConnectionProxiesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionProxiesClient.BeginCreateOrUpdate // method. type PrivateEndpointConnectionProxiesClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // PrivateEndpointConnectionProxiesClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionProxiesClient.BeginDelete // method. type PrivateEndpointConnectionProxiesClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // PrivateEndpointConnectionProxiesClientGetOptions contains the optional parameters for the PrivateEndpointConnectionProxiesClient.Get @@ -634,6 +495,12 @@ type PrivateEndpointConnectionProxiesClientListByAccountOptions struct { // placeholder for future optional parameters } +// PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesOptions contains the optional parameters for the PrivateEndpointConnectionProxiesClient.UpdatePrivateEndpointProperties +// method. +type PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesOptions struct { + // placeholder for future optional parameters +} + // PrivateEndpointConnectionProxiesClientValidateOptions contains the optional parameters for the PrivateEndpointConnectionProxiesClient.Validate // method. type PrivateEndpointConnectionProxiesClientValidateOptions struct { @@ -642,6 +509,9 @@ type PrivateEndpointConnectionProxiesClientValidateOptions struct { // PrivateEndpointConnectionProxy - Private endpoint connection proxy details. type PrivateEndpointConnectionProxy struct { + // Private endpoint connection proxy object property bag. + Properties *PrivateEndpointConnectionProxyProperties `json:"properties,omitempty"` + // Remote private endpoint details. RemotePrivateEndpoint *RemotePrivateEndpoint `json:"remotePrivateEndpoint,omitempty"` @@ -657,9 +527,6 @@ type PrivateEndpointConnectionProxy struct { // READ-ONLY; The name of the resource Name *string `json:"name,omitempty" azure:"ro"` - // READ-ONLY; The provisioning state of the private endpoint connection proxy resource. - ProvisioningState *PrivateEndpointConnectionProxyProvisioningState `json:"provisioningState,omitempty" azure:"ro"` - // READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty" azure:"ro"` @@ -677,16 +544,14 @@ type PrivateEndpointConnectionProxyListResult struct { Value []*PrivateEndpointConnectionProxy `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProxyListResult. -func (p PrivateEndpointConnectionProxyListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) +// PrivateEndpointConnectionProxyProperties - Private endpoint connection proxy object property bag. +type PrivateEndpointConnectionProxyProperties struct { + // READ-ONLY; The provisioning state of the private endpoint connection proxy resource. + ProvisioningState *PrivateEndpointConnectionProxyProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } -// PrivateEndpointConnectionProxyProperties - Private endpoint connection proxy object properties. -type PrivateEndpointConnectionProxyProperties struct { +// PrivateEndpointConnectionProxyPropertiesAutoGenerated - Private endpoint connection proxy object properties. +type PrivateEndpointConnectionProxyPropertiesAutoGenerated struct { // Remote private endpoint details. RemotePrivateEndpoint *RemotePrivateEndpoint `json:"remotePrivateEndpoint,omitempty"` @@ -695,21 +560,20 @@ type PrivateEndpointConnectionProxyProperties struct { // READ-ONLY; ETag from NRP. ETag *string `json:"eTag,omitempty" azure:"ro"` - - // READ-ONLY; The provisioning state of the private endpoint connection proxy resource. - ProvisioningState *PrivateEndpointConnectionProxyProvisioningState `json:"provisioningState,omitempty" azure:"ro"` } // PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate // method. type PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. type PrivateEndpointConnectionsClientBeginDeleteOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // PrivateEndpointConnectionsClientGetOptions contains the optional parameters for the PrivateEndpointConnectionsClient.Get @@ -724,6 +588,24 @@ type PrivateEndpointConnectionsClientListByAccountOptions struct { // placeholder for future optional parameters } +// PrivateEndpointUpdate - Private endpoint update details. +type PrivateEndpointUpdate struct { + // Remote endpoint resource ID. + ID *string `json:"id,omitempty"` + + // Original resource ID needed by Microsoft.Network. + ImmutableResourceID *string `json:"immutableResourceId,omitempty"` + + // Original subscription ID needed by Microsoft.Network. + ImmutableSubscriptionID *string `json:"immutableSubscriptionId,omitempty"` + + // ARM location of the remote private endpoint. + Location *string `json:"location,omitempty"` + + // Virtual network traffic tag. + VnetTrafficTag *string `json:"vnetTrafficTag,omitempty"` +} + // PrivateLinkResourceListResult - The available private link resources for an Account type PrivateLinkResourceListResult struct { // The URI that can be used to request the next list of private link resources. @@ -733,14 +615,6 @@ type PrivateLinkResourceListResult struct { Value []*GroupInformation `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. -func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PrivateLinkResourceProperties - Properties of a private link resource. type PrivateLinkResourceProperties struct { // The private link resource Private link DNS zone name. @@ -753,15 +627,6 @@ type PrivateLinkResourceProperties struct { RequiredMembers []*string `json:"requiredMembers,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. -func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupId", p.GroupID) - populate(objectMap, "requiredMembers", p.RequiredMembers) - populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) - return json.Marshal(objectMap) -} - // PrivateLinkResourcesClientGetOptions contains the optional parameters for the PrivateLinkResourcesClient.Get method. type PrivateLinkResourcesClientGetOptions struct { // placeholder for future optional parameters @@ -785,15 +650,6 @@ type PrivateLinkServiceConnection struct { RequestMessage *string `json:"requestMessage,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnection. -func (p PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupIds", p.GroupIDs) - populate(objectMap, "name", p.Name) - populate(objectMap, "requestMessage", p.RequestMessage) - return json.Marshal(objectMap) -} - // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer // and provider. type PrivateLinkServiceConnectionState struct { @@ -822,16 +678,6 @@ type PrivateLinkServiceProxy struct { RemotePrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"remotePrivateLinkServiceConnectionState,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceProxy. -func (p PrivateLinkServiceProxy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "groupConnectivityInformation", p.GroupConnectivityInformation) - populate(objectMap, "id", p.ID) - populate(objectMap, "remotePrivateEndpointConnection", p.RemotePrivateEndpointConnection) - populate(objectMap, "remotePrivateLinkServiceConnectionState", p.RemotePrivateLinkServiceConnectionState) - return json.Marshal(objectMap) -} - // PrivateLinkServiceProxyRemotePrivateEndpointConnection - Remote private endpoint connection details. type PrivateLinkServiceProxyRemotePrivateEndpointConnection struct { // READ-ONLY; Remote private endpoint connection ID. @@ -862,6 +708,15 @@ type RemotePrivateEndpoint struct { // Remote endpoint resource ID. ID *string `json:"id,omitempty"` + // Original resource ID needed by Microsoft.Network. + ImmutableResourceID *string `json:"immutableResourceId,omitempty"` + + // Original subscription ID needed by Microsoft.Network. + ImmutableSubscriptionID *string `json:"immutableSubscriptionId,omitempty"` + + // ARM location of the remote private endpoint. + Location *string `json:"location,omitempty"` + // List of private link service connections that need manual approval. ManualPrivateLinkServiceConnections []*PrivateLinkServiceConnection `json:"manualPrivateLinkServiceConnections,omitempty"` @@ -871,20 +726,8 @@ type RemotePrivateEndpoint struct { // List of private link service proxies. PrivateLinkServiceProxies []*PrivateLinkServiceProxy `json:"privateLinkServiceProxies,omitempty"` - // READ-ONLY; Virtual network traffic tag. - VnetTrafficTag *string `json:"vnetTrafficTag,omitempty" azure:"ro"` -} - -// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpoint. -func (r RemotePrivateEndpoint) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "connectionDetails", r.ConnectionDetails) - populate(objectMap, "id", r.ID) - populate(objectMap, "manualPrivateLinkServiceConnections", r.ManualPrivateLinkServiceConnections) - populate(objectMap, "privateLinkServiceConnections", r.PrivateLinkServiceConnections) - populate(objectMap, "privateLinkServiceProxies", r.PrivateLinkServiceProxies) - populate(objectMap, "vnetTrafficTag", r.VnetTrafficTag) - return json.Marshal(objectMap) + // Virtual network traffic tag. + VnetTrafficTag *string `json:"vnetTrafficTag,omitempty"` } // RemotePrivateEndpointConnection - Remote private endpoint connection details. @@ -929,66 +772,12 @@ type SystemData struct { LastModifiedByType *CreatedByType `json:"lastModifiedByType,omitempty"` } -// 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 err - } - for key, val := range rawMsg { - var err error - switch key { - case "createdAt": - err = unpopulateTimeRFC3339(val, &s.CreatedAt) - delete(rawMsg, key) - case "createdBy": - err = unpopulate(val, &s.CreatedBy) - delete(rawMsg, key) - case "createdByType": - err = unpopulate(val, &s.CreatedByType) - delete(rawMsg, key) - case "lastModifiedAt": - err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) - delete(rawMsg, key) - case "lastModifiedBy": - err = unpopulate(val, &s.LastModifiedBy) - delete(rawMsg, key) - case "lastModifiedByType": - err = unpopulate(val, &s.LastModifiedByType) - delete(rawMsg, key) - } - if err != nil { - return err - } - } - return nil -} - // TagUpdate - Request payload used to update an existing resource's tags. type TagUpdate struct { // List of key value pairs that describe the resource. This will overwrite the existing tags. Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type TagUpdate. -func (t TagUpdate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", t.Tags) - return json.Marshal(objectMap) -} - // TrackedResource - The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' // and a 'location' type TrackedResource struct { @@ -1011,18 +800,6 @@ type TrackedResource struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type TrackedResource. -func (t TrackedResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", t.ID) - populate(objectMap, "location", t.Location) - populate(objectMap, "name", t.Name) - populate(objectMap, "systemData", t.SystemData) - populate(objectMap, "tags", t.Tags) - populate(objectMap, "type", t.Type) - return json.Marshal(objectMap) -} - // UserAssignedIdentity - User assigned identity properties type UserAssignedIdentity struct { // READ-ONLY; The client ID of the assigned identity. @@ -1031,20 +808,3 @@ type UserAssignedIdentity struct { // READ-ONLY; The principal ID of the assigned identity. PrincipalID *string `json:"principalId,omitempty" azure:"ro"` } - -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, v interface{}) error { - if data == nil { - return nil - } - return json.Unmarshal(data, v) -} diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_models_serde.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_models_serde.go new file mode 100644 index 000000000000..05a7a73aca97 --- /dev/null +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_models_serde.go @@ -0,0 +1,298 @@ +//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 armdeviceupdate + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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, "systemData", a.SystemData) + populate(objectMap, "tags", a.Tags) + populate(objectMap, "type", a.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AccountList. +func (a AccountList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", a.NextLink) + populate(objectMap, "value", a.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AccountProperties. +func (a AccountProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "hostName", a.HostName) + populate(objectMap, "privateEndpointConnections", a.PrivateEndpointConnections) + populate(objectMap, "provisioningState", a.ProvisioningState) + populate(objectMap, "publicNetworkAccess", a.PublicNetworkAccess) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type AccountUpdate. +func (a AccountUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "identity", a.Identity) + populate(objectMap, "location", a.Location) + populate(objectMap, "tags", a.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type ErrorDetail. +func (e ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "additionalInfo", e.AdditionalInfo) + populate(objectMap, "code", e.Code) + populate(objectMap, "details", e.Details) + populate(objectMap, "message", e.Message) + populate(objectMap, "target", e.Target) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GroupConnectivityInformation. +func (g GroupConnectivityInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "customerVisibleFqdns", g.CustomerVisibleFqdns) + populate(objectMap, "groupId", g.GroupID) + populate(objectMap, "internalFqdn", g.InternalFqdn) + populate(objectMap, "memberName", g.MemberName) + populate(objectMap, "privateLinkServiceArmRegion", g.PrivateLinkServiceArmRegion) + populate(objectMap, "redirectMapId", g.RedirectMapID) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type GroupInformationProperties. +func (g GroupInformationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", g.GroupID) + populate(objectMap, "provisioningState", g.ProvisioningState) + populate(objectMap, "requiredMembers", g.RequiredMembers) + populate(objectMap, "requiredZoneNames", g.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type Instance. +func (i Instance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", i.ID) + populate(objectMap, "location", i.Location) + populate(objectMap, "name", i.Name) + populate(objectMap, "properties", i.Properties) + populate(objectMap, "systemData", i.SystemData) + populate(objectMap, "tags", i.Tags) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceList. +func (i InstanceList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", i.NextLink) + populate(objectMap, "value", i.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InstanceProperties. +func (i InstanceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "accountName", i.AccountName) + populate(objectMap, "diagnosticStorageProperties", i.DiagnosticStorageProperties) + populate(objectMap, "enableDiagnostics", i.EnableDiagnostics) + populate(objectMap, "iotHubs", i.IotHubs) + populate(objectMap, "provisioningState", i.ProvisioningState) + return json.Marshal(objectMap) +} + +// 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) +} + +// 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) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionListResult. +func (p PrivateEndpointConnectionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProperties. +func (p PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "privateEndpoint", p.PrivateEndpoint) + populate(objectMap, "privateLinkServiceConnectionState", p.PrivateLinkServiceConnectionState) + populate(objectMap, "provisioningState", p.ProvisioningState) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateEndpointConnectionProxyListResult. +func (p PrivateEndpointConnectionProxyListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceListResult. +func (p PrivateLinkResourceListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkResourceProperties. +func (p PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupId", p.GroupID) + populate(objectMap, "requiredMembers", p.RequiredMembers) + populate(objectMap, "requiredZoneNames", p.RequiredZoneNames) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceConnection. +func (p PrivateLinkServiceConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupIds", p.GroupIDs) + populate(objectMap, "name", p.Name) + populate(objectMap, "requestMessage", p.RequestMessage) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PrivateLinkServiceProxy. +func (p PrivateLinkServiceProxy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "groupConnectivityInformation", p.GroupConnectivityInformation) + populate(objectMap, "id", p.ID) + populate(objectMap, "remotePrivateEndpointConnection", p.RemotePrivateEndpointConnection) + populate(objectMap, "remotePrivateLinkServiceConnectionState", p.RemotePrivateLinkServiceConnectionState) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type RemotePrivateEndpoint. +func (r RemotePrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "connectionDetails", r.ConnectionDetails) + populate(objectMap, "id", r.ID) + populate(objectMap, "immutableResourceId", r.ImmutableResourceID) + populate(objectMap, "immutableSubscriptionId", r.ImmutableSubscriptionID) + populate(objectMap, "location", r.Location) + populate(objectMap, "manualPrivateLinkServiceConnections", r.ManualPrivateLinkServiceConnections) + populate(objectMap, "privateLinkServiceConnections", r.PrivateLinkServiceConnections) + populate(objectMap, "privateLinkServiceProxies", r.PrivateLinkServiceProxies) + populate(objectMap, "vnetTrafficTag", r.VnetTrafficTag) + return json.Marshal(objectMap) +} + +// 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 err + } + for key, val := range rawMsg { + var err error + switch key { + case "createdAt": + err = unpopulateTimeRFC3339(val, &s.CreatedAt) + delete(rawMsg, key) + case "createdBy": + err = unpopulate(val, &s.CreatedBy) + delete(rawMsg, key) + case "createdByType": + err = unpopulate(val, &s.CreatedByType) + delete(rawMsg, key) + case "lastModifiedAt": + err = unpopulateTimeRFC3339(val, &s.LastModifiedAt) + delete(rawMsg, key) + case "lastModifiedBy": + err = unpopulate(val, &s.LastModifiedBy) + delete(rawMsg, key) + case "lastModifiedByType": + err = unpopulate(val, &s.LastModifiedByType) + delete(rawMsg, key) + } + if err != nil { + return err + } + } + return nil +} + +// MarshalJSON implements the json.Marshaller interface for type TagUpdate. +func (t TagUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "tags", t.Tags) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type TrackedResource. +func (t TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", t.ID) + populate(objectMap, "location", t.Location) + populate(objectMap, "name", t.Name) + populate(objectMap, "systemData", t.SystemData) + populate(objectMap, "tags", t.Tags) + populate(objectMap, "type", t.Type) + return json.Marshal(objectMap) +} + +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, v interface{}) error { + if data == nil { + return nil + } + return json.Unmarshal(data, v) +} diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_operations_client.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_operations_client.go index 71aefb7bb895..2e1ec221efec 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_operations_client.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -13,6 +13,7 @@ import ( "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" @@ -28,34 +29,54 @@ type OperationsClient struct { // 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 { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - Returns list of operations for Microsoft.DeviceUpdate resource provider. // If the operation fails it returns an *azcore.ResponseError type. // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager { - return &OperationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *OperationsClient) List(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp OperationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OperationListResult.NextLink) + 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. @@ -74,7 +95,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_pagers.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_pagers.go deleted file mode 100644 index 63fa41fe668b..000000000000 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_pagers.go +++ /dev/null @@ -1,233 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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 armdeviceupdate - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// AccountsClientListByResourceGroupPager provides operations for iterating over paged responses. -type AccountsClientListByResourceGroupPager struct { - client *AccountsClient - current AccountsClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AccountsClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AccountsClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AccountsClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AccountList.NextLink == nil || len(*p.current.AccountList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AccountsClientListByResourceGroupResponse page. -func (p *AccountsClientListByResourceGroupPager) PageResponse() AccountsClientListByResourceGroupResponse { - return p.current -} - -// AccountsClientListBySubscriptionPager provides operations for iterating over paged responses. -type AccountsClientListBySubscriptionPager struct { - client *AccountsClient - current AccountsClientListBySubscriptionResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, AccountsClientListBySubscriptionResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *AccountsClientListBySubscriptionPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *AccountsClientListBySubscriptionPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.AccountList.NextLink == nil || len(*p.current.AccountList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listBySubscriptionHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current AccountsClientListBySubscriptionResponse page. -func (p *AccountsClientListBySubscriptionPager) PageResponse() AccountsClientListBySubscriptionResponse { - return p.current -} - -// InstancesClientListByAccountPager provides operations for iterating over paged responses. -type InstancesClientListByAccountPager struct { - client *InstancesClient - current InstancesClientListByAccountResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, InstancesClientListByAccountResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *InstancesClientListByAccountPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *InstancesClientListByAccountPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.InstanceList.NextLink == nil || len(*p.current.InstanceList.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByAccountHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current InstancesClientListByAccountResponse page. -func (p *InstancesClientListByAccountPager) PageResponse() InstancesClientListByAccountResponse { - return p.current -} - -// OperationsClientListPager provides operations for iterating over paged responses. -type OperationsClientListPager struct { - client *OperationsClient - current OperationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OperationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *OperationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *OperationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OperationListResult.NextLink == nil || len(*p.current.OperationListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current OperationsClientListResponse page. -func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse { - return p.current -} diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_pollers.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_pollers.go deleted file mode 100644 index fbbcf21a00c3..000000000000 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_pollers.go +++ /dev/null @@ -1,402 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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 armdeviceupdate - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "net/http" -) - -// AccountsClientCreatePoller provides polling facilities until the operation reaches a terminal state. -type AccountsClientCreatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *AccountsClientCreatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *AccountsClientCreatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final AccountsClientCreateResponse will be returned. -func (p *AccountsClientCreatePoller) FinalResponse(ctx context.Context) (AccountsClientCreateResponse, error) { - respType := AccountsClientCreateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.Account) - if err != nil { - return AccountsClientCreateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *AccountsClientCreatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// AccountsClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type AccountsClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *AccountsClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *AccountsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final AccountsClientDeleteResponse will be returned. -func (p *AccountsClientDeletePoller) FinalResponse(ctx context.Context) (AccountsClientDeleteResponse, error) { - respType := AccountsClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return AccountsClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *AccountsClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// AccountsClientUpdatePoller provides polling facilities until the operation reaches a terminal state. -type AccountsClientUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *AccountsClientUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *AccountsClientUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final AccountsClientUpdateResponse will be returned. -func (p *AccountsClientUpdatePoller) FinalResponse(ctx context.Context) (AccountsClientUpdateResponse, error) { - respType := AccountsClientUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.Account) - if err != nil { - return AccountsClientUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *AccountsClientUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// InstancesClientCreatePoller provides polling facilities until the operation reaches a terminal state. -type InstancesClientCreatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *InstancesClientCreatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *InstancesClientCreatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final InstancesClientCreateResponse will be returned. -func (p *InstancesClientCreatePoller) FinalResponse(ctx context.Context) (InstancesClientCreateResponse, error) { - respType := InstancesClientCreateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.Instance) - if err != nil { - return InstancesClientCreateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *InstancesClientCreatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// InstancesClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type InstancesClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *InstancesClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *InstancesClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final InstancesClientDeleteResponse will be returned. -func (p *InstancesClientDeletePoller) FinalResponse(ctx context.Context) (InstancesClientDeleteResponse, error) { - respType := InstancesClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return InstancesClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *InstancesClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse will be returned. -func (p *PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse, error) { - respType := PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.PrivateEndpointConnectionProxy) - if err != nil { - return PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// PrivateEndpointConnectionProxiesClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type PrivateEndpointConnectionProxiesClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *PrivateEndpointConnectionProxiesClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *PrivateEndpointConnectionProxiesClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final PrivateEndpointConnectionProxiesClientDeleteResponse will be returned. -func (p *PrivateEndpointConnectionProxiesClientDeletePoller) FinalResponse(ctx context.Context) (PrivateEndpointConnectionProxiesClientDeleteResponse, error) { - respType := PrivateEndpointConnectionProxiesClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return PrivateEndpointConnectionProxiesClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *PrivateEndpointConnectionProxiesClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// PrivateEndpointConnectionsClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type PrivateEndpointConnectionsClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *PrivateEndpointConnectionsClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *PrivateEndpointConnectionsClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final PrivateEndpointConnectionsClientCreateOrUpdateResponse will be returned. -func (p *PrivateEndpointConnectionsClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { - respType := PrivateEndpointConnectionsClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.PrivateEndpointConnection) - if err != nil { - return PrivateEndpointConnectionsClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *PrivateEndpointConnectionsClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} - -// PrivateEndpointConnectionsClientDeletePoller provides polling facilities until the operation reaches a terminal state. -type PrivateEndpointConnectionsClientDeletePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *PrivateEndpointConnectionsClientDeletePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *PrivateEndpointConnectionsClientDeletePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final PrivateEndpointConnectionsClientDeleteResponse will be returned. -func (p *PrivateEndpointConnectionsClientDeletePoller) FinalResponse(ctx context.Context) (PrivateEndpointConnectionsClientDeleteResponse, error) { - respType := PrivateEndpointConnectionsClientDeleteResponse{} - resp, err := p.pt.FinalResponse(ctx, nil) - if err != nil { - return PrivateEndpointConnectionsClientDeleteResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *PrivateEndpointConnectionsClientDeletePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privateendpointconnectionproxies_client.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privateendpointconnectionproxies_client.go index 29de9a7321d9..f454eefaf526 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privateendpointconnectionproxies_client.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privateendpointconnectionproxies_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type PrivateEndpointConnectionProxiesClient struct { // subscriptionID - The Azure subscription ID. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewPrivateEndpointConnectionProxiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PrivateEndpointConnectionProxiesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPrivateEndpointConnectionProxiesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionProxiesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &PrivateEndpointConnectionProxiesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - (INTERNAL - DO NOT USE) Creates or updates the specified private endpoint connection proxy resource @@ -58,22 +63,18 @@ func NewPrivateEndpointConnectionProxiesClient(subscriptionID string, credential // privateEndpointConnectionProxy - The parameters for creating a private endpoint connection proxy. // options - PrivateEndpointConnectionProxiesClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionProxiesClient.BeginCreateOrUpdate // method. -func (client *PrivateEndpointConnectionProxiesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionProxyID string, privateEndpointConnectionProxy PrivateEndpointConnectionProxy, options *PrivateEndpointConnectionProxiesClientBeginCreateOrUpdateOptions) (PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, privateEndpointConnectionProxyID, privateEndpointConnectionProxy, options) - if err != nil { - return PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse{}, err - } - result := PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("PrivateEndpointConnectionProxiesClient.CreateOrUpdate", "azure-async-operation", resp, client.pl) - if err != nil { - return PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller{ - pt: pt, +func (client *PrivateEndpointConnectionProxiesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionProxyID string, privateEndpointConnectionProxy PrivateEndpointConnectionProxy, options *PrivateEndpointConnectionProxiesClientBeginCreateOrUpdateOptions) (*armruntime.Poller[PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, privateEndpointConnectionProxyID, privateEndpointConnectionProxy, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse]{ + FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + }) + } else { + return armruntime.NewPollerFromResumeToken[PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - (INTERNAL - DO NOT USE) Creates or updates the specified private endpoint connection proxy resource associated @@ -132,22 +133,18 @@ func (client *PrivateEndpointConnectionProxiesClient) createOrUpdateCreateReques // privateEndpointConnectionProxyID - The ID of the private endpoint connection proxy object. // options - PrivateEndpointConnectionProxiesClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionProxiesClient.BeginDelete // method. -func (client *PrivateEndpointConnectionProxiesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionProxyID string, options *PrivateEndpointConnectionProxiesClientBeginDeleteOptions) (PrivateEndpointConnectionProxiesClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, privateEndpointConnectionProxyID, options) - if err != nil { - return PrivateEndpointConnectionProxiesClientDeletePollerResponse{}, err - } - result := PrivateEndpointConnectionProxiesClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("PrivateEndpointConnectionProxiesClient.Delete", "location", resp, client.pl) - if err != nil { - return PrivateEndpointConnectionProxiesClientDeletePollerResponse{}, err - } - result.Poller = &PrivateEndpointConnectionProxiesClientDeletePoller{ - pt: pt, +func (client *PrivateEndpointConnectionProxiesClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionProxyID string, options *PrivateEndpointConnectionProxiesClientBeginDeleteOptions) (*armruntime.Poller[PrivateEndpointConnectionProxiesClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, privateEndpointConnectionProxyID, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[PrivateEndpointConnectionProxiesClientDeleteResponse]{ + FinalStateVia: armruntime.FinalStateViaLocation, + }) + } else { + return armruntime.NewPollerFromResumeToken[PrivateEndpointConnectionProxiesClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - (INTERNAL - DO NOT USE) Deletes the specified private endpoint connection proxy associated with the device update @@ -252,7 +249,7 @@ func (client *PrivateEndpointConnectionProxiesClient) getCreateRequest(ctx conte // getHandleResponse handles the Get response. func (client *PrivateEndpointConnectionProxiesClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionProxiesClientGetResponse, error) { - result := PrivateEndpointConnectionProxiesClientGetResponse{RawResponse: resp} + result := PrivateEndpointConnectionProxiesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionProxy); err != nil { return PrivateEndpointConnectionProxiesClientGetResponse{}, err } @@ -265,19 +262,26 @@ func (client *PrivateEndpointConnectionProxiesClient) getHandleResponse(resp *ht // accountName - Account name. // options - PrivateEndpointConnectionProxiesClientListByAccountOptions contains the optional parameters for the PrivateEndpointConnectionProxiesClient.ListByAccount // method. -func (client *PrivateEndpointConnectionProxiesClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionProxiesClientListByAccountOptions) (PrivateEndpointConnectionProxiesClientListByAccountResponse, error) { - req, err := client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) - if err != nil { - return PrivateEndpointConnectionProxiesClientListByAccountResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionProxiesClientListByAccountResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionProxiesClientListByAccountResponse{}, runtime.NewResponseError(resp) - } - return client.listByAccountHandleResponse(resp) +func (client *PrivateEndpointConnectionProxiesClient) ListByAccount(resourceGroupName string, accountName string, options *PrivateEndpointConnectionProxiesClientListByAccountOptions) *runtime.Pager[PrivateEndpointConnectionProxiesClientListByAccountResponse] { + return runtime.NewPager(runtime.PageProcessor[PrivateEndpointConnectionProxiesClientListByAccountResponse]{ + More: func(page PrivateEndpointConnectionProxiesClientListByAccountResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionProxiesClientListByAccountResponse) (PrivateEndpointConnectionProxiesClientListByAccountResponse, error) { + req, err := client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return PrivateEndpointConnectionProxiesClientListByAccountResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionProxiesClientListByAccountResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionProxiesClientListByAccountResponse{}, runtime.NewResponseError(resp) + } + return client.listByAccountHandleResponse(resp) + }, + }) } // listByAccountCreateRequest creates the ListByAccount request. @@ -308,13 +312,67 @@ func (client *PrivateEndpointConnectionProxiesClient) listByAccountCreateRequest // listByAccountHandleResponse handles the ListByAccount response. func (client *PrivateEndpointConnectionProxiesClient) listByAccountHandleResponse(resp *http.Response) (PrivateEndpointConnectionProxiesClientListByAccountResponse, error) { - result := PrivateEndpointConnectionProxiesClientListByAccountResponse{RawResponse: resp} + result := PrivateEndpointConnectionProxiesClientListByAccountResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionProxyListResult); err != nil { return PrivateEndpointConnectionProxiesClientListByAccountResponse{}, err } return result, nil } +// UpdatePrivateEndpointProperties - (INTERNAL - DO NOT USE) Updates a private endpoint inside the private endpoint connection +// proxy object. +// If the operation fails it returns an *azcore.ResponseError type. +// resourceGroupName - The resource group name. +// accountName - Account name. +// privateEndpointConnectionProxyID - The ID of the private endpoint connection proxy object. +// privateEndpointUpdate - The parameters for updating a private endpoint connection proxy. +// options - PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesOptions contains the optional parameters +// for the PrivateEndpointConnectionProxiesClient.UpdatePrivateEndpointProperties method. +func (client *PrivateEndpointConnectionProxiesClient) UpdatePrivateEndpointProperties(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionProxyID string, privateEndpointUpdate PrivateEndpointUpdate, options *PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesOptions) (PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse, error) { + req, err := client.updatePrivateEndpointPropertiesCreateRequest(ctx, resourceGroupName, accountName, privateEndpointConnectionProxyID, privateEndpointUpdate, options) + if err != nil { + return PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse{}, runtime.NewResponseError(resp) + } + return PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse{}, nil +} + +// updatePrivateEndpointPropertiesCreateRequest creates the UpdatePrivateEndpointProperties request. +func (client *PrivateEndpointConnectionProxiesClient) updatePrivateEndpointPropertiesCreateRequest(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionProxyID string, privateEndpointUpdate PrivateEndpointUpdate, options *PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesOptions) (*policy.Request, error) { + urlPath := "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DeviceUpdate/accounts/{accountName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyId}/updatePrivateEndpointProperties" + 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 accountName == "" { + return nil, errors.New("parameter accountName cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{accountName}", url.PathEscape(accountName)) + if privateEndpointConnectionProxyID == "" { + return nil, errors.New("parameter privateEndpointConnectionProxyID cannot be empty") + } + urlPath = strings.ReplaceAll(urlPath, "{privateEndpointConnectionProxyId}", url.PathEscape(privateEndpointConnectionProxyID)) + 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", "2020-03-01-preview") + req.Raw().URL.RawQuery = reqQP.Encode() + req.Raw().Header.Set("Accept", "application/json") + return req, runtime.MarshalAsJSON(req, privateEndpointUpdate) +} + // Validate - (INTERNAL - DO NOT USE) Validates a private endpoint connection proxy object. // If the operation fails it returns an *azcore.ResponseError type. // resourceGroupName - The resource group name. @@ -335,7 +393,7 @@ func (client *PrivateEndpointConnectionProxiesClient) Validate(ctx context.Conte if !runtime.HasStatusCode(resp, http.StatusOK) { return PrivateEndpointConnectionProxiesClientValidateResponse{}, runtime.NewResponseError(resp) } - return PrivateEndpointConnectionProxiesClientValidateResponse{RawResponse: resp}, nil + return PrivateEndpointConnectionProxiesClientValidateResponse{}, nil } // validateCreateRequest creates the Validate request. diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privateendpointconnections_client.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privateendpointconnections_client.go index 727f5d75d93d..c8e0c7b77eb1 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privateendpointconnections_client.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privateendpointconnections_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type PrivateEndpointConnectionsClient struct { // subscriptionID - The Azure subscription ID. // 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 { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateEndpointConnectionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &PrivateEndpointConnectionsClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Update the state of specified private endpoint connection associated with the device update account. @@ -57,22 +62,18 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string, credential azcor // privateEndpointConnection - The parameters for creating a private endpoint connection. // options - PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginCreateOrUpdate // method. -func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, privateEndpointConnectionName, privateEndpointConnection, options) - if err != nil { - return PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse{}, err - } - result := PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("PrivateEndpointConnectionsClient.CreateOrUpdate", "azure-async-operation", resp, client.pl) - if err != nil { - return PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &PrivateEndpointConnectionsClientCreateOrUpdatePoller{ - pt: pt, +func (client *PrivateEndpointConnectionsClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection, options *PrivateEndpointConnectionsClientBeginCreateOrUpdateOptions) (*armruntime.Poller[PrivateEndpointConnectionsClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, accountName, privateEndpointConnectionName, privateEndpointConnection, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[PrivateEndpointConnectionsClientCreateOrUpdateResponse]{ + FinalStateVia: armruntime.FinalStateViaAzureAsyncOp, + }) + } else { + return armruntime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // CreateOrUpdate - Update the state of specified private endpoint connection associated with the device update account. @@ -129,22 +130,18 @@ func (client *PrivateEndpointConnectionsClient) createOrUpdateCreateRequest(ctx // privateEndpointConnectionName - The name of the private endpoint connection associated with the Azure resource // options - PrivateEndpointConnectionsClientBeginDeleteOptions contains the optional parameters for the PrivateEndpointConnectionsClient.BeginDelete // method. -func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (PrivateEndpointConnectionsClientDeletePollerResponse, error) { - resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options) - if err != nil { - return PrivateEndpointConnectionsClientDeletePollerResponse{}, err - } - result := PrivateEndpointConnectionsClientDeletePollerResponse{ - RawResponse: resp, - } - pt, err := armruntime.NewPoller("PrivateEndpointConnectionsClient.Delete", "location", resp, client.pl) - if err != nil { - return PrivateEndpointConnectionsClientDeletePollerResponse{}, err - } - result.Poller = &PrivateEndpointConnectionsClientDeletePoller{ - pt: pt, +func (client *PrivateEndpointConnectionsClient) BeginDelete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, options *PrivateEndpointConnectionsClientBeginDeleteOptions) (*armruntime.Poller[PrivateEndpointConnectionsClientDeleteResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.deleteOperation(ctx, resourceGroupName, accountName, privateEndpointConnectionName, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller(resp, client.pl, &armruntime.NewPollerOptions[PrivateEndpointConnectionsClientDeleteResponse]{ + FinalStateVia: armruntime.FinalStateViaLocation, + }) + } else { + return armruntime.NewPollerFromResumeToken[PrivateEndpointConnectionsClientDeleteResponse](options.ResumeToken, client.pl, nil) } - return result, nil } // Delete - Deletes the specified private endpoint connection associated with the device update account. @@ -248,7 +245,7 @@ func (client *PrivateEndpointConnectionsClient) getCreateRequest(ctx context.Con // getHandleResponse handles the Get response. func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientGetResponse, error) { - result := PrivateEndpointConnectionsClientGetResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnection); err != nil { return PrivateEndpointConnectionsClientGetResponse{}, err } @@ -261,19 +258,26 @@ func (client *PrivateEndpointConnectionsClient) getHandleResponse(resp *http.Res // accountName - Account name. // options - PrivateEndpointConnectionsClientListByAccountOptions contains the optional parameters for the PrivateEndpointConnectionsClient.ListByAccount // method. -func (client *PrivateEndpointConnectionsClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListByAccountOptions) (PrivateEndpointConnectionsClientListByAccountResponse, error) { - req, err := client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) - if err != nil { - return PrivateEndpointConnectionsClientListByAccountResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateEndpointConnectionsClientListByAccountResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateEndpointConnectionsClientListByAccountResponse{}, runtime.NewResponseError(resp) - } - return client.listByAccountHandleResponse(resp) +func (client *PrivateEndpointConnectionsClient) ListByAccount(resourceGroupName string, accountName string, options *PrivateEndpointConnectionsClientListByAccountOptions) *runtime.Pager[PrivateEndpointConnectionsClientListByAccountResponse] { + return runtime.NewPager(runtime.PageProcessor[PrivateEndpointConnectionsClientListByAccountResponse]{ + More: func(page PrivateEndpointConnectionsClientListByAccountResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateEndpointConnectionsClientListByAccountResponse) (PrivateEndpointConnectionsClientListByAccountResponse, error) { + req, err := client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return PrivateEndpointConnectionsClientListByAccountResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateEndpointConnectionsClientListByAccountResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateEndpointConnectionsClientListByAccountResponse{}, runtime.NewResponseError(resp) + } + return client.listByAccountHandleResponse(resp) + }, + }) } // listByAccountCreateRequest creates the ListByAccount request. @@ -304,7 +308,7 @@ func (client *PrivateEndpointConnectionsClient) listByAccountCreateRequest(ctx c // listByAccountHandleResponse handles the ListByAccount response. func (client *PrivateEndpointConnectionsClient) listByAccountHandleResponse(resp *http.Response) (PrivateEndpointConnectionsClientListByAccountResponse, error) { - result := PrivateEndpointConnectionsClientListByAccountResponse{RawResponse: resp} + result := PrivateEndpointConnectionsClientListByAccountResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateEndpointConnectionListResult); err != nil { return PrivateEndpointConnectionsClientListByAccountResponse{}, err } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privatelinkresources_client.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privatelinkresources_client.go index e1e1770429f6..da5c646b512b 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privatelinkresources_client.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_privatelinkresources_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type PrivateLinkResourcesClient struct { // subscriptionID - The Azure subscription ID. // 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 { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPrivateLinkResourcesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PrivateLinkResourcesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &PrivateLinkResourcesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // Get - Get the specified private link resource associated with the device update account. @@ -103,7 +108,7 @@ func (client *PrivateLinkResourcesClient) getCreateRequest(ctx context.Context, // getHandleResponse handles the Get response. func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) (PrivateLinkResourcesClientGetResponse, error) { - result := PrivateLinkResourcesClientGetResponse{RawResponse: resp} + result := PrivateLinkResourcesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.GroupInformation); err != nil { return PrivateLinkResourcesClientGetResponse{}, err } @@ -116,19 +121,26 @@ func (client *PrivateLinkResourcesClient) getHandleResponse(resp *http.Response) // accountName - Account name. // options - PrivateLinkResourcesClientListByAccountOptions contains the optional parameters for the PrivateLinkResourcesClient.ListByAccount // method. -func (client *PrivateLinkResourcesClient) ListByAccount(ctx context.Context, resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListByAccountOptions) (PrivateLinkResourcesClientListByAccountResponse, error) { - req, err := client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) - if err != nil { - return PrivateLinkResourcesClientListByAccountResponse{}, err - } - resp, err := client.pl.Do(req) - if err != nil { - return PrivateLinkResourcesClientListByAccountResponse{}, err - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - return PrivateLinkResourcesClientListByAccountResponse{}, runtime.NewResponseError(resp) - } - return client.listByAccountHandleResponse(resp) +func (client *PrivateLinkResourcesClient) ListByAccount(resourceGroupName string, accountName string, options *PrivateLinkResourcesClientListByAccountOptions) *runtime.Pager[PrivateLinkResourcesClientListByAccountResponse] { + return runtime.NewPager(runtime.PageProcessor[PrivateLinkResourcesClientListByAccountResponse]{ + More: func(page PrivateLinkResourcesClientListByAccountResponse) bool { + return false + }, + Fetcher: func(ctx context.Context, page *PrivateLinkResourcesClientListByAccountResponse) (PrivateLinkResourcesClientListByAccountResponse, error) { + req, err := client.listByAccountCreateRequest(ctx, resourceGroupName, accountName, options) + if err != nil { + return PrivateLinkResourcesClientListByAccountResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PrivateLinkResourcesClientListByAccountResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PrivateLinkResourcesClientListByAccountResponse{}, runtime.NewResponseError(resp) + } + return client.listByAccountHandleResponse(resp) + }, + }) } // listByAccountCreateRequest creates the ListByAccount request. @@ -159,7 +171,7 @@ func (client *PrivateLinkResourcesClient) listByAccountCreateRequest(ctx context // listByAccountHandleResponse handles the ListByAccount response. func (client *PrivateLinkResourcesClient) listByAccountHandleResponse(resp *http.Response) (PrivateLinkResourcesClientListByAccountResponse, error) { - result := PrivateLinkResourcesClientListByAccountResponse{RawResponse: resp} + result := PrivateLinkResourcesClientListByAccountResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PrivateLinkResourceListResult); err != nil { return PrivateLinkResourcesClientListByAccountResponse{}, err } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_response_types.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_response_types.go index 14240feaaf82..974baf3b4416 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_response_types.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,654 +8,139 @@ package armdeviceupdate -import ( - "context" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "net/http" - "time" -) - -// AccountsClientCreatePollerResponse contains the response from method AccountsClient.Create. -type AccountsClientCreatePollerResponse struct { - // Poller contains an initialized poller. - Poller *AccountsClientCreatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l AccountsClientCreatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AccountsClientCreateResponse, error) { - respType := AccountsClientCreateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Account) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a AccountsClientCreatePollerResponse from the provided client and resume token. -func (l *AccountsClientCreatePollerResponse) Resume(ctx context.Context, client *AccountsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("AccountsClient.Create", token, client.pl) - if err != nil { - return err - } - poller := &AccountsClientCreatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // AccountsClientCreateResponse contains the response from method AccountsClient.Create. type AccountsClientCreateResponse struct { - AccountsClientCreateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AccountsClientCreateResult contains the result from method AccountsClient.Create. -type AccountsClientCreateResult struct { Account } -// AccountsClientDeletePollerResponse contains the response from method AccountsClient.Delete. -type AccountsClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *AccountsClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l AccountsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AccountsClientDeleteResponse, error) { - respType := AccountsClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a AccountsClientDeletePollerResponse from the provided client and resume token. -func (l *AccountsClientDeletePollerResponse) Resume(ctx context.Context, client *AccountsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("AccountsClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &AccountsClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // AccountsClientDeleteResponse contains the response from method AccountsClient.Delete. type AccountsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // AccountsClientGetResponse contains the response from method AccountsClient.Get. type AccountsClientGetResponse struct { - AccountsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AccountsClientGetResult contains the result from method AccountsClient.Get. -type AccountsClientGetResult struct { Account } // AccountsClientHeadResponse contains the response from method AccountsClient.Head. type AccountsClientHeadResponse struct { - AccountsClientHeadResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AccountsClientHeadResult contains the result from method AccountsClient.Head. -type AccountsClientHeadResult struct { // Success indicates if the operation succeeded or failed. Success bool } // AccountsClientListByResourceGroupResponse contains the response from method AccountsClient.ListByResourceGroup. type AccountsClientListByResourceGroupResponse struct { - AccountsClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AccountsClientListByResourceGroupResult contains the result from method AccountsClient.ListByResourceGroup. -type AccountsClientListByResourceGroupResult struct { AccountList } // AccountsClientListBySubscriptionResponse contains the response from method AccountsClient.ListBySubscription. type AccountsClientListBySubscriptionResponse struct { - AccountsClientListBySubscriptionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AccountsClientListBySubscriptionResult contains the result from method AccountsClient.ListBySubscription. -type AccountsClientListBySubscriptionResult struct { AccountList } -// AccountsClientUpdatePollerResponse contains the response from method AccountsClient.Update. -type AccountsClientUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *AccountsClientUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l AccountsClientUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (AccountsClientUpdateResponse, error) { - respType := AccountsClientUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Account) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a AccountsClientUpdatePollerResponse from the provided client and resume token. -func (l *AccountsClientUpdatePollerResponse) Resume(ctx context.Context, client *AccountsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("AccountsClient.Update", token, client.pl) - if err != nil { - return err - } - poller := &AccountsClientUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // AccountsClientUpdateResponse contains the response from method AccountsClient.Update. type AccountsClientUpdateResponse struct { - AccountsClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// AccountsClientUpdateResult contains the result from method AccountsClient.Update. -type AccountsClientUpdateResult struct { Account } // ClientCheckNameAvailabilityResponse contains the response from method Client.CheckNameAvailability. type ClientCheckNameAvailabilityResponse struct { - ClientCheckNameAvailabilityResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// ClientCheckNameAvailabilityResult contains the result from method Client.CheckNameAvailability. -type ClientCheckNameAvailabilityResult struct { CheckNameAvailabilityResponse } -// InstancesClientCreatePollerResponse contains the response from method InstancesClient.Create. -type InstancesClientCreatePollerResponse struct { - // Poller contains an initialized poller. - Poller *InstancesClientCreatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l InstancesClientCreatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (InstancesClientCreateResponse, error) { - respType := InstancesClientCreateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Instance) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a InstancesClientCreatePollerResponse from the provided client and resume token. -func (l *InstancesClientCreatePollerResponse) Resume(ctx context.Context, client *InstancesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("InstancesClient.Create", token, client.pl) - if err != nil { - return err - } - poller := &InstancesClientCreatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // InstancesClientCreateResponse contains the response from method InstancesClient.Create. type InstancesClientCreateResponse struct { - InstancesClientCreateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// InstancesClientCreateResult contains the result from method InstancesClient.Create. -type InstancesClientCreateResult struct { Instance } -// InstancesClientDeletePollerResponse contains the response from method InstancesClient.Delete. -type InstancesClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *InstancesClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l InstancesClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (InstancesClientDeleteResponse, error) { - respType := InstancesClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a InstancesClientDeletePollerResponse from the provided client and resume token. -func (l *InstancesClientDeletePollerResponse) Resume(ctx context.Context, client *InstancesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("InstancesClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &InstancesClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // InstancesClientDeleteResponse contains the response from method InstancesClient.Delete. type InstancesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // InstancesClientGetResponse contains the response from method InstancesClient.Get. type InstancesClientGetResponse struct { - InstancesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// InstancesClientGetResult contains the result from method InstancesClient.Get. -type InstancesClientGetResult struct { Instance } // InstancesClientHeadResponse contains the response from method InstancesClient.Head. type InstancesClientHeadResponse struct { - InstancesClientHeadResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// InstancesClientHeadResult contains the result from method InstancesClient.Head. -type InstancesClientHeadResult struct { // Success indicates if the operation succeeded or failed. Success bool } // InstancesClientListByAccountResponse contains the response from method InstancesClient.ListByAccount. type InstancesClientListByAccountResponse struct { - InstancesClientListByAccountResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// InstancesClientListByAccountResult contains the result from method InstancesClient.ListByAccount. -type InstancesClientListByAccountResult struct { InstanceList } // InstancesClientUpdateResponse contains the response from method InstancesClient.Update. type InstancesClientUpdateResponse struct { - InstancesClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// InstancesClientUpdateResult contains the result from method InstancesClient.Update. -type InstancesClientUpdateResult struct { Instance } // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { OperationListResult } -// PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse contains the response from method PrivateEndpointConnectionProxiesClient.CreateOrUpdate. -type PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse, error) { - respType := PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.PrivateEndpointConnectionProxy) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse from the provided client and resume -// token. -func (l *PrivateEndpointConnectionProxiesClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *PrivateEndpointConnectionProxiesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("PrivateEndpointConnectionProxiesClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &PrivateEndpointConnectionProxiesClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionProxiesClient.CreateOrUpdate. type PrivateEndpointConnectionProxiesClientCreateOrUpdateResponse struct { - PrivateEndpointConnectionProxiesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionProxiesClientCreateOrUpdateResult contains the result from method PrivateEndpointConnectionProxiesClient.CreateOrUpdate. -type PrivateEndpointConnectionProxiesClientCreateOrUpdateResult struct { PrivateEndpointConnectionProxy } -// PrivateEndpointConnectionProxiesClientDeletePollerResponse contains the response from method PrivateEndpointConnectionProxiesClient.Delete. -type PrivateEndpointConnectionProxiesClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *PrivateEndpointConnectionProxiesClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l PrivateEndpointConnectionProxiesClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (PrivateEndpointConnectionProxiesClientDeleteResponse, error) { - respType := PrivateEndpointConnectionProxiesClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a PrivateEndpointConnectionProxiesClientDeletePollerResponse from the provided client and resume token. -func (l *PrivateEndpointConnectionProxiesClientDeletePollerResponse) Resume(ctx context.Context, client *PrivateEndpointConnectionProxiesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("PrivateEndpointConnectionProxiesClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &PrivateEndpointConnectionProxiesClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // PrivateEndpointConnectionProxiesClientDeleteResponse contains the response from method PrivateEndpointConnectionProxiesClient.Delete. type PrivateEndpointConnectionProxiesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // PrivateEndpointConnectionProxiesClientGetResponse contains the response from method PrivateEndpointConnectionProxiesClient.Get. type PrivateEndpointConnectionProxiesClientGetResponse struct { - PrivateEndpointConnectionProxiesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionProxiesClientGetResult contains the result from method PrivateEndpointConnectionProxiesClient.Get. -type PrivateEndpointConnectionProxiesClientGetResult struct { PrivateEndpointConnectionProxy } // PrivateEndpointConnectionProxiesClientListByAccountResponse contains the response from method PrivateEndpointConnectionProxiesClient.ListByAccount. type PrivateEndpointConnectionProxiesClientListByAccountResponse struct { - PrivateEndpointConnectionProxiesClientListByAccountResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + PrivateEndpointConnectionProxyListResult } -// PrivateEndpointConnectionProxiesClientListByAccountResult contains the result from method PrivateEndpointConnectionProxiesClient.ListByAccount. -type PrivateEndpointConnectionProxiesClientListByAccountResult struct { - PrivateEndpointConnectionProxyListResult +// PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse contains the response from method PrivateEndpointConnectionProxiesClient.UpdatePrivateEndpointProperties. +type PrivateEndpointConnectionProxiesClientUpdatePrivateEndpointPropertiesResponse struct { + // placeholder for future response values } // PrivateEndpointConnectionProxiesClientValidateResponse contains the response from method PrivateEndpointConnectionProxiesClient.Validate. type PrivateEndpointConnectionProxiesClientValidateResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse contains the response from method PrivateEndpointConnectionsClient.CreateOrUpdate. -type PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *PrivateEndpointConnectionsClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (PrivateEndpointConnectionsClientCreateOrUpdateResponse, error) { - respType := PrivateEndpointConnectionsClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.PrivateEndpointConnection) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *PrivateEndpointConnectionsClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *PrivateEndpointConnectionsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("PrivateEndpointConnectionsClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &PrivateEndpointConnectionsClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil + // placeholder for future response values } // PrivateEndpointConnectionsClientCreateOrUpdateResponse contains the response from method PrivateEndpointConnectionsClient.CreateOrUpdate. type PrivateEndpointConnectionsClientCreateOrUpdateResponse struct { - PrivateEndpointConnectionsClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientCreateOrUpdateResult contains the result from method PrivateEndpointConnectionsClient.CreateOrUpdate. -type PrivateEndpointConnectionsClientCreateOrUpdateResult struct { PrivateEndpointConnection } -// PrivateEndpointConnectionsClientDeletePollerResponse contains the response from method PrivateEndpointConnectionsClient.Delete. -type PrivateEndpointConnectionsClientDeletePollerResponse struct { - // Poller contains an initialized poller. - Poller *PrivateEndpointConnectionsClientDeletePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l PrivateEndpointConnectionsClientDeletePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (PrivateEndpointConnectionsClientDeleteResponse, error) { - respType := PrivateEndpointConnectionsClientDeleteResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, nil) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a PrivateEndpointConnectionsClientDeletePollerResponse from the provided client and resume token. -func (l *PrivateEndpointConnectionsClientDeletePollerResponse) Resume(ctx context.Context, client *PrivateEndpointConnectionsClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("PrivateEndpointConnectionsClient.Delete", token, client.pl) - if err != nil { - return err - } - poller := &PrivateEndpointConnectionsClientDeletePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // PrivateEndpointConnectionsClientDeleteResponse contains the response from method PrivateEndpointConnectionsClient.Delete. type PrivateEndpointConnectionsClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // PrivateEndpointConnectionsClientGetResponse contains the response from method PrivateEndpointConnectionsClient.Get. type PrivateEndpointConnectionsClientGetResponse struct { - PrivateEndpointConnectionsClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientGetResult contains the result from method PrivateEndpointConnectionsClient.Get. -type PrivateEndpointConnectionsClientGetResult struct { PrivateEndpointConnection } // PrivateEndpointConnectionsClientListByAccountResponse contains the response from method PrivateEndpointConnectionsClient.ListByAccount. type PrivateEndpointConnectionsClientListByAccountResponse struct { - PrivateEndpointConnectionsClientListByAccountResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateEndpointConnectionsClientListByAccountResult contains the result from method PrivateEndpointConnectionsClient.ListByAccount. -type PrivateEndpointConnectionsClientListByAccountResult struct { PrivateEndpointConnectionListResult } // PrivateLinkResourcesClientGetResponse contains the response from method PrivateLinkResourcesClient.Get. type PrivateLinkResourcesClientGetResponse struct { - PrivateLinkResourcesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateLinkResourcesClientGetResult contains the result from method PrivateLinkResourcesClient.Get. -type PrivateLinkResourcesClientGetResult struct { GroupInformation } // PrivateLinkResourcesClientListByAccountResponse contains the response from method PrivateLinkResourcesClient.ListByAccount. type PrivateLinkResourcesClientListByAccountResponse struct { - PrivateLinkResourcesClientListByAccountResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PrivateLinkResourcesClientListByAccountResult contains the result from method PrivateLinkResourcesClient.ListByAccount. -type PrivateLinkResourcesClientListByAccountResult struct { PrivateLinkResourceListResult } diff --git a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_time_rfc3339.go b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_time_rfc3339.go index dceef810c0f7..d8e3c23eb8f7 100644 --- a/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_time_rfc3339.go +++ b/sdk/resourcemanager/deviceupdate/armdeviceupdate/zz_generated_time_rfc3339.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. diff --git a/sdk/resourcemanager/devops/armdevops/CHANGELOG.md b/sdk/resourcemanager/devops/armdevops/CHANGELOG.md index 954e23611f36..b3048129ee48 100644 --- a/sdk/resourcemanager/devops/armdevops/CHANGELOG.md +++ b/sdk/resourcemanager/devops/armdevops/CHANGELOG.md @@ -1,5 +1,78 @@ # Release History +## 0.3.0 (2022-04-11) +### Breaking Changes + +- Function `*OperationsClient.List` return value(s) have been changed from `(*OperationsClientListPager)` to `(*runtime.Pager[OperationsClientListResponse])` +- Function `NewPipelinesClient` return value(s) have been changed from `(*PipelinesClient)` to `(*PipelinesClient, error)` +- Function `*PipelinesClient.ListByResourceGroup` return value(s) have been changed from `(*PipelinesClientListByResourceGroupPager)` to `(*runtime.Pager[PipelinesClientListByResourceGroupResponse])` +- Function `*PipelinesClient.ListBySubscription` return value(s) have been changed from `(*PipelinesClientListBySubscriptionPager)` to `(*runtime.Pager[PipelinesClientListBySubscriptionResponse])` +- Function `*PipelineTemplateDefinitionsClient.List` return value(s) have been changed from `(*PipelineTemplateDefinitionsClientListPager)` to `(*runtime.Pager[PipelineTemplateDefinitionsClientListResponse])` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `*PipelinesClient.BeginCreateOrUpdate` return value(s) have been changed from `(PipelinesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[PipelinesClientCreateOrUpdateResponse], error)` +- Function `NewPipelineTemplateDefinitionsClient` return value(s) have been changed from `(*PipelineTemplateDefinitionsClient)` to `(*PipelineTemplateDefinitionsClient, error)` +- Function `*OperationsClientListPager.PageResponse` has been removed +- Function `*PipelineTemplateDefinitionsClientListPager.NextPage` has been removed +- Function `*PipelinesClientListBySubscriptionPager.NextPage` has been removed +- Function `*PipelinesClientCreateOrUpdatePoller.Done` has been removed +- Function `*PipelinesClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*PipelinesClientListBySubscriptionPager.Err` has been removed +- Function `*PipelinesClientListByResourceGroupPager.NextPage` has been removed +- Function `InputDataType.ToPtr` has been removed +- Function `*OperationsClientListPager.Err` has been removed +- Function `CodeRepositoryType.ToPtr` has been removed +- Function `*PipelinesClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `PipelinesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*PipelinesClientListByResourceGroupPager.PageResponse` has been removed +- Function `AuthorizationType.ToPtr` has been removed +- Function `*PipelineTemplateDefinitionsClientListPager.Err` has been removed +- Function `*PipelinesClientListByResourceGroupPager.Err` has been removed +- Function `*PipelinesClientCreateOrUpdatePoller.Poll` has been removed +- Function `*PipelinesClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*PipelinesClientListBySubscriptionPager.PageResponse` has been removed +- Function `*PipelineTemplateDefinitionsClientListPager.PageResponse` has been removed +- Function `*OperationsClientListPager.NextPage` has been removed +- Struct `OperationsClientListPager` has been removed +- Struct `OperationsClientListResult` has been removed +- Struct `PipelineTemplateDefinitionsClientListPager` has been removed +- Struct `PipelineTemplateDefinitionsClientListResult` has been removed +- Struct `PipelinesClientCreateOrUpdatePoller` has been removed +- Struct `PipelinesClientCreateOrUpdatePollerResponse` has been removed +- Struct `PipelinesClientCreateOrUpdateResult` has been removed +- Struct `PipelinesClientGetResult` has been removed +- Struct `PipelinesClientListByResourceGroupPager` has been removed +- Struct `PipelinesClientListByResourceGroupResult` has been removed +- Struct `PipelinesClientListBySubscriptionPager` has been removed +- Struct `PipelinesClientListBySubscriptionResult` has been removed +- Struct `PipelinesClientUpdateResult` has been removed +- Field `PipelinesClientGetResult` of struct `PipelinesClientGetResponse` has been removed +- Field `RawResponse` of struct `PipelinesClientGetResponse` has been removed +- Field `PipelinesClientListBySubscriptionResult` of struct `PipelinesClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `PipelinesClientListBySubscriptionResponse` has been removed +- Field `OperationsClientListResult` of struct `OperationsClientListResponse` has been removed +- Field `RawResponse` of struct `OperationsClientListResponse` has been removed +- Field `PipelinesClientListByResourceGroupResult` of struct `PipelinesClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `PipelinesClientListByResourceGroupResponse` has been removed +- Field `PipelinesClientCreateOrUpdateResult` of struct `PipelinesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `PipelinesClientCreateOrUpdateResponse` has been removed +- Field `PipelinesClientUpdateResult` of struct `PipelinesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `PipelinesClientUpdateResponse` has been removed +- Field `PipelineTemplateDefinitionsClientListResult` of struct `PipelineTemplateDefinitionsClientListResponse` has been removed +- Field `RawResponse` of struct `PipelineTemplateDefinitionsClientListResponse` has been removed +- Field `RawResponse` of struct `PipelinesClientDeleteResponse` has been removed + +### Features Added + +- New anonymous field `Pipeline` in struct `PipelinesClientUpdateResponse` +- New anonymous field `PipelineTemplateDefinitionListResult` in struct `PipelineTemplateDefinitionsClientListResponse` +- New anonymous field `Pipeline` in struct `PipelinesClientCreateOrUpdateResponse` +- New anonymous field `PipelineListResult` in struct `PipelinesClientListBySubscriptionResponse` +- New anonymous field `Pipeline` in struct `PipelinesClientGetResponse` +- New field `ResumeToken` in struct `PipelinesClientBeginCreateOrUpdateOptions` +- New anonymous field `OperationListResult` in struct `OperationsClientListResponse` +- New anonymous field `PipelineListResult` in struct `PipelinesClientListByResourceGroupResponse` + + ## 0.2.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/devops/armdevops/README.md b/sdk/resourcemanager/devops/armdevops/README.md index 26e75fb544b1..67d1832927fa 100644 --- a/sdk/resourcemanager/devops/armdevops/README.md +++ b/sdk/resourcemanager/devops/armdevops/README.md @@ -11,7 +11,7 @@ The `armdevops` module provides operations for working with Azure DevOps. ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.16 or above +- Go 1.18 or above ## Install the package @@ -38,16 +38,18 @@ For more information on authentication, please see the documentation for `aziden Azure DevOps 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 := armdevops.NewPipelinesClient(, cred, nil) +client, err := armdevops.NewPipelinesClient(, 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{ - Host: arm.AzureChina, +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, } -client := armdevops.NewPipelinesClient(, cred, &options) +client, err := armdevops.NewPipelinesClient(, cred, &options) ``` ## Provide Feedback diff --git a/sdk/resourcemanager/devops/armdevops/autorest.md b/sdk/resourcemanager/devops/armdevops/autorest.md index 11deede1a525..1d114bdf4934 100644 --- a/sdk/resourcemanager/devops/armdevops/autorest.md +++ b/sdk/resourcemanager/devops/armdevops/autorest.md @@ -5,9 +5,9 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/devops/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/devops/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/devops/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/devops/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.1 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/devops/armdevops/go.mod b/sdk/resourcemanager/devops/armdevops/go.mod index f5b7204627f3..2c134a513cac 100644 --- a/sdk/resourcemanager/devops/armdevops/go.mod +++ b/sdk/resourcemanager/devops/armdevops/go.mod @@ -1,8 +1,21 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops -go 1.16 +go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect + github.com/golang-jwt/jwt v3.2.1+incompatible // indirect + github.com/google/uuid v1.1.1 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect + golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/devops/armdevops/go.sum b/sdk/resourcemanager/devops/armdevops/go.sum index 2ce51d3b8174..56d1c32628ae 100644 --- a/sdk/resourcemanager/devops/armdevops/go.sum +++ b/sdk/resourcemanager/devops/armdevops/go.sum @@ -1,18 +1,18 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= 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/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -32,21 +32,16 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -56,4 +51,3 @@ 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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/devops/armdevops/ze_generated_example_operations_client_test.go b/sdk/resourcemanager/devops/armdevops/ze_generated_example_operations_client_test.go index 7e6fa0d4d5a0..825a8184f8f1 100644 --- a/sdk/resourcemanager/devops/armdevops/ze_generated_example_operations_client_test.go +++ b/sdk/resourcemanager/devops/armdevops/ze_generated_example_operations_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,25 +16,29 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops" ) -// x-ms-original-file: specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListOperations.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListOperations.json func ExampleOperationsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevops.NewOperationsClient(cred, nil) + client, err := armdevops.NewOperationsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/devops/armdevops/ze_generated_example_pipelines_client_test.go b/sdk/resourcemanager/devops/armdevops/ze_generated_example_pipelines_client_test.go index 0ee49617d651..5c802b4a1e83 100644 --- a/sdk/resourcemanager/devops/armdevops/ze_generated_example_pipelines_client_test.go +++ b/sdk/resourcemanager/devops/armdevops/ze_generated_example_pipelines_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,155 +19,191 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops" ) -// x-ms-original-file: specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/CreateAzurePipeline-Sample-AspNet-WindowsWebApp.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/CreateAzurePipeline-Sample-AspNet-WindowsWebApp.json func ExamplePipelinesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevops.NewPipelinesClient("", cred, nil) + client, err := armdevops.NewPipelinesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", armdevops.Pipeline{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Tags: map[string]*string{}, Properties: &armdevops.PipelineProperties{ BootstrapConfiguration: &armdevops.BootstrapConfiguration{ Template: &armdevops.PipelineTemplate{ - ID: to.StringPtr(""), + ID: to.Ptr(""), Parameters: map[string]*string{ - "appInsightLocation": to.StringPtr("South India"), - "appServicePlan": to.StringPtr("S1 Standard"), - "azureAuth": to.StringPtr("{\"scheme\":\"ServicePrincipal\",\"parameters\":{\"tenantid\":\"{subscriptionTenantId}\",\"objectid\":\"{appObjectId}\",\"serviceprincipalid\":\"{appId}\",\"serviceprincipalkey\":\"{appSecret}\"}}"), - "location": to.StringPtr("South India"), - "resourceGroup": to.StringPtr("myAspNetWebAppPipeline-rg"), - "subscriptionId": to.StringPtr("{subscriptionId}"), - "webAppName": to.StringPtr("myAspNetWebApp"), + "appInsightLocation": to.Ptr("South India"), + "appServicePlan": to.Ptr("S1 Standard"), + "azureAuth": to.Ptr("{\"scheme\":\"ServicePrincipal\",\"parameters\":{\"tenantid\":\"{subscriptionTenantId}\",\"objectid\":\"{appObjectId}\",\"serviceprincipalid\":\"{appId}\",\"serviceprincipalkey\":\"{appSecret}\"}}"), + "location": to.Ptr("South India"), + "resourceGroup": to.Ptr("myAspNetWebAppPipeline-rg"), + "subscriptionId": to.Ptr("{subscriptionId}"), + "webAppName": to.Ptr("myAspNetWebApp"), }, }, }, Organization: &armdevops.OrganizationReference{ - Name: to.StringPtr(""), + Name: to.Ptr(""), }, Project: &armdevops.ProjectReference{ - Name: to.StringPtr(""), + Name: to.Ptr(""), }, }, }, - nil) + &armdevops.PipelinesClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.PipelinesClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/GetAzurePipeline.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/GetAzurePipeline.json func ExamplePipelinesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevops.NewPipelinesClient("", cred, nil) + client, err := armdevops.NewPipelinesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PipelinesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/UpdateAzurePipeline.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/UpdateAzurePipeline.json func ExamplePipelinesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevops.NewPipelinesClient("", cred, nil) + client, err := armdevops.NewPipelinesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", armdevops.PipelineUpdateParameters{ Tags: map[string]*string{ - "tagKey": to.StringPtr("tagvalue"), + "tagKey": to.Ptr("tagvalue"), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.PipelinesClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/DeleteAzurePipeline.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/DeleteAzurePipeline.json func ExamplePipelinesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevops.NewPipelinesClient("", cred, nil) + client, err := armdevops.NewPipelinesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListAzurePipelinesByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListAzurePipelinesByResourceGroup.json func ExamplePipelinesClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevops.NewPipelinesClient("", cred, nil) + client, err := armdevops.NewPipelinesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByResourceGroup("", nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListAzurePipelinesBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListAzurePipelinesBySubscription.json func ExamplePipelinesClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevops.NewPipelinesClient("", cred, nil) + client, err := armdevops.NewPipelinesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListBySubscription(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/devops/armdevops/ze_generated_example_pipelinetemplatedefinitions_client_test.go b/sdk/resourcemanager/devops/armdevops/ze_generated_example_pipelinetemplatedefinitions_client_test.go index f48d936060fe..f61ba9fa14be 100644 --- a/sdk/resourcemanager/devops/armdevops/ze_generated_example_pipelinetemplatedefinitions_client_test.go +++ b/sdk/resourcemanager/devops/armdevops/ze_generated_example_pipelinetemplatedefinitions_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,25 +16,29 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devops/armdevops" ) -// x-ms-original-file: specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListPipelineTemplateDefinitions.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devops/resource-manager/Microsoft.DevOps/preview/2019-07-01-preview/examples/ListPipelineTemplateDefinitions.json func ExamplePipelineTemplateDefinitionsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevops.NewPipelineTemplateDefinitionsClient(cred, nil) + client, err := armdevops.NewPipelineTemplateDefinitionsClient(cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List(nil) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_constants.go b/sdk/resourcemanager/devops/armdevops/zz_generated_constants.go index 2c1f467a3fcf..d392ee044755 100644 --- a/sdk/resourcemanager/devops/armdevops/zz_generated_constants.go +++ b/sdk/resourcemanager/devops/armdevops/zz_generated_constants.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -10,7 +10,7 @@ package armdevops const ( moduleName = "armdevops" - moduleVersion = "v0.2.1" + moduleVersion = "v0.3.0" ) // AuthorizationType - Type of authorization. @@ -27,11 +27,6 @@ func PossibleAuthorizationTypeValues() []AuthorizationType { } } -// ToPtr returns a *AuthorizationType pointing to the current value. -func (c AuthorizationType) ToPtr() *AuthorizationType { - return &c -} - // CodeRepositoryType - Type of code repository. type CodeRepositoryType string @@ -48,11 +43,6 @@ func PossibleCodeRepositoryTypeValues() []CodeRepositoryType { } } -// ToPtr returns a *CodeRepositoryType pointing to the current value. -func (c CodeRepositoryType) ToPtr() *CodeRepositoryType { - return &c -} - // InputDataType - Data type of the value of the input parameter. type InputDataType string @@ -74,8 +64,3 @@ func PossibleInputDataTypeValues() []InputDataType { InputDataTypeString, } } - -// ToPtr returns a *InputDataType pointing to the current value. -func (c InputDataType) ToPtr() *InputDataType { - return &c -} diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_models.go b/sdk/resourcemanager/devops/armdevops/zz_generated_models.go index 3d626164086b..586eb64006f6 100644 --- a/sdk/resourcemanager/devops/armdevops/zz_generated_models.go +++ b/sdk/resourcemanager/devops/armdevops/zz_generated_models.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,12 +8,6 @@ package armdevops -import ( - "encoding/json" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "reflect" -) - // Authorization info used to access a resource (like code repository). type Authorization struct { // REQUIRED; Type of authorization. @@ -23,14 +17,6 @@ type Authorization struct { Parameters map[string]*string `json:"parameters,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type Authorization. -func (a Authorization) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorizationType", a.AuthorizationType) - populate(objectMap, "parameters", a.Parameters) - return json.Marshal(objectMap) -} - // BootstrapConfiguration - Configuration used to bootstrap a Pipeline. type BootstrapConfiguration struct { // REQUIRED; Template used to bootstrap the pipeline. @@ -61,16 +47,6 @@ type CloudErrorBody struct { Target *string `json:"target,omitempty"` } -// 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) -} - // CodeRepository - Repository containing the source code for a pipeline. type CodeRepository struct { // REQUIRED; Default branch used to configure Continuous Integration (CI) in the pipeline. @@ -89,17 +65,6 @@ type CodeRepository struct { Properties map[string]*string `json:"properties,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type CodeRepository. -func (c CodeRepository) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "authorization", c.Authorization) - populate(objectMap, "defaultBranch", c.DefaultBranch) - populate(objectMap, "id", c.ID) - populate(objectMap, "properties", c.Properties) - populate(objectMap, "repositoryType", c.RepositoryType) - return json.Marshal(objectMap) -} - // InputDescriptor - Representation of a pipeline template input parameter. type InputDescriptor struct { // REQUIRED; Identifier of the input parameter. @@ -115,16 +80,6 @@ type InputDescriptor struct { PossibleValues []*InputValue `json:"possibleValues,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type InputDescriptor. -func (i InputDescriptor) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", i.Description) - populate(objectMap, "id", i.ID) - populate(objectMap, "possibleValues", i.PossibleValues) - populate(objectMap, "type", i.Type) - return json.Marshal(objectMap) -} - // InputValue - Representation of a pipeline template input parameter value. type InputValue struct { // Description of the input parameter value. @@ -170,14 +125,6 @@ type OperationListResult struct { Value []*Operation `json:"value,omitempty" azure:"ro"` } -// 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) -} - // OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. type OperationsClientListOptions struct { // placeholder for future optional parameters @@ -213,18 +160,6 @@ type Pipeline struct { Type *string `json:"type,omitempty" azure:"ro"` } -// MarshalJSON implements the json.Marshaller interface for type Pipeline. -func (p Pipeline) 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) - return json.Marshal(objectMap) -} - // PipelineListResult - Result of a request to list all Azure Pipelines under a given scope. type PipelineListResult struct { // URL to get the next set of Pipelines, if there are any. @@ -234,14 +169,6 @@ type PipelineListResult struct { Value []*Pipeline `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PipelineListResult. -func (p PipelineListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PipelineProperties - Custom properties of a Pipeline. type PipelineProperties struct { // REQUIRED; Configuration used to bootstrap the Pipeline. @@ -266,14 +193,6 @@ type PipelineTemplate struct { Parameters map[string]*string `json:"parameters,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PipelineTemplate. -func (p PipelineTemplate) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "id", p.ID) - populate(objectMap, "parameters", p.Parameters) - return json.Marshal(objectMap) -} - // PipelineTemplateDefinition - Definition of a pipeline template. type PipelineTemplateDefinition struct { // REQUIRED; Unique identifier of the pipeline template. @@ -286,15 +205,6 @@ type PipelineTemplateDefinition struct { Inputs []*InputDescriptor `json:"inputs,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PipelineTemplateDefinition. -func (p PipelineTemplateDefinition) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "description", p.Description) - populate(objectMap, "id", p.ID) - populate(objectMap, "inputs", p.Inputs) - return json.Marshal(objectMap) -} - // PipelineTemplateDefinitionListResult - Result of a request to list all pipeline template definitions. type PipelineTemplateDefinitionListResult struct { // The URL to get the next set of pipeline template definitions, if there are any. @@ -304,14 +214,6 @@ type PipelineTemplateDefinitionListResult struct { Value []*PipelineTemplateDefinition `json:"value,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PipelineTemplateDefinitionListResult. -func (p PipelineTemplateDefinitionListResult) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "nextLink", p.NextLink) - populate(objectMap, "value", p.Value) - return json.Marshal(objectMap) -} - // PipelineTemplateDefinitionsClientListOptions contains the optional parameters for the PipelineTemplateDefinitionsClient.List // method. type PipelineTemplateDefinitionsClientListOptions struct { @@ -324,17 +226,11 @@ type PipelineUpdateParameters struct { Tags map[string]*string `json:"tags,omitempty"` } -// MarshalJSON implements the json.Marshaller interface for type PipelineUpdateParameters. -func (p PipelineUpdateParameters) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - populate(objectMap, "tags", p.Tags) - return json.Marshal(objectMap) -} - // PipelinesClientBeginCreateOrUpdateOptions contains the optional parameters for the PipelinesClient.BeginCreateOrUpdate // method. type PipelinesClientBeginCreateOrUpdateOptions struct { - // placeholder for future optional parameters + // Resumes the LRO from the provided token. + ResumeToken string } // PipelinesClientDeleteOptions contains the optional parameters for the PipelinesClient.Delete method. @@ -389,24 +285,3 @@ type Resource struct { // READ-ONLY; Resource Type Type *string `json:"type,omitempty" azure:"ro"` } - -// 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) -} - -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 - } -} diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_models_serde.go b/sdk/resourcemanager/devops/armdevops/zz_generated_models_serde.go new file mode 100644 index 000000000000..1a07878e9003 --- /dev/null +++ b/sdk/resourcemanager/devops/armdevops/zz_generated_models_serde.go @@ -0,0 +1,135 @@ +//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 armdevops + +import ( + "encoding/json" + "github.com/Azure/azure-sdk-for-go/sdk/azcore" + "reflect" +) + +// MarshalJSON implements the json.Marshaller interface for type Authorization. +func (a Authorization) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorizationType", a.AuthorizationType) + populate(objectMap, "parameters", a.Parameters) + return json.Marshal(objectMap) +} + +// 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) +} + +// MarshalJSON implements the json.Marshaller interface for type CodeRepository. +func (c CodeRepository) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "authorization", c.Authorization) + populate(objectMap, "defaultBranch", c.DefaultBranch) + populate(objectMap, "id", c.ID) + populate(objectMap, "properties", c.Properties) + populate(objectMap, "repositoryType", c.RepositoryType) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type InputDescriptor. +func (i InputDescriptor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", i.Description) + populate(objectMap, "id", i.ID) + populate(objectMap, "possibleValues", i.PossibleValues) + populate(objectMap, "type", i.Type) + return json.Marshal(objectMap) +} + +// 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) +} + +// MarshalJSON implements the json.Marshaller interface for type Pipeline. +func (p Pipeline) 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) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PipelineListResult. +func (p PipelineListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PipelineTemplate. +func (p PipelineTemplate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "id", p.ID) + populate(objectMap, "parameters", p.Parameters) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PipelineTemplateDefinition. +func (p PipelineTemplateDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "description", p.Description) + populate(objectMap, "id", p.ID) + populate(objectMap, "inputs", p.Inputs) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PipelineTemplateDefinitionListResult. +func (p PipelineTemplateDefinitionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + populate(objectMap, "nextLink", p.NextLink) + populate(objectMap, "value", p.Value) + return json.Marshal(objectMap) +} + +// MarshalJSON implements the json.Marshaller interface for type PipelineUpdateParameters. +func (p PipelineUpdateParameters) 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 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) +} + +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 + } +} diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_operations_client.go b/sdk/resourcemanager/devops/armdevops/zz_generated_operations_client.go index b3a6f9698dca..7c2aaacf87ae 100644 --- a/sdk/resourcemanager/devops/armdevops/zz_generated_operations_client.go +++ b/sdk/resourcemanager/devops/armdevops/zz_generated_operations_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -13,6 +13,7 @@ import ( "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" @@ -28,34 +29,54 @@ type OperationsClient struct { // 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 { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewOperationsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*OperationsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - Lists all the operations supported by Microsoft.DevOps resource provider. // If the operation fails it returns an *azcore.ResponseError type. // options - OperationsClientListOptions contains the optional parameters for the OperationsClient.List method. -func (client *OperationsClient) List(options *OperationsClientListOptions) *OperationsClientListPager { - return &OperationsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *OperationsClient) List(options *OperationsClientListOptions) *runtime.Pager[OperationsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[OperationsClientListResponse]{ + More: func(page OperationsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp OperationsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.OperationListResult.NextLink) + 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. @@ -74,7 +95,7 @@ func (client *OperationsClient) listCreateRequest(ctx context.Context, options * // listHandleResponse handles the List response. func (client *OperationsClient) listHandleResponse(resp *http.Response) (OperationsClientListResponse, error) { - result := OperationsClientListResponse{RawResponse: resp} + result := OperationsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.OperationListResult); err != nil { return OperationsClientListResponse{}, err } diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_pagers.go b/sdk/resourcemanager/devops/armdevops/zz_generated_pagers.go deleted file mode 100644 index fb435150128c..000000000000 --- a/sdk/resourcemanager/devops/armdevops/zz_generated_pagers.go +++ /dev/null @@ -1,233 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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 armdevops - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/policy" - "github.com/Azure/azure-sdk-for-go/sdk/azcore/runtime" - "net/http" - "reflect" -) - -// OperationsClientListPager provides operations for iterating over paged responses. -type OperationsClientListPager struct { - client *OperationsClient - current OperationsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, OperationsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *OperationsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *OperationsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.OperationListResult.NextLink == nil || len(*p.current.OperationListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current OperationsClientListResponse page. -func (p *OperationsClientListPager) PageResponse() OperationsClientListResponse { - return p.current -} - -// PipelineTemplateDefinitionsClientListPager provides operations for iterating over paged responses. -type PipelineTemplateDefinitionsClientListPager struct { - client *PipelineTemplateDefinitionsClient - current PipelineTemplateDefinitionsClientListResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, PipelineTemplateDefinitionsClientListResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *PipelineTemplateDefinitionsClientListPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *PipelineTemplateDefinitionsClientListPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.PipelineTemplateDefinitionListResult.NextLink == nil || len(*p.current.PipelineTemplateDefinitionListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current PipelineTemplateDefinitionsClientListResponse page. -func (p *PipelineTemplateDefinitionsClientListPager) PageResponse() PipelineTemplateDefinitionsClientListResponse { - return p.current -} - -// PipelinesClientListByResourceGroupPager provides operations for iterating over paged responses. -type PipelinesClientListByResourceGroupPager struct { - client *PipelinesClient - current PipelinesClientListByResourceGroupResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, PipelinesClientListByResourceGroupResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *PipelinesClientListByResourceGroupPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *PipelinesClientListByResourceGroupPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.PipelineListResult.NextLink == nil || len(*p.current.PipelineListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listByResourceGroupHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current PipelinesClientListByResourceGroupResponse page. -func (p *PipelinesClientListByResourceGroupPager) PageResponse() PipelinesClientListByResourceGroupResponse { - return p.current -} - -// PipelinesClientListBySubscriptionPager provides operations for iterating over paged responses. -type PipelinesClientListBySubscriptionPager struct { - client *PipelinesClient - current PipelinesClientListBySubscriptionResponse - err error - requester func(context.Context) (*policy.Request, error) - advancer func(context.Context, PipelinesClientListBySubscriptionResponse) (*policy.Request, error) -} - -// Err returns the last error encountered while paging. -func (p *PipelinesClientListBySubscriptionPager) Err() error { - return p.err -} - -// NextPage returns true if the pager advanced to the next page. -// Returns false if there are no more pages or an error occurred. -func (p *PipelinesClientListBySubscriptionPager) NextPage(ctx context.Context) bool { - var req *policy.Request - var err error - if !reflect.ValueOf(p.current).IsZero() { - if p.current.PipelineListResult.NextLink == nil || len(*p.current.PipelineListResult.NextLink) == 0 { - return false - } - req, err = p.advancer(ctx, p.current) - } else { - req, err = p.requester(ctx) - } - if err != nil { - p.err = err - return false - } - resp, err := p.client.pl.Do(req) - if err != nil { - p.err = err - return false - } - if !runtime.HasStatusCode(resp, http.StatusOK) { - p.err = runtime.NewResponseError(resp) - return false - } - result, err := p.client.listBySubscriptionHandleResponse(resp) - if err != nil { - p.err = err - return false - } - p.current = result - return true -} - -// PageResponse returns the current PipelinesClientListBySubscriptionResponse page. -func (p *PipelinesClientListBySubscriptionPager) PageResponse() PipelinesClientListBySubscriptionResponse { - return p.current -} diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_pipelines_client.go b/sdk/resourcemanager/devops/armdevops/zz_generated_pipelines_client.go index 88d61c06e75d..8721d05108f7 100644 --- a/sdk/resourcemanager/devops/armdevops/zz_generated_pipelines_client.go +++ b/sdk/resourcemanager/devops/armdevops/zz_generated_pipelines_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -14,6 +14,7 @@ import ( "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" @@ -33,20 +34,24 @@ type PipelinesClient struct { // subscriptionID - Unique identifier of the Azure subscription. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewPipelinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) *PipelinesClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPipelinesClient(subscriptionID string, credential azcore.TokenCredential, options *arm.ClientOptions) (*PipelinesClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &PipelinesClient{ subscriptionID: subscriptionID, - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // BeginCreateOrUpdate - Creates or updates an Azure Pipeline. @@ -56,22 +61,16 @@ func NewPipelinesClient(subscriptionID string, credential azcore.TokenCredential // createOperationParameters - The request payload to create the Azure Pipeline. // options - PipelinesClientBeginCreateOrUpdateOptions contains the optional parameters for the PipelinesClient.BeginCreateOrUpdate // method. -func (client *PipelinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, pipelineName string, createOperationParameters Pipeline, options *PipelinesClientBeginCreateOrUpdateOptions) (PipelinesClientCreateOrUpdatePollerResponse, error) { - resp, err := client.createOrUpdate(ctx, resourceGroupName, pipelineName, createOperationParameters, options) - if err != nil { - return PipelinesClientCreateOrUpdatePollerResponse{}, err - } - result := PipelinesClientCreateOrUpdatePollerResponse{ - RawResponse: resp, +func (client *PipelinesClient) BeginCreateOrUpdate(ctx context.Context, resourceGroupName string, pipelineName string, createOperationParameters Pipeline, options *PipelinesClientBeginCreateOrUpdateOptions) (*armruntime.Poller[PipelinesClientCreateOrUpdateResponse], error) { + if options == nil || options.ResumeToken == "" { + resp, err := client.createOrUpdate(ctx, resourceGroupName, pipelineName, createOperationParameters, options) + if err != nil { + return nil, err + } + return armruntime.NewPoller[PipelinesClientCreateOrUpdateResponse](resp, client.pl, nil) + } else { + return armruntime.NewPollerFromResumeToken[PipelinesClientCreateOrUpdateResponse](options.ResumeToken, client.pl, nil) } - pt, err := armruntime.NewPoller("PipelinesClient.CreateOrUpdate", "", resp, client.pl) - if err != nil { - return PipelinesClientCreateOrUpdatePollerResponse{}, err - } - result.Poller = &PipelinesClientCreateOrUpdatePoller{ - pt: pt, - } - return result, nil } // CreateOrUpdate - Creates or updates an Azure Pipeline. @@ -134,7 +133,7 @@ func (client *PipelinesClient) Delete(ctx context.Context, resourceGroupName str if !runtime.HasStatusCode(resp, http.StatusOK, http.StatusNoContent) { return PipelinesClientDeleteResponse{}, runtime.NewResponseError(resp) } - return PipelinesClientDeleteResponse{RawResponse: resp}, nil + return PipelinesClientDeleteResponse{}, nil } // deleteCreateRequest creates the Delete request. @@ -211,7 +210,7 @@ func (client *PipelinesClient) getCreateRequest(ctx context.Context, resourceGro // getHandleResponse handles the Get response. func (client *PipelinesClient) getHandleResponse(resp *http.Response) (PipelinesClientGetResponse, error) { - result := PipelinesClientGetResponse{RawResponse: resp} + result := PipelinesClientGetResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Pipeline); err != nil { return PipelinesClientGetResponse{}, err } @@ -223,16 +222,32 @@ func (client *PipelinesClient) getHandleResponse(resp *http.Response) (Pipelines // resourceGroupName - Name of the resource group within the Azure subscription. // options - PipelinesClientListByResourceGroupOptions contains the optional parameters for the PipelinesClient.ListByResourceGroup // method. -func (client *PipelinesClient) ListByResourceGroup(resourceGroupName string, options *PipelinesClientListByResourceGroupOptions) *PipelinesClientListByResourceGroupPager { - return &PipelinesClientListByResourceGroupPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listByResourceGroupCreateRequest(ctx, resourceGroupName, options) +func (client *PipelinesClient) ListByResourceGroup(resourceGroupName string, options *PipelinesClientListByResourceGroupOptions) *runtime.Pager[PipelinesClientListByResourceGroupResponse] { + return runtime.NewPager(runtime.PageProcessor[PipelinesClientListByResourceGroupResponse]{ + More: func(page PipelinesClientListByResourceGroupResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp PipelinesClientListByResourceGroupResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.PipelineListResult.NextLink) + Fetcher: func(ctx context.Context, page *PipelinesClientListByResourceGroupResponse) (PipelinesClientListByResourceGroupResponse, 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 PipelinesClientListByResourceGroupResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PipelinesClientListByResourceGroupResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PipelinesClientListByResourceGroupResponse{}, runtime.NewResponseError(resp) + } + return client.listByResourceGroupHandleResponse(resp) }, - } + }) } // listByResourceGroupCreateRequest creates the ListByResourceGroup request. @@ -259,7 +274,7 @@ func (client *PipelinesClient) listByResourceGroupCreateRequest(ctx context.Cont // listByResourceGroupHandleResponse handles the ListByResourceGroup response. func (client *PipelinesClient) listByResourceGroupHandleResponse(resp *http.Response) (PipelinesClientListByResourceGroupResponse, error) { - result := PipelinesClientListByResourceGroupResponse{RawResponse: resp} + result := PipelinesClientListByResourceGroupResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PipelineListResult); err != nil { return PipelinesClientListByResourceGroupResponse{}, err } @@ -270,16 +285,32 @@ func (client *PipelinesClient) listByResourceGroupHandleResponse(resp *http.Resp // If the operation fails it returns an *azcore.ResponseError type. // options - PipelinesClientListBySubscriptionOptions contains the optional parameters for the PipelinesClient.ListBySubscription // method. -func (client *PipelinesClient) ListBySubscription(options *PipelinesClientListBySubscriptionOptions) *PipelinesClientListBySubscriptionPager { - return &PipelinesClientListBySubscriptionPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listBySubscriptionCreateRequest(ctx, options) +func (client *PipelinesClient) ListBySubscription(options *PipelinesClientListBySubscriptionOptions) *runtime.Pager[PipelinesClientListBySubscriptionResponse] { + return runtime.NewPager(runtime.PageProcessor[PipelinesClientListBySubscriptionResponse]{ + More: func(page PipelinesClientListBySubscriptionResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp PipelinesClientListBySubscriptionResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.PipelineListResult.NextLink) + Fetcher: func(ctx context.Context, page *PipelinesClientListBySubscriptionResponse) (PipelinesClientListBySubscriptionResponse, 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 PipelinesClientListBySubscriptionResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PipelinesClientListBySubscriptionResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PipelinesClientListBySubscriptionResponse{}, runtime.NewResponseError(resp) + } + return client.listBySubscriptionHandleResponse(resp) }, - } + }) } // listBySubscriptionCreateRequest creates the ListBySubscription request. @@ -302,7 +333,7 @@ func (client *PipelinesClient) listBySubscriptionCreateRequest(ctx context.Conte // listBySubscriptionHandleResponse handles the ListBySubscription response. func (client *PipelinesClient) listBySubscriptionHandleResponse(resp *http.Response) (PipelinesClientListBySubscriptionResponse, error) { - result := PipelinesClientListBySubscriptionResponse{RawResponse: resp} + result := PipelinesClientListBySubscriptionResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PipelineListResult); err != nil { return PipelinesClientListBySubscriptionResponse{}, err } @@ -358,7 +389,7 @@ func (client *PipelinesClient) updateCreateRequest(ctx context.Context, resource // updateHandleResponse handles the Update response. func (client *PipelinesClient) updateHandleResponse(resp *http.Response) (PipelinesClientUpdateResponse, error) { - result := PipelinesClientUpdateResponse{RawResponse: resp} + result := PipelinesClientUpdateResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.Pipeline); err != nil { return PipelinesClientUpdateResponse{}, err } diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_pipelinetemplatedefinitions_client.go b/sdk/resourcemanager/devops/armdevops/zz_generated_pipelinetemplatedefinitions_client.go index 46c7aac62e8c..9aabcafedad9 100644 --- a/sdk/resourcemanager/devops/armdevops/zz_generated_pipelinetemplatedefinitions_client.go +++ b/sdk/resourcemanager/devops/armdevops/zz_generated_pipelinetemplatedefinitions_client.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -13,6 +13,7 @@ import ( "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" @@ -28,35 +29,55 @@ type PipelineTemplateDefinitionsClient struct { // NewPipelineTemplateDefinitionsClient creates a new instance of PipelineTemplateDefinitionsClient with the specified values. // credential - used to authorize requests. Usually a credential from azidentity. // options - pass nil to accept the default values. -func NewPipelineTemplateDefinitionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) *PipelineTemplateDefinitionsClient { - cp := arm.ClientOptions{} - if options != nil { - cp = *options +func NewPipelineTemplateDefinitionsClient(credential azcore.TokenCredential, options *arm.ClientOptions) (*PipelineTemplateDefinitionsClient, error) { + if options == nil { + options = &arm.ClientOptions{} } - if len(cp.Endpoint) == 0 { - cp.Endpoint = arm.AzurePublicCloud + ep := cloud.AzurePublicCloud.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 := &PipelineTemplateDefinitionsClient{ - host: string(cp.Endpoint), - pl: armruntime.NewPipeline(moduleName, moduleVersion, credential, runtime.PipelineOptions{}, &cp), + host: ep, + pl: pl, } - return client + return client, nil } // List - Lists all pipeline templates which can be used to configure an Azure Pipeline. // If the operation fails it returns an *azcore.ResponseError type. // options - PipelineTemplateDefinitionsClientListOptions contains the optional parameters for the PipelineTemplateDefinitionsClient.List // method. -func (client *PipelineTemplateDefinitionsClient) List(options *PipelineTemplateDefinitionsClientListOptions) *PipelineTemplateDefinitionsClientListPager { - return &PipelineTemplateDefinitionsClientListPager{ - client: client, - requester: func(ctx context.Context) (*policy.Request, error) { - return client.listCreateRequest(ctx, options) +func (client *PipelineTemplateDefinitionsClient) List(options *PipelineTemplateDefinitionsClientListOptions) *runtime.Pager[PipelineTemplateDefinitionsClientListResponse] { + return runtime.NewPager(runtime.PageProcessor[PipelineTemplateDefinitionsClientListResponse]{ + More: func(page PipelineTemplateDefinitionsClientListResponse) bool { + return page.NextLink != nil && len(*page.NextLink) > 0 }, - advancer: func(ctx context.Context, resp PipelineTemplateDefinitionsClientListResponse) (*policy.Request, error) { - return runtime.NewRequest(ctx, http.MethodGet, *resp.PipelineTemplateDefinitionListResult.NextLink) + Fetcher: func(ctx context.Context, page *PipelineTemplateDefinitionsClientListResponse) (PipelineTemplateDefinitionsClientListResponse, 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 PipelineTemplateDefinitionsClientListResponse{}, err + } + resp, err := client.pl.Do(req) + if err != nil { + return PipelineTemplateDefinitionsClientListResponse{}, err + } + if !runtime.HasStatusCode(resp, http.StatusOK) { + return PipelineTemplateDefinitionsClientListResponse{}, runtime.NewResponseError(resp) + } + return client.listHandleResponse(resp) }, - } + }) } // listCreateRequest creates the List request. @@ -75,7 +96,7 @@ func (client *PipelineTemplateDefinitionsClient) listCreateRequest(ctx context.C // listHandleResponse handles the List response. func (client *PipelineTemplateDefinitionsClient) listHandleResponse(resp *http.Response) (PipelineTemplateDefinitionsClientListResponse, error) { - result := PipelineTemplateDefinitionsClientListResponse{RawResponse: resp} + result := PipelineTemplateDefinitionsClientListResponse{} if err := runtime.UnmarshalAsJSON(resp, &result.PipelineTemplateDefinitionListResult); err != nil { return PipelineTemplateDefinitionsClientListResponse{}, err } diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_pollers.go b/sdk/resourcemanager/devops/armdevops/zz_generated_pollers.go deleted file mode 100644 index acae7a2dfdf3..000000000000 --- a/sdk/resourcemanager/devops/armdevops/zz_generated_pollers.go +++ /dev/null @@ -1,58 +0,0 @@ -//go:build go1.16 -// +build go1.16 - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for 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 armdevops - -import ( - "context" - "github.com/Azure/azure-sdk-for-go/sdk/azcore" - "net/http" -) - -// PipelinesClientCreateOrUpdatePoller provides polling facilities until the operation reaches a terminal state. -type PipelinesClientCreateOrUpdatePoller struct { - pt *azcore.Poller -} - -// Done returns true if the LRO has reached a terminal state. -func (p *PipelinesClientCreateOrUpdatePoller) Done() bool { - return p.pt.Done() -} - -// Poll fetches the latest state of the LRO. It returns an HTTP response or error. -// If the LRO has completed successfully, the poller's state is updated and the HTTP -// response is returned. -// If the LRO has completed with failure or was cancelled, the poller's state is -// updated and the error is returned. -// If the LRO has not reached a terminal state, the poller's state is updated and -// the latest HTTP response is returned. -// If Poll fails, the poller's state is unmodified and the error is returned. -// Calling Poll on an LRO that has reached a terminal state will return the final -// HTTP response or error. -func (p *PipelinesClientCreateOrUpdatePoller) Poll(ctx context.Context) (*http.Response, error) { - return p.pt.Poll(ctx) -} - -// FinalResponse performs a final GET to the service and returns the final response -// for the polling operation. If there is an error performing the final GET then an error is returned. -// If the final GET succeeded then the final PipelinesClientCreateOrUpdateResponse will be returned. -func (p *PipelinesClientCreateOrUpdatePoller) FinalResponse(ctx context.Context) (PipelinesClientCreateOrUpdateResponse, error) { - respType := PipelinesClientCreateOrUpdateResponse{} - resp, err := p.pt.FinalResponse(ctx, &respType.Pipeline) - if err != nil { - return PipelinesClientCreateOrUpdateResponse{}, err - } - respType.RawResponse = resp - return respType, nil -} - -// ResumeToken returns a value representing the poller that can be used to resume -// the LRO at a later time. ResumeTokens are unique per service operation. -func (p *PipelinesClientCreateOrUpdatePoller) ResumeToken() (string, error) { - return p.pt.ResumeToken() -} diff --git a/sdk/resourcemanager/devops/armdevops/zz_generated_response_types.go b/sdk/resourcemanager/devops/armdevops/zz_generated_response_types.go index d2bdc20416c5..097574ed5de2 100644 --- a/sdk/resourcemanager/devops/armdevops/zz_generated_response_types.go +++ b/sdk/resourcemanager/devops/armdevops/zz_generated_response_types.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -8,139 +8,42 @@ package armdevops -import ( - "context" - armruntime "github.com/Azure/azure-sdk-for-go/sdk/azcore/arm/runtime" - "net/http" - "time" -) - // OperationsClientListResponse contains the response from method OperationsClient.List. type OperationsClientListResponse struct { - OperationsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// OperationsClientListResult contains the result from method OperationsClient.List. -type OperationsClientListResult struct { OperationListResult } // PipelineTemplateDefinitionsClientListResponse contains the response from method PipelineTemplateDefinitionsClient.List. type PipelineTemplateDefinitionsClientListResponse struct { - PipelineTemplateDefinitionsClientListResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PipelineTemplateDefinitionsClientListResult contains the result from method PipelineTemplateDefinitionsClient.List. -type PipelineTemplateDefinitionsClientListResult struct { PipelineTemplateDefinitionListResult } -// PipelinesClientCreateOrUpdatePollerResponse contains the response from method PipelinesClient.CreateOrUpdate. -type PipelinesClientCreateOrUpdatePollerResponse struct { - // Poller contains an initialized poller. - Poller *PipelinesClientCreateOrUpdatePoller - - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PollUntilDone will poll the service endpoint until a terminal state is reached or an error is received. -// freq: the time to wait between intervals in absence of a Retry-After header. Allowed minimum is one second. -// A good starting value is 30 seconds. Note that some resources might benefit from a different value. -func (l PipelinesClientCreateOrUpdatePollerResponse) PollUntilDone(ctx context.Context, freq time.Duration) (PipelinesClientCreateOrUpdateResponse, error) { - respType := PipelinesClientCreateOrUpdateResponse{} - resp, err := l.Poller.pt.PollUntilDone(ctx, freq, &respType.Pipeline) - if err != nil { - return respType, err - } - respType.RawResponse = resp - return respType, nil -} - -// Resume rehydrates a PipelinesClientCreateOrUpdatePollerResponse from the provided client and resume token. -func (l *PipelinesClientCreateOrUpdatePollerResponse) Resume(ctx context.Context, client *PipelinesClient, token string) error { - pt, err := armruntime.NewPollerFromResumeToken("PipelinesClient.CreateOrUpdate", token, client.pl) - if err != nil { - return err - } - poller := &PipelinesClientCreateOrUpdatePoller{ - pt: pt, - } - resp, err := poller.Poll(ctx) - if err != nil { - return err - } - l.Poller = poller - l.RawResponse = resp - return nil -} - // PipelinesClientCreateOrUpdateResponse contains the response from method PipelinesClient.CreateOrUpdate. type PipelinesClientCreateOrUpdateResponse struct { - PipelinesClientCreateOrUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PipelinesClientCreateOrUpdateResult contains the result from method PipelinesClient.CreateOrUpdate. -type PipelinesClientCreateOrUpdateResult struct { Pipeline } // PipelinesClientDeleteResponse contains the response from method PipelinesClient.Delete. type PipelinesClientDeleteResponse struct { - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response + // placeholder for future response values } // PipelinesClientGetResponse contains the response from method PipelinesClient.Get. type PipelinesClientGetResponse struct { - PipelinesClientGetResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PipelinesClientGetResult contains the result from method PipelinesClient.Get. -type PipelinesClientGetResult struct { Pipeline } // PipelinesClientListByResourceGroupResponse contains the response from method PipelinesClient.ListByResourceGroup. type PipelinesClientListByResourceGroupResponse struct { - PipelinesClientListByResourceGroupResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PipelinesClientListByResourceGroupResult contains the result from method PipelinesClient.ListByResourceGroup. -type PipelinesClientListByResourceGroupResult struct { PipelineListResult } // PipelinesClientListBySubscriptionResponse contains the response from method PipelinesClient.ListBySubscription. type PipelinesClientListBySubscriptionResponse struct { - PipelinesClientListBySubscriptionResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PipelinesClientListBySubscriptionResult contains the result from method PipelinesClient.ListBySubscription. -type PipelinesClientListBySubscriptionResult struct { PipelineListResult } // PipelinesClientUpdateResponse contains the response from method PipelinesClient.Update. type PipelinesClientUpdateResponse struct { - PipelinesClientUpdateResult - // RawResponse contains the underlying HTTP response. - RawResponse *http.Response -} - -// PipelinesClientUpdateResult contains the result from method PipelinesClient.Update. -type PipelinesClientUpdateResult struct { Pipeline } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/CHANGELOG.md b/sdk/resourcemanager/devtestlabs/armdevtestlabs/CHANGELOG.md index e948df7ba633..502218f04058 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/CHANGELOG.md +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/CHANGELOG.md @@ -1,5 +1,1010 @@ # Release History +## 0.3.0 (2022-04-11) +### Breaking Changes + +- Function `*VirtualMachinesClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualMachinesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientCreateOrUpdateResponse], error)` +- Function `*ArmTemplatesClient.List` return value(s) have been changed from `(*ArmTemplatesClientListPager)` to `(*runtime.Pager[ArmTemplatesClientListResponse])` +- Function `*DisksClient.BeginCreateOrUpdate` return value(s) have been changed from `(DisksClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[DisksClientCreateOrUpdateResponse], error)` +- Function `*VirtualMachinesClient.BeginUnClaim` return value(s) have been changed from `(VirtualMachinesClientUnClaimPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientUnClaimResponse], error)` +- Function `NewPolicySetsClient` return value(s) have been changed from `(*PolicySetsClient)` to `(*PolicySetsClient, error)` +- Function `*CustomImagesClient.List` return value(s) have been changed from `(*CustomImagesClientListPager)` to `(*runtime.Pager[CustomImagesClientListResponse])` +- Function `*ArtifactsClient.List` return value(s) have been changed from `(*ArtifactsClientListPager)` to `(*runtime.Pager[ArtifactsClientListResponse])` +- Function `*CustomImagesClient.BeginCreateOrUpdate` return value(s) have been changed from `(CustomImagesClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[CustomImagesClientCreateOrUpdateResponse], error)` +- Function `*ServiceFabricSchedulesClient.List` return value(s) have been changed from `(*ServiceFabricSchedulesClientListPager)` to `(*runtime.Pager[ServiceFabricSchedulesClientListResponse])` +- Function `*ProviderOperationsClient.List` return value(s) have been changed from `(*ProviderOperationsClientListPager)` to `(*runtime.Pager[ProviderOperationsClientListResponse])` +- Function `*VirtualMachinesClient.BeginResize` return value(s) have been changed from `(VirtualMachinesClientResizePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientResizeResponse], error)` +- Function `NewFormulasClient` return value(s) have been changed from `(*FormulasClient)` to `(*FormulasClient, error)` +- Function `NewServiceFabricsClient` return value(s) have been changed from `(*ServiceFabricsClient)` to `(*ServiceFabricsClient, error)` +- Function `NewServiceRunnersClient` return value(s) have been changed from `(*ServiceRunnersClient)` to `(*ServiceRunnersClient, error)` +- Function `*SecretsClient.BeginCreateOrUpdate` return value(s) have been changed from `(SecretsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[SecretsClientCreateOrUpdateResponse], error)` +- Function `*VirtualNetworksClient.BeginCreateOrUpdate` return value(s) have been changed from `(VirtualNetworksClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[VirtualNetworksClientCreateOrUpdateResponse], error)` +- Function `NewDisksClient` return value(s) have been changed from `(*DisksClient)` to `(*DisksClient, error)` +- Function `*LabsClient.BeginDelete` return value(s) have been changed from `(LabsClientDeletePollerResponse, error)` to `(*armruntime.Poller[LabsClientDeleteResponse], error)` +- Function `NewServiceFabricSchedulesClient` return value(s) have been changed from `(*ServiceFabricSchedulesClient)` to `(*ServiceFabricSchedulesClient, error)` +- Function `*SchedulesClient.BeginExecute` return value(s) have been changed from `(SchedulesClientExecutePollerResponse, error)` to `(*armruntime.Poller[SchedulesClientExecuteResponse], error)` +- Function `*ServiceFabricsClient.BeginStart` return value(s) have been changed from `(ServiceFabricsClientStartPollerResponse, error)` to `(*armruntime.Poller[ServiceFabricsClientStartResponse], error)` +- Function `*FormulasClient.BeginCreateOrUpdate` return value(s) have been changed from `(FormulasClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[FormulasClientCreateOrUpdateResponse], error)` +- Function `NewArtifactsClient` return value(s) have been changed from `(*ArtifactsClient)` to `(*ArtifactsClient, error)` +- Function `*VirtualMachineSchedulesClient.BeginExecute` return value(s) have been changed from `(VirtualMachineSchedulesClientExecutePollerResponse, error)` to `(*armruntime.Poller[VirtualMachineSchedulesClientExecuteResponse], error)` +- Function `NewUsersClient` return value(s) have been changed from `(*UsersClient)` to `(*UsersClient, error)` +- Function `*GlobalSchedulesClient.ListByResourceGroup` return value(s) have been changed from `(*GlobalSchedulesClientListByResourceGroupPager)` to `(*runtime.Pager[GlobalSchedulesClientListByResourceGroupResponse])` +- Function `NewVirtualNetworksClient` return value(s) have been changed from `(*VirtualNetworksClient)` to `(*VirtualNetworksClient, error)` +- Function `NewNotificationChannelsClient` return value(s) have been changed from `(*NotificationChannelsClient)` to `(*NotificationChannelsClient, error)` +- Function `*LabsClient.ListVhds` return value(s) have been changed from `(*LabsClientListVhdsPager)` to `(*runtime.Pager[LabsClientListVhdsResponse])` +- Function `NewVirtualMachineSchedulesClient` return value(s) have been changed from `(*VirtualMachineSchedulesClient)` to `(*VirtualMachineSchedulesClient, error)` +- Function `*EnvironmentsClient.BeginDelete` return value(s) have been changed from `(EnvironmentsClientDeletePollerResponse, error)` to `(*armruntime.Poller[EnvironmentsClientDeleteResponse], error)` +- Function `NewVirtualMachinesClient` return value(s) have been changed from `(*VirtualMachinesClient)` to `(*VirtualMachinesClient, error)` +- Function `*ServiceFabricsClient.BeginStop` return value(s) have been changed from `(ServiceFabricsClientStopPollerResponse, error)` to `(*armruntime.Poller[ServiceFabricsClientStopResponse], error)` +- Function `*LabsClient.ListByResourceGroup` return value(s) have been changed from `(*LabsClientListByResourceGroupPager)` to `(*runtime.Pager[LabsClientListByResourceGroupResponse])` +- Function `*SecretsClient.List` return value(s) have been changed from `(*SecretsClientListPager)` to `(*runtime.Pager[SecretsClientListResponse])` +- Function `*DisksClient.BeginDetach` return value(s) have been changed from `(DisksClientDetachPollerResponse, error)` to `(*armruntime.Poller[DisksClientDetachResponse], error)` +- Function `NewArmTemplatesClient` return value(s) have been changed from `(*ArmTemplatesClient)` to `(*ArmTemplatesClient, error)` +- Function `*VirtualNetworksClient.List` return value(s) have been changed from `(*VirtualNetworksClientListPager)` to `(*runtime.Pager[VirtualNetworksClientListResponse])` +- Function `*PoliciesClient.List` return value(s) have been changed from `(*PoliciesClientListPager)` to `(*runtime.Pager[PoliciesClientListResponse])` +- Function `*VirtualNetworksClient.BeginDelete` return value(s) have been changed from `(VirtualNetworksClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualNetworksClientDeleteResponse], error)` +- Function `NewPoliciesClient` return value(s) have been changed from `(*PoliciesClient)` to `(*PoliciesClient, error)` +- Function `*GlobalSchedulesClient.BeginRetarget` return value(s) have been changed from `(GlobalSchedulesClientRetargetPollerResponse, error)` to `(*armruntime.Poller[GlobalSchedulesClientRetargetResponse], error)` +- Function `*ArtifactSourcesClient.List` return value(s) have been changed from `(*ArtifactSourcesClientListPager)` to `(*runtime.Pager[ArtifactSourcesClientListResponse])` +- Function `NewEnvironmentsClient` return value(s) have been changed from `(*EnvironmentsClient)` to `(*EnvironmentsClient, error)` +- Function `NewOperationsClient` return value(s) have been changed from `(*OperationsClient)` to `(*OperationsClient, error)` +- Function `*EnvironmentsClient.BeginCreateOrUpdate` return value(s) have been changed from `(EnvironmentsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[EnvironmentsClientCreateOrUpdateResponse], error)` +- Function `*ServiceFabricsClient.BeginCreateOrUpdate` return value(s) have been changed from `(ServiceFabricsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[ServiceFabricsClientCreateOrUpdateResponse], error)` +- Function `*VirtualMachinesClient.BeginStop` return value(s) have been changed from `(VirtualMachinesClientStopPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientStopResponse], error)` +- Function `*VirtualMachinesClient.BeginDetachDataDisk` return value(s) have been changed from `(VirtualMachinesClientDetachDataDiskPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientDetachDataDiskResponse], error)` +- Function `*GlobalSchedulesClient.ListBySubscription` return value(s) have been changed from `(*GlobalSchedulesClientListBySubscriptionPager)` to `(*runtime.Pager[GlobalSchedulesClientListBySubscriptionResponse])` +- Function `*SchedulesClient.ListApplicable` return value(s) have been changed from `(*SchedulesClientListApplicablePager)` to `(*runtime.Pager[SchedulesClientListApplicableResponse])` +- Function `*ServiceFabricsClient.BeginDelete` return value(s) have been changed from `(ServiceFabricsClientDeletePollerResponse, error)` to `(*armruntime.Poller[ServiceFabricsClientDeleteResponse], error)` +- Function `*LabsClient.BeginClaimAnyVM` return value(s) have been changed from `(LabsClientClaimAnyVMPollerResponse, error)` to `(*armruntime.Poller[LabsClientClaimAnyVMResponse], error)` +- Function `*ServiceFabricsClient.List` return value(s) have been changed from `(*ServiceFabricsClientListPager)` to `(*runtime.Pager[ServiceFabricsClientListResponse])` +- Function `*VirtualMachinesClient.BeginRedeploy` return value(s) have been changed from `(VirtualMachinesClientRedeployPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientRedeployResponse], error)` +- Function `NewSchedulesClient` return value(s) have been changed from `(*SchedulesClient)` to `(*SchedulesClient, error)` +- Function `*NotificationChannelsClient.List` return value(s) have been changed from `(*NotificationChannelsClientListPager)` to `(*runtime.Pager[NotificationChannelsClientListResponse])` +- Function `*CustomImagesClient.BeginDelete` return value(s) have been changed from `(CustomImagesClientDeletePollerResponse, error)` to `(*armruntime.Poller[CustomImagesClientDeleteResponse], error)` +- Function `NewLabsClient` return value(s) have been changed from `(*LabsClient)` to `(*LabsClient, error)` +- Function `NewProviderOperationsClient` return value(s) have been changed from `(*ProviderOperationsClient)` to `(*ProviderOperationsClient, error)` +- Function `NewSecretsClient` return value(s) have been changed from `(*SecretsClient)` to `(*SecretsClient, error)` +- Function `*VirtualMachinesClient.BeginRestart` return value(s) have been changed from `(VirtualMachinesClientRestartPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientRestartResponse], error)` +- Function `*VirtualMachinesClient.BeginAddDataDisk` return value(s) have been changed from `(VirtualMachinesClientAddDataDiskPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientAddDataDiskResponse], error)` +- Function `*DisksClient.BeginDelete` return value(s) have been changed from `(DisksClientDeletePollerResponse, error)` to `(*armruntime.Poller[DisksClientDeleteResponse], error)` +- Function `*VirtualMachinesClient.BeginClaim` return value(s) have been changed from `(VirtualMachinesClientClaimPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientClaimResponse], error)` +- Function `*VirtualMachineSchedulesClient.List` return value(s) have been changed from `(*VirtualMachineSchedulesClientListPager)` to `(*runtime.Pager[VirtualMachineSchedulesClientListResponse])` +- Function `*LabsClient.BeginCreateOrUpdate` return value(s) have been changed from `(LabsClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[LabsClientCreateOrUpdateResponse], error)` +- Function `*SchedulesClient.List` return value(s) have been changed from `(*SchedulesClientListPager)` to `(*runtime.Pager[SchedulesClientListResponse])` +- Function `*UsersClient.List` return value(s) have been changed from `(*UsersClientListPager)` to `(*runtime.Pager[UsersClientListResponse])` +- Function `NewArtifactSourcesClient` return value(s) have been changed from `(*ArtifactSourcesClient)` to `(*ArtifactSourcesClient, error)` +- Function `*VirtualMachinesClient.BeginStart` return value(s) have been changed from `(VirtualMachinesClientStartPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientStartResponse], error)` +- Function `*FormulasClient.List` return value(s) have been changed from `(*FormulasClientListPager)` to `(*runtime.Pager[FormulasClientListResponse])` +- Function `*DisksClient.BeginAttach` return value(s) have been changed from `(DisksClientAttachPollerResponse, error)` to `(*armruntime.Poller[DisksClientAttachResponse], error)` +- Function `*LabsClient.ListBySubscription` return value(s) have been changed from `(*LabsClientListBySubscriptionPager)` to `(*runtime.Pager[LabsClientListBySubscriptionResponse])` +- Function `*UsersClient.BeginCreateOrUpdate` return value(s) have been changed from `(UsersClientCreateOrUpdatePollerResponse, error)` to `(*armruntime.Poller[UsersClientCreateOrUpdateResponse], error)` +- Function `*EnvironmentsClient.List` return value(s) have been changed from `(*EnvironmentsClientListPager)` to `(*runtime.Pager[EnvironmentsClientListResponse])` +- Function `*LabsClient.BeginImportVirtualMachine` return value(s) have been changed from `(LabsClientImportVirtualMachinePollerResponse, error)` to `(*armruntime.Poller[LabsClientImportVirtualMachineResponse], error)` +- Function `*GalleryImagesClient.List` return value(s) have been changed from `(*GalleryImagesClientListPager)` to `(*runtime.Pager[GalleryImagesClientListResponse])` +- Function `*ServiceFabricSchedulesClient.BeginExecute` return value(s) have been changed from `(ServiceFabricSchedulesClientExecutePollerResponse, error)` to `(*armruntime.Poller[ServiceFabricSchedulesClientExecuteResponse], error)` +- Function `*VirtualMachinesClient.BeginDelete` return value(s) have been changed from `(VirtualMachinesClientDeletePollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientDeleteResponse], error)` +- Function `NewGalleryImagesClient` return value(s) have been changed from `(*GalleryImagesClient)` to `(*GalleryImagesClient, error)` +- Function `NewCustomImagesClient` return value(s) have been changed from `(*CustomImagesClient)` to `(*CustomImagesClient, error)` +- Function `*LabsClient.BeginCreateEnvironment` return value(s) have been changed from `(LabsClientCreateEnvironmentPollerResponse, error)` to `(*armruntime.Poller[LabsClientCreateEnvironmentResponse], error)` +- Function `NewCostsClient` return value(s) have been changed from `(*CostsClient)` to `(*CostsClient, error)` +- Function `NewGlobalSchedulesClient` return value(s) have been changed from `(*GlobalSchedulesClient)` to `(*GlobalSchedulesClient, error)` +- Function `*UsersClient.BeginDelete` return value(s) have been changed from `(UsersClientDeletePollerResponse, error)` to `(*armruntime.Poller[UsersClientDeleteResponse], error)` +- Function `*LabsClient.BeginExportResourceUsage` return value(s) have been changed from `(LabsClientExportResourceUsagePollerResponse, error)` to `(*armruntime.Poller[LabsClientExportResourceUsageResponse], error)` +- Function `*VirtualMachinesClient.BeginTransferDisks` return value(s) have been changed from `(VirtualMachinesClientTransferDisksPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientTransferDisksResponse], error)` +- Function `*DisksClient.List` return value(s) have been changed from `(*DisksClientListPager)` to `(*runtime.Pager[DisksClientListResponse])` +- Function `*VirtualMachinesClient.BeginApplyArtifacts` return value(s) have been changed from `(VirtualMachinesClientApplyArtifactsPollerResponse, error)` to `(*armruntime.Poller[VirtualMachinesClientApplyArtifactsResponse], error)` +- Function `*VirtualMachinesClient.List` return value(s) have been changed from `(*VirtualMachinesClientListPager)` to `(*runtime.Pager[VirtualMachinesClientListResponse])` +- Function `*GlobalSchedulesClient.BeginExecute` return value(s) have been changed from `(GlobalSchedulesClientExecutePollerResponse, error)` to `(*armruntime.Poller[GlobalSchedulesClientExecuteResponse], error)` +- Type of `ArmTemplateInfo.Parameters` has been changed from `map[string]interface{}` to `interface{}` +- Type of `ArmTemplateInfo.Template` has been changed from `map[string]interface{}` to `interface{}` +- Type of `ArtifactProperties.Parameters` has been changed from `map[string]interface{}` to `interface{}` +- Type of `ParametersValueFileInfo.ParametersValueInfo` has been changed from `map[string]interface{}` to `interface{}` +- Type of `ArmTemplateProperties.Contents` has been changed from `map[string]interface{}` to `interface{}` +- Function `*LabsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `EnvironmentPermission.ToPtr` has been removed +- Function `*LabsClientImportVirtualMachinePollerResponse.Resume` has been removed +- Function `*VirtualMachinesClientClaimPoller.Poll` has been removed +- Function `*ArtifactSourcesClientListPager.NextPage` has been removed +- Function `*PoliciesClientListPager.Err` has been removed +- Function `*ServiceFabricsClientDeletePoller.FinalResponse` has been removed +- Function `*VirtualNetworksClientDeletePoller.Done` has been removed +- Function `*VirtualNetworksClientListPager.Err` has been removed +- Function `*VirtualMachinesClientApplyArtifactsPoller.ResumeToken` has been removed +- Function `*LabsClientExportResourceUsagePollerResponse.Resume` has been removed +- Function `*ServiceFabricsClientDeletePoller.ResumeToken` has been removed +- Function `LabsClientImportVirtualMachinePollerResponse.PollUntilDone` has been removed +- Function `*VirtualMachinesClientStartPoller.Poll` has been removed +- Function `*PoliciesClientListPager.NextPage` has been removed +- Function `*SecretsClientListPager.PageResponse` has been removed +- Function `*VirtualNetworksClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*SchedulesClientListApplicablePager.NextPage` has been removed +- Function `*LabsClientDeletePoller.Poll` has been removed +- Function `VirtualMachinesClientUnClaimPollerResponse.PollUntilDone` has been removed +- Function `*DisksClientDetachPoller.ResumeToken` has been removed +- Function `*ServiceFabricSchedulesClientExecutePoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientDeletePollerResponse.Resume` has been removed +- Function `ServiceFabricsClientStopPollerResponse.PollUntilDone` has been removed +- Function `VirtualMachinesClientAddDataDiskPollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricSchedulesClientExecutePollerResponse.Resume` has been removed +- Function `*LabsClientExportResourceUsagePoller.ResumeToken` has been removed +- Function `*FormulasClientCreateOrUpdatePoller.Done` has been removed +- Function `*VirtualNetworksClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*SecretsClientCreateOrUpdatePoller.Poll` has been removed +- Function `*EnvironmentsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientStartPoller.ResumeToken` has been removed +- Function `*UsersClientDeletePoller.ResumeToken` has been removed +- Function `LabsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*CustomImagesClientDeletePollerResponse.Resume` has been removed +- Function `*CustomImagesClientListPager.NextPage` has been removed +- Function `*ArtifactSourcesClientListPager.Err` has been removed +- Function `*EnvironmentsClientListPager.Err` has been removed +- Function `VirtualMachinesClientRestartPollerResponse.PollUntilDone` has been removed +- Function `*NotificationChannelsClientListPager.PageResponse` has been removed +- Function `*DisksClientDeletePoller.FinalResponse` has been removed +- Function `ServiceFabricsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*FormulasClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*LabsClientListBySubscriptionPager.PageResponse` has been removed +- Function `*VirtualMachinesClientRestartPoller.FinalResponse` has been removed +- Function `*CustomImagesClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*LabsClientListByResourceGroupPager.NextPage` has been removed +- Function `*GlobalSchedulesClientRetargetPollerResponse.Resume` has been removed +- Function `*UsersClientListPager.PageResponse` has been removed +- Function `VirtualMachineSchedulesClientExecutePollerResponse.PollUntilDone` has been removed +- Function `*GalleryImagesClientListPager.NextPage` has been removed +- Function `*DisksClientListPager.NextPage` has been removed +- Function `*VirtualMachinesClientCreateOrUpdatePoller.Poll` has been removed +- Function `*FormulasClientListPager.Err` has been removed +- Function `*VirtualNetworksClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*LabsClientImportVirtualMachinePoller.ResumeToken` has been removed +- Function `*GlobalSchedulesClientListBySubscriptionPager.NextPage` has been removed +- Function `*CustomImagesClientCreateOrUpdatePoller.Poll` has been removed +- Function `*UsersClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*VirtualMachinesClientApplyArtifactsPollerResponse.Resume` has been removed +- Function `*DisksClientDetachPoller.FinalResponse` has been removed +- Function `*LabsClientClaimAnyVMPoller.Poll` has been removed +- Function `HostCachingOptions.ToPtr` has been removed +- Function `*VirtualMachinesClientAddDataDiskPoller.FinalResponse` has been removed +- Function `*VirtualNetworksClientListPager.PageResponse` has been removed +- Function `*ServiceFabricsClientListPager.PageResponse` has been removed +- Function `VirtualNetworksClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*CustomImagesClientDeletePoller.Done` has been removed +- Function `DisksClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientStopPoller.Done` has been removed +- Function `*VirtualMachinesClientRestartPoller.ResumeToken` has been removed +- Function `*ServiceFabricsClientStartPoller.ResumeToken` has been removed +- Function `*ServiceFabricsClientCreateOrUpdatePoller.Poll` has been removed +- Function `*UsersClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*DisksClientAttachPoller.Done` has been removed +- Function `*ProviderOperationsClientListPager.Err` has been removed +- Function `*NotificationChannelsClientListPager.Err` has been removed +- Function `*VirtualMachinesClientRedeployPoller.Poll` has been removed +- Function `*SchedulesClientExecutePoller.ResumeToken` has been removed +- Function `*ProviderOperationsClientListPager.PageResponse` has been removed +- Function `*ArtifactSourcesClientListPager.PageResponse` has been removed +- Function `*GlobalSchedulesClientExecutePoller.ResumeToken` has been removed +- Function `PolicyFactName.ToPtr` has been removed +- Function `*SecretsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*VirtualMachinesClientCreateOrUpdatePoller.Done` has been removed +- Function `LinuxOsState.ToPtr` has been removed +- Function `*ServiceFabricsClientCreateOrUpdatePoller.Done` has been removed +- Function `DisksClientDetachPollerResponse.PollUntilDone` has been removed +- Function `TransportProtocol.ToPtr` has been removed +- Function `*VirtualMachinesClientDetachDataDiskPoller.Poll` has been removed +- Function `TargetCostStatus.ToPtr` has been removed +- Function `*VirtualMachinesClientRestartPoller.Poll` has been removed +- Function `VirtualMachinesClientRedeployPollerResponse.PollUntilDone` has been removed +- Function `*VirtualMachinesClientUnClaimPoller.ResumeToken` has been removed +- Function `*LabsClientCreateEnvironmentPoller.Done` has been removed +- Function `*ServiceFabricsClientStopPoller.ResumeToken` has been removed +- Function `*DisksClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*GlobalSchedulesClientRetargetPoller.Poll` has been removed +- Function `SourceControlType.ToPtr` has been removed +- Function `*CustomImagesClientCreateOrUpdatePoller.Done` has been removed +- Function `*VirtualMachinesClientResizePoller.Done` has been removed +- Function `*DisksClientAttachPoller.FinalResponse` has been removed +- Function `UsersClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientStartPoller.FinalResponse` has been removed +- Function `*EnvironmentsClientListPager.PageResponse` has been removed +- Function `*SecretsClientListPager.Err` has been removed +- Function `*VirtualMachinesClientUnClaimPoller.FinalResponse` has been removed +- Function `*PoliciesClientListPager.PageResponse` has been removed +- Function `*VirtualMachinesClientApplyArtifactsPoller.Done` has been removed +- Function `*VirtualMachineSchedulesClientExecutePollerResponse.Resume` has been removed +- Function `*VirtualMachineSchedulesClientExecutePoller.FinalResponse` has been removed +- Function `*VirtualMachineSchedulesClientExecutePoller.Poll` has been removed +- Function `*VirtualMachinesClientDeletePoller.Done` has been removed +- Function `*VirtualMachinesClientResizePollerResponse.Resume` has been removed +- Function `*DisksClientCreateOrUpdatePoller.Poll` has been removed +- Function `*VirtualMachinesClientApplyArtifactsPoller.Poll` has been removed +- Function `*VirtualMachinesClientDetachDataDiskPoller.ResumeToken` has been removed +- Function `*VirtualNetworksClientDeletePoller.FinalResponse` has been removed +- Function `*UsersClientListPager.Err` has been removed +- Function `*EnvironmentsClientDeletePoller.Done` has been removed +- Function `*GlobalSchedulesClientListBySubscriptionPager.PageResponse` has been removed +- Function `*ServiceFabricSchedulesClientExecutePoller.Poll` has been removed +- Function `VirtualMachinesClientClaimPollerResponse.PollUntilDone` has been removed +- Function `*VirtualMachinesClientUnClaimPollerResponse.Resume` has been removed +- Function `*VirtualMachinesClientStopPoller.Done` has been removed +- Function `HTTPStatusCode.ToPtr` has been removed +- Function `FileUploadOptions.ToPtr` has been removed +- Function `*GlobalSchedulesClientRetargetPoller.ResumeToken` has been removed +- Function `*GlobalSchedulesClientListBySubscriptionPager.Err` has been removed +- Function `GlobalSchedulesClientRetargetPollerResponse.PollUntilDone` has been removed +- Function `*VirtualNetworksClientDeletePoller.Poll` has been removed +- Function `*SchedulesClientListPager.Err` has been removed +- Function `*ServiceFabricSchedulesClientListPager.PageResponse` has been removed +- Function `*VirtualMachinesClientStopPoller.FinalResponse` has been removed +- Function `*VirtualMachinesClientAddDataDiskPoller.ResumeToken` has been removed +- Function `ManagedIdentityType.ToPtr` has been removed +- Function `*VirtualMachinesClientTransferDisksPoller.Done` has been removed +- Function `*UsersClientListPager.NextPage` has been removed +- Function `CostType.ToPtr` has been removed +- Function `LabsClientClaimAnyVMPollerResponse.PollUntilDone` has been removed +- Function `*VirtualMachinesClientTransferDisksPoller.FinalResponse` has been removed +- Function `VirtualMachineCreationSource.ToPtr` has been removed +- Function `EnableStatus.ToPtr` has been removed +- Function `*DisksClientAttachPoller.ResumeToken` has been removed +- Function `*LabsClientImportVirtualMachinePoller.Poll` has been removed +- Function `VirtualMachinesClientStopPollerResponse.PollUntilDone` has been removed +- Function `*LabsClientExportResourceUsagePoller.Done` has been removed +- Function `*VirtualMachineSchedulesClientListPager.NextPage` has been removed +- Function `*VirtualMachinesClientClaimPoller.ResumeToken` has been removed +- Function `*UsersClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientAddDataDiskPollerResponse.Resume` has been removed +- Function `*VirtualMachinesClientTransferDisksPoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientRedeployPollerResponse.Resume` has been removed +- Function `*UsersClientDeletePoller.Done` has been removed +- Function `*DisksClientDeletePoller.Poll` has been removed +- Function `*LabsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*LabsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `VirtualMachinesClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*LabsClientListVhdsPager.Err` has been removed +- Function `*VirtualMachinesClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*VirtualMachinesClientDetachDataDiskPollerResponse.Resume` has been removed +- Function `*EnvironmentsClientListPager.NextPage` has been removed +- Function `*LabsClientDeletePoller.ResumeToken` has been removed +- Function `*EnvironmentsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `PolicyEvaluatorType.ToPtr` has been removed +- Function `CustomImageOsType.ToPtr` has been removed +- Function `NotificationChannelEventType.ToPtr` has been removed +- Function `*LabsClientImportVirtualMachinePoller.Done` has been removed +- Function `*ServiceFabricsClientListPager.NextPage` has been removed +- Function `*DisksClientDetachPollerResponse.Resume` has been removed +- Function `*UsersClientCreateOrUpdatePoller.Done` has been removed +- Function `*LabsClientListBySubscriptionPager.Err` has been removed +- Function `*VirtualMachinesClientApplyArtifactsPoller.FinalResponse` has been removed +- Function `*LabsClientCreateEnvironmentPoller.FinalResponse` has been removed +- Function `LabsClientExportResourceUsagePollerResponse.PollUntilDone` has been removed +- Function `*EnvironmentsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*ServiceFabricsClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*EnvironmentsClientDeletePoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientDeletePoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientRedeployPoller.Done` has been removed +- Function `*LabsClientClaimAnyVMPoller.Done` has been removed +- Function `DisksClientAttachPollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientStartPollerResponse.Resume` has been removed +- Function `*VirtualMachinesClientTransferDisksPoller.Poll` has been removed +- Function `*FormulasClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*LabsClientListByResourceGroupPager.PageResponse` has been removed +- Function `*DisksClientListPager.Err` has been removed +- Function `*LabsClientClaimAnyVMPollerResponse.Resume` has been removed +- Function `*VirtualMachinesClientClaimPoller.Done` has been removed +- Function `*VirtualMachinesClientRedeployPoller.FinalResponse` has been removed +- Function `*GlobalSchedulesClientExecutePoller.FinalResponse` has been removed +- Function `*SchedulesClientExecutePoller.FinalResponse` has been removed +- Function `*LabsClientCreateOrUpdatePoller.Poll` has been removed +- Function `PremiumDataDisk.ToPtr` has been removed +- Function `*EnvironmentsClientDeletePoller.Poll` has been removed +- Function `*CustomImagesClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*UsersClientDeletePollerResponse.Resume` has been removed +- Function `*FormulasClientListPager.PageResponse` has been removed +- Function `*VirtualMachinesClientAddDataDiskPoller.Poll` has been removed +- Function `*EnvironmentsClientCreateOrUpdatePoller.Done` has been removed +- Function `*GlobalSchedulesClientExecutePoller.Poll` has been removed +- Function `*FormulasClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `VirtualMachinesClientApplyArtifactsPollerResponse.PollUntilDone` has been removed +- Function `*DisksClientDetachPoller.Poll` has been removed +- Function `*VirtualMachinesClientListPager.PageResponse` has been removed +- Function `*CustomImagesClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `*SecretsClientListPager.NextPage` has been removed +- Function `*SecretsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*VirtualNetworksClientCreateOrUpdatePoller.Done` has been removed +- Function `VirtualMachinesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `ServiceFabricSchedulesClientExecutePollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientListPager.Err` has been removed +- Function `*VirtualMachinesClientStopPollerResponse.Resume` has been removed +- Function `*VirtualMachinesClientRestartPoller.Done` has been removed +- Function `*VirtualNetworksClientListPager.NextPage` has been removed +- Function `*VirtualMachineSchedulesClientListPager.PageResponse` has been removed +- Function `*GlobalSchedulesClientListByResourceGroupPager.PageResponse` has been removed +- Function `*FormulasClientCreateOrUpdatePoller.Poll` has been removed +- Function `GlobalSchedulesClientExecutePollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientDeletePollerResponse.Resume` has been removed +- Function `*GalleryImagesClientListPager.Err` has been removed +- Function `LabsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*CustomImagesClientDeletePoller.ResumeToken` has been removed +- Function `*LabsClientImportVirtualMachinePoller.FinalResponse` has been removed +- Function `*ArtifactsClientListPager.NextPage` has been removed +- Function `*CustomImagesClientListPager.Err` has been removed +- Function `*LabsClientListBySubscriptionPager.NextPage` has been removed +- Function `*ArmTemplatesClientListPager.Err` has been removed +- Function `VirtualMachinesClientResizePollerResponse.PollUntilDone` has been removed +- Function `*VirtualMachinesClientStopPoller.Poll` has been removed +- Function `*LabsClientExportResourceUsagePoller.FinalResponse` has been removed +- Function `UsagePermissionType.ToPtr` has been removed +- Function `UsersClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientStopPoller.FinalResponse` has been removed +- Function `ServiceFabricsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*VirtualNetworksClientDeletePollerResponse.Resume` has been removed +- Function `*SchedulesClientListPager.NextPage` has been removed +- Function `*VirtualMachinesClientClaimPoller.FinalResponse` has been removed +- Function `*CustomImagesClientDeletePoller.FinalResponse` has been removed +- Function `*GlobalSchedulesClientExecutePollerResponse.Resume` has been removed +- Function `EnvironmentsClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*LabsClientListVhdsPager.NextPage` has been removed +- Function `*LabsClientDeletePollerResponse.Resume` has been removed +- Function `*NotificationChannelsClientListPager.NextPage` has been removed +- Function `*SecretsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientStartPollerResponse.Resume` has been removed +- Function `*LabsClientListByResourceGroupPager.Err` has been removed +- Function `*ServiceFabricSchedulesClientExecutePoller.Done` has been removed +- Function `*FormulasClientListPager.NextPage` has been removed +- Function `*VirtualMachinesClientTransferDisksPollerResponse.Resume` has been removed +- Function `*LabsClientCreateEnvironmentPoller.ResumeToken` has been removed +- Function `*LabsClientCreateEnvironmentPollerResponse.Resume` has been removed +- Function `*GalleryImagesClientListPager.PageResponse` has been removed +- Function `*VirtualMachinesClientDetachDataDiskPoller.FinalResponse` has been removed +- Function `*LabsClientExportResourceUsagePoller.Poll` has been removed +- Function `*SecretsClientCreateOrUpdatePoller.Done` has been removed +- Function `*VirtualMachinesClientStartPoller.Done` has been removed +- Function `*ArtifactsClientListPager.Err` has been removed +- Function `*CustomImagesClientDeletePoller.Poll` has been removed +- Function `*DisksClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `PolicyStatus.ToPtr` has been removed +- Function `*DisksClientListPager.PageResponse` has been removed +- Function `*ArmTemplatesClientListPager.PageResponse` has been removed +- Function `*SchedulesClientExecutePollerResponse.Resume` has been removed +- Function `*ArtifactsClientListPager.PageResponse` has been removed +- Function `CostThresholdStatus.ToPtr` has been removed +- Function `*ServiceFabricsClientDeletePoller.Done` has been removed +- Function `*EnvironmentsClientDeletePollerResponse.Resume` has been removed +- Function `*VirtualMachinesClientListPager.Err` has been removed +- Function `*EnvironmentsClientCreateOrUpdatePoller.Poll` has been removed +- Function `*VirtualMachinesClientUnClaimPoller.Poll` has been removed +- Function `*ServiceFabricSchedulesClientListPager.Err` has been removed +- Function `*SchedulesClientListPager.PageResponse` has been removed +- Function `*VirtualMachinesClientAddDataDiskPoller.Done` has been removed +- Function `SchedulesClientExecutePollerResponse.PollUntilDone` has been removed +- Function `FormulasClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientStopPoller.Poll` has been removed +- Function `*ServiceFabricsClientStartPoller.Poll` has been removed +- Function `*LabsClientClaimAnyVMPoller.ResumeToken` has been removed +- Function `*LabsClientDeletePoller.FinalResponse` has been removed +- Function `ReportingCycleType.ToPtr` has been removed +- Function `*ServiceFabricSchedulesClientExecutePoller.FinalResponse` has been removed +- Function `*VirtualMachinesClientUnClaimPoller.Done` has been removed +- Function `*ServiceFabricSchedulesClientListPager.NextPage` has been removed +- Function `EnvironmentsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*VirtualMachinesClientListPager.NextPage` has been removed +- Function `*VirtualMachinesClientClaimPollerResponse.Resume` has been removed +- Function `VirtualMachinesClientStartPollerResponse.PollUntilDone` has been removed +- Function `*VirtualNetworksClientCreateOrUpdatePoller.Poll` has been removed +- Function `*UsersClientDeletePoller.FinalResponse` has been removed +- Function `*SchedulesClientListApplicablePager.Err` has been removed +- Function `*VirtualMachineSchedulesClientExecutePoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientResizePoller.ResumeToken` has been removed +- Function `*GlobalSchedulesClientRetargetPoller.FinalResponse` has been removed +- Function `*LabsClientClaimAnyVMPoller.FinalResponse` has been removed +- Function `*EnvironmentsClientDeletePoller.FinalResponse` has been removed +- Function `*GlobalSchedulesClientRetargetPoller.Done` has been removed +- Function `*VirtualMachinesClientRestartPollerResponse.Resume` has been removed +- Function `*GlobalSchedulesClientExecutePoller.Done` has been removed +- Function `ServiceFabricsClientStartPollerResponse.PollUntilDone` has been removed +- Function `*SchedulesClientExecutePoller.Done` has been removed +- Function `*SchedulesClientListApplicablePager.PageResponse` has been removed +- Function `*VirtualMachinesClientResizePoller.FinalResponse` has been removed +- Function `*VirtualMachineSchedulesClientExecutePoller.Done` has been removed +- Function `*LabsClientCreateOrUpdatePoller.Done` has been removed +- Function `LabsClientCreateEnvironmentPollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*CustomImagesClientListPager.PageResponse` has been removed +- Function `*DisksClientDeletePoller.Done` has been removed +- Function `*VirtualMachineSchedulesClientListPager.Err` has been removed +- Function `*ServiceFabricsClientStopPollerResponse.Resume` has been removed +- Function `VirtualMachinesClientDetachDataDiskPollerResponse.PollUntilDone` has been removed +- Function `StorageType.ToPtr` has been removed +- Function `*VirtualMachinesClientResizePoller.Poll` has been removed +- Function `*DisksClientDeletePoller.ResumeToken` has been removed +- Function `*LabsClientDeletePoller.Done` has been removed +- Function `*DisksClientAttachPoller.Poll` has been removed +- Function `*VirtualMachinesClientStartPoller.FinalResponse` has been removed +- Function `*GlobalSchedulesClientListByResourceGroupPager.Err` has been removed +- Function `*VirtualMachinesClientRedeployPoller.ResumeToken` has been removed +- Function `VirtualNetworksClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*VirtualMachinesClientCreateOrUpdatePoller.ResumeToken` has been removed +- Function `*UsersClientDeletePoller.Poll` has been removed +- Function `*VirtualMachinesClientDetachDataDiskPoller.Done` has been removed +- Function `*DisksClientCreateOrUpdatePoller.FinalResponse` has been removed +- Function `VirtualMachinesClientTransferDisksPollerResponse.PollUntilDone` has been removed +- Function `*VirtualNetworksClientDeletePoller.ResumeToken` has been removed +- Function `SecretsClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*DisksClientDetachPoller.Done` has been removed +- Function `*ProviderOperationsClientListPager.NextPage` has been removed +- Function `CustomImagesClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*DisksClientAttachPollerResponse.Resume` has been removed +- Function `*ArmTemplatesClientListPager.NextPage` has been removed +- Function `DisksClientCreateOrUpdatePollerResponse.PollUntilDone` has been removed +- Function `*DisksClientCreateOrUpdatePoller.Done` has been removed +- Function `*SchedulesClientExecutePoller.Poll` has been removed +- Function `*ServiceFabricsClientStartPoller.Done` has been removed +- Function `*DisksClientDeletePollerResponse.Resume` has been removed +- Function `*UsersClientCreateOrUpdatePoller.Poll` has been removed +- Function `*LabsClientListVhdsPager.PageResponse` has been removed +- Function `*VirtualMachinesClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `*VirtualMachinesClientDeletePoller.FinalResponse` has been removed +- Function `*ServiceFabricsClientDeletePoller.Poll` has been removed +- Function `*LabsClientCreateEnvironmentPoller.Poll` has been removed +- Function `*VirtualMachinesClientStopPoller.ResumeToken` has been removed +- Function `*VirtualMachinesClientDeletePoller.Poll` has been removed +- Function `CustomImagesClientDeletePollerResponse.PollUntilDone` has been removed +- Function `*ServiceFabricsClientCreateOrUpdatePollerResponse.Resume` has been removed +- Function `WindowsOsState.ToPtr` has been removed +- Function `*GlobalSchedulesClientListByResourceGroupPager.NextPage` has been removed +- Struct `ArmTemplatesClientGetResult` has been removed +- Struct `ArmTemplatesClientListPager` has been removed +- Struct `ArmTemplatesClientListResult` has been removed +- Struct `ArtifactSourcesClientCreateOrUpdateResult` has been removed +- Struct `ArtifactSourcesClientGetResult` has been removed +- Struct `ArtifactSourcesClientListPager` has been removed +- Struct `ArtifactSourcesClientListResult` has been removed +- Struct `ArtifactSourcesClientUpdateResult` has been removed +- Struct `ArtifactsClientGenerateArmTemplateResult` has been removed +- Struct `ArtifactsClientGetResult` has been removed +- Struct `ArtifactsClientListPager` has been removed +- Struct `ArtifactsClientListResult` has been removed +- Struct `CostsClientCreateOrUpdateResult` has been removed +- Struct `CostsClientGetResult` has been removed +- Struct `CustomImagesClientCreateOrUpdatePoller` has been removed +- Struct `CustomImagesClientCreateOrUpdatePollerResponse` has been removed +- Struct `CustomImagesClientCreateOrUpdateResult` has been removed +- Struct `CustomImagesClientDeletePoller` has been removed +- Struct `CustomImagesClientDeletePollerResponse` has been removed +- Struct `CustomImagesClientGetResult` has been removed +- Struct `CustomImagesClientListPager` has been removed +- Struct `CustomImagesClientListResult` has been removed +- Struct `CustomImagesClientUpdateResult` has been removed +- Struct `DisksClientAttachPoller` has been removed +- Struct `DisksClientAttachPollerResponse` 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 `DisksClientDetachPoller` has been removed +- Struct `DisksClientDetachPollerResponse` has been removed +- Struct `DisksClientGetResult` has been removed +- Struct `DisksClientListPager` has been removed +- Struct `DisksClientListResult` has been removed +- Struct `DisksClientUpdateResult` has been removed +- Struct `EnvironmentsClientCreateOrUpdatePoller` has been removed +- Struct `EnvironmentsClientCreateOrUpdatePollerResponse` has been removed +- Struct `EnvironmentsClientCreateOrUpdateResult` has been removed +- Struct `EnvironmentsClientDeletePoller` has been removed +- Struct `EnvironmentsClientDeletePollerResponse` has been removed +- Struct `EnvironmentsClientGetResult` has been removed +- Struct `EnvironmentsClientListPager` has been removed +- Struct `EnvironmentsClientListResult` has been removed +- Struct `EnvironmentsClientUpdateResult` has been removed +- Struct `FormulasClientCreateOrUpdatePoller` has been removed +- Struct `FormulasClientCreateOrUpdatePollerResponse` has been removed +- Struct `FormulasClientCreateOrUpdateResult` has been removed +- Struct `FormulasClientGetResult` has been removed +- Struct `FormulasClientListPager` has been removed +- Struct `FormulasClientListResult` has been removed +- Struct `FormulasClientUpdateResult` has been removed +- Struct `GalleryImagesClientListPager` has been removed +- Struct `GalleryImagesClientListResult` has been removed +- Struct `GlobalSchedulesClientCreateOrUpdateResult` has been removed +- Struct `GlobalSchedulesClientExecutePoller` has been removed +- Struct `GlobalSchedulesClientExecutePollerResponse` has been removed +- Struct `GlobalSchedulesClientGetResult` has been removed +- Struct `GlobalSchedulesClientListByResourceGroupPager` has been removed +- Struct `GlobalSchedulesClientListByResourceGroupResult` has been removed +- Struct `GlobalSchedulesClientListBySubscriptionPager` has been removed +- Struct `GlobalSchedulesClientListBySubscriptionResult` has been removed +- Struct `GlobalSchedulesClientRetargetPoller` has been removed +- Struct `GlobalSchedulesClientRetargetPollerResponse` has been removed +- Struct `GlobalSchedulesClientUpdateResult` has been removed +- Struct `LabsClientClaimAnyVMPoller` has been removed +- Struct `LabsClientClaimAnyVMPollerResponse` has been removed +- Struct `LabsClientCreateEnvironmentPoller` has been removed +- Struct `LabsClientCreateEnvironmentPollerResponse` has been removed +- Struct `LabsClientCreateOrUpdatePoller` has been removed +- Struct `LabsClientCreateOrUpdatePollerResponse` has been removed +- Struct `LabsClientCreateOrUpdateResult` has been removed +- Struct `LabsClientDeletePoller` has been removed +- Struct `LabsClientDeletePollerResponse` has been removed +- Struct `LabsClientExportResourceUsagePoller` has been removed +- Struct `LabsClientExportResourceUsagePollerResponse` has been removed +- Struct `LabsClientGenerateUploadURIResult` has been removed +- Struct `LabsClientGetResult` has been removed +- Struct `LabsClientImportVirtualMachinePoller` has been removed +- Struct `LabsClientImportVirtualMachinePollerResponse` has been removed +- Struct `LabsClientListByResourceGroupPager` has been removed +- Struct `LabsClientListByResourceGroupResult` has been removed +- Struct `LabsClientListBySubscriptionPager` has been removed +- Struct `LabsClientListBySubscriptionResult` has been removed +- Struct `LabsClientListVhdsPager` has been removed +- Struct `LabsClientListVhdsResult` has been removed +- Struct `LabsClientUpdateResult` has been removed +- Struct `NotificationChannelsClientCreateOrUpdateResult` has been removed +- Struct `NotificationChannelsClientGetResult` has been removed +- Struct `NotificationChannelsClientListPager` has been removed +- Struct `NotificationChannelsClientListResult` has been removed +- Struct `NotificationChannelsClientUpdateResult` has been removed +- Struct `OperationsClientGetResult` has been removed +- Struct `PoliciesClientCreateOrUpdateResult` has been removed +- Struct `PoliciesClientGetResult` has been removed +- Struct `PoliciesClientListPager` has been removed +- Struct `PoliciesClientListResult` has been removed +- Struct `PoliciesClientUpdateResult` has been removed +- Struct `PolicySetsClientEvaluatePoliciesResult` has been removed +- Struct `ProviderOperationsClientListPager` has been removed +- Struct `ProviderOperationsClientListResult` has been removed +- Struct `SchedulesClientCreateOrUpdateResult` has been removed +- Struct `SchedulesClientExecutePoller` has been removed +- Struct `SchedulesClientExecutePollerResponse` has been removed +- Struct `SchedulesClientGetResult` has been removed +- Struct `SchedulesClientListApplicablePager` has been removed +- Struct `SchedulesClientListApplicableResult` has been removed +- Struct `SchedulesClientListPager` has been removed +- Struct `SchedulesClientListResult` has been removed +- Struct `SchedulesClientUpdateResult` has been removed +- Struct `SecretsClientCreateOrUpdatePoller` has been removed +- Struct `SecretsClientCreateOrUpdatePollerResponse` has been removed +- Struct `SecretsClientCreateOrUpdateResult` has been removed +- Struct `SecretsClientGetResult` has been removed +- Struct `SecretsClientListPager` has been removed +- Struct `SecretsClientListResult` has been removed +- Struct `SecretsClientUpdateResult` has been removed +- Struct `ServiceFabricSchedulesClientCreateOrUpdateResult` has been removed +- Struct `ServiceFabricSchedulesClientExecutePoller` has been removed +- Struct `ServiceFabricSchedulesClientExecutePollerResponse` has been removed +- Struct `ServiceFabricSchedulesClientGetResult` has been removed +- Struct `ServiceFabricSchedulesClientListPager` has been removed +- Struct `ServiceFabricSchedulesClientListResult` has been removed +- Struct `ServiceFabricSchedulesClientUpdateResult` has been removed +- Struct `ServiceFabricsClientCreateOrUpdatePoller` has been removed +- Struct `ServiceFabricsClientCreateOrUpdatePollerResponse` has been removed +- Struct `ServiceFabricsClientCreateOrUpdateResult` has been removed +- Struct `ServiceFabricsClientDeletePoller` has been removed +- Struct `ServiceFabricsClientDeletePollerResponse` has been removed +- Struct `ServiceFabricsClientGetResult` has been removed +- Struct `ServiceFabricsClientListApplicableSchedulesResult` has been removed +- Struct `ServiceFabricsClientListPager` has been removed +- Struct `ServiceFabricsClientListResult` has been removed +- Struct `ServiceFabricsClientStartPoller` has been removed +- Struct `ServiceFabricsClientStartPollerResponse` has been removed +- Struct `ServiceFabricsClientStopPoller` has been removed +- Struct `ServiceFabricsClientStopPollerResponse` has been removed +- Struct `ServiceFabricsClientUpdateResult` has been removed +- Struct `ServiceRunnersClientCreateOrUpdateResult` has been removed +- Struct `ServiceRunnersClientGetResult` has been removed +- Struct `UsersClientCreateOrUpdatePoller` has been removed +- Struct `UsersClientCreateOrUpdatePollerResponse` has been removed +- Struct `UsersClientCreateOrUpdateResult` has been removed +- Struct `UsersClientDeletePoller` has been removed +- Struct `UsersClientDeletePollerResponse` has been removed +- Struct `UsersClientGetResult` has been removed +- Struct `UsersClientListPager` has been removed +- Struct `UsersClientListResult` has been removed +- Struct `UsersClientUpdateResult` has been removed +- Struct `VirtualMachineSchedulesClientCreateOrUpdateResult` has been removed +- Struct `VirtualMachineSchedulesClientExecutePoller` has been removed +- Struct `VirtualMachineSchedulesClientExecutePollerResponse` has been removed +- Struct `VirtualMachineSchedulesClientGetResult` has been removed +- Struct `VirtualMachineSchedulesClientListPager` has been removed +- Struct `VirtualMachineSchedulesClientListResult` has been removed +- Struct `VirtualMachineSchedulesClientUpdateResult` has been removed +- Struct `VirtualMachinesClientAddDataDiskPoller` has been removed +- Struct `VirtualMachinesClientAddDataDiskPollerResponse` has been removed +- Struct `VirtualMachinesClientApplyArtifactsPoller` has been removed +- Struct `VirtualMachinesClientApplyArtifactsPollerResponse` has been removed +- Struct `VirtualMachinesClientClaimPoller` has been removed +- Struct `VirtualMachinesClientClaimPollerResponse` has been removed +- Struct `VirtualMachinesClientCreateOrUpdatePoller` has been removed +- Struct `VirtualMachinesClientCreateOrUpdatePollerResponse` has been removed +- Struct `VirtualMachinesClientCreateOrUpdateResult` has been removed +- Struct `VirtualMachinesClientDeletePoller` has been removed +- Struct `VirtualMachinesClientDeletePollerResponse` has been removed +- Struct `VirtualMachinesClientDetachDataDiskPoller` has been removed +- Struct `VirtualMachinesClientDetachDataDiskPollerResponse` has been removed +- Struct `VirtualMachinesClientGetRdpFileContentsResult` has been removed +- Struct `VirtualMachinesClientGetResult` has been removed +- Struct `VirtualMachinesClientListApplicableSchedulesResult` has been removed +- Struct `VirtualMachinesClientListPager` has been removed +- Struct `VirtualMachinesClientListResult` has been removed +- Struct `VirtualMachinesClientRedeployPoller` has been removed +- Struct `VirtualMachinesClientRedeployPollerResponse` has been removed +- Struct `VirtualMachinesClientResizePoller` has been removed +- Struct `VirtualMachinesClientResizePollerResponse` has been removed +- Struct `VirtualMachinesClientRestartPoller` has been removed +- Struct `VirtualMachinesClientRestartPollerResponse` has been removed +- Struct `VirtualMachinesClientStartPoller` has been removed +- Struct `VirtualMachinesClientStartPollerResponse` has been removed +- Struct `VirtualMachinesClientStopPoller` has been removed +- Struct `VirtualMachinesClientStopPollerResponse` has been removed +- Struct `VirtualMachinesClientTransferDisksPoller` has been removed +- Struct `VirtualMachinesClientTransferDisksPollerResponse` has been removed +- Struct `VirtualMachinesClientUnClaimPoller` has been removed +- Struct `VirtualMachinesClientUnClaimPollerResponse` has been removed +- Struct `VirtualMachinesClientUpdateResult` has been removed +- Struct `VirtualNetworksClientCreateOrUpdatePoller` has been removed +- Struct `VirtualNetworksClientCreateOrUpdatePollerResponse` has been removed +- Struct `VirtualNetworksClientCreateOrUpdateResult` has been removed +- Struct `VirtualNetworksClientDeletePoller` has been removed +- Struct `VirtualNetworksClientDeletePollerResponse` has been removed +- Struct `VirtualNetworksClientGetResult` has been removed +- Struct `VirtualNetworksClientListPager` has been removed +- Struct `VirtualNetworksClientListResult` has been removed +- Struct `VirtualNetworksClientUpdateResult` has been removed +- Field `ServiceFabricsClientUpdateResult` of struct `ServiceFabricsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricsClientUpdateResponse` has been removed +- Field `ArtifactSourcesClientListResult` of struct `ArtifactSourcesClientListResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientListResponse` has been removed +- Field `DisksClientListResult` of struct `DisksClientListResponse` has been removed +- Field `RawResponse` of struct `DisksClientListResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientDeleteResponse` has been removed +- Field `RawResponse` of struct `ServiceRunnersClientDeleteResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientClaimResponse` has been removed +- Field `PolicySetsClientEvaluatePoliciesResult` of struct `PolicySetsClientEvaluatePoliciesResponse` has been removed +- Field `RawResponse` of struct `PolicySetsClientEvaluatePoliciesResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientRedeployResponse` has been removed +- Field `RawResponse` of struct `GlobalSchedulesClientDeleteResponse` has been removed +- Field `RawResponse` of struct `DisksClientDetachResponse` has been removed +- Field `ArtifactsClientGenerateArmTemplateResult` of struct `ArtifactsClientGenerateArmTemplateResponse` has been removed +- Field `RawResponse` of struct `ArtifactsClientGenerateArmTemplateResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientDeleteResponse` has been removed +- Field `GlobalSchedulesClientCreateOrUpdateResult` of struct `GlobalSchedulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `GlobalSchedulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `UsersClientDeleteResponse` has been removed +- Field `ServiceFabricsClientListApplicableSchedulesResult` of struct `ServiceFabricsClientListApplicableSchedulesResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricsClientListApplicableSchedulesResponse` has been removed +- Field `VirtualNetworksClientGetResult` of struct `VirtualNetworksClientGetResponse` has been removed +- Field `RawResponse` of struct `VirtualNetworksClientGetResponse` has been removed +- Field `SchedulesClientUpdateResult` of struct `SchedulesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `SchedulesClientUpdateResponse` has been removed +- Field `GlobalSchedulesClientGetResult` of struct `GlobalSchedulesClientGetResponse` has been removed +- Field `RawResponse` of struct `GlobalSchedulesClientGetResponse` has been removed +- Field `UsersClientListResult` of struct `UsersClientListResponse` has been removed +- Field `RawResponse` of struct `UsersClientListResponse` has been removed +- Field `PoliciesClientUpdateResult` of struct `PoliciesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `PoliciesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientStopResponse` has been removed +- Field `CostsClientCreateOrUpdateResult` of struct `CostsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `CostsClientCreateOrUpdateResponse` has been removed +- Field `VirtualNetworksClientListResult` of struct `VirtualNetworksClientListResponse` has been removed +- Field `RawResponse` of struct `VirtualNetworksClientListResponse` has been removed +- Field `RawResponse` of struct `LabsClientClaimAnyVMResponse` has been removed +- Field `RawResponse` of struct `NotificationChannelsClientDeleteResponse` has been removed +- Field `RawResponse` of struct `FormulasClientDeleteResponse` has been removed +- Field `SchedulesClientListApplicableResult` of struct `SchedulesClientListApplicableResponse` has been removed +- Field `RawResponse` of struct `SchedulesClientListApplicableResponse` has been removed +- Field `SecretsClientUpdateResult` of struct `SecretsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `SecretsClientUpdateResponse` has been removed +- Field `NotificationChannelsClientUpdateResult` of struct `NotificationChannelsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `NotificationChannelsClientUpdateResponse` has been removed +- Field `ServiceFabricsClientGetResult` of struct `ServiceFabricsClientGetResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricsClientGetResponse` has been removed +- Field `ServiceFabricSchedulesClientCreateOrUpdateResult` of struct `ServiceFabricSchedulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricSchedulesClientCreateOrUpdateResponse` has been removed +- Field `SecretsClientGetResult` of struct `SecretsClientGetResponse` has been removed +- Field `RawResponse` of struct `SecretsClientGetResponse` has been removed +- Field `ServiceFabricSchedulesClientGetResult` of struct `ServiceFabricSchedulesClientGetResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricSchedulesClientGetResponse` has been removed +- Field `RawResponse` of struct `GlobalSchedulesClientRetargetResponse` has been removed +- Field `RawResponse` of struct `SecretsClientDeleteResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientUnClaimResponse` has been removed +- Field `DisksClientGetResult` of struct `DisksClientGetResponse` has been removed +- Field `RawResponse` of struct `DisksClientGetResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricsClientStopResponse` has been removed +- Field `RawResponse` of struct `LabsClientExportResourceUsageResponse` has been removed +- Field `RawResponse` of struct `LabsClientImportVirtualMachineResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientApplyArtifactsResponse` has been removed +- Field `RawResponse` of struct `VirtualMachineSchedulesClientExecuteResponse` has been removed +- Field `ArmTemplatesClientListResult` of struct `ArmTemplatesClientListResponse` has been removed +- Field `RawResponse` of struct `ArmTemplatesClientListResponse` has been removed +- Field `SecretsClientCreateOrUpdateResult` of struct `SecretsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `SecretsClientCreateOrUpdateResponse` has been removed +- Field `ProviderOperationsClientListResult` of struct `ProviderOperationsClientListResponse` has been removed +- Field `RawResponse` of struct `ProviderOperationsClientListResponse` has been removed +- Field `RawResponse` of struct `DisksClientAttachResponse` has been removed +- Field `CustomImagesClientCreateOrUpdateResult` of struct `CustomImagesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `CustomImagesClientCreateOrUpdateResponse` has been removed +- Field `GalleryImagesClientListResult` of struct `GalleryImagesClientListResponse` has been removed +- Field `RawResponse` of struct `GalleryImagesClientListResponse` has been removed +- Field `EnvironmentsClientGetResult` of struct `EnvironmentsClientGetResponse` has been removed +- Field `RawResponse` of struct `EnvironmentsClientGetResponse` has been removed +- Field `SchedulesClientGetResult` of struct `SchedulesClientGetResponse` has been removed +- Field `RawResponse` of struct `SchedulesClientGetResponse` has been removed +- Field `GlobalSchedulesClientListBySubscriptionResult` of struct `GlobalSchedulesClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `GlobalSchedulesClientListBySubscriptionResponse` has been removed +- Field `UsersClientCreateOrUpdateResult` of struct `UsersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `UsersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricsClientStartResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricsClientDeleteResponse` has been removed +- Field `VirtualMachinesClientListApplicableSchedulesResult` of struct `VirtualMachinesClientListApplicableSchedulesResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientListApplicableSchedulesResponse` has been removed +- Field `LabsClientListBySubscriptionResult` of struct `LabsClientListBySubscriptionResponse` has been removed +- Field `RawResponse` of struct `LabsClientListBySubscriptionResponse` has been removed +- Field `LabsClientUpdateResult` of struct `LabsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `LabsClientUpdateResponse` has been removed +- Field `VirtualMachinesClientGetResult` of struct `VirtualMachinesClientGetResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientGetResponse` has been removed +- Field `GlobalSchedulesClientUpdateResult` of struct `GlobalSchedulesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `GlobalSchedulesClientUpdateResponse` has been removed +- Field `VirtualMachineSchedulesClientListResult` of struct `VirtualMachineSchedulesClientListResponse` has been removed +- Field `RawResponse` of struct `VirtualMachineSchedulesClientListResponse` has been removed +- Field `ServiceFabricsClientListResult` of struct `ServiceFabricsClientListResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricsClientListResponse` has been removed +- Field `ArtifactSourcesClientUpdateResult` of struct `ArtifactSourcesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricSchedulesClientExecuteResponse` has been removed +- Field `LabsClientCreateOrUpdateResult` of struct `LabsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `LabsClientCreateOrUpdateResponse` has been removed +- Field `SchedulesClientCreateOrUpdateResult` of struct `SchedulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `SchedulesClientCreateOrUpdateResponse` has been removed +- Field `ArtifactsClientListResult` of struct `ArtifactsClientListResponse` has been removed +- Field `RawResponse` of struct `ArtifactsClientListResponse` has been removed +- Field `ServiceRunnersClientGetResult` of struct `ServiceRunnersClientGetResponse` has been removed +- Field `RawResponse` of struct `ServiceRunnersClientGetResponse` has been removed +- Field `FormulasClientUpdateResult` of struct `FormulasClientUpdateResponse` has been removed +- Field `RawResponse` of struct `FormulasClientUpdateResponse` has been removed +- Field `VirtualMachineSchedulesClientUpdateResult` of struct `VirtualMachineSchedulesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachineSchedulesClientUpdateResponse` has been removed +- Field `CustomImagesClientListResult` of struct `CustomImagesClientListResponse` has been removed +- Field `RawResponse` of struct `CustomImagesClientListResponse` has been removed +- Field `LabsClientGenerateUploadURIResult` of struct `LabsClientGenerateUploadURIResponse` has been removed +- Field `RawResponse` of struct `LabsClientGenerateUploadURIResponse` has been removed +- Field `RawResponse` of struct `EnvironmentsClientDeleteResponse` has been removed +- Field `LabsClientListVhdsResult` of struct `LabsClientListVhdsResponse` has been removed +- Field `RawResponse` of struct `LabsClientListVhdsResponse` has been removed +- Field `FormulasClientCreateOrUpdateResult` of struct `FormulasClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `FormulasClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientResizeResponse` has been removed +- Field `VirtualMachinesClientListResult` of struct `VirtualMachinesClientListResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientListResponse` has been removed +- Field `SchedulesClientListResult` of struct `SchedulesClientListResponse` has been removed +- Field `RawResponse` of struct `SchedulesClientListResponse` has been removed +- Field `VirtualMachinesClientCreateOrUpdateResult` of struct `VirtualMachinesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientStartResponse` has been removed +- Field `VirtualNetworksClientUpdateResult` of struct `VirtualNetworksClientUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualNetworksClientUpdateResponse` has been removed +- Field `VirtualMachineSchedulesClientCreateOrUpdateResult` of struct `VirtualMachineSchedulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachineSchedulesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `PoliciesClientDeleteResponse` has been removed +- Field `ServiceFabricSchedulesClientUpdateResult` of struct `ServiceFabricSchedulesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricSchedulesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachineSchedulesClientDeleteResponse` has been removed +- Field `CustomImagesClientUpdateResult` of struct `CustomImagesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `CustomImagesClientUpdateResponse` has been removed +- Field `OperationsClientGetResult` of struct `OperationsClientGetResponse` has been removed +- Field `RawResponse` of struct `OperationsClientGetResponse` has been removed +- Field `PoliciesClientCreateOrUpdateResult` of struct `PoliciesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `PoliciesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `GlobalSchedulesClientExecuteResponse` has been removed +- Field `ServiceRunnersClientCreateOrUpdateResult` of struct `ServiceRunnersClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceRunnersClientCreateOrUpdateResponse` has been removed +- Field `DisksClientUpdateResult` of struct `DisksClientUpdateResponse` has been removed +- Field `RawResponse` of struct `DisksClientUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientTransferDisksResponse` has been removed +- Field `VirtualMachinesClientUpdateResult` of struct `VirtualMachinesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientDetachDataDiskResponse` has been removed +- Field `CustomImagesClientGetResult` of struct `CustomImagesClientGetResponse` has been removed +- Field `RawResponse` of struct `CustomImagesClientGetResponse` has been removed +- Field `RawResponse` of struct `LabsClientCreateEnvironmentResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientRestartResponse` has been removed +- Field `RawResponse` of struct `CustomImagesClientDeleteResponse` has been removed +- Field `EnvironmentsClientCreateOrUpdateResult` of struct `EnvironmentsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `EnvironmentsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `DisksClientDeleteResponse` has been removed +- Field `ServiceFabricsClientCreateOrUpdateResult` of struct `ServiceFabricsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricsClientCreateOrUpdateResponse` has been removed +- Field `VirtualNetworksClientCreateOrUpdateResult` of struct `VirtualNetworksClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `VirtualNetworksClientCreateOrUpdateResponse` has been removed +- Field `VirtualMachineSchedulesClientGetResult` of struct `VirtualMachineSchedulesClientGetResponse` has been removed +- Field `RawResponse` of struct `VirtualMachineSchedulesClientGetResponse` has been removed +- Field `LabsClientGetResult` of struct `LabsClientGetResponse` has been removed +- Field `RawResponse` of struct `LabsClientGetResponse` has been removed +- Field `NotificationChannelsClientCreateOrUpdateResult` of struct `NotificationChannelsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `NotificationChannelsClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `LabsClientDeleteResponse` has been removed +- Field `RawResponse` of struct `NotificationChannelsClientNotifyResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientAddDataDiskResponse` has been removed +- Field `ArtifactsClientGetResult` of struct `ArtifactsClientGetResponse` has been removed +- Field `RawResponse` of struct `ArtifactsClientGetResponse` has been removed +- Field `NotificationChannelsClientListResult` of struct `NotificationChannelsClientListResponse` has been removed +- Field `RawResponse` of struct `NotificationChannelsClientListResponse` has been removed +- Field `LabsClientListByResourceGroupResult` of struct `LabsClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `LabsClientListByResourceGroupResponse` has been removed +- Field `EnvironmentsClientUpdateResult` of struct `EnvironmentsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `EnvironmentsClientUpdateResponse` has been removed +- Field `RawResponse` of struct `SchedulesClientDeleteResponse` has been removed +- Field `ServiceFabricSchedulesClientListResult` of struct `ServiceFabricSchedulesClientListResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricSchedulesClientListResponse` has been removed +- Field `PoliciesClientGetResult` of struct `PoliciesClientGetResponse` has been removed +- Field `RawResponse` of struct `PoliciesClientGetResponse` has been removed +- Field `FormulasClientGetResult` of struct `FormulasClientGetResponse` has been removed +- Field `RawResponse` of struct `FormulasClientGetResponse` has been removed +- Field `PoliciesClientListResult` of struct `PoliciesClientListResponse` has been removed +- Field `RawResponse` of struct `PoliciesClientListResponse` has been removed +- Field `UsersClientGetResult` of struct `UsersClientGetResponse` has been removed +- Field `RawResponse` of struct `UsersClientGetResponse` has been removed +- Field `EnvironmentsClientListResult` of struct `EnvironmentsClientListResponse` has been removed +- Field `RawResponse` of struct `EnvironmentsClientListResponse` has been removed +- Field `RawResponse` of struct `ServiceFabricSchedulesClientDeleteResponse` has been removed +- Field `CostsClientGetResult` of struct `CostsClientGetResponse` has been removed +- Field `RawResponse` of struct `CostsClientGetResponse` has been removed +- Field `RawResponse` of struct `VirtualNetworksClientDeleteResponse` has been removed +- Field `ArtifactSourcesClientGetResult` of struct `ArtifactSourcesClientGetResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientGetResponse` has been removed +- Field `SecretsClientListResult` of struct `SecretsClientListResponse` has been removed +- Field `RawResponse` of struct `SecretsClientListResponse` has been removed +- Field `NotificationChannelsClientGetResult` of struct `NotificationChannelsClientGetResponse` has been removed +- Field `RawResponse` of struct `NotificationChannelsClientGetResponse` has been removed +- Field `FormulasClientListResult` of struct `FormulasClientListResponse` has been removed +- Field `RawResponse` of struct `FormulasClientListResponse` has been removed +- Field `RawResponse` of struct `SchedulesClientExecuteResponse` has been removed +- Field `VirtualMachinesClientGetRdpFileContentsResult` of struct `VirtualMachinesClientGetRdpFileContentsResponse` has been removed +- Field `RawResponse` of struct `VirtualMachinesClientGetRdpFileContentsResponse` has been removed +- Field `DisksClientCreateOrUpdateResult` of struct `DisksClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `DisksClientCreateOrUpdateResponse` has been removed +- Field `ArmTemplatesClientGetResult` of struct `ArmTemplatesClientGetResponse` has been removed +- Field `RawResponse` of struct `ArmTemplatesClientGetResponse` has been removed +- Field `GlobalSchedulesClientListByResourceGroupResult` of struct `GlobalSchedulesClientListByResourceGroupResponse` has been removed +- Field `RawResponse` of struct `GlobalSchedulesClientListByResourceGroupResponse` has been removed +- Field `ArtifactSourcesClientCreateOrUpdateResult` of struct `ArtifactSourcesClientCreateOrUpdateResponse` has been removed +- Field `RawResponse` of struct `ArtifactSourcesClientCreateOrUpdateResponse` has been removed +- Field `UsersClientUpdateResult` of struct `UsersClientUpdateResponse` has been removed +- Field `RawResponse` of struct `UsersClientUpdateResponse` has been removed + +### Features Added + +- New anonymous field `CustomImageList` in struct `CustomImagesClientListResponse` +- New anonymous field `LabVirtualMachine` in struct `VirtualMachinesClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginResizeOptions` +- New anonymous field `Disk` in struct `DisksClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginRestartOptions` +- New field `ResumeToken` in struct `CustomImagesClientBeginCreateOrUpdateOptions` +- New anonymous field `ScheduleList` in struct `VirtualMachineSchedulesClientListResponse` +- New field `ResumeToken` in struct `EnvironmentsClientBeginDeleteOptions` +- New anonymous field `NotificationChannelList` in struct `NotificationChannelsClientListResponse` +- New field `ResumeToken` in struct `UsersClientBeginCreateOrUpdateOptions` +- New anonymous field `ArmTemplateList` in struct `ArmTemplatesClientListResponse` +- New anonymous field `UserList` in struct `UsersClientListResponse` +- New anonymous field `Lab` in struct `LabsClientGetResponse` +- New anonymous field `ServiceFabric` in struct `ServiceFabricsClientCreateOrUpdateResponse` +- New anonymous field `Lab` in struct `LabsClientCreateOrUpdateResponse` +- New anonymous field `ScheduleList` in struct `SchedulesClientListResponse` +- New anonymous field `ArtifactSourceList` in struct `ArtifactSourcesClientListResponse` +- New anonymous field `LabVirtualMachine` in struct `VirtualMachinesClientUpdateResponse` +- New anonymous field `ArtifactList` in struct `ArtifactsClientListResponse` +- New anonymous field `Schedule` in struct `GlobalSchedulesClientCreateOrUpdateResponse` +- New anonymous field `GalleryImageList` in struct `GalleryImagesClientListResponse` +- New field `ResumeToken` in struct `DisksClientBeginDetachOptions` +- New anonymous field `PolicyList` in struct `PoliciesClientListResponse` +- New anonymous field `NotificationChannel` in struct `NotificationChannelsClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `UsersClientBeginDeleteOptions` +- New anonymous field `LabVirtualMachine` in struct `VirtualMachinesClientGetResponse` +- New anonymous field `Formula` in struct `FormulasClientUpdateResponse` +- New anonymous field `Schedule` in struct `VirtualMachineSchedulesClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginDeleteOptions` +- New anonymous field `LabCost` in struct `CostsClientCreateOrUpdateResponse` +- New anonymous field `LabList` in struct `LabsClientListBySubscriptionResponse` +- New anonymous field `ApplicableSchedule` in struct `ServiceFabricsClientListApplicableSchedulesResponse` +- New anonymous field `Artifact` in struct `ArtifactsClientGetResponse` +- New anonymous field `ArmTemplateInfo` in struct `ArtifactsClientGenerateArmTemplateResponse` +- New field `ResumeToken` in struct `VirtualNetworksClientBeginCreateOrUpdateOptions` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginTransferDisksOptions` +- New field `ResumeToken` in struct `VirtualNetworksClientBeginDeleteOptions` +- New anonymous field `DtlEnvironment` in struct `EnvironmentsClientCreateOrUpdateResponse` +- New anonymous field `Policy` in struct `PoliciesClientGetResponse` +- New field `ResumeToken` in struct `SchedulesClientBeginExecuteOptions` +- New anonymous field `ArtifactSource` in struct `ArtifactSourcesClientUpdateResponse` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginStopOptions` +- New anonymous field `User` in struct `UsersClientUpdateResponse` +- New anonymous field `RdpConnection` in struct `VirtualMachinesClientGetRdpFileContentsResponse` +- New anonymous field `User` in struct `UsersClientCreateOrUpdateResponse` +- New anonymous field `Schedule` in struct `ServiceFabricSchedulesClientCreateOrUpdateResponse` +- New anonymous field `NotificationChannel` in struct `NotificationChannelsClientUpdateResponse` +- New anonymous field `Secret` in struct `SecretsClientGetResponse` +- New anonymous field `LabVhdList` in struct `LabsClientListVhdsResponse` +- New anonymous field `ServiceFabric` in struct `ServiceFabricsClientGetResponse` +- New anonymous field `Schedule` in struct `ServiceFabricSchedulesClientGetResponse` +- New anonymous field `CustomImage` in struct `CustomImagesClientUpdateResponse` +- New anonymous field `User` in struct `UsersClientGetResponse` +- New anonymous field `VirtualNetwork` in struct `VirtualNetworksClientCreateOrUpdateResponse` +- New anonymous field `Policy` in struct `PoliciesClientCreateOrUpdateResponse` +- New anonymous field `DtlEnvironmentList` in struct `EnvironmentsClientListResponse` +- New field `ResumeToken` in struct `VirtualMachineSchedulesClientBeginExecuteOptions` +- New anonymous field `ScheduleList` in struct `GlobalSchedulesClientListByResourceGroupResponse` +- New anonymous field `LabVirtualMachineList` in struct `VirtualMachinesClientListResponse` +- New field `ResumeToken` in struct `SecretsClientBeginCreateOrUpdateOptions` +- New anonymous field `VirtualNetwork` in struct `VirtualNetworksClientUpdateResponse` +- New anonymous field `ArmTemplate` in struct `ArmTemplatesClientGetResponse` +- New anonymous field `GenerateUploadURIResponse` in struct `LabsClientGenerateUploadURIResponse` +- New field `ResumeToken` in struct `EnvironmentsClientBeginCreateOrUpdateOptions` +- New anonymous field `VirtualNetwork` in struct `VirtualNetworksClientGetResponse` +- New anonymous field `Schedule` in struct `GlobalSchedulesClientGetResponse` +- New anonymous field `ScheduleList` in struct `ServiceFabricSchedulesClientListResponse` +- New field `ResumeToken` in struct `LabsClientBeginDeleteOptions` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginClaimOptions` +- New field `ResumeToken` in struct `ServiceFabricsClientBeginStopOptions` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginRedeployOptions` +- New field `ResumeToken` in struct `DisksClientBeginAttachOptions` +- New anonymous field `FormulaList` in struct `FormulasClientListResponse` +- New field `ResumeToken` in struct `GlobalSchedulesClientBeginRetargetOptions` +- New anonymous field `ScheduleList` in struct `SchedulesClientListApplicableResponse` +- New anonymous field `ProviderOperationResult` in struct `ProviderOperationsClientListResponse` +- New field `ResumeToken` in struct `ServiceFabricSchedulesClientBeginExecuteOptions` +- New anonymous field `Schedule` in struct `SchedulesClientCreateOrUpdateResponse` +- New anonymous field `DtlEnvironment` in struct `EnvironmentsClientGetResponse` +- New anonymous field `ServiceRunner` in struct `ServiceRunnersClientCreateOrUpdateResponse` +- New anonymous field `Disk` in struct `DisksClientUpdateResponse` +- New field `ResumeToken` in struct `ServiceFabricsClientBeginCreateOrUpdateOptions` +- New field `ResumeToken` in struct `LabsClientBeginCreateEnvironmentOptions` +- New field `ResumeToken` in struct `ServiceFabricsClientBeginDeleteOptions` +- New anonymous field `LabCost` in struct `CostsClientGetResponse` +- New anonymous field `DtlEnvironment` in struct `EnvironmentsClientUpdateResponse` +- New field `ResumeToken` in struct `LabsClientBeginCreateOrUpdateOptions` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginUnClaimOptions` +- New anonymous field `Schedule` in struct `ServiceFabricSchedulesClientUpdateResponse` +- New anonymous field `Lab` in struct `LabsClientUpdateResponse` +- New field `ResumeToken` in struct `FormulasClientBeginCreateOrUpdateOptions` +- New anonymous field `DiskList` in struct `DisksClientListResponse` +- New anonymous field `OperationResult` in struct `OperationsClientGetResponse` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginCreateOrUpdateOptions` +- New field `ResumeToken` in struct `ServiceFabricsClientBeginStartOptions` +- New anonymous field `CustomImage` in struct `CustomImagesClientCreateOrUpdateResponse` +- New anonymous field `Schedule` in struct `VirtualMachineSchedulesClientUpdateResponse` +- New anonymous field `Schedule` in struct `GlobalSchedulesClientUpdateResponse` +- New anonymous field `Secret` in struct `SecretsClientUpdateResponse` +- New anonymous field `Formula` in struct `FormulasClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `LabsClientBeginImportVirtualMachineOptions` +- New field `ResumeToken` in struct `LabsClientBeginClaimAnyVMOptions` +- New field `ResumeToken` in struct `DisksClientBeginDeleteOptions` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginAddDataDiskOptions` +- New anonymous field `ServiceRunner` in struct `ServiceRunnersClientGetResponse` +- New anonymous field `Policy` in struct `PoliciesClientUpdateResponse` +- New anonymous field `ArtifactSource` in struct `ArtifactSourcesClientCreateOrUpdateResponse` +- New field `ResumeToken` in struct `DisksClientBeginCreateOrUpdateOptions` +- New anonymous field `LabList` in struct `LabsClientListByResourceGroupResponse` +- New anonymous field `ArtifactSource` in struct `ArtifactSourcesClientGetResponse` +- New anonymous field `Schedule` in struct `SchedulesClientGetResponse` +- New anonymous field `Secret` in struct `SecretsClientCreateOrUpdateResponse` +- New anonymous field `ScheduleList` in struct `GlobalSchedulesClientListBySubscriptionResponse` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginStartOptions` +- New anonymous field `EvaluatePoliciesResponse` in struct `PolicySetsClientEvaluatePoliciesResponse` +- New anonymous field `ServiceFabricList` in struct `ServiceFabricsClientListResponse` +- New anonymous field `Schedule` in struct `SchedulesClientUpdateResponse` +- New anonymous field `SecretList` in struct `SecretsClientListResponse` +- New anonymous field `CustomImage` in struct `CustomImagesClientGetResponse` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginApplyArtifactsOptions` +- New field `ResumeToken` in struct `CustomImagesClientBeginDeleteOptions` +- New anonymous field `NotificationChannel` in struct `NotificationChannelsClientGetResponse` +- New field `ResumeToken` in struct `GlobalSchedulesClientBeginExecuteOptions` +- New field `ResumeToken` in struct `VirtualMachinesClientBeginDetachDataDiskOptions` +- New anonymous field `Disk` in struct `DisksClientGetResponse` +- New field `ResumeToken` in struct `LabsClientBeginExportResourceUsageOptions` +- New anonymous field `ApplicableSchedule` in struct `VirtualMachinesClientListApplicableSchedulesResponse` +- New anonymous field `ServiceFabric` in struct `ServiceFabricsClientUpdateResponse` +- New anonymous field `VirtualNetworkList` in struct `VirtualNetworksClientListResponse` +- New anonymous field `Formula` in struct `FormulasClientGetResponse` +- New anonymous field `Schedule` in struct `VirtualMachineSchedulesClientGetResponse` + + ## 0.2.1 (2022-02-22) ### Other Changes diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/README.md b/sdk/resourcemanager/devtestlabs/armdevtestlabs/README.md index 9668e1d43714..b53e7d883bec 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/README.md +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/README.md @@ -11,7 +11,7 @@ The `armdevtestlabs` module provides operations for working with Azure Lab Servi ## Prerequisites - an [Azure subscription](https://azure.microsoft.com/free/) -- Go 1.16 or above +- Go 1.18 or above ## Install the package @@ -38,16 +38,18 @@ For more information on authentication, please see the documentation for `aziden Azure Lab Services 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 := armdevtestlabs.NewPolicySetsClient(, cred, nil) +client, err := armdevtestlabs.NewPolicySetsClient(, 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{ - Host: arm.AzureChina, +options := arm.ClientOptions { + ClientOptions: azcore.ClientOptions { + Cloud: cloud.AzureChina, + }, } -client := armdevtestlabs.NewPolicySetsClient(, cred, &options) +client, err := armdevtestlabs.NewPolicySetsClient(, cred, &options) ``` ## Provide Feedback diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/autorest.md b/sdk/resourcemanager/devtestlabs/armdevtestlabs/autorest.md index 1997cfe515a8..2bf281e901ac 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/autorest.md +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/autorest.md @@ -5,8 +5,8 @@ ``` yaml azure-arm: true require: -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/devtestlabs/resource-manager/readme.md -- https://github.com/Azure/azure-rest-api-specs/blob/8e4746332979ed6ff3577bdc97dd2065a7577598/specification/devtestlabs/resource-manager/readme.go.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/devtestlabs/resource-manager/readme.md +- https://github.com/Azure/azure-rest-api-specs/blob/d48ca7ed92cbb4f972eb6214bdb3200edaf78369/specification/devtestlabs/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION -module-version: 0.2.1 +module-version: 0.3.0 ``` \ No newline at end of file diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.mod b/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.mod index b086d13ca158..397af4b23d7d 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.mod +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.mod @@ -1,8 +1,21 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs -go 1.16 +go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 - github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 + github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 + github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 +) + +require ( + github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 // indirect + github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 // indirect + github.com/golang-jwt/jwt v3.2.1+incompatible // indirect + github.com/google/uuid v1.1.1 // indirect + github.com/kylelemons/godebug v1.1.0 // indirect + github.com/pkg/browser v0.0.0-20210115035449-ce105d075bb4 // indirect + golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 // indirect + golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f // indirect + golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 // indirect + golang.org/x/text v0.3.7 // indirect ) diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.sum b/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.sum index 2ce51d3b8174..56d1c32628ae 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.sum +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/go.sum @@ -1,18 +1,18 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0 h1:8wVJL0HUP5yDFXvotdewORTw7Yu88JbreWN/mobSvsQ= -github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.0/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0 h1:bLRntPH25SkY1uZ/YZW+dmxNky9r1fAHvDFrzluo+4Q= -github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.13.0/go.mod h1:TmXReXZ9yPp5D5TBRMTAtyz+UyOl15Py4hL5E5p6igQ= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3 h1:E+m3SkZCN0Bf5q7YdTs5lSm2CYY3CK4spn5OmUIiQtk= -github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0 h1:D7l5jspkc4kwBYRWoZE4DQnu6LVpLwDsMZjBKS4wZLQ= +github.com/Azure/azure-sdk-for-go/sdk/azcore v0.23.0/go.mod h1:w5pDIZuawUmY3Bj4tVx3Xb8KS96ToB0j315w9rqpAg0= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0 h1:NVS/4LOQfkBpk+B1VopIzv1ptmYeEskA8w/3K/w7vjo= +github.com/Azure/azure-sdk-for-go/sdk/azidentity v0.14.0/go.mod h1:RG0cZndeZM17StwohYclmcXSr4oOJ8b1I5hB8llIc6Y= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1 h1:sLZ/Y+P/5RRtsXWylBjB5lkgixYfm0MQPiwrSX//JSo= +github.com/Azure/azure-sdk-for-go/sdk/internal v0.9.1/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0 h1:WVsrXCnHlDDX8ls+tootqRE87/hL9S/g4ewig9RsD/c= github.com/AzureAD/microsoft-authentication-library-for-go v0.4.0/go.mod h1:Vt9sXTKwMyGcOxSmLDMnGPgqsUg7m8pe215qMLrDXw4= 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/dnaeon/go-vcr v1.1.0 h1:ReYa/UBrRyQdant9B4fNHGoCNKw6qh6P0fsdGmZpR7c= github.com/dnaeon/go-vcr v1.1.0/go.mod h1:M7tiix8f0r6mKKJ3Yq/kqU1OYf3MnfmBWVbPx/yU9ko= github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= @@ -32,21 +32,16 @@ golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897 h1:pLI5jrR7OSLijeIDcmRxNm golang.org/x/crypto v0.0.0-20201016220609-9e8e0b390897/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20210610132358-84b48f89b13b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f h1:OfiFi4JbukWwe3lzw+xunroH1mnC1e2Gy5cxNJApiSY= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/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-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654 h1:id054HUawV2/6IGm2IV8KZQjqtwAOo2CYlOToYqa0d0= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -56,4 +51,3 @@ 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-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= -gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_armtemplates_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_armtemplates_client_test.go index 495e05148357..49a91cfe31bd 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_armtemplates_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_armtemplates_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,14 +16,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_List.json func ExampleArmTemplatesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArmTemplatesClient("", cred, nil) + client, err := armdevtestlabs.NewArmTemplatesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", "", @@ -32,28 +37,32 @@ func ExampleArmTemplatesClient_List() { Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArmTemplates_Get.json func ExampleArmTemplatesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArmTemplatesClient("", cred, nil) + client, err := armdevtestlabs.NewArmTemplatesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", @@ -61,7 +70,9 @@ func ExampleArmTemplatesClient_Get() { "", &armdevtestlabs.ArmTemplatesClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ArmTemplatesClientGetResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifacts_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifacts_client_test.go index d05ea3fc092a..7174313b3726 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifacts_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifacts_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,14 +17,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_List.json func ExampleArtifactsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArtifactsClient("", cred, nil) + client, err := armdevtestlabs.NewArtifactsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", "", @@ -33,28 +38,32 @@ func ExampleArtifactsClient_List() { Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_Get.json func ExampleArtifactsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArtifactsClient("", cred, nil) + client, err := armdevtestlabs.NewArtifactsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", @@ -62,32 +71,41 @@ func ExampleArtifactsClient_Get() { "", &armdevtestlabs.ArtifactsClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ArtifactsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_GenerateArmTemplate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Artifacts_GenerateArmTemplate.json func ExampleArtifactsClient_GenerateArmTemplate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArtifactsClient("", cred, nil) + client, err := armdevtestlabs.NewArtifactsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.GenerateArmTemplate(ctx, "", "", "", "", armdevtestlabs.GenerateArmTemplateRequest{ - FileUploadOptions: armdevtestlabs.FileUploadOptions("None").ToPtr(), - Location: to.StringPtr(""), - VirtualMachineName: to.StringPtr(""), + FileUploadOptions: to.Ptr(armdevtestlabs.FileUploadOptionsNone), + Location: to.Ptr(""), + VirtualMachineName: to.Ptr(""), }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ArtifactsClientGenerateArmTemplateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifactsources_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifactsources_client_test.go index 0690c02fc886..26b07901ed4d 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifactsources_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_artifactsources_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -17,14 +17,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_List.json func ExampleArtifactSourcesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + client, err := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", &armdevtestlabs.ArtifactSourcesClientListOptions{Expand: nil, @@ -32,111 +37,137 @@ func ExampleArtifactSourcesClient_List() { Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Get.json func ExampleArtifactSourcesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + client, err := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", &armdevtestlabs.ArtifactSourcesClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ArtifactSourcesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_CreateOrUpdate.json func ExampleArtifactSourcesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + client, err := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", "", armdevtestlabs.ArtifactSource{ Tags: map[string]*string{ - "tagName1": to.StringPtr("tagValue1"), + "tagName1": to.Ptr("tagValue1"), }, Properties: &armdevtestlabs.ArtifactSourceProperties{ - ArmTemplateFolderPath: to.StringPtr(""), - BranchRef: to.StringPtr(""), - DisplayName: to.StringPtr(""), - FolderPath: to.StringPtr(""), - SecurityToken: to.StringPtr(""), - SourceType: armdevtestlabs.SourceControlType("{VsoGit|GitHub|StorageAccount}").ToPtr(), - Status: armdevtestlabs.EnableStatus("{Enabled|Disabled}").ToPtr(), - URI: to.StringPtr(""), + ArmTemplateFolderPath: to.Ptr(""), + BranchRef: to.Ptr(""), + DisplayName: to.Ptr(""), + FolderPath: to.Ptr(""), + SecurityToken: to.Ptr(""), + SourceType: to.Ptr(armdevtestlabs.SourceControlType("{VsoGit|GitHub|StorageAccount}")), + Status: to.Ptr(armdevtestlabs.EnableStatus("{Enabled|Disabled}")), + URI: to.Ptr(""), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ArtifactSourcesClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Delete.json func ExampleArtifactSourcesClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + client, err := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/ArtifactSources_Update.json func ExampleArtifactSourcesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + client, err := armdevtestlabs.NewArtifactSourcesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", "", armdevtestlabs.ArtifactSourceFragment{ Tags: map[string]*string{ - "tagName1": to.StringPtr("tagValue1"), + "tagName1": to.Ptr("tagValue1"), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.ArtifactSourcesClientUpdateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_costs_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_costs_client_test.go index 888718d7ebdc..748fe67cd6e3 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_costs_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_costs_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,95 +19,109 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_Get.json func ExampleCostsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewCostsClient("", cred, nil) + client, err := armdevtestlabs.NewCostsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", &armdevtestlabs.CostsClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.CostsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Costs_CreateOrUpdate.json func ExampleCostsClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewCostsClient("", cred, nil) + client, err := armdevtestlabs.NewCostsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", "", armdevtestlabs.LabCost{ Properties: &armdevtestlabs.LabCostProperties{ - CurrencyCode: to.StringPtr(""), - EndDateTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T23:59:59Z"); return t }()), - StartDateTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00Z"); return t }()), + CurrencyCode: to.Ptr(""), + EndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T23:59:59Z"); return t }()), + StartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00Z"); return t }()), TargetCost: &armdevtestlabs.TargetCostProperties{ CostThresholds: []*armdevtestlabs.CostThresholdProperties{ { - DisplayOnChart: armdevtestlabs.CostThresholdStatus("Disabled").ToPtr(), + DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Float64Ptr(25), + ThresholdValue: to.Ptr[float64](25), }, - SendNotificationWhenExceeded: armdevtestlabs.CostThresholdStatus("Disabled").ToPtr(), - ThresholdID: to.StringPtr(""), + SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), + ThresholdID: to.Ptr(""), }, { - DisplayOnChart: armdevtestlabs.CostThresholdStatus("Enabled").ToPtr(), + DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled), PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Float64Ptr(50), + ThresholdValue: to.Ptr[float64](50), }, - SendNotificationWhenExceeded: armdevtestlabs.CostThresholdStatus("Enabled").ToPtr(), - ThresholdID: to.StringPtr(""), + SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusEnabled), + ThresholdID: to.Ptr(""), }, { - DisplayOnChart: armdevtestlabs.CostThresholdStatus("Disabled").ToPtr(), + DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Float64Ptr(75), + ThresholdValue: to.Ptr[float64](75), }, - SendNotificationWhenExceeded: armdevtestlabs.CostThresholdStatus("Disabled").ToPtr(), - ThresholdID: to.StringPtr(""), + SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), + ThresholdID: to.Ptr(""), }, { - DisplayOnChart: armdevtestlabs.CostThresholdStatus("Disabled").ToPtr(), + DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Float64Ptr(100), + ThresholdValue: to.Ptr[float64](100), }, - SendNotificationWhenExceeded: armdevtestlabs.CostThresholdStatus("Disabled").ToPtr(), - ThresholdID: to.StringPtr(""), + SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), + ThresholdID: to.Ptr(""), }, { - DisplayOnChart: armdevtestlabs.CostThresholdStatus("Disabled").ToPtr(), + DisplayOnChart: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), PercentageThreshold: &armdevtestlabs.PercentageCostThresholdProperties{ - ThresholdValue: to.Float64Ptr(125), + ThresholdValue: to.Ptr[float64](125), }, - SendNotificationWhenExceeded: armdevtestlabs.CostThresholdStatus("Disabled").ToPtr(), - ThresholdID: to.StringPtr(""), + SendNotificationWhenExceeded: to.Ptr(armdevtestlabs.CostThresholdStatusDisabled), + ThresholdID: to.Ptr(""), }}, - CycleEndDateTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T00:00:00.000Z"); return t }()), - CycleStartDateTime: to.TimePtr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t }()), - CycleType: armdevtestlabs.ReportingCycleType("CalendarMonth").ToPtr(), - Status: armdevtestlabs.TargetCostStatus("Enabled").ToPtr(), - Target: to.Int32Ptr(100), + CycleEndDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-31T00:00:00.000Z"); return t }()), + CycleStartDateTime: to.Ptr(func() time.Time { t, _ := time.Parse(time.RFC3339Nano, "2020-12-01T00:00:00.000Z"); return t }()), + CycleType: to.Ptr(armdevtestlabs.ReportingCycleTypeCalendarMonth), + Status: to.Ptr(armdevtestlabs.TargetCostStatusEnabled), + Target: to.Ptr[int32](100), }, }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.CostsClientCreateOrUpdateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_customimages_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_customimages_client_test.go index 3c5f0c613647..30e65ba11dce 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_customimages_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_customimages_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,14 +19,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_List.json func ExampleCustomImagesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewCustomImagesClient("", cred, nil) + client, err := armdevtestlabs.NewCustomImagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", &armdevtestlabs.CustomImagesClientListOptions{Expand: nil, @@ -34,118 +39,146 @@ func ExampleCustomImagesClient_List() { Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Get.json func ExampleCustomImagesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewCustomImagesClient("", cred, nil) + client, err := armdevtestlabs.NewCustomImagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", &armdevtestlabs.CustomImagesClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.CustomImagesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_CreateOrUpdate.json func ExampleCustomImagesClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewCustomImagesClient("", cred, nil) + client, err := armdevtestlabs.NewCustomImagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", "", armdevtestlabs.CustomImage{ Tags: map[string]*string{ - "tagName1": to.StringPtr("tagValue1"), + "tagName1": to.Ptr("tagValue1"), }, Properties: &armdevtestlabs.CustomImageProperties{ - Description: to.StringPtr(""), + Description: to.Ptr(""), VM: &armdevtestlabs.CustomImagePropertiesFromVM{ LinuxOsInfo: &armdevtestlabs.LinuxOsInfo{ - LinuxOsState: armdevtestlabs.LinuxOsState("NonDeprovisioned").ToPtr(), + LinuxOsState: to.Ptr(armdevtestlabs.LinuxOsStateNonDeprovisioned), }, - SourceVMID: to.StringPtr(""), + SourceVMID: to.Ptr(""), }, }, }, - nil) + &armdevtestlabs.CustomImagesClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.CustomImagesClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Delete.json func ExampleCustomImagesClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewCustomImagesClient("", cred, nil) + client, err := armdevtestlabs.NewCustomImagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDelete(ctx, "", "", "", - nil) + &armdevtestlabs.CustomImagesClientBeginDeleteOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/CustomImages_Update.json func ExampleCustomImagesClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewCustomImagesClient("", cred, nil) + client, err := armdevtestlabs.NewCustomImagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", "", armdevtestlabs.CustomImageFragment{ Tags: map[string]*string{ - "tagName1": to.StringPtr("tagValue2"), + "tagName1": to.Ptr("tagValue2"), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.CustomImagesClientUpdateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_disks_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_disks_client_test.go index 90315de00c66..9646405e4309 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_disks_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_disks_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,14 +19,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_List.json func ExampleDisksClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewDisksClient("", cred, nil) + client, err := armdevtestlabs.NewDisksClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", "", @@ -35,28 +40,32 @@ func ExampleDisksClient_List() { Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Get.json func ExampleDisksClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewDisksClient("", cred, nil) + client, err := armdevtestlabs.NewDisksClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", @@ -64,19 +73,26 @@ func ExampleDisksClient_Get() { "", &armdevtestlabs.DisksClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DisksClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_CreateOrUpdate.json func ExampleDisksClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewDisksClient("", cred, nil) + client, err := armdevtestlabs.NewDisksClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", @@ -84,53 +100,68 @@ func ExampleDisksClient_BeginCreateOrUpdate() { "", armdevtestlabs.Disk{ Properties: &armdevtestlabs.DiskProperties{ - DiskSizeGiB: to.Int32Ptr(1023), - DiskType: armdevtestlabs.StorageType("Standard").ToPtr(), - LeasedByLabVMID: to.StringPtr(""), + DiskSizeGiB: to.Ptr[int32](1023), + DiskType: to.Ptr(armdevtestlabs.StorageTypeStandard), + LeasedByLabVMID: to.Ptr(""), }, }, - nil) + &armdevtestlabs.DisksClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.DisksClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Delete.json func ExampleDisksClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewDisksClient("", cred, nil) + client, err := armdevtestlabs.NewDisksClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDelete(ctx, "", "", "", "", - nil) + &armdevtestlabs.DisksClientBeginDeleteOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Update.json func ExampleDisksClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewDisksClient("", cred, nil) + client, err := armdevtestlabs.NewDisksClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", @@ -138,64 +169,80 @@ func ExampleDisksClient_Update() { "", armdevtestlabs.DiskFragment{ Tags: map[string]*string{ - "tagName1": to.StringPtr("tagValue1"), + "tagName1": to.Ptr("tagValue1"), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.DisksClientUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Attach.json func ExampleDisksClient_BeginAttach() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewDisksClient("", cred, nil) + client, err := armdevtestlabs.NewDisksClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginAttach(ctx, "", "", "", "", armdevtestlabs.AttachDiskProperties{ - LeasedByLabVMID: to.StringPtr(""), + LeasedByLabVMID: to.Ptr(""), }, - nil) + &armdevtestlabs.DisksClientBeginAttachOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Disks_Detach.json func ExampleDisksClient_BeginDetach() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewDisksClient("", cred, nil) + client, err := armdevtestlabs.NewDisksClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDetach(ctx, "", "", "", "", armdevtestlabs.DetachDiskProperties{ - LeasedByLabVMID: to.StringPtr(""), + LeasedByLabVMID: to.Ptr(""), }, - nil) + &armdevtestlabs.DisksClientBeginDetachOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_environments_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_environments_client_test.go index 0b843206f936..1e78174ebfca 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_environments_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_environments_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,14 +19,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_List.json func ExampleEnvironmentsClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + client, err := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", "", @@ -35,28 +40,32 @@ func ExampleEnvironmentsClient_List() { Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Get.json func ExampleEnvironmentsClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + client, err := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", @@ -64,19 +73,26 @@ func ExampleEnvironmentsClient_Get() { "", &armdevtestlabs.EnvironmentsClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.EnvironmentsClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_CreateOrUpdate.json func ExampleEnvironmentsClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + client, err := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", @@ -85,53 +101,68 @@ func ExampleEnvironmentsClient_BeginCreateOrUpdate() { armdevtestlabs.DtlEnvironment{ Properties: &armdevtestlabs.EnvironmentProperties{ DeploymentProperties: &armdevtestlabs.EnvironmentDeploymentProperties{ - ArmTemplateID: to.StringPtr(""), + ArmTemplateID: to.Ptr(""), Parameters: []*armdevtestlabs.ArmTemplateParameterProperties{}, }, }, }, - nil) + &armdevtestlabs.EnvironmentsClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.EnvironmentsClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Delete.json func ExampleEnvironmentsClient_BeginDelete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + client, err := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginDelete(ctx, "", "", "", "", - nil) + &armdevtestlabs.EnvironmentsClientBeginDeleteOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } _, err = poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Environments_Update.json func ExampleEnvironmentsClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + client, err := armdevtestlabs.NewEnvironmentsClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", @@ -139,12 +170,14 @@ func ExampleEnvironmentsClient_Update() { "", armdevtestlabs.DtlEnvironmentFragment{ Tags: map[string]*string{ - "tagName1": to.StringPtr("tagValue1"), + "tagName1": to.Ptr("tagValue1"), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.EnvironmentsClientUpdateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_formulas_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_formulas_client_test.go index 335c01714bed..41108f373276 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_formulas_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_formulas_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,14 +19,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_List.json func ExampleFormulasClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewFormulasClient("", cred, nil) + client, err := armdevtestlabs.NewFormulasClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", &armdevtestlabs.FormulasClientListOptions{Expand: nil, @@ -34,141 +39,168 @@ func ExampleFormulasClient_List() { Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Get.json func ExampleFormulasClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewFormulasClient("", cred, nil) + client, err := armdevtestlabs.NewFormulasClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", "", &armdevtestlabs.FormulasClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.FormulasClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_CreateOrUpdate.json func ExampleFormulasClient_BeginCreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewFormulasClient("", cred, nil) + client, err := armdevtestlabs.NewFormulasClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } poller, err := client.BeginCreateOrUpdate(ctx, "", "", "", armdevtestlabs.Formula{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Properties: &armdevtestlabs.FormulaProperties{ - Description: to.StringPtr(""), + Description: to.Ptr(""), FormulaContent: &armdevtestlabs.LabVirtualMachineCreationParameter{ - Location: to.StringPtr(""), + Location: to.Ptr(""), Properties: &armdevtestlabs.LabVirtualMachineCreationParameterProperties{ - AllowClaim: to.BoolPtr(false), + AllowClaim: to.Ptr(false), Artifacts: []*armdevtestlabs.ArtifactInstallProperties{ { - ArtifactID: to.StringPtr(""), + ArtifactID: to.Ptr(""), Parameters: []*armdevtestlabs.ArtifactParameterProperties{}, }}, - DisallowPublicIPAddress: to.BoolPtr(true), + DisallowPublicIPAddress: to.Ptr(true), GalleryImageReference: &armdevtestlabs.GalleryImageReference{ - Offer: to.StringPtr(""), - OSType: to.StringPtr(""), - Publisher: to.StringPtr(""), - SKU: to.StringPtr(""), - Version: to.StringPtr(""), + Offer: to.Ptr(""), + OSType: to.Ptr(""), + Publisher: to.Ptr(""), + SKU: to.Ptr(""), + Version: to.Ptr(""), }, - IsAuthenticationWithSSHKey: to.BoolPtr(false), - LabSubnetName: to.StringPtr(""), - LabVirtualNetworkID: to.StringPtr(""), + IsAuthenticationWithSSHKey: to.Ptr(false), + LabSubnetName: to.Ptr(""), + LabVirtualNetworkID: to.Ptr(""), NetworkInterface: &armdevtestlabs.NetworkInterfaceProperties{ SharedPublicIPAddressConfiguration: &armdevtestlabs.SharedPublicIPAddressConfiguration{ InboundNatRules: []*armdevtestlabs.InboundNatRule{ { - BackendPort: to.Int32Ptr(22), - TransportProtocol: armdevtestlabs.TransportProtocol("Tcp").ToPtr(), + BackendPort: to.Ptr[int32](22), + TransportProtocol: to.Ptr(armdevtestlabs.TransportProtocolTCP), }}, }, }, - Notes: to.StringPtr(""), - Size: to.StringPtr(""), - StorageType: to.StringPtr(""), - UserName: to.StringPtr(""), + Notes: to.Ptr(""), + Size: to.Ptr(""), + StorageType: to.Ptr(""), + UserName: to.Ptr(""), }, }, }, }, - nil) + &armdevtestlabs.FormulasClientBeginCreateOrUpdateOptions{ResumeToken: ""}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } res, err := poller.PollUntilDone(ctx, 30*time.Second) if err != nil { - log.Fatal(err) + log.Fatalf("failed to pull the result: %v", err) + return } - log.Printf("Response result: %#v\n", res.FormulasClientCreateOrUpdateResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Delete.json func ExampleFormulasClient_Delete() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewFormulasClient("", cred, nil) + client, err := armdevtestlabs.NewFormulasClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } _, err = client.Delete(ctx, "", "", "", nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/Formulas_Update.json func ExampleFormulasClient_Update() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewFormulasClient("", cred, nil) + client, err := armdevtestlabs.NewFormulasClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Update(ctx, "", "", "", armdevtestlabs.FormulaFragment{ Tags: map[string]*string{ - "tagName1": to.StringPtr("tagValue1"), + "tagName1": to.Ptr("tagValue1"), }, }, nil) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.FormulasClientUpdateResult) + // TODO: use response item + _ = res } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_galleryimages_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_galleryimages_client_test.go index 1770dd0ade40..7b820f63e779 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_galleryimages_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_galleryimages_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -16,14 +16,19 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GalleryImages_List.json func ExampleGalleryImagesClient_List() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewGalleryImagesClient("", cred, nil) + client, err := armdevtestlabs.NewGalleryImagesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.List("", "", &armdevtestlabs.GalleryImagesClientListOptions{Expand: nil, @@ -31,16 +36,15 @@ func ExampleGalleryImagesClient_List() { Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } diff --git a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_globalschedules_client_test.go b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_globalschedules_client_test.go index c6fe394e4a3d..d0a5b9fbfee1 100644 --- a/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_globalschedules_client_test.go +++ b/sdk/resourcemanager/devtestlabs/armdevtestlabs/ze_generated_example_globalschedules_client_test.go @@ -1,5 +1,5 @@ -//go:build go1.16 -// +build go1.16 +//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. @@ -19,196 +19,245 @@ import ( "github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/devtestlabs/armdevtestlabs" ) -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListBySubscription.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListBySubscription.json func ExampleGlobalSchedulesClient_ListBySubscription() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewGlobalSchedulesClient("", cred, nil) + client, err := armdevtestlabs.NewGlobalSchedulesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListBySubscription(&armdevtestlabs.GlobalSchedulesClientListBySubscriptionOptions{Expand: nil, Filter: nil, Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListByResourceGroup.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_ListByResourceGroup.json func ExampleGlobalSchedulesClient_ListByResourceGroup() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewGlobalSchedulesClient("", cred, nil) + client, err := armdevtestlabs.NewGlobalSchedulesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } pager := client.ListByResourceGroup("", &armdevtestlabs.GlobalSchedulesClientListByResourceGroupOptions{Expand: nil, Filter: nil, Top: nil, Orderby: nil, }) - for { - nextResult := pager.NextPage(ctx) - if err := pager.Err(); err != nil { + for pager.More() { + nextResult, err := pager.NextPage(ctx) + if err != nil { log.Fatalf("failed to advance page: %v", err) + return } - if !nextResult { - break - } - for _, v := range pager.PageResponse().Value { - log.Printf("Pager result: %#v\n", v) + for _, v := range nextResult.Value { + // TODO: use page item + _ = v } } } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_Get.json func ExampleGlobalSchedulesClient_Get() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewGlobalSchedulesClient("", cred, nil) + client, err := armdevtestlabs.NewGlobalSchedulesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.Get(ctx, "", "", &armdevtestlabs.GlobalSchedulesClientGetOptions{Expand: nil}) if err != nil { - log.Fatal(err) + log.Fatalf("failed to finish the request: %v", err) + return } - log.Printf("Response result: %#v\n", res.GlobalSchedulesClientGetResult) + // TODO: use response item + _ = res } -// x-ms-original-file: specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_CreateOrUpdate.json +// Generated from example definition: https://github.com/Azure/azure-rest-api-specs/tree/main/specification/devtestlabs/resource-manager/Microsoft.DevTestLab/stable/2018-09-15/examples/GlobalSchedules_CreateOrUpdate.json func ExampleGlobalSchedulesClient_CreateOrUpdate() { cred, err := azidentity.NewDefaultAzureCredential(nil) if err != nil { log.Fatalf("failed to obtain a credential: %v", err) + return } ctx := context.Background() - client := armdevtestlabs.NewGlobalSchedulesClient("", cred, nil) + client, err := armdevtestlabs.NewGlobalSchedulesClient("", cred, nil) + if err != nil { + log.Fatalf("failed to create client: %v", err) + return + } res, err := client.CreateOrUpdate(ctx, "", "", armdevtestlabs.Schedule{ Properties: &armdevtestlabs.ScheduleProperties{ - Status: armdevtestlabs.EnableStatus("Enabled").ToPtr(), - TaskType: to.StringPtr(""), - TimeZoneID: to.StringPtr(""), + Status: to.Ptr(armdevtestlabs.EnableStatusEnabled), + TaskType: to.Ptr(""), + TimeZoneID: to.Ptr(""), WeeklyRecurrence: &armdevtestlabs.WeekDetails{ - Time: to.StringPtr("