From 8ac38b3b2d24cda4666c0c3489a5419be3f385b4 Mon Sep 17 00:00:00 2001 From: Joel Hendrix Date: Tue, 18 Jul 2023 23:06:57 -0700 Subject: [PATCH] Prep latest armcompute beta for release (#21203) --- .../compute/armcompute/CHANGELOG.md | 6 + .../compute/armcompute/autorest.md | 4 +- .../compute/armcompute/build.go | 2 +- .../compute/armcompute/client_factory.go | 196 +- .../compute/armcompute/constants.go | 2 +- .../fake/availabilitysets_server.go | 60 +- .../fake/capacityreservationgroups_server.go | 44 +- .../fake/capacityreservations_server.go | 74 +- .../cloudserviceoperatingsystems_server.go | 44 +- .../fake/cloudserviceroleinstances_server.go | 90 +- .../fake/cloudserviceroles_server.go | 26 +- .../armcompute/fake/cloudservices_server.go | 188 +- .../fake/cloudservicesupdatedomain_server.go | 42 +- .../fake/communitygalleries_server.go | 4 +- .../fake/communitygalleryimages_server.go | 26 +- .../communitygalleryimageversions_server.go | 26 +- .../fake/dedicatedhostgroups_server.go | 44 +- .../armcompute/fake/dedicatedhosts_server.go | 106 +- .../armcompute/fake/diskaccesses_server.go | 142 +- .../fake/diskencryptionsets_server.go | 110 +- .../fake/diskrestorepoint_server.go | 58 +- .../compute/armcompute/fake/disks_server.go | 124 +- .../armcompute/fake/galleries_server.go | 92 +- .../fake/galleryapplications_server.go | 74 +- .../fake/galleryapplicationversions_server.go | 74 +- .../armcompute/fake/galleryimages_server.go | 74 +- .../fake/galleryimageversions_server.go | 74 +- .../fake/gallerysharingprofile_server.go | 24 +- .../compute/armcompute/fake/images_server.go | 92 +- .../compute/armcompute/fake/internal.go | 45 + .../armcompute/fake/loganalytics_server.go | 40 +- .../armcompute/fake/operations_server.go | 24 +- .../fake/proximityplacementgroups_server.go | 44 +- .../armcompute/fake/resourceskus_server.go | 26 +- .../fake/restorepointcollections_server.go | 60 +- .../armcompute/fake/restorepoints_server.go | 40 +- .../armcompute/fake/sharedgalleries_server.go | 26 +- .../fake/sharedgalleryimages_server.go | 26 +- .../fake/sharedgalleryimageversions_server.go | 26 +- .../armcompute/fake/snapshots_server.go | 124 +- .../armcompute/fake/sshpublickeys_server.go | 44 +- .../compute/armcompute/fake/usage_server.go | 26 +- .../virtualmachineextensionimages_server.go | 4 +- .../fake/virtualmachineextensions_server.go | 56 +- .../fake/virtualmachineimages_server.go | 4 +- .../virtualmachineimagesedgezone_server.go | 4 +- .../fake/virtualmachineruncommands_server.go | 92 +- .../armcompute/fake/virtualmachines_server.go | 334 +-- ...virtualmachinescalesetextensions_server.go | 74 +- ...almachinescalesetrollingupgrades_server.go | 56 +- .../fake/virtualmachinescalesets_server.go | 338 +-- ...rtualmachinescalesetvmextensions_server.go | 56 +- ...tualmachinescalesetvmruncommands_server.go | 74 +- .../fake/virtualmachinescalesetvms_server.go | 202 +- .../fake/virtualmachinesizes_server.go | 24 +- sdk/resourcemanager/compute/armcompute/go.mod | 2 +- sdk/resourcemanager/compute/armcompute/go.sum | 4 +- .../compute/armcompute/models.go | 1867 +--------------- .../compute/armcompute/options.go | 1901 +++++++++++++++++ .../compute/armcompute/response_types.go | 218 ++ 60 files changed, 4472 insertions(+), 3311 deletions(-) create mode 100644 sdk/resourcemanager/compute/armcompute/options.go diff --git a/sdk/resourcemanager/compute/armcompute/CHANGELOG.md b/sdk/resourcemanager/compute/armcompute/CHANGELOG.md index 380d89339ea6..5b0226747a10 100644 --- a/sdk/resourcemanager/compute/armcompute/CHANGELOG.md +++ b/sdk/resourcemanager/compute/armcompute/CHANGELOG.md @@ -1,5 +1,11 @@ # Release History +## 5.1.0-beta.2 (2023-07-19) + +### Bug Fixes + +- Fixed a potential panic in faked paged and long-running operations. + ## 5.1.0-beta.1 (2023-06-12) ### Features Added diff --git a/sdk/resourcemanager/compute/armcompute/autorest.md b/sdk/resourcemanager/compute/armcompute/autorest.md index ceb9fdd5b293..6c16247c13c5 100644 --- a/sdk/resourcemanager/compute/armcompute/autorest.md +++ b/sdk/resourcemanager/compute/armcompute/autorest.md @@ -9,9 +9,9 @@ require: - https://github.com/Azure/azure-rest-api-specs/blob/5d2adf9b7fda669b4a2538c65e937ee74fe3f966/specification/compute/resource-manager/readme.go.md license-header: MICROSOFT_MIT_NO_VERSION module: github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/v5 -module-version: 5.1.0-beta.1 +module-version: 5.1.0-beta.2 tag: package-2023-03-01 -azcore-version: 1.7.0-beta.2 +azcore-version: 1.8.0-beta.1 generate-fakes: true inject-spans: true ``` diff --git a/sdk/resourcemanager/compute/armcompute/build.go b/sdk/resourcemanager/compute/armcompute/build.go index d301bc6e5b9f..d99229e35746 100644 --- a/sdk/resourcemanager/compute/armcompute/build.go +++ b/sdk/resourcemanager/compute/armcompute/build.go @@ -2,6 +2,6 @@ // Licensed under the MIT License. See License.txt in the project root for license information. // This file enables 'go generate' to regenerate this specific SDK -//go:generate pwsh ../../../../eng/scripts/build.ps1 -goExtension "@autorest/go@4.0.0-preview.51" -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired resourcemanager/compute/armcompute +//go:generate pwsh ../../../../eng/scripts/build.ps1 -goExtension "@autorest/go@4.0.0-preview.53" -skipBuild -cleanGenerated -format -tidy -generate -alwaysSetBodyParamRequired resourcemanager/compute/armcompute package armcompute diff --git a/sdk/resourcemanager/compute/armcompute/client_factory.go b/sdk/resourcemanager/compute/armcompute/client_factory.go index adad45461335..0f403c613fca 100644 --- a/sdk/resourcemanager/compute/armcompute/client_factory.go +++ b/sdk/resourcemanager/compute/armcompute/client_factory.go @@ -38,247 +38,247 @@ func NewClientFactory(subscriptionID string, credential azcore.TokenCredential, }, nil } -func (c *ClientFactory) NewOperationsClient() *OperationsClient { - subClient, _ := NewOperationsClient(c.credential, c.options) +func (c *ClientFactory) NewAvailabilitySetsClient() *AvailabilitySetsClient { + subClient, _ := NewAvailabilitySetsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewUsageClient() *UsageClient { - subClient, _ := NewUsageClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient { + subClient, _ := NewCapacityReservationGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient { - subClient, _ := NewVirtualMachineSizesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCapacityReservationsClient() *CapacityReservationsClient { + subClient, _ := NewCapacityReservationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineScaleSetsClient() *VirtualMachineScaleSetsClient { - subClient, _ := NewVirtualMachineScaleSetsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCloudServiceOperatingSystemsClient() *CloudServiceOperatingSystemsClient { + subClient, _ := NewCloudServiceOperatingSystemsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineScaleSetExtensionsClient() *VirtualMachineScaleSetExtensionsClient { - subClient, _ := NewVirtualMachineScaleSetExtensionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCloudServiceRoleInstancesClient() *CloudServiceRoleInstancesClient { + subClient, _ := NewCloudServiceRoleInstancesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineScaleSetRollingUpgradesClient() *VirtualMachineScaleSetRollingUpgradesClient { - subClient, _ := NewVirtualMachineScaleSetRollingUpgradesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCloudServiceRolesClient() *CloudServiceRolesClient { + subClient, _ := NewCloudServiceRolesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineScaleSetVMExtensionsClient() *VirtualMachineScaleSetVMExtensionsClient { - subClient, _ := NewVirtualMachineScaleSetVMExtensionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCloudServicesClient() *CloudServicesClient { + subClient, _ := NewCloudServicesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineScaleSetVMsClient() *VirtualMachineScaleSetVMsClient { - subClient, _ := NewVirtualMachineScaleSetVMsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCloudServicesUpdateDomainClient() *CloudServicesUpdateDomainClient { + subClient, _ := NewCloudServicesUpdateDomainClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineExtensionsClient() *VirtualMachineExtensionsClient { - subClient, _ := NewVirtualMachineExtensionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCommunityGalleriesClient() *CommunityGalleriesClient { + subClient, _ := NewCommunityGalleriesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient { - subClient, _ := NewVirtualMachinesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCommunityGalleryImageVersionsClient() *CommunityGalleryImageVersionsClient { + subClient, _ := NewCommunityGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineImagesClient() *VirtualMachineImagesClient { - subClient, _ := NewVirtualMachineImagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewCommunityGalleryImagesClient() *CommunityGalleryImagesClient { + subClient, _ := NewCommunityGalleryImagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineImagesEdgeZoneClient() *VirtualMachineImagesEdgeZoneClient { - subClient, _ := NewVirtualMachineImagesEdgeZoneClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDedicatedHostGroupsClient() *DedicatedHostGroupsClient { + subClient, _ := NewDedicatedHostGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineExtensionImagesClient() *VirtualMachineExtensionImagesClient { - subClient, _ := NewVirtualMachineExtensionImagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDedicatedHostsClient() *DedicatedHostsClient { + subClient, _ := NewDedicatedHostsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewAvailabilitySetsClient() *AvailabilitySetsClient { - subClient, _ := NewAvailabilitySetsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDiskAccessesClient() *DiskAccessesClient { + subClient, _ := NewDiskAccessesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewProximityPlacementGroupsClient() *ProximityPlacementGroupsClient { - subClient, _ := NewProximityPlacementGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDiskEncryptionSetsClient() *DiskEncryptionSetsClient { + subClient, _ := NewDiskEncryptionSetsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDedicatedHostGroupsClient() *DedicatedHostGroupsClient { - subClient, _ := NewDedicatedHostGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDiskRestorePointClient() *DiskRestorePointClient { + subClient, _ := NewDiskRestorePointClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDedicatedHostsClient() *DedicatedHostsClient { - subClient, _ := NewDedicatedHostsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewDisksClient() *DisksClient { + subClient, _ := NewDisksClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSSHPublicKeysClient() *SSHPublicKeysClient { - subClient, _ := NewSSHPublicKeysClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGalleriesClient() *GalleriesClient { + subClient, _ := NewGalleriesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewImagesClient() *ImagesClient { - subClient, _ := NewImagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGalleryApplicationVersionsClient() *GalleryApplicationVersionsClient { + subClient, _ := NewGalleryApplicationVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRestorePointCollectionsClient() *RestorePointCollectionsClient { - subClient, _ := NewRestorePointCollectionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGalleryApplicationsClient() *GalleryApplicationsClient { + subClient, _ := NewGalleryApplicationsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient { - subClient, _ := NewRestorePointsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGalleryImageVersionsClient() *GalleryImageVersionsClient { + subClient, _ := NewGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCapacityReservationGroupsClient() *CapacityReservationGroupsClient { - subClient, _ := NewCapacityReservationGroupsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient { + subClient, _ := NewGalleryImagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCapacityReservationsClient() *CapacityReservationsClient { - subClient, _ := NewCapacityReservationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewGallerySharingProfileClient() *GallerySharingProfileClient { + subClient, _ := NewGallerySharingProfileClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient { - subClient, _ := NewLogAnalyticsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewImagesClient() *ImagesClient { + subClient, _ := NewImagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineRunCommandsClient() *VirtualMachineRunCommandsClient { - subClient, _ := NewVirtualMachineRunCommandsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewLogAnalyticsClient() *LogAnalyticsClient { + subClient, _ := NewLogAnalyticsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewVirtualMachineScaleSetVMRunCommandsClient() *VirtualMachineScaleSetVMRunCommandsClient { - subClient, _ := NewVirtualMachineScaleSetVMRunCommandsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewOperationsClient() *OperationsClient { + subClient, _ := NewOperationsClient(c.credential, c.options) return subClient } -func (c *ClientFactory) NewDisksClient() *DisksClient { - subClient, _ := NewDisksClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewProximityPlacementGroupsClient() *ProximityPlacementGroupsClient { + subClient, _ := NewProximityPlacementGroupsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDiskAccessesClient() *DiskAccessesClient { - subClient, _ := NewDiskAccessesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient { + subClient, _ := NewResourceSKUsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDiskEncryptionSetsClient() *DiskEncryptionSetsClient { - subClient, _ := NewDiskEncryptionSetsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRestorePointCollectionsClient() *RestorePointCollectionsClient { + subClient, _ := NewRestorePointCollectionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewDiskRestorePointClient() *DiskRestorePointClient { - subClient, _ := NewDiskRestorePointClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewRestorePointsClient() *RestorePointsClient { + subClient, _ := NewRestorePointsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { - subClient, _ := NewSnapshotsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSSHPublicKeysClient() *SSHPublicKeysClient { + subClient, _ := NewSSHPublicKeysClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewResourceSKUsClient() *ResourceSKUsClient { - subClient, _ := NewResourceSKUsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSharedGalleriesClient() *SharedGalleriesClient { + subClient, _ := NewSharedGalleriesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGalleriesClient() *GalleriesClient { - subClient, _ := NewGalleriesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSharedGalleryImageVersionsClient() *SharedGalleryImageVersionsClient { + subClient, _ := NewSharedGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGalleryImagesClient() *GalleryImagesClient { - subClient, _ := NewGalleryImagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSharedGalleryImagesClient() *SharedGalleryImagesClient { + subClient, _ := NewSharedGalleryImagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGalleryImageVersionsClient() *GalleryImageVersionsClient { - subClient, _ := NewGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewSnapshotsClient() *SnapshotsClient { + subClient, _ := NewSnapshotsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGalleryApplicationsClient() *GalleryApplicationsClient { - subClient, _ := NewGalleryApplicationsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewUsageClient() *UsageClient { + subClient, _ := NewUsageClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGalleryApplicationVersionsClient() *GalleryApplicationVersionsClient { - subClient, _ := NewGalleryApplicationVersionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineExtensionImagesClient() *VirtualMachineExtensionImagesClient { + subClient, _ := NewVirtualMachineExtensionImagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewGallerySharingProfileClient() *GallerySharingProfileClient { - subClient, _ := NewGallerySharingProfileClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineExtensionsClient() *VirtualMachineExtensionsClient { + subClient, _ := NewVirtualMachineExtensionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSharedGalleriesClient() *SharedGalleriesClient { - subClient, _ := NewSharedGalleriesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineImagesClient() *VirtualMachineImagesClient { + subClient, _ := NewVirtualMachineImagesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSharedGalleryImagesClient() *SharedGalleryImagesClient { - subClient, _ := NewSharedGalleryImagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineImagesEdgeZoneClient() *VirtualMachineImagesEdgeZoneClient { + subClient, _ := NewVirtualMachineImagesEdgeZoneClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewSharedGalleryImageVersionsClient() *SharedGalleryImageVersionsClient { - subClient, _ := NewSharedGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineRunCommandsClient() *VirtualMachineRunCommandsClient { + subClient, _ := NewVirtualMachineRunCommandsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCommunityGalleriesClient() *CommunityGalleriesClient { - subClient, _ := NewCommunityGalleriesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineScaleSetExtensionsClient() *VirtualMachineScaleSetExtensionsClient { + subClient, _ := NewVirtualMachineScaleSetExtensionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCommunityGalleryImagesClient() *CommunityGalleryImagesClient { - subClient, _ := NewCommunityGalleryImagesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineScaleSetRollingUpgradesClient() *VirtualMachineScaleSetRollingUpgradesClient { + subClient, _ := NewVirtualMachineScaleSetRollingUpgradesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCommunityGalleryImageVersionsClient() *CommunityGalleryImageVersionsClient { - subClient, _ := NewCommunityGalleryImageVersionsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineScaleSetVMExtensionsClient() *VirtualMachineScaleSetVMExtensionsClient { + subClient, _ := NewVirtualMachineScaleSetVMExtensionsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCloudServiceRoleInstancesClient() *CloudServiceRoleInstancesClient { - subClient, _ := NewCloudServiceRoleInstancesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineScaleSetVMRunCommandsClient() *VirtualMachineScaleSetVMRunCommandsClient { + subClient, _ := NewVirtualMachineScaleSetVMRunCommandsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCloudServiceRolesClient() *CloudServiceRolesClient { - subClient, _ := NewCloudServiceRolesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineScaleSetVMsClient() *VirtualMachineScaleSetVMsClient { + subClient, _ := NewVirtualMachineScaleSetVMsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCloudServicesClient() *CloudServicesClient { - subClient, _ := NewCloudServicesClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineScaleSetsClient() *VirtualMachineScaleSetsClient { + subClient, _ := NewVirtualMachineScaleSetsClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCloudServicesUpdateDomainClient() *CloudServicesUpdateDomainClient { - subClient, _ := NewCloudServicesUpdateDomainClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachineSizesClient() *VirtualMachineSizesClient { + subClient, _ := NewVirtualMachineSizesClient(c.subscriptionID, c.credential, c.options) return subClient } -func (c *ClientFactory) NewCloudServiceOperatingSystemsClient() *CloudServiceOperatingSystemsClient { - subClient, _ := NewCloudServiceOperatingSystemsClient(c.subscriptionID, c.credential, c.options) +func (c *ClientFactory) NewVirtualMachinesClient() *VirtualMachinesClient { + subClient, _ := NewVirtualMachinesClient(c.subscriptionID, c.credential, c.options) return subClient } diff --git a/sdk/resourcemanager/compute/armcompute/constants.go b/sdk/resourcemanager/compute/armcompute/constants.go index a513a8a2efdf..dfd223e148e7 100644 --- a/sdk/resourcemanager/compute/armcompute/constants.go +++ b/sdk/resourcemanager/compute/armcompute/constants.go @@ -10,7 +10,7 @@ package armcompute const ( moduleName = "armcompute" - moduleVersion = "v5.1.0-beta.1" + moduleVersion = "v5.1.0-beta.2" ) type AccessLevel string diff --git a/sdk/resourcemanager/compute/armcompute/fake/availabilitysets_server.go b/sdk/resourcemanager/compute/armcompute/fake/availabilitysets_server.go index 4bd37fd81ed7..36cda8f74298 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/availabilitysets_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/availabilitysets_server.go @@ -54,19 +54,24 @@ type AvailabilitySetsServer struct { } // NewAvailabilitySetsServerTransport creates a new instance of AvailabilitySetsServerTransport with the provided implementation. -// The returned AvailabilitySetsServerTransport instance is connected to an instance of armcompute.AvailabilitySetsClient by way of the -// undefined.Transporter field. +// The returned AvailabilitySetsServerTransport instance is connected to an instance of armcompute.AvailabilitySetsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewAvailabilitySetsServerTransport(srv *AvailabilitySetsServer) *AvailabilitySetsServerTransport { - return &AvailabilitySetsServerTransport{srv: srv} + return &AvailabilitySetsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.AvailabilitySetsClientListResponse]](), + newListAvailableSizesPager: newTracker[azfake.PagerResponder[armcompute.AvailabilitySetsClientListAvailableSizesResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armcompute.AvailabilitySetsClientListBySubscriptionResponse]](), + } } // AvailabilitySetsServerTransport connects instances of armcompute.AvailabilitySetsClient to instances of AvailabilitySetsServer. // Don't use this type directly, use NewAvailabilitySetsServerTransport instead. type AvailabilitySetsServerTransport struct { srv *AvailabilitySetsServer - newListPager *azfake.PagerResponder[armcompute.AvailabilitySetsClientListResponse] - newListAvailableSizesPager *azfake.PagerResponder[armcompute.AvailabilitySetsClientListAvailableSizesResponse] - newListBySubscriptionPager *azfake.PagerResponder[armcompute.AvailabilitySetsClientListBySubscriptionResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.AvailabilitySetsClientListResponse]] + newListAvailableSizesPager *tracker[azfake.PagerResponder[armcompute.AvailabilitySetsClientListAvailableSizesResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armcompute.AvailabilitySetsClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for AvailabilitySetsServerTransport. @@ -213,7 +218,8 @@ func (a *AvailabilitySetsServerTransport) dispatchNewListPager(req *http.Request if a.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if a.newListPager == nil { + newListPager := a.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/availabilitySets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -225,20 +231,22 @@ func (a *AvailabilitySetsServerTransport) dispatchNewListPager(req *http.Request return nil, err } resp := a.srv.NewListPager(resourceGroupNameUnescaped, nil) - a.newListPager = &resp - server.PagerResponderInjectNextLinks(a.newListPager, req, func(page *armcompute.AvailabilitySetsClientListResponse, createLink func() string) { + newListPager = &resp + a.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.AvailabilitySetsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListPager) { - a.newListPager = nil + if !server.PagerResponderMore(newListPager) { + a.newListPager.remove(req) } return resp, nil } @@ -247,7 +255,8 @@ func (a *AvailabilitySetsServerTransport) dispatchNewListAvailableSizesPager(req if a.srv.NewListAvailableSizesPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAvailableSizesPager not implemented")} } - if a.newListAvailableSizesPager == nil { + newListAvailableSizesPager := a.newListAvailableSizesPager.get(req) + if newListAvailableSizesPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/availabilitySets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/vmSizes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -263,17 +272,19 @@ func (a *AvailabilitySetsServerTransport) dispatchNewListAvailableSizesPager(req return nil, err } resp := a.srv.NewListAvailableSizesPager(resourceGroupNameUnescaped, availabilitySetNameUnescaped, nil) - a.newListAvailableSizesPager = &resp + newListAvailableSizesPager = &resp + a.newListAvailableSizesPager.add(req, newListAvailableSizesPager) } - resp, err := server.PagerResponderNext(a.newListAvailableSizesPager, req) + resp, err := server.PagerResponderNext(newListAvailableSizesPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListAvailableSizesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListAvailableSizesPager) { - a.newListAvailableSizesPager = nil + if !server.PagerResponderMore(newListAvailableSizesPager) { + a.newListAvailableSizesPager.remove(req) } return resp, nil } @@ -282,7 +293,8 @@ func (a *AvailabilitySetsServerTransport) dispatchNewListBySubscriptionPager(req if a.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if a.newListBySubscriptionPager == nil { + newListBySubscriptionPager := a.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/availabilitySets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -302,20 +314,22 @@ func (a *AvailabilitySetsServerTransport) dispatchNewListBySubscriptionPager(req } } resp := a.srv.NewListBySubscriptionPager(options) - a.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(a.newListBySubscriptionPager, req, func(page *armcompute.AvailabilitySetsClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + a.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armcompute.AvailabilitySetsClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(a.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + a.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(a.newListBySubscriptionPager) { - a.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + a.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/capacityreservationgroups_server.go b/sdk/resourcemanager/compute/armcompute/fake/capacityreservationgroups_server.go index fff2c8f5dc9a..65490fd75e3e 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/capacityreservationgroups_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/capacityreservationgroups_server.go @@ -50,18 +50,22 @@ type CapacityReservationGroupsServer struct { } // NewCapacityReservationGroupsServerTransport creates a new instance of CapacityReservationGroupsServerTransport with the provided implementation. -// The returned CapacityReservationGroupsServerTransport instance is connected to an instance of armcompute.CapacityReservationGroupsClient by way of the -// undefined.Transporter field. +// The returned CapacityReservationGroupsServerTransport instance is connected to an instance of armcompute.CapacityReservationGroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCapacityReservationGroupsServerTransport(srv *CapacityReservationGroupsServer) *CapacityReservationGroupsServerTransport { - return &CapacityReservationGroupsServerTransport{srv: srv} + return &CapacityReservationGroupsServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.CapacityReservationGroupsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armcompute.CapacityReservationGroupsClientListBySubscriptionResponse]](), + } } // CapacityReservationGroupsServerTransport connects instances of armcompute.CapacityReservationGroupsClient to instances of CapacityReservationGroupsServer. // Don't use this type directly, use NewCapacityReservationGroupsServerTransport instead. type CapacityReservationGroupsServerTransport struct { srv *CapacityReservationGroupsServer - newListByResourceGroupPager *azfake.PagerResponder[armcompute.CapacityReservationGroupsClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armcompute.CapacityReservationGroupsClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.CapacityReservationGroupsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armcompute.CapacityReservationGroupsClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for CapacityReservationGroupsServerTransport. @@ -218,7 +222,8 @@ func (c *CapacityReservationGroupsServerTransport) dispatchNewListByResourceGrou if c.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if c.newListByResourceGroupPager == nil { + newListByResourceGroupPager := c.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/capacityReservationGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -242,20 +247,22 @@ func (c *CapacityReservationGroupsServerTransport) dispatchNewListByResourceGrou } } resp := c.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, options) - c.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(c.newListByResourceGroupPager, req, func(page *armcompute.CapacityReservationGroupsClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + c.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.CapacityReservationGroupsClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListByResourceGroupPager) { - c.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + c.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -264,7 +271,8 @@ func (c *CapacityReservationGroupsServerTransport) dispatchNewListBySubscription if c.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if c.newListBySubscriptionPager == nil { + newListBySubscriptionPager := c.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/capacityReservationGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -284,20 +292,22 @@ func (c *CapacityReservationGroupsServerTransport) dispatchNewListBySubscription } } resp := c.srv.NewListBySubscriptionPager(options) - c.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(c.newListBySubscriptionPager, req, func(page *armcompute.CapacityReservationGroupsClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + c.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armcompute.CapacityReservationGroupsClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListBySubscriptionPager) { - c.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + c.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/capacityreservations_server.go b/sdk/resourcemanager/compute/armcompute/fake/capacityreservations_server.go index 3b5272a6cbad..b4c5ed78c9c6 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/capacityreservations_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/capacityreservations_server.go @@ -46,20 +46,26 @@ type CapacityReservationsServer struct { } // NewCapacityReservationsServerTransport creates a new instance of CapacityReservationsServerTransport with the provided implementation. -// The returned CapacityReservationsServerTransport instance is connected to an instance of armcompute.CapacityReservationsClient by way of the -// undefined.Transporter field. +// The returned CapacityReservationsServerTransport instance is connected to an instance of armcompute.CapacityReservationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCapacityReservationsServerTransport(srv *CapacityReservationsServer) *CapacityReservationsServerTransport { - return &CapacityReservationsServerTransport{srv: srv} + return &CapacityReservationsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.CapacityReservationsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.CapacityReservationsClientDeleteResponse]](), + newListByCapacityReservationGroupPager: newTracker[azfake.PagerResponder[armcompute.CapacityReservationsClientListByCapacityReservationGroupResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.CapacityReservationsClientUpdateResponse]](), + } } // CapacityReservationsServerTransport connects instances of armcompute.CapacityReservationsClient to instances of CapacityReservationsServer. // Don't use this type directly, use NewCapacityReservationsServerTransport instead. type CapacityReservationsServerTransport struct { srv *CapacityReservationsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.CapacityReservationsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.CapacityReservationsClientDeleteResponse] - newListByCapacityReservationGroupPager *azfake.PagerResponder[armcompute.CapacityReservationsClientListByCapacityReservationGroupResponse] - beginUpdate *azfake.PollerResponder[armcompute.CapacityReservationsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.CapacityReservationsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.CapacityReservationsClientDeleteResponse]] + newListByCapacityReservationGroupPager *tracker[azfake.PagerResponder[armcompute.CapacityReservationsClientListByCapacityReservationGroupResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.CapacityReservationsClientUpdateResponse]] } // Do implements the policy.Transporter interface for CapacityReservationsServerTransport. @@ -99,7 +105,8 @@ func (c *CapacityReservationsServerTransport) dispatchBeginCreateOrUpdate(req *h if c.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if c.beginCreateOrUpdate == nil { + beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/capacityReservationGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capacityReservations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -126,19 +133,21 @@ func (c *CapacityReservationsServerTransport) dispatchBeginCreateOrUpdate(req *h if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(c.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + c.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginCreateOrUpdate) { - c.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + c.beginCreateOrUpdate.remove(req) } return resp, nil @@ -148,7 +157,8 @@ func (c *CapacityReservationsServerTransport) dispatchBeginDelete(req *http.Requ if c.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if c.beginDelete == nil { + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/capacityReservationGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capacityReservations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -171,19 +181,21 @@ func (c *CapacityReservationsServerTransport) dispatchBeginDelete(req *http.Requ if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginDelete = &respr + beginDelete = &respr + c.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(c.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginDelete) { - c.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) } return resp, nil @@ -242,7 +254,8 @@ func (c *CapacityReservationsServerTransport) dispatchNewListByCapacityReservati if c.srv.NewListByCapacityReservationGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByCapacityReservationGroupPager not implemented")} } - if c.newListByCapacityReservationGroupPager == nil { + newListByCapacityReservationGroupPager := c.newListByCapacityReservationGroupPager.get(req) + if newListByCapacityReservationGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/capacityReservationGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capacityReservations` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -258,20 +271,22 @@ func (c *CapacityReservationsServerTransport) dispatchNewListByCapacityReservati return nil, err } resp := c.srv.NewListByCapacityReservationGroupPager(resourceGroupNameUnescaped, capacityReservationGroupNameUnescaped, nil) - c.newListByCapacityReservationGroupPager = &resp - server.PagerResponderInjectNextLinks(c.newListByCapacityReservationGroupPager, req, func(page *armcompute.CapacityReservationsClientListByCapacityReservationGroupResponse, createLink func() string) { + newListByCapacityReservationGroupPager = &resp + c.newListByCapacityReservationGroupPager.add(req, newListByCapacityReservationGroupPager) + server.PagerResponderInjectNextLinks(newListByCapacityReservationGroupPager, req, func(page *armcompute.CapacityReservationsClientListByCapacityReservationGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListByCapacityReservationGroupPager, req) + resp, err := server.PagerResponderNext(newListByCapacityReservationGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListByCapacityReservationGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListByCapacityReservationGroupPager) { - c.newListByCapacityReservationGroupPager = nil + if !server.PagerResponderMore(newListByCapacityReservationGroupPager) { + c.newListByCapacityReservationGroupPager.remove(req) } return resp, nil } @@ -280,7 +295,8 @@ func (c *CapacityReservationsServerTransport) dispatchBeginUpdate(req *http.Requ if c.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if c.beginUpdate == nil { + beginUpdate := c.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/capacityReservationGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capacityReservations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -307,19 +323,21 @@ func (c *CapacityReservationsServerTransport) dispatchBeginUpdate(req *http.Requ if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginUpdate = &respr + beginUpdate = &respr + c.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(c.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginUpdate) { - c.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + c.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceoperatingsystems_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceoperatingsystems_server.go index 5d9f96f6f65f..90560e9c7010 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceoperatingsystems_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceoperatingsystems_server.go @@ -42,18 +42,22 @@ type CloudServiceOperatingSystemsServer struct { } // NewCloudServiceOperatingSystemsServerTransport creates a new instance of CloudServiceOperatingSystemsServerTransport with the provided implementation. -// The returned CloudServiceOperatingSystemsServerTransport instance is connected to an instance of armcompute.CloudServiceOperatingSystemsClient by way of the -// undefined.Transporter field. +// The returned CloudServiceOperatingSystemsServerTransport instance is connected to an instance of armcompute.CloudServiceOperatingSystemsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCloudServiceOperatingSystemsServerTransport(srv *CloudServiceOperatingSystemsServer) *CloudServiceOperatingSystemsServerTransport { - return &CloudServiceOperatingSystemsServerTransport{srv: srv} + return &CloudServiceOperatingSystemsServerTransport{ + srv: srv, + newListOSFamiliesPager: newTracker[azfake.PagerResponder[armcompute.CloudServiceOperatingSystemsClientListOSFamiliesResponse]](), + newListOSVersionsPager: newTracker[azfake.PagerResponder[armcompute.CloudServiceOperatingSystemsClientListOSVersionsResponse]](), + } } // CloudServiceOperatingSystemsServerTransport connects instances of armcompute.CloudServiceOperatingSystemsClient to instances of CloudServiceOperatingSystemsServer. // Don't use this type directly, use NewCloudServiceOperatingSystemsServerTransport instead. type CloudServiceOperatingSystemsServerTransport struct { srv *CloudServiceOperatingSystemsServer - newListOSFamiliesPager *azfake.PagerResponder[armcompute.CloudServiceOperatingSystemsClientListOSFamiliesResponse] - newListOSVersionsPager *azfake.PagerResponder[armcompute.CloudServiceOperatingSystemsClientListOSVersionsResponse] + newListOSFamiliesPager *tracker[azfake.PagerResponder[armcompute.CloudServiceOperatingSystemsClientListOSFamiliesResponse]] + newListOSVersionsPager *tracker[azfake.PagerResponder[armcompute.CloudServiceOperatingSystemsClientListOSVersionsResponse]] } // Do implements the policy.Transporter interface for CloudServiceOperatingSystemsServerTransport. @@ -157,7 +161,8 @@ func (c *CloudServiceOperatingSystemsServerTransport) dispatchNewListOSFamiliesP if c.srv.NewListOSFamiliesPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListOSFamiliesPager not implemented")} } - if c.newListOSFamiliesPager == nil { + newListOSFamiliesPager := c.newListOSFamiliesPager.get(req) + if newListOSFamiliesPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cloudServiceOsFamilies` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -169,20 +174,22 @@ func (c *CloudServiceOperatingSystemsServerTransport) dispatchNewListOSFamiliesP return nil, err } resp := c.srv.NewListOSFamiliesPager(locationUnescaped, nil) - c.newListOSFamiliesPager = &resp - server.PagerResponderInjectNextLinks(c.newListOSFamiliesPager, req, func(page *armcompute.CloudServiceOperatingSystemsClientListOSFamiliesResponse, createLink func() string) { + newListOSFamiliesPager = &resp + c.newListOSFamiliesPager.add(req, newListOSFamiliesPager) + server.PagerResponderInjectNextLinks(newListOSFamiliesPager, req, func(page *armcompute.CloudServiceOperatingSystemsClientListOSFamiliesResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListOSFamiliesPager, req) + resp, err := server.PagerResponderNext(newListOSFamiliesPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListOSFamiliesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListOSFamiliesPager) { - c.newListOSFamiliesPager = nil + if !server.PagerResponderMore(newListOSFamiliesPager) { + c.newListOSFamiliesPager.remove(req) } return resp, nil } @@ -191,7 +198,8 @@ func (c *CloudServiceOperatingSystemsServerTransport) dispatchNewListOSVersionsP if c.srv.NewListOSVersionsPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListOSVersionsPager not implemented")} } - if c.newListOSVersionsPager == nil { + newListOSVersionsPager := c.newListOSVersionsPager.get(req) + if newListOSVersionsPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/cloudServiceOsVersions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -203,20 +211,22 @@ func (c *CloudServiceOperatingSystemsServerTransport) dispatchNewListOSVersionsP return nil, err } resp := c.srv.NewListOSVersionsPager(locationUnescaped, nil) - c.newListOSVersionsPager = &resp - server.PagerResponderInjectNextLinks(c.newListOSVersionsPager, req, func(page *armcompute.CloudServiceOperatingSystemsClientListOSVersionsResponse, createLink func() string) { + newListOSVersionsPager = &resp + c.newListOSVersionsPager.add(req, newListOSVersionsPager) + server.PagerResponderInjectNextLinks(newListOSVersionsPager, req, func(page *armcompute.CloudServiceOperatingSystemsClientListOSVersionsResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListOSVersionsPager, req) + resp, err := server.PagerResponderNext(newListOSVersionsPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListOSVersionsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListOSVersionsPager) { - c.newListOSVersionsPager = nil + if !server.PagerResponderMore(newListOSVersionsPager) { + c.newListOSVersionsPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroleinstances_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroleinstances_server.go index ef8b4ad375ca..7df0bbefe418 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroleinstances_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroleinstances_server.go @@ -58,21 +58,28 @@ type CloudServiceRoleInstancesServer struct { } // NewCloudServiceRoleInstancesServerTransport creates a new instance of CloudServiceRoleInstancesServerTransport with the provided implementation. -// The returned CloudServiceRoleInstancesServerTransport instance is connected to an instance of armcompute.CloudServiceRoleInstancesClient by way of the -// undefined.Transporter field. +// The returned CloudServiceRoleInstancesServerTransport instance is connected to an instance of armcompute.CloudServiceRoleInstancesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCloudServiceRoleInstancesServerTransport(srv *CloudServiceRoleInstancesServer) *CloudServiceRoleInstancesServerTransport { - return &CloudServiceRoleInstancesServerTransport{srv: srv} + return &CloudServiceRoleInstancesServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.CloudServiceRoleInstancesClientListResponse]](), + beginRebuild: newTracker[azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientRebuildResponse]](), + beginReimage: newTracker[azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientReimageResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientRestartResponse]](), + } } // CloudServiceRoleInstancesServerTransport connects instances of armcompute.CloudServiceRoleInstancesClient to instances of CloudServiceRoleInstancesServer. // Don't use this type directly, use NewCloudServiceRoleInstancesServerTransport instead. type CloudServiceRoleInstancesServerTransport struct { srv *CloudServiceRoleInstancesServer - beginDelete *azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.CloudServiceRoleInstancesClientListResponse] - beginRebuild *azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientRebuildResponse] - beginReimage *azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientReimageResponse] - beginRestart *azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientRestartResponse] + beginDelete *tracker[azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.CloudServiceRoleInstancesClientListResponse]] + beginRebuild *tracker[azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientRebuildResponse]] + beginReimage *tracker[azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientReimageResponse]] + beginRestart *tracker[azfake.PollerResponder[armcompute.CloudServiceRoleInstancesClientRestartResponse]] } // Do implements the policy.Transporter interface for CloudServiceRoleInstancesServerTransport. @@ -118,7 +125,8 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginDelete(req *http if c.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if c.beginDelete == nil { + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -141,19 +149,21 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginDelete(req *http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginDelete = &respr + beginDelete = &respr + c.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(c.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginDelete) { - c.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) } return resp, nil @@ -289,7 +299,8 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchNewListPager(req *htt if c.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if c.newListPager == nil { + newListPager := c.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -317,20 +328,22 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchNewListPager(req *htt } } resp := c.srv.NewListPager(resourceGroupNameUnescaped, cloudServiceNameUnescaped, options) - c.newListPager = &resp - server.PagerResponderInjectNextLinks(c.newListPager, req, func(page *armcompute.CloudServiceRoleInstancesClientListResponse, createLink func() string) { + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.CloudServiceRoleInstancesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListPager) { - c.newListPager = nil + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) } return resp, nil } @@ -339,7 +352,8 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginRebuild(req *htt if c.srv.BeginRebuild == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRebuild not implemented")} } - if c.beginRebuild == nil { + beginRebuild := c.beginRebuild.get(req) + if beginRebuild == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rebuild` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -362,19 +376,21 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginRebuild(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginRebuild = &respr + beginRebuild = &respr + c.beginRebuild.add(req, beginRebuild) } - resp, err := server.PollerResponderNext(c.beginRebuild, req) + resp, err := server.PollerResponderNext(beginRebuild, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginRebuild.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginRebuild) { - c.beginRebuild = nil + if !server.PollerResponderMore(beginRebuild) { + c.beginRebuild.remove(req) } return resp, nil @@ -384,7 +400,8 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginReimage(req *htt if c.srv.BeginReimage == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReimage not implemented")} } - if c.beginReimage == nil { + beginReimage := c.beginReimage.get(req) + if beginReimage == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimage` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -407,19 +424,21 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginReimage(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginReimage = &respr + beginReimage = &respr + c.beginReimage.add(req, beginReimage) } - resp, err := server.PollerResponderNext(c.beginReimage, req) + resp, err := server.PollerResponderNext(beginReimage, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginReimage.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginReimage) { - c.beginReimage = nil + if !server.PollerResponderMore(beginReimage) { + c.beginReimage.remove(req) } return resp, nil @@ -429,7 +448,8 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginRestart(req *htt if c.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} } - if c.beginRestart == nil { + beginRestart := c.beginRestart.get(req) + if beginRestart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roleInstances/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -452,19 +472,21 @@ func (c *CloudServiceRoleInstancesServerTransport) dispatchBeginRestart(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginRestart = &respr + beginRestart = &respr + c.beginRestart.add(req, beginRestart) } - resp, err := server.PollerResponderNext(c.beginRestart, req) + resp, err := server.PollerResponderNext(beginRestart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginRestart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginRestart) { - c.beginRestart = nil + if !server.PollerResponderMore(beginRestart) { + c.beginRestart.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroles_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroles_server.go index 1131cc2f2a8c..88ca75fa1ec0 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroles_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudserviceroles_server.go @@ -34,17 +34,20 @@ type CloudServiceRolesServer struct { } // NewCloudServiceRolesServerTransport creates a new instance of CloudServiceRolesServerTransport with the provided implementation. -// The returned CloudServiceRolesServerTransport instance is connected to an instance of armcompute.CloudServiceRolesClient by way of the -// undefined.Transporter field. +// The returned CloudServiceRolesServerTransport instance is connected to an instance of armcompute.CloudServiceRolesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCloudServiceRolesServerTransport(srv *CloudServiceRolesServer) *CloudServiceRolesServerTransport { - return &CloudServiceRolesServerTransport{srv: srv} + return &CloudServiceRolesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.CloudServiceRolesClientListResponse]](), + } } // CloudServiceRolesServerTransport connects instances of armcompute.CloudServiceRolesClient to instances of CloudServiceRolesServer. // Don't use this type directly, use NewCloudServiceRolesServerTransport instead. type CloudServiceRolesServerTransport struct { srv *CloudServiceRolesServer - newListPager *azfake.PagerResponder[armcompute.CloudServiceRolesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.CloudServiceRolesClientListResponse]] } // Do implements the policy.Transporter interface for CloudServiceRolesServerTransport. @@ -115,7 +118,8 @@ func (c *CloudServiceRolesServerTransport) dispatchNewListPager(req *http.Reques if c.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if c.newListPager == nil { + newListPager := c.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/roles` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -131,20 +135,22 @@ func (c *CloudServiceRolesServerTransport) dispatchNewListPager(req *http.Reques return nil, err } resp := c.srv.NewListPager(resourceGroupNameUnescaped, cloudServiceNameUnescaped, nil) - c.newListPager = &resp - server.PagerResponderInjectNextLinks(c.newListPager, req, func(page *armcompute.CloudServiceRolesClientListResponse, createLink func() string) { + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.CloudServiceRolesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListPager) { - c.newListPager = nil + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudservices_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudservices_server.go index ecb57b62a74a..3dd3344a5cf2 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudservices_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudservices_server.go @@ -79,27 +79,40 @@ type CloudServicesServer struct { } // NewCloudServicesServerTransport creates a new instance of CloudServicesServerTransport with the provided implementation. -// The returned CloudServicesServerTransport instance is connected to an instance of armcompute.CloudServicesClient by way of the -// undefined.Transporter field. +// The returned CloudServicesServerTransport instance is connected to an instance of armcompute.CloudServicesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCloudServicesServerTransport(srv *CloudServicesServer) *CloudServicesServerTransport { - return &CloudServicesServerTransport{srv: srv} + return &CloudServicesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientDeleteResponse]](), + beginDeleteInstances: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientDeleteInstancesResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.CloudServicesClientListResponse]](), + newListAllPager: newTracker[azfake.PagerResponder[armcompute.CloudServicesClientListAllResponse]](), + beginPowerOff: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientPowerOffResponse]](), + beginRebuild: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientRebuildResponse]](), + beginReimage: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientReimageResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientRestartResponse]](), + beginStart: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientStartResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.CloudServicesClientUpdateResponse]](), + } } // CloudServicesServerTransport connects instances of armcompute.CloudServicesClient to instances of CloudServicesServer. // Don't use this type directly, use NewCloudServicesServerTransport instead. type CloudServicesServerTransport struct { srv *CloudServicesServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.CloudServicesClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.CloudServicesClientDeleteResponse] - beginDeleteInstances *azfake.PollerResponder[armcompute.CloudServicesClientDeleteInstancesResponse] - newListPager *azfake.PagerResponder[armcompute.CloudServicesClientListResponse] - newListAllPager *azfake.PagerResponder[armcompute.CloudServicesClientListAllResponse] - beginPowerOff *azfake.PollerResponder[armcompute.CloudServicesClientPowerOffResponse] - beginRebuild *azfake.PollerResponder[armcompute.CloudServicesClientRebuildResponse] - beginReimage *azfake.PollerResponder[armcompute.CloudServicesClientReimageResponse] - beginRestart *azfake.PollerResponder[armcompute.CloudServicesClientRestartResponse] - beginStart *azfake.PollerResponder[armcompute.CloudServicesClientStartResponse] - beginUpdate *azfake.PollerResponder[armcompute.CloudServicesClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.CloudServicesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.CloudServicesClientDeleteResponse]] + beginDeleteInstances *tracker[azfake.PollerResponder[armcompute.CloudServicesClientDeleteInstancesResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.CloudServicesClientListResponse]] + newListAllPager *tracker[azfake.PagerResponder[armcompute.CloudServicesClientListAllResponse]] + beginPowerOff *tracker[azfake.PollerResponder[armcompute.CloudServicesClientPowerOffResponse]] + beginRebuild *tracker[azfake.PollerResponder[armcompute.CloudServicesClientRebuildResponse]] + beginReimage *tracker[azfake.PollerResponder[armcompute.CloudServicesClientReimageResponse]] + beginRestart *tracker[azfake.PollerResponder[armcompute.CloudServicesClientRestartResponse]] + beginStart *tracker[azfake.PollerResponder[armcompute.CloudServicesClientStartResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.CloudServicesClientUpdateResponse]] } // Do implements the policy.Transporter interface for CloudServicesServerTransport. @@ -155,7 +168,8 @@ func (c *CloudServicesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req if c.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if c.beginCreateOrUpdate == nil { + beginCreateOrUpdate := c.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -178,19 +192,21 @@ func (c *CloudServicesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + c.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(c.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + c.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginCreateOrUpdate) { - c.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + c.beginCreateOrUpdate.remove(req) } return resp, nil @@ -200,7 +216,8 @@ func (c *CloudServicesServerTransport) dispatchBeginDelete(req *http.Request) (* if c.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if c.beginDelete == nil { + beginDelete := c.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -219,19 +236,21 @@ func (c *CloudServicesServerTransport) dispatchBeginDelete(req *http.Request) (* if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginDelete = &respr + beginDelete = &respr + c.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(c.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + c.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginDelete) { - c.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + c.beginDelete.remove(req) } return resp, nil @@ -241,7 +260,8 @@ func (c *CloudServicesServerTransport) dispatchBeginDeleteInstances(req *http.Re if c.srv.BeginDeleteInstances == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDeleteInstances not implemented")} } - if c.beginDeleteInstances == nil { + beginDeleteInstances := c.beginDeleteInstances.get(req) + if beginDeleteInstances == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/delete` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -270,19 +290,21 @@ func (c *CloudServicesServerTransport) dispatchBeginDeleteInstances(req *http.Re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginDeleteInstances = &respr + beginDeleteInstances = &respr + c.beginDeleteInstances.add(req, beginDeleteInstances) } - resp, err := server.PollerResponderNext(c.beginDeleteInstances, req) + resp, err := server.PollerResponderNext(beginDeleteInstances, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginDeleteInstances.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginDeleteInstances) { - c.beginDeleteInstances = nil + if !server.PollerResponderMore(beginDeleteInstances) { + c.beginDeleteInstances.remove(req) } return resp, nil @@ -358,7 +380,8 @@ func (c *CloudServicesServerTransport) dispatchNewListPager(req *http.Request) ( if c.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if c.newListPager == nil { + newListPager := c.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -370,20 +393,22 @@ func (c *CloudServicesServerTransport) dispatchNewListPager(req *http.Request) ( return nil, err } resp := c.srv.NewListPager(resourceGroupNameUnescaped, nil) - c.newListPager = &resp - server.PagerResponderInjectNextLinks(c.newListPager, req, func(page *armcompute.CloudServicesClientListResponse, createLink func() string) { + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.CloudServicesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListPager) { - c.newListPager = nil + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) } return resp, nil } @@ -392,7 +417,8 @@ func (c *CloudServicesServerTransport) dispatchNewListAllPager(req *http.Request if c.srv.NewListAllPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAllPager not implemented")} } - if c.newListAllPager == nil { + newListAllPager := c.newListAllPager.get(req) + if newListAllPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -400,20 +426,22 @@ func (c *CloudServicesServerTransport) dispatchNewListAllPager(req *http.Request return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := c.srv.NewListAllPager(nil) - c.newListAllPager = &resp - server.PagerResponderInjectNextLinks(c.newListAllPager, req, func(page *armcompute.CloudServicesClientListAllResponse, createLink func() string) { + newListAllPager = &resp + c.newListAllPager.add(req, newListAllPager) + server.PagerResponderInjectNextLinks(newListAllPager, req, func(page *armcompute.CloudServicesClientListAllResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListAllPager, req) + resp, err := server.PagerResponderNext(newListAllPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListAllPager) { - c.newListAllPager = nil + if !server.PagerResponderMore(newListAllPager) { + c.newListAllPager.remove(req) } return resp, nil } @@ -422,7 +450,8 @@ func (c *CloudServicesServerTransport) dispatchBeginPowerOff(req *http.Request) if c.srv.BeginPowerOff == nil { return nil, &nonRetriableError{errors.New("fake for method BeginPowerOff not implemented")} } - if c.beginPowerOff == nil { + beginPowerOff := c.beginPowerOff.get(req) + if beginPowerOff == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/poweroff` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -441,19 +470,21 @@ func (c *CloudServicesServerTransport) dispatchBeginPowerOff(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginPowerOff = &respr + beginPowerOff = &respr + c.beginPowerOff.add(req, beginPowerOff) } - resp, err := server.PollerResponderNext(c.beginPowerOff, req) + resp, err := server.PollerResponderNext(beginPowerOff, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginPowerOff.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginPowerOff) { - c.beginPowerOff = nil + if !server.PollerResponderMore(beginPowerOff) { + c.beginPowerOff.remove(req) } return resp, nil @@ -463,7 +494,8 @@ func (c *CloudServicesServerTransport) dispatchBeginRebuild(req *http.Request) ( if c.srv.BeginRebuild == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRebuild not implemented")} } - if c.beginRebuild == nil { + beginRebuild := c.beginRebuild.get(req) + if beginRebuild == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rebuild` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -492,19 +524,21 @@ func (c *CloudServicesServerTransport) dispatchBeginRebuild(req *http.Request) ( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginRebuild = &respr + beginRebuild = &respr + c.beginRebuild.add(req, beginRebuild) } - resp, err := server.PollerResponderNext(c.beginRebuild, req) + resp, err := server.PollerResponderNext(beginRebuild, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginRebuild.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginRebuild) { - c.beginRebuild = nil + if !server.PollerResponderMore(beginRebuild) { + c.beginRebuild.remove(req) } return resp, nil @@ -514,7 +548,8 @@ func (c *CloudServicesServerTransport) dispatchBeginReimage(req *http.Request) ( if c.srv.BeginReimage == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReimage not implemented")} } - if c.beginReimage == nil { + beginReimage := c.beginReimage.get(req) + if beginReimage == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimage` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -543,19 +578,21 @@ func (c *CloudServicesServerTransport) dispatchBeginReimage(req *http.Request) ( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginReimage = &respr + beginReimage = &respr + c.beginReimage.add(req, beginReimage) } - resp, err := server.PollerResponderNext(c.beginReimage, req) + resp, err := server.PollerResponderNext(beginReimage, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginReimage.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginReimage) { - c.beginReimage = nil + if !server.PollerResponderMore(beginReimage) { + c.beginReimage.remove(req) } return resp, nil @@ -565,7 +602,8 @@ func (c *CloudServicesServerTransport) dispatchBeginRestart(req *http.Request) ( if c.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} } - if c.beginRestart == nil { + beginRestart := c.beginRestart.get(req) + if beginRestart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -594,19 +632,21 @@ func (c *CloudServicesServerTransport) dispatchBeginRestart(req *http.Request) ( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginRestart = &respr + beginRestart = &respr + c.beginRestart.add(req, beginRestart) } - resp, err := server.PollerResponderNext(c.beginRestart, req) + resp, err := server.PollerResponderNext(beginRestart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginRestart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginRestart) { - c.beginRestart = nil + if !server.PollerResponderMore(beginRestart) { + c.beginRestart.remove(req) } return resp, nil @@ -616,7 +656,8 @@ func (c *CloudServicesServerTransport) dispatchBeginStart(req *http.Request) (*h if c.srv.BeginStart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} } - if c.beginStart == nil { + beginStart := c.beginStart.get(req) + if beginStart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -635,19 +676,21 @@ func (c *CloudServicesServerTransport) dispatchBeginStart(req *http.Request) (*h if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginStart = &respr + beginStart = &respr + c.beginStart.add(req, beginStart) } - resp, err := server.PollerResponderNext(c.beginStart, req) + resp, err := server.PollerResponderNext(beginStart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginStart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginStart) { - c.beginStart = nil + if !server.PollerResponderMore(beginStart) { + c.beginStart.remove(req) } return resp, nil @@ -657,7 +700,8 @@ func (c *CloudServicesServerTransport) dispatchBeginUpdate(req *http.Request) (* if c.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if c.beginUpdate == nil { + beginUpdate := c.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -680,19 +724,21 @@ func (c *CloudServicesServerTransport) dispatchBeginUpdate(req *http.Request) (* if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginUpdate = &respr + beginUpdate = &respr + c.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(c.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginUpdate) { - c.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + c.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/cloudservicesupdatedomain_server.go b/sdk/resourcemanager/compute/armcompute/fake/cloudservicesupdatedomain_server.go index 19337782c379..13adfe659ac3 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/cloudservicesupdatedomain_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/cloudservicesupdatedomain_server.go @@ -39,18 +39,22 @@ type CloudServicesUpdateDomainServer struct { } // NewCloudServicesUpdateDomainServerTransport creates a new instance of CloudServicesUpdateDomainServerTransport with the provided implementation. -// The returned CloudServicesUpdateDomainServerTransport instance is connected to an instance of armcompute.CloudServicesUpdateDomainClient by way of the -// undefined.Transporter field. +// The returned CloudServicesUpdateDomainServerTransport instance is connected to an instance of armcompute.CloudServicesUpdateDomainClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCloudServicesUpdateDomainServerTransport(srv *CloudServicesUpdateDomainServer) *CloudServicesUpdateDomainServerTransport { - return &CloudServicesUpdateDomainServerTransport{srv: srv} + return &CloudServicesUpdateDomainServerTransport{ + srv: srv, + newListUpdateDomainsPager: newTracker[azfake.PagerResponder[armcompute.CloudServicesUpdateDomainClientListUpdateDomainsResponse]](), + beginWalkUpdateDomain: newTracker[azfake.PollerResponder[armcompute.CloudServicesUpdateDomainClientWalkUpdateDomainResponse]](), + } } // CloudServicesUpdateDomainServerTransport connects instances of armcompute.CloudServicesUpdateDomainClient to instances of CloudServicesUpdateDomainServer. // Don't use this type directly, use NewCloudServicesUpdateDomainServerTransport instead. type CloudServicesUpdateDomainServerTransport struct { srv *CloudServicesUpdateDomainServer - newListUpdateDomainsPager *azfake.PagerResponder[armcompute.CloudServicesUpdateDomainClientListUpdateDomainsResponse] - beginWalkUpdateDomain *azfake.PollerResponder[armcompute.CloudServicesUpdateDomainClientWalkUpdateDomainResponse] + newListUpdateDomainsPager *tracker[azfake.PagerResponder[armcompute.CloudServicesUpdateDomainClientListUpdateDomainsResponse]] + beginWalkUpdateDomain *tracker[azfake.PollerResponder[armcompute.CloudServicesUpdateDomainClientWalkUpdateDomainResponse]] } // Do implements the policy.Transporter interface for CloudServicesUpdateDomainServerTransport. @@ -133,7 +137,8 @@ func (c *CloudServicesUpdateDomainServerTransport) dispatchNewListUpdateDomainsP if c.srv.NewListUpdateDomainsPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListUpdateDomainsPager not implemented")} } - if c.newListUpdateDomainsPager == nil { + newListUpdateDomainsPager := c.newListUpdateDomainsPager.get(req) + if newListUpdateDomainsPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/updateDomains` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -149,20 +154,22 @@ func (c *CloudServicesUpdateDomainServerTransport) dispatchNewListUpdateDomainsP return nil, err } resp := c.srv.NewListUpdateDomainsPager(resourceGroupNameUnescaped, cloudServiceNameUnescaped, nil) - c.newListUpdateDomainsPager = &resp - server.PagerResponderInjectNextLinks(c.newListUpdateDomainsPager, req, func(page *armcompute.CloudServicesUpdateDomainClientListUpdateDomainsResponse, createLink func() string) { + newListUpdateDomainsPager = &resp + c.newListUpdateDomainsPager.add(req, newListUpdateDomainsPager) + server.PagerResponderInjectNextLinks(newListUpdateDomainsPager, req, func(page *armcompute.CloudServicesUpdateDomainClientListUpdateDomainsResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListUpdateDomainsPager, req) + resp, err := server.PagerResponderNext(newListUpdateDomainsPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListUpdateDomainsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListUpdateDomainsPager) { - c.newListUpdateDomainsPager = nil + if !server.PagerResponderMore(newListUpdateDomainsPager) { + c.newListUpdateDomainsPager.remove(req) } return resp, nil } @@ -171,7 +178,8 @@ func (c *CloudServicesUpdateDomainServerTransport) dispatchBeginWalkUpdateDomain if c.srv.BeginWalkUpdateDomain == nil { return nil, &nonRetriableError{errors.New("fake for method BeginWalkUpdateDomain not implemented")} } - if c.beginWalkUpdateDomain == nil { + beginWalkUpdateDomain := c.beginWalkUpdateDomain.get(req) + if beginWalkUpdateDomain == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/cloudServices/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/updateDomains/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -208,19 +216,21 @@ func (c *CloudServicesUpdateDomainServerTransport) dispatchBeginWalkUpdateDomain if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - c.beginWalkUpdateDomain = &respr + beginWalkUpdateDomain = &respr + c.beginWalkUpdateDomain.add(req, beginWalkUpdateDomain) } - resp, err := server.PollerResponderNext(c.beginWalkUpdateDomain, req) + resp, err := server.PollerResponderNext(beginWalkUpdateDomain, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + c.beginWalkUpdateDomain.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(c.beginWalkUpdateDomain) { - c.beginWalkUpdateDomain = nil + if !server.PollerResponderMore(beginWalkUpdateDomain) { + c.beginWalkUpdateDomain.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/communitygalleries_server.go b/sdk/resourcemanager/compute/armcompute/fake/communitygalleries_server.go index 10a00daa9a77..5bb42a3a53ef 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/communitygalleries_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/communitygalleries_server.go @@ -29,8 +29,8 @@ type CommunityGalleriesServer struct { } // NewCommunityGalleriesServerTransport creates a new instance of CommunityGalleriesServerTransport with the provided implementation. -// The returned CommunityGalleriesServerTransport instance is connected to an instance of armcompute.CommunityGalleriesClient by way of the -// undefined.Transporter field. +// The returned CommunityGalleriesServerTransport instance is connected to an instance of armcompute.CommunityGalleriesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCommunityGalleriesServerTransport(srv *CommunityGalleriesServer) *CommunityGalleriesServerTransport { return &CommunityGalleriesServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimages_server.go index 6a13283915e4..312c99e7d2f9 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimages_server.go @@ -34,17 +34,20 @@ type CommunityGalleryImagesServer struct { } // NewCommunityGalleryImagesServerTransport creates a new instance of CommunityGalleryImagesServerTransport with the provided implementation. -// The returned CommunityGalleryImagesServerTransport instance is connected to an instance of armcompute.CommunityGalleryImagesClient by way of the -// undefined.Transporter field. +// The returned CommunityGalleryImagesServerTransport instance is connected to an instance of armcompute.CommunityGalleryImagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCommunityGalleryImagesServerTransport(srv *CommunityGalleryImagesServer) *CommunityGalleryImagesServerTransport { - return &CommunityGalleryImagesServerTransport{srv: srv} + return &CommunityGalleryImagesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.CommunityGalleryImagesClientListResponse]](), + } } // CommunityGalleryImagesServerTransport connects instances of armcompute.CommunityGalleryImagesClient to instances of CommunityGalleryImagesServer. // Don't use this type directly, use NewCommunityGalleryImagesServerTransport instead. type CommunityGalleryImagesServerTransport struct { srv *CommunityGalleryImagesServer - newListPager *azfake.PagerResponder[armcompute.CommunityGalleryImagesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.CommunityGalleryImagesClientListResponse]] } // Do implements the policy.Transporter interface for CommunityGalleryImagesServerTransport. @@ -115,7 +118,8 @@ func (c *CommunityGalleryImagesServerTransport) dispatchNewListPager(req *http.R if c.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if c.newListPager == nil { + newListPager := c.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/communityGalleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -131,20 +135,22 @@ func (c *CommunityGalleryImagesServerTransport) dispatchNewListPager(req *http.R return nil, err } resp := c.srv.NewListPager(locationUnescaped, publicGalleryNameUnescaped, nil) - c.newListPager = &resp - server.PagerResponderInjectNextLinks(c.newListPager, req, func(page *armcompute.CommunityGalleryImagesClientListResponse, createLink func() string) { + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.CommunityGalleryImagesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListPager) { - c.newListPager = nil + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimageversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimageversions_server.go index 81a3c0f42dc1..b8b9f76e84ae 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimageversions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/communitygalleryimageversions_server.go @@ -34,17 +34,20 @@ type CommunityGalleryImageVersionsServer struct { } // NewCommunityGalleryImageVersionsServerTransport creates a new instance of CommunityGalleryImageVersionsServerTransport with the provided implementation. -// The returned CommunityGalleryImageVersionsServerTransport instance is connected to an instance of armcompute.CommunityGalleryImageVersionsClient by way of the -// undefined.Transporter field. +// The returned CommunityGalleryImageVersionsServerTransport instance is connected to an instance of armcompute.CommunityGalleryImageVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewCommunityGalleryImageVersionsServerTransport(srv *CommunityGalleryImageVersionsServer) *CommunityGalleryImageVersionsServerTransport { - return &CommunityGalleryImageVersionsServerTransport{srv: srv} + return &CommunityGalleryImageVersionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.CommunityGalleryImageVersionsClientListResponse]](), + } } // CommunityGalleryImageVersionsServerTransport connects instances of armcompute.CommunityGalleryImageVersionsClient to instances of CommunityGalleryImageVersionsServer. // Don't use this type directly, use NewCommunityGalleryImageVersionsServerTransport instead. type CommunityGalleryImageVersionsServerTransport struct { srv *CommunityGalleryImageVersionsServer - newListPager *azfake.PagerResponder[armcompute.CommunityGalleryImageVersionsClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.CommunityGalleryImageVersionsClientListResponse]] } // Do implements the policy.Transporter interface for CommunityGalleryImageVersionsServerTransport. @@ -119,7 +122,8 @@ func (c *CommunityGalleryImageVersionsServerTransport) dispatchNewListPager(req if c.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if c.newListPager == nil { + newListPager := c.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/communityGalleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -139,20 +143,22 @@ func (c *CommunityGalleryImageVersionsServerTransport) dispatchNewListPager(req return nil, err } resp := c.srv.NewListPager(locationUnescaped, publicGalleryNameUnescaped, galleryImageNameUnescaped, nil) - c.newListPager = &resp - server.PagerResponderInjectNextLinks(c.newListPager, req, func(page *armcompute.CommunityGalleryImageVersionsClientListResponse, createLink func() string) { + newListPager = &resp + c.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.CommunityGalleryImageVersionsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(c.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + c.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(c.newListPager) { - c.newListPager = nil + if !server.PagerResponderMore(newListPager) { + c.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/dedicatedhostgroups_server.go b/sdk/resourcemanager/compute/armcompute/fake/dedicatedhostgroups_server.go index 895cb2ab8686..0d93d8e9b214 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/dedicatedhostgroups_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/dedicatedhostgroups_server.go @@ -50,18 +50,22 @@ type DedicatedHostGroupsServer struct { } // NewDedicatedHostGroupsServerTransport creates a new instance of DedicatedHostGroupsServerTransport with the provided implementation. -// The returned DedicatedHostGroupsServerTransport instance is connected to an instance of armcompute.DedicatedHostGroupsClient by way of the -// undefined.Transporter field. +// The returned DedicatedHostGroupsServerTransport instance is connected to an instance of armcompute.DedicatedHostGroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDedicatedHostGroupsServerTransport(srv *DedicatedHostGroupsServer) *DedicatedHostGroupsServerTransport { - return &DedicatedHostGroupsServerTransport{srv: srv} + return &DedicatedHostGroupsServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.DedicatedHostGroupsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armcompute.DedicatedHostGroupsClientListBySubscriptionResponse]](), + } } // DedicatedHostGroupsServerTransport connects instances of armcompute.DedicatedHostGroupsClient to instances of DedicatedHostGroupsServer. // Don't use this type directly, use NewDedicatedHostGroupsServerTransport instead. type DedicatedHostGroupsServerTransport struct { srv *DedicatedHostGroupsServer - newListByResourceGroupPager *azfake.PagerResponder[armcompute.DedicatedHostGroupsClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armcompute.DedicatedHostGroupsClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.DedicatedHostGroupsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armcompute.DedicatedHostGroupsClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for DedicatedHostGroupsServerTransport. @@ -218,7 +222,8 @@ func (d *DedicatedHostGroupsServerTransport) dispatchNewListByResourceGroupPager if d.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if d.newListByResourceGroupPager == nil { + newListByResourceGroupPager := d.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/hostGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -230,20 +235,22 @@ func (d *DedicatedHostGroupsServerTransport) dispatchNewListByResourceGroupPager return nil, err } resp := d.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - d.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(d.newListByResourceGroupPager, req, func(page *armcompute.DedicatedHostGroupsClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + d.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.DedicatedHostGroupsClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByResourceGroupPager) { - d.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + d.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -252,7 +259,8 @@ func (d *DedicatedHostGroupsServerTransport) dispatchNewListBySubscriptionPager( if d.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if d.newListBySubscriptionPager == nil { + newListBySubscriptionPager := d.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/hostGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -260,20 +268,22 @@ func (d *DedicatedHostGroupsServerTransport) dispatchNewListBySubscriptionPager( return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := d.srv.NewListBySubscriptionPager(nil) - d.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(d.newListBySubscriptionPager, req, func(page *armcompute.DedicatedHostGroupsClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + d.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armcompute.DedicatedHostGroupsClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListBySubscriptionPager) { - d.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + d.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/dedicatedhosts_server.go b/sdk/resourcemanager/compute/armcompute/fake/dedicatedhosts_server.go index a7f6d5390ba5..fbf3347df248 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/dedicatedhosts_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/dedicatedhosts_server.go @@ -54,22 +54,30 @@ type DedicatedHostsServer struct { } // NewDedicatedHostsServerTransport creates a new instance of DedicatedHostsServerTransport with the provided implementation. -// The returned DedicatedHostsServerTransport instance is connected to an instance of armcompute.DedicatedHostsClient by way of the -// undefined.Transporter field. +// The returned DedicatedHostsServerTransport instance is connected to an instance of armcompute.DedicatedHostsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDedicatedHostsServerTransport(srv *DedicatedHostsServer) *DedicatedHostsServerTransport { - return &DedicatedHostsServerTransport{srv: srv} + return &DedicatedHostsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.DedicatedHostsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.DedicatedHostsClientDeleteResponse]](), + newListAvailableSizesPager: newTracker[azfake.PagerResponder[armcompute.DedicatedHostsClientListAvailableSizesResponse]](), + newListByHostGroupPager: newTracker[azfake.PagerResponder[armcompute.DedicatedHostsClientListByHostGroupResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armcompute.DedicatedHostsClientRestartResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.DedicatedHostsClientUpdateResponse]](), + } } // DedicatedHostsServerTransport connects instances of armcompute.DedicatedHostsClient to instances of DedicatedHostsServer. // Don't use this type directly, use NewDedicatedHostsServerTransport instead. type DedicatedHostsServerTransport struct { srv *DedicatedHostsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.DedicatedHostsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.DedicatedHostsClientDeleteResponse] - newListAvailableSizesPager *azfake.PagerResponder[armcompute.DedicatedHostsClientListAvailableSizesResponse] - newListByHostGroupPager *azfake.PagerResponder[armcompute.DedicatedHostsClientListByHostGroupResponse] - beginRestart *azfake.PollerResponder[armcompute.DedicatedHostsClientRestartResponse] - beginUpdate *azfake.PollerResponder[armcompute.DedicatedHostsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.DedicatedHostsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.DedicatedHostsClientDeleteResponse]] + newListAvailableSizesPager *tracker[azfake.PagerResponder[armcompute.DedicatedHostsClientListAvailableSizesResponse]] + newListByHostGroupPager *tracker[azfake.PagerResponder[armcompute.DedicatedHostsClientListByHostGroupResponse]] + beginRestart *tracker[azfake.PollerResponder[armcompute.DedicatedHostsClientRestartResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.DedicatedHostsClientUpdateResponse]] } // Do implements the policy.Transporter interface for DedicatedHostsServerTransport. @@ -113,7 +121,8 @@ func (d *DedicatedHostsServerTransport) dispatchBeginCreateOrUpdate(req *http.Re if d.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if d.beginCreateOrUpdate == nil { + beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/hostGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/hosts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -140,19 +149,21 @@ func (d *DedicatedHostsServerTransport) dispatchBeginCreateOrUpdate(req *http.Re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(d.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginCreateOrUpdate) { - d.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) } return resp, nil @@ -162,7 +173,8 @@ func (d *DedicatedHostsServerTransport) dispatchBeginDelete(req *http.Request) ( if d.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if d.beginDelete == nil { + beginDelete := d.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/hostGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/hosts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -185,19 +197,21 @@ func (d *DedicatedHostsServerTransport) dispatchBeginDelete(req *http.Request) ( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginDelete = &respr + beginDelete = &respr + d.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(d.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginDelete) { - d.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + d.beginDelete.remove(req) } return resp, nil @@ -256,7 +270,8 @@ func (d *DedicatedHostsServerTransport) dispatchNewListAvailableSizesPager(req * if d.srv.NewListAvailableSizesPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAvailableSizesPager not implemented")} } - if d.newListAvailableSizesPager == nil { + newListAvailableSizesPager := d.newListAvailableSizesPager.get(req) + if newListAvailableSizesPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/hostGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/hosts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/hostSizes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -276,17 +291,19 @@ func (d *DedicatedHostsServerTransport) dispatchNewListAvailableSizesPager(req * return nil, err } resp := d.srv.NewListAvailableSizesPager(resourceGroupNameUnescaped, hostGroupNameUnescaped, hostNameUnescaped, nil) - d.newListAvailableSizesPager = &resp + newListAvailableSizesPager = &resp + d.newListAvailableSizesPager.add(req, newListAvailableSizesPager) } - resp, err := server.PagerResponderNext(d.newListAvailableSizesPager, req) + resp, err := server.PagerResponderNext(newListAvailableSizesPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListAvailableSizesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListAvailableSizesPager) { - d.newListAvailableSizesPager = nil + if !server.PagerResponderMore(newListAvailableSizesPager) { + d.newListAvailableSizesPager.remove(req) } return resp, nil } @@ -295,7 +312,8 @@ func (d *DedicatedHostsServerTransport) dispatchNewListByHostGroupPager(req *htt if d.srv.NewListByHostGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByHostGroupPager not implemented")} } - if d.newListByHostGroupPager == nil { + newListByHostGroupPager := d.newListByHostGroupPager.get(req) + if newListByHostGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/hostGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/hosts` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -311,20 +329,22 @@ func (d *DedicatedHostsServerTransport) dispatchNewListByHostGroupPager(req *htt return nil, err } resp := d.srv.NewListByHostGroupPager(resourceGroupNameUnescaped, hostGroupNameUnescaped, nil) - d.newListByHostGroupPager = &resp - server.PagerResponderInjectNextLinks(d.newListByHostGroupPager, req, func(page *armcompute.DedicatedHostsClientListByHostGroupResponse, createLink func() string) { + newListByHostGroupPager = &resp + d.newListByHostGroupPager.add(req, newListByHostGroupPager) + server.PagerResponderInjectNextLinks(newListByHostGroupPager, req, func(page *armcompute.DedicatedHostsClientListByHostGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByHostGroupPager, req) + resp, err := server.PagerResponderNext(newListByHostGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByHostGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByHostGroupPager) { - d.newListByHostGroupPager = nil + if !server.PagerResponderMore(newListByHostGroupPager) { + d.newListByHostGroupPager.remove(req) } return resp, nil } @@ -333,7 +353,8 @@ func (d *DedicatedHostsServerTransport) dispatchBeginRestart(req *http.Request) if d.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} } - if d.beginRestart == nil { + beginRestart := d.beginRestart.get(req) + if beginRestart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/hostGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/hosts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -356,19 +377,21 @@ func (d *DedicatedHostsServerTransport) dispatchBeginRestart(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginRestart = &respr + beginRestart = &respr + d.beginRestart.add(req, beginRestart) } - resp, err := server.PollerResponderNext(d.beginRestart, req) + resp, err := server.PollerResponderNext(beginRestart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.beginRestart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginRestart) { - d.beginRestart = nil + if !server.PollerResponderMore(beginRestart) { + d.beginRestart.remove(req) } return resp, nil @@ -378,7 +401,8 @@ func (d *DedicatedHostsServerTransport) dispatchBeginUpdate(req *http.Request) ( if d.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if d.beginUpdate == nil { + beginUpdate := d.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/hostGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/hosts/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -405,19 +429,21 @@ func (d *DedicatedHostsServerTransport) dispatchBeginUpdate(req *http.Request) ( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginUpdate = &respr + beginUpdate = &respr + d.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(d.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginUpdate) { - d.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + d.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/diskaccesses_server.go b/sdk/resourcemanager/compute/armcompute/fake/diskaccesses_server.go index 6e46387e0691..2c5c63532811 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/diskaccesses_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/diskaccesses_server.go @@ -70,24 +70,34 @@ type DiskAccessesServer struct { } // NewDiskAccessesServerTransport creates a new instance of DiskAccessesServerTransport with the provided implementation. -// The returned DiskAccessesServerTransport instance is connected to an instance of armcompute.DiskAccessesClient by way of the -// undefined.Transporter field. +// The returned DiskAccessesServerTransport instance is connected to an instance of armcompute.DiskAccessesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDiskAccessesServerTransport(srv *DiskAccessesServer) *DiskAccessesServerTransport { - return &DiskAccessesServerTransport{srv: srv} + return &DiskAccessesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.DiskAccessesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.DiskAccessesClientDeleteResponse]](), + beginDeleteAPrivateEndpointConnection: newTracker[azfake.PollerResponder[armcompute.DiskAccessesClientDeleteAPrivateEndpointConnectionResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.DiskAccessesClientListResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.DiskAccessesClientListByResourceGroupResponse]](), + newListPrivateEndpointConnectionsPager: newTracker[azfake.PagerResponder[armcompute.DiskAccessesClientListPrivateEndpointConnectionsResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.DiskAccessesClientUpdateResponse]](), + beginUpdateAPrivateEndpointConnection: newTracker[azfake.PollerResponder[armcompute.DiskAccessesClientUpdateAPrivateEndpointConnectionResponse]](), + } } // DiskAccessesServerTransport connects instances of armcompute.DiskAccessesClient to instances of DiskAccessesServer. // Don't use this type directly, use NewDiskAccessesServerTransport instead. type DiskAccessesServerTransport struct { srv *DiskAccessesServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.DiskAccessesClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.DiskAccessesClientDeleteResponse] - beginDeleteAPrivateEndpointConnection *azfake.PollerResponder[armcompute.DiskAccessesClientDeleteAPrivateEndpointConnectionResponse] - newListPager *azfake.PagerResponder[armcompute.DiskAccessesClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcompute.DiskAccessesClientListByResourceGroupResponse] - newListPrivateEndpointConnectionsPager *azfake.PagerResponder[armcompute.DiskAccessesClientListPrivateEndpointConnectionsResponse] - beginUpdate *azfake.PollerResponder[armcompute.DiskAccessesClientUpdateResponse] - beginUpdateAPrivateEndpointConnection *azfake.PollerResponder[armcompute.DiskAccessesClientUpdateAPrivateEndpointConnectionResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.DiskAccessesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.DiskAccessesClientDeleteResponse]] + beginDeleteAPrivateEndpointConnection *tracker[azfake.PollerResponder[armcompute.DiskAccessesClientDeleteAPrivateEndpointConnectionResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.DiskAccessesClientListResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.DiskAccessesClientListByResourceGroupResponse]] + newListPrivateEndpointConnectionsPager *tracker[azfake.PagerResponder[armcompute.DiskAccessesClientListPrivateEndpointConnectionsResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.DiskAccessesClientUpdateResponse]] + beginUpdateAPrivateEndpointConnection *tracker[azfake.PollerResponder[armcompute.DiskAccessesClientUpdateAPrivateEndpointConnectionResponse]] } // Do implements the policy.Transporter interface for DiskAccessesServerTransport. @@ -139,7 +149,8 @@ func (d *DiskAccessesServerTransport) dispatchBeginCreateOrUpdate(req *http.Requ if d.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if d.beginCreateOrUpdate == nil { + beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskAccesses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -162,19 +173,21 @@ func (d *DiskAccessesServerTransport) dispatchBeginCreateOrUpdate(req *http.Requ if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(d.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginCreateOrUpdate) { - d.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) } return resp, nil @@ -184,7 +197,8 @@ func (d *DiskAccessesServerTransport) dispatchBeginDelete(req *http.Request) (*h if d.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if d.beginDelete == nil { + beginDelete := d.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskAccesses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -203,19 +217,21 @@ func (d *DiskAccessesServerTransport) dispatchBeginDelete(req *http.Request) (*h if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginDelete = &respr + beginDelete = &respr + d.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(d.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginDelete) { - d.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + d.beginDelete.remove(req) } return resp, nil @@ -225,7 +241,8 @@ func (d *DiskAccessesServerTransport) dispatchBeginDeleteAPrivateEndpointConnect if d.srv.BeginDeleteAPrivateEndpointConnection == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDeleteAPrivateEndpointConnection not implemented")} } - if d.beginDeleteAPrivateEndpointConnection == nil { + beginDeleteAPrivateEndpointConnection := d.beginDeleteAPrivateEndpointConnection.get(req) + if beginDeleteAPrivateEndpointConnection == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskAccesses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -248,19 +265,21 @@ func (d *DiskAccessesServerTransport) dispatchBeginDeleteAPrivateEndpointConnect if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginDeleteAPrivateEndpointConnection = &respr + beginDeleteAPrivateEndpointConnection = &respr + d.beginDeleteAPrivateEndpointConnection.add(req, beginDeleteAPrivateEndpointConnection) } - resp, err := server.PollerResponderNext(d.beginDeleteAPrivateEndpointConnection, req) + resp, err := server.PollerResponderNext(beginDeleteAPrivateEndpointConnection, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDeleteAPrivateEndpointConnection.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginDeleteAPrivateEndpointConnection) { - d.beginDeleteAPrivateEndpointConnection = nil + if !server.PollerResponderMore(beginDeleteAPrivateEndpointConnection) { + d.beginDeleteAPrivateEndpointConnection.remove(req) } return resp, nil @@ -373,7 +392,8 @@ func (d *DiskAccessesServerTransport) dispatchNewListPager(req *http.Request) (* if d.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if d.newListPager == nil { + newListPager := d.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskAccesses` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -381,20 +401,22 @@ func (d *DiskAccessesServerTransport) dispatchNewListPager(req *http.Request) (* return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := d.srv.NewListPager(nil) - d.newListPager = &resp - server.PagerResponderInjectNextLinks(d.newListPager, req, func(page *armcompute.DiskAccessesClientListResponse, createLink func() string) { + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.DiskAccessesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListPager) { - d.newListPager = nil + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) } return resp, nil } @@ -403,7 +425,8 @@ func (d *DiskAccessesServerTransport) dispatchNewListByResourceGroupPager(req *h if d.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if d.newListByResourceGroupPager == nil { + newListByResourceGroupPager := d.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskAccesses` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -415,20 +438,22 @@ func (d *DiskAccessesServerTransport) dispatchNewListByResourceGroupPager(req *h return nil, err } resp := d.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - d.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(d.newListByResourceGroupPager, req, func(page *armcompute.DiskAccessesClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + d.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.DiskAccessesClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByResourceGroupPager) { - d.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + d.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -437,7 +462,8 @@ func (d *DiskAccessesServerTransport) dispatchNewListPrivateEndpointConnectionsP if d.srv.NewListPrivateEndpointConnectionsPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPrivateEndpointConnectionsPager not implemented")} } - if d.newListPrivateEndpointConnectionsPager == nil { + newListPrivateEndpointConnectionsPager := d.newListPrivateEndpointConnectionsPager.get(req) + if newListPrivateEndpointConnectionsPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskAccesses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -453,20 +479,22 @@ func (d *DiskAccessesServerTransport) dispatchNewListPrivateEndpointConnectionsP return nil, err } resp := d.srv.NewListPrivateEndpointConnectionsPager(resourceGroupNameUnescaped, diskAccessNameUnescaped, nil) - d.newListPrivateEndpointConnectionsPager = &resp - server.PagerResponderInjectNextLinks(d.newListPrivateEndpointConnectionsPager, req, func(page *armcompute.DiskAccessesClientListPrivateEndpointConnectionsResponse, createLink func() string) { + newListPrivateEndpointConnectionsPager = &resp + d.newListPrivateEndpointConnectionsPager.add(req, newListPrivateEndpointConnectionsPager) + server.PagerResponderInjectNextLinks(newListPrivateEndpointConnectionsPager, req, func(page *armcompute.DiskAccessesClientListPrivateEndpointConnectionsResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListPrivateEndpointConnectionsPager, req) + resp, err := server.PagerResponderNext(newListPrivateEndpointConnectionsPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPrivateEndpointConnectionsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListPrivateEndpointConnectionsPager) { - d.newListPrivateEndpointConnectionsPager = nil + if !server.PagerResponderMore(newListPrivateEndpointConnectionsPager) { + d.newListPrivateEndpointConnectionsPager.remove(req) } return resp, nil } @@ -475,7 +503,8 @@ func (d *DiskAccessesServerTransport) dispatchBeginUpdate(req *http.Request) (*h if d.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if d.beginUpdate == nil { + beginUpdate := d.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskAccesses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -498,19 +527,21 @@ func (d *DiskAccessesServerTransport) dispatchBeginUpdate(req *http.Request) (*h if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginUpdate = &respr + beginUpdate = &respr + d.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(d.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginUpdate) { - d.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + d.beginUpdate.remove(req) } return resp, nil @@ -520,7 +551,8 @@ func (d *DiskAccessesServerTransport) dispatchBeginUpdateAPrivateEndpointConnect if d.srv.BeginUpdateAPrivateEndpointConnection == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdateAPrivateEndpointConnection not implemented")} } - if d.beginUpdateAPrivateEndpointConnection == nil { + beginUpdateAPrivateEndpointConnection := d.beginUpdateAPrivateEndpointConnection.get(req) + if beginUpdateAPrivateEndpointConnection == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskAccesses/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/privateEndpointConnections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -547,19 +579,21 @@ func (d *DiskAccessesServerTransport) dispatchBeginUpdateAPrivateEndpointConnect if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginUpdateAPrivateEndpointConnection = &respr + beginUpdateAPrivateEndpointConnection = &respr + d.beginUpdateAPrivateEndpointConnection.add(req, beginUpdateAPrivateEndpointConnection) } - resp, err := server.PollerResponderNext(d.beginUpdateAPrivateEndpointConnection, req) + resp, err := server.PollerResponderNext(beginUpdateAPrivateEndpointConnection, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginUpdateAPrivateEndpointConnection.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginUpdateAPrivateEndpointConnection) { - d.beginUpdateAPrivateEndpointConnection = nil + if !server.PollerResponderMore(beginUpdateAPrivateEndpointConnection) { + d.beginUpdateAPrivateEndpointConnection.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/diskencryptionsets_server.go b/sdk/resourcemanager/compute/armcompute/fake/diskencryptionsets_server.go index 66f8b5b6113c..bc5c3950b2f7 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/diskencryptionsets_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/diskencryptionsets_server.go @@ -54,22 +54,30 @@ type DiskEncryptionSetsServer struct { } // NewDiskEncryptionSetsServerTransport creates a new instance of DiskEncryptionSetsServerTransport with the provided implementation. -// The returned DiskEncryptionSetsServerTransport instance is connected to an instance of armcompute.DiskEncryptionSetsClient by way of the -// undefined.Transporter field. +// The returned DiskEncryptionSetsServerTransport instance is connected to an instance of armcompute.DiskEncryptionSetsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDiskEncryptionSetsServerTransport(srv *DiskEncryptionSetsServer) *DiskEncryptionSetsServerTransport { - return &DiskEncryptionSetsServerTransport{srv: srv} + return &DiskEncryptionSetsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.DiskEncryptionSetsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.DiskEncryptionSetsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListResponse]](), + newListAssociatedResourcesPager: newTracker[azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListAssociatedResourcesResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListByResourceGroupResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.DiskEncryptionSetsClientUpdateResponse]](), + } } // DiskEncryptionSetsServerTransport connects instances of armcompute.DiskEncryptionSetsClient to instances of DiskEncryptionSetsServer. // Don't use this type directly, use NewDiskEncryptionSetsServerTransport instead. type DiskEncryptionSetsServerTransport struct { srv *DiskEncryptionSetsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.DiskEncryptionSetsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.DiskEncryptionSetsClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListResponse] - newListAssociatedResourcesPager *azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListAssociatedResourcesResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListByResourceGroupResponse] - beginUpdate *azfake.PollerResponder[armcompute.DiskEncryptionSetsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.DiskEncryptionSetsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.DiskEncryptionSetsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListResponse]] + newListAssociatedResourcesPager *tracker[azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListAssociatedResourcesResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.DiskEncryptionSetsClientListByResourceGroupResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.DiskEncryptionSetsClientUpdateResponse]] } // Do implements the policy.Transporter interface for DiskEncryptionSetsServerTransport. @@ -113,7 +121,8 @@ func (d *DiskEncryptionSetsServerTransport) dispatchBeginCreateOrUpdate(req *htt if d.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if d.beginCreateOrUpdate == nil { + beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskEncryptionSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -136,19 +145,21 @@ func (d *DiskEncryptionSetsServerTransport) dispatchBeginCreateOrUpdate(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(d.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginCreateOrUpdate) { - d.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) } return resp, nil @@ -158,7 +169,8 @@ func (d *DiskEncryptionSetsServerTransport) dispatchBeginDelete(req *http.Reques if d.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if d.beginDelete == nil { + beginDelete := d.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskEncryptionSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -177,19 +189,21 @@ func (d *DiskEncryptionSetsServerTransport) dispatchBeginDelete(req *http.Reques if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginDelete = &respr + beginDelete = &respr + d.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(d.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginDelete) { - d.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + d.beginDelete.remove(req) } return resp, nil @@ -232,7 +246,8 @@ func (d *DiskEncryptionSetsServerTransport) dispatchNewListPager(req *http.Reque if d.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if d.newListPager == nil { + newListPager := d.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskEncryptionSets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -240,20 +255,22 @@ func (d *DiskEncryptionSetsServerTransport) dispatchNewListPager(req *http.Reque return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := d.srv.NewListPager(nil) - d.newListPager = &resp - server.PagerResponderInjectNextLinks(d.newListPager, req, func(page *armcompute.DiskEncryptionSetsClientListResponse, createLink func() string) { + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.DiskEncryptionSetsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListPager) { - d.newListPager = nil + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) } return resp, nil } @@ -262,7 +279,8 @@ func (d *DiskEncryptionSetsServerTransport) dispatchNewListAssociatedResourcesPa if d.srv.NewListAssociatedResourcesPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAssociatedResourcesPager not implemented")} } - if d.newListAssociatedResourcesPager == nil { + newListAssociatedResourcesPager := d.newListAssociatedResourcesPager.get(req) + if newListAssociatedResourcesPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskEncryptionSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/associatedResources` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -278,20 +296,22 @@ func (d *DiskEncryptionSetsServerTransport) dispatchNewListAssociatedResourcesPa return nil, err } resp := d.srv.NewListAssociatedResourcesPager(resourceGroupNameUnescaped, diskEncryptionSetNameUnescaped, nil) - d.newListAssociatedResourcesPager = &resp - server.PagerResponderInjectNextLinks(d.newListAssociatedResourcesPager, req, func(page *armcompute.DiskEncryptionSetsClientListAssociatedResourcesResponse, createLink func() string) { + newListAssociatedResourcesPager = &resp + d.newListAssociatedResourcesPager.add(req, newListAssociatedResourcesPager) + server.PagerResponderInjectNextLinks(newListAssociatedResourcesPager, req, func(page *armcompute.DiskEncryptionSetsClientListAssociatedResourcesResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListAssociatedResourcesPager, req) + resp, err := server.PagerResponderNext(newListAssociatedResourcesPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListAssociatedResourcesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListAssociatedResourcesPager) { - d.newListAssociatedResourcesPager = nil + if !server.PagerResponderMore(newListAssociatedResourcesPager) { + d.newListAssociatedResourcesPager.remove(req) } return resp, nil } @@ -300,7 +320,8 @@ func (d *DiskEncryptionSetsServerTransport) dispatchNewListByResourceGroupPager( if d.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if d.newListByResourceGroupPager == nil { + newListByResourceGroupPager := d.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskEncryptionSets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -312,20 +333,22 @@ func (d *DiskEncryptionSetsServerTransport) dispatchNewListByResourceGroupPager( return nil, err } resp := d.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - d.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(d.newListByResourceGroupPager, req, func(page *armcompute.DiskEncryptionSetsClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + d.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.DiskEncryptionSetsClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByResourceGroupPager) { - d.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + d.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -334,7 +357,8 @@ func (d *DiskEncryptionSetsServerTransport) dispatchBeginUpdate(req *http.Reques if d.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if d.beginUpdate == nil { + beginUpdate := d.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/diskEncryptionSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -357,19 +381,21 @@ func (d *DiskEncryptionSetsServerTransport) dispatchBeginUpdate(req *http.Reques if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginUpdate = &respr + beginUpdate = &respr + d.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(d.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginUpdate) { - d.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + d.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/diskrestorepoint_server.go b/sdk/resourcemanager/compute/armcompute/fake/diskrestorepoint_server.go index d91d690cf622..ab13ab0ecb00 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/diskrestorepoint_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/diskrestorepoint_server.go @@ -42,19 +42,24 @@ type DiskRestorePointServer struct { } // NewDiskRestorePointServerTransport creates a new instance of DiskRestorePointServerTransport with the provided implementation. -// The returned DiskRestorePointServerTransport instance is connected to an instance of armcompute.DiskRestorePointClient by way of the -// undefined.Transporter field. +// The returned DiskRestorePointServerTransport instance is connected to an instance of armcompute.DiskRestorePointClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDiskRestorePointServerTransport(srv *DiskRestorePointServer) *DiskRestorePointServerTransport { - return &DiskRestorePointServerTransport{srv: srv} + return &DiskRestorePointServerTransport{ + srv: srv, + beginGrantAccess: newTracker[azfake.PollerResponder[armcompute.DiskRestorePointClientGrantAccessResponse]](), + newListByRestorePointPager: newTracker[azfake.PagerResponder[armcompute.DiskRestorePointClientListByRestorePointResponse]](), + beginRevokeAccess: newTracker[azfake.PollerResponder[armcompute.DiskRestorePointClientRevokeAccessResponse]](), + } } // DiskRestorePointServerTransport connects instances of armcompute.DiskRestorePointClient to instances of DiskRestorePointServer. // Don't use this type directly, use NewDiskRestorePointServerTransport instead. type DiskRestorePointServerTransport struct { srv *DiskRestorePointServer - beginGrantAccess *azfake.PollerResponder[armcompute.DiskRestorePointClientGrantAccessResponse] - newListByRestorePointPager *azfake.PagerResponder[armcompute.DiskRestorePointClientListByRestorePointResponse] - beginRevokeAccess *azfake.PollerResponder[armcompute.DiskRestorePointClientRevokeAccessResponse] + beginGrantAccess *tracker[azfake.PollerResponder[armcompute.DiskRestorePointClientGrantAccessResponse]] + newListByRestorePointPager *tracker[azfake.PagerResponder[armcompute.DiskRestorePointClientListByRestorePointResponse]] + beginRevokeAccess *tracker[azfake.PollerResponder[armcompute.DiskRestorePointClientRevokeAccessResponse]] } // Do implements the policy.Transporter interface for DiskRestorePointServerTransport. @@ -133,7 +138,8 @@ func (d *DiskRestorePointServerTransport) dispatchBeginGrantAccess(req *http.Req if d.srv.BeginGrantAccess == nil { return nil, &nonRetriableError{errors.New("fake for method BeginGrantAccess not implemented")} } - if d.beginGrantAccess == nil { + beginGrantAccess := d.beginGrantAccess.get(req) + if beginGrantAccess == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/restorePointCollections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restorePoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/diskRestorePoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/beginGetAccess` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -164,19 +170,21 @@ func (d *DiskRestorePointServerTransport) dispatchBeginGrantAccess(req *http.Req if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginGrantAccess = &respr + beginGrantAccess = &respr + d.beginGrantAccess.add(req, beginGrantAccess) } - resp, err := server.PollerResponderNext(d.beginGrantAccess, req) + resp, err := server.PollerResponderNext(beginGrantAccess, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginGrantAccess.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginGrantAccess) { - d.beginGrantAccess = nil + if !server.PollerResponderMore(beginGrantAccess) { + d.beginGrantAccess.remove(req) } return resp, nil @@ -186,7 +194,8 @@ func (d *DiskRestorePointServerTransport) dispatchNewListByRestorePointPager(req if d.srv.NewListByRestorePointPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByRestorePointPager not implemented")} } - if d.newListByRestorePointPager == nil { + newListByRestorePointPager := d.newListByRestorePointPager.get(req) + if newListByRestorePointPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/restorePointCollections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restorePoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/diskRestorePoints` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -206,20 +215,22 @@ func (d *DiskRestorePointServerTransport) dispatchNewListByRestorePointPager(req return nil, err } resp := d.srv.NewListByRestorePointPager(resourceGroupNameUnescaped, restorePointCollectionNameUnescaped, vmRestorePointNameUnescaped, nil) - d.newListByRestorePointPager = &resp - server.PagerResponderInjectNextLinks(d.newListByRestorePointPager, req, func(page *armcompute.DiskRestorePointClientListByRestorePointResponse, createLink func() string) { + newListByRestorePointPager = &resp + d.newListByRestorePointPager.add(req, newListByRestorePointPager) + server.PagerResponderInjectNextLinks(newListByRestorePointPager, req, func(page *armcompute.DiskRestorePointClientListByRestorePointResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByRestorePointPager, req) + resp, err := server.PagerResponderNext(newListByRestorePointPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByRestorePointPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByRestorePointPager) { - d.newListByRestorePointPager = nil + if !server.PagerResponderMore(newListByRestorePointPager) { + d.newListByRestorePointPager.remove(req) } return resp, nil } @@ -228,7 +239,8 @@ func (d *DiskRestorePointServerTransport) dispatchBeginRevokeAccess(req *http.Re if d.srv.BeginRevokeAccess == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRevokeAccess not implemented")} } - if d.beginRevokeAccess == nil { + beginRevokeAccess := d.beginRevokeAccess.get(req) + if beginRevokeAccess == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/restorePointCollections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restorePoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/diskRestorePoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/endGetAccess` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -255,19 +267,21 @@ func (d *DiskRestorePointServerTransport) dispatchBeginRevokeAccess(req *http.Re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginRevokeAccess = &respr + beginRevokeAccess = &respr + d.beginRevokeAccess.add(req, beginRevokeAccess) } - resp, err := server.PollerResponderNext(d.beginRevokeAccess, req) + resp, err := server.PollerResponderNext(beginRevokeAccess, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginRevokeAccess.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginRevokeAccess) { - d.beginRevokeAccess = nil + if !server.PollerResponderMore(beginRevokeAccess) { + d.beginRevokeAccess.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/disks_server.go b/sdk/resourcemanager/compute/armcompute/fake/disks_server.go index b190cd1c3129..ce15abbeb8ea 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/disks_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/disks_server.go @@ -58,23 +58,32 @@ type DisksServer struct { } // NewDisksServerTransport creates a new instance of DisksServerTransport with the provided implementation. -// The returned DisksServerTransport instance is connected to an instance of armcompute.DisksClient by way of the -// undefined.Transporter field. +// The returned DisksServerTransport instance is connected to an instance of armcompute.DisksClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewDisksServerTransport(srv *DisksServer) *DisksServerTransport { - return &DisksServerTransport{srv: srv} + return &DisksServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.DisksClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.DisksClientDeleteResponse]](), + beginGrantAccess: newTracker[azfake.PollerResponder[armcompute.DisksClientGrantAccessResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.DisksClientListResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.DisksClientListByResourceGroupResponse]](), + beginRevokeAccess: newTracker[azfake.PollerResponder[armcompute.DisksClientRevokeAccessResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.DisksClientUpdateResponse]](), + } } // DisksServerTransport connects instances of armcompute.DisksClient to instances of DisksServer. // Don't use this type directly, use NewDisksServerTransport instead. type DisksServerTransport struct { srv *DisksServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.DisksClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.DisksClientDeleteResponse] - beginGrantAccess *azfake.PollerResponder[armcompute.DisksClientGrantAccessResponse] - newListPager *azfake.PagerResponder[armcompute.DisksClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcompute.DisksClientListByResourceGroupResponse] - beginRevokeAccess *azfake.PollerResponder[armcompute.DisksClientRevokeAccessResponse] - beginUpdate *azfake.PollerResponder[armcompute.DisksClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.DisksClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.DisksClientDeleteResponse]] + beginGrantAccess *tracker[azfake.PollerResponder[armcompute.DisksClientGrantAccessResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.DisksClientListResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.DisksClientListByResourceGroupResponse]] + beginRevokeAccess *tracker[azfake.PollerResponder[armcompute.DisksClientRevokeAccessResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.DisksClientUpdateResponse]] } // Do implements the policy.Transporter interface for DisksServerTransport. @@ -120,7 +129,8 @@ func (d *DisksServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (* if d.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if d.beginCreateOrUpdate == nil { + beginCreateOrUpdate := d.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/disks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -143,19 +153,21 @@ func (d *DisksServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) (* if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + d.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(d.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginCreateOrUpdate) { - d.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + d.beginCreateOrUpdate.remove(req) } return resp, nil @@ -165,7 +177,8 @@ func (d *DisksServerTransport) dispatchBeginDelete(req *http.Request) (*http.Res if d.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if d.beginDelete == nil { + beginDelete := d.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/disks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -184,19 +197,21 @@ func (d *DisksServerTransport) dispatchBeginDelete(req *http.Request) (*http.Res if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginDelete = &respr + beginDelete = &respr + d.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(d.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + d.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginDelete) { - d.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + d.beginDelete.remove(req) } return resp, nil @@ -239,7 +254,8 @@ func (d *DisksServerTransport) dispatchBeginGrantAccess(req *http.Request) (*htt if d.srv.BeginGrantAccess == nil { return nil, &nonRetriableError{errors.New("fake for method BeginGrantAccess not implemented")} } - if d.beginGrantAccess == nil { + beginGrantAccess := d.beginGrantAccess.get(req) + if beginGrantAccess == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/disks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/beginGetAccess` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -262,19 +278,21 @@ func (d *DisksServerTransport) dispatchBeginGrantAccess(req *http.Request) (*htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginGrantAccess = &respr + beginGrantAccess = &respr + d.beginGrantAccess.add(req, beginGrantAccess) } - resp, err := server.PollerResponderNext(d.beginGrantAccess, req) + resp, err := server.PollerResponderNext(beginGrantAccess, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginGrantAccess.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginGrantAccess) { - d.beginGrantAccess = nil + if !server.PollerResponderMore(beginGrantAccess) { + d.beginGrantAccess.remove(req) } return resp, nil @@ -284,7 +302,8 @@ func (d *DisksServerTransport) dispatchNewListPager(req *http.Request) (*http.Re if d.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if d.newListPager == nil { + newListPager := d.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/disks` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -292,20 +311,22 @@ func (d *DisksServerTransport) dispatchNewListPager(req *http.Request) (*http.Re return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := d.srv.NewListPager(nil) - d.newListPager = &resp - server.PagerResponderInjectNextLinks(d.newListPager, req, func(page *armcompute.DisksClientListResponse, createLink func() string) { + newListPager = &resp + d.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.DisksClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListPager) { - d.newListPager = nil + if !server.PagerResponderMore(newListPager) { + d.newListPager.remove(req) } return resp, nil } @@ -314,7 +335,8 @@ func (d *DisksServerTransport) dispatchNewListByResourceGroupPager(req *http.Req if d.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if d.newListByResourceGroupPager == nil { + newListByResourceGroupPager := d.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/disks` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -326,20 +348,22 @@ func (d *DisksServerTransport) dispatchNewListByResourceGroupPager(req *http.Req return nil, err } resp := d.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - d.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(d.newListByResourceGroupPager, req, func(page *armcompute.DisksClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + d.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.DisksClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(d.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + d.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(d.newListByResourceGroupPager) { - d.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + d.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -348,7 +372,8 @@ func (d *DisksServerTransport) dispatchBeginRevokeAccess(req *http.Request) (*ht if d.srv.BeginRevokeAccess == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRevokeAccess not implemented")} } - if d.beginRevokeAccess == nil { + beginRevokeAccess := d.beginRevokeAccess.get(req) + if beginRevokeAccess == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/disks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/endGetAccess` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -367,19 +392,21 @@ func (d *DisksServerTransport) dispatchBeginRevokeAccess(req *http.Request) (*ht if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginRevokeAccess = &respr + beginRevokeAccess = &respr + d.beginRevokeAccess.add(req, beginRevokeAccess) } - resp, err := server.PollerResponderNext(d.beginRevokeAccess, req) + resp, err := server.PollerResponderNext(beginRevokeAccess, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginRevokeAccess.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginRevokeAccess) { - d.beginRevokeAccess = nil + if !server.PollerResponderMore(beginRevokeAccess) { + d.beginRevokeAccess.remove(req) } return resp, nil @@ -389,7 +416,8 @@ func (d *DisksServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Res if d.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if d.beginUpdate == nil { + beginUpdate := d.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/disks/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -412,19 +440,21 @@ func (d *DisksServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Res if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - d.beginUpdate = &respr + beginUpdate = &respr + d.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(d.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + d.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(d.beginUpdate) { - d.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + d.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleries_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleries_server.go index c86071662757..64bc25ad5505 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleries_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleries_server.go @@ -50,21 +50,28 @@ type GalleriesServer struct { } // NewGalleriesServerTransport creates a new instance of GalleriesServerTransport with the provided implementation. -// The returned GalleriesServerTransport instance is connected to an instance of armcompute.GalleriesClient by way of the -// undefined.Transporter field. +// The returned GalleriesServerTransport instance is connected to an instance of armcompute.GalleriesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewGalleriesServerTransport(srv *GalleriesServer) *GalleriesServerTransport { - return &GalleriesServerTransport{srv: srv} + return &GalleriesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.GalleriesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.GalleriesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.GalleriesClientListResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.GalleriesClientListByResourceGroupResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.GalleriesClientUpdateResponse]](), + } } // GalleriesServerTransport connects instances of armcompute.GalleriesClient to instances of GalleriesServer. // Don't use this type directly, use NewGalleriesServerTransport instead. type GalleriesServerTransport struct { srv *GalleriesServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.GalleriesClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.GalleriesClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.GalleriesClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcompute.GalleriesClientListByResourceGroupResponse] - beginUpdate *azfake.PollerResponder[armcompute.GalleriesClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.GalleriesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.GalleriesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.GalleriesClientListResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.GalleriesClientListByResourceGroupResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.GalleriesClientUpdateResponse]] } // Do implements the policy.Transporter interface for GalleriesServerTransport. @@ -106,7 +113,8 @@ func (g *GalleriesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request if g.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if g.beginCreateOrUpdate == nil { + beginCreateOrUpdate := g.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -129,19 +137,21 @@ func (g *GalleriesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + g.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(g.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + g.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginCreateOrUpdate) { - g.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + g.beginCreateOrUpdate.remove(req) } return resp, nil @@ -151,7 +161,8 @@ func (g *GalleriesServerTransport) dispatchBeginDelete(req *http.Request) (*http if g.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if g.beginDelete == nil { + beginDelete := g.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -170,19 +181,21 @@ func (g *GalleriesServerTransport) dispatchBeginDelete(req *http.Request) (*http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginDelete = &respr + beginDelete = &respr + g.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(g.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + g.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginDelete) { - g.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + g.beginDelete.remove(req) } return resp, nil @@ -243,7 +256,8 @@ func (g *GalleriesServerTransport) dispatchNewListPager(req *http.Request) (*htt if g.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if g.newListPager == nil { + newListPager := g.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -251,20 +265,22 @@ func (g *GalleriesServerTransport) dispatchNewListPager(req *http.Request) (*htt return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := g.srv.NewListPager(nil) - g.newListPager = &resp - server.PagerResponderInjectNextLinks(g.newListPager, req, func(page *armcompute.GalleriesClientListResponse, createLink func() string) { + newListPager = &resp + g.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.GalleriesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(g.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(g.newListPager) { - g.newListPager = nil + if !server.PagerResponderMore(newListPager) { + g.newListPager.remove(req) } return resp, nil } @@ -273,7 +289,8 @@ func (g *GalleriesServerTransport) dispatchNewListByResourceGroupPager(req *http if g.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if g.newListByResourceGroupPager == nil { + newListByResourceGroupPager := g.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -285,20 +302,22 @@ func (g *GalleriesServerTransport) dispatchNewListByResourceGroupPager(req *http return nil, err } resp := g.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - g.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(g.newListByResourceGroupPager, req, func(page *armcompute.GalleriesClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + g.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.GalleriesClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(g.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(g.newListByResourceGroupPager) { - g.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + g.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -307,7 +326,8 @@ func (g *GalleriesServerTransport) dispatchBeginUpdate(req *http.Request) (*http if g.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if g.beginUpdate == nil { + beginUpdate := g.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -330,19 +350,21 @@ func (g *GalleriesServerTransport) dispatchBeginUpdate(req *http.Request) (*http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginUpdate = &respr + beginUpdate = &respr + g.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(g.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginUpdate) { - g.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + g.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryapplications_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryapplications_server.go index ec505359bbea..9d47d99aeb4d 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryapplications_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleryapplications_server.go @@ -46,20 +46,26 @@ type GalleryApplicationsServer struct { } // NewGalleryApplicationsServerTransport creates a new instance of GalleryApplicationsServerTransport with the provided implementation. -// The returned GalleryApplicationsServerTransport instance is connected to an instance of armcompute.GalleryApplicationsClient by way of the -// undefined.Transporter field. +// The returned GalleryApplicationsServerTransport instance is connected to an instance of armcompute.GalleryApplicationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewGalleryApplicationsServerTransport(srv *GalleryApplicationsServer) *GalleryApplicationsServerTransport { - return &GalleryApplicationsServerTransport{srv: srv} + return &GalleryApplicationsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryApplicationsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.GalleryApplicationsClientDeleteResponse]](), + newListByGalleryPager: newTracker[azfake.PagerResponder[armcompute.GalleryApplicationsClientListByGalleryResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryApplicationsClientUpdateResponse]](), + } } // GalleryApplicationsServerTransport connects instances of armcompute.GalleryApplicationsClient to instances of GalleryApplicationsServer. // Don't use this type directly, use NewGalleryApplicationsServerTransport instead. type GalleryApplicationsServerTransport struct { srv *GalleryApplicationsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.GalleryApplicationsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.GalleryApplicationsClientDeleteResponse] - newListByGalleryPager *azfake.PagerResponder[armcompute.GalleryApplicationsClientListByGalleryResponse] - beginUpdate *azfake.PollerResponder[armcompute.GalleryApplicationsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.GalleryApplicationsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.GalleryApplicationsClientDeleteResponse]] + newListByGalleryPager *tracker[azfake.PagerResponder[armcompute.GalleryApplicationsClientListByGalleryResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.GalleryApplicationsClientUpdateResponse]] } // Do implements the policy.Transporter interface for GalleryApplicationsServerTransport. @@ -99,7 +105,8 @@ func (g *GalleryApplicationsServerTransport) dispatchBeginCreateOrUpdate(req *ht if g.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if g.beginCreateOrUpdate == nil { + beginCreateOrUpdate := g.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -126,19 +133,21 @@ func (g *GalleryApplicationsServerTransport) dispatchBeginCreateOrUpdate(req *ht if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + g.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(g.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + g.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginCreateOrUpdate) { - g.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + g.beginCreateOrUpdate.remove(req) } return resp, nil @@ -148,7 +157,8 @@ func (g *GalleryApplicationsServerTransport) dispatchBeginDelete(req *http.Reque if g.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if g.beginDelete == nil { + beginDelete := g.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -171,19 +181,21 @@ func (g *GalleryApplicationsServerTransport) dispatchBeginDelete(req *http.Reque if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginDelete = &respr + beginDelete = &respr + g.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(g.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + g.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginDelete) { - g.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + g.beginDelete.remove(req) } return resp, nil @@ -230,7 +242,8 @@ func (g *GalleryApplicationsServerTransport) dispatchNewListByGalleryPager(req * if g.srv.NewListByGalleryPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByGalleryPager not implemented")} } - if g.newListByGalleryPager == nil { + newListByGalleryPager := g.newListByGalleryPager.get(req) + if newListByGalleryPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -246,20 +259,22 @@ func (g *GalleryApplicationsServerTransport) dispatchNewListByGalleryPager(req * return nil, err } resp := g.srv.NewListByGalleryPager(resourceGroupNameUnescaped, galleryNameUnescaped, nil) - g.newListByGalleryPager = &resp - server.PagerResponderInjectNextLinks(g.newListByGalleryPager, req, func(page *armcompute.GalleryApplicationsClientListByGalleryResponse, createLink func() string) { + newListByGalleryPager = &resp + g.newListByGalleryPager.add(req, newListByGalleryPager) + server.PagerResponderInjectNextLinks(newListByGalleryPager, req, func(page *armcompute.GalleryApplicationsClientListByGalleryResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(g.newListByGalleryPager, req) + resp, err := server.PagerResponderNext(newListByGalleryPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.newListByGalleryPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(g.newListByGalleryPager) { - g.newListByGalleryPager = nil + if !server.PagerResponderMore(newListByGalleryPager) { + g.newListByGalleryPager.remove(req) } return resp, nil } @@ -268,7 +283,8 @@ func (g *GalleryApplicationsServerTransport) dispatchBeginUpdate(req *http.Reque if g.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if g.beginUpdate == nil { + beginUpdate := g.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -295,19 +311,21 @@ func (g *GalleryApplicationsServerTransport) dispatchBeginUpdate(req *http.Reque if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginUpdate = &respr + beginUpdate = &respr + g.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(g.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginUpdate) { - g.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + g.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryapplicationversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryapplicationversions_server.go index ccf4b614129c..b55f9b2c2184 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryapplicationversions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleryapplicationversions_server.go @@ -46,20 +46,26 @@ type GalleryApplicationVersionsServer struct { } // NewGalleryApplicationVersionsServerTransport creates a new instance of GalleryApplicationVersionsServerTransport with the provided implementation. -// The returned GalleryApplicationVersionsServerTransport instance is connected to an instance of armcompute.GalleryApplicationVersionsClient by way of the -// undefined.Transporter field. +// The returned GalleryApplicationVersionsServerTransport instance is connected to an instance of armcompute.GalleryApplicationVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewGalleryApplicationVersionsServerTransport(srv *GalleryApplicationVersionsServer) *GalleryApplicationVersionsServerTransport { - return &GalleryApplicationVersionsServerTransport{srv: srv} + return &GalleryApplicationVersionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientDeleteResponse]](), + newListByGalleryApplicationPager: newTracker[azfake.PagerResponder[armcompute.GalleryApplicationVersionsClientListByGalleryApplicationResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientUpdateResponse]](), + } } // GalleryApplicationVersionsServerTransport connects instances of armcompute.GalleryApplicationVersionsClient to instances of GalleryApplicationVersionsServer. // Don't use this type directly, use NewGalleryApplicationVersionsServerTransport instead. type GalleryApplicationVersionsServerTransport struct { srv *GalleryApplicationVersionsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientDeleteResponse] - newListByGalleryApplicationPager *azfake.PagerResponder[armcompute.GalleryApplicationVersionsClientListByGalleryApplicationResponse] - beginUpdate *azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientDeleteResponse]] + newListByGalleryApplicationPager *tracker[azfake.PagerResponder[armcompute.GalleryApplicationVersionsClientListByGalleryApplicationResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.GalleryApplicationVersionsClientUpdateResponse]] } // Do implements the policy.Transporter interface for GalleryApplicationVersionsServerTransport. @@ -99,7 +105,8 @@ func (g *GalleryApplicationVersionsServerTransport) dispatchBeginCreateOrUpdate( if g.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if g.beginCreateOrUpdate == nil { + beginCreateOrUpdate := g.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -130,19 +137,21 @@ func (g *GalleryApplicationVersionsServerTransport) dispatchBeginCreateOrUpdate( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + g.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(g.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + g.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginCreateOrUpdate) { - g.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + g.beginCreateOrUpdate.remove(req) } return resp, nil @@ -152,7 +161,8 @@ func (g *GalleryApplicationVersionsServerTransport) dispatchBeginDelete(req *htt if g.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if g.beginDelete == nil { + beginDelete := g.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -179,19 +189,21 @@ func (g *GalleryApplicationVersionsServerTransport) dispatchBeginDelete(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginDelete = &respr + beginDelete = &respr + g.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(g.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + g.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginDelete) { - g.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + g.beginDelete.remove(req) } return resp, nil @@ -254,7 +266,8 @@ func (g *GalleryApplicationVersionsServerTransport) dispatchNewListByGalleryAppl if g.srv.NewListByGalleryApplicationPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByGalleryApplicationPager not implemented")} } - if g.newListByGalleryApplicationPager == nil { + newListByGalleryApplicationPager := g.newListByGalleryApplicationPager.get(req) + if newListByGalleryApplicationPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -274,20 +287,22 @@ func (g *GalleryApplicationVersionsServerTransport) dispatchNewListByGalleryAppl return nil, err } resp := g.srv.NewListByGalleryApplicationPager(resourceGroupNameUnescaped, galleryNameUnescaped, galleryApplicationNameUnescaped, nil) - g.newListByGalleryApplicationPager = &resp - server.PagerResponderInjectNextLinks(g.newListByGalleryApplicationPager, req, func(page *armcompute.GalleryApplicationVersionsClientListByGalleryApplicationResponse, createLink func() string) { + newListByGalleryApplicationPager = &resp + g.newListByGalleryApplicationPager.add(req, newListByGalleryApplicationPager) + server.PagerResponderInjectNextLinks(newListByGalleryApplicationPager, req, func(page *armcompute.GalleryApplicationVersionsClientListByGalleryApplicationResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(g.newListByGalleryApplicationPager, req) + resp, err := server.PagerResponderNext(newListByGalleryApplicationPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.newListByGalleryApplicationPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(g.newListByGalleryApplicationPager) { - g.newListByGalleryApplicationPager = nil + if !server.PagerResponderMore(newListByGalleryApplicationPager) { + g.newListByGalleryApplicationPager.remove(req) } return resp, nil } @@ -296,7 +311,8 @@ func (g *GalleryApplicationVersionsServerTransport) dispatchBeginUpdate(req *htt if g.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if g.beginUpdate == nil { + beginUpdate := g.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/applications/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -327,19 +343,21 @@ func (g *GalleryApplicationVersionsServerTransport) dispatchBeginUpdate(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginUpdate = &respr + beginUpdate = &respr + g.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(g.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginUpdate) { - g.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + g.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryimages_server.go index 9fe025c69acf..97a80524a6c3 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleryimages_server.go @@ -46,20 +46,26 @@ type GalleryImagesServer struct { } // NewGalleryImagesServerTransport creates a new instance of GalleryImagesServerTransport with the provided implementation. -// The returned GalleryImagesServerTransport instance is connected to an instance of armcompute.GalleryImagesClient by way of the -// undefined.Transporter field. +// The returned GalleryImagesServerTransport instance is connected to an instance of armcompute.GalleryImagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewGalleryImagesServerTransport(srv *GalleryImagesServer) *GalleryImagesServerTransport { - return &GalleryImagesServerTransport{srv: srv} + return &GalleryImagesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryImagesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.GalleryImagesClientDeleteResponse]](), + newListByGalleryPager: newTracker[azfake.PagerResponder[armcompute.GalleryImagesClientListByGalleryResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryImagesClientUpdateResponse]](), + } } // GalleryImagesServerTransport connects instances of armcompute.GalleryImagesClient to instances of GalleryImagesServer. // Don't use this type directly, use NewGalleryImagesServerTransport instead. type GalleryImagesServerTransport struct { srv *GalleryImagesServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.GalleryImagesClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.GalleryImagesClientDeleteResponse] - newListByGalleryPager *azfake.PagerResponder[armcompute.GalleryImagesClientListByGalleryResponse] - beginUpdate *azfake.PollerResponder[armcompute.GalleryImagesClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.GalleryImagesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.GalleryImagesClientDeleteResponse]] + newListByGalleryPager *tracker[azfake.PagerResponder[armcompute.GalleryImagesClientListByGalleryResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.GalleryImagesClientUpdateResponse]] } // Do implements the policy.Transporter interface for GalleryImagesServerTransport. @@ -99,7 +105,8 @@ func (g *GalleryImagesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req if g.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if g.beginCreateOrUpdate == nil { + beginCreateOrUpdate := g.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -126,19 +133,21 @@ func (g *GalleryImagesServerTransport) dispatchBeginCreateOrUpdate(req *http.Req if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + g.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(g.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + g.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginCreateOrUpdate) { - g.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + g.beginCreateOrUpdate.remove(req) } return resp, nil @@ -148,7 +157,8 @@ func (g *GalleryImagesServerTransport) dispatchBeginDelete(req *http.Request) (* if g.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if g.beginDelete == nil { + beginDelete := g.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -171,19 +181,21 @@ func (g *GalleryImagesServerTransport) dispatchBeginDelete(req *http.Request) (* if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginDelete = &respr + beginDelete = &respr + g.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(g.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + g.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginDelete) { - g.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + g.beginDelete.remove(req) } return resp, nil @@ -230,7 +242,8 @@ func (g *GalleryImagesServerTransport) dispatchNewListByGalleryPager(req *http.R if g.srv.NewListByGalleryPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByGalleryPager not implemented")} } - if g.newListByGalleryPager == nil { + newListByGalleryPager := g.newListByGalleryPager.get(req) + if newListByGalleryPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -246,20 +259,22 @@ func (g *GalleryImagesServerTransport) dispatchNewListByGalleryPager(req *http.R return nil, err } resp := g.srv.NewListByGalleryPager(resourceGroupNameUnescaped, galleryNameUnescaped, nil) - g.newListByGalleryPager = &resp - server.PagerResponderInjectNextLinks(g.newListByGalleryPager, req, func(page *armcompute.GalleryImagesClientListByGalleryResponse, createLink func() string) { + newListByGalleryPager = &resp + g.newListByGalleryPager.add(req, newListByGalleryPager) + server.PagerResponderInjectNextLinks(newListByGalleryPager, req, func(page *armcompute.GalleryImagesClientListByGalleryResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(g.newListByGalleryPager, req) + resp, err := server.PagerResponderNext(newListByGalleryPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.newListByGalleryPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(g.newListByGalleryPager) { - g.newListByGalleryPager = nil + if !server.PagerResponderMore(newListByGalleryPager) { + g.newListByGalleryPager.remove(req) } return resp, nil } @@ -268,7 +283,8 @@ func (g *GalleryImagesServerTransport) dispatchBeginUpdate(req *http.Request) (* if g.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if g.beginUpdate == nil { + beginUpdate := g.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -295,19 +311,21 @@ func (g *GalleryImagesServerTransport) dispatchBeginUpdate(req *http.Request) (* if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginUpdate = &respr + beginUpdate = &respr + g.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(g.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginUpdate) { - g.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + g.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/galleryimageversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/galleryimageversions_server.go index 2add4cd73d91..7910745d33b7 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/galleryimageversions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/galleryimageversions_server.go @@ -46,20 +46,26 @@ type GalleryImageVersionsServer struct { } // NewGalleryImageVersionsServerTransport creates a new instance of GalleryImageVersionsServerTransport with the provided implementation. -// The returned GalleryImageVersionsServerTransport instance is connected to an instance of armcompute.GalleryImageVersionsClient by way of the -// undefined.Transporter field. +// The returned GalleryImageVersionsServerTransport instance is connected to an instance of armcompute.GalleryImageVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewGalleryImageVersionsServerTransport(srv *GalleryImageVersionsServer) *GalleryImageVersionsServerTransport { - return &GalleryImageVersionsServerTransport{srv: srv} + return &GalleryImageVersionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryImageVersionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.GalleryImageVersionsClientDeleteResponse]](), + newListByGalleryImagePager: newTracker[azfake.PagerResponder[armcompute.GalleryImageVersionsClientListByGalleryImageResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.GalleryImageVersionsClientUpdateResponse]](), + } } // GalleryImageVersionsServerTransport connects instances of armcompute.GalleryImageVersionsClient to instances of GalleryImageVersionsServer. // Don't use this type directly, use NewGalleryImageVersionsServerTransport instead. type GalleryImageVersionsServerTransport struct { srv *GalleryImageVersionsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.GalleryImageVersionsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.GalleryImageVersionsClientDeleteResponse] - newListByGalleryImagePager *azfake.PagerResponder[armcompute.GalleryImageVersionsClientListByGalleryImageResponse] - beginUpdate *azfake.PollerResponder[armcompute.GalleryImageVersionsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.GalleryImageVersionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.GalleryImageVersionsClientDeleteResponse]] + newListByGalleryImagePager *tracker[azfake.PagerResponder[armcompute.GalleryImageVersionsClientListByGalleryImageResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.GalleryImageVersionsClientUpdateResponse]] } // Do implements the policy.Transporter interface for GalleryImageVersionsServerTransport. @@ -99,7 +105,8 @@ func (g *GalleryImageVersionsServerTransport) dispatchBeginCreateOrUpdate(req *h if g.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if g.beginCreateOrUpdate == nil { + beginCreateOrUpdate := g.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -130,19 +137,21 @@ func (g *GalleryImageVersionsServerTransport) dispatchBeginCreateOrUpdate(req *h if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + g.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(g.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated, http.StatusAccepted}, resp.StatusCode) { + g.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginCreateOrUpdate) { - g.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + g.beginCreateOrUpdate.remove(req) } return resp, nil @@ -152,7 +161,8 @@ func (g *GalleryImageVersionsServerTransport) dispatchBeginDelete(req *http.Requ if g.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if g.beginDelete == nil { + beginDelete := g.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -179,19 +189,21 @@ func (g *GalleryImageVersionsServerTransport) dispatchBeginDelete(req *http.Requ if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginDelete = &respr + beginDelete = &respr + g.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(g.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + g.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginDelete) { - g.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + g.beginDelete.remove(req) } return resp, nil @@ -254,7 +266,8 @@ func (g *GalleryImageVersionsServerTransport) dispatchNewListByGalleryImagePager if g.srv.NewListByGalleryImagePager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByGalleryImagePager not implemented")} } - if g.newListByGalleryImagePager == nil { + newListByGalleryImagePager := g.newListByGalleryImagePager.get(req) + if newListByGalleryImagePager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -274,20 +287,22 @@ func (g *GalleryImageVersionsServerTransport) dispatchNewListByGalleryImagePager return nil, err } resp := g.srv.NewListByGalleryImagePager(resourceGroupNameUnescaped, galleryNameUnescaped, galleryImageNameUnescaped, nil) - g.newListByGalleryImagePager = &resp - server.PagerResponderInjectNextLinks(g.newListByGalleryImagePager, req, func(page *armcompute.GalleryImageVersionsClientListByGalleryImageResponse, createLink func() string) { + newListByGalleryImagePager = &resp + g.newListByGalleryImagePager.add(req, newListByGalleryImagePager) + server.PagerResponderInjectNextLinks(newListByGalleryImagePager, req, func(page *armcompute.GalleryImageVersionsClientListByGalleryImageResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(g.newListByGalleryImagePager, req) + resp, err := server.PagerResponderNext(newListByGalleryImagePager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.newListByGalleryImagePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(g.newListByGalleryImagePager) { - g.newListByGalleryImagePager = nil + if !server.PagerResponderMore(newListByGalleryImagePager) { + g.newListByGalleryImagePager.remove(req) } return resp, nil } @@ -296,7 +311,8 @@ func (g *GalleryImageVersionsServerTransport) dispatchBeginUpdate(req *http.Requ if g.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if g.beginUpdate == nil { + beginUpdate := g.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -327,19 +343,21 @@ func (g *GalleryImageVersionsServerTransport) dispatchBeginUpdate(req *http.Requ if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginUpdate = &respr + beginUpdate = &respr + g.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(g.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + g.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginUpdate) { - g.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + g.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/gallerysharingprofile_server.go b/sdk/resourcemanager/compute/armcompute/fake/gallerysharingprofile_server.go index d8157d5f0d6c..716a34b8c610 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/gallerysharingprofile_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/gallerysharingprofile_server.go @@ -29,17 +29,20 @@ type GallerySharingProfileServer struct { } // NewGallerySharingProfileServerTransport creates a new instance of GallerySharingProfileServerTransport with the provided implementation. -// The returned GallerySharingProfileServerTransport instance is connected to an instance of armcompute.GallerySharingProfileClient by way of the -// undefined.Transporter field. +// The returned GallerySharingProfileServerTransport instance is connected to an instance of armcompute.GallerySharingProfileClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewGallerySharingProfileServerTransport(srv *GallerySharingProfileServer) *GallerySharingProfileServerTransport { - return &GallerySharingProfileServerTransport{srv: srv} + return &GallerySharingProfileServerTransport{ + srv: srv, + beginUpdate: newTracker[azfake.PollerResponder[armcompute.GallerySharingProfileClientUpdateResponse]](), + } } // GallerySharingProfileServerTransport connects instances of armcompute.GallerySharingProfileClient to instances of GallerySharingProfileServer. // Don't use this type directly, use NewGallerySharingProfileServerTransport instead. type GallerySharingProfileServerTransport struct { srv *GallerySharingProfileServer - beginUpdate *azfake.PollerResponder[armcompute.GallerySharingProfileClientUpdateResponse] + beginUpdate *tracker[azfake.PollerResponder[armcompute.GallerySharingProfileClientUpdateResponse]] } // Do implements the policy.Transporter interface for GallerySharingProfileServerTransport. @@ -71,7 +74,8 @@ func (g *GallerySharingProfileServerTransport) dispatchBeginUpdate(req *http.Req if g.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if g.beginUpdate == nil { + beginUpdate := g.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/galleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/share` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -94,19 +98,21 @@ func (g *GallerySharingProfileServerTransport) dispatchBeginUpdate(req *http.Req if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - g.beginUpdate = &respr + beginUpdate = &respr + g.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(g.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + g.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(g.beginUpdate) { - g.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + g.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/images_server.go b/sdk/resourcemanager/compute/armcompute/fake/images_server.go index da04f379118c..ac5545531632 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/images_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/images_server.go @@ -50,21 +50,28 @@ type ImagesServer struct { } // NewImagesServerTransport creates a new instance of ImagesServerTransport with the provided implementation. -// The returned ImagesServerTransport instance is connected to an instance of armcompute.ImagesClient by way of the -// undefined.Transporter field. +// The returned ImagesServerTransport instance is connected to an instance of armcompute.ImagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewImagesServerTransport(srv *ImagesServer) *ImagesServerTransport { - return &ImagesServerTransport{srv: srv} + return &ImagesServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.ImagesClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.ImagesClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.ImagesClientListResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.ImagesClientListByResourceGroupResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.ImagesClientUpdateResponse]](), + } } // ImagesServerTransport connects instances of armcompute.ImagesClient to instances of ImagesServer. // Don't use this type directly, use NewImagesServerTransport instead. type ImagesServerTransport struct { srv *ImagesServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.ImagesClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.ImagesClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.ImagesClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcompute.ImagesClientListByResourceGroupResponse] - beginUpdate *azfake.PollerResponder[armcompute.ImagesClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.ImagesClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.ImagesClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.ImagesClientListResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.ImagesClientListByResourceGroupResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.ImagesClientUpdateResponse]] } // Do implements the policy.Transporter interface for ImagesServerTransport. @@ -106,7 +113,8 @@ func (i *ImagesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) ( if i.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if i.beginCreateOrUpdate == nil { + beginCreateOrUpdate := i.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -129,19 +137,21 @@ func (i *ImagesServerTransport) dispatchBeginCreateOrUpdate(req *http.Request) ( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - i.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + i.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(i.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + i.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(i.beginCreateOrUpdate) { - i.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + i.beginCreateOrUpdate.remove(req) } return resp, nil @@ -151,7 +161,8 @@ func (i *ImagesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re if i.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if i.beginDelete == nil { + beginDelete := i.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -170,19 +181,21 @@ func (i *ImagesServerTransport) dispatchBeginDelete(req *http.Request) (*http.Re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - i.beginDelete = &respr + beginDelete = &respr + i.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(i.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + i.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(i.beginDelete) { - i.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + i.beginDelete.remove(req) } return resp, nil @@ -237,7 +250,8 @@ func (i *ImagesServerTransport) dispatchNewListPager(req *http.Request) (*http.R if i.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if i.newListPager == nil { + newListPager := i.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/images` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -245,20 +259,22 @@ func (i *ImagesServerTransport) dispatchNewListPager(req *http.Request) (*http.R return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := i.srv.NewListPager(nil) - i.newListPager = &resp - server.PagerResponderInjectNextLinks(i.newListPager, req, func(page *armcompute.ImagesClientListResponse, createLink func() string) { + newListPager = &resp + i.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.ImagesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(i.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(i.newListPager) { - i.newListPager = nil + if !server.PagerResponderMore(newListPager) { + i.newListPager.remove(req) } return resp, nil } @@ -267,7 +283,8 @@ func (i *ImagesServerTransport) dispatchNewListByResourceGroupPager(req *http.Re if i.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if i.newListByResourceGroupPager == nil { + newListByResourceGroupPager := i.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/images` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -279,20 +296,22 @@ func (i *ImagesServerTransport) dispatchNewListByResourceGroupPager(req *http.Re return nil, err } resp := i.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - i.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(i.newListByResourceGroupPager, req, func(page *armcompute.ImagesClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + i.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.ImagesClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(i.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + i.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(i.newListByResourceGroupPager) { - i.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + i.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -301,7 +320,8 @@ func (i *ImagesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re if i.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if i.beginUpdate == nil { + beginUpdate := i.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -324,19 +344,21 @@ func (i *ImagesServerTransport) dispatchBeginUpdate(req *http.Request) (*http.Re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - i.beginUpdate = &respr + beginUpdate = &respr + i.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(i.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + i.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(i.beginUpdate) { - i.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + i.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/internal.go b/sdk/resourcemanager/compute/armcompute/fake/internal.go index e9c8222f2199..03b635903572 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/internal.go +++ b/sdk/resourcemanager/compute/armcompute/fake/internal.go @@ -12,6 +12,9 @@ import ( "io" "net/http" "reflect" + "regexp" + "strings" + "sync" ) type nonRetriableError struct { @@ -76,3 +79,45 @@ func contains[T comparable](s []T, v T) bool { } return false } + +func newTracker[T any]() *tracker[T] { + return &tracker[T]{ + items: map[string]*T{}, + } +} + +type tracker[T any] struct { + items map[string]*T + mu sync.Mutex +} + +func (p *tracker[T]) key(req *http.Request) string { + path := req.URL.Path + if match, _ := regexp.Match(`/page_\d+$`, []byte(path)); match { + path = path[:strings.LastIndex(path, "/")] + } else if strings.HasSuffix(path, "/get/fake/status") { + path = path[:len(path)-16] + } + return path +} + +func (p *tracker[T]) get(req *http.Request) *T { + p.mu.Lock() + defer p.mu.Unlock() + if item, ok := p.items[p.key(req)]; ok { + return item + } + return nil +} + +func (p *tracker[T]) add(req *http.Request, item *T) { + p.mu.Lock() + defer p.mu.Unlock() + p.items[p.key(req)] = item +} + +func (p *tracker[T]) remove(req *http.Request) { + p.mu.Lock() + defer p.mu.Unlock() + delete(p.items, p.key(req)) +} diff --git a/sdk/resourcemanager/compute/armcompute/fake/loganalytics_server.go b/sdk/resourcemanager/compute/armcompute/fake/loganalytics_server.go index 8c2a7b5ebc75..6e1539b65eda 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/loganalytics_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/loganalytics_server.go @@ -33,18 +33,22 @@ type LogAnalyticsServer struct { } // NewLogAnalyticsServerTransport creates a new instance of LogAnalyticsServerTransport with the provided implementation. -// The returned LogAnalyticsServerTransport instance is connected to an instance of armcompute.LogAnalyticsClient by way of the -// undefined.Transporter field. +// The returned LogAnalyticsServerTransport instance is connected to an instance of armcompute.LogAnalyticsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewLogAnalyticsServerTransport(srv *LogAnalyticsServer) *LogAnalyticsServerTransport { - return &LogAnalyticsServerTransport{srv: srv} + return &LogAnalyticsServerTransport{ + srv: srv, + beginExportRequestRateByInterval: newTracker[azfake.PollerResponder[armcompute.LogAnalyticsClientExportRequestRateByIntervalResponse]](), + beginExportThrottledRequests: newTracker[azfake.PollerResponder[armcompute.LogAnalyticsClientExportThrottledRequestsResponse]](), + } } // LogAnalyticsServerTransport connects instances of armcompute.LogAnalyticsClient to instances of LogAnalyticsServer. // Don't use this type directly, use NewLogAnalyticsServerTransport instead. type LogAnalyticsServerTransport struct { srv *LogAnalyticsServer - beginExportRequestRateByInterval *azfake.PollerResponder[armcompute.LogAnalyticsClientExportRequestRateByIntervalResponse] - beginExportThrottledRequests *azfake.PollerResponder[armcompute.LogAnalyticsClientExportThrottledRequestsResponse] + beginExportRequestRateByInterval *tracker[azfake.PollerResponder[armcompute.LogAnalyticsClientExportRequestRateByIntervalResponse]] + beginExportThrottledRequests *tracker[azfake.PollerResponder[armcompute.LogAnalyticsClientExportThrottledRequestsResponse]] } // Do implements the policy.Transporter interface for LogAnalyticsServerTransport. @@ -78,7 +82,8 @@ func (l *LogAnalyticsServerTransport) dispatchBeginExportRequestRateByInterval(r if l.srv.BeginExportRequestRateByInterval == nil { return nil, &nonRetriableError{errors.New("fake for method BeginExportRequestRateByInterval not implemented")} } - if l.beginExportRequestRateByInterval == nil { + beginExportRequestRateByInterval := l.beginExportRequestRateByInterval.get(req) + if beginExportRequestRateByInterval == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/logAnalytics/apiAccess/getRequestRateByInterval` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -97,19 +102,21 @@ func (l *LogAnalyticsServerTransport) dispatchBeginExportRequestRateByInterval(r if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - l.beginExportRequestRateByInterval = &respr + beginExportRequestRateByInterval = &respr + l.beginExportRequestRateByInterval.add(req, beginExportRequestRateByInterval) } - resp, err := server.PollerResponderNext(l.beginExportRequestRateByInterval, req) + resp, err := server.PollerResponderNext(beginExportRequestRateByInterval, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + l.beginExportRequestRateByInterval.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(l.beginExportRequestRateByInterval) { - l.beginExportRequestRateByInterval = nil + if !server.PollerResponderMore(beginExportRequestRateByInterval) { + l.beginExportRequestRateByInterval.remove(req) } return resp, nil @@ -119,7 +126,8 @@ func (l *LogAnalyticsServerTransport) dispatchBeginExportThrottledRequests(req * if l.srv.BeginExportThrottledRequests == nil { return nil, &nonRetriableError{errors.New("fake for method BeginExportThrottledRequests not implemented")} } - if l.beginExportThrottledRequests == nil { + beginExportThrottledRequests := l.beginExportThrottledRequests.get(req) + if beginExportThrottledRequests == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/logAnalytics/apiAccess/getThrottledRequests` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -138,19 +146,21 @@ func (l *LogAnalyticsServerTransport) dispatchBeginExportThrottledRequests(req * if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - l.beginExportThrottledRequests = &respr + beginExportThrottledRequests = &respr + l.beginExportThrottledRequests.add(req, beginExportThrottledRequests) } - resp, err := server.PollerResponderNext(l.beginExportThrottledRequests, req) + resp, err := server.PollerResponderNext(beginExportThrottledRequests, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + l.beginExportThrottledRequests.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(l.beginExportThrottledRequests) { - l.beginExportThrottledRequests = nil + if !server.PollerResponderMore(beginExportThrottledRequests) { + l.beginExportThrottledRequests.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/operations_server.go b/sdk/resourcemanager/compute/armcompute/fake/operations_server.go index cd6fa60a9598..103898c5c4be 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/operations_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/operations_server.go @@ -26,17 +26,20 @@ type OperationsServer struct { } // NewOperationsServerTransport creates a new instance of OperationsServerTransport with the provided implementation. -// The returned OperationsServerTransport instance is connected to an instance of armcompute.OperationsClient by way of the -// undefined.Transporter field. +// The returned OperationsServerTransport instance is connected to an instance of armcompute.OperationsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewOperationsServerTransport(srv *OperationsServer) *OperationsServerTransport { - return &OperationsServerTransport{srv: srv} + return &OperationsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.OperationsClientListResponse]](), + } } // OperationsServerTransport connects instances of armcompute.OperationsClient to instances of OperationsServer. // Don't use this type directly, use NewOperationsServerTransport instead. type OperationsServerTransport struct { srv *OperationsServer - newListPager *azfake.PagerResponder[armcompute.OperationsClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.OperationsClientListResponse]] } // Do implements the policy.Transporter interface for OperationsServerTransport. @@ -68,19 +71,22 @@ func (o *OperationsServerTransport) dispatchNewListPager(req *http.Request) (*ht if o.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if o.newListPager == nil { + newListPager := o.newListPager.get(req) + if newListPager == nil { resp := o.srv.NewListPager(nil) - o.newListPager = &resp + newListPager = &resp + o.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(o.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + o.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(o.newListPager) { - o.newListPager = nil + if !server.PagerResponderMore(newListPager) { + o.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/proximityplacementgroups_server.go b/sdk/resourcemanager/compute/armcompute/fake/proximityplacementgroups_server.go index b067d0d6790a..8a0fdbb50f6d 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/proximityplacementgroups_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/proximityplacementgroups_server.go @@ -50,18 +50,22 @@ type ProximityPlacementGroupsServer struct { } // NewProximityPlacementGroupsServerTransport creates a new instance of ProximityPlacementGroupsServerTransport with the provided implementation. -// The returned ProximityPlacementGroupsServerTransport instance is connected to an instance of armcompute.ProximityPlacementGroupsClient by way of the -// undefined.Transporter field. +// The returned ProximityPlacementGroupsServerTransport instance is connected to an instance of armcompute.ProximityPlacementGroupsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewProximityPlacementGroupsServerTransport(srv *ProximityPlacementGroupsServer) *ProximityPlacementGroupsServerTransport { - return &ProximityPlacementGroupsServerTransport{srv: srv} + return &ProximityPlacementGroupsServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.ProximityPlacementGroupsClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armcompute.ProximityPlacementGroupsClientListBySubscriptionResponse]](), + } } // ProximityPlacementGroupsServerTransport connects instances of armcompute.ProximityPlacementGroupsClient to instances of ProximityPlacementGroupsServer. // Don't use this type directly, use NewProximityPlacementGroupsServerTransport instead. type ProximityPlacementGroupsServerTransport struct { srv *ProximityPlacementGroupsServer - newListByResourceGroupPager *azfake.PagerResponder[armcompute.ProximityPlacementGroupsClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armcompute.ProximityPlacementGroupsClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.ProximityPlacementGroupsClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armcompute.ProximityPlacementGroupsClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for ProximityPlacementGroupsServerTransport. @@ -218,7 +222,8 @@ func (p *ProximityPlacementGroupsServerTransport) dispatchNewListByResourceGroup if p.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if p.newListByResourceGroupPager == nil { + newListByResourceGroupPager := p.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/proximityPlacementGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -230,20 +235,22 @@ func (p *ProximityPlacementGroupsServerTransport) dispatchNewListByResourceGroup return nil, err } resp := p.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - p.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(p.newListByResourceGroupPager, req, func(page *armcompute.ProximityPlacementGroupsClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + p.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.ProximityPlacementGroupsClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(p.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(p.newListByResourceGroupPager) { - p.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + p.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -252,7 +259,8 @@ func (p *ProximityPlacementGroupsServerTransport) dispatchNewListBySubscriptionP if p.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if p.newListBySubscriptionPager == nil { + newListBySubscriptionPager := p.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/proximityPlacementGroups` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -260,20 +268,22 @@ func (p *ProximityPlacementGroupsServerTransport) dispatchNewListBySubscriptionP return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := p.srv.NewListBySubscriptionPager(nil) - p.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(p.newListBySubscriptionPager, req, func(page *armcompute.ProximityPlacementGroupsClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + p.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armcompute.ProximityPlacementGroupsClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(p.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + p.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(p.newListBySubscriptionPager) { - p.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + p.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/resourceskus_server.go b/sdk/resourcemanager/compute/armcompute/fake/resourceskus_server.go index de5cf390f23f..f5d5815f8745 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/resourceskus_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/resourceskus_server.go @@ -29,17 +29,20 @@ type ResourceSKUsServer struct { } // NewResourceSKUsServerTransport creates a new instance of ResourceSKUsServerTransport with the provided implementation. -// The returned ResourceSKUsServerTransport instance is connected to an instance of armcompute.ResourceSKUsClient by way of the -// undefined.Transporter field. +// The returned ResourceSKUsServerTransport instance is connected to an instance of armcompute.ResourceSKUsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewResourceSKUsServerTransport(srv *ResourceSKUsServer) *ResourceSKUsServerTransport { - return &ResourceSKUsServerTransport{srv: srv} + return &ResourceSKUsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.ResourceSKUsClientListResponse]](), + } } // ResourceSKUsServerTransport connects instances of armcompute.ResourceSKUsClient to instances of ResourceSKUsServer. // Don't use this type directly, use NewResourceSKUsServerTransport instead. type ResourceSKUsServerTransport struct { srv *ResourceSKUsServer - newListPager *azfake.PagerResponder[armcompute.ResourceSKUsClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.ResourceSKUsClientListResponse]] } // Do implements the policy.Transporter interface for ResourceSKUsServerTransport. @@ -71,7 +74,8 @@ func (r *ResourceSKUsServerTransport) dispatchNewListPager(req *http.Request) (* if r.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if r.newListPager == nil { + newListPager := r.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/skus` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -97,20 +101,22 @@ func (r *ResourceSKUsServerTransport) dispatchNewListPager(req *http.Request) (* } } resp := r.srv.NewListPager(options) - r.newListPager = &resp - server.PagerResponderInjectNextLinks(r.newListPager, req, func(page *armcompute.ResourceSKUsClientListResponse, createLink func() string) { + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.ResourceSKUsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(r.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(r.newListPager) { - r.newListPager = nil + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/restorepointcollections_server.go b/sdk/resourcemanager/compute/armcompute/fake/restorepointcollections_server.go index dddd84e2a922..2555729d7aec 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/restorepointcollections_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/restorepointcollections_server.go @@ -50,19 +50,24 @@ type RestorePointCollectionsServer struct { } // NewRestorePointCollectionsServerTransport creates a new instance of RestorePointCollectionsServerTransport with the provided implementation. -// The returned RestorePointCollectionsServerTransport instance is connected to an instance of armcompute.RestorePointCollectionsClient by way of the -// undefined.Transporter field. +// The returned RestorePointCollectionsServerTransport instance is connected to an instance of armcompute.RestorePointCollectionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewRestorePointCollectionsServerTransport(srv *RestorePointCollectionsServer) *RestorePointCollectionsServerTransport { - return &RestorePointCollectionsServerTransport{srv: srv} + return &RestorePointCollectionsServerTransport{ + srv: srv, + beginDelete: newTracker[azfake.PollerResponder[armcompute.RestorePointCollectionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.RestorePointCollectionsClientListResponse]](), + newListAllPager: newTracker[azfake.PagerResponder[armcompute.RestorePointCollectionsClientListAllResponse]](), + } } // RestorePointCollectionsServerTransport connects instances of armcompute.RestorePointCollectionsClient to instances of RestorePointCollectionsServer. // Don't use this type directly, use NewRestorePointCollectionsServerTransport instead. type RestorePointCollectionsServerTransport struct { srv *RestorePointCollectionsServer - beginDelete *azfake.PollerResponder[armcompute.RestorePointCollectionsClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.RestorePointCollectionsClientListResponse] - newListAllPager *azfake.PagerResponder[armcompute.RestorePointCollectionsClientListAllResponse] + beginDelete *tracker[azfake.PollerResponder[armcompute.RestorePointCollectionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.RestorePointCollectionsClientListResponse]] + newListAllPager *tracker[azfake.PagerResponder[armcompute.RestorePointCollectionsClientListAllResponse]] } // Do implements the policy.Transporter interface for RestorePointCollectionsServerTransport. @@ -141,7 +146,8 @@ func (r *RestorePointCollectionsServerTransport) dispatchBeginDelete(req *http.R if r.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if r.beginDelete == nil { + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/restorePointCollections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -160,19 +166,21 @@ func (r *RestorePointCollectionsServerTransport) dispatchBeginDelete(req *http.R if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - r.beginDelete = &respr + beginDelete = &respr + r.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(r.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(r.beginDelete) { - r.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) } return resp, nil @@ -227,7 +235,8 @@ func (r *RestorePointCollectionsServerTransport) dispatchNewListPager(req *http. if r.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if r.newListPager == nil { + newListPager := r.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/restorePointCollections` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -239,20 +248,22 @@ func (r *RestorePointCollectionsServerTransport) dispatchNewListPager(req *http. return nil, err } resp := r.srv.NewListPager(resourceGroupNameUnescaped, nil) - r.newListPager = &resp - server.PagerResponderInjectNextLinks(r.newListPager, req, func(page *armcompute.RestorePointCollectionsClientListResponse, createLink func() string) { + newListPager = &resp + r.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.RestorePointCollectionsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(r.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(r.newListPager) { - r.newListPager = nil + if !server.PagerResponderMore(newListPager) { + r.newListPager.remove(req) } return resp, nil } @@ -261,7 +272,8 @@ func (r *RestorePointCollectionsServerTransport) dispatchNewListAllPager(req *ht if r.srv.NewListAllPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAllPager not implemented")} } - if r.newListAllPager == nil { + newListAllPager := r.newListAllPager.get(req) + if newListAllPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/restorePointCollections` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -269,20 +281,22 @@ func (r *RestorePointCollectionsServerTransport) dispatchNewListAllPager(req *ht return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := r.srv.NewListAllPager(nil) - r.newListAllPager = &resp - server.PagerResponderInjectNextLinks(r.newListAllPager, req, func(page *armcompute.RestorePointCollectionsClientListAllResponse, createLink func() string) { + newListAllPager = &resp + r.newListAllPager.add(req, newListAllPager) + server.PagerResponderInjectNextLinks(newListAllPager, req, func(page *armcompute.RestorePointCollectionsClientListAllResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(r.newListAllPager, req) + resp, err := server.PagerResponderNext(newListAllPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + r.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(r.newListAllPager) { - r.newListAllPager = nil + if !server.PagerResponderMore(newListAllPager) { + r.newListAllPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/restorepoints_server.go b/sdk/resourcemanager/compute/armcompute/fake/restorepoints_server.go index 0bff9e9d74a0..49957d1ee68b 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/restorepoints_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/restorepoints_server.go @@ -37,18 +37,22 @@ type RestorePointsServer struct { } // NewRestorePointsServerTransport creates a new instance of RestorePointsServerTransport with the provided implementation. -// The returned RestorePointsServerTransport instance is connected to an instance of armcompute.RestorePointsClient by way of the -// undefined.Transporter field. +// The returned RestorePointsServerTransport instance is connected to an instance of armcompute.RestorePointsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewRestorePointsServerTransport(srv *RestorePointsServer) *RestorePointsServerTransport { - return &RestorePointsServerTransport{srv: srv} + return &RestorePointsServerTransport{ + srv: srv, + beginCreate: newTracker[azfake.PollerResponder[armcompute.RestorePointsClientCreateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.RestorePointsClientDeleteResponse]](), + } } // RestorePointsServerTransport connects instances of armcompute.RestorePointsClient to instances of RestorePointsServer. // Don't use this type directly, use NewRestorePointsServerTransport instead. type RestorePointsServerTransport struct { srv *RestorePointsServer - beginCreate *azfake.PollerResponder[armcompute.RestorePointsClientCreateResponse] - beginDelete *azfake.PollerResponder[armcompute.RestorePointsClientDeleteResponse] + beginCreate *tracker[azfake.PollerResponder[armcompute.RestorePointsClientCreateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.RestorePointsClientDeleteResponse]] } // Do implements the policy.Transporter interface for RestorePointsServerTransport. @@ -84,7 +88,8 @@ func (r *RestorePointsServerTransport) dispatchBeginCreate(req *http.Request) (* if r.srv.BeginCreate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreate not implemented")} } - if r.beginCreate == nil { + beginCreate := r.beginCreate.get(req) + if beginCreate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/restorePointCollections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restorePoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -111,19 +116,21 @@ func (r *RestorePointsServerTransport) dispatchBeginCreate(req *http.Request) (* if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - r.beginCreate = &respr + beginCreate = &respr + r.beginCreate.add(req, beginCreate) } - resp, err := server.PollerResponderNext(r.beginCreate, req) + resp, err := server.PollerResponderNext(beginCreate, req) if err != nil { return nil, err } if !contains([]int{http.StatusCreated}, resp.StatusCode) { + r.beginCreate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(r.beginCreate) { - r.beginCreate = nil + if !server.PollerResponderMore(beginCreate) { + r.beginCreate.remove(req) } return resp, nil @@ -133,7 +140,8 @@ func (r *RestorePointsServerTransport) dispatchBeginDelete(req *http.Request) (* if r.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if r.beginDelete == nil { + beginDelete := r.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/restorePointCollections/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restorePoints/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -156,19 +164,21 @@ func (r *RestorePointsServerTransport) dispatchBeginDelete(req *http.Request) (* if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - r.beginDelete = &respr + beginDelete = &respr + r.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(r.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + r.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(r.beginDelete) { - r.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + r.beginDelete.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleries_server.go b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleries_server.go index 3189fb7ecce6..39d5b2b2752e 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleries_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleries_server.go @@ -34,17 +34,20 @@ type SharedGalleriesServer struct { } // NewSharedGalleriesServerTransport creates a new instance of SharedGalleriesServerTransport with the provided implementation. -// The returned SharedGalleriesServerTransport instance is connected to an instance of armcompute.SharedGalleriesClient by way of the -// undefined.Transporter field. +// The returned SharedGalleriesServerTransport instance is connected to an instance of armcompute.SharedGalleriesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewSharedGalleriesServerTransport(srv *SharedGalleriesServer) *SharedGalleriesServerTransport { - return &SharedGalleriesServerTransport{srv: srv} + return &SharedGalleriesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.SharedGalleriesClientListResponse]](), + } } // SharedGalleriesServerTransport connects instances of armcompute.SharedGalleriesClient to instances of SharedGalleriesServer. // Don't use this type directly, use NewSharedGalleriesServerTransport instead. type SharedGalleriesServerTransport struct { srv *SharedGalleriesServer - newListPager *azfake.PagerResponder[armcompute.SharedGalleriesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.SharedGalleriesClientListResponse]] } // Do implements the policy.Transporter interface for SharedGalleriesServerTransport. @@ -111,7 +114,8 @@ func (s *SharedGalleriesServerTransport) dispatchNewListPager(req *http.Request) if s.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if s.newListPager == nil { + newListPager := s.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedGalleries` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -135,20 +139,22 @@ func (s *SharedGalleriesServerTransport) dispatchNewListPager(req *http.Request) } } resp := s.srv.NewListPager(locationUnescaped, options) - s.newListPager = &resp - server.PagerResponderInjectNextLinks(s.newListPager, req, func(page *armcompute.SharedGalleriesClientListResponse, createLink func() string) { + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.SharedGalleriesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListPager) { - s.newListPager = nil + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimages_server.go index 449941ca06e1..c33992b1c2ce 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimages_server.go @@ -34,17 +34,20 @@ type SharedGalleryImagesServer struct { } // NewSharedGalleryImagesServerTransport creates a new instance of SharedGalleryImagesServerTransport with the provided implementation. -// The returned SharedGalleryImagesServerTransport instance is connected to an instance of armcompute.SharedGalleryImagesClient by way of the -// undefined.Transporter field. +// The returned SharedGalleryImagesServerTransport instance is connected to an instance of armcompute.SharedGalleryImagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewSharedGalleryImagesServerTransport(srv *SharedGalleryImagesServer) *SharedGalleryImagesServerTransport { - return &SharedGalleryImagesServerTransport{srv: srv} + return &SharedGalleryImagesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.SharedGalleryImagesClientListResponse]](), + } } // SharedGalleryImagesServerTransport connects instances of armcompute.SharedGalleryImagesClient to instances of SharedGalleryImagesServer. // Don't use this type directly, use NewSharedGalleryImagesServerTransport instead. type SharedGalleryImagesServerTransport struct { srv *SharedGalleryImagesServer - newListPager *azfake.PagerResponder[armcompute.SharedGalleryImagesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.SharedGalleryImagesClientListResponse]] } // Do implements the policy.Transporter interface for SharedGalleryImagesServerTransport. @@ -115,7 +118,8 @@ func (s *SharedGalleryImagesServerTransport) dispatchNewListPager(req *http.Requ if s.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if s.newListPager == nil { + newListPager := s.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedGalleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -143,20 +147,22 @@ func (s *SharedGalleryImagesServerTransport) dispatchNewListPager(req *http.Requ } } resp := s.srv.NewListPager(locationUnescaped, galleryUniqueNameUnescaped, options) - s.newListPager = &resp - server.PagerResponderInjectNextLinks(s.newListPager, req, func(page *armcompute.SharedGalleryImagesClientListResponse, createLink func() string) { + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.SharedGalleryImagesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListPager) { - s.newListPager = nil + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimageversions_server.go b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimageversions_server.go index 1ad694e2faa0..bbacf3863a75 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimageversions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/sharedgalleryimageversions_server.go @@ -34,17 +34,20 @@ type SharedGalleryImageVersionsServer struct { } // NewSharedGalleryImageVersionsServerTransport creates a new instance of SharedGalleryImageVersionsServerTransport with the provided implementation. -// The returned SharedGalleryImageVersionsServerTransport instance is connected to an instance of armcompute.SharedGalleryImageVersionsClient by way of the -// undefined.Transporter field. +// The returned SharedGalleryImageVersionsServerTransport instance is connected to an instance of armcompute.SharedGalleryImageVersionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewSharedGalleryImageVersionsServerTransport(srv *SharedGalleryImageVersionsServer) *SharedGalleryImageVersionsServerTransport { - return &SharedGalleryImageVersionsServerTransport{srv: srv} + return &SharedGalleryImageVersionsServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.SharedGalleryImageVersionsClientListResponse]](), + } } // SharedGalleryImageVersionsServerTransport connects instances of armcompute.SharedGalleryImageVersionsClient to instances of SharedGalleryImageVersionsServer. // Don't use this type directly, use NewSharedGalleryImageVersionsServerTransport instead. type SharedGalleryImageVersionsServerTransport struct { srv *SharedGalleryImageVersionsServer - newListPager *azfake.PagerResponder[armcompute.SharedGalleryImageVersionsClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.SharedGalleryImageVersionsClientListResponse]] } // Do implements the policy.Transporter interface for SharedGalleryImageVersionsServerTransport. @@ -119,7 +122,8 @@ func (s *SharedGalleryImageVersionsServerTransport) dispatchNewListPager(req *ht if s.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if s.newListPager == nil { + newListPager := s.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/sharedGalleries/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/images/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/versions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -151,20 +155,22 @@ func (s *SharedGalleryImageVersionsServerTransport) dispatchNewListPager(req *ht } } resp := s.srv.NewListPager(locationUnescaped, galleryUniqueNameUnescaped, galleryImageNameUnescaped, options) - s.newListPager = &resp - server.PagerResponderInjectNextLinks(s.newListPager, req, func(page *armcompute.SharedGalleryImageVersionsClientListResponse, createLink func() string) { + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.SharedGalleryImageVersionsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListPager) { - s.newListPager = nil + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/snapshots_server.go b/sdk/resourcemanager/compute/armcompute/fake/snapshots_server.go index bf457c5a3919..c298edaaf33e 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/snapshots_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/snapshots_server.go @@ -58,23 +58,32 @@ type SnapshotsServer struct { } // NewSnapshotsServerTransport creates a new instance of SnapshotsServerTransport with the provided implementation. -// The returned SnapshotsServerTransport instance is connected to an instance of armcompute.SnapshotsClient by way of the -// undefined.Transporter field. +// The returned SnapshotsServerTransport instance is connected to an instance of armcompute.SnapshotsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewSnapshotsServerTransport(srv *SnapshotsServer) *SnapshotsServerTransport { - return &SnapshotsServerTransport{srv: srv} + return &SnapshotsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.SnapshotsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.SnapshotsClientDeleteResponse]](), + beginGrantAccess: newTracker[azfake.PollerResponder[armcompute.SnapshotsClientGrantAccessResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.SnapshotsClientListResponse]](), + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.SnapshotsClientListByResourceGroupResponse]](), + beginRevokeAccess: newTracker[azfake.PollerResponder[armcompute.SnapshotsClientRevokeAccessResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.SnapshotsClientUpdateResponse]](), + } } // SnapshotsServerTransport connects instances of armcompute.SnapshotsClient to instances of SnapshotsServer. // Don't use this type directly, use NewSnapshotsServerTransport instead. type SnapshotsServerTransport struct { srv *SnapshotsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.SnapshotsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.SnapshotsClientDeleteResponse] - beginGrantAccess *azfake.PollerResponder[armcompute.SnapshotsClientGrantAccessResponse] - newListPager *azfake.PagerResponder[armcompute.SnapshotsClientListResponse] - newListByResourceGroupPager *azfake.PagerResponder[armcompute.SnapshotsClientListByResourceGroupResponse] - beginRevokeAccess *azfake.PollerResponder[armcompute.SnapshotsClientRevokeAccessResponse] - beginUpdate *azfake.PollerResponder[armcompute.SnapshotsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.SnapshotsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.SnapshotsClientDeleteResponse]] + beginGrantAccess *tracker[azfake.PollerResponder[armcompute.SnapshotsClientGrantAccessResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.SnapshotsClientListResponse]] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.SnapshotsClientListByResourceGroupResponse]] + beginRevokeAccess *tracker[azfake.PollerResponder[armcompute.SnapshotsClientRevokeAccessResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.SnapshotsClientUpdateResponse]] } // Do implements the policy.Transporter interface for SnapshotsServerTransport. @@ -120,7 +129,8 @@ func (s *SnapshotsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request if s.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if s.beginCreateOrUpdate == nil { + beginCreateOrUpdate := s.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -143,19 +153,21 @@ func (s *SnapshotsServerTransport) dispatchBeginCreateOrUpdate(req *http.Request if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - s.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + s.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(s.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(s.beginCreateOrUpdate) { - s.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + s.beginCreateOrUpdate.remove(req) } return resp, nil @@ -165,7 +177,8 @@ func (s *SnapshotsServerTransport) dispatchBeginDelete(req *http.Request) (*http if s.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if s.beginDelete == nil { + beginDelete := s.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -184,19 +197,21 @@ func (s *SnapshotsServerTransport) dispatchBeginDelete(req *http.Request) (*http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - s.beginDelete = &respr + beginDelete = &respr + s.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(s.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + s.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(s.beginDelete) { - s.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + s.beginDelete.remove(req) } return resp, nil @@ -239,7 +254,8 @@ func (s *SnapshotsServerTransport) dispatchBeginGrantAccess(req *http.Request) ( if s.srv.BeginGrantAccess == nil { return nil, &nonRetriableError{errors.New("fake for method BeginGrantAccess not implemented")} } - if s.beginGrantAccess == nil { + beginGrantAccess := s.beginGrantAccess.get(req) + if beginGrantAccess == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/beginGetAccess` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -262,19 +278,21 @@ func (s *SnapshotsServerTransport) dispatchBeginGrantAccess(req *http.Request) ( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - s.beginGrantAccess = &respr + beginGrantAccess = &respr + s.beginGrantAccess.add(req, beginGrantAccess) } - resp, err := server.PollerResponderNext(s.beginGrantAccess, req) + resp, err := server.PollerResponderNext(beginGrantAccess, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginGrantAccess.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(s.beginGrantAccess) { - s.beginGrantAccess = nil + if !server.PollerResponderMore(beginGrantAccess) { + s.beginGrantAccess.remove(req) } return resp, nil @@ -284,7 +302,8 @@ func (s *SnapshotsServerTransport) dispatchNewListPager(req *http.Request) (*htt if s.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if s.newListPager == nil { + newListPager := s.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/snapshots` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -292,20 +311,22 @@ func (s *SnapshotsServerTransport) dispatchNewListPager(req *http.Request) (*htt return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := s.srv.NewListPager(nil) - s.newListPager = &resp - server.PagerResponderInjectNextLinks(s.newListPager, req, func(page *armcompute.SnapshotsClientListResponse, createLink func() string) { + newListPager = &resp + s.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.SnapshotsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListPager) { - s.newListPager = nil + if !server.PagerResponderMore(newListPager) { + s.newListPager.remove(req) } return resp, nil } @@ -314,7 +335,8 @@ func (s *SnapshotsServerTransport) dispatchNewListByResourceGroupPager(req *http if s.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if s.newListByResourceGroupPager == nil { + newListByResourceGroupPager := s.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/snapshots` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -326,20 +348,22 @@ func (s *SnapshotsServerTransport) dispatchNewListByResourceGroupPager(req *http return nil, err } resp := s.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - s.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(s.newListByResourceGroupPager, req, func(page *armcompute.SnapshotsClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + s.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.SnapshotsClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListByResourceGroupPager) { - s.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + s.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -348,7 +372,8 @@ func (s *SnapshotsServerTransport) dispatchBeginRevokeAccess(req *http.Request) if s.srv.BeginRevokeAccess == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRevokeAccess not implemented")} } - if s.beginRevokeAccess == nil { + beginRevokeAccess := s.beginRevokeAccess.get(req) + if beginRevokeAccess == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/endGetAccess` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -367,19 +392,21 @@ func (s *SnapshotsServerTransport) dispatchBeginRevokeAccess(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - s.beginRevokeAccess = &respr + beginRevokeAccess = &respr + s.beginRevokeAccess.add(req, beginRevokeAccess) } - resp, err := server.PollerResponderNext(s.beginRevokeAccess, req) + resp, err := server.PollerResponderNext(beginRevokeAccess, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginRevokeAccess.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(s.beginRevokeAccess) { - s.beginRevokeAccess = nil + if !server.PollerResponderMore(beginRevokeAccess) { + s.beginRevokeAccess.remove(req) } return resp, nil @@ -389,7 +416,8 @@ func (s *SnapshotsServerTransport) dispatchBeginUpdate(req *http.Request) (*http if s.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if s.beginUpdate == nil { + beginUpdate := s.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/snapshots/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -412,19 +440,21 @@ func (s *SnapshotsServerTransport) dispatchBeginUpdate(req *http.Request) (*http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - s.beginUpdate = &respr + beginUpdate = &respr + s.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(s.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + s.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(s.beginUpdate) { - s.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + s.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/sshpublickeys_server.go b/sdk/resourcemanager/compute/armcompute/fake/sshpublickeys_server.go index ac70080a158c..4eeb43c4c6bb 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/sshpublickeys_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/sshpublickeys_server.go @@ -54,18 +54,22 @@ type SSHPublicKeysServer struct { } // NewSSHPublicKeysServerTransport creates a new instance of SSHPublicKeysServerTransport with the provided implementation. -// The returned SSHPublicKeysServerTransport instance is connected to an instance of armcompute.SSHPublicKeysClient by way of the -// undefined.Transporter field. +// The returned SSHPublicKeysServerTransport instance is connected to an instance of armcompute.SSHPublicKeysClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewSSHPublicKeysServerTransport(srv *SSHPublicKeysServer) *SSHPublicKeysServerTransport { - return &SSHPublicKeysServerTransport{srv: srv} + return &SSHPublicKeysServerTransport{ + srv: srv, + newListByResourceGroupPager: newTracker[azfake.PagerResponder[armcompute.SSHPublicKeysClientListByResourceGroupResponse]](), + newListBySubscriptionPager: newTracker[azfake.PagerResponder[armcompute.SSHPublicKeysClientListBySubscriptionResponse]](), + } } // SSHPublicKeysServerTransport connects instances of armcompute.SSHPublicKeysClient to instances of SSHPublicKeysServer. // Don't use this type directly, use NewSSHPublicKeysServerTransport instead. type SSHPublicKeysServerTransport struct { srv *SSHPublicKeysServer - newListByResourceGroupPager *azfake.PagerResponder[armcompute.SSHPublicKeysClientListByResourceGroupResponse] - newListBySubscriptionPager *azfake.PagerResponder[armcompute.SSHPublicKeysClientListBySubscriptionResponse] + newListByResourceGroupPager *tracker[azfake.PagerResponder[armcompute.SSHPublicKeysClientListByResourceGroupResponse]] + newListBySubscriptionPager *tracker[azfake.PagerResponder[armcompute.SSHPublicKeysClientListBySubscriptionResponse]] } // Do implements the policy.Transporter interface for SSHPublicKeysServerTransport. @@ -245,7 +249,8 @@ func (s *SSHPublicKeysServerTransport) dispatchNewListByResourceGroupPager(req * if s.srv.NewListByResourceGroupPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByResourceGroupPager not implemented")} } - if s.newListByResourceGroupPager == nil { + newListByResourceGroupPager := s.newListByResourceGroupPager.get(req) + if newListByResourceGroupPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/sshPublicKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -257,20 +262,22 @@ func (s *SSHPublicKeysServerTransport) dispatchNewListByResourceGroupPager(req * return nil, err } resp := s.srv.NewListByResourceGroupPager(resourceGroupNameUnescaped, nil) - s.newListByResourceGroupPager = &resp - server.PagerResponderInjectNextLinks(s.newListByResourceGroupPager, req, func(page *armcompute.SSHPublicKeysClientListByResourceGroupResponse, createLink func() string) { + newListByResourceGroupPager = &resp + s.newListByResourceGroupPager.add(req, newListByResourceGroupPager) + server.PagerResponderInjectNextLinks(newListByResourceGroupPager, req, func(page *armcompute.SSHPublicKeysClientListByResourceGroupResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListByResourceGroupPager, req) + resp, err := server.PagerResponderNext(newListByResourceGroupPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListByResourceGroupPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListByResourceGroupPager) { - s.newListByResourceGroupPager = nil + if !server.PagerResponderMore(newListByResourceGroupPager) { + s.newListByResourceGroupPager.remove(req) } return resp, nil } @@ -279,7 +286,8 @@ func (s *SSHPublicKeysServerTransport) dispatchNewListBySubscriptionPager(req *h if s.srv.NewListBySubscriptionPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListBySubscriptionPager not implemented")} } - if s.newListBySubscriptionPager == nil { + newListBySubscriptionPager := s.newListBySubscriptionPager.get(req) + if newListBySubscriptionPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/sshPublicKeys` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -287,20 +295,22 @@ func (s *SSHPublicKeysServerTransport) dispatchNewListBySubscriptionPager(req *h return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := s.srv.NewListBySubscriptionPager(nil) - s.newListBySubscriptionPager = &resp - server.PagerResponderInjectNextLinks(s.newListBySubscriptionPager, req, func(page *armcompute.SSHPublicKeysClientListBySubscriptionResponse, createLink func() string) { + newListBySubscriptionPager = &resp + s.newListBySubscriptionPager.add(req, newListBySubscriptionPager) + server.PagerResponderInjectNextLinks(newListBySubscriptionPager, req, func(page *armcompute.SSHPublicKeysClientListBySubscriptionResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(s.newListBySubscriptionPager, req) + resp, err := server.PagerResponderNext(newListBySubscriptionPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + s.newListBySubscriptionPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(s.newListBySubscriptionPager) { - s.newListBySubscriptionPager = nil + if !server.PagerResponderMore(newListBySubscriptionPager) { + s.newListBySubscriptionPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/usage_server.go b/sdk/resourcemanager/compute/armcompute/fake/usage_server.go index cef7a65a9ff8..46ea1ef76460 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/usage_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/usage_server.go @@ -29,17 +29,20 @@ type UsageServer struct { } // NewUsageServerTransport creates a new instance of UsageServerTransport with the provided implementation. -// The returned UsageServerTransport instance is connected to an instance of armcompute.UsageClient by way of the -// undefined.Transporter field. +// The returned UsageServerTransport instance is connected to an instance of armcompute.UsageClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewUsageServerTransport(srv *UsageServer) *UsageServerTransport { - return &UsageServerTransport{srv: srv} + return &UsageServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.UsageClientListResponse]](), + } } // UsageServerTransport connects instances of armcompute.UsageClient to instances of UsageServer. // Don't use this type directly, use NewUsageServerTransport instead. type UsageServerTransport struct { srv *UsageServer - newListPager *azfake.PagerResponder[armcompute.UsageClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.UsageClientListResponse]] } // Do implements the policy.Transporter interface for UsageServerTransport. @@ -71,7 +74,8 @@ func (u *UsageServerTransport) dispatchNewListPager(req *http.Request) (*http.Re if u.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if u.newListPager == nil { + newListPager := u.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/usages` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -83,20 +87,22 @@ func (u *UsageServerTransport) dispatchNewListPager(req *http.Request) (*http.Re return nil, err } resp := u.srv.NewListPager(locationUnescaped, nil) - u.newListPager = &resp - server.PagerResponderInjectNextLinks(u.newListPager, req, func(page *armcompute.UsageClientListResponse, createLink func() string) { + newListPager = &resp + u.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.UsageClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(u.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + u.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(u.newListPager) { - u.newListPager = nil + if !server.PagerResponderMore(newListPager) { + u.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensionimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensionimages_server.go index 86068a3ead9f..de86f645a0de 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensionimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensionimages_server.go @@ -38,8 +38,8 @@ type VirtualMachineExtensionImagesServer struct { } // NewVirtualMachineExtensionImagesServerTransport creates a new instance of VirtualMachineExtensionImagesServerTransport with the provided implementation. -// The returned VirtualMachineExtensionImagesServerTransport instance is connected to an instance of armcompute.VirtualMachineExtensionImagesClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineExtensionImagesServerTransport instance is connected to an instance of armcompute.VirtualMachineExtensionImagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineExtensionImagesServerTransport(srv *VirtualMachineExtensionImagesServer) *VirtualMachineExtensionImagesServerTransport { return &VirtualMachineExtensionImagesServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensions_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensions_server.go index 4971818b3b98..c656ec6111e2 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineextensions_server.go @@ -45,19 +45,24 @@ type VirtualMachineExtensionsServer struct { } // NewVirtualMachineExtensionsServerTransport creates a new instance of VirtualMachineExtensionsServerTransport with the provided implementation. -// The returned VirtualMachineExtensionsServerTransport instance is connected to an instance of armcompute.VirtualMachineExtensionsClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineExtensionsServerTransport instance is connected to an instance of armcompute.VirtualMachineExtensionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineExtensionsServerTransport(srv *VirtualMachineExtensionsServer) *VirtualMachineExtensionsServerTransport { - return &VirtualMachineExtensionsServerTransport{srv: srv} + return &VirtualMachineExtensionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientDeleteResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientUpdateResponse]](), + } } // VirtualMachineExtensionsServerTransport connects instances of armcompute.VirtualMachineExtensionsClient to instances of VirtualMachineExtensionsServer. // Don't use this type directly, use NewVirtualMachineExtensionsServerTransport instead. type VirtualMachineExtensionsServerTransport struct { srv *VirtualMachineExtensionsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientDeleteResponse] - beginUpdate *azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientDeleteResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineExtensionsClientUpdateResponse]] } // Do implements the policy.Transporter interface for VirtualMachineExtensionsServerTransport. @@ -97,7 +102,8 @@ func (v *VirtualMachineExtensionsServerTransport) dispatchBeginCreateOrUpdate(re if v.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if v.beginCreateOrUpdate == nil { + beginCreateOrUpdate := v.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -124,19 +130,21 @@ func (v *VirtualMachineExtensionsServerTransport) dispatchBeginCreateOrUpdate(re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + v.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(v.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCreateOrUpdate) { - v.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + v.beginCreateOrUpdate.remove(req) } return resp, nil @@ -146,7 +154,8 @@ func (v *VirtualMachineExtensionsServerTransport) dispatchBeginDelete(req *http. if v.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if v.beginDelete == nil { + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -169,19 +178,21 @@ func (v *VirtualMachineExtensionsServerTransport) dispatchBeginDelete(req *http. if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDelete = &respr + beginDelete = &respr + v.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(v.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDelete) { - v.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) } return resp, nil @@ -285,7 +296,8 @@ func (v *VirtualMachineExtensionsServerTransport) dispatchBeginUpdate(req *http. if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if v.beginUpdate == nil { + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -312,19 +324,21 @@ func (v *VirtualMachineExtensionsServerTransport) dispatchBeginUpdate(req *http. if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdate = &respr + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(v.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdate) { - v.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimages_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimages_server.go index 2aaec473eb8c..1c7588a978c9 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimages_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimages_server.go @@ -50,8 +50,8 @@ type VirtualMachineImagesServer struct { } // NewVirtualMachineImagesServerTransport creates a new instance of VirtualMachineImagesServerTransport with the provided implementation. -// The returned VirtualMachineImagesServerTransport instance is connected to an instance of armcompute.VirtualMachineImagesClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineImagesServerTransport instance is connected to an instance of armcompute.VirtualMachineImagesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineImagesServerTransport(srv *VirtualMachineImagesServer) *VirtualMachineImagesServerTransport { return &VirtualMachineImagesServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimagesedgezone_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimagesedgezone_server.go index a24715fcce9c..717058022f39 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimagesedgezone_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineimagesedgezone_server.go @@ -46,8 +46,8 @@ type VirtualMachineImagesEdgeZoneServer struct { } // NewVirtualMachineImagesEdgeZoneServerTransport creates a new instance of VirtualMachineImagesEdgeZoneServerTransport with the provided implementation. -// The returned VirtualMachineImagesEdgeZoneServerTransport instance is connected to an instance of armcompute.VirtualMachineImagesEdgeZoneClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineImagesEdgeZoneServerTransport instance is connected to an instance of armcompute.VirtualMachineImagesEdgeZoneClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineImagesEdgeZoneServerTransport(srv *VirtualMachineImagesEdgeZoneServer) *VirtualMachineImagesEdgeZoneServerTransport { return &VirtualMachineImagesEdgeZoneServerTransport{srv: srv} } diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineruncommands_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineruncommands_server.go index 32fe4bc31be8..15f9cfc8ebde 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachineruncommands_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachineruncommands_server.go @@ -54,21 +54,28 @@ type VirtualMachineRunCommandsServer struct { } // NewVirtualMachineRunCommandsServerTransport creates a new instance of VirtualMachineRunCommandsServerTransport with the provided implementation. -// The returned VirtualMachineRunCommandsServerTransport instance is connected to an instance of armcompute.VirtualMachineRunCommandsClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineRunCommandsServerTransport instance is connected to an instance of armcompute.VirtualMachineRunCommandsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineRunCommandsServerTransport(srv *VirtualMachineRunCommandsServer) *VirtualMachineRunCommandsServerTransport { - return &VirtualMachineRunCommandsServerTransport{srv: srv} + return &VirtualMachineRunCommandsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineRunCommandsClientListResponse]](), + newListByVirtualMachinePager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineRunCommandsClientListByVirtualMachineResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientUpdateResponse]](), + } } // VirtualMachineRunCommandsServerTransport connects instances of armcompute.VirtualMachineRunCommandsClient to instances of VirtualMachineRunCommandsServer. // Don't use this type directly, use NewVirtualMachineRunCommandsServerTransport instead. type VirtualMachineRunCommandsServerTransport struct { srv *VirtualMachineRunCommandsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.VirtualMachineRunCommandsClientListResponse] - newListByVirtualMachinePager *azfake.PagerResponder[armcompute.VirtualMachineRunCommandsClientListByVirtualMachineResponse] - beginUpdate *azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineRunCommandsClientListResponse]] + newListByVirtualMachinePager *tracker[azfake.PagerResponder[armcompute.VirtualMachineRunCommandsClientListByVirtualMachineResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineRunCommandsClientUpdateResponse]] } // Do implements the policy.Transporter interface for VirtualMachineRunCommandsServerTransport. @@ -112,7 +119,8 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchBeginCreateOrUpdate(r if v.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if v.beginCreateOrUpdate == nil { + beginCreateOrUpdate := v.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -139,19 +147,21 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchBeginCreateOrUpdate(r if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + v.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(v.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCreateOrUpdate) { - v.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + v.beginCreateOrUpdate.remove(req) } return resp, nil @@ -161,7 +171,8 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchBeginDelete(req *http if v.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if v.beginDelete == nil { + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -184,19 +195,21 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchBeginDelete(req *http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDelete = &respr + beginDelete = &respr + v.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(v.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDelete) { - v.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) } return resp, nil @@ -288,7 +301,8 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchNewListPager(req *htt if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if v.newListPager == nil { + newListPager := v.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -300,20 +314,22 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchNewListPager(req *htt return nil, err } resp := v.srv.NewListPager(locationUnescaped, nil) - v.newListPager = &resp - server.PagerResponderInjectNextLinks(v.newListPager, req, func(page *armcompute.VirtualMachineRunCommandsClientListResponse, createLink func() string) { + newListPager = &resp + v.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.VirtualMachineRunCommandsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListPager) { - v.newListPager = nil + if !server.PagerResponderMore(newListPager) { + v.newListPager.remove(req) } return resp, nil } @@ -322,7 +338,8 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchNewListByVirtualMachi if v.srv.NewListByVirtualMachinePager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByVirtualMachinePager not implemented")} } - if v.newListByVirtualMachinePager == nil { + newListByVirtualMachinePager := v.newListByVirtualMachinePager.get(req) + if newListByVirtualMachinePager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -350,20 +367,22 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchNewListByVirtualMachi } } resp := v.srv.NewListByVirtualMachinePager(resourceGroupNameUnescaped, vmNameUnescaped, options) - v.newListByVirtualMachinePager = &resp - server.PagerResponderInjectNextLinks(v.newListByVirtualMachinePager, req, func(page *armcompute.VirtualMachineRunCommandsClientListByVirtualMachineResponse, createLink func() string) { + newListByVirtualMachinePager = &resp + v.newListByVirtualMachinePager.add(req, newListByVirtualMachinePager) + server.PagerResponderInjectNextLinks(newListByVirtualMachinePager, req, func(page *armcompute.VirtualMachineRunCommandsClientListByVirtualMachineResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListByVirtualMachinePager, req) + resp, err := server.PagerResponderNext(newListByVirtualMachinePager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListByVirtualMachinePager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListByVirtualMachinePager) { - v.newListByVirtualMachinePager = nil + if !server.PagerResponderMore(newListByVirtualMachinePager) { + v.newListByVirtualMachinePager.remove(req) } return resp, nil } @@ -372,7 +391,8 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchBeginUpdate(req *http if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if v.beginUpdate == nil { + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -399,19 +419,21 @@ func (v *VirtualMachineRunCommandsServerTransport) dispatchBeginUpdate(req *http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdate = &respr + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(v.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdate) { - v.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachines_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachines_server.go index 81cffcb9d03c..1a4e1195900a 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachines_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachines_server.go @@ -128,36 +128,58 @@ type VirtualMachinesServer struct { } // NewVirtualMachinesServerTransport creates a new instance of VirtualMachinesServerTransport with the provided implementation. -// The returned VirtualMachinesServerTransport instance is connected to an instance of armcompute.VirtualMachinesClient by way of the -// undefined.Transporter field. +// The returned VirtualMachinesServerTransport instance is connected to an instance of armcompute.VirtualMachinesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachinesServerTransport(srv *VirtualMachinesServer) *VirtualMachinesServerTransport { - return &VirtualMachinesServerTransport{srv: srv} + return &VirtualMachinesServerTransport{ + srv: srv, + beginAssessPatches: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientAssessPatchesResponse]](), + beginCapture: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientCaptureResponse]](), + beginConvertToManagedDisks: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientConvertToManagedDisksResponse]](), + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientCreateOrUpdateResponse]](), + beginDeallocate: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientDeallocateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientDeleteResponse]](), + beginInstallPatches: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientInstallPatchesResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachinesClientListResponse]](), + newListAllPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachinesClientListAllResponse]](), + newListAvailableSizesPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachinesClientListAvailableSizesResponse]](), + newListByLocationPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachinesClientListByLocationResponse]](), + beginPerformMaintenance: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientPerformMaintenanceResponse]](), + beginPowerOff: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientPowerOffResponse]](), + beginReapply: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientReapplyResponse]](), + beginRedeploy: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientRedeployResponse]](), + beginReimage: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientReimageResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientRestartResponse]](), + beginRunCommand: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientRunCommandResponse]](), + beginStart: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientStartResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachinesClientUpdateResponse]](), + } } // VirtualMachinesServerTransport connects instances of armcompute.VirtualMachinesClient to instances of VirtualMachinesServer. // Don't use this type directly, use NewVirtualMachinesServerTransport instead. type VirtualMachinesServerTransport struct { srv *VirtualMachinesServer - beginAssessPatches *azfake.PollerResponder[armcompute.VirtualMachinesClientAssessPatchesResponse] - beginCapture *azfake.PollerResponder[armcompute.VirtualMachinesClientCaptureResponse] - beginConvertToManagedDisks *azfake.PollerResponder[armcompute.VirtualMachinesClientConvertToManagedDisksResponse] - beginCreateOrUpdate *azfake.PollerResponder[armcompute.VirtualMachinesClientCreateOrUpdateResponse] - beginDeallocate *azfake.PollerResponder[armcompute.VirtualMachinesClientDeallocateResponse] - beginDelete *azfake.PollerResponder[armcompute.VirtualMachinesClientDeleteResponse] - beginInstallPatches *azfake.PollerResponder[armcompute.VirtualMachinesClientInstallPatchesResponse] - newListPager *azfake.PagerResponder[armcompute.VirtualMachinesClientListResponse] - newListAllPager *azfake.PagerResponder[armcompute.VirtualMachinesClientListAllResponse] - newListAvailableSizesPager *azfake.PagerResponder[armcompute.VirtualMachinesClientListAvailableSizesResponse] - newListByLocationPager *azfake.PagerResponder[armcompute.VirtualMachinesClientListByLocationResponse] - beginPerformMaintenance *azfake.PollerResponder[armcompute.VirtualMachinesClientPerformMaintenanceResponse] - beginPowerOff *azfake.PollerResponder[armcompute.VirtualMachinesClientPowerOffResponse] - beginReapply *azfake.PollerResponder[armcompute.VirtualMachinesClientReapplyResponse] - beginRedeploy *azfake.PollerResponder[armcompute.VirtualMachinesClientRedeployResponse] - beginReimage *azfake.PollerResponder[armcompute.VirtualMachinesClientReimageResponse] - beginRestart *azfake.PollerResponder[armcompute.VirtualMachinesClientRestartResponse] - beginRunCommand *azfake.PollerResponder[armcompute.VirtualMachinesClientRunCommandResponse] - beginStart *azfake.PollerResponder[armcompute.VirtualMachinesClientStartResponse] - beginUpdate *azfake.PollerResponder[armcompute.VirtualMachinesClientUpdateResponse] + beginAssessPatches *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientAssessPatchesResponse]] + beginCapture *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientCaptureResponse]] + beginConvertToManagedDisks *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientConvertToManagedDisksResponse]] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientCreateOrUpdateResponse]] + beginDeallocate *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientDeallocateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientDeleteResponse]] + beginInstallPatches *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientInstallPatchesResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.VirtualMachinesClientListResponse]] + newListAllPager *tracker[azfake.PagerResponder[armcompute.VirtualMachinesClientListAllResponse]] + newListAvailableSizesPager *tracker[azfake.PagerResponder[armcompute.VirtualMachinesClientListAvailableSizesResponse]] + newListByLocationPager *tracker[azfake.PagerResponder[armcompute.VirtualMachinesClientListByLocationResponse]] + beginPerformMaintenance *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientPerformMaintenanceResponse]] + beginPowerOff *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientPowerOffResponse]] + beginReapply *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientReapplyResponse]] + beginRedeploy *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientRedeployResponse]] + beginReimage *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientReimageResponse]] + beginRestart *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientRestartResponse]] + beginRunCommand *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientRunCommandResponse]] + beginStart *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientStartResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachinesClientUpdateResponse]] } // Do implements the policy.Transporter interface for VirtualMachinesServerTransport. @@ -237,7 +259,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginAssessPatches(req *http.Re if v.srv.BeginAssessPatches == nil { return nil, &nonRetriableError{errors.New("fake for method BeginAssessPatches not implemented")} } - if v.beginAssessPatches == nil { + beginAssessPatches := v.beginAssessPatches.get(req) + if beginAssessPatches == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/assessPatches` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -256,19 +279,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginAssessPatches(req *http.Re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginAssessPatches = &respr + beginAssessPatches = &respr + v.beginAssessPatches.add(req, beginAssessPatches) } - resp, err := server.PollerResponderNext(v.beginAssessPatches, req) + resp, err := server.PollerResponderNext(beginAssessPatches, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginAssessPatches.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginAssessPatches) { - v.beginAssessPatches = nil + if !server.PollerResponderMore(beginAssessPatches) { + v.beginAssessPatches.remove(req) } return resp, nil @@ -278,7 +303,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginCapture(req *http.Request) if v.srv.BeginCapture == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCapture not implemented")} } - if v.beginCapture == nil { + beginCapture := v.beginCapture.get(req) + if beginCapture == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/capture` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -301,19 +327,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginCapture(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCapture = &respr + beginCapture = &respr + v.beginCapture.add(req, beginCapture) } - resp, err := server.PollerResponderNext(v.beginCapture, req) + resp, err := server.PollerResponderNext(beginCapture, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginCapture.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCapture) { - v.beginCapture = nil + if !server.PollerResponderMore(beginCapture) { + v.beginCapture.remove(req) } return resp, nil @@ -323,7 +351,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginConvertToManagedDisks(req if v.srv.BeginConvertToManagedDisks == nil { return nil, &nonRetriableError{errors.New("fake for method BeginConvertToManagedDisks not implemented")} } - if v.beginConvertToManagedDisks == nil { + beginConvertToManagedDisks := v.beginConvertToManagedDisks.get(req) + if beginConvertToManagedDisks == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/convertToManagedDisks` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -342,19 +371,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginConvertToManagedDisks(req if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginConvertToManagedDisks = &respr + beginConvertToManagedDisks = &respr + v.beginConvertToManagedDisks.add(req, beginConvertToManagedDisks) } - resp, err := server.PollerResponderNext(v.beginConvertToManagedDisks, req) + resp, err := server.PollerResponderNext(beginConvertToManagedDisks, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginConvertToManagedDisks.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginConvertToManagedDisks) { - v.beginConvertToManagedDisks = nil + if !server.PollerResponderMore(beginConvertToManagedDisks) { + v.beginConvertToManagedDisks.remove(req) } return resp, nil @@ -364,7 +395,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginCreateOrUpdate(req *http.R if v.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if v.beginCreateOrUpdate == nil { + beginCreateOrUpdate := v.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -387,19 +419,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginCreateOrUpdate(req *http.R if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + v.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(v.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCreateOrUpdate) { - v.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + v.beginCreateOrUpdate.remove(req) } return resp, nil @@ -409,7 +443,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginDeallocate(req *http.Reque if v.srv.BeginDeallocate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDeallocate not implemented")} } - if v.beginDeallocate == nil { + beginDeallocate := v.beginDeallocate.get(req) + if beginDeallocate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deallocate` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -443,19 +478,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginDeallocate(req *http.Reque if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDeallocate = &respr + beginDeallocate = &respr + v.beginDeallocate.add(req, beginDeallocate) } - resp, err := server.PollerResponderNext(v.beginDeallocate, req) + resp, err := server.PollerResponderNext(beginDeallocate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginDeallocate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDeallocate) { - v.beginDeallocate = nil + if !server.PollerResponderMore(beginDeallocate) { + v.beginDeallocate.remove(req) } return resp, nil @@ -465,7 +502,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginDelete(req *http.Request) if v.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if v.beginDelete == nil { + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -499,19 +537,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginDelete(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDelete = &respr + beginDelete = &respr + v.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(v.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDelete) { - v.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) } return resp, nil @@ -599,7 +639,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginInstallPatches(req *http.R if v.srv.BeginInstallPatches == nil { return nil, &nonRetriableError{errors.New("fake for method BeginInstallPatches not implemented")} } - if v.beginInstallPatches == nil { + beginInstallPatches := v.beginInstallPatches.get(req) + if beginInstallPatches == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/installPatches` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -622,19 +663,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginInstallPatches(req *http.R if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginInstallPatches = &respr + beginInstallPatches = &respr + v.beginInstallPatches.add(req, beginInstallPatches) } - resp, err := server.PollerResponderNext(v.beginInstallPatches, req) + resp, err := server.PollerResponderNext(beginInstallPatches, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginInstallPatches.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginInstallPatches) { - v.beginInstallPatches = nil + if !server.PollerResponderMore(beginInstallPatches) { + v.beginInstallPatches.remove(req) } return resp, nil @@ -677,7 +720,8 @@ func (v *VirtualMachinesServerTransport) dispatchNewListPager(req *http.Request) if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if v.newListPager == nil { + newListPager := v.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -707,20 +751,22 @@ func (v *VirtualMachinesServerTransport) dispatchNewListPager(req *http.Request) } } resp := v.srv.NewListPager(resourceGroupNameUnescaped, options) - v.newListPager = &resp - server.PagerResponderInjectNextLinks(v.newListPager, req, func(page *armcompute.VirtualMachinesClientListResponse, createLink func() string) { + newListPager = &resp + v.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.VirtualMachinesClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListPager) { - v.newListPager = nil + if !server.PagerResponderMore(newListPager) { + v.newListPager.remove(req) } return resp, nil } @@ -729,7 +775,8 @@ func (v *VirtualMachinesServerTransport) dispatchNewListAllPager(req *http.Reque if v.srv.NewListAllPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAllPager not implemented")} } - if v.newListAllPager == nil { + newListAllPager := v.newListAllPager.get(req) + if newListAllPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -761,20 +808,22 @@ func (v *VirtualMachinesServerTransport) dispatchNewListAllPager(req *http.Reque } } resp := v.srv.NewListAllPager(options) - v.newListAllPager = &resp - server.PagerResponderInjectNextLinks(v.newListAllPager, req, func(page *armcompute.VirtualMachinesClientListAllResponse, createLink func() string) { + newListAllPager = &resp + v.newListAllPager.add(req, newListAllPager) + server.PagerResponderInjectNextLinks(newListAllPager, req, func(page *armcompute.VirtualMachinesClientListAllResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListAllPager, req) + resp, err := server.PagerResponderNext(newListAllPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListAllPager) { - v.newListAllPager = nil + if !server.PagerResponderMore(newListAllPager) { + v.newListAllPager.remove(req) } return resp, nil } @@ -783,7 +832,8 @@ func (v *VirtualMachinesServerTransport) dispatchNewListAvailableSizesPager(req if v.srv.NewListAvailableSizesPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAvailableSizesPager not implemented")} } - if v.newListAvailableSizesPager == nil { + newListAvailableSizesPager := v.newListAvailableSizesPager.get(req) + if newListAvailableSizesPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/vmSizes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -799,17 +849,19 @@ func (v *VirtualMachinesServerTransport) dispatchNewListAvailableSizesPager(req return nil, err } resp := v.srv.NewListAvailableSizesPager(resourceGroupNameUnescaped, vmNameUnescaped, nil) - v.newListAvailableSizesPager = &resp + newListAvailableSizesPager = &resp + v.newListAvailableSizesPager.add(req, newListAvailableSizesPager) } - resp, err := server.PagerResponderNext(v.newListAvailableSizesPager, req) + resp, err := server.PagerResponderNext(newListAvailableSizesPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListAvailableSizesPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListAvailableSizesPager) { - v.newListAvailableSizesPager = nil + if !server.PagerResponderMore(newListAvailableSizesPager) { + v.newListAvailableSizesPager.remove(req) } return resp, nil } @@ -818,7 +870,8 @@ func (v *VirtualMachinesServerTransport) dispatchNewListByLocationPager(req *htt if v.srv.NewListByLocationPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByLocationPager not implemented")} } - if v.newListByLocationPager == nil { + newListByLocationPager := v.newListByLocationPager.get(req) + if newListByLocationPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -830,20 +883,22 @@ func (v *VirtualMachinesServerTransport) dispatchNewListByLocationPager(req *htt return nil, err } resp := v.srv.NewListByLocationPager(locationUnescaped, nil) - v.newListByLocationPager = &resp - server.PagerResponderInjectNextLinks(v.newListByLocationPager, req, func(page *armcompute.VirtualMachinesClientListByLocationResponse, createLink func() string) { + newListByLocationPager = &resp + v.newListByLocationPager.add(req, newListByLocationPager) + server.PagerResponderInjectNextLinks(newListByLocationPager, req, func(page *armcompute.VirtualMachinesClientListByLocationResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListByLocationPager, req) + resp, err := server.PagerResponderNext(newListByLocationPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListByLocationPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListByLocationPager) { - v.newListByLocationPager = nil + if !server.PagerResponderMore(newListByLocationPager) { + v.newListByLocationPager.remove(req) } return resp, nil } @@ -852,7 +907,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginPerformMaintenance(req *ht if v.srv.BeginPerformMaintenance == nil { return nil, &nonRetriableError{errors.New("fake for method BeginPerformMaintenance not implemented")} } - if v.beginPerformMaintenance == nil { + beginPerformMaintenance := v.beginPerformMaintenance.get(req) + if beginPerformMaintenance == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/performMaintenance` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -871,19 +927,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginPerformMaintenance(req *ht if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginPerformMaintenance = &respr + beginPerformMaintenance = &respr + v.beginPerformMaintenance.add(req, beginPerformMaintenance) } - resp, err := server.PollerResponderNext(v.beginPerformMaintenance, req) + resp, err := server.PollerResponderNext(beginPerformMaintenance, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginPerformMaintenance.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginPerformMaintenance) { - v.beginPerformMaintenance = nil + if !server.PollerResponderMore(beginPerformMaintenance) { + v.beginPerformMaintenance.remove(req) } return resp, nil @@ -893,7 +951,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginPowerOff(req *http.Request if v.srv.BeginPowerOff == nil { return nil, &nonRetriableError{errors.New("fake for method BeginPowerOff not implemented")} } - if v.beginPowerOff == nil { + beginPowerOff := v.beginPowerOff.get(req) + if beginPowerOff == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/powerOff` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -927,19 +986,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginPowerOff(req *http.Request if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginPowerOff = &respr + beginPowerOff = &respr + v.beginPowerOff.add(req, beginPowerOff) } - resp, err := server.PollerResponderNext(v.beginPowerOff, req) + resp, err := server.PollerResponderNext(beginPowerOff, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginPowerOff.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginPowerOff) { - v.beginPowerOff = nil + if !server.PollerResponderMore(beginPowerOff) { + v.beginPowerOff.remove(req) } return resp, nil @@ -949,7 +1010,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginReapply(req *http.Request) if v.srv.BeginReapply == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReapply not implemented")} } - if v.beginReapply == nil { + beginReapply := v.beginReapply.get(req) + if beginReapply == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reapply` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -968,19 +1030,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginReapply(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginReapply = &respr + beginReapply = &respr + v.beginReapply.add(req, beginReapply) } - resp, err := server.PollerResponderNext(v.beginReapply, req) + resp, err := server.PollerResponderNext(beginReapply, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginReapply.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginReapply) { - v.beginReapply = nil + if !server.PollerResponderMore(beginReapply) { + v.beginReapply.remove(req) } return resp, nil @@ -990,7 +1054,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginRedeploy(req *http.Request if v.srv.BeginRedeploy == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRedeploy not implemented")} } - if v.beginRedeploy == nil { + beginRedeploy := v.beginRedeploy.get(req) + if beginRedeploy == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/redeploy` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1009,19 +1074,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginRedeploy(req *http.Request if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginRedeploy = &respr + beginRedeploy = &respr + v.beginRedeploy.add(req, beginRedeploy) } - resp, err := server.PollerResponderNext(v.beginRedeploy, req) + resp, err := server.PollerResponderNext(beginRedeploy, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginRedeploy.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginRedeploy) { - v.beginRedeploy = nil + if !server.PollerResponderMore(beginRedeploy) { + v.beginRedeploy.remove(req) } return resp, nil @@ -1031,7 +1098,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginReimage(req *http.Request) if v.srv.BeginReimage == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReimage not implemented")} } - if v.beginReimage == nil { + beginReimage := v.beginReimage.get(req) + if beginReimage == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimage` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1060,19 +1128,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginReimage(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginReimage = &respr + beginReimage = &respr + v.beginReimage.add(req, beginReimage) } - resp, err := server.PollerResponderNext(v.beginReimage, req) + resp, err := server.PollerResponderNext(beginReimage, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginReimage.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginReimage) { - v.beginReimage = nil + if !server.PollerResponderMore(beginReimage) { + v.beginReimage.remove(req) } return resp, nil @@ -1082,7 +1152,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginRestart(req *http.Request) if v.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} } - if v.beginRestart == nil { + beginRestart := v.beginRestart.get(req) + if beginRestart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1101,19 +1172,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginRestart(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginRestart = &respr + beginRestart = &respr + v.beginRestart.add(req, beginRestart) } - resp, err := server.PollerResponderNext(v.beginRestart, req) + resp, err := server.PollerResponderNext(beginRestart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginRestart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginRestart) { - v.beginRestart = nil + if !server.PollerResponderMore(beginRestart) { + v.beginRestart.remove(req) } return resp, nil @@ -1177,7 +1250,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginRunCommand(req *http.Reque if v.srv.BeginRunCommand == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRunCommand not implemented")} } - if v.beginRunCommand == nil { + beginRunCommand := v.beginRunCommand.get(req) + if beginRunCommand == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommand` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1200,19 +1274,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginRunCommand(req *http.Reque if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginRunCommand = &respr + beginRunCommand = &respr + v.beginRunCommand.add(req, beginRunCommand) } - resp, err := server.PollerResponderNext(v.beginRunCommand, req) + resp, err := server.PollerResponderNext(beginRunCommand, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginRunCommand.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginRunCommand) { - v.beginRunCommand = nil + if !server.PollerResponderMore(beginRunCommand) { + v.beginRunCommand.remove(req) } return resp, nil @@ -1255,7 +1331,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginStart(req *http.Request) ( if v.srv.BeginStart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} } - if v.beginStart == nil { + beginStart := v.beginStart.get(req) + if beginStart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1274,19 +1351,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginStart(req *http.Request) ( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginStart = &respr + beginStart = &respr + v.beginStart.add(req, beginStart) } - resp, err := server.PollerResponderNext(v.beginStart, req) + resp, err := server.PollerResponderNext(beginStart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginStart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginStart) { - v.beginStart = nil + if !server.PollerResponderMore(beginStart) { + v.beginStart.remove(req) } return resp, nil @@ -1296,7 +1375,8 @@ func (v *VirtualMachinesServerTransport) dispatchBeginUpdate(req *http.Request) if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if v.beginUpdate == nil { + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1319,19 +1399,21 @@ func (v *VirtualMachinesServerTransport) dispatchBeginUpdate(req *http.Request) if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdate = &respr + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(v.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdate) { - v.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetextensions_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetextensions_server.go index f6517aa38d2e..a1b4bc7d0e1f 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetextensions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetextensions_server.go @@ -46,20 +46,26 @@ type VirtualMachineScaleSetExtensionsServer struct { } // NewVirtualMachineScaleSetExtensionsServerTransport creates a new instance of VirtualMachineScaleSetExtensionsServerTransport with the provided implementation. -// The returned VirtualMachineScaleSetExtensionsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetExtensionsClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineScaleSetExtensionsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetExtensionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineScaleSetExtensionsServerTransport(srv *VirtualMachineScaleSetExtensionsServer) *VirtualMachineScaleSetExtensionsServerTransport { - return &VirtualMachineScaleSetExtensionsServerTransport{srv: srv} + return &VirtualMachineScaleSetExtensionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetExtensionsClientListResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientUpdateResponse]](), + } } // VirtualMachineScaleSetExtensionsServerTransport connects instances of armcompute.VirtualMachineScaleSetExtensionsClient to instances of VirtualMachineScaleSetExtensionsServer. // Don't use this type directly, use NewVirtualMachineScaleSetExtensionsServerTransport instead. type VirtualMachineScaleSetExtensionsServerTransport struct { srv *VirtualMachineScaleSetExtensionsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.VirtualMachineScaleSetExtensionsClientListResponse] - beginUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetExtensionsClientListResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetExtensionsClientUpdateResponse]] } // Do implements the policy.Transporter interface for VirtualMachineScaleSetExtensionsServerTransport. @@ -99,7 +105,8 @@ func (v *VirtualMachineScaleSetExtensionsServerTransport) dispatchBeginCreateOrU if v.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if v.beginCreateOrUpdate == nil { + beginCreateOrUpdate := v.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -126,19 +133,21 @@ func (v *VirtualMachineScaleSetExtensionsServerTransport) dispatchBeginCreateOrU if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + v.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(v.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCreateOrUpdate) { - v.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + v.beginCreateOrUpdate.remove(req) } return resp, nil @@ -148,7 +157,8 @@ func (v *VirtualMachineScaleSetExtensionsServerTransport) dispatchBeginDelete(re if v.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if v.beginDelete == nil { + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -171,19 +181,21 @@ func (v *VirtualMachineScaleSetExtensionsServerTransport) dispatchBeginDelete(re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDelete = &respr + beginDelete = &respr + v.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(v.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDelete) { - v.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) } return resp, nil @@ -242,7 +254,8 @@ func (v *VirtualMachineScaleSetExtensionsServerTransport) dispatchNewListPager(r if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if v.newListPager == nil { + newListPager := v.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -258,20 +271,22 @@ func (v *VirtualMachineScaleSetExtensionsServerTransport) dispatchNewListPager(r return nil, err } resp := v.srv.NewListPager(resourceGroupNameUnescaped, vmScaleSetNameUnescaped, nil) - v.newListPager = &resp - server.PagerResponderInjectNextLinks(v.newListPager, req, func(page *armcompute.VirtualMachineScaleSetExtensionsClientListResponse, createLink func() string) { + newListPager = &resp + v.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.VirtualMachineScaleSetExtensionsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListPager) { - v.newListPager = nil + if !server.PagerResponderMore(newListPager) { + v.newListPager.remove(req) } return resp, nil } @@ -280,7 +295,8 @@ func (v *VirtualMachineScaleSetExtensionsServerTransport) dispatchBeginUpdate(re if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if v.beginUpdate == nil { + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -307,19 +323,21 @@ func (v *VirtualMachineScaleSetExtensionsServerTransport) dispatchBeginUpdate(re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdate = &respr + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(v.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + v.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdate) { - v.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetrollingupgrades_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetrollingupgrades_server.go index 5f7a6f845bad..664c480a64fd 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetrollingupgrades_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetrollingupgrades_server.go @@ -41,19 +41,24 @@ type VirtualMachineScaleSetRollingUpgradesServer struct { } // NewVirtualMachineScaleSetRollingUpgradesServerTransport creates a new instance of VirtualMachineScaleSetRollingUpgradesServerTransport with the provided implementation. -// The returned VirtualMachineScaleSetRollingUpgradesServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetRollingUpgradesClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineScaleSetRollingUpgradesServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetRollingUpgradesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineScaleSetRollingUpgradesServerTransport(srv *VirtualMachineScaleSetRollingUpgradesServer) *VirtualMachineScaleSetRollingUpgradesServerTransport { - return &VirtualMachineScaleSetRollingUpgradesServerTransport{srv: srv} + return &VirtualMachineScaleSetRollingUpgradesServerTransport{ + srv: srv, + beginCancel: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientCancelResponse]](), + beginStartExtensionUpgrade: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse]](), + beginStartOSUpgrade: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse]](), + } } // VirtualMachineScaleSetRollingUpgradesServerTransport connects instances of armcompute.VirtualMachineScaleSetRollingUpgradesClient to instances of VirtualMachineScaleSetRollingUpgradesServer. // Don't use this type directly, use NewVirtualMachineScaleSetRollingUpgradesServerTransport instead. type VirtualMachineScaleSetRollingUpgradesServerTransport struct { srv *VirtualMachineScaleSetRollingUpgradesServer - beginCancel *azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientCancelResponse] - beginStartExtensionUpgrade *azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse] - beginStartOSUpgrade *azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse] + beginCancel *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientCancelResponse]] + beginStartExtensionUpgrade *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientStartExtensionUpgradeResponse]] + beginStartOSUpgrade *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse]] } // Do implements the policy.Transporter interface for VirtualMachineScaleSetRollingUpgradesServerTransport. @@ -91,7 +96,8 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginCanc if v.srv.BeginCancel == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCancel not implemented")} } - if v.beginCancel == nil { + beginCancel := v.beginCancel.get(req) + if beginCancel == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/rollingUpgrades/cancel` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -110,19 +116,21 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginCanc if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCancel = &respr + beginCancel = &respr + v.beginCancel.add(req, beginCancel) } - resp, err := server.PollerResponderNext(v.beginCancel, req) + resp, err := server.PollerResponderNext(beginCancel, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginCancel.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCancel) { - v.beginCancel = nil + if !server.PollerResponderMore(beginCancel) { + v.beginCancel.remove(req) } return resp, nil @@ -165,7 +173,8 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginStar if v.srv.BeginStartExtensionUpgrade == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStartExtensionUpgrade not implemented")} } - if v.beginStartExtensionUpgrade == nil { + beginStartExtensionUpgrade := v.beginStartExtensionUpgrade.get(req) + if beginStartExtensionUpgrade == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensionRollingUpgrade` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -184,19 +193,21 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginStar if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginStartExtensionUpgrade = &respr + beginStartExtensionUpgrade = &respr + v.beginStartExtensionUpgrade.add(req, beginStartExtensionUpgrade) } - resp, err := server.PollerResponderNext(v.beginStartExtensionUpgrade, req) + resp, err := server.PollerResponderNext(beginStartExtensionUpgrade, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginStartExtensionUpgrade.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginStartExtensionUpgrade) { - v.beginStartExtensionUpgrade = nil + if !server.PollerResponderMore(beginStartExtensionUpgrade) { + v.beginStartExtensionUpgrade.remove(req) } return resp, nil @@ -206,7 +217,8 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginStar if v.srv.BeginStartOSUpgrade == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStartOSUpgrade not implemented")} } - if v.beginStartOSUpgrade == nil { + beginStartOSUpgrade := v.beginStartOSUpgrade.get(req) + if beginStartOSUpgrade == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/osRollingUpgrade` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -225,19 +237,21 @@ func (v *VirtualMachineScaleSetRollingUpgradesServerTransport) dispatchBeginStar if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginStartOSUpgrade = &respr + beginStartOSUpgrade = &respr + v.beginStartOSUpgrade.add(req, beginStartOSUpgrade) } - resp, err := server.PollerResponderNext(v.beginStartOSUpgrade, req) + resp, err := server.PollerResponderNext(beginStartOSUpgrade, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginStartOSUpgrade.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginStartOSUpgrade) { - v.beginStartOSUpgrade = nil + if !server.PollerResponderMore(beginStartOSUpgrade) { + v.beginStartOSUpgrade.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesets_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesets_server.go index 6e12c1870c2f..bdd7a3e3f66a 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesets_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesets_server.go @@ -124,36 +124,58 @@ type VirtualMachineScaleSetsServer struct { } // NewVirtualMachineScaleSetsServerTransport creates a new instance of VirtualMachineScaleSetsServerTransport with the provided implementation. -// The returned VirtualMachineScaleSetsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetsClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineScaleSetsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineScaleSetsServerTransport(srv *VirtualMachineScaleSetsServer) *VirtualMachineScaleSetsServerTransport { - return &VirtualMachineScaleSetsServerTransport{srv: srv} + return &VirtualMachineScaleSetsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientCreateOrUpdateResponse]](), + beginDeallocate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeallocateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeleteResponse]](), + beginDeleteInstances: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse]](), + newGetOSUpgradeHistoryPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListResponse]](), + newListAllPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListAllResponse]](), + newListByLocationPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListByLocationResponse]](), + newListSKUsPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListSKUsResponse]](), + beginPerformMaintenance: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientPerformMaintenanceResponse]](), + beginPowerOff: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientPowerOffResponse]](), + beginReapply: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReapplyResponse]](), + beginRedeploy: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientRedeployResponse]](), + beginReimage: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReimageResponse]](), + beginReimageAll: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReimageAllResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientRestartResponse]](), + beginSetOrchestrationServiceState: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse]](), + beginStart: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientStartResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientUpdateResponse]](), + beginUpdateInstances: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientUpdateInstancesResponse]](), + } } // VirtualMachineScaleSetsServerTransport connects instances of armcompute.VirtualMachineScaleSetsClient to instances of VirtualMachineScaleSetsServer. // Don't use this type directly, use NewVirtualMachineScaleSetsServerTransport instead. type VirtualMachineScaleSetsServerTransport struct { srv *VirtualMachineScaleSetsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientCreateOrUpdateResponse] - beginDeallocate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeallocateResponse] - beginDelete *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeleteResponse] - beginDeleteInstances *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse] - newGetOSUpgradeHistoryPager *azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse] - newListPager *azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListResponse] - newListAllPager *azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListAllResponse] - newListByLocationPager *azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListByLocationResponse] - newListSKUsPager *azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListSKUsResponse] - beginPerformMaintenance *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientPerformMaintenanceResponse] - beginPowerOff *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientPowerOffResponse] - beginReapply *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReapplyResponse] - beginRedeploy *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientRedeployResponse] - beginReimage *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReimageResponse] - beginReimageAll *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReimageAllResponse] - beginRestart *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientRestartResponse] - beginSetOrchestrationServiceState *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse] - beginStart *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientStartResponse] - beginUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientUpdateResponse] - beginUpdateInstances *azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientUpdateInstancesResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientCreateOrUpdateResponse]] + beginDeallocate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeallocateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeleteResponse]] + beginDeleteInstances *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientDeleteInstancesResponse]] + newGetOSUpgradeHistoryPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListResponse]] + newListAllPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListAllResponse]] + newListByLocationPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListByLocationResponse]] + newListSKUsPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetsClientListSKUsResponse]] + beginPerformMaintenance *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientPerformMaintenanceResponse]] + beginPowerOff *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientPowerOffResponse]] + beginReapply *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReapplyResponse]] + beginRedeploy *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientRedeployResponse]] + beginReimage *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReimageResponse]] + beginReimageAll *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientReimageAllResponse]] + beginRestart *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientRestartResponse]] + beginSetOrchestrationServiceState *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientSetOrchestrationServiceStateResponse]] + beginStart *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientStartResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientUpdateResponse]] + beginUpdateInstances *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetsClientUpdateInstancesResponse]] } // Do implements the policy.Transporter interface for VirtualMachineScaleSetsServerTransport. @@ -268,7 +290,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginCreateOrUpdate(req if v.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if v.beginCreateOrUpdate == nil { + beginCreateOrUpdate := v.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -291,19 +314,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginCreateOrUpdate(req if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + v.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(v.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCreateOrUpdate) { - v.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + v.beginCreateOrUpdate.remove(req) } return resp, nil @@ -313,7 +338,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginDeallocate(req *ht if v.srv.BeginDeallocate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDeallocate not implemented")} } - if v.beginDeallocate == nil { + beginDeallocate := v.beginDeallocate.get(req) + if beginDeallocate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deallocate` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -352,19 +378,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginDeallocate(req *ht if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDeallocate = &respr + beginDeallocate = &respr + v.beginDeallocate.add(req, beginDeallocate) } - resp, err := server.PollerResponderNext(v.beginDeallocate, req) + resp, err := server.PollerResponderNext(beginDeallocate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginDeallocate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDeallocate) { - v.beginDeallocate = nil + if !server.PollerResponderMore(beginDeallocate) { + v.beginDeallocate.remove(req) } return resp, nil @@ -374,7 +402,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginDelete(req *http.R if v.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if v.beginDelete == nil { + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -408,19 +437,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginDelete(req *http.R if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDelete = &respr + beginDelete = &respr + v.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(v.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDelete) { - v.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) } return resp, nil @@ -430,7 +461,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginDeleteInstances(re if v.srv.BeginDeleteInstances == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDeleteInstances not implemented")} } - if v.beginDeleteInstances == nil { + beginDeleteInstances := v.beginDeleteInstances.get(req) + if beginDeleteInstances == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/delete` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -468,19 +500,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginDeleteInstances(re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDeleteInstances = &respr + beginDeleteInstances = &respr + v.beginDeleteInstances.add(req, beginDeleteInstances) } - resp, err := server.PollerResponderNext(v.beginDeleteInstances, req) + resp, err := server.PollerResponderNext(beginDeleteInstances, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginDeleteInstances.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDeleteInstances) { - v.beginDeleteInstances = nil + if !server.PollerResponderMore(beginDeleteInstances) { + v.beginDeleteInstances.remove(req) } return resp, nil @@ -633,7 +667,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewGetOSUpgradeHistoryP if v.srv.NewGetOSUpgradeHistoryPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewGetOSUpgradeHistoryPager not implemented")} } - if v.newGetOSUpgradeHistoryPager == nil { + newGetOSUpgradeHistoryPager := v.newGetOSUpgradeHistoryPager.get(req) + if newGetOSUpgradeHistoryPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/osUpgradeHistory` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -649,20 +684,22 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewGetOSUpgradeHistoryP return nil, err } resp := v.srv.NewGetOSUpgradeHistoryPager(resourceGroupNameUnescaped, vmScaleSetNameUnescaped, nil) - v.newGetOSUpgradeHistoryPager = &resp - server.PagerResponderInjectNextLinks(v.newGetOSUpgradeHistoryPager, req, func(page *armcompute.VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, createLink func() string) { + newGetOSUpgradeHistoryPager = &resp + v.newGetOSUpgradeHistoryPager.add(req, newGetOSUpgradeHistoryPager) + server.PagerResponderInjectNextLinks(newGetOSUpgradeHistoryPager, req, func(page *armcompute.VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newGetOSUpgradeHistoryPager, req) + resp, err := server.PagerResponderNext(newGetOSUpgradeHistoryPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newGetOSUpgradeHistoryPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newGetOSUpgradeHistoryPager) { - v.newGetOSUpgradeHistoryPager = nil + if !server.PagerResponderMore(newGetOSUpgradeHistoryPager) { + v.newGetOSUpgradeHistoryPager.remove(req) } return resp, nil } @@ -671,7 +708,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewListPager(req *http. if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if v.newListPager == nil { + newListPager := v.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -683,20 +721,22 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewListPager(req *http. return nil, err } resp := v.srv.NewListPager(resourceGroupNameUnescaped, nil) - v.newListPager = &resp - server.PagerResponderInjectNextLinks(v.newListPager, req, func(page *armcompute.VirtualMachineScaleSetsClientListResponse, createLink func() string) { + newListPager = &resp + v.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.VirtualMachineScaleSetsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListPager) { - v.newListPager = nil + if !server.PagerResponderMore(newListPager) { + v.newListPager.remove(req) } return resp, nil } @@ -705,7 +745,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewListAllPager(req *ht if v.srv.NewListAllPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListAllPager not implemented")} } - if v.newListAllPager == nil { + newListAllPager := v.newListAllPager.get(req) + if newListAllPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -713,20 +754,22 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewListAllPager(req *ht return nil, fmt.Errorf("failed to parse path %s", req.URL.Path) } resp := v.srv.NewListAllPager(nil) - v.newListAllPager = &resp - server.PagerResponderInjectNextLinks(v.newListAllPager, req, func(page *armcompute.VirtualMachineScaleSetsClientListAllResponse, createLink func() string) { + newListAllPager = &resp + v.newListAllPager.add(req, newListAllPager) + server.PagerResponderInjectNextLinks(newListAllPager, req, func(page *armcompute.VirtualMachineScaleSetsClientListAllResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListAllPager, req) + resp, err := server.PagerResponderNext(newListAllPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListAllPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListAllPager) { - v.newListAllPager = nil + if !server.PagerResponderMore(newListAllPager) { + v.newListAllPager.remove(req) } return resp, nil } @@ -735,7 +778,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewListByLocationPager( if v.srv.NewListByLocationPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListByLocationPager not implemented")} } - if v.newListByLocationPager == nil { + newListByLocationPager := v.newListByLocationPager.get(req) + if newListByLocationPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachineScaleSets` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -747,20 +791,22 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewListByLocationPager( return nil, err } resp := v.srv.NewListByLocationPager(locationUnescaped, nil) - v.newListByLocationPager = &resp - server.PagerResponderInjectNextLinks(v.newListByLocationPager, req, func(page *armcompute.VirtualMachineScaleSetsClientListByLocationResponse, createLink func() string) { + newListByLocationPager = &resp + v.newListByLocationPager.add(req, newListByLocationPager) + server.PagerResponderInjectNextLinks(newListByLocationPager, req, func(page *armcompute.VirtualMachineScaleSetsClientListByLocationResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListByLocationPager, req) + resp, err := server.PagerResponderNext(newListByLocationPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListByLocationPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListByLocationPager) { - v.newListByLocationPager = nil + if !server.PagerResponderMore(newListByLocationPager) { + v.newListByLocationPager.remove(req) } return resp, nil } @@ -769,7 +815,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewListSKUsPager(req *h if v.srv.NewListSKUsPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListSKUsPager not implemented")} } - if v.newListSKUsPager == nil { + newListSKUsPager := v.newListSKUsPager.get(req) + if newListSKUsPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/skus` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -785,20 +832,22 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchNewListSKUsPager(req *h return nil, err } resp := v.srv.NewListSKUsPager(resourceGroupNameUnescaped, vmScaleSetNameUnescaped, nil) - v.newListSKUsPager = &resp - server.PagerResponderInjectNextLinks(v.newListSKUsPager, req, func(page *armcompute.VirtualMachineScaleSetsClientListSKUsResponse, createLink func() string) { + newListSKUsPager = &resp + v.newListSKUsPager.add(req, newListSKUsPager) + server.PagerResponderInjectNextLinks(newListSKUsPager, req, func(page *armcompute.VirtualMachineScaleSetsClientListSKUsResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListSKUsPager, req) + resp, err := server.PagerResponderNext(newListSKUsPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListSKUsPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListSKUsPager) { - v.newListSKUsPager = nil + if !server.PagerResponderMore(newListSKUsPager) { + v.newListSKUsPager.remove(req) } return resp, nil } @@ -807,7 +856,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginPerformMaintenance if v.srv.BeginPerformMaintenance == nil { return nil, &nonRetriableError{errors.New("fake for method BeginPerformMaintenance not implemented")} } - if v.beginPerformMaintenance == nil { + beginPerformMaintenance := v.beginPerformMaintenance.get(req) + if beginPerformMaintenance == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/performMaintenance` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -836,19 +886,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginPerformMaintenance if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginPerformMaintenance = &respr + beginPerformMaintenance = &respr + v.beginPerformMaintenance.add(req, beginPerformMaintenance) } - resp, err := server.PollerResponderNext(v.beginPerformMaintenance, req) + resp, err := server.PollerResponderNext(beginPerformMaintenance, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginPerformMaintenance.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginPerformMaintenance) { - v.beginPerformMaintenance = nil + if !server.PollerResponderMore(beginPerformMaintenance) { + v.beginPerformMaintenance.remove(req) } return resp, nil @@ -858,7 +910,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginPowerOff(req *http if v.srv.BeginPowerOff == nil { return nil, &nonRetriableError{errors.New("fake for method BeginPowerOff not implemented")} } - if v.beginPowerOff == nil { + beginPowerOff := v.beginPowerOff.get(req) + if beginPowerOff == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/poweroff` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -897,19 +950,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginPowerOff(req *http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginPowerOff = &respr + beginPowerOff = &respr + v.beginPowerOff.add(req, beginPowerOff) } - resp, err := server.PollerResponderNext(v.beginPowerOff, req) + resp, err := server.PollerResponderNext(beginPowerOff, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginPowerOff.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginPowerOff) { - v.beginPowerOff = nil + if !server.PollerResponderMore(beginPowerOff) { + v.beginPowerOff.remove(req) } return resp, nil @@ -919,7 +974,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginReapply(req *http. if v.srv.BeginReapply == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReapply not implemented")} } - if v.beginReapply == nil { + beginReapply := v.beginReapply.get(req) + if beginReapply == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reapply` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -938,19 +994,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginReapply(req *http. if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginReapply = &respr + beginReapply = &respr + v.beginReapply.add(req, beginReapply) } - resp, err := server.PollerResponderNext(v.beginReapply, req) + resp, err := server.PollerResponderNext(beginReapply, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginReapply.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginReapply) { - v.beginReapply = nil + if !server.PollerResponderMore(beginReapply) { + v.beginReapply.remove(req) } return resp, nil @@ -960,7 +1018,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginRedeploy(req *http if v.srv.BeginRedeploy == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRedeploy not implemented")} } - if v.beginRedeploy == nil { + beginRedeploy := v.beginRedeploy.get(req) + if beginRedeploy == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/redeploy` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -989,19 +1048,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginRedeploy(req *http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginRedeploy = &respr + beginRedeploy = &respr + v.beginRedeploy.add(req, beginRedeploy) } - resp, err := server.PollerResponderNext(v.beginRedeploy, req) + resp, err := server.PollerResponderNext(beginRedeploy, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginRedeploy.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginRedeploy) { - v.beginRedeploy = nil + if !server.PollerResponderMore(beginRedeploy) { + v.beginRedeploy.remove(req) } return resp, nil @@ -1011,7 +1072,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginReimage(req *http. if v.srv.BeginReimage == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReimage not implemented")} } - if v.beginReimage == nil { + beginReimage := v.beginReimage.get(req) + if beginReimage == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimage` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1040,19 +1102,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginReimage(req *http. if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginReimage = &respr + beginReimage = &respr + v.beginReimage.add(req, beginReimage) } - resp, err := server.PollerResponderNext(v.beginReimage, req) + resp, err := server.PollerResponderNext(beginReimage, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginReimage.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginReimage) { - v.beginReimage = nil + if !server.PollerResponderMore(beginReimage) { + v.beginReimage.remove(req) } return resp, nil @@ -1062,7 +1126,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginReimageAll(req *ht if v.srv.BeginReimageAll == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReimageAll not implemented")} } - if v.beginReimageAll == nil { + beginReimageAll := v.beginReimageAll.get(req) + if beginReimageAll == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimageall` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1091,19 +1156,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginReimageAll(req *ht if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginReimageAll = &respr + beginReimageAll = &respr + v.beginReimageAll.add(req, beginReimageAll) } - resp, err := server.PollerResponderNext(v.beginReimageAll, req) + resp, err := server.PollerResponderNext(beginReimageAll, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginReimageAll.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginReimageAll) { - v.beginReimageAll = nil + if !server.PollerResponderMore(beginReimageAll) { + v.beginReimageAll.remove(req) } return resp, nil @@ -1113,7 +1180,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginRestart(req *http. if v.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} } - if v.beginRestart == nil { + beginRestart := v.beginRestart.get(req) + if beginRestart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1142,19 +1210,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginRestart(req *http. if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginRestart = &respr + beginRestart = &respr + v.beginRestart.add(req, beginRestart) } - resp, err := server.PollerResponderNext(v.beginRestart, req) + resp, err := server.PollerResponderNext(beginRestart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginRestart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginRestart) { - v.beginRestart = nil + if !server.PollerResponderMore(beginRestart) { + v.beginRestart.remove(req) } return resp, nil @@ -1164,7 +1234,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginSetOrchestrationSe if v.srv.BeginSetOrchestrationServiceState == nil { return nil, &nonRetriableError{errors.New("fake for method BeginSetOrchestrationServiceState not implemented")} } - if v.beginSetOrchestrationServiceState == nil { + beginSetOrchestrationServiceState := v.beginSetOrchestrationServiceState.get(req) + if beginSetOrchestrationServiceState == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/setOrchestrationServiceState` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1187,19 +1258,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginSetOrchestrationSe if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginSetOrchestrationServiceState = &respr + beginSetOrchestrationServiceState = &respr + v.beginSetOrchestrationServiceState.add(req, beginSetOrchestrationServiceState) } - resp, err := server.PollerResponderNext(v.beginSetOrchestrationServiceState, req) + resp, err := server.PollerResponderNext(beginSetOrchestrationServiceState, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginSetOrchestrationServiceState.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginSetOrchestrationServiceState) { - v.beginSetOrchestrationServiceState = nil + if !server.PollerResponderMore(beginSetOrchestrationServiceState) { + v.beginSetOrchestrationServiceState.remove(req) } return resp, nil @@ -1209,7 +1282,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginStart(req *http.Re if v.srv.BeginStart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} } - if v.beginStart == nil { + beginStart := v.beginStart.get(req) + if beginStart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1238,19 +1312,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginStart(req *http.Re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginStart = &respr + beginStart = &respr + v.beginStart.add(req, beginStart) } - resp, err := server.PollerResponderNext(v.beginStart, req) + resp, err := server.PollerResponderNext(beginStart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginStart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginStart) { - v.beginStart = nil + if !server.PollerResponderMore(beginStart) { + v.beginStart.remove(req) } return resp, nil @@ -1260,7 +1336,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginUpdate(req *http.R if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if v.beginUpdate == nil { + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1283,19 +1360,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginUpdate(req *http.R if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdate = &respr + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(v.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdate) { - v.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) } return resp, nil @@ -1305,7 +1384,8 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginUpdateInstances(re if v.srv.BeginUpdateInstances == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdateInstances not implemented")} } - if v.beginUpdateInstances == nil { + beginUpdateInstances := v.beginUpdateInstances.get(req) + if beginUpdateInstances == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/manualupgrade` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -1328,19 +1408,21 @@ func (v *VirtualMachineScaleSetsServerTransport) dispatchBeginUpdateInstances(re if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdateInstances = &respr + beginUpdateInstances = &respr + v.beginUpdateInstances.add(req, beginUpdateInstances) } - resp, err := server.PollerResponderNext(v.beginUpdateInstances, req) + resp, err := server.PollerResponderNext(beginUpdateInstances, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginUpdateInstances.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdateInstances) { - v.beginUpdateInstances = nil + if !server.PollerResponderMore(beginUpdateInstances) { + v.beginUpdateInstances.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmextensions_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmextensions_server.go index 295091f705e1..6719e1797e2b 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmextensions_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmextensions_server.go @@ -45,19 +45,24 @@ type VirtualMachineScaleSetVMExtensionsServer struct { } // NewVirtualMachineScaleSetVMExtensionsServerTransport creates a new instance of VirtualMachineScaleSetVMExtensionsServerTransport with the provided implementation. -// The returned VirtualMachineScaleSetVMExtensionsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetVMExtensionsClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineScaleSetVMExtensionsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetVMExtensionsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineScaleSetVMExtensionsServerTransport(srv *VirtualMachineScaleSetVMExtensionsServer) *VirtualMachineScaleSetVMExtensionsServerTransport { - return &VirtualMachineScaleSetVMExtensionsServerTransport{srv: srv} + return &VirtualMachineScaleSetVMExtensionsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientDeleteResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientUpdateResponse]](), + } } // VirtualMachineScaleSetVMExtensionsServerTransport connects instances of armcompute.VirtualMachineScaleSetVMExtensionsClient to instances of VirtualMachineScaleSetVMExtensionsServer. // Don't use this type directly, use NewVirtualMachineScaleSetVMExtensionsServerTransport instead. type VirtualMachineScaleSetVMExtensionsServerTransport struct { srv *VirtualMachineScaleSetVMExtensionsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientDeleteResponse] - beginUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientDeleteResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMExtensionsClientUpdateResponse]] } // Do implements the policy.Transporter interface for VirtualMachineScaleSetVMExtensionsServerTransport. @@ -97,7 +102,8 @@ func (v *VirtualMachineScaleSetVMExtensionsServerTransport) dispatchBeginCreateO if v.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if v.beginCreateOrUpdate == nil { + beginCreateOrUpdate := v.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -128,19 +134,21 @@ func (v *VirtualMachineScaleSetVMExtensionsServerTransport) dispatchBeginCreateO if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + v.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(v.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCreateOrUpdate) { - v.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + v.beginCreateOrUpdate.remove(req) } return resp, nil @@ -150,7 +158,8 @@ func (v *VirtualMachineScaleSetVMExtensionsServerTransport) dispatchBeginDelete( if v.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if v.beginDelete == nil { + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -177,19 +186,21 @@ func (v *VirtualMachineScaleSetVMExtensionsServerTransport) dispatchBeginDelete( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDelete = &respr + beginDelete = &respr + v.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(v.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDelete) { - v.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) } return resp, nil @@ -301,7 +312,8 @@ func (v *VirtualMachineScaleSetVMExtensionsServerTransport) dispatchBeginUpdate( if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if v.beginUpdate == nil { + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/extensions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -332,19 +344,21 @@ func (v *VirtualMachineScaleSetVMExtensionsServerTransport) dispatchBeginUpdate( if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdate = &respr + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(v.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdate) { - v.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmruncommands_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmruncommands_server.go index 4d55bab1340c..239f9b666725 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmruncommands_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvmruncommands_server.go @@ -46,20 +46,26 @@ type VirtualMachineScaleSetVMRunCommandsServer struct { } // NewVirtualMachineScaleSetVMRunCommandsServerTransport creates a new instance of VirtualMachineScaleSetVMRunCommandsServerTransport with the provided implementation. -// The returned VirtualMachineScaleSetVMRunCommandsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetVMRunCommandsClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineScaleSetVMRunCommandsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetVMRunCommandsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineScaleSetVMRunCommandsServerTransport(srv *VirtualMachineScaleSetVMRunCommandsServer) *VirtualMachineScaleSetVMRunCommandsServerTransport { - return &VirtualMachineScaleSetVMRunCommandsServerTransport{srv: srv} + return &VirtualMachineScaleSetVMRunCommandsServerTransport{ + srv: srv, + beginCreateOrUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientListResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientUpdateResponse]](), + } } // VirtualMachineScaleSetVMRunCommandsServerTransport connects instances of armcompute.VirtualMachineScaleSetVMRunCommandsClient to instances of VirtualMachineScaleSetVMRunCommandsServer. // Don't use this type directly, use NewVirtualMachineScaleSetVMRunCommandsServerTransport instead. type VirtualMachineScaleSetVMRunCommandsServerTransport struct { srv *VirtualMachineScaleSetVMRunCommandsServer - beginCreateOrUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse] - beginDelete *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientListResponse] - beginUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientUpdateResponse] + beginCreateOrUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientListResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMRunCommandsClientUpdateResponse]] } // Do implements the policy.Transporter interface for VirtualMachineScaleSetVMRunCommandsServerTransport. @@ -99,7 +105,8 @@ func (v *VirtualMachineScaleSetVMRunCommandsServerTransport) dispatchBeginCreate if v.srv.BeginCreateOrUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginCreateOrUpdate not implemented")} } - if v.beginCreateOrUpdate == nil { + beginCreateOrUpdate := v.beginCreateOrUpdate.get(req) + if beginCreateOrUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -130,19 +137,21 @@ func (v *VirtualMachineScaleSetVMRunCommandsServerTransport) dispatchBeginCreate if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginCreateOrUpdate = &respr + beginCreateOrUpdate = &respr + v.beginCreateOrUpdate.add(req, beginCreateOrUpdate) } - resp, err := server.PollerResponderNext(v.beginCreateOrUpdate, req) + resp, err := server.PollerResponderNext(beginCreateOrUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusCreated}, resp.StatusCode) { + v.beginCreateOrUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusCreated", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginCreateOrUpdate) { - v.beginCreateOrUpdate = nil + if !server.PollerResponderMore(beginCreateOrUpdate) { + v.beginCreateOrUpdate.remove(req) } return resp, nil @@ -152,7 +161,8 @@ func (v *VirtualMachineScaleSetVMRunCommandsServerTransport) dispatchBeginDelete if v.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if v.beginDelete == nil { + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -179,19 +189,21 @@ func (v *VirtualMachineScaleSetVMRunCommandsServerTransport) dispatchBeginDelete if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDelete = &respr + beginDelete = &respr + v.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(v.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDelete) { - v.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) } return resp, nil @@ -254,7 +266,8 @@ func (v *VirtualMachineScaleSetVMRunCommandsServerTransport) dispatchNewListPage if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if v.newListPager == nil { + newListPager := v.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -286,20 +299,22 @@ func (v *VirtualMachineScaleSetVMRunCommandsServerTransport) dispatchNewListPage } } resp := v.srv.NewListPager(resourceGroupNameUnescaped, vmScaleSetNameUnescaped, instanceIDUnescaped, options) - v.newListPager = &resp - server.PagerResponderInjectNextLinks(v.newListPager, req, func(page *armcompute.VirtualMachineScaleSetVMRunCommandsClientListResponse, createLink func() string) { + newListPager = &resp + v.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.VirtualMachineScaleSetVMRunCommandsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListPager) { - v.newListPager = nil + if !server.PagerResponderMore(newListPager) { + v.newListPager.remove(req) } return resp, nil } @@ -308,7 +323,8 @@ func (v *VirtualMachineScaleSetVMRunCommandsServerTransport) dispatchBeginUpdate if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if v.beginUpdate == nil { + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommands/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -339,19 +355,21 @@ func (v *VirtualMachineScaleSetVMRunCommandsServerTransport) dispatchBeginUpdate if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdate = &respr + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(v.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdate) { - v.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvms_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvms_server.go index d2ce35064507..8b54f4b467f4 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvms_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinescalesetvms_server.go @@ -92,28 +92,42 @@ type VirtualMachineScaleSetVMsServer struct { } // NewVirtualMachineScaleSetVMsServerTransport creates a new instance of VirtualMachineScaleSetVMsServerTransport with the provided implementation. -// The returned VirtualMachineScaleSetVMsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetVMsClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineScaleSetVMsServerTransport instance is connected to an instance of armcompute.VirtualMachineScaleSetVMsClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineScaleSetVMsServerTransport(srv *VirtualMachineScaleSetVMsServer) *VirtualMachineScaleSetVMsServerTransport { - return &VirtualMachineScaleSetVMsServerTransport{srv: srv} + return &VirtualMachineScaleSetVMsServerTransport{ + srv: srv, + beginDeallocate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientDeallocateResponse]](), + beginDelete: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientDeleteResponse]](), + newListPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetVMsClientListResponse]](), + beginPerformMaintenance: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientPerformMaintenanceResponse]](), + beginPowerOff: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientPowerOffResponse]](), + beginRedeploy: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRedeployResponse]](), + beginReimage: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientReimageResponse]](), + beginReimageAll: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientReimageAllResponse]](), + beginRestart: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRestartResponse]](), + beginRunCommand: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRunCommandResponse]](), + beginStart: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientStartResponse]](), + beginUpdate: newTracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientUpdateResponse]](), + } } // VirtualMachineScaleSetVMsServerTransport connects instances of armcompute.VirtualMachineScaleSetVMsClient to instances of VirtualMachineScaleSetVMsServer. // Don't use this type directly, use NewVirtualMachineScaleSetVMsServerTransport instead. type VirtualMachineScaleSetVMsServerTransport struct { srv *VirtualMachineScaleSetVMsServer - beginDeallocate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientDeallocateResponse] - beginDelete *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientDeleteResponse] - newListPager *azfake.PagerResponder[armcompute.VirtualMachineScaleSetVMsClientListResponse] - beginPerformMaintenance *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientPerformMaintenanceResponse] - beginPowerOff *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientPowerOffResponse] - beginRedeploy *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRedeployResponse] - beginReimage *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientReimageResponse] - beginReimageAll *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientReimageAllResponse] - beginRestart *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRestartResponse] - beginRunCommand *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRunCommandResponse] - beginStart *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientStartResponse] - beginUpdate *azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientUpdateResponse] + beginDeallocate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientDeallocateResponse]] + beginDelete *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientDeleteResponse]] + newListPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineScaleSetVMsClientListResponse]] + beginPerformMaintenance *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientPerformMaintenanceResponse]] + beginPowerOff *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientPowerOffResponse]] + beginRedeploy *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRedeployResponse]] + beginReimage *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientReimageResponse]] + beginReimageAll *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientReimageAllResponse]] + beginRestart *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRestartResponse]] + beginRunCommand *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientRunCommandResponse]] + beginStart *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientStartResponse]] + beginUpdate *tracker[azfake.PollerResponder[armcompute.VirtualMachineScaleSetVMsClientUpdateResponse]] } // Do implements the policy.Transporter interface for VirtualMachineScaleSetVMsServerTransport. @@ -175,7 +189,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginDeallocate(req * if v.srv.BeginDeallocate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDeallocate not implemented")} } - if v.beginDeallocate == nil { + beginDeallocate := v.beginDeallocate.get(req) + if beginDeallocate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/deallocate` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -198,19 +213,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginDeallocate(req * if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDeallocate = &respr + beginDeallocate = &respr + v.beginDeallocate.add(req, beginDeallocate) } - resp, err := server.PollerResponderNext(v.beginDeallocate, req) + resp, err := server.PollerResponderNext(beginDeallocate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginDeallocate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDeallocate) { - v.beginDeallocate = nil + if !server.PollerResponderMore(beginDeallocate) { + v.beginDeallocate.remove(req) } return resp, nil @@ -220,7 +237,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginDelete(req *http if v.srv.BeginDelete == nil { return nil, &nonRetriableError{errors.New("fake for method BeginDelete not implemented")} } - if v.beginDelete == nil { + beginDelete := v.beginDelete.get(req) + if beginDelete == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -258,19 +276,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginDelete(req *http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginDelete = &respr + beginDelete = &respr + v.beginDelete.add(req, beginDelete) } - resp, err := server.PollerResponderNext(v.beginDelete, req) + resp, err := server.PollerResponderNext(beginDelete, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted, http.StatusNoContent}, resp.StatusCode) { + v.beginDelete.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted, http.StatusNoContent", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginDelete) { - v.beginDelete = nil + if !server.PollerResponderMore(beginDelete) { + v.beginDelete.remove(req) } return resp, nil @@ -366,7 +386,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchNewListPager(req *htt if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if v.newListPager == nil { + newListPager := v.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -406,20 +427,22 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchNewListPager(req *htt } } resp := v.srv.NewListPager(resourceGroupNameUnescaped, virtualMachineScaleSetNameUnescaped, options) - v.newListPager = &resp - server.PagerResponderInjectNextLinks(v.newListPager, req, func(page *armcompute.VirtualMachineScaleSetVMsClientListResponse, createLink func() string) { + newListPager = &resp + v.newListPager.add(req, newListPager) + server.PagerResponderInjectNextLinks(newListPager, req, func(page *armcompute.VirtualMachineScaleSetVMsClientListResponse, createLink func() string) { page.NextLink = to.Ptr(createLink()) }) } - resp, err := server.PagerResponderNext(v.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListPager) { - v.newListPager = nil + if !server.PagerResponderMore(newListPager) { + v.newListPager.remove(req) } return resp, nil } @@ -428,7 +451,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginPerformMaintenan if v.srv.BeginPerformMaintenance == nil { return nil, &nonRetriableError{errors.New("fake for method BeginPerformMaintenance not implemented")} } - if v.beginPerformMaintenance == nil { + beginPerformMaintenance := v.beginPerformMaintenance.get(req) + if beginPerformMaintenance == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualmachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/performMaintenance` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -451,19 +475,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginPerformMaintenan if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginPerformMaintenance = &respr + beginPerformMaintenance = &respr + v.beginPerformMaintenance.add(req, beginPerformMaintenance) } - resp, err := server.PollerResponderNext(v.beginPerformMaintenance, req) + resp, err := server.PollerResponderNext(beginPerformMaintenance, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginPerformMaintenance.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginPerformMaintenance) { - v.beginPerformMaintenance = nil + if !server.PollerResponderMore(beginPerformMaintenance) { + v.beginPerformMaintenance.remove(req) } return resp, nil @@ -473,7 +499,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginPowerOff(req *ht if v.srv.BeginPowerOff == nil { return nil, &nonRetriableError{errors.New("fake for method BeginPowerOff not implemented")} } - if v.beginPowerOff == nil { + beginPowerOff := v.beginPowerOff.get(req) + if beginPowerOff == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualmachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/poweroff` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -511,19 +538,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginPowerOff(req *ht if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginPowerOff = &respr + beginPowerOff = &respr + v.beginPowerOff.add(req, beginPowerOff) } - resp, err := server.PollerResponderNext(v.beginPowerOff, req) + resp, err := server.PollerResponderNext(beginPowerOff, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginPowerOff.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginPowerOff) { - v.beginPowerOff = nil + if !server.PollerResponderMore(beginPowerOff) { + v.beginPowerOff.remove(req) } return resp, nil @@ -533,7 +562,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginRedeploy(req *ht if v.srv.BeginRedeploy == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRedeploy not implemented")} } - if v.beginRedeploy == nil { + beginRedeploy := v.beginRedeploy.get(req) + if beginRedeploy == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualmachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/redeploy` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -556,19 +586,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginRedeploy(req *ht if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginRedeploy = &respr + beginRedeploy = &respr + v.beginRedeploy.add(req, beginRedeploy) } - resp, err := server.PollerResponderNext(v.beginRedeploy, req) + resp, err := server.PollerResponderNext(beginRedeploy, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginRedeploy.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginRedeploy) { - v.beginRedeploy = nil + if !server.PollerResponderMore(beginRedeploy) { + v.beginRedeploy.remove(req) } return resp, nil @@ -578,7 +610,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginReimage(req *htt if v.srv.BeginReimage == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReimage not implemented")} } - if v.beginReimage == nil { + beginReimage := v.beginReimage.get(req) + if beginReimage == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimage` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -611,19 +644,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginReimage(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginReimage = &respr + beginReimage = &respr + v.beginReimage.add(req, beginReimage) } - resp, err := server.PollerResponderNext(v.beginReimage, req) + resp, err := server.PollerResponderNext(beginReimage, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginReimage.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginReimage) { - v.beginReimage = nil + if !server.PollerResponderMore(beginReimage) { + v.beginReimage.remove(req) } return resp, nil @@ -633,7 +668,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginReimageAll(req * if v.srv.BeginReimageAll == nil { return nil, &nonRetriableError{errors.New("fake for method BeginReimageAll not implemented")} } - if v.beginReimageAll == nil { + beginReimageAll := v.beginReimageAll.get(req) + if beginReimageAll == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/reimageall` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -656,19 +692,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginReimageAll(req * if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginReimageAll = &respr + beginReimageAll = &respr + v.beginReimageAll.add(req, beginReimageAll) } - resp, err := server.PollerResponderNext(v.beginReimageAll, req) + resp, err := server.PollerResponderNext(beginReimageAll, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginReimageAll.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginReimageAll) { - v.beginReimageAll = nil + if !server.PollerResponderMore(beginReimageAll) { + v.beginReimageAll.remove(req) } return resp, nil @@ -678,7 +716,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginRestart(req *htt if v.srv.BeginRestart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRestart not implemented")} } - if v.beginRestart == nil { + beginRestart := v.beginRestart.get(req) + if beginRestart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualmachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/restart` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -701,19 +740,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginRestart(req *htt if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginRestart = &respr + beginRestart = &respr + v.beginRestart.add(req, beginRestart) } - resp, err := server.PollerResponderNext(v.beginRestart, req) + resp, err := server.PollerResponderNext(beginRestart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginRestart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginRestart) { - v.beginRestart = nil + if !server.PollerResponderMore(beginRestart) { + v.beginRestart.remove(req) } return resp, nil @@ -781,7 +822,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginRunCommand(req * if v.srv.BeginRunCommand == nil { return nil, &nonRetriableError{errors.New("fake for method BeginRunCommand not implemented")} } - if v.beginRunCommand == nil { + beginRunCommand := v.beginRunCommand.get(req) + if beginRunCommand == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualmachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/runCommand` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -808,19 +850,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginRunCommand(req * if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginRunCommand = &respr + beginRunCommand = &respr + v.beginRunCommand.add(req, beginRunCommand) } - resp, err := server.PollerResponderNext(v.beginRunCommand, req) + resp, err := server.PollerResponderNext(beginRunCommand, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginRunCommand.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginRunCommand) { - v.beginRunCommand = nil + if !server.PollerResponderMore(beginRunCommand) { + v.beginRunCommand.remove(req) } return resp, nil @@ -867,7 +911,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginStart(req *http. if v.srv.BeginStart == nil { return nil, &nonRetriableError{errors.New("fake for method BeginStart not implemented")} } - if v.beginStart == nil { + beginStart := v.beginStart.get(req) + if beginStart == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualmachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/start` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -890,19 +935,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginStart(req *http. if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginStart = &respr + beginStart = &respr + v.beginStart.add(req, beginStart) } - resp, err := server.PollerResponderNext(v.beginStart, req) + resp, err := server.PollerResponderNext(beginStart, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginStart.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginStart) { - v.beginStart = nil + if !server.PollerResponderMore(beginStart) { + v.beginStart.remove(req) } return resp, nil @@ -912,7 +959,8 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginUpdate(req *http if v.srv.BeginUpdate == nil { return nil, &nonRetriableError{errors.New("fake for method BeginUpdate not implemented")} } - if v.beginUpdate == nil { + beginUpdate := v.beginUpdate.get(req) + if beginUpdate == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/resourceGroups/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/virtualMachineScaleSets/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/virtualMachines/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -939,19 +987,21 @@ func (v *VirtualMachineScaleSetVMsServerTransport) dispatchBeginUpdate(req *http if respErr := server.GetError(errRespr, req); respErr != nil { return nil, respErr } - v.beginUpdate = &respr + beginUpdate = &respr + v.beginUpdate.add(req, beginUpdate) } - resp, err := server.PollerResponderNext(v.beginUpdate, req) + resp, err := server.PollerResponderNext(beginUpdate, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK, http.StatusAccepted}, resp.StatusCode) { + v.beginUpdate.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK, http.StatusAccepted", resp.StatusCode)} } - if !server.PollerResponderMore(v.beginUpdate) { - v.beginUpdate = nil + if !server.PollerResponderMore(beginUpdate) { + v.beginUpdate.remove(req) } return resp, nil diff --git a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinesizes_server.go b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinesizes_server.go index 47e098f47c8d..20f0649f4eb3 100644 --- a/sdk/resourcemanager/compute/armcompute/fake/virtualmachinesizes_server.go +++ b/sdk/resourcemanager/compute/armcompute/fake/virtualmachinesizes_server.go @@ -28,17 +28,20 @@ type VirtualMachineSizesServer struct { } // NewVirtualMachineSizesServerTransport creates a new instance of VirtualMachineSizesServerTransport with the provided implementation. -// The returned VirtualMachineSizesServerTransport instance is connected to an instance of armcompute.VirtualMachineSizesClient by way of the -// undefined.Transporter field. +// The returned VirtualMachineSizesServerTransport instance is connected to an instance of armcompute.VirtualMachineSizesClient via the +// azcore.ClientOptions.Transporter field in the client's constructor parameters. func NewVirtualMachineSizesServerTransport(srv *VirtualMachineSizesServer) *VirtualMachineSizesServerTransport { - return &VirtualMachineSizesServerTransport{srv: srv} + return &VirtualMachineSizesServerTransport{ + srv: srv, + newListPager: newTracker[azfake.PagerResponder[armcompute.VirtualMachineSizesClientListResponse]](), + } } // VirtualMachineSizesServerTransport connects instances of armcompute.VirtualMachineSizesClient to instances of VirtualMachineSizesServer. // Don't use this type directly, use NewVirtualMachineSizesServerTransport instead. type VirtualMachineSizesServerTransport struct { srv *VirtualMachineSizesServer - newListPager *azfake.PagerResponder[armcompute.VirtualMachineSizesClientListResponse] + newListPager *tracker[azfake.PagerResponder[armcompute.VirtualMachineSizesClientListResponse]] } // Do implements the policy.Transporter interface for VirtualMachineSizesServerTransport. @@ -70,7 +73,8 @@ func (v *VirtualMachineSizesServerTransport) dispatchNewListPager(req *http.Requ if v.srv.NewListPager == nil { return nil, &nonRetriableError{errors.New("fake for method NewListPager not implemented")} } - if v.newListPager == nil { + newListPager := v.newListPager.get(req) + if newListPager == nil { const regexStr = `/subscriptions/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/providers/Microsoft.Compute/locations/(?P[!#&$-;=?-\[\]_a-zA-Z0-9~%@]+)/vmSizes` regex := regexp.MustCompile(regexStr) matches := regex.FindStringSubmatch(req.URL.EscapedPath()) @@ -82,17 +86,19 @@ func (v *VirtualMachineSizesServerTransport) dispatchNewListPager(req *http.Requ return nil, err } resp := v.srv.NewListPager(locationUnescaped, nil) - v.newListPager = &resp + newListPager = &resp + v.newListPager.add(req, newListPager) } - resp, err := server.PagerResponderNext(v.newListPager, req) + resp, err := server.PagerResponderNext(newListPager, req) if err != nil { return nil, err } if !contains([]int{http.StatusOK}, resp.StatusCode) { + v.newListPager.remove(req) return nil, &nonRetriableError{fmt.Errorf("unexpected status code %d. acceptable values are http.StatusOK", resp.StatusCode)} } - if !server.PagerResponderMore(v.newListPager) { - v.newListPager = nil + if !server.PagerResponderMore(newListPager) { + v.newListPager.remove(req) } return resp, nil } diff --git a/sdk/resourcemanager/compute/armcompute/go.mod b/sdk/resourcemanager/compute/armcompute/go.mod index 8965d86f88d8..25504291fd2e 100644 --- a/sdk/resourcemanager/compute/armcompute/go.mod +++ b/sdk/resourcemanager/compute/armcompute/go.mod @@ -3,7 +3,7 @@ module github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/compute/armcompute/ go 1.18 require ( - github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0-beta.2 + github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0-beta.1 github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/internal v1.1.2 github.com/Azure/azure-sdk-for-go/sdk/resourcemanager/resources/armresources v1.1.1 diff --git a/sdk/resourcemanager/compute/armcompute/go.sum b/sdk/resourcemanager/compute/armcompute/go.sum index b8e59261b2da..09d19adee11c 100644 --- a/sdk/resourcemanager/compute/armcompute/go.sum +++ b/sdk/resourcemanager/compute/armcompute/go.sum @@ -1,5 +1,5 @@ -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0-beta.2 h1:C3zKsGguxcLd8a2uEytB8+TFtBGd75bXRxEs0QBwsv0= -github.com/Azure/azure-sdk-for-go/sdk/azcore v1.7.0-beta.2/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0-beta.1 h1:8t6ZZtkOCl+rx7uBn40Nj62ABVGkXK69U/En44wJIlE= +github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0-beta.1/go.mod h1:bjGvMhVMb+EEm3VRNQawDMUyMMjo+S5ewNjflkep/0Q= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2 h1:uqM+VoHjVH6zdlkLF2b6O0ZANcHoj3rO0PoQ3jglUJA= github.com/Azure/azure-sdk-for-go/sdk/azidentity v1.2.2/go.mod h1:twTKAa1E6hLmSDjLhaCkbTMQKc7p/rNLU40rLxGEOCI= github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 h1:sXr+ck84g/ZlZUOZiNELInmMgOsuGwdjjVkEIde0OtY= diff --git a/sdk/resourcemanager/compute/armcompute/models.go b/sdk/resourcemanager/compute/armcompute/models.go index 1d75062e2e24..25d23adf8dda 100644 --- a/sdk/resourcemanager/compute/armcompute/models.go +++ b/sdk/resourcemanager/compute/armcompute/models.go @@ -214,45 +214,6 @@ type AvailabilitySetUpdate struct { Tags map[string]*string } -// AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate -// method. -type AvailabilitySetsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. -type AvailabilitySetsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. -type AvailabilitySetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager -// method. -type AvailabilitySetsClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager -// method. -type AvailabilitySetsClientListBySubscriptionOptions struct { - // The expand expression to apply to the operation. Allowed values are 'instanceView'. - Expand *string -} - -// AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager method. -type AvailabilitySetsClientListOptions struct { - // placeholder for future optional parameters -} - -// AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method. -type AvailabilitySetsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // AvailablePatchSummary - Describes the properties of an virtual machine instance view for available patch summary. type AvailablePatchSummary struct { // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension @@ -426,51 +387,6 @@ type CapacityReservationGroupUpdate struct { Tags map[string]*string } -// CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate -// method. -type CapacityReservationGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete -// method. -type CapacityReservationGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get -// method. -type CapacityReservationGroupsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity - // reservations under the capacity reservation group which is a snapshot of the - // runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. - Expand *CapacityReservationGroupInstanceViewTypes -} - -// CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager -// method. -type CapacityReservationGroupsClientListByResourceGroupOptions struct { - // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet - // VM Instance or both resource Ids which are associated to capacity - // reservation group in the response. - Expand *ExpandTypesForGetCapacityReservationGroups -} - -// CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager -// method. -type CapacityReservationGroupsClientListBySubscriptionOptions struct { - // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet - // VM Instance or both resource Ids which are associated to capacity - // reservation group in the response. - Expand *ExpandTypesForGetCapacityReservationGroups -} - -// CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update -// method. -type CapacityReservationGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // CapacityReservationInstanceView - The instance view of a capacity reservation that provides as snapshot of the runtime // properties of the capacity reservation that is managed by the platform and can change outside of control plane // operations. @@ -565,41 +481,6 @@ type CapacityReservationUtilization struct { VirtualMachinesAllocated []*SubResourceReadOnly } -// CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate -// method. -type CapacityReservationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete -// method. -type CapacityReservationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate -// method. -type CapacityReservationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get method. -type CapacityReservationsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity - // reservation that is managed by the platform and can change outside of - // control plane operations. - Expand *CapacityReservationInstanceViewTypes -} - -// CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager -// method. -type CapacityReservationsClientListByCapacityReservationGroupOptions struct { - // placeholder for future optional parameters -} - // CloudService - Describes the cloud service. type CloudService struct { // REQUIRED; Resource location. @@ -723,30 +604,6 @@ type CloudServiceNetworkProfile struct { SwappableCloudService *SubResource } -// CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily -// method. -type CloudServiceOperatingSystemsClientGetOSFamilyOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion -// method. -type CloudServiceOperatingSystemsClientGetOSVersionOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager -// method. -type CloudServiceOperatingSystemsClientListOSFamiliesOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager -// method. -type CloudServiceOperatingSystemsClientListOSVersionsOptions struct { - // placeholder for future optional parameters -} - // CloudServiceOsProfile - Describes the OS profile for the cloud service. type CloudServiceOsProfile struct { // Specifies set of certificates that should be installed onto the role instances. @@ -830,60 +687,6 @@ type CloudServiceRole struct { Type *string } -// CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete -// method. -type CloudServiceRoleInstancesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild -// method. -type CloudServiceRoleInstancesClientBeginRebuildOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage -// method. -type CloudServiceRoleInstancesClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart -// method. -type CloudServiceRoleInstancesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView -// method. -type CloudServiceRoleInstancesClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get -// method. -type CloudServiceRoleInstancesClientGetOptions struct { - // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. - Expand *InstanceViewTypes -} - -// CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile -// method. -type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager -// method. -type CloudServiceRoleInstancesClientListOptions struct { - // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. - Expand *InstanceViewTypes -} - // CloudServiceRoleListResult - The list operation result. type CloudServiceRoleListResult struct { // REQUIRED; The list of resources. @@ -930,16 +733,6 @@ type CloudServiceRoleSKU struct { Tier *string } -// CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method. -type CloudServiceRolesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager method. -type CloudServiceRolesClientListOptions struct { - // placeholder for future optional parameters -} - type CloudServiceUpdate struct { // Resource tags Tags map[string]*string @@ -971,115 +764,6 @@ type CloudServiceVaultSecretGroup struct { VaultCertificates []*CloudServiceVaultCertificate } -// CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate -// method. -type CloudServicesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances -// method. -type CloudServicesClientBeginDeleteInstancesOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete method. -type CloudServicesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff method. -type CloudServicesClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild method. -type CloudServicesClientBeginRebuildOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage method. -type CloudServicesClientBeginReimageOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart method. -type CloudServicesClientBeginRestartOptions struct { - // List of cloud service role instance names. - Parameters *RoleInstances - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart method. -type CloudServicesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate method. -type CloudServicesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView -// method. -type CloudServicesClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. -type CloudServicesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager method. -type CloudServicesClientListAllOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method. -type CloudServicesClientListOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain -// method. -type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain -// method. -type CloudServicesUpdateDomainClientGetUpdateDomainOptions struct { - // placeholder for future optional parameters -} - -// CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager -// method. -type CloudServicesUpdateDomainClientListUpdateDomainsOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. -type CommunityGalleriesClientGetOptions struct { - // placeholder for future optional parameters -} - // CommunityGallery - Specifies information about the Community Gallery that you want to create or update. type CommunityGallery struct { // The identifier information of community gallery. @@ -1231,29 +915,6 @@ type CommunityGalleryImageVersionProperties struct { StorageProfile *SharedGalleryImageVersionStorageProfile } -// CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get -// method. -type CommunityGalleryImageVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager -// method. -type CommunityGalleryImageVersionsClientListOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method. -type CommunityGalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager -// method. -type CommunityGalleryImagesClientListOptions struct { - // placeholder for future optional parameters -} - // CommunityGalleryInfo - Information of community gallery if current gallery is shared to community type CommunityGalleryInfo struct { // End-user license agreement for community gallery image. @@ -1548,42 +1209,6 @@ type DedicatedHostGroupUpdate struct { Zones []*string } -// DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate -// method. -type DedicatedHostGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete method. -type DedicatedHostGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. -type DedicatedHostGroupsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated - // hosts under the dedicated host group. 'UserData' is not supported for - // dedicated host group. - Expand *InstanceViewTypes -} - -// DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager -// method. -type DedicatedHostGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager -// method. -type DedicatedHostGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update method. -type DedicatedHostGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // DedicatedHostInstanceView - The instance view of a dedicated host. type DedicatedHostInstanceView struct { // Unutilized capacity of the dedicated host. @@ -1675,50 +1300,6 @@ type DedicatedHostUpdate struct { Tags map[string]*string } -// DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate -// method. -type DedicatedHostsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete method. -type DedicatedHostsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart method. -type DedicatedHostsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate method. -type DedicatedHostsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method. -type DedicatedHostsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated - // host. 'UserData' is not supported for dedicated host. - Expand *InstanceViewTypes -} - -// DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager -// method. -type DedicatedHostsClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager -// method. -type DedicatedHostsClientListByHostGroupOptions struct { - // placeholder for future optional parameters -} - // DiagnosticsProfile - Specifies the boot diagnostic settings state. Minimum api-version: 2015-06-15. type DiagnosticsProfile struct { // Boot Diagnostics is a debugging feature which allows you to view Console Output and Screenshot to diagnose VM status. NOTE: @@ -1841,73 +1422,6 @@ type DiskAccessUpdate struct { Tags map[string]*string } -// DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate -// method. -type DiskAccessesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection -// method. -type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete method. -type DiskAccessesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection -// method. -type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate method. -type DiskAccessesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection -// method. -type DiskAccessesClientGetAPrivateEndpointConnectionOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method. -type DiskAccessesClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources -// method. -type DiskAccessesClientGetPrivateLinkResourcesOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager -// method. -type DiskAccessesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method. -type DiskAccessesClientListOptions struct { - // placeholder for future optional parameters -} - -// DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager -// method. -type DiskAccessesClientListPrivateEndpointConnectionsOptions struct { - // placeholder for future optional parameters -} - // DiskEncryptionSet - disk encryption set resource. type DiskEncryptionSet struct { // REQUIRED; Resource location @@ -1978,49 +1492,6 @@ type DiskEncryptionSetUpdateProperties struct { RotationToLatestKeyVersionEnabled *bool } -// DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate -// method. -type DiskEncryptionSetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete -// method. -type DiskEncryptionSetsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate -// method. -type DiskEncryptionSetsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method. -type DiskEncryptionSetsClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager -// method. -type DiskEncryptionSetsClientListAssociatedResourcesOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager -// method. -type DiskEncryptionSetsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager method. -type DiskEncryptionSetsClientListOptions struct { - // placeholder for future optional parameters -} - // DiskEncryptionSettings - Describes a Encryption Settings for a Disk type DiskEncryptionSettings struct { // Specifies the location of the disk encryption key, which is a Key Vault Secret. @@ -2215,31 +1686,6 @@ type DiskRestorePointAttributes struct { ID *string } -// DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess -// method. -type DiskRestorePointClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess -// method. -type DiskRestorePointClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method. -type DiskRestorePointClientGetOptions struct { - // placeholder for future optional parameters -} - -// DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager -// method. -type DiskRestorePointClientListByRestorePointOptions struct { - // placeholder for future optional parameters -} - // DiskRestorePointInstanceView - The instance view of a disk restore point. type DiskRestorePointInstanceView struct { // Disk restore point Id. @@ -2428,52 +1874,6 @@ type DiskUpdateProperties struct { PropertyUpdatesInProgress *PropertyUpdatesInProgress } -// DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method. -type DisksClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method. -type DisksClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method. -type DisksClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method. -type DisksClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method. -type DisksClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// DisksClientGetOptions contains the optional parameters for the DisksClient.Get method. -type DisksClientGetOptions struct { - // placeholder for future optional parameters -} - -// DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager -// method. -type DisksClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method. -type DisksClientListOptions struct { - // placeholder for future optional parameters -} - // Encryption at rest settings for disk or snapshot type Encryption struct { // ResourceId of the disk encryption set to use for enabling encryption at rest. @@ -2589,44 +1989,6 @@ type Extension struct { Properties *CloudServiceExtensionProperties } -// GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate -// method. -type GalleriesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. -type GalleriesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method. -type GalleriesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. -type GalleriesClientGetOptions struct { - // The expand query option to apply on the operation. - Expand *GalleryExpandParams - // The select expression to apply on the operation. - Select *SelectPermissions -} - -// GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager -// method. -type GalleriesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method. -type GalleriesClientListOptions struct { - // placeholder for future optional parameters -} - // Gallery - Specifies information about the Shared Image Gallery that you want to create or update. type Gallery struct { // REQUIRED; Resource location @@ -2875,72 +2237,6 @@ type GalleryApplicationVersionUpdate struct { Type *string } -// GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate -// method. -type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete -// method. -type GalleryApplicationVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate -// method. -type GalleryApplicationVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get -// method. -type GalleryApplicationVersionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *ReplicationStatusTypes -} - -// GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager -// method. -type GalleryApplicationVersionsClientListByGalleryApplicationOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate -// method. -type GalleryApplicationsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete -// method. -type GalleryApplicationsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate -// method. -type GalleryApplicationsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method. -type GalleryApplicationsClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager -// method. -type GalleryApplicationsClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - // GalleryArtifactPublishingProfileBase - Describes the basic gallery artifact publishing profile. type GalleryArtifactPublishingProfileBase struct { // The end of life date of the gallery image version. This property can be used for decommissioning purposes. This property @@ -3296,69 +2592,6 @@ type GalleryImageVersionUpdate struct { Type *string } -// GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate -// method. -type GalleryImageVersionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete -// method. -type GalleryImageVersionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate -// method. -type GalleryImageVersionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get method. -type GalleryImageVersionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *ReplicationStatusTypes -} - -// GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager -// method. -type GalleryImageVersionsClientListByGalleryImageOptions struct { - // placeholder for future optional parameters -} - -// GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate -// method. -type GalleryImagesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete method. -type GalleryImagesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate method. -type GalleryImagesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. -type GalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager -// method. -type GalleryImagesClientListByGalleryOptions struct { - // placeholder for future optional parameters -} - // GalleryList - The List Galleries operation response. type GalleryList struct { // REQUIRED; A list of galleries. @@ -3401,13 +2634,6 @@ type GalleryProperties struct { SharingStatus *SharingStatus } -// GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate -// method. -type GallerySharingProfileClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - type GalleryTargetExtendedLocation struct { // Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. Encryption *EncryptionImages @@ -3722,41 +2948,6 @@ type ImageUpdate struct { Tags map[string]*string } -// ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate method. -type ImagesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. -type ImagesClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method. -type ImagesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. -type ImagesClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager -// method. -type ImagesClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method. -type ImagesClientListOptions struct { - // placeholder for future optional parameters -} - // InnerError - Inner error details. type InnerError struct { // The internal error message or exception dump. @@ -4015,20 +3206,6 @@ type LoadBalancerFrontendIPConfigurationProperties struct { Subnet *SubResource } -// LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval -// method. -type LogAnalyticsClientBeginExportRequestRateByIntervalOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests -// method. -type LogAnalyticsClientBeginExportThrottledRequestsOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - // LogAnalyticsInputBase - Api input base class for LogAnalytics Api. type LogAnalyticsInputBase struct { // REQUIRED; SAS Uri of the logging blob container to which LogAnalytics Api writes output logs to. @@ -4467,11 +3644,6 @@ type OperationValueDisplay struct { Resource *string } -// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. -type OperationsClientListOptions struct { - // placeholder for future optional parameters -} - // OrchestrationServiceStateInput - The input for OrchestrationServiceState type OrchestrationServiceStateInput struct { // REQUIRED; The action to be performed. @@ -4778,42 +3950,6 @@ type ProximityPlacementGroupUpdate struct { Tags map[string]*string } -// ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate -// method. -type ProximityPlacementGroupsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete -// method. -type ProximityPlacementGroupsClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get method. -type ProximityPlacementGroupsClientGetOptions struct { - // includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. - IncludeColocationStatus *string -} - -// ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager -// method. -type ProximityPlacementGroupsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager -// method. -type ProximityPlacementGroupsClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update -// method. -type ProximityPlacementGroupsClientUpdateOptions struct { - // placeholder for future optional parameters -} - // ProxyOnlyResource - The ProxyOnly Resource model definition. type ProxyOnlyResource struct { // READ-ONLY; Resource Id @@ -5124,14 +4260,6 @@ type ResourceSKUZoneDetails struct { Name []*string } -// ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method. -type ResourceSKUsClientListOptions struct { - // The filter to apply on the operation. Only location filter is supported currently. - Filter *string - // To Include Extended Locations information or not in the response. - IncludeExtendedLocations *string -} - // ResourceSKUsResult - The List Resource Skus operation response. type ResourceSKUsResult struct { // REQUIRED; The list of skus available for the subscription. @@ -5240,49 +4368,11 @@ type RestorePointCollectionSourceProperties struct { // RestorePointCollectionUpdate - Update Restore Point collection parameters. type RestorePointCollectionUpdate struct { - // The restore point collection properties. - Properties *RestorePointCollectionProperties - - // Resource tags - Tags map[string]*string -} - -// RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete -// method. -type RestorePointCollectionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate -// method. -type RestorePointCollectionsClientCreateOrUpdateOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get method. -type RestorePointCollectionsClientGetOptions struct { - // The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points - // in the restorePointCollection. - Expand *RestorePointCollectionExpandOptions -} - -// RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager -// method. -type RestorePointCollectionsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager -// method. -type RestorePointCollectionsClientListOptions struct { - // placeholder for future optional parameters -} + // The restore point collection properties. + Properties *RestorePointCollectionProperties -// RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update -// method. -type RestorePointCollectionsClientUpdateOptions struct { - // placeholder for future optional parameters + // Resource tags + Tags map[string]*string } // RestorePointEncryption - Encryption at rest settings for disk restore point. It is an optional property that can be specified @@ -5428,25 +4518,6 @@ type RestorePointSourceVMStorageProfile struct { OSDisk *RestorePointSourceVMOSDisk } -// RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method. -type RestorePointsClientBeginCreateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete method. -type RestorePointsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. -type RestorePointsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore - // point. - Expand *RestorePointExpandOptions -} - // RetrieveBootDiagnosticsDataResult - The SAS URIs of the console screenshot and serial log blobs. type RetrieveBootDiagnosticsDataResult struct { // READ-ONLY; The console screenshot blob URI @@ -5842,44 +4913,6 @@ type SSHPublicKeyUpdateResource struct { Tags map[string]*string } -// SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method. -type SSHPublicKeysClientCreateOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. -type SSHPublicKeysClientDeleteOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair -// method. -type SSHPublicKeysClientGenerateKeyPairOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. -type SSHPublicKeysClientGetOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager -// method. -type SSHPublicKeysClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager -// method. -type SSHPublicKeysClientListBySubscriptionOptions struct { - // placeholder for future optional parameters -} - -// SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method. -type SSHPublicKeysClientUpdateOptions struct { - // placeholder for future optional parameters -} - // SSHPublicKeysGroupListResult - The list SSH public keys operation response. type SSHPublicKeysGroupListResult struct { // REQUIRED; The list of SSH public keys @@ -5960,17 +4993,6 @@ type ShareInfoElement struct { VMURI *string } -// SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. -type SharedGalleriesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager method. -type SharedGalleriesClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - // SharedGallery - Specifies information about the Shared Gallery that you want to create or update. type SharedGallery struct { // The identifier information of shared gallery. @@ -6133,30 +5155,6 @@ type SharedGalleryImageVersionStorageProfile struct { OSDiskImage *SharedGalleryOSDiskImage } -// SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get -// method. -type SharedGalleryImageVersionsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager -// method. -type SharedGalleryImageVersionsClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - -// SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method. -type SharedGalleryImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager method. -type SharedGalleryImagesClientListOptions struct { - // The query parameter to decide what shared galleries to fetch when doing listing operations. - SharedTo *SharedToValues -} - // SharedGalleryList - The List Shared Galleries operation response. type SharedGalleryList struct { // REQUIRED; A list of shared galleries. @@ -6402,53 +5400,6 @@ type SnapshotUpdateProperties struct { SupportsHibernation *bool } -// SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate -// method. -type SnapshotsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. -type SnapshotsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess method. -type SnapshotsClientBeginGrantAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess method. -type SnapshotsClientBeginRevokeAccessOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. -type SnapshotsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. -type SnapshotsClientGetOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager -// method. -type SnapshotsClientListByResourceGroupOptions struct { - // placeholder for future optional parameters -} - -// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. -type SnapshotsClientListOptions struct { - // placeholder for future optional parameters -} - // SoftDeletePolicy - Contains information about the soft deletion policy of the gallery. type SoftDeletePolicy struct { // Enables soft-deletion for resources in this gallery, allowing them to be recovered within retention time. @@ -6730,11 +5681,6 @@ type Usage struct { Unit *string } -// UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method. -type UsageClientListOptions struct { - // placeholder for future optional parameters -} - // UsageName - The Usage Names. type UsageName struct { // The localized name of the resource. @@ -7082,27 +6028,6 @@ type VirtualMachineExtensionImageProperties struct { VMScaleSetEnabled *bool } -// VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get -// method. -type VirtualMachineExtensionImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes -// method. -type VirtualMachineExtensionImagesClientListTypesOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions -// method. -type VirtualMachineExtensionImagesClientListVersionsOptions struct { - // The filter to apply on the operation. - Filter *string - Orderby *string - Top *int32 -} - // VirtualMachineExtensionInstanceView - The instance view of a virtual machine extension. type VirtualMachineExtensionInstanceView struct { // The virtual machine extension name. @@ -7213,40 +6138,6 @@ type VirtualMachineExtensionUpdateProperties struct { TypeHandlerVersion *string } -// VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete -// method. -type VirtualMachineExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate -// method. -type VirtualMachineExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get method. -type VirtualMachineExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List -// method. -type VirtualMachineExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - // VirtualMachineExtensionsListResult - The List Extension operation response type VirtualMachineExtensionsListResult struct { // The list of extensions @@ -7366,78 +6257,6 @@ type VirtualMachineImageResource struct { Tags map[string]*string } -// VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get method. -type VirtualMachineImagesClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone -// method. -type VirtualMachineImagesClientListByEdgeZoneOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers -// method. -type VirtualMachineImagesClientListOffersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List method. -type VirtualMachineImagesClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string - Orderby *string - Top *int32 -} - -// VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers -// method. -type VirtualMachineImagesClientListPublishersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs -// method. -type VirtualMachineImagesClientListSKUsOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get -// method. -type VirtualMachineImagesEdgeZoneClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers -// method. -type VirtualMachineImagesEdgeZoneClientListOffersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List -// method. -type VirtualMachineImagesEdgeZoneClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string - // Specifies the order of the results returned. Formatted as an OData query. - Orderby *string - // An integer value specifying the number of images to return that matches supplied values. - Top *int32 -} - -// VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers -// method. -type VirtualMachineImagesEdgeZoneClientListPublishersOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs -// method. -type VirtualMachineImagesEdgeZoneClientListSKUsOptions struct { - // placeholder for future optional parameters -} - // VirtualMachineInstallPatchesParameters - Input for InstallPatches as directly received by the API type VirtualMachineInstallPatchesParameters struct { // REQUIRED; Defines when it is acceptable to reboot a VM during a software update operation. @@ -7977,53 +6796,6 @@ type VirtualMachineRunCommandUpdate struct { Tags map[string]*string } -// VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate -// method. -type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete -// method. -type VirtualMachineRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate -// method. -type VirtualMachineRunCommandsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine -// method. -type VirtualMachineRunCommandsClientGetByVirtualMachineOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get -// method. -type VirtualMachineRunCommandsClientGetOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager -// method. -type VirtualMachineRunCommandsClientListByVirtualMachineOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager -// method. -type VirtualMachineRunCommandsClientListOptions struct { - // placeholder for future optional parameters -} - // VirtualMachineRunCommandsListResult - The List run command operation response type VirtualMachineRunCommandsListResult struct { // REQUIRED; The list of run commands @@ -8212,40 +6984,6 @@ type VirtualMachineScaleSetExtensionUpdate struct { Type *string } -// VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete -// method. -type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate -// method. -type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get -// method. -type VirtualMachineScaleSetExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager -// method. -type VirtualMachineScaleSetExtensionsClientListOptions struct { - // placeholder for future optional parameters -} - // VirtualMachineScaleSetHardwareProfile - Specifies the hardware settings for the virtual machine scale set. type VirtualMachineScaleSetHardwareProfile struct { // Specifies the properties for customizing the size of the virtual machine. Minimum api-version: 2021-11-01. Please follow @@ -8704,33 +7442,6 @@ type VirtualMachineScaleSetReimageParameters struct { TempDisk *bool } -// VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade -// method. -type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest -// method. -type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions struct { - // placeholder for future optional parameters -} - // VirtualMachineScaleSetSKU - Describes an available virtual machine scale set sku. type VirtualMachineScaleSetSKU struct { // READ-ONLY; Specifies the number of virtual machines in the scale set. @@ -9136,41 +7847,6 @@ type VirtualMachineScaleSetVMExtensionUpdate struct { Type *string } -// VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get -// method. -type VirtualMachineScaleSetVMExtensionsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List -// method. -type VirtualMachineScaleSetVMExtensionsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - // VirtualMachineScaleSetVMExtensionsListResult - The List VMSS VM Extension operation response type VirtualMachineScaleSetVMExtensionsListResult struct { // The list of VMSS VM extensions @@ -9439,355 +8115,6 @@ type VirtualMachineScaleSetVMReimageParameters struct { TempDisk *bool } -// VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get -// method. -type VirtualMachineScaleSetVMRunCommandsClientGetOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager -// method. -type VirtualMachineScaleSetVMRunCommandsClientListOptions struct { - // The expand expression to apply on the operation. - Expand *string -} - -// VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate -// method. -type VirtualMachineScaleSetVMsClientBeginDeallocateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete -// method. -type VirtualMachineScaleSetVMsClientBeginDeleteOptions struct { - // Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) - ForceDeletion *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance -// method. -type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff -// method. -type VirtualMachineScaleSetVMsClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool -} - -// VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy -// method. -type VirtualMachineScaleSetVMsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll -// method. -type VirtualMachineScaleSetVMsClientBeginReimageAllOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage -// method. -type VirtualMachineScaleSetVMsClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // Parameters for the Reimaging Virtual machine in ScaleSet. - VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters -} - -// VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart -// method. -type VirtualMachineScaleSetVMsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand -// method. -type VirtualMachineScaleSetVMsClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart -// method. -type VirtualMachineScaleSetVMsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate -// method. -type VirtualMachineScaleSetVMsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView -// method. -type VirtualMachineScaleSetVMsClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get -// method. -type VirtualMachineScaleSetVMsClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. - // 'UserData' will retrieve the UserData of the virtual machine. - Expand *InstanceViewTypes -} - -// VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager -// method. -type VirtualMachineScaleSetVMsClientListOptions struct { - // The expand expression to apply to the operation. Allowed values are 'instanceView'. - Expand *string - // The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', - // 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq - // false'. - Filter *string - // The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. - Select *string -} - -// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData -// method. -type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions struct { - // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs - // will be generated with a default expiration duration of 120 minutes. - SasURIExpirationTimeInMinutes *int32 -} - -// VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction -// method. -type VirtualMachineScaleSetVMsClientSimulateEvictionOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate -// method. -type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate -// method. -type VirtualMachineScaleSetsClientBeginDeallocateOptions struct { - // Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible - // OrchestrationMode only) - Hibernate *bool - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances -// method. -type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions struct { - // Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview) - ForceDeletion *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete -// method. -type VirtualMachineScaleSetsClientBeginDeleteOptions struct { - // Optional parameter to force delete a VM scale set. (Feature in Preview) - ForceDeletion *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance -// method. -type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff -// method. -type VirtualMachineScaleSetsClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply -// method. -type VirtualMachineScaleSetsClientBeginReapplyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy -// method. -type VirtualMachineScaleSetsClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll -// method. -type VirtualMachineScaleSetsClientBeginReimageAllOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage -// method. -type VirtualMachineScaleSetsClientBeginReimageOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // Parameters for Reimaging VM ScaleSet. - VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters -} - -// VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart -// method. -type VirtualMachineScaleSetsClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState -// method. -type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart -// method. -type VirtualMachineScaleSetsClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // A list of virtual machine instance IDs from the VM scale set. - VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs -} - -// VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances -// method. -type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate -// method. -type VirtualMachineScaleSetsClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup -// method. -type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional parameters -// for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method. -type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions struct { - // The placement group id for which the manual recovery walk is requested. - PlacementGroupID *string - // The zone in which the manual recovery walk is requested for cross zone virtual machine scale set - Zone *string -} - -// VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView -// method. -type VirtualMachineScaleSetsClientGetInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager -// method. -type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get method. -type VirtualMachineScaleSetsClientGetOptions struct { - // The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was - // provided by the user during the VM scale set Create/Update operation - Expand *ExpandTypesForGetVMScaleSets -} - -// VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager -// method. -type VirtualMachineScaleSetsClientListAllOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager -// method. -type VirtualMachineScaleSetsClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager -// method. -type VirtualMachineScaleSetsClientListOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager -// method. -type VirtualMachineScaleSetsClientListSKUsOptions struct { - // placeholder for future optional parameters -} - // VirtualMachineSize - Describes the properties of a VM size. type VirtualMachineSize struct { // The maximum number of data disks that can be attached to the virtual machine size. @@ -9817,11 +8144,6 @@ type VirtualMachineSizeListResult struct { Value []*VirtualMachineSize } -// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager method. -type VirtualMachineSizesClientListOptions struct { - // placeholder for future optional parameters -} - // VirtualMachineSoftwarePatchProperties - Describes the properties of a Virtual Machine software patch. type VirtualMachineSoftwarePatchProperties struct { // READ-ONLY; The activity ID of the operation that produced this result. It is used to correlate across CRP and extension @@ -9887,187 +8209,6 @@ type VirtualMachineUpdate struct { Zones []*string } -// VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches -// method. -type VirtualMachinesClientBeginAssessPatchesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture method. -type VirtualMachinesClientBeginCaptureOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks -// method. -type VirtualMachinesClientBeginConvertToManagedDisksOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate -// method. -type VirtualMachinesClientBeginCreateOrUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate -// method. -type VirtualMachinesClientBeginDeallocateOptions struct { - // Optional parameter to hibernate a virtual machine. (Feature in Preview) - Hibernate *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method. -type VirtualMachinesClientBeginDeleteOptions struct { - // Optional parameter to force delete virtual machines. - ForceDeletion *bool - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches -// method. -type VirtualMachinesClientBeginInstallPatchesOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance -// method. -type VirtualMachinesClientBeginPerformMaintenanceOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff -// method. -type VirtualMachinesClientBeginPowerOffOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string - // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false - // indicates otherwise. Default value for this flag is false if not specified - SkipShutdown *bool -} - -// VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply method. -type VirtualMachinesClientBeginReapplyOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy -// method. -type VirtualMachinesClientBeginRedeployOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage method. -type VirtualMachinesClientBeginReimageOptions struct { - // Parameters supplied to the Reimage Virtual Machine operation. - Parameters *VirtualMachineReimageParameters - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method. -type VirtualMachinesClientBeginRestartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand -// method. -type VirtualMachinesClientBeginRunCommandOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method. -type VirtualMachinesClientBeginStartOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method. -type VirtualMachinesClientBeginUpdateOptions struct { - // Resumes the LRO from the provided token. - ResumeToken string -} - -// VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize method. -type VirtualMachinesClientGeneralizeOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. -type VirtualMachinesClientGetOptions struct { - // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual - // machine that is managed by the platform and can change outside of control - // plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user - // during the VM Create/Update operation. - Expand *InstanceViewTypes -} - -// VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView method. -type VirtualMachinesClientInstanceViewOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager method. -type VirtualMachinesClientListAllOptions struct { - // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this - // can only be specified if a valid $filter option is specified - Expand *ExpandTypesForListVMs - // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq - // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - Filter *string - // statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. - StatusOnly *string -} - -// VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager -// method. -type VirtualMachinesClientListAvailableSizesOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager -// method. -type VirtualMachinesClientListByLocationOptions struct { - // placeholder for future optional parameters -} - -// VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method. -type VirtualMachinesClientListOptions struct { - // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this - // can only be specified if a valid $filter option is specified - Expand *ExpandTypeForListVMs - // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq - // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' - Filter *string -} - -// VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData -// method. -type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions struct { - // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs - // will be generated with a default expiration duration of 120 minutes. - SasURIExpirationTimeInMinutes *int32 -} - -// VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction -// method. -type VirtualMachinesClientSimulateEvictionOptions struct { - // placeholder for future optional parameters -} - // WinRMConfiguration - Describes Windows Remote Management configuration of the VM type WinRMConfiguration struct { // The list of Windows Remote Management listeners diff --git a/sdk/resourcemanager/compute/armcompute/options.go b/sdk/resourcemanager/compute/armcompute/options.go new file mode 100644 index 000000000000..39d7b0f15d02 --- /dev/null +++ b/sdk/resourcemanager/compute/armcompute/options.go @@ -0,0 +1,1901 @@ +//go:build go1.18 +// +build go1.18 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. DO NOT EDIT. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +package armcompute + +// AvailabilitySetsClientCreateOrUpdateOptions contains the optional parameters for the AvailabilitySetsClient.CreateOrUpdate +// method. +type AvailabilitySetsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// AvailabilitySetsClientDeleteOptions contains the optional parameters for the AvailabilitySetsClient.Delete method. +type AvailabilitySetsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// AvailabilitySetsClientGetOptions contains the optional parameters for the AvailabilitySetsClient.Get method. +type AvailabilitySetsClientGetOptions struct { + // placeholder for future optional parameters +} + +// AvailabilitySetsClientListAvailableSizesOptions contains the optional parameters for the AvailabilitySetsClient.NewListAvailableSizesPager +// method. +type AvailabilitySetsClientListAvailableSizesOptions struct { + // placeholder for future optional parameters +} + +// AvailabilitySetsClientListBySubscriptionOptions contains the optional parameters for the AvailabilitySetsClient.NewListBySubscriptionPager +// method. +type AvailabilitySetsClientListBySubscriptionOptions struct { + // The expand expression to apply to the operation. Allowed values are 'instanceView'. + Expand *string +} + +// AvailabilitySetsClientListOptions contains the optional parameters for the AvailabilitySetsClient.NewListPager method. +type AvailabilitySetsClientListOptions struct { + // placeholder for future optional parameters +} + +// AvailabilitySetsClientUpdateOptions contains the optional parameters for the AvailabilitySetsClient.Update method. +type AvailabilitySetsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// CapacityReservationGroupsClientCreateOrUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.CreateOrUpdate +// method. +type CapacityReservationGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// CapacityReservationGroupsClientDeleteOptions contains the optional parameters for the CapacityReservationGroupsClient.Delete +// method. +type CapacityReservationGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// CapacityReservationGroupsClientGetOptions contains the optional parameters for the CapacityReservationGroupsClient.Get +// method. +type CapacityReservationGroupsClientGetOptions struct { + // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the capacity + // reservations under the capacity reservation group which is a snapshot of the + // runtime properties of a capacity reservation that is managed by the platform and can change outside of control plane operations. + Expand *CapacityReservationGroupInstanceViewTypes +} + +// CapacityReservationGroupsClientListByResourceGroupOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListByResourceGroupPager +// method. +type CapacityReservationGroupsClientListByResourceGroupOptions struct { + // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet + // VM Instance or both resource Ids which are associated to capacity + // reservation group in the response. + Expand *ExpandTypesForGetCapacityReservationGroups +} + +// CapacityReservationGroupsClientListBySubscriptionOptions contains the optional parameters for the CapacityReservationGroupsClient.NewListBySubscriptionPager +// method. +type CapacityReservationGroupsClientListBySubscriptionOptions struct { + // The expand expression to apply on the operation. Based on the expand param(s) specified we return Virtual Machine or ScaleSet + // VM Instance or both resource Ids which are associated to capacity + // reservation group in the response. + Expand *ExpandTypesForGetCapacityReservationGroups +} + +// CapacityReservationGroupsClientUpdateOptions contains the optional parameters for the CapacityReservationGroupsClient.Update +// method. +type CapacityReservationGroupsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// CapacityReservationsClientBeginCreateOrUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginCreateOrUpdate +// method. +type CapacityReservationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CapacityReservationsClientBeginDeleteOptions contains the optional parameters for the CapacityReservationsClient.BeginDelete +// method. +type CapacityReservationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CapacityReservationsClientBeginUpdateOptions contains the optional parameters for the CapacityReservationsClient.BeginUpdate +// method. +type CapacityReservationsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CapacityReservationsClientGetOptions contains the optional parameters for the CapacityReservationsClient.Get method. +type CapacityReservationsClientGetOptions struct { + // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the capacity + // reservation that is managed by the platform and can change outside of + // control plane operations. + Expand *CapacityReservationInstanceViewTypes +} + +// CapacityReservationsClientListByCapacityReservationGroupOptions contains the optional parameters for the CapacityReservationsClient.NewListByCapacityReservationGroupPager +// method. +type CapacityReservationsClientListByCapacityReservationGroupOptions struct { + // placeholder for future optional parameters +} + +// CloudServiceOperatingSystemsClientGetOSFamilyOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSFamily +// method. +type CloudServiceOperatingSystemsClientGetOSFamilyOptions struct { + // placeholder for future optional parameters +} + +// CloudServiceOperatingSystemsClientGetOSVersionOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.GetOSVersion +// method. +type CloudServiceOperatingSystemsClientGetOSVersionOptions struct { + // placeholder for future optional parameters +} + +// CloudServiceOperatingSystemsClientListOSFamiliesOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSFamiliesPager +// method. +type CloudServiceOperatingSystemsClientListOSFamiliesOptions struct { + // placeholder for future optional parameters +} + +// CloudServiceOperatingSystemsClientListOSVersionsOptions contains the optional parameters for the CloudServiceOperatingSystemsClient.NewListOSVersionsPager +// method. +type CloudServiceOperatingSystemsClientListOSVersionsOptions struct { + // placeholder for future optional parameters +} + +// CloudServiceRoleInstancesClientBeginDeleteOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginDelete +// method. +type CloudServiceRoleInstancesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServiceRoleInstancesClientBeginRebuildOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRebuild +// method. +type CloudServiceRoleInstancesClientBeginRebuildOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServiceRoleInstancesClientBeginReimageOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginReimage +// method. +type CloudServiceRoleInstancesClientBeginReimageOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServiceRoleInstancesClientBeginRestartOptions contains the optional parameters for the CloudServiceRoleInstancesClient.BeginRestart +// method. +type CloudServiceRoleInstancesClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServiceRoleInstancesClientGetInstanceViewOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetInstanceView +// method. +type CloudServiceRoleInstancesClientGetInstanceViewOptions struct { + // placeholder for future optional parameters +} + +// CloudServiceRoleInstancesClientGetOptions contains the optional parameters for the CloudServiceRoleInstancesClient.Get +// method. +type CloudServiceRoleInstancesClientGetOptions struct { + // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + Expand *InstanceViewTypes +} + +// CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions contains the optional parameters for the CloudServiceRoleInstancesClient.GetRemoteDesktopFile +// method. +type CloudServiceRoleInstancesClientGetRemoteDesktopFileOptions struct { + // placeholder for future optional parameters +} + +// CloudServiceRoleInstancesClientListOptions contains the optional parameters for the CloudServiceRoleInstancesClient.NewListPager +// method. +type CloudServiceRoleInstancesClientListOptions struct { + // The expand expression to apply to the operation. 'UserData' is not supported for cloud services. + Expand *InstanceViewTypes +} + +// CloudServiceRolesClientGetOptions contains the optional parameters for the CloudServiceRolesClient.Get method. +type CloudServiceRolesClientGetOptions struct { + // placeholder for future optional parameters +} + +// CloudServiceRolesClientListOptions contains the optional parameters for the CloudServiceRolesClient.NewListPager method. +type CloudServiceRolesClientListOptions struct { + // placeholder for future optional parameters +} + +// CloudServicesClientBeginCreateOrUpdateOptions contains the optional parameters for the CloudServicesClient.BeginCreateOrUpdate +// method. +type CloudServicesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientBeginDeleteInstancesOptions contains the optional parameters for the CloudServicesClient.BeginDeleteInstances +// method. +type CloudServicesClientBeginDeleteInstancesOptions struct { + // List of cloud service role instance names. + Parameters *RoleInstances + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientBeginDeleteOptions contains the optional parameters for the CloudServicesClient.BeginDelete method. +type CloudServicesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientBeginPowerOffOptions contains the optional parameters for the CloudServicesClient.BeginPowerOff method. +type CloudServicesClientBeginPowerOffOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientBeginRebuildOptions contains the optional parameters for the CloudServicesClient.BeginRebuild method. +type CloudServicesClientBeginRebuildOptions struct { + // List of cloud service role instance names. + Parameters *RoleInstances + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientBeginReimageOptions contains the optional parameters for the CloudServicesClient.BeginReimage method. +type CloudServicesClientBeginReimageOptions struct { + // List of cloud service role instance names. + Parameters *RoleInstances + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientBeginRestartOptions contains the optional parameters for the CloudServicesClient.BeginRestart method. +type CloudServicesClientBeginRestartOptions struct { + // List of cloud service role instance names. + Parameters *RoleInstances + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientBeginStartOptions contains the optional parameters for the CloudServicesClient.BeginStart method. +type CloudServicesClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientBeginUpdateOptions contains the optional parameters for the CloudServicesClient.BeginUpdate method. +type CloudServicesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesClientGetInstanceViewOptions contains the optional parameters for the CloudServicesClient.GetInstanceView +// method. +type CloudServicesClientGetInstanceViewOptions struct { + // placeholder for future optional parameters +} + +// CloudServicesClientGetOptions contains the optional parameters for the CloudServicesClient.Get method. +type CloudServicesClientGetOptions struct { + // placeholder for future optional parameters +} + +// CloudServicesClientListAllOptions contains the optional parameters for the CloudServicesClient.NewListAllPager method. +type CloudServicesClientListAllOptions struct { + // placeholder for future optional parameters +} + +// CloudServicesClientListOptions contains the optional parameters for the CloudServicesClient.NewListPager method. +type CloudServicesClientListOptions struct { + // placeholder for future optional parameters +} + +// CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.BeginWalkUpdateDomain +// method. +type CloudServicesUpdateDomainClientBeginWalkUpdateDomainOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// CloudServicesUpdateDomainClientGetUpdateDomainOptions contains the optional parameters for the CloudServicesUpdateDomainClient.GetUpdateDomain +// method. +type CloudServicesUpdateDomainClientGetUpdateDomainOptions struct { + // placeholder for future optional parameters +} + +// CloudServicesUpdateDomainClientListUpdateDomainsOptions contains the optional parameters for the CloudServicesUpdateDomainClient.NewListUpdateDomainsPager +// method. +type CloudServicesUpdateDomainClientListUpdateDomainsOptions struct { + // placeholder for future optional parameters +} + +// CommunityGalleriesClientGetOptions contains the optional parameters for the CommunityGalleriesClient.Get method. +type CommunityGalleriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// CommunityGalleryImageVersionsClientGetOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.Get +// method. +type CommunityGalleryImageVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// CommunityGalleryImageVersionsClientListOptions contains the optional parameters for the CommunityGalleryImageVersionsClient.NewListPager +// method. +type CommunityGalleryImageVersionsClientListOptions struct { + // placeholder for future optional parameters +} + +// CommunityGalleryImagesClientGetOptions contains the optional parameters for the CommunityGalleryImagesClient.Get method. +type CommunityGalleryImagesClientGetOptions struct { + // placeholder for future optional parameters +} + +// CommunityGalleryImagesClientListOptions contains the optional parameters for the CommunityGalleryImagesClient.NewListPager +// method. +type CommunityGalleryImagesClientListOptions struct { + // placeholder for future optional parameters +} + +// DedicatedHostGroupsClientCreateOrUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.CreateOrUpdate +// method. +type DedicatedHostGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// DedicatedHostGroupsClientDeleteOptions contains the optional parameters for the DedicatedHostGroupsClient.Delete method. +type DedicatedHostGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// DedicatedHostGroupsClientGetOptions contains the optional parameters for the DedicatedHostGroupsClient.Get method. +type DedicatedHostGroupsClientGetOptions struct { + // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated + // hosts under the dedicated host group. 'UserData' is not supported for + // dedicated host group. + Expand *InstanceViewTypes +} + +// DedicatedHostGroupsClientListByResourceGroupOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListByResourceGroupPager +// method. +type DedicatedHostGroupsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DedicatedHostGroupsClientListBySubscriptionOptions contains the optional parameters for the DedicatedHostGroupsClient.NewListBySubscriptionPager +// method. +type DedicatedHostGroupsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// DedicatedHostGroupsClientUpdateOptions contains the optional parameters for the DedicatedHostGroupsClient.Update method. +type DedicatedHostGroupsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// DedicatedHostsClientBeginCreateOrUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginCreateOrUpdate +// method. +type DedicatedHostsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DedicatedHostsClientBeginDeleteOptions contains the optional parameters for the DedicatedHostsClient.BeginDelete method. +type DedicatedHostsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DedicatedHostsClientBeginRestartOptions contains the optional parameters for the DedicatedHostsClient.BeginRestart method. +type DedicatedHostsClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DedicatedHostsClientBeginUpdateOptions contains the optional parameters for the DedicatedHostsClient.BeginUpdate method. +type DedicatedHostsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DedicatedHostsClientGetOptions contains the optional parameters for the DedicatedHostsClient.Get method. +type DedicatedHostsClientGetOptions struct { + // The expand expression to apply on the operation. 'InstanceView' will retrieve the list of instance views of the dedicated + // host. 'UserData' is not supported for dedicated host. + Expand *InstanceViewTypes +} + +// DedicatedHostsClientListAvailableSizesOptions contains the optional parameters for the DedicatedHostsClient.NewListAvailableSizesPager +// method. +type DedicatedHostsClientListAvailableSizesOptions struct { + // placeholder for future optional parameters +} + +// DedicatedHostsClientListByHostGroupOptions contains the optional parameters for the DedicatedHostsClient.NewListByHostGroupPager +// method. +type DedicatedHostsClientListByHostGroupOptions struct { + // placeholder for future optional parameters +} + +// DiskAccessesClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginCreateOrUpdate +// method. +type DiskAccessesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginDeleteAPrivateEndpointConnection +// method. +type DiskAccessesClientBeginDeleteAPrivateEndpointConnectionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskAccessesClientBeginDeleteOptions contains the optional parameters for the DiskAccessesClient.BeginDelete method. +type DiskAccessesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.BeginUpdateAPrivateEndpointConnection +// method. +type DiskAccessesClientBeginUpdateAPrivateEndpointConnectionOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskAccessesClientBeginUpdateOptions contains the optional parameters for the DiskAccessesClient.BeginUpdate method. +type DiskAccessesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskAccessesClientGetAPrivateEndpointConnectionOptions contains the optional parameters for the DiskAccessesClient.GetAPrivateEndpointConnection +// method. +type DiskAccessesClientGetAPrivateEndpointConnectionOptions struct { + // placeholder for future optional parameters +} + +// DiskAccessesClientGetOptions contains the optional parameters for the DiskAccessesClient.Get method. +type DiskAccessesClientGetOptions struct { + // placeholder for future optional parameters +} + +// DiskAccessesClientGetPrivateLinkResourcesOptions contains the optional parameters for the DiskAccessesClient.GetPrivateLinkResources +// method. +type DiskAccessesClientGetPrivateLinkResourcesOptions struct { + // placeholder for future optional parameters +} + +// DiskAccessesClientListByResourceGroupOptions contains the optional parameters for the DiskAccessesClient.NewListByResourceGroupPager +// method. +type DiskAccessesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DiskAccessesClientListOptions contains the optional parameters for the DiskAccessesClient.NewListPager method. +type DiskAccessesClientListOptions struct { + // placeholder for future optional parameters +} + +// DiskAccessesClientListPrivateEndpointConnectionsOptions contains the optional parameters for the DiskAccessesClient.NewListPrivateEndpointConnectionsPager +// method. +type DiskAccessesClientListPrivateEndpointConnectionsOptions struct { + // placeholder for future optional parameters +} + +// DiskEncryptionSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginCreateOrUpdate +// method. +type DiskEncryptionSetsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskEncryptionSetsClientBeginDeleteOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginDelete +// method. +type DiskEncryptionSetsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskEncryptionSetsClientBeginUpdateOptions contains the optional parameters for the DiskEncryptionSetsClient.BeginUpdate +// method. +type DiskEncryptionSetsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskEncryptionSetsClientGetOptions contains the optional parameters for the DiskEncryptionSetsClient.Get method. +type DiskEncryptionSetsClientGetOptions struct { + // placeholder for future optional parameters +} + +// DiskEncryptionSetsClientListAssociatedResourcesOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListAssociatedResourcesPager +// method. +type DiskEncryptionSetsClientListAssociatedResourcesOptions struct { + // placeholder for future optional parameters +} + +// DiskEncryptionSetsClientListByResourceGroupOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListByResourceGroupPager +// method. +type DiskEncryptionSetsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DiskEncryptionSetsClientListOptions contains the optional parameters for the DiskEncryptionSetsClient.NewListPager method. +type DiskEncryptionSetsClientListOptions struct { + // placeholder for future optional parameters +} + +// DiskRestorePointClientBeginGrantAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginGrantAccess +// method. +type DiskRestorePointClientBeginGrantAccessOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskRestorePointClientBeginRevokeAccessOptions contains the optional parameters for the DiskRestorePointClient.BeginRevokeAccess +// method. +type DiskRestorePointClientBeginRevokeAccessOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DiskRestorePointClientGetOptions contains the optional parameters for the DiskRestorePointClient.Get method. +type DiskRestorePointClientGetOptions struct { + // placeholder for future optional parameters +} + +// DiskRestorePointClientListByRestorePointOptions contains the optional parameters for the DiskRestorePointClient.NewListByRestorePointPager +// method. +type DiskRestorePointClientListByRestorePointOptions struct { + // placeholder for future optional parameters +} + +// DisksClientBeginCreateOrUpdateOptions contains the optional parameters for the DisksClient.BeginCreateOrUpdate method. +type DisksClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DisksClientBeginDeleteOptions contains the optional parameters for the DisksClient.BeginDelete method. +type DisksClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DisksClientBeginGrantAccessOptions contains the optional parameters for the DisksClient.BeginGrantAccess method. +type DisksClientBeginGrantAccessOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DisksClientBeginRevokeAccessOptions contains the optional parameters for the DisksClient.BeginRevokeAccess method. +type DisksClientBeginRevokeAccessOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DisksClientBeginUpdateOptions contains the optional parameters for the DisksClient.BeginUpdate method. +type DisksClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// DisksClientGetOptions contains the optional parameters for the DisksClient.Get method. +type DisksClientGetOptions struct { + // placeholder for future optional parameters +} + +// DisksClientListByResourceGroupOptions contains the optional parameters for the DisksClient.NewListByResourceGroupPager +// method. +type DisksClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// DisksClientListOptions contains the optional parameters for the DisksClient.NewListPager method. +type DisksClientListOptions struct { + // placeholder for future optional parameters +} + +// GalleriesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleriesClient.BeginCreateOrUpdate +// method. +type GalleriesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleriesClientBeginDeleteOptions contains the optional parameters for the GalleriesClient.BeginDelete method. +type GalleriesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleriesClientBeginUpdateOptions contains the optional parameters for the GalleriesClient.BeginUpdate method. +type GalleriesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleriesClientGetOptions contains the optional parameters for the GalleriesClient.Get method. +type GalleriesClientGetOptions struct { + // The expand query option to apply on the operation. + Expand *GalleryExpandParams + + // The select expression to apply on the operation. + Select *SelectPermissions +} + +// GalleriesClientListByResourceGroupOptions contains the optional parameters for the GalleriesClient.NewListByResourceGroupPager +// method. +type GalleriesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// GalleriesClientListOptions contains the optional parameters for the GalleriesClient.NewListPager method. +type GalleriesClientListOptions struct { + // placeholder for future optional parameters +} + +// GalleryApplicationVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginCreateOrUpdate +// method. +type GalleryApplicationVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryApplicationVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginDelete +// method. +type GalleryApplicationVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryApplicationVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationVersionsClient.BeginUpdate +// method. +type GalleryApplicationVersionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryApplicationVersionsClientGetOptions contains the optional parameters for the GalleryApplicationVersionsClient.Get +// method. +type GalleryApplicationVersionsClientGetOptions struct { + // The expand expression to apply on the operation. + Expand *ReplicationStatusTypes +} + +// GalleryApplicationVersionsClientListByGalleryApplicationOptions contains the optional parameters for the GalleryApplicationVersionsClient.NewListByGalleryApplicationPager +// method. +type GalleryApplicationVersionsClientListByGalleryApplicationOptions struct { + // placeholder for future optional parameters +} + +// GalleryApplicationsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginCreateOrUpdate +// method. +type GalleryApplicationsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryApplicationsClientBeginDeleteOptions contains the optional parameters for the GalleryApplicationsClient.BeginDelete +// method. +type GalleryApplicationsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryApplicationsClientBeginUpdateOptions contains the optional parameters for the GalleryApplicationsClient.BeginUpdate +// method. +type GalleryApplicationsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryApplicationsClientGetOptions contains the optional parameters for the GalleryApplicationsClient.Get method. +type GalleryApplicationsClientGetOptions struct { + // placeholder for future optional parameters +} + +// GalleryApplicationsClientListByGalleryOptions contains the optional parameters for the GalleryApplicationsClient.NewListByGalleryPager +// method. +type GalleryApplicationsClientListByGalleryOptions struct { + // placeholder for future optional parameters +} + +// GalleryImageVersionsClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginCreateOrUpdate +// method. +type GalleryImageVersionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryImageVersionsClientBeginDeleteOptions contains the optional parameters for the GalleryImageVersionsClient.BeginDelete +// method. +type GalleryImageVersionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryImageVersionsClientBeginUpdateOptions contains the optional parameters for the GalleryImageVersionsClient.BeginUpdate +// method. +type GalleryImageVersionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryImageVersionsClientGetOptions contains the optional parameters for the GalleryImageVersionsClient.Get method. +type GalleryImageVersionsClientGetOptions struct { + // The expand expression to apply on the operation. + Expand *ReplicationStatusTypes +} + +// GalleryImageVersionsClientListByGalleryImageOptions contains the optional parameters for the GalleryImageVersionsClient.NewListByGalleryImagePager +// method. +type GalleryImageVersionsClientListByGalleryImageOptions struct { + // placeholder for future optional parameters +} + +// GalleryImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginCreateOrUpdate +// method. +type GalleryImagesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryImagesClientBeginDeleteOptions contains the optional parameters for the GalleryImagesClient.BeginDelete method. +type GalleryImagesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryImagesClientBeginUpdateOptions contains the optional parameters for the GalleryImagesClient.BeginUpdate method. +type GalleryImagesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// GalleryImagesClientGetOptions contains the optional parameters for the GalleryImagesClient.Get method. +type GalleryImagesClientGetOptions struct { + // placeholder for future optional parameters +} + +// GalleryImagesClientListByGalleryOptions contains the optional parameters for the GalleryImagesClient.NewListByGalleryPager +// method. +type GalleryImagesClientListByGalleryOptions struct { + // placeholder for future optional parameters +} + +// GallerySharingProfileClientBeginUpdateOptions contains the optional parameters for the GallerySharingProfileClient.BeginUpdate +// method. +type GallerySharingProfileClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ImagesClientBeginCreateOrUpdateOptions contains the optional parameters for the ImagesClient.BeginCreateOrUpdate method. +type ImagesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ImagesClientBeginDeleteOptions contains the optional parameters for the ImagesClient.BeginDelete method. +type ImagesClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ImagesClientBeginUpdateOptions contains the optional parameters for the ImagesClient.BeginUpdate method. +type ImagesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// ImagesClientGetOptions contains the optional parameters for the ImagesClient.Get method. +type ImagesClientGetOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// ImagesClientListByResourceGroupOptions contains the optional parameters for the ImagesClient.NewListByResourceGroupPager +// method. +type ImagesClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ImagesClientListOptions contains the optional parameters for the ImagesClient.NewListPager method. +type ImagesClientListOptions struct { + // placeholder for future optional parameters +} + +// LogAnalyticsClientBeginExportRequestRateByIntervalOptions contains the optional parameters for the LogAnalyticsClient.BeginExportRequestRateByInterval +// method. +type LogAnalyticsClientBeginExportRequestRateByIntervalOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// LogAnalyticsClientBeginExportThrottledRequestsOptions contains the optional parameters for the LogAnalyticsClient.BeginExportThrottledRequests +// method. +type LogAnalyticsClientBeginExportThrottledRequestsOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// OperationsClientListOptions contains the optional parameters for the OperationsClient.NewListPager method. +type OperationsClientListOptions struct { + // placeholder for future optional parameters +} + +// ProximityPlacementGroupsClientCreateOrUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.CreateOrUpdate +// method. +type ProximityPlacementGroupsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// ProximityPlacementGroupsClientDeleteOptions contains the optional parameters for the ProximityPlacementGroupsClient.Delete +// method. +type ProximityPlacementGroupsClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// ProximityPlacementGroupsClientGetOptions contains the optional parameters for the ProximityPlacementGroupsClient.Get method. +type ProximityPlacementGroupsClientGetOptions struct { + // includeColocationStatus=true enables fetching the colocation status of all the resources in the proximity placement group. + IncludeColocationStatus *string +} + +// ProximityPlacementGroupsClientListByResourceGroupOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListByResourceGroupPager +// method. +type ProximityPlacementGroupsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// ProximityPlacementGroupsClientListBySubscriptionOptions contains the optional parameters for the ProximityPlacementGroupsClient.NewListBySubscriptionPager +// method. +type ProximityPlacementGroupsClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// ProximityPlacementGroupsClientUpdateOptions contains the optional parameters for the ProximityPlacementGroupsClient.Update +// method. +type ProximityPlacementGroupsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// ResourceSKUsClientListOptions contains the optional parameters for the ResourceSKUsClient.NewListPager method. +type ResourceSKUsClientListOptions struct { + // The filter to apply on the operation. Only location filter is supported currently. + Filter *string + + // To Include Extended Locations information or not in the response. + IncludeExtendedLocations *string +} + +// RestorePointCollectionsClientBeginDeleteOptions contains the optional parameters for the RestorePointCollectionsClient.BeginDelete +// method. +type RestorePointCollectionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RestorePointCollectionsClientCreateOrUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.CreateOrUpdate +// method. +type RestorePointCollectionsClientCreateOrUpdateOptions struct { + // placeholder for future optional parameters +} + +// RestorePointCollectionsClientGetOptions contains the optional parameters for the RestorePointCollectionsClient.Get method. +type RestorePointCollectionsClientGetOptions struct { + // The expand expression to apply on the operation. If expand=restorePoints, server will return all contained restore points + // in the restorePointCollection. + Expand *RestorePointCollectionExpandOptions +} + +// RestorePointCollectionsClientListAllOptions contains the optional parameters for the RestorePointCollectionsClient.NewListAllPager +// method. +type RestorePointCollectionsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// RestorePointCollectionsClientListOptions contains the optional parameters for the RestorePointCollectionsClient.NewListPager +// method. +type RestorePointCollectionsClientListOptions struct { + // placeholder for future optional parameters +} + +// RestorePointCollectionsClientUpdateOptions contains the optional parameters for the RestorePointCollectionsClient.Update +// method. +type RestorePointCollectionsClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// RestorePointsClientBeginCreateOptions contains the optional parameters for the RestorePointsClient.BeginCreate method. +type RestorePointsClientBeginCreateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RestorePointsClientBeginDeleteOptions contains the optional parameters for the RestorePointsClient.BeginDelete method. +type RestorePointsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// RestorePointsClientGetOptions contains the optional parameters for the RestorePointsClient.Get method. +type RestorePointsClientGetOptions struct { + // The expand expression to apply on the operation. 'InstanceView' retrieves information about the run-time state of a restore + // point. + Expand *RestorePointExpandOptions +} + +// SSHPublicKeysClientCreateOptions contains the optional parameters for the SSHPublicKeysClient.Create method. +type SSHPublicKeysClientCreateOptions struct { + // placeholder for future optional parameters +} + +// SSHPublicKeysClientDeleteOptions contains the optional parameters for the SSHPublicKeysClient.Delete method. +type SSHPublicKeysClientDeleteOptions struct { + // placeholder for future optional parameters +} + +// SSHPublicKeysClientGenerateKeyPairOptions contains the optional parameters for the SSHPublicKeysClient.GenerateKeyPair +// method. +type SSHPublicKeysClientGenerateKeyPairOptions struct { + // placeholder for future optional parameters +} + +// SSHPublicKeysClientGetOptions contains the optional parameters for the SSHPublicKeysClient.Get method. +type SSHPublicKeysClientGetOptions struct { + // placeholder for future optional parameters +} + +// SSHPublicKeysClientListByResourceGroupOptions contains the optional parameters for the SSHPublicKeysClient.NewListByResourceGroupPager +// method. +type SSHPublicKeysClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// SSHPublicKeysClientListBySubscriptionOptions contains the optional parameters for the SSHPublicKeysClient.NewListBySubscriptionPager +// method. +type SSHPublicKeysClientListBySubscriptionOptions struct { + // placeholder for future optional parameters +} + +// SSHPublicKeysClientUpdateOptions contains the optional parameters for the SSHPublicKeysClient.Update method. +type SSHPublicKeysClientUpdateOptions struct { + // placeholder for future optional parameters +} + +// SharedGalleriesClientGetOptions contains the optional parameters for the SharedGalleriesClient.Get method. +type SharedGalleriesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SharedGalleriesClientListOptions contains the optional parameters for the SharedGalleriesClient.NewListPager method. +type SharedGalleriesClientListOptions struct { + // The query parameter to decide what shared galleries to fetch when doing listing operations. + SharedTo *SharedToValues +} + +// SharedGalleryImageVersionsClientGetOptions contains the optional parameters for the SharedGalleryImageVersionsClient.Get +// method. +type SharedGalleryImageVersionsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SharedGalleryImageVersionsClientListOptions contains the optional parameters for the SharedGalleryImageVersionsClient.NewListPager +// method. +type SharedGalleryImageVersionsClientListOptions struct { + // The query parameter to decide what shared galleries to fetch when doing listing operations. + SharedTo *SharedToValues +} + +// SharedGalleryImagesClientGetOptions contains the optional parameters for the SharedGalleryImagesClient.Get method. +type SharedGalleryImagesClientGetOptions struct { + // placeholder for future optional parameters +} + +// SharedGalleryImagesClientListOptions contains the optional parameters for the SharedGalleryImagesClient.NewListPager method. +type SharedGalleryImagesClientListOptions struct { + // The query parameter to decide what shared galleries to fetch when doing listing operations. + SharedTo *SharedToValues +} + +// SnapshotsClientBeginCreateOrUpdateOptions contains the optional parameters for the SnapshotsClient.BeginCreateOrUpdate +// method. +type SnapshotsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientBeginDeleteOptions contains the optional parameters for the SnapshotsClient.BeginDelete method. +type SnapshotsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientBeginGrantAccessOptions contains the optional parameters for the SnapshotsClient.BeginGrantAccess method. +type SnapshotsClientBeginGrantAccessOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientBeginRevokeAccessOptions contains the optional parameters for the SnapshotsClient.BeginRevokeAccess method. +type SnapshotsClientBeginRevokeAccessOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientBeginUpdateOptions contains the optional parameters for the SnapshotsClient.BeginUpdate method. +type SnapshotsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// SnapshotsClientGetOptions contains the optional parameters for the SnapshotsClient.Get method. +type SnapshotsClientGetOptions struct { + // placeholder for future optional parameters +} + +// SnapshotsClientListByResourceGroupOptions contains the optional parameters for the SnapshotsClient.NewListByResourceGroupPager +// method. +type SnapshotsClientListByResourceGroupOptions struct { + // placeholder for future optional parameters +} + +// SnapshotsClientListOptions contains the optional parameters for the SnapshotsClient.NewListPager method. +type SnapshotsClientListOptions struct { + // placeholder for future optional parameters +} + +// UsageClientListOptions contains the optional parameters for the UsageClient.NewListPager method. +type UsageClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineExtensionImagesClientGetOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.Get +// method. +type VirtualMachineExtensionImagesClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineExtensionImagesClientListTypesOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListTypes +// method. +type VirtualMachineExtensionImagesClientListTypesOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineExtensionImagesClientListVersionsOptions contains the optional parameters for the VirtualMachineExtensionImagesClient.ListVersions +// method. +type VirtualMachineExtensionImagesClientListVersionsOptions struct { + // The filter to apply on the operation. + Filter *string + Orderby *string + Top *int32 +} + +// VirtualMachineExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginCreateOrUpdate +// method. +type VirtualMachineExtensionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginDelete +// method. +type VirtualMachineExtensionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineExtensionsClient.BeginUpdate +// method. +type VirtualMachineExtensionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineExtensionsClientGetOptions contains the optional parameters for the VirtualMachineExtensionsClient.Get method. +type VirtualMachineExtensionsClientGetOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineExtensionsClientListOptions contains the optional parameters for the VirtualMachineExtensionsClient.List +// method. +type VirtualMachineExtensionsClientListOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineImagesClientGetOptions contains the optional parameters for the VirtualMachineImagesClient.Get method. +type VirtualMachineImagesClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineImagesClientListByEdgeZoneOptions contains the optional parameters for the VirtualMachineImagesClient.ListByEdgeZone +// method. +type VirtualMachineImagesClientListByEdgeZoneOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineImagesClientListOffersOptions contains the optional parameters for the VirtualMachineImagesClient.ListOffers +// method. +type VirtualMachineImagesClientListOffersOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineImagesClientListOptions contains the optional parameters for the VirtualMachineImagesClient.List method. +type VirtualMachineImagesClientListOptions struct { + // The expand expression to apply on the operation. + Expand *string + Orderby *string + Top *int32 +} + +// VirtualMachineImagesClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesClient.ListPublishers +// method. +type VirtualMachineImagesClientListPublishersOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineImagesClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesClient.ListSKUs +// method. +type VirtualMachineImagesClientListSKUsOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineImagesEdgeZoneClientGetOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.Get +// method. +type VirtualMachineImagesEdgeZoneClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineImagesEdgeZoneClientListOffersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListOffers +// method. +type VirtualMachineImagesEdgeZoneClientListOffersOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineImagesEdgeZoneClientListOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.List +// method. +type VirtualMachineImagesEdgeZoneClientListOptions struct { + // The expand expression to apply on the operation. + Expand *string + + // Specifies the order of the results returned. Formatted as an OData query. + Orderby *string + + // An integer value specifying the number of images to return that matches supplied values. + Top *int32 +} + +// VirtualMachineImagesEdgeZoneClientListPublishersOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListPublishers +// method. +type VirtualMachineImagesEdgeZoneClientListPublishersOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineImagesEdgeZoneClientListSKUsOptions contains the optional parameters for the VirtualMachineImagesEdgeZoneClient.ListSKUs +// method. +type VirtualMachineImagesEdgeZoneClientListSKUsOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginCreateOrUpdate +// method. +type VirtualMachineRunCommandsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginDelete +// method. +type VirtualMachineRunCommandsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineRunCommandsClient.BeginUpdate +// method. +type VirtualMachineRunCommandsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineRunCommandsClientGetByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.GetByVirtualMachine +// method. +type VirtualMachineRunCommandsClientGetByVirtualMachineOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineRunCommandsClient.Get +// method. +type VirtualMachineRunCommandsClientGetOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineRunCommandsClientListByVirtualMachineOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListByVirtualMachinePager +// method. +type VirtualMachineRunCommandsClientListByVirtualMachineOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineRunCommandsClientListOptions contains the optional parameters for the VirtualMachineRunCommandsClient.NewListPager +// method. +type VirtualMachineRunCommandsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate +// method. +type VirtualMachineScaleSetExtensionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginDelete +// method. +type VirtualMachineScaleSetExtensionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.BeginUpdate +// method. +type VirtualMachineScaleSetExtensionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.Get +// method. +type VirtualMachineScaleSetExtensionsClientGetOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineScaleSetExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetExtensionsClient.NewListPager +// method. +type VirtualMachineScaleSetExtensionsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginCancel +// method. +type VirtualMachineScaleSetRollingUpgradesClientBeginCancelOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartExtensionUpgrade +// method. +type VirtualMachineScaleSetRollingUpgradesClientBeginStartExtensionUpgradeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.BeginStartOSUpgrade +// method. +type VirtualMachineScaleSetRollingUpgradesClientBeginStartOSUpgradeOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions contains the optional parameters for the VirtualMachineScaleSetRollingUpgradesClient.GetLatest +// method. +type VirtualMachineScaleSetRollingUpgradesClientGetLatestOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate +// method. +type VirtualMachineScaleSetVMExtensionsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginDelete +// method. +type VirtualMachineScaleSetVMExtensionsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.BeginUpdate +// method. +type VirtualMachineScaleSetVMExtensionsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMExtensionsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.Get +// method. +type VirtualMachineScaleSetVMExtensionsClientGetOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineScaleSetVMExtensionsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMExtensionsClient.List +// method. +type VirtualMachineScaleSetVMExtensionsClientListOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate +// method. +type VirtualMachineScaleSetVMRunCommandsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginDelete +// method. +type VirtualMachineScaleSetVMRunCommandsClientBeginDeleteOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate +// method. +type VirtualMachineScaleSetVMRunCommandsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMRunCommandsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.Get +// method. +type VirtualMachineScaleSetVMRunCommandsClientGetOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineScaleSetVMRunCommandsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMRunCommandsClient.NewListPager +// method. +type VirtualMachineScaleSetVMRunCommandsClientListOptions struct { + // The expand expression to apply on the operation. + Expand *string +} + +// VirtualMachineScaleSetVMsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDeallocate +// method. +type VirtualMachineScaleSetVMsClientBeginDeallocateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginDelete +// method. +type VirtualMachineScaleSetVMsClientBeginDeleteOptions struct { + // Optional parameter to force delete a virtual machine from a VM scale set. (Feature in Preview) + ForceDeletion *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPerformMaintenance +// method. +type VirtualMachineScaleSetVMsClientBeginPerformMaintenanceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginPowerOff +// method. +type VirtualMachineScaleSetVMsClientBeginPowerOffOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false + // indicates otherwise. Default value for this flag is false if not specified + SkipShutdown *bool +} + +// VirtualMachineScaleSetVMsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRedeploy +// method. +type VirtualMachineScaleSetVMsClientBeginRedeployOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimageAll +// method. +type VirtualMachineScaleSetVMsClientBeginReimageAllOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginReimage +// method. +type VirtualMachineScaleSetVMsClientBeginReimageOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // Parameters for the Reimaging Virtual machine in ScaleSet. + VMScaleSetVMReimageInput *VirtualMachineScaleSetVMReimageParameters +} + +// VirtualMachineScaleSetVMsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRestart +// method. +type VirtualMachineScaleSetVMsClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientBeginRunCommandOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginRunCommand +// method. +type VirtualMachineScaleSetVMsClientBeginRunCommandOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginStart +// method. +type VirtualMachineScaleSetVMsClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.BeginUpdate +// method. +type VirtualMachineScaleSetVMsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetVMsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.GetInstanceView +// method. +type VirtualMachineScaleSetVMsClientGetInstanceViewOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetVMsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.Get +// method. +type VirtualMachineScaleSetVMsClientGetOptions struct { + // The expand expression to apply on the operation. 'InstanceView' will retrieve the instance view of the virtual machine. + // 'UserData' will retrieve the UserData of the virtual machine. + Expand *InstanceViewTypes +} + +// VirtualMachineScaleSetVMsClientListOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.NewListPager +// method. +type VirtualMachineScaleSetVMsClientListOptions struct { + // The expand expression to apply to the operation. Allowed values are 'instanceView'. + Expand *string + + // The filter to apply to the operation. Allowed values are 'startswith(instanceView/statuses/code, 'PowerState') eq true', + // 'properties/latestModelApplied eq true', 'properties/latestModelApplied eq + // false'. + Filter *string + + // The list parameters. Allowed values are 'instanceView', 'instanceView/statuses'. + Select *string +} + +// VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData +// method. +type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataOptions struct { + // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs + // will be generated with a default expiration duration of 120 minutes. + SasURIExpirationTimeInMinutes *int32 +} + +// VirtualMachineScaleSetVMsClientSimulateEvictionOptions contains the optional parameters for the VirtualMachineScaleSetVMsClient.SimulateEviction +// method. +type VirtualMachineScaleSetVMsClientSimulateEvictionOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginCreateOrUpdate +// method. +type VirtualMachineScaleSetsClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetsClientBeginDeallocateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeallocate +// method. +type VirtualMachineScaleSetsClientBeginDeallocateOptions struct { + // Optional parameter to hibernate a virtual machine from the VM scale set. (This feature is available for VMSS with Flexible + // OrchestrationMode only) + Hibernate *bool + + // Resumes the LRO from the provided token. + ResumeToken string + + // A list of virtual machine instance IDs from the VM scale set. + VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs +} + +// VirtualMachineScaleSetsClientBeginDeleteInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDeleteInstances +// method. +type VirtualMachineScaleSetsClientBeginDeleteInstancesOptions struct { + // Optional parameter to force delete virtual machines from the VM scale set. (Feature in Preview) + ForceDeletion *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetsClientBeginDeleteOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginDelete +// method. +type VirtualMachineScaleSetsClientBeginDeleteOptions struct { + // Optional parameter to force delete a VM scale set. (Feature in Preview) + ForceDeletion *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPerformMaintenance +// method. +type VirtualMachineScaleSetsClientBeginPerformMaintenanceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // A list of virtual machine instance IDs from the VM scale set. + VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs +} + +// VirtualMachineScaleSetsClientBeginPowerOffOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginPowerOff +// method. +type VirtualMachineScaleSetsClientBeginPowerOffOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false + // indicates otherwise. Default value for this flag is false if not specified + SkipShutdown *bool + + // A list of virtual machine instance IDs from the VM scale set. + VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs +} + +// VirtualMachineScaleSetsClientBeginReapplyOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReapply +// method. +type VirtualMachineScaleSetsClientBeginReapplyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetsClientBeginRedeployOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRedeploy +// method. +type VirtualMachineScaleSetsClientBeginRedeployOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // A list of virtual machine instance IDs from the VM scale set. + VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs +} + +// VirtualMachineScaleSetsClientBeginReimageAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimageAll +// method. +type VirtualMachineScaleSetsClientBeginReimageAllOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // A list of virtual machine instance IDs from the VM scale set. + VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs +} + +// VirtualMachineScaleSetsClientBeginReimageOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginReimage +// method. +type VirtualMachineScaleSetsClientBeginReimageOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // Parameters for Reimaging VM ScaleSet. + VMScaleSetReimageInput *VirtualMachineScaleSetReimageParameters +} + +// VirtualMachineScaleSetsClientBeginRestartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginRestart +// method. +type VirtualMachineScaleSetsClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // A list of virtual machine instance IDs from the VM scale set. + VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs +} + +// VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginSetOrchestrationServiceState +// method. +type VirtualMachineScaleSetsClientBeginSetOrchestrationServiceStateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetsClientBeginStartOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginStart +// method. +type VirtualMachineScaleSetsClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // A list of virtual machine instance IDs from the VM scale set. + VMInstanceIDs *VirtualMachineScaleSetVMInstanceIDs +} + +// VirtualMachineScaleSetsClientBeginUpdateInstancesOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdateInstances +// method. +type VirtualMachineScaleSetsClientBeginUpdateInstancesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetsClientBeginUpdateOptions contains the optional parameters for the VirtualMachineScaleSetsClient.BeginUpdate +// method. +type VirtualMachineScaleSetsClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions contains the optional parameters for the VirtualMachineScaleSetsClient.ConvertToSinglePlacementGroup +// method. +type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions contains the optional parameters +// for the VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk method. +type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkOptions struct { + // The placement group id for which the manual recovery walk is requested. + PlacementGroupID *string + + // The zone in which the manual recovery walk is requested for cross zone virtual machine scale set + Zone *string +} + +// VirtualMachineScaleSetsClientGetInstanceViewOptions contains the optional parameters for the VirtualMachineScaleSetsClient.GetInstanceView +// method. +type VirtualMachineScaleSetsClientGetInstanceViewOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager +// method. +type VirtualMachineScaleSetsClientGetOSUpgradeHistoryOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetsClientGetOptions contains the optional parameters for the VirtualMachineScaleSetsClient.Get method. +type VirtualMachineScaleSetsClientGetOptions struct { + // The expand expression to apply on the operation. 'UserData' retrieves the UserData property of the VM scale set that was + // provided by the user during the VM scale set Create/Update operation + Expand *ExpandTypesForGetVMScaleSets +} + +// VirtualMachineScaleSetsClientListAllOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListAllPager +// method. +type VirtualMachineScaleSetsClientListAllOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetsClientListByLocationOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListByLocationPager +// method. +type VirtualMachineScaleSetsClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetsClientListOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListPager +// method. +type VirtualMachineScaleSetsClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineScaleSetsClientListSKUsOptions contains the optional parameters for the VirtualMachineScaleSetsClient.NewListSKUsPager +// method. +type VirtualMachineScaleSetsClientListSKUsOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachineSizesClientListOptions contains the optional parameters for the VirtualMachineSizesClient.NewListPager method. +type VirtualMachineSizesClientListOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachinesClientBeginAssessPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginAssessPatches +// method. +type VirtualMachinesClientBeginAssessPatchesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginCaptureOptions contains the optional parameters for the VirtualMachinesClient.BeginCapture method. +type VirtualMachinesClientBeginCaptureOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginConvertToManagedDisksOptions contains the optional parameters for the VirtualMachinesClient.BeginConvertToManagedDisks +// method. +type VirtualMachinesClientBeginConvertToManagedDisksOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginCreateOrUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginCreateOrUpdate +// method. +type VirtualMachinesClientBeginCreateOrUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginDeallocateOptions contains the optional parameters for the VirtualMachinesClient.BeginDeallocate +// method. +type VirtualMachinesClientBeginDeallocateOptions struct { + // Optional parameter to hibernate a virtual machine. (Feature in Preview) + Hibernate *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginDeleteOptions contains the optional parameters for the VirtualMachinesClient.BeginDelete method. +type VirtualMachinesClientBeginDeleteOptions struct { + // Optional parameter to force delete virtual machines. + ForceDeletion *bool + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginInstallPatchesOptions contains the optional parameters for the VirtualMachinesClient.BeginInstallPatches +// method. +type VirtualMachinesClientBeginInstallPatchesOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginPerformMaintenanceOptions contains the optional parameters for the VirtualMachinesClient.BeginPerformMaintenance +// method. +type VirtualMachinesClientBeginPerformMaintenanceOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginPowerOffOptions contains the optional parameters for the VirtualMachinesClient.BeginPowerOff +// method. +type VirtualMachinesClientBeginPowerOffOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string + + // The parameter to request non-graceful VM shutdown. True value for this flag indicates non-graceful shutdown whereas false + // indicates otherwise. Default value for this flag is false if not specified + SkipShutdown *bool +} + +// VirtualMachinesClientBeginReapplyOptions contains the optional parameters for the VirtualMachinesClient.BeginReapply method. +type VirtualMachinesClientBeginReapplyOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginRedeployOptions contains the optional parameters for the VirtualMachinesClient.BeginRedeploy +// method. +type VirtualMachinesClientBeginRedeployOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginReimageOptions contains the optional parameters for the VirtualMachinesClient.BeginReimage method. +type VirtualMachinesClientBeginReimageOptions struct { + // Parameters supplied to the Reimage Virtual Machine operation. + Parameters *VirtualMachineReimageParameters + + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginRestartOptions contains the optional parameters for the VirtualMachinesClient.BeginRestart method. +type VirtualMachinesClientBeginRestartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginRunCommandOptions contains the optional parameters for the VirtualMachinesClient.BeginRunCommand +// method. +type VirtualMachinesClientBeginRunCommandOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginStartOptions contains the optional parameters for the VirtualMachinesClient.BeginStart method. +type VirtualMachinesClientBeginStartOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientBeginUpdateOptions contains the optional parameters for the VirtualMachinesClient.BeginUpdate method. +type VirtualMachinesClientBeginUpdateOptions struct { + // Resumes the LRO from the provided token. + ResumeToken string +} + +// VirtualMachinesClientGeneralizeOptions contains the optional parameters for the VirtualMachinesClient.Generalize method. +type VirtualMachinesClientGeneralizeOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachinesClientGetOptions contains the optional parameters for the VirtualMachinesClient.Get method. +type VirtualMachinesClientGetOptions struct { + // The expand expression to apply on the operation. 'InstanceView' retrieves a snapshot of the runtime properties of the virtual + // machine that is managed by the platform and can change outside of control + // plane operations. 'UserData' retrieves the UserData property as part of the VM model view that was provided by the user + // during the VM Create/Update operation. + Expand *InstanceViewTypes +} + +// VirtualMachinesClientInstanceViewOptions contains the optional parameters for the VirtualMachinesClient.InstanceView method. +type VirtualMachinesClientInstanceViewOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachinesClientListAllOptions contains the optional parameters for the VirtualMachinesClient.NewListAllPager method. +type VirtualMachinesClientListAllOptions struct { + // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this + // can only be specified if a valid $filter option is specified + Expand *ExpandTypesForListVMs + + // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + Filter *string + + // statusOnly=true enables fetching run time status of all Virtual Machines in the subscription. + StatusOnly *string +} + +// VirtualMachinesClientListAvailableSizesOptions contains the optional parameters for the VirtualMachinesClient.NewListAvailableSizesPager +// method. +type VirtualMachinesClientListAvailableSizesOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachinesClientListByLocationOptions contains the optional parameters for the VirtualMachinesClient.NewListByLocationPager +// method. +type VirtualMachinesClientListByLocationOptions struct { + // placeholder for future optional parameters +} + +// VirtualMachinesClientListOptions contains the optional parameters for the VirtualMachinesClient.NewListPager method. +type VirtualMachinesClientListOptions struct { + // The expand expression to apply on operation. 'instanceView' enables fetching run time status of all Virtual Machines, this + // can only be specified if a valid $filter option is specified + Expand *ExpandTypeForListVMs + + // The system query option to filter VMs returned in the response. Allowed value is 'virtualMachineScaleSet/id' eq + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachineScaleSets/{vmssName}' + Filter *string +} + +// VirtualMachinesClientRetrieveBootDiagnosticsDataOptions contains the optional parameters for the VirtualMachinesClient.RetrieveBootDiagnosticsData +// method. +type VirtualMachinesClientRetrieveBootDiagnosticsDataOptions struct { + // Expiration duration in minutes for the SAS URIs with a value between 1 to 1440 minutes. Note: If not specified, SAS URIs + // will be generated with a default expiration duration of 120 minutes. + SasURIExpirationTimeInMinutes *int32 +} + +// VirtualMachinesClientSimulateEvictionOptions contains the optional parameters for the VirtualMachinesClient.SimulateEviction +// method. +type VirtualMachinesClientSimulateEvictionOptions struct { + // placeholder for future optional parameters +} diff --git a/sdk/resourcemanager/compute/armcompute/response_types.go b/sdk/resourcemanager/compute/armcompute/response_types.go index 3f23308e7e9e..360dfc34bd94 100644 --- a/sdk/resourcemanager/compute/armcompute/response_types.go +++ b/sdk/resourcemanager/compute/armcompute/response_types.go @@ -12,6 +12,12 @@ import "io" // AvailabilitySetsClientCreateOrUpdateResponse contains the response from method AvailabilitySetsClient.CreateOrUpdate. type AvailabilitySetsClientCreateOrUpdateResponse struct { + // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified + // in the same availability set are allocated to different nodes to maximize availability. For more information about availability + // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For + // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability + // set. AvailabilitySet } @@ -22,31 +28,49 @@ type AvailabilitySetsClientDeleteResponse struct { // AvailabilitySetsClientGetResponse contains the response from method AvailabilitySetsClient.Get. type AvailabilitySetsClientGetResponse struct { + // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified + // in the same availability set are allocated to different nodes to maximize availability. For more information about availability + // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For + // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability + // set. AvailabilitySet } // AvailabilitySetsClientListAvailableSizesResponse contains the response from method AvailabilitySetsClient.NewListAvailableSizesPager. type AvailabilitySetsClientListAvailableSizesResponse struct { + // The List Virtual Machine operation response. VirtualMachineSizeListResult } // AvailabilitySetsClientListBySubscriptionResponse contains the response from method AvailabilitySetsClient.NewListBySubscriptionPager. type AvailabilitySetsClientListBySubscriptionResponse struct { + // The List Availability Set operation response. AvailabilitySetListResult } // AvailabilitySetsClientListResponse contains the response from method AvailabilitySetsClient.NewListPager. type AvailabilitySetsClientListResponse struct { + // The List Availability Set operation response. AvailabilitySetListResult } // AvailabilitySetsClientUpdateResponse contains the response from method AvailabilitySetsClient.Update. type AvailabilitySetsClientUpdateResponse struct { + // Specifies information about the availability set that the virtual machine should be assigned to. Virtual machines specified + // in the same availability set are allocated to different nodes to maximize availability. For more information about availability + // sets, see [Availability sets overview](https://docs.microsoft.com/azure/virtual-machines/availability-set-overview). For + // more information on Azure planned maintenance, see [Maintenance and updates for Virtual Machines in Azure](https://docs.microsoft.com/azure/virtual-machines/maintenance-and-updates). + // Currently, a VM can only be added to an availability set at creation time. An existing VM cannot be added to an availability + // set. AvailabilitySet } // CapacityReservationGroupsClientCreateOrUpdateResponse contains the response from method CapacityReservationGroupsClient.CreateOrUpdate. type CapacityReservationGroupsClientCreateOrUpdateResponse struct { + // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, + // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation + // cannot be added or moved to another capacity reservation group. CapacityReservationGroup } @@ -57,26 +81,35 @@ type CapacityReservationGroupsClientDeleteResponse struct { // CapacityReservationGroupsClientGetResponse contains the response from method CapacityReservationGroupsClient.Get. type CapacityReservationGroupsClientGetResponse struct { + // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, + // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation + // cannot be added or moved to another capacity reservation group. CapacityReservationGroup } // CapacityReservationGroupsClientListByResourceGroupResponse contains the response from method CapacityReservationGroupsClient.NewListByResourceGroupPager. type CapacityReservationGroupsClientListByResourceGroupResponse struct { + // The List capacity reservation group with resource group response. CapacityReservationGroupListResult } // CapacityReservationGroupsClientListBySubscriptionResponse contains the response from method CapacityReservationGroupsClient.NewListBySubscriptionPager. type CapacityReservationGroupsClientListBySubscriptionResponse struct { + // The List capacity reservation group with resource group response. CapacityReservationGroupListResult } // CapacityReservationGroupsClientUpdateResponse contains the response from method CapacityReservationGroupsClient.Update. type CapacityReservationGroupsClientUpdateResponse struct { + // Specifies information about the capacity reservation group that the capacity reservations should be assigned to. Currently, + // a capacity reservation can only be added to a capacity reservation group at creation time. An existing capacity reservation + // cannot be added or moved to another capacity reservation group. CapacityReservationGroup } // CapacityReservationsClientCreateOrUpdateResponse contains the response from method CapacityReservationsClient.BeginCreateOrUpdate. type CapacityReservationsClientCreateOrUpdateResponse struct { + // Specifies information about the capacity reservation. CapacityReservation } @@ -87,36 +120,43 @@ type CapacityReservationsClientDeleteResponse struct { // CapacityReservationsClientGetResponse contains the response from method CapacityReservationsClient.Get. type CapacityReservationsClientGetResponse struct { + // Specifies information about the capacity reservation. CapacityReservation } // CapacityReservationsClientListByCapacityReservationGroupResponse contains the response from method CapacityReservationsClient.NewListByCapacityReservationGroupPager. type CapacityReservationsClientListByCapacityReservationGroupResponse struct { + // The list capacity reservation operation response. CapacityReservationListResult } // CapacityReservationsClientUpdateResponse contains the response from method CapacityReservationsClient.BeginUpdate. type CapacityReservationsClientUpdateResponse struct { + // Specifies information about the capacity reservation. CapacityReservation } // CloudServiceOperatingSystemsClientGetOSFamilyResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSFamily. type CloudServiceOperatingSystemsClientGetOSFamilyResponse struct { + // Describes a cloud service OS family. OSFamily } // CloudServiceOperatingSystemsClientGetOSVersionResponse contains the response from method CloudServiceOperatingSystemsClient.GetOSVersion. type CloudServiceOperatingSystemsClientGetOSVersionResponse struct { + // Describes a cloud service OS version. OSVersion } // CloudServiceOperatingSystemsClientListOSFamiliesResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSFamiliesPager. type CloudServiceOperatingSystemsClientListOSFamiliesResponse struct { + // The list operation result. OSFamilyListResult } // CloudServiceOperatingSystemsClientListOSVersionsResponse contains the response from method CloudServiceOperatingSystemsClient.NewListOSVersionsPager. type CloudServiceOperatingSystemsClientListOSVersionsResponse struct { + // The list operation result. OSVersionListResult } @@ -127,6 +167,7 @@ type CloudServiceRoleInstancesClientDeleteResponse struct { // CloudServiceRoleInstancesClientGetInstanceViewResponse contains the response from method CloudServiceRoleInstancesClient.GetInstanceView. type CloudServiceRoleInstancesClientGetInstanceViewResponse struct { + // The instance view of the role instance. RoleInstanceView } @@ -138,11 +179,13 @@ type CloudServiceRoleInstancesClientGetRemoteDesktopFileResponse struct { // CloudServiceRoleInstancesClientGetResponse contains the response from method CloudServiceRoleInstancesClient.Get. type CloudServiceRoleInstancesClientGetResponse struct { + // Describes the cloud service role instance. RoleInstance } // CloudServiceRoleInstancesClientListResponse contains the response from method CloudServiceRoleInstancesClient.NewListPager. type CloudServiceRoleInstancesClientListResponse struct { + // The list operation result. RoleInstanceListResult } @@ -163,16 +206,19 @@ type CloudServiceRoleInstancesClientRestartResponse struct { // CloudServiceRolesClientGetResponse contains the response from method CloudServiceRolesClient.Get. type CloudServiceRolesClientGetResponse struct { + // Describes a role of the cloud service. CloudServiceRole } // CloudServiceRolesClientListResponse contains the response from method CloudServiceRolesClient.NewListPager. type CloudServiceRolesClientListResponse struct { + // The list operation result. CloudServiceRoleListResult } // CloudServicesClientCreateOrUpdateResponse contains the response from method CloudServicesClient.BeginCreateOrUpdate. type CloudServicesClientCreateOrUpdateResponse struct { + // Describes the cloud service. CloudService } @@ -188,21 +234,25 @@ type CloudServicesClientDeleteResponse struct { // CloudServicesClientGetInstanceViewResponse contains the response from method CloudServicesClient.GetInstanceView. type CloudServicesClientGetInstanceViewResponse struct { + // InstanceView of CloudService as a whole CloudServiceInstanceView } // CloudServicesClientGetResponse contains the response from method CloudServicesClient.Get. type CloudServicesClientGetResponse struct { + // Describes the cloud service. CloudService } // CloudServicesClientListAllResponse contains the response from method CloudServicesClient.NewListAllPager. type CloudServicesClientListAllResponse struct { + // The list operation result. CloudServiceListResult } // CloudServicesClientListResponse contains the response from method CloudServicesClient.NewListPager. type CloudServicesClientListResponse struct { + // The list operation result. CloudServiceListResult } @@ -233,16 +283,19 @@ type CloudServicesClientStartResponse struct { // CloudServicesClientUpdateResponse contains the response from method CloudServicesClient.BeginUpdate. type CloudServicesClientUpdateResponse struct { + // Describes the cloud service. CloudService } // CloudServicesUpdateDomainClientGetUpdateDomainResponse contains the response from method CloudServicesUpdateDomainClient.GetUpdateDomain. type CloudServicesUpdateDomainClientGetUpdateDomainResponse struct { + // Defines an update domain for the cloud service. UpdateDomain } // CloudServicesUpdateDomainClientListUpdateDomainsResponse contains the response from method CloudServicesUpdateDomainClient.NewListUpdateDomainsPager. type CloudServicesUpdateDomainClientListUpdateDomainsResponse struct { + // The list operation result. UpdateDomainListResult } @@ -253,31 +306,39 @@ type CloudServicesUpdateDomainClientWalkUpdateDomainResponse struct { // CommunityGalleriesClientGetResponse contains the response from method CommunityGalleriesClient.Get. type CommunityGalleriesClientGetResponse struct { + // Specifies information about the Community Gallery that you want to create or update. CommunityGallery } // CommunityGalleryImageVersionsClientGetResponse contains the response from method CommunityGalleryImageVersionsClient.Get. type CommunityGalleryImageVersionsClientGetResponse struct { + // Specifies information about the gallery image version that you want to create or update. CommunityGalleryImageVersion } // CommunityGalleryImageVersionsClientListResponse contains the response from method CommunityGalleryImageVersionsClient.NewListPager. type CommunityGalleryImageVersionsClientListResponse struct { + // The List Community Gallery Image versions operation response. CommunityGalleryImageVersionList } // CommunityGalleryImagesClientGetResponse contains the response from method CommunityGalleryImagesClient.Get. type CommunityGalleryImagesClientGetResponse struct { + // Specifies information about the gallery image definition that you want to create or update. CommunityGalleryImage } // CommunityGalleryImagesClientListResponse contains the response from method CommunityGalleryImagesClient.NewListPager. type CommunityGalleryImagesClientListResponse struct { + // The List Community Gallery Images operation response. CommunityGalleryImageList } // DedicatedHostGroupsClientCreateOrUpdateResponse contains the response from method DedicatedHostGroupsClient.CreateOrUpdate. type DedicatedHostGroupsClientCreateOrUpdateResponse struct { + // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated + // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another + // dedicated host group. DedicatedHostGroup } @@ -288,26 +349,35 @@ type DedicatedHostGroupsClientDeleteResponse struct { // DedicatedHostGroupsClientGetResponse contains the response from method DedicatedHostGroupsClient.Get. type DedicatedHostGroupsClientGetResponse struct { + // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated + // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another + // dedicated host group. DedicatedHostGroup } // DedicatedHostGroupsClientListByResourceGroupResponse contains the response from method DedicatedHostGroupsClient.NewListByResourceGroupPager. type DedicatedHostGroupsClientListByResourceGroupResponse struct { + // The List Dedicated Host Group with resource group response. DedicatedHostGroupListResult } // DedicatedHostGroupsClientListBySubscriptionResponse contains the response from method DedicatedHostGroupsClient.NewListBySubscriptionPager. type DedicatedHostGroupsClientListBySubscriptionResponse struct { + // The List Dedicated Host Group with resource group response. DedicatedHostGroupListResult } // DedicatedHostGroupsClientUpdateResponse contains the response from method DedicatedHostGroupsClient.Update. type DedicatedHostGroupsClientUpdateResponse struct { + // Specifies information about the dedicated host group that the dedicated hosts should be assigned to. Currently, a dedicated + // host can only be added to a dedicated host group at creation time. An existing dedicated host cannot be added to another + // dedicated host group. DedicatedHostGroup } // DedicatedHostsClientCreateOrUpdateResponse contains the response from method DedicatedHostsClient.BeginCreateOrUpdate. type DedicatedHostsClientCreateOrUpdateResponse struct { + // Specifies information about the Dedicated host. DedicatedHost } @@ -318,16 +388,19 @@ type DedicatedHostsClientDeleteResponse struct { // DedicatedHostsClientGetResponse contains the response from method DedicatedHostsClient.Get. type DedicatedHostsClientGetResponse struct { + // Specifies information about the Dedicated host. DedicatedHost } // DedicatedHostsClientListAvailableSizesResponse contains the response from method DedicatedHostsClient.NewListAvailableSizesPager. type DedicatedHostsClientListAvailableSizesResponse struct { + // The List Dedicated Host sizes operation response. DedicatedHostSizeListResult } // DedicatedHostsClientListByHostGroupResponse contains the response from method DedicatedHostsClient.NewListByHostGroupPager. type DedicatedHostsClientListByHostGroupResponse struct { + // The list dedicated host operation response. DedicatedHostListResult } @@ -338,11 +411,13 @@ type DedicatedHostsClientRestartResponse struct { // DedicatedHostsClientUpdateResponse contains the response from method DedicatedHostsClient.BeginUpdate. type DedicatedHostsClientUpdateResponse struct { + // Specifies information about the Dedicated host. DedicatedHost } // DiskAccessesClientCreateOrUpdateResponse contains the response from method DiskAccessesClient.BeginCreateOrUpdate. type DiskAccessesClientCreateOrUpdateResponse struct { + // disk access resource. DiskAccess } @@ -358,46 +433,55 @@ type DiskAccessesClientDeleteResponse struct { // DiskAccessesClientGetAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.GetAPrivateEndpointConnection. type DiskAccessesClientGetAPrivateEndpointConnectionResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } // DiskAccessesClientGetPrivateLinkResourcesResponse contains the response from method DiskAccessesClient.GetPrivateLinkResources. type DiskAccessesClientGetPrivateLinkResourcesResponse struct { + // A list of private link resources PrivateLinkResourceListResult } // DiskAccessesClientGetResponse contains the response from method DiskAccessesClient.Get. type DiskAccessesClientGetResponse struct { + // disk access resource. DiskAccess } // DiskAccessesClientListByResourceGroupResponse contains the response from method DiskAccessesClient.NewListByResourceGroupPager. type DiskAccessesClientListByResourceGroupResponse struct { + // The List disk access operation response. DiskAccessList } // DiskAccessesClientListPrivateEndpointConnectionsResponse contains the response from method DiskAccessesClient.NewListPrivateEndpointConnectionsPager. type DiskAccessesClientListPrivateEndpointConnectionsResponse struct { + // A list of private link resources PrivateEndpointConnectionListResult } // DiskAccessesClientListResponse contains the response from method DiskAccessesClient.NewListPager. type DiskAccessesClientListResponse struct { + // The List disk access operation response. DiskAccessList } // DiskAccessesClientUpdateAPrivateEndpointConnectionResponse contains the response from method DiskAccessesClient.BeginUpdateAPrivateEndpointConnection. type DiskAccessesClientUpdateAPrivateEndpointConnectionResponse struct { + // The Private Endpoint Connection resource. PrivateEndpointConnection } // DiskAccessesClientUpdateResponse contains the response from method DiskAccessesClient.BeginUpdate. type DiskAccessesClientUpdateResponse struct { + // disk access resource. DiskAccess } // DiskEncryptionSetsClientCreateOrUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginCreateOrUpdate. type DiskEncryptionSetsClientCreateOrUpdateResponse struct { + // disk encryption set resource. DiskEncryptionSet } @@ -408,41 +492,49 @@ type DiskEncryptionSetsClientDeleteResponse struct { // DiskEncryptionSetsClientGetResponse contains the response from method DiskEncryptionSetsClient.Get. type DiskEncryptionSetsClientGetResponse struct { + // disk encryption set resource. DiskEncryptionSet } // DiskEncryptionSetsClientListAssociatedResourcesResponse contains the response from method DiskEncryptionSetsClient.NewListAssociatedResourcesPager. type DiskEncryptionSetsClientListAssociatedResourcesResponse struct { + // The List resources which are encrypted with the disk encryption set. ResourceURIList } // DiskEncryptionSetsClientListByResourceGroupResponse contains the response from method DiskEncryptionSetsClient.NewListByResourceGroupPager. type DiskEncryptionSetsClientListByResourceGroupResponse struct { + // The List disk encryption set operation response. DiskEncryptionSetList } // DiskEncryptionSetsClientListResponse contains the response from method DiskEncryptionSetsClient.NewListPager. type DiskEncryptionSetsClientListResponse struct { + // The List disk encryption set operation response. DiskEncryptionSetList } // DiskEncryptionSetsClientUpdateResponse contains the response from method DiskEncryptionSetsClient.BeginUpdate. type DiskEncryptionSetsClientUpdateResponse struct { + // disk encryption set resource. DiskEncryptionSet } // DiskRestorePointClientGetResponse contains the response from method DiskRestorePointClient.Get. type DiskRestorePointClientGetResponse struct { + // Properties of disk restore point DiskRestorePoint } // DiskRestorePointClientGrantAccessResponse contains the response from method DiskRestorePointClient.BeginGrantAccess. type DiskRestorePointClientGrantAccessResponse struct { + // A disk access SAS uri. AccessURI } // DiskRestorePointClientListByRestorePointResponse contains the response from method DiskRestorePointClient.NewListByRestorePointPager. type DiskRestorePointClientListByRestorePointResponse struct { + // The List Disk Restore Points operation response. DiskRestorePointList } @@ -453,6 +545,7 @@ type DiskRestorePointClientRevokeAccessResponse struct { // DisksClientCreateOrUpdateResponse contains the response from method DisksClient.BeginCreateOrUpdate. type DisksClientCreateOrUpdateResponse struct { + // Disk resource. Disk } @@ -463,21 +556,25 @@ type DisksClientDeleteResponse struct { // DisksClientGetResponse contains the response from method DisksClient.Get. type DisksClientGetResponse struct { + // Disk resource. Disk } // DisksClientGrantAccessResponse contains the response from method DisksClient.BeginGrantAccess. type DisksClientGrantAccessResponse struct { + // A disk access SAS uri. AccessURI } // DisksClientListByResourceGroupResponse contains the response from method DisksClient.NewListByResourceGroupPager. type DisksClientListByResourceGroupResponse struct { + // The List Disks operation response. DiskList } // DisksClientListResponse contains the response from method DisksClient.NewListPager. type DisksClientListResponse struct { + // The List Disks operation response. DiskList } @@ -488,11 +585,13 @@ type DisksClientRevokeAccessResponse struct { // DisksClientUpdateResponse contains the response from method DisksClient.BeginUpdate. type DisksClientUpdateResponse struct { + // Disk resource. Disk } // GalleriesClientCreateOrUpdateResponse contains the response from method GalleriesClient.BeginCreateOrUpdate. type GalleriesClientCreateOrUpdateResponse struct { + // Specifies information about the Shared Image Gallery that you want to create or update. Gallery } @@ -503,26 +602,31 @@ type GalleriesClientDeleteResponse struct { // GalleriesClientGetResponse contains the response from method GalleriesClient.Get. type GalleriesClientGetResponse struct { + // Specifies information about the Shared Image Gallery that you want to create or update. Gallery } // GalleriesClientListByResourceGroupResponse contains the response from method GalleriesClient.NewListByResourceGroupPager. type GalleriesClientListByResourceGroupResponse struct { + // The List Galleries operation response. GalleryList } // GalleriesClientListResponse contains the response from method GalleriesClient.NewListPager. type GalleriesClientListResponse struct { + // The List Galleries operation response. GalleryList } // GalleriesClientUpdateResponse contains the response from method GalleriesClient.BeginUpdate. type GalleriesClientUpdateResponse struct { + // Specifies information about the Shared Image Gallery that you want to create or update. Gallery } // GalleryApplicationVersionsClientCreateOrUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginCreateOrUpdate. type GalleryApplicationVersionsClientCreateOrUpdateResponse struct { + // Specifies information about the gallery Application Version that you want to create or update. GalleryApplicationVersion } @@ -533,21 +637,25 @@ type GalleryApplicationVersionsClientDeleteResponse struct { // GalleryApplicationVersionsClientGetResponse contains the response from method GalleryApplicationVersionsClient.Get. type GalleryApplicationVersionsClientGetResponse struct { + // Specifies information about the gallery Application Version that you want to create or update. GalleryApplicationVersion } // GalleryApplicationVersionsClientListByGalleryApplicationResponse contains the response from method GalleryApplicationVersionsClient.NewListByGalleryApplicationPager. type GalleryApplicationVersionsClientListByGalleryApplicationResponse struct { + // The List Gallery Application version operation response. GalleryApplicationVersionList } // GalleryApplicationVersionsClientUpdateResponse contains the response from method GalleryApplicationVersionsClient.BeginUpdate. type GalleryApplicationVersionsClientUpdateResponse struct { + // Specifies information about the gallery Application Version that you want to create or update. GalleryApplicationVersion } // GalleryApplicationsClientCreateOrUpdateResponse contains the response from method GalleryApplicationsClient.BeginCreateOrUpdate. type GalleryApplicationsClientCreateOrUpdateResponse struct { + // Specifies information about the gallery Application Definition that you want to create or update. GalleryApplication } @@ -558,21 +666,25 @@ type GalleryApplicationsClientDeleteResponse struct { // GalleryApplicationsClientGetResponse contains the response from method GalleryApplicationsClient.Get. type GalleryApplicationsClientGetResponse struct { + // Specifies information about the gallery Application Definition that you want to create or update. GalleryApplication } // GalleryApplicationsClientListByGalleryResponse contains the response from method GalleryApplicationsClient.NewListByGalleryPager. type GalleryApplicationsClientListByGalleryResponse struct { + // The List Gallery Applications operation response. GalleryApplicationList } // GalleryApplicationsClientUpdateResponse contains the response from method GalleryApplicationsClient.BeginUpdate. type GalleryApplicationsClientUpdateResponse struct { + // Specifies information about the gallery Application Definition that you want to create or update. GalleryApplication } // GalleryImageVersionsClientCreateOrUpdateResponse contains the response from method GalleryImageVersionsClient.BeginCreateOrUpdate. type GalleryImageVersionsClientCreateOrUpdateResponse struct { + // Specifies information about the gallery image version that you want to create or update. GalleryImageVersion } @@ -583,21 +695,25 @@ type GalleryImageVersionsClientDeleteResponse struct { // GalleryImageVersionsClientGetResponse contains the response from method GalleryImageVersionsClient.Get. type GalleryImageVersionsClientGetResponse struct { + // Specifies information about the gallery image version that you want to create or update. GalleryImageVersion } // GalleryImageVersionsClientListByGalleryImageResponse contains the response from method GalleryImageVersionsClient.NewListByGalleryImagePager. type GalleryImageVersionsClientListByGalleryImageResponse struct { + // The List Gallery Image version operation response. GalleryImageVersionList } // GalleryImageVersionsClientUpdateResponse contains the response from method GalleryImageVersionsClient.BeginUpdate. type GalleryImageVersionsClientUpdateResponse struct { + // Specifies information about the gallery image version that you want to create or update. GalleryImageVersion } // GalleryImagesClientCreateOrUpdateResponse contains the response from method GalleryImagesClient.BeginCreateOrUpdate. type GalleryImagesClientCreateOrUpdateResponse struct { + // Specifies information about the gallery image definition that you want to create or update. GalleryImage } @@ -608,26 +724,32 @@ type GalleryImagesClientDeleteResponse struct { // GalleryImagesClientGetResponse contains the response from method GalleryImagesClient.Get. type GalleryImagesClientGetResponse struct { + // Specifies information about the gallery image definition that you want to create or update. GalleryImage } // GalleryImagesClientListByGalleryResponse contains the response from method GalleryImagesClient.NewListByGalleryPager. type GalleryImagesClientListByGalleryResponse struct { + // The List Gallery Images operation response. GalleryImageList } // GalleryImagesClientUpdateResponse contains the response from method GalleryImagesClient.BeginUpdate. type GalleryImagesClientUpdateResponse struct { + // Specifies information about the gallery image definition that you want to create or update. GalleryImage } // GallerySharingProfileClientUpdateResponse contains the response from method GallerySharingProfileClient.BeginUpdate. type GallerySharingProfileClientUpdateResponse struct { + // Specifies information about the gallery sharing profile update. SharingUpdate } // ImagesClientCreateOrUpdateResponse contains the response from method ImagesClient.BeginCreateOrUpdate. type ImagesClientCreateOrUpdateResponse struct { + // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. + // If SourceImage is provided, the destination virtual hard drive must not exist. Image } @@ -638,41 +760,51 @@ type ImagesClientDeleteResponse struct { // ImagesClientGetResponse contains the response from method ImagesClient.Get. type ImagesClientGetResponse struct { + // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. + // If SourceImage is provided, the destination virtual hard drive must not exist. Image } // ImagesClientListByResourceGroupResponse contains the response from method ImagesClient.NewListByResourceGroupPager. type ImagesClientListByResourceGroupResponse struct { + // The List Image operation response. ImageListResult } // ImagesClientListResponse contains the response from method ImagesClient.NewListPager. type ImagesClientListResponse struct { + // The List Image operation response. ImageListResult } // ImagesClientUpdateResponse contains the response from method ImagesClient.BeginUpdate. type ImagesClientUpdateResponse struct { + // The source user image virtual hard disk. The virtual hard disk will be copied before being attached to the virtual machine. + // If SourceImage is provided, the destination virtual hard drive must not exist. Image } // LogAnalyticsClientExportRequestRateByIntervalResponse contains the response from method LogAnalyticsClient.BeginExportRequestRateByInterval. type LogAnalyticsClientExportRequestRateByIntervalResponse struct { + // LogAnalytics operation status response LogAnalyticsOperationResult } // LogAnalyticsClientExportThrottledRequestsResponse contains the response from method LogAnalyticsClient.BeginExportThrottledRequests. type LogAnalyticsClientExportThrottledRequestsResponse struct { + // LogAnalytics operation status response LogAnalyticsOperationResult } // OperationsClientListResponse contains the response from method OperationsClient.NewListPager. type OperationsClientListResponse struct { + // The List Compute Operation operation response. OperationListResult } // ProximityPlacementGroupsClientCreateOrUpdateResponse contains the response from method ProximityPlacementGroupsClient.CreateOrUpdate. type ProximityPlacementGroupsClientCreateOrUpdateResponse struct { + // Specifies information about the proximity placement group. ProximityPlacementGroup } @@ -683,31 +815,37 @@ type ProximityPlacementGroupsClientDeleteResponse struct { // ProximityPlacementGroupsClientGetResponse contains the response from method ProximityPlacementGroupsClient.Get. type ProximityPlacementGroupsClientGetResponse struct { + // Specifies information about the proximity placement group. ProximityPlacementGroup } // ProximityPlacementGroupsClientListByResourceGroupResponse contains the response from method ProximityPlacementGroupsClient.NewListByResourceGroupPager. type ProximityPlacementGroupsClientListByResourceGroupResponse struct { + // The List Proximity Placement Group operation response. ProximityPlacementGroupListResult } // ProximityPlacementGroupsClientListBySubscriptionResponse contains the response from method ProximityPlacementGroupsClient.NewListBySubscriptionPager. type ProximityPlacementGroupsClientListBySubscriptionResponse struct { + // The List Proximity Placement Group operation response. ProximityPlacementGroupListResult } // ProximityPlacementGroupsClientUpdateResponse contains the response from method ProximityPlacementGroupsClient.Update. type ProximityPlacementGroupsClientUpdateResponse struct { + // Specifies information about the proximity placement group. ProximityPlacementGroup } // ResourceSKUsClientListResponse contains the response from method ResourceSKUsClient.NewListPager. type ResourceSKUsClientListResponse struct { + // The List Resource Skus operation response. ResourceSKUsResult } // RestorePointCollectionsClientCreateOrUpdateResponse contains the response from method RestorePointCollectionsClient.CreateOrUpdate. type RestorePointCollectionsClientCreateOrUpdateResponse struct { + // Create or update Restore Point collection parameters. RestorePointCollection } @@ -718,26 +856,31 @@ type RestorePointCollectionsClientDeleteResponse struct { // RestorePointCollectionsClientGetResponse contains the response from method RestorePointCollectionsClient.Get. type RestorePointCollectionsClientGetResponse struct { + // Create or update Restore Point collection parameters. RestorePointCollection } // RestorePointCollectionsClientListAllResponse contains the response from method RestorePointCollectionsClient.NewListAllPager. type RestorePointCollectionsClientListAllResponse struct { + // The List restore point collection operation response. RestorePointCollectionListResult } // RestorePointCollectionsClientListResponse contains the response from method RestorePointCollectionsClient.NewListPager. type RestorePointCollectionsClientListResponse struct { + // The List restore point collection operation response. RestorePointCollectionListResult } // RestorePointCollectionsClientUpdateResponse contains the response from method RestorePointCollectionsClient.Update. type RestorePointCollectionsClientUpdateResponse struct { + // Create or update Restore Point collection parameters. RestorePointCollection } // RestorePointsClientCreateResponse contains the response from method RestorePointsClient.BeginCreate. type RestorePointsClientCreateResponse struct { + // Restore Point details. RestorePoint } @@ -748,11 +891,13 @@ type RestorePointsClientDeleteResponse struct { // RestorePointsClientGetResponse contains the response from method RestorePointsClient.Get. type RestorePointsClientGetResponse struct { + // Restore Point details. RestorePoint } // SSHPublicKeysClientCreateResponse contains the response from method SSHPublicKeysClient.Create. type SSHPublicKeysClientCreateResponse struct { + // Specifies information about the SSH public key. SSHPublicKeyResource } @@ -763,61 +908,73 @@ type SSHPublicKeysClientDeleteResponse struct { // SSHPublicKeysClientGenerateKeyPairResponse contains the response from method SSHPublicKeysClient.GenerateKeyPair. type SSHPublicKeysClientGenerateKeyPairResponse struct { + // Response from generation of an SSH key pair. SSHPublicKeyGenerateKeyPairResult } // SSHPublicKeysClientGetResponse contains the response from method SSHPublicKeysClient.Get. type SSHPublicKeysClientGetResponse struct { + // Specifies information about the SSH public key. SSHPublicKeyResource } // SSHPublicKeysClientListByResourceGroupResponse contains the response from method SSHPublicKeysClient.NewListByResourceGroupPager. type SSHPublicKeysClientListByResourceGroupResponse struct { + // The list SSH public keys operation response. SSHPublicKeysGroupListResult } // SSHPublicKeysClientListBySubscriptionResponse contains the response from method SSHPublicKeysClient.NewListBySubscriptionPager. type SSHPublicKeysClientListBySubscriptionResponse struct { + // The list SSH public keys operation response. SSHPublicKeysGroupListResult } // SSHPublicKeysClientUpdateResponse contains the response from method SSHPublicKeysClient.Update. type SSHPublicKeysClientUpdateResponse struct { + // Specifies information about the SSH public key. SSHPublicKeyResource } // SharedGalleriesClientGetResponse contains the response from method SharedGalleriesClient.Get. type SharedGalleriesClientGetResponse struct { + // Specifies information about the Shared Gallery that you want to create or update. SharedGallery } // SharedGalleriesClientListResponse contains the response from method SharedGalleriesClient.NewListPager. type SharedGalleriesClientListResponse struct { + // The List Shared Galleries operation response. SharedGalleryList } // SharedGalleryImageVersionsClientGetResponse contains the response from method SharedGalleryImageVersionsClient.Get. type SharedGalleryImageVersionsClientGetResponse struct { + // Specifies information about the gallery image version that you want to create or update. SharedGalleryImageVersion } // SharedGalleryImageVersionsClientListResponse contains the response from method SharedGalleryImageVersionsClient.NewListPager. type SharedGalleryImageVersionsClientListResponse struct { + // The List Shared Gallery Image versions operation response. SharedGalleryImageVersionList } // SharedGalleryImagesClientGetResponse contains the response from method SharedGalleryImagesClient.Get. type SharedGalleryImagesClientGetResponse struct { + // Specifies information about the gallery image definition that you want to create or update. SharedGalleryImage } // SharedGalleryImagesClientListResponse contains the response from method SharedGalleryImagesClient.NewListPager. type SharedGalleryImagesClientListResponse struct { + // The List Shared Gallery Images operation response. SharedGalleryImageList } // SnapshotsClientCreateOrUpdateResponse contains the response from method SnapshotsClient.BeginCreateOrUpdate. type SnapshotsClientCreateOrUpdateResponse struct { + // Snapshot resource. Snapshot } @@ -828,21 +985,25 @@ type SnapshotsClientDeleteResponse struct { // SnapshotsClientGetResponse contains the response from method SnapshotsClient.Get. type SnapshotsClientGetResponse struct { + // Snapshot resource. Snapshot } // SnapshotsClientGrantAccessResponse contains the response from method SnapshotsClient.BeginGrantAccess. type SnapshotsClientGrantAccessResponse struct { + // A disk access SAS uri. AccessURI } // SnapshotsClientListByResourceGroupResponse contains the response from method SnapshotsClient.NewListByResourceGroupPager. type SnapshotsClientListByResourceGroupResponse struct { + // The List Snapshots operation response. SnapshotList } // SnapshotsClientListResponse contains the response from method SnapshotsClient.NewListPager. type SnapshotsClientListResponse struct { + // The List Snapshots operation response. SnapshotList } @@ -853,16 +1014,19 @@ type SnapshotsClientRevokeAccessResponse struct { // SnapshotsClientUpdateResponse contains the response from method SnapshotsClient.BeginUpdate. type SnapshotsClientUpdateResponse struct { + // Snapshot resource. Snapshot } // UsageClientListResponse contains the response from method UsageClient.NewListPager. type UsageClientListResponse struct { + // The List Usages operation response. ListUsagesResult } // VirtualMachineExtensionImagesClientGetResponse contains the response from method VirtualMachineExtensionImagesClient.Get. type VirtualMachineExtensionImagesClientGetResponse struct { + // Describes a Virtual Machine Extension Image. VirtualMachineExtensionImage } @@ -880,6 +1044,7 @@ type VirtualMachineExtensionImagesClientListVersionsResponse struct { // VirtualMachineExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginCreateOrUpdate. type VirtualMachineExtensionsClientCreateOrUpdateResponse struct { + // Describes a Virtual Machine Extension. VirtualMachineExtension } @@ -890,26 +1055,31 @@ type VirtualMachineExtensionsClientDeleteResponse struct { // VirtualMachineExtensionsClientGetResponse contains the response from method VirtualMachineExtensionsClient.Get. type VirtualMachineExtensionsClientGetResponse struct { + // Describes a Virtual Machine Extension. VirtualMachineExtension } // VirtualMachineExtensionsClientListResponse contains the response from method VirtualMachineExtensionsClient.List. type VirtualMachineExtensionsClientListResponse struct { + // The List Extension operation response VirtualMachineExtensionsListResult } // VirtualMachineExtensionsClientUpdateResponse contains the response from method VirtualMachineExtensionsClient.BeginUpdate. type VirtualMachineExtensionsClientUpdateResponse struct { + // Describes a Virtual Machine Extension. VirtualMachineExtension } // VirtualMachineImagesClientGetResponse contains the response from method VirtualMachineImagesClient.Get. type VirtualMachineImagesClientGetResponse struct { + // Describes a Virtual Machine Image. VirtualMachineImage } // VirtualMachineImagesClientListByEdgeZoneResponse contains the response from method VirtualMachineImagesClient.ListByEdgeZone. type VirtualMachineImagesClientListByEdgeZoneResponse struct { + // The List VmImages in EdgeZone operation response. VMImagesInEdgeZoneListResult } @@ -939,6 +1109,7 @@ type VirtualMachineImagesClientListSKUsResponse struct { // VirtualMachineImagesEdgeZoneClientGetResponse contains the response from method VirtualMachineImagesEdgeZoneClient.Get. type VirtualMachineImagesEdgeZoneClientGetResponse struct { + // Describes a Virtual Machine Image. VirtualMachineImage } @@ -968,6 +1139,7 @@ type VirtualMachineImagesEdgeZoneClientListSKUsResponse struct { // VirtualMachineRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginCreateOrUpdate. type VirtualMachineRunCommandsClientCreateOrUpdateResponse struct { + // Describes a Virtual Machine run command. VirtualMachineRunCommand } @@ -978,31 +1150,37 @@ type VirtualMachineRunCommandsClientDeleteResponse struct { // VirtualMachineRunCommandsClientGetByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.GetByVirtualMachine. type VirtualMachineRunCommandsClientGetByVirtualMachineResponse struct { + // Describes a Virtual Machine run command. VirtualMachineRunCommand } // VirtualMachineRunCommandsClientGetResponse contains the response from method VirtualMachineRunCommandsClient.Get. type VirtualMachineRunCommandsClientGetResponse struct { + // Describes the properties of a Run Command. RunCommandDocument } // VirtualMachineRunCommandsClientListByVirtualMachineResponse contains the response from method VirtualMachineRunCommandsClient.NewListByVirtualMachinePager. type VirtualMachineRunCommandsClientListByVirtualMachineResponse struct { + // The List run command operation response VirtualMachineRunCommandsListResult } // VirtualMachineRunCommandsClientListResponse contains the response from method VirtualMachineRunCommandsClient.NewListPager. type VirtualMachineRunCommandsClientListResponse struct { + // The List Virtual Machine operation response. RunCommandListResult } // VirtualMachineRunCommandsClientUpdateResponse contains the response from method VirtualMachineRunCommandsClient.BeginUpdate. type VirtualMachineRunCommandsClientUpdateResponse struct { + // Describes a Virtual Machine run command. VirtualMachineRunCommand } // VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginCreateOrUpdate. type VirtualMachineScaleSetExtensionsClientCreateOrUpdateResponse struct { + // Describes a Virtual Machine Scale Set Extension. VirtualMachineScaleSetExtension } @@ -1013,16 +1191,19 @@ type VirtualMachineScaleSetExtensionsClientDeleteResponse struct { // VirtualMachineScaleSetExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetExtensionsClient.Get. type VirtualMachineScaleSetExtensionsClientGetResponse struct { + // Describes a Virtual Machine Scale Set Extension. VirtualMachineScaleSetExtension } // VirtualMachineScaleSetExtensionsClientListResponse contains the response from method VirtualMachineScaleSetExtensionsClient.NewListPager. type VirtualMachineScaleSetExtensionsClientListResponse struct { + // The List VM scale set extension operation response. VirtualMachineScaleSetExtensionListResult } // VirtualMachineScaleSetExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetExtensionsClient.BeginUpdate. type VirtualMachineScaleSetExtensionsClientUpdateResponse struct { + // Describes a Virtual Machine Scale Set Extension. VirtualMachineScaleSetExtension } @@ -1033,6 +1214,7 @@ type VirtualMachineScaleSetRollingUpgradesClientCancelResponse struct { // VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse contains the response from method VirtualMachineScaleSetRollingUpgradesClient.GetLatest. type VirtualMachineScaleSetRollingUpgradesClientGetLatestResponse struct { + // The status of the latest virtual machine scale set rolling upgrade. RollingUpgradeStatusInfo } @@ -1048,6 +1230,7 @@ type VirtualMachineScaleSetRollingUpgradesClientStartOSUpgradeResponse struct { // VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginCreateOrUpdate. type VirtualMachineScaleSetVMExtensionsClientCreateOrUpdateResponse struct { + // Describes a VMSS VM Extension. VirtualMachineScaleSetVMExtension } @@ -1058,21 +1241,25 @@ type VirtualMachineScaleSetVMExtensionsClientDeleteResponse struct { // VirtualMachineScaleSetVMExtensionsClientGetResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.Get. type VirtualMachineScaleSetVMExtensionsClientGetResponse struct { + // Describes a VMSS VM Extension. VirtualMachineScaleSetVMExtension } // VirtualMachineScaleSetVMExtensionsClientListResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.List. type VirtualMachineScaleSetVMExtensionsClientListResponse struct { + // The List VMSS VM Extension operation response VirtualMachineScaleSetVMExtensionsListResult } // VirtualMachineScaleSetVMExtensionsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMExtensionsClient.BeginUpdate. type VirtualMachineScaleSetVMExtensionsClientUpdateResponse struct { + // Describes a VMSS VM Extension. VirtualMachineScaleSetVMExtension } // VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginCreateOrUpdate. type VirtualMachineScaleSetVMRunCommandsClientCreateOrUpdateResponse struct { + // Describes a Virtual Machine run command. VirtualMachineRunCommand } @@ -1083,16 +1270,19 @@ type VirtualMachineScaleSetVMRunCommandsClientDeleteResponse struct { // VirtualMachineScaleSetVMRunCommandsClientGetResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.Get. type VirtualMachineScaleSetVMRunCommandsClientGetResponse struct { + // Describes a Virtual Machine run command. VirtualMachineRunCommand } // VirtualMachineScaleSetVMRunCommandsClientListResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.NewListPager. type VirtualMachineScaleSetVMRunCommandsClientListResponse struct { + // The List run command operation response VirtualMachineRunCommandsListResult } // VirtualMachineScaleSetVMRunCommandsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMRunCommandsClient.BeginUpdate. type VirtualMachineScaleSetVMRunCommandsClientUpdateResponse struct { + // Describes a Virtual Machine run command. VirtualMachineRunCommand } @@ -1108,16 +1298,19 @@ type VirtualMachineScaleSetVMsClientDeleteResponse struct { // VirtualMachineScaleSetVMsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetVMsClient.GetInstanceView. type VirtualMachineScaleSetVMsClientGetInstanceViewResponse struct { + // The instance view of a virtual machine scale set VM. VirtualMachineScaleSetVMInstanceView } // VirtualMachineScaleSetVMsClientGetResponse contains the response from method VirtualMachineScaleSetVMsClient.Get. type VirtualMachineScaleSetVMsClientGetResponse struct { + // Describes a virtual machine scale set virtual machine. VirtualMachineScaleSetVM } // VirtualMachineScaleSetVMsClientListResponse contains the response from method VirtualMachineScaleSetVMsClient.NewListPager. type VirtualMachineScaleSetVMsClientListResponse struct { + // The List Virtual Machine Scale Set VMs operation response. VirtualMachineScaleSetVMListResult } @@ -1153,6 +1346,7 @@ type VirtualMachineScaleSetVMsClientRestartResponse struct { // VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachineScaleSetVMsClient.RetrieveBootDiagnosticsData. type VirtualMachineScaleSetVMsClientRetrieveBootDiagnosticsDataResponse struct { + // The SAS URIs of the console screenshot and serial log blobs. RetrieveBootDiagnosticsDataResult } @@ -1173,6 +1367,7 @@ type VirtualMachineScaleSetVMsClientStartResponse struct { // VirtualMachineScaleSetVMsClientUpdateResponse contains the response from method VirtualMachineScaleSetVMsClient.BeginUpdate. type VirtualMachineScaleSetVMsClientUpdateResponse struct { + // Describes a virtual machine scale set virtual machine. VirtualMachineScaleSetVM } @@ -1183,6 +1378,7 @@ type VirtualMachineScaleSetsClientConvertToSinglePlacementGroupResponse struct { // VirtualMachineScaleSetsClientCreateOrUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginCreateOrUpdate. type VirtualMachineScaleSetsClientCreateOrUpdateResponse struct { + // Describes a Virtual Machine Scale Set. VirtualMachineScaleSet } @@ -1204,41 +1400,49 @@ type VirtualMachineScaleSetsClientDeleteResponse struct { // VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse contains the response from method // VirtualMachineScaleSetsClient.ForceRecoveryServiceFabricPlatformUpdateDomainWalk. type VirtualMachineScaleSetsClientForceRecoveryServiceFabricPlatformUpdateDomainWalkResponse struct { + // Response after calling a manual recovery walk RecoveryWalkResponse } // VirtualMachineScaleSetsClientGetInstanceViewResponse contains the response from method VirtualMachineScaleSetsClient.GetInstanceView. type VirtualMachineScaleSetsClientGetInstanceViewResponse struct { + // The instance view of a virtual machine scale set. VirtualMachineScaleSetInstanceView } // VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse contains the response from method VirtualMachineScaleSetsClient.NewGetOSUpgradeHistoryPager. type VirtualMachineScaleSetsClientGetOSUpgradeHistoryResponse struct { + // List of Virtual Machine Scale Set OS Upgrade History operation response. VirtualMachineScaleSetListOSUpgradeHistory } // VirtualMachineScaleSetsClientGetResponse contains the response from method VirtualMachineScaleSetsClient.Get. type VirtualMachineScaleSetsClientGetResponse struct { + // Describes a Virtual Machine Scale Set. VirtualMachineScaleSet } // VirtualMachineScaleSetsClientListAllResponse contains the response from method VirtualMachineScaleSetsClient.NewListAllPager. type VirtualMachineScaleSetsClientListAllResponse struct { + // The List Virtual Machine operation response. VirtualMachineScaleSetListWithLinkResult } // VirtualMachineScaleSetsClientListByLocationResponse contains the response from method VirtualMachineScaleSetsClient.NewListByLocationPager. type VirtualMachineScaleSetsClientListByLocationResponse struct { + // The List Virtual Machine operation response. VirtualMachineScaleSetListResult } // VirtualMachineScaleSetsClientListResponse contains the response from method VirtualMachineScaleSetsClient.NewListPager. type VirtualMachineScaleSetsClientListResponse struct { + // The List Virtual Machine operation response. VirtualMachineScaleSetListResult } // VirtualMachineScaleSetsClientListSKUsResponse contains the response from method VirtualMachineScaleSetsClient.NewListSKUsPager. type VirtualMachineScaleSetsClientListSKUsResponse struct { + // The Virtual Machine Scale Set List Skus operation response. VirtualMachineScaleSetListSKUsResult } @@ -1294,21 +1498,25 @@ type VirtualMachineScaleSetsClientUpdateInstancesResponse struct { // VirtualMachineScaleSetsClientUpdateResponse contains the response from method VirtualMachineScaleSetsClient.BeginUpdate. type VirtualMachineScaleSetsClientUpdateResponse struct { + // Describes a Virtual Machine Scale Set. VirtualMachineScaleSet } // VirtualMachineSizesClientListResponse contains the response from method VirtualMachineSizesClient.NewListPager. type VirtualMachineSizesClientListResponse struct { + // The List Virtual Machine operation response. VirtualMachineSizeListResult } // VirtualMachinesClientAssessPatchesResponse contains the response from method VirtualMachinesClient.BeginAssessPatches. type VirtualMachinesClientAssessPatchesResponse struct { + // Describes the properties of an AssessPatches result. VirtualMachineAssessPatchesResult } // VirtualMachinesClientCaptureResponse contains the response from method VirtualMachinesClient.BeginCapture. type VirtualMachinesClientCaptureResponse struct { + // Output of virtual machine capture operation. VirtualMachineCaptureResult } @@ -1319,6 +1527,7 @@ type VirtualMachinesClientConvertToManagedDisksResponse struct { // VirtualMachinesClientCreateOrUpdateResponse contains the response from method VirtualMachinesClient.BeginCreateOrUpdate. type VirtualMachinesClientCreateOrUpdateResponse struct { + // Describes a Virtual Machine. VirtualMachine } @@ -1339,36 +1548,43 @@ type VirtualMachinesClientGeneralizeResponse struct { // VirtualMachinesClientGetResponse contains the response from method VirtualMachinesClient.Get. type VirtualMachinesClientGetResponse struct { + // Describes a Virtual Machine. VirtualMachine } // VirtualMachinesClientInstallPatchesResponse contains the response from method VirtualMachinesClient.BeginInstallPatches. type VirtualMachinesClientInstallPatchesResponse struct { + // The result summary of an installation operation. VirtualMachineInstallPatchesResult } // VirtualMachinesClientInstanceViewResponse contains the response from method VirtualMachinesClient.InstanceView. type VirtualMachinesClientInstanceViewResponse struct { + // The instance view of a virtual machine. VirtualMachineInstanceView } // VirtualMachinesClientListAllResponse contains the response from method VirtualMachinesClient.NewListAllPager. type VirtualMachinesClientListAllResponse struct { + // The List Virtual Machine operation response. VirtualMachineListResult } // VirtualMachinesClientListAvailableSizesResponse contains the response from method VirtualMachinesClient.NewListAvailableSizesPager. type VirtualMachinesClientListAvailableSizesResponse struct { + // The List Virtual Machine operation response. VirtualMachineSizeListResult } // VirtualMachinesClientListByLocationResponse contains the response from method VirtualMachinesClient.NewListByLocationPager. type VirtualMachinesClientListByLocationResponse struct { + // The List Virtual Machine operation response. VirtualMachineListResult } // VirtualMachinesClientListResponse contains the response from method VirtualMachinesClient.NewListPager. type VirtualMachinesClientListResponse struct { + // The List Virtual Machine operation response. VirtualMachineListResult } @@ -1404,6 +1620,7 @@ type VirtualMachinesClientRestartResponse struct { // VirtualMachinesClientRetrieveBootDiagnosticsDataResponse contains the response from method VirtualMachinesClient.RetrieveBootDiagnosticsData. type VirtualMachinesClientRetrieveBootDiagnosticsDataResponse struct { + // The SAS URIs of the console screenshot and serial log blobs. RetrieveBootDiagnosticsDataResult } @@ -1424,5 +1641,6 @@ type VirtualMachinesClientStartResponse struct { // VirtualMachinesClientUpdateResponse contains the response from method VirtualMachinesClient.BeginUpdate. type VirtualMachinesClientUpdateResponse struct { + // Describes a Virtual Machine. VirtualMachine }