diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 113b932457ab..2685fea8076f 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -2961,7 +2961,7 @@ packages: dev: false /array-flatten/1.1.1: - resolution: {integrity: sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=} + resolution: {integrity: sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==} dev: false /array-includes/3.1.6: @@ -3200,7 +3200,7 @@ packages: dev: false /buffer-equal-constant-time/1.0.1: - resolution: {integrity: sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=} + resolution: {integrity: sha512-zRpUiDwd/xk6ADqPMATG8vc9VPrkck7T07OIx0gnjmJAnHnTVXNQG3vfvWNuiZIkwu9KrKdA1iJKfsfTVxE6NA==} dev: false /buffer-from/1.1.2: @@ -3357,7 +3357,7 @@ packages: dev: false /charenc/0.0.2: - resolution: {integrity: sha1-wKHS86cJLgN3S/qD8UwPxXkKhmc=} + resolution: {integrity: sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==} dev: false /check-error/1.0.2: @@ -3493,6 +3493,7 @@ packages: /commander/2.20.3: resolution: {integrity: sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==} + requiresBuild: true dev: false /commondir/1.0.1: @@ -3500,7 +3501,7 @@ packages: dev: false /concat-map/0.0.1: - resolution: {integrity: sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=} + resolution: {integrity: sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==} dev: false /concurrently/6.5.1: @@ -3561,7 +3562,7 @@ packages: dev: false /cookie-signature/1.0.6: - resolution: {integrity: sha1-4wOogrNCzD7oylE6eZmXNNqzriw=} + resolution: {integrity: sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==} dev: false /cookie/0.4.2: @@ -3674,7 +3675,7 @@ packages: dev: false /crypt/0.0.2: - resolution: {integrity: sha1-iNf/fsDfuG9xPch7u0LQRNPmxBs=} + resolution: {integrity: sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==} dev: false /csv-parse/5.3.3: @@ -3928,7 +3929,7 @@ packages: dependencies: semver: 7.3.8 shelljs: 0.8.5 - typescript: 5.0.0-dev.20221206 + typescript: 5.0.0-dev.20221207 dev: false /downlevel-dts/0.8.0: @@ -3947,11 +3948,11 @@ packages: dev: false /edge-launcher/1.2.2: - resolution: {integrity: sha1-60Cq+9Bnpup27/+rBke81VCbN7I=} + resolution: {integrity: sha512-JcD5WBi3BHZXXVSSeEhl6sYO8g5cuynk/hifBzds2Bp4JdzCGLNMHgMCKu5DvrO1yatMgF0goFsxXRGus0yh1g==} dev: false /ee-first/1.1.1: - resolution: {integrity: sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=} + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} dev: false /electron-to-chromium/1.4.284: @@ -4832,7 +4833,7 @@ packages: dev: false /fresh/0.5.2: - resolution: {integrity: sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=} + resolution: {integrity: sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==} engines: {node: '>= 0.6'} dev: false @@ -4972,7 +4973,7 @@ packages: dev: false /github-from-package/0.0.0: - resolution: {integrity: sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=} + resolution: {integrity: sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==} dev: false /glob-parent/5.1.2: @@ -6388,7 +6389,7 @@ packages: dev: false /media-typer/0.3.0: - resolution: {integrity: sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=} + resolution: {integrity: sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==} engines: {node: '>= 0.6'} dev: false @@ -6398,7 +6399,7 @@ packages: dev: false /merge-descriptors/1.0.1: - resolution: {integrity: sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=} + resolution: {integrity: sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==} dev: false /merge-source-map/1.1.0: @@ -6815,7 +6816,7 @@ packages: dev: false /noms/0.0.0: - resolution: {integrity: sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=} + resolution: {integrity: sha512-lNDU9VJaOPxUmXcLb+HQFeUgQQPtMI24Gt6hgfuMHRJgMRHMF/qZ4HJD3GDru4sSw9IQl2jPjAYnQrdIeLbwow==} dependencies: inherits: 2.0.4 readable-stream: 1.0.34 @@ -8949,8 +8950,8 @@ packages: hasBin: true dev: false - /typescript/5.0.0-dev.20221206: - resolution: {integrity: sha512-Yl7kEx5CxhDafU4SgjeLmlUZ7kbxKZBXlvnQQlfRLHtXSRyy4BsTx6h6loHDnCWkmRwpcyPJ88uquATOUGfLwQ==} + /typescript/5.0.0-dev.20221207: + resolution: {integrity: sha512-xPWWjASgLapa35nseHVRmQK6L0k3E1hb8OcN3I7XZHqYGUxk3n+RcncQSb4gGVromTEy7OHaoNSWLrkDO0+T1Q==} engines: {node: '>=4.2.0'} hasBin: true dev: false @@ -9074,7 +9075,7 @@ packages: dev: false /utils-merge/1.0.1: - resolution: {integrity: sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=} + resolution: {integrity: sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==} engines: {node: '>= 0.4.0'} dev: false @@ -11051,7 +11052,7 @@ packages: dev: false file:projects/arm-compute-1.tgz: - resolution: {integrity: sha512-G/4QihxMoK0YpaoDGINMwblXU4fznZD0B+v1xgQR0BF+ClVa+YfEbFDi6uunOzOPjUqgmvdC2RNeIkPUqmUPew==, tarball: file:projects/arm-compute-1.tgz} + resolution: {integrity: sha512-/6LaxSwqtFEhu2InFsFMkgb0rpPdFdKxdXMKXptu3xmseGQDGW76+J57HP8/rFp09fIzlBaEVrFC2E10NxzUaQ==, tarball: file:projects/arm-compute-1.tgz} name: '@rush-temp/arm-compute-1' version: 0.0.0 dependencies: @@ -11063,18 +11064,18 @@ packages: '@rollup/plugin-multi-entry': 4.1.0_rollup@2.79.1 '@rollup/plugin-node-resolve': 13.3.0_rollup@2.79.1 '@types/chai': 4.3.4 + '@types/node': 14.18.33 chai: 4.3.7 cross-env: 7.0.3 mkdirp: 1.0.4 mocha: 7.2.0 rimraf: 3.0.2 rollup: 2.79.1 - rollup-plugin-sourcemaps: 0.6.3_rollup@2.79.1 + rollup-plugin-sourcemaps: 0.6.3_1225c068d0546e507df7db46196a6444 tslib: 2.4.1 - typescript: 4.6.4 + typescript: 4.8.4 uglify-js: 3.17.4 transitivePeerDependencies: - - '@types/node' - supports-color dev: false @@ -15778,7 +15779,7 @@ packages: dev: false file:projects/communication-job-router.tgz: - resolution: {integrity: sha512-/i/QMGXP/g10uWLW/0Wrait10N30QJaEJKnNioHUwg6wLgaZKnKkGQCyZgbHKAB7o8rkQsNSLIYBz920/Mt1Fg==, tarball: file:projects/communication-job-router.tgz} + resolution: {integrity: sha512-aJ10TxMFU+MdVJyQmkeThKCZbnZ6QmU9tzOoBz7yXNgmNlTMDVjYE6dpwJnWgHpDjOLHlYfnO5sEepLhZ/8Z8A==, tarball: file:projects/communication-job-router.tgz} name: '@rush-temp/communication-job-router' version: 0.0.0 dependencies: @@ -15830,7 +15831,7 @@ packages: dev: false file:projects/communication-network-traversal.tgz: - resolution: {integrity: sha512-8BxjW4TN+CR+jUFtm7WWGCLTSlmwVL5tHETlolRYZ4pT7mbg5u5U4g90FNC2cuVcWD21efKwcxwqtG7YuPF3pw==, tarball: file:projects/communication-network-traversal.tgz} + resolution: {integrity: sha512-/gHUTUZtOKjvHerwEWLt+fwQYvXqdowYDQg+aJXp5/Q3TJrnDnnZD0LB+cy7rsFVnhbcIz4i+E78C6FoVb4zFw==, tarball: file:projects/communication-network-traversal.tgz} name: '@rush-temp/communication-network-traversal' version: 0.0.0 dependencies: @@ -16145,7 +16146,7 @@ packages: dev: false file:projects/core-amqp.tgz: - resolution: {integrity: sha512-FohZhL1nEjGi/9HxIaQKjgP07gL1O++dXUtBoYbeIq4DJhlY8wivalEbwErJch88M5l+vOY0e9jKfjSp8VXXHg==, tarball: file:projects/core-amqp.tgz} + resolution: {integrity: sha512-vJ7aD2zobl65Rwr8xx9e21lUr0OnvQSx5Wnhyy4YWdtZA77wD5hTLqB3nXbtQhni6siHOObS5UgZepNRivjq/g==, tarball: file:projects/core-amqp.tgz} name: '@rush-temp/core-amqp' version: 0.0.0 dependencies: @@ -16877,7 +16878,7 @@ packages: dev: false file:projects/dtdl-parser.tgz: - resolution: {integrity: sha512-tpIsaZWhGDJnpVqy/VriUYjEM5qzcjiQQGnK0KfuZy5x36FdS9w0p5SVKr3fZWnYpBYRNST/8H6m79K3A5xYJw==, tarball: file:projects/dtdl-parser.tgz} + resolution: {integrity: sha512-oadak9uqVnuit3rJujUthnEnz749jsjM7CwpLJrcr6L5LeP56GUTojveukyCl5ZqNyN1z4Fc6q2rHtnFBKnZyw==, tarball: file:projects/dtdl-parser.tgz} name: '@rush-temp/dtdl-parser' version: 0.0.0 dependencies: @@ -16966,7 +16967,7 @@ packages: dev: false file:projects/event-hubs.tgz: - resolution: {integrity: sha512-j/S7lD5JD3mwUE5WQWMzk7VDFqwkWiIBtJZIPAha28VrJoOM51Wi88bhftXNzvzA8pWvUBYVQN8KiFz9He+PMg==, tarball: file:projects/event-hubs.tgz} + resolution: {integrity: sha512-8Z/Lp4mVyIyb92vRhanHwLEvH1v94/qa08iKbBRpTwyyFau+hFu+/F70Gsigf1ZP8z2WjrT3X5MpTKGi9PkMiA==, tarball: file:projects/event-hubs.tgz} name: '@rush-temp/event-hubs' version: 0.0.0 dependencies: @@ -18227,7 +18228,7 @@ packages: dev: false file:projects/notification-hubs.tgz: - resolution: {integrity: sha512-f2Mz829O/deVSeFCWsgd/wsbBvyPQeEsbqiZ5Mpji8E1Mt73o5Hsgpio4UhGwYiamC+Tht7VgZ9Tz5PqqJ2jCw==, tarball: file:projects/notification-hubs.tgz} + resolution: {integrity: sha512-4SZI+GsuvYZ7ljHY8A8lqLnCgwOEDYS1mGM0M64Dr+dP7gXDSiOf2pYw06fKFrXZVg9h9GQwgBImh6CVjJAmdA==, tarball: file:projects/notification-hubs.tgz} name: '@rush-temp/notification-hubs' version: 0.0.0 dependencies: diff --git a/sdk/compute/arm-compute/CHANGELOG.md b/sdk/compute/arm-compute/CHANGELOG.md index 0a49cbb2f431..4966a990c76c 100644 --- a/sdk/compute/arm-compute/CHANGELOG.md +++ b/sdk/compute/arm-compute/CHANGELOG.md @@ -1,15 +1,56 @@ # Release History + +## 20.0.0 (2022-12-08) + +**Features** -## 19.2.1 (Unreleased) - -### Features Added - -### Breaking Changes - -### Bugs Fixed + - Added Interface GalleryApplicationCustomAction + - Added Interface GalleryApplicationCustomActionParameter + - Added Interface GalleryApplicationVersionSafetyProfile + - Added Interface GalleryArtifactSafetyProfileBase + - Added Interface GalleryArtifactVersionFullSource + - Added Interface GalleryDiskImageSource + - Added Interface GalleryImageVersionSafetyProfile + - Added Interface LatestGalleryImageVersion + - Added Interface PolicyViolation + - Added Type Alias GalleryApplicationCustomActionParameterType + - Added Type Alias PolicyViolationCategory + - Interface GalleryApplication has a new optional parameter customActions + - Interface GalleryApplicationUpdate has a new optional parameter customActions + - Interface GalleryApplicationVersion has a new optional parameter safetyProfile + - Interface GalleryApplicationVersionPublishingProfile has a new optional parameter customActions + - Interface GalleryApplicationVersionUpdate has a new optional parameter safetyProfile + - Interface GalleryImageVersion has a new optional parameter safetyProfile + - Interface GalleryImageVersionUpdate has a new optional parameter safetyProfile + - Interface SharedGalleryImage has a new optional parameter eula + - Interface SharedGalleryImage has a new optional parameter privacyStatementUri + - Interface TargetRegion has a new optional parameter excludeFromLatest + - Interface VirtualMachineScaleSet has a new optional parameter constrainedMaximumCapacity + - Interface VirtualMachineScaleSetOSProfile has a new optional parameter requireGuestProvisionSignal + - Added Enum KnownPolicyViolationCategory -### Other Changes +**Breaking Changes** + - Interface AvailabilitySetsListBySubscriptionNextOptionalParams no longer has parameter expand + - Interface CapacityReservationGroupsListByResourceGroupNextOptionalParams no longer has parameter expand + - Interface CapacityReservationGroupsListBySubscriptionNextOptionalParams no longer has parameter expand + - Interface CloudServiceRoleInstancesListNextOptionalParams no longer has parameter expand + - Interface GalleryArtifactVersionSource no longer has parameter uri + - Interface ResourceSkusListNextOptionalParams no longer has parameter filter + - Interface ResourceSkusListNextOptionalParams no longer has parameter includeExtendedLocations + - Interface SharedGalleriesListNextOptionalParams no longer has parameter sharedTo + - Interface SharedGalleryImagesListNextOptionalParams no longer has parameter sharedTo + - Interface SharedGalleryImageVersionsListNextOptionalParams no longer has parameter sharedTo + - Interface VirtualMachineRunCommandsListByVirtualMachineNextOptionalParams no longer has parameter expand + - Interface VirtualMachineScaleSetVMRunCommandsListNextOptionalParams no longer has parameter expand + - Interface VirtualMachineScaleSetVMsListNextOptionalParams no longer has parameter expand + - Interface VirtualMachineScaleSetVMsListNextOptionalParams no longer has parameter filter + - Interface VirtualMachineScaleSetVMsListNextOptionalParams no longer has parameter select + - Interface VirtualMachinesListAllNextOptionalParams no longer has parameter filter + - Interface VirtualMachinesListAllNextOptionalParams no longer has parameter statusOnly + - Interface VirtualMachinesListNextOptionalParams no longer has parameter filter + + ## 19.2.0 (2022-09-21) **Features** diff --git a/sdk/compute/arm-compute/_meta.json b/sdk/compute/arm-compute/_meta.json index 2179f6dfb650..953fb499b733 100644 --- a/sdk/compute/arm-compute/_meta.json +++ b/sdk/compute/arm-compute/_meta.json @@ -1,8 +1,8 @@ { - "commit": "8ff0e3b8dc12cd793f4f2208d76f9f3a7f51176c", + "commit": "d5781a220004fed4523c1a6eba52c88b16708487", "readme": "specification/compute/resource-manager/readme.md", - "autorest_command": "autorest --version=3.8.4 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\compute\\resource-manager\\readme.md --use=@autorest/typescript@6.0.0-rc.1.20220727.1 --generate-sample=true", + "autorest_command": "autorest --version=3.9.3 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/compute/resource-manager/readme.md --use=@autorest/typescript@6.0.0-rc.4", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.4.2", - "use": "@autorest/typescript@6.0.0-rc.1.20220727.1" + "release_tool": "@azure-tools/js-sdk-release-tools@2.5.2", + "use": "@autorest/typescript@6.0.0-rc.4" } \ No newline at end of file diff --git a/sdk/compute/arm-compute/package.json b/sdk/compute/arm-compute/package.json index de94dcd17301..5e2b0a36eeb0 100644 --- a/sdk/compute/arm-compute/package.json +++ b/sdk/compute/arm-compute/package.json @@ -3,7 +3,7 @@ "sdk-type": "mgmt", "author": "Microsoft Corporation", "description": "A generated SDK for ComputeManagementClient.", - "version": "19.2.1", + "version": "20.0.0", "engines": { "node": ">=14.0.0" }, @@ -11,7 +11,7 @@ "@azure/core-lro": "^2.2.0", "@azure/abort-controller": "^1.0.0", "@azure/core-paging": "^1.2.0", - "@azure/core-client": "^1.5.0", + "@azure/core-client": "^1.6.1", "@azure/core-auth": "^1.3.0", "@azure/core-rest-pipeline": "^1.8.0", "tslib": "^2.2.0" @@ -36,7 +36,7 @@ "mkdirp": "^1.0.4", "rollup": "^2.66.1", "rollup-plugin-sourcemaps": "^0.6.3", - "typescript": "~4.6.0", + "typescript": "~4.8.0", "uglify-js": "^3.4.9", "rimraf": "^3.0.0", "@azure/identity": "^2.0.1", @@ -46,8 +46,8 @@ "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", - "@azure/dev-tool": "^1.0.0", - "@azure/arm-network": "^26.0.0" + "@types/node": "^14.0.0", + "@azure/dev-tool": "^1.0.0" }, "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/compute/arm-compute", "repository": { @@ -110,13 +110,5 @@ } ] }, - "autoPublish": true, - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-compute?view=azure-node-preview" - } -} + "autoPublish": true +} \ No newline at end of file diff --git a/sdk/compute/arm-compute/review/arm-compute.api.md b/sdk/compute/arm-compute/review/arm-compute.api.md index 9052c4e28443..1f83ffc8f6b5 100644 --- a/sdk/compute/arm-compute/review/arm-compute.api.md +++ b/sdk/compute/arm-compute/review/arm-compute.api.md @@ -146,7 +146,6 @@ export type AvailabilitySetsListAvailableSizesResponse = VirtualMachineSizeListR // @public export interface AvailabilitySetsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -290,7 +289,6 @@ export type CapacityReservationGroupsGetResponse = CapacityReservationGroup; // @public export interface CapacityReservationGroupsListByResourceGroupNextOptionalParams extends coreClient.OperationOptions { - expand?: ExpandTypesForGetCapacityReservationGroups; } // @public @@ -306,7 +304,6 @@ export type CapacityReservationGroupsListByResourceGroupResponse = CapacityReser // @public export interface CapacityReservationGroupsListBySubscriptionNextOptionalParams extends coreClient.OperationOptions { - expand?: ExpandTypesForGetCapacityReservationGroups; } // @public @@ -623,7 +620,6 @@ export type CloudServiceRoleInstancesGetResponse = RoleInstance; // @public export interface CloudServiceRoleInstancesListNextOptionalParams extends coreClient.OperationOptions { - expand?: InstanceViewTypes; } // @public @@ -2198,6 +2194,7 @@ export interface Gallery extends Resource { // @public export interface GalleryApplication extends Resource { + customActions?: GalleryApplicationCustomAction[]; description?: string; endOfLifeDate?: Date; eula?: string; @@ -2206,6 +2203,26 @@ export interface GalleryApplication extends Resource { supportedOSType?: OperatingSystemTypes; } +// @public +export interface GalleryApplicationCustomAction { + description?: string; + name: string; + parameters?: GalleryApplicationCustomActionParameter[]; + script: string; +} + +// @public +export interface GalleryApplicationCustomActionParameter { + defaultValue?: string; + description?: string; + name: string; + required?: boolean; + type?: GalleryApplicationCustomActionParameterType; +} + +// @public +export type GalleryApplicationCustomActionParameterType = "String" | "ConfigurationDataBlob" | "LogOutputBlob"; + // @public export interface GalleryApplicationList { nextLink?: string; @@ -2271,6 +2288,7 @@ export type GalleryApplicationsUpdateResponse = GalleryApplication; // @public export interface GalleryApplicationUpdate extends UpdateResourceDefinition { + customActions?: GalleryApplicationCustomAction[]; description?: string; endOfLifeDate?: Date; eula?: string; @@ -2284,6 +2302,7 @@ export interface GalleryApplicationVersion extends Resource { readonly provisioningState?: GalleryProvisioningState; publishingProfile?: GalleryApplicationVersionPublishingProfile; readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryApplicationVersionSafetyProfile; } // @public @@ -2297,6 +2316,7 @@ export interface GalleryApplicationVersionPublishingProfile extends GalleryArtif advancedSettings?: { [propertyName: string]: string; }; + customActions?: GalleryApplicationCustomAction[]; enableHealthCheck?: boolean; // (undocumented) manageActions?: UserArtifactManage; @@ -2316,6 +2336,10 @@ export interface GalleryApplicationVersions { listByGalleryApplication(resourceGroupName: string, galleryName: string, galleryApplicationName: string, options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface GalleryApplicationVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { +} + // @public export interface GalleryApplicationVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -2367,6 +2391,7 @@ export interface GalleryApplicationVersionUpdate extends UpdateResourceDefinitio readonly provisioningState?: GalleryProvisioningState; publishingProfile?: GalleryApplicationVersionPublishingProfile; readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryApplicationVersionSafetyProfile; } // @public @@ -2381,15 +2406,24 @@ export interface GalleryArtifactPublishingProfileBase { targetRegions?: TargetRegion[]; } +// @public +export interface GalleryArtifactSafetyProfileBase { + allowDeletionOfReplicatedLocations?: boolean; +} + // @public export interface GalleryArtifactSource { managedImage: ManagedArtifact; } +// @public +export interface GalleryArtifactVersionFullSource extends GalleryArtifactVersionSource { + communityGalleryImageId?: string; +} + // @public export interface GalleryArtifactVersionSource { id?: string; - uri?: string; } // @public @@ -2401,7 +2435,13 @@ export interface GalleryDataDiskImage extends GalleryDiskImage { export interface GalleryDiskImage { hostCaching?: HostCaching; readonly sizeInGB?: number; - source?: GalleryArtifactVersionSource; + source?: GalleryDiskImageSource; +} + +// @public +export interface GalleryDiskImageSource extends GalleryArtifactVersionSource { + storageAccountId?: string; + uri?: string; } // @public @@ -2541,6 +2581,7 @@ export interface GalleryImageVersion extends Resource { readonly provisioningState?: GalleryProvisioningState; publishingProfile?: GalleryImageVersionPublishingProfile; readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryImageVersionSafetyProfile; storageProfile?: GalleryImageVersionStorageProfile; } @@ -2566,6 +2607,12 @@ export interface GalleryImageVersions { listByGalleryImage(resourceGroupName: string, galleryName: string, galleryImageName: string, options?: GalleryImageVersionsListByGalleryImageOptionalParams): PagedAsyncIterableIterator; } +// @public +export interface GalleryImageVersionSafetyProfile extends GalleryArtifactSafetyProfileBase { + readonly policyViolations?: PolicyViolation[]; + readonly reportedForPolicyViolation?: boolean; +} + // @public export interface GalleryImageVersionsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { resumeFrom?: string; @@ -2607,7 +2654,7 @@ export type GalleryImageVersionsListByGalleryImageResponse = GalleryImageVersion export interface GalleryImageVersionStorageProfile { dataDiskImages?: GalleryDataDiskImage[]; osDiskImage?: GalleryOSDiskImage; - source?: GalleryArtifactVersionSource; + source?: GalleryArtifactVersionFullSource; } // @public @@ -2624,6 +2671,7 @@ export interface GalleryImageVersionUpdate extends UpdateResourceDefinition { readonly provisioningState?: GalleryProvisioningState; publishingProfile?: GalleryImageVersionPublishingProfile; readonly replicationStatus?: ReplicationStatus; + safetyProfile?: GalleryImageVersionSafetyProfile; storageProfile?: GalleryImageVersionStorageProfile; } @@ -2677,6 +2725,9 @@ export interface GalleryUpdate extends UpdateResourceDefinition { softDeletePolicy?: SoftDeletePolicy; } +// @public +export function getContinuationToken(page: unknown): string | undefined; + // @public export interface GrantAccessData { // (undocumented) @@ -3290,6 +3341,14 @@ export enum KnownPatchOperationStatus { Unknown = "Unknown" } +// @public +export enum KnownPolicyViolationCategory { + CopyrightValidation = "CopyrightValidation", + ImageFlaggedUnsafe = "ImageFlaggedUnsafe", + IpTheft = "IpTheft", + Other = "Other" +} + // @public export enum KnownPrivateEndpointConnectionProvisioningState { Creating = "Creating", @@ -3723,6 +3782,12 @@ export interface LastPatchInstallationSummary { readonly status?: PatchOperationStatus; } +// @public +export interface LatestGalleryImageVersion { + latestVersionName?: string; + location?: string; +} + // @public export interface LinuxConfiguration { disablePasswordAuthentication?: boolean; @@ -4084,6 +4149,15 @@ export interface Plan { publisher?: string; } +// @public +export interface PolicyViolation { + category?: PolicyViolationCategory; + details?: string; +} + +// @public +export type PolicyViolationCategory = string; + // @public export interface PriorityMixPolicy { baseRegularPriorityCount?: number; @@ -4443,8 +4517,6 @@ export interface ResourceSkus { // @public export interface ResourceSkusListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - includeExtendedLocations?: string; } // @public @@ -4865,7 +4937,6 @@ export type SharedGalleriesGetResponse = SharedGallery; // @public export interface SharedGalleriesListNextOptionalParams extends coreClient.OperationOptions { - sharedTo?: SharedToValues; } // @public @@ -4902,11 +4973,13 @@ export interface SharedGalleryImage extends PirSharedGalleryResource { architecture?: Architecture; disallowed?: Disallowed; endOfLifeDate?: Date; + eula?: string; features?: GalleryImageFeature[]; hyperVGeneration?: HyperVGeneration; identifier?: GalleryImageIdentifier; osState?: OperatingSystemStateTypes; osType?: OperatingSystemTypes; + privacyStatementUri?: string; purchasePlan?: ImagePurchasePlan; recommended?: RecommendedMachineConfiguration; } @@ -4932,7 +5005,6 @@ export type SharedGalleryImagesGetResponse = SharedGalleryImage; // @public export interface SharedGalleryImagesListNextOptionalParams extends coreClient.OperationOptions { - sharedTo?: SharedToValues; } // @public @@ -4975,7 +5047,6 @@ export type SharedGalleryImageVersionsGetResponse = SharedGalleryImageVersion; // @public export interface SharedGalleryImageVersionsListNextOptionalParams extends coreClient.OperationOptions { - sharedTo?: SharedToValues; } // @public @@ -5383,6 +5454,7 @@ export interface SystemData { // @public export interface TargetRegion { encryption?: EncryptionImages; + excludeFromLatest?: boolean; name: string; regionalReplicaCount?: number; storageAccountType?: StorageAccountType; @@ -5654,7 +5726,7 @@ export interface VirtualMachineExtensionImage extends Resource { // @public export interface VirtualMachineExtensionImages { - get(location: string, publisherName: string, version: string, typeParam: string, options?: VirtualMachineExtensionImagesGetOptionalParams): Promise; + get(location: string, publisherName: string, typeParam: string, version: string, options?: VirtualMachineExtensionImagesGetOptionalParams): Promise; listTypes(location: string, publisherName: string, options?: VirtualMachineExtensionImagesListTypesOptionalParams): Promise; listVersions(location: string, publisherName: string, typeParam: string, options?: VirtualMachineExtensionImagesListVersionsOptionalParams): Promise; } @@ -6116,7 +6188,6 @@ export type VirtualMachineRunCommandsGetResponse = RunCommandDocument; // @public export interface VirtualMachineRunCommandsListByVirtualMachineNextOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -6232,6 +6303,7 @@ export type VirtualMachinesAssessPatchesResponse = VirtualMachineAssessPatchesRe export interface VirtualMachineScaleSet extends Resource { additionalCapabilities?: AdditionalCapabilities; automaticRepairsPolicy?: AutomaticRepairsPolicy; + constrainedMaximumCapacity?: boolean; doNotRunExtensionsOnOverprovisionedVMs?: boolean; extendedLocation?: ExtendedLocation; hostGroup?: SubResource; @@ -6502,6 +6574,7 @@ export interface VirtualMachineScaleSetOSProfile { computerNamePrefix?: string; customData?: string; linuxConfiguration?: LinuxConfiguration; + requireGuestProvisionSignal?: boolean; secrets?: VaultSecretGroup[]; windowsConfiguration?: WindowsConfiguration; } @@ -7163,7 +7236,6 @@ export type VirtualMachineScaleSetVMRunCommandsGetResponse = VirtualMachineRunCo // @public export interface VirtualMachineScaleSetVMRunCommandsListNextOptionalParams extends coreClient.OperationOptions { - expand?: string; } // @public @@ -7247,9 +7319,6 @@ export type VirtualMachineScaleSetVMsGetResponse = VirtualMachineScaleSetVM; // @public export interface VirtualMachineScaleSetVMsListNextOptionalParams extends coreClient.OperationOptions { - expand?: string; - filter?: string; - select?: string; } // @public @@ -7437,8 +7506,6 @@ export type VirtualMachineSizeTypes = string; // @public export interface VirtualMachinesListAllNextOptionalParams extends coreClient.OperationOptions { - filter?: string; - statusOnly?: string; } // @public @@ -7476,7 +7543,6 @@ export type VirtualMachinesListByLocationResponse = VirtualMachineListResult; // @public export interface VirtualMachinesListNextOptionalParams extends coreClient.OperationOptions { - filter?: string; } // @public diff --git a/sdk/compute/arm-compute/src/computeManagementClient.ts b/sdk/compute/arm-compute/src/computeManagementClient.ts index 094852bc8f74..1db9506bfe48 100644 --- a/sdk/compute/arm-compute/src/computeManagementClient.ts +++ b/sdk/compute/arm-compute/src/computeManagementClient.ts @@ -145,22 +145,19 @@ export class ComputeManagementClient extends coreClient.ServiceClient { credential: credentials }; - const packageDetails = `azsdk-js-arm-compute/19.2.1`; + const packageDetails = `azsdk-js-arm-compute/20.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`; - if (!options.credentialScopes) { - options.credentialScopes = ["https://management.azure.com/.default"]; - } const optionsWithDefaults = { ...defaults, ...options, userAgentOptions: { userAgentPrefix }, - baseUri: + endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com" }; super(optionsWithDefaults); @@ -186,7 +183,9 @@ export class ComputeManagementClient extends coreClient.ServiceClient { this.pipeline.addPolicy( coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, - scopes: `${optionsWithDefaults.credentialScopes}`, + scopes: + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge diff --git a/sdk/compute/arm-compute/src/index.ts b/sdk/compute/arm-compute/src/index.ts index 67331a75789a..4f342674dcb5 100644 --- a/sdk/compute/arm-compute/src/index.ts +++ b/sdk/compute/arm-compute/src/index.ts @@ -7,6 +7,7 @@ */ /// +export { getContinuationToken } from "./pagingHelper"; export * from "./models"; export { ComputeManagementClient } from "./computeManagementClient"; export * from "./operationsInterfaces"; diff --git a/sdk/compute/arm-compute/src/models/index.ts b/sdk/compute/arm-compute/src/models/index.ts index fb48e799858c..74f3587e018b 100644 --- a/sdk/compute/arm-compute/src/models/index.ts +++ b/sdk/compute/arm-compute/src/models/index.ts @@ -267,6 +267,8 @@ export interface VirtualMachineScaleSetOSProfile { secrets?: VaultSecretGroup[]; /** Specifies whether extension operations should be allowed on the virtual machine scale set.

This may only be set to False when no extensions are present on the virtual machine scale set. */ allowExtensionOperations?: boolean; + /** Optional property which must either be set to True or omitted. */ + requireGuestProvisionSignal?: boolean; } /** Specifies Windows operating system settings on the virtual machine. */ @@ -3419,6 +3421,8 @@ export interface TargetRegion { storageAccountType?: StorageAccountType; /** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ encryption?: EncryptionImages; + /** Contains the flag setting to hide an image when users specify version='latest' */ + excludeFromLatest?: boolean; } /** Optional. Allows users to provide customer managed keys for encrypting the OS and data disks in the gallery artifact. */ @@ -3465,8 +3469,8 @@ export interface GalleryExtendedLocation { /** This is the storage profile of a Gallery Image Version. */ export interface GalleryImageVersionStorageProfile { - /** The gallery artifact version source. */ - source?: GalleryArtifactVersionSource; + /** The source of the gallery artifact version. */ + source?: GalleryArtifactVersionFullSource; /** This is the OS disk image. */ osDiskImage?: GalleryOSDiskImage; /** A list of data disk images. */ @@ -3477,8 +3481,6 @@ export interface GalleryImageVersionStorageProfile { export interface GalleryArtifactVersionSource { /** The id of the gallery artifact version source. Can specify a disk uri, snapshot uri, user image or storage account resource. */ id?: string; - /** The uri of the gallery artifact version source. Currently used to specify vhd/blob source. */ - uri?: string; } /** This is the disk image base class. */ @@ -3490,8 +3492,22 @@ export interface GalleryDiskImage { readonly sizeInGB?: number; /** The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite' */ hostCaching?: HostCaching; - /** The gallery artifact version source. */ - source?: GalleryArtifactVersionSource; + /** The source for the disk image. */ + source?: GalleryDiskImageSource; +} + +/** A policy violation reported against a gallery artifact. */ +export interface PolicyViolation { + /** Describes the nature of the policy violation. */ + category?: PolicyViolationCategory; + /** Describes specific details about why this policy violation was reported. */ + details?: string; +} + +/** This is the safety profile of the Gallery Artifact Version. */ +export interface GalleryArtifactSafetyProfileBase { + /** Indicates whether or not removing this Gallery Image Version from replicated regions is allowed. */ + allowDeletionOfReplicatedLocations?: boolean; } /** This is the replication status of the gallery image version. */ @@ -3532,6 +3548,32 @@ export interface RegionalReplicationStatus { readonly progress?: number; } +/** A custom action that can be performed with a Gallery Application Version. */ +export interface GalleryApplicationCustomAction { + /** The name of the custom action. Must be unique within the Gallery Application Version. */ + name: string; + /** The script to run when executing this custom action. */ + script: string; + /** Description to help the users understand what this custom action does. */ + description?: string; + /** The parameters that this custom action uses */ + parameters?: GalleryApplicationCustomActionParameter[]; +} + +/** The definition of a parameter that can be passed to a custom action of a Gallery Application Version. */ +export interface GalleryApplicationCustomActionParameter { + /** The name of the custom action. Must be unique within the Gallery Application Version. */ + name: string; + /** Indicates whether this parameter must be passed when running the custom action. */ + required?: boolean; + /** Specifies the type of the custom action parameter. Possible values are: String, ConfigurationDataBlob or LogOutputBlob */ + type?: GalleryApplicationCustomActionParameterType; + /** The default value of the parameter. Only applies to string types */ + defaultValue?: string; + /** A description to help users understand what this parameter means */ + description?: string; +} + /** The source image from which the Image Version is going to be created. */ export interface UserArtifactSource { /** Required. The mediaLink of the artifact, must be a readable storage page blob. */ @@ -4340,6 +4382,14 @@ export interface ManagedArtifact { id: string; } +/** The gallery image version with latest version in a particular region. */ +export interface LatestGalleryImageVersion { + /** The name of the latest version in the region. */ + latestVersionName?: string; + /** region of the Gallery Image Version. */ + location?: string; +} + /** Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. */ export interface ImageReference extends SubResource { /** The image publisher. */ @@ -4731,6 +4781,8 @@ export interface VirtualMachineScaleSet extends Resource { * NOTE: This property will not be serialized. It can only be populated by the server. */ readonly timeCreated?: Date; + /** Optional property which must either be set to True or omitted. */ + constrainedMaximumCapacity?: boolean; } /** The status of the latest virtual machine scale set rolling upgrade. */ @@ -5487,6 +5539,8 @@ export interface GalleryImageVersion extends Resource { readonly provisioningState?: GalleryProvisioningState; /** This is the storage profile of a Gallery Image Version. */ storageProfile?: GalleryImageVersionStorageProfile; + /** This is the safety profile of the Gallery Image Version. */ + safetyProfile?: GalleryImageVersionSafetyProfile; /** * This is the replication status of the gallery image version. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -5508,12 +5562,16 @@ export interface GalleryApplication extends Resource { endOfLifeDate?: Date; /** This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

**Windows**

**Linux** */ supportedOSType?: OperatingSystemTypes; + /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ + customActions?: GalleryApplicationCustomAction[]; } /** Specifies information about the gallery Application Version that you want to create or update. */ export interface GalleryApplicationVersion extends Resource { /** The publishing profile of a gallery image version. */ publishingProfile?: GalleryApplicationVersionPublishingProfile; + /** The safety profile of the Gallery Application Version. */ + safetyProfile?: GalleryApplicationVersionSafetyProfile; /** * The provisioning state, which only appears in the response. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -6115,6 +6173,8 @@ export interface GalleryImageVersionUpdate extends UpdateResourceDefinition { readonly provisioningState?: GalleryProvisioningState; /** This is the storage profile of a Gallery Image Version. */ storageProfile?: GalleryImageVersionStorageProfile; + /** This is the safety profile of the Gallery Image Version. */ + safetyProfile?: GalleryImageVersionSafetyProfile; /** * This is the replication status of the gallery image version. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -6136,6 +6196,8 @@ export interface GalleryApplicationUpdate extends UpdateResourceDefinition { endOfLifeDate?: Date; /** This property allows you to specify the supported type of the OS that application is built for.

Possible values are:

**Windows**

**Linux** */ supportedOSType?: OperatingSystemTypes; + /** A list of custom actions that can be performed with all of the Gallery Application Versions within this Gallery Application. */ + customActions?: GalleryApplicationCustomAction[]; } /** Specifies information about the gallery Application Version that you want to update. */ @@ -6143,6 +6205,8 @@ export interface GalleryApplicationVersionUpdate extends UpdateResourceDefinition { /** The publishing profile of a gallery image version. */ publishingProfile?: GalleryApplicationVersionPublishingProfile; + /** The safety profile of the Gallery Application Version. */ + safetyProfile?: GalleryApplicationVersionSafetyProfile; /** * The provisioning state, which only appears in the response. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -6171,6 +6235,8 @@ export interface GalleryApplicationVersionPublishingProfile advancedSettings?: { [propertyName: string]: string }; /** Optional. Whether or not this application reports health. */ enableHealthCheck?: boolean; + /** A list of custom actions that can be performed with this Gallery Application Version. */ + customActions?: GalleryApplicationCustomAction[]; } /** Contains encryption settings for an OS disk image. */ @@ -6185,6 +6251,21 @@ export interface DataDiskImageEncryption extends DiskImageEncryption { lun: number; } +/** The source of the gallery artifact version. */ +export interface GalleryArtifactVersionFullSource + extends GalleryArtifactVersionSource { + /** The resource Id of the source Community Gallery Image. Only required when using Community Gallery Image as a source. */ + communityGalleryImageId?: string; +} + +/** The source for the disk image. */ +export interface GalleryDiskImageSource extends GalleryArtifactVersionSource { + /** The uri of the gallery artifact version source. Currently used to specify vhd/blob source. */ + uri?: string; + /** The Storage Account Id that contains the vhd blob being used as a source for this artifact version. */ + storageAccountId?: string; +} + /** This is the OS disk image. */ export interface GalleryOSDiskImage extends GalleryDiskImage {} @@ -6194,6 +6275,25 @@ export interface GalleryDataDiskImage extends GalleryDiskImage { lun: number; } +/** This is the safety profile of the Gallery Image Version. */ +export interface GalleryImageVersionSafetyProfile + extends GalleryArtifactSafetyProfileBase { + /** + * Indicates whether this image has been reported as violating Microsoft's policies. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly reportedForPolicyViolation?: boolean; + /** + * A list of Policy Violations that have been reported for this Gallery Image Version. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly policyViolations?: PolicyViolation[]; +} + +/** The safety profile of the Gallery Application Version. */ +export interface GalleryApplicationVersionSafetyProfile + extends GalleryArtifactSafetyProfileBase {} + /** Base information about the shared gallery resource in pir. */ export interface PirSharedGalleryResource extends PirResource { /** The unique id of this shared gallery. */ @@ -6303,6 +6403,10 @@ export interface SharedGalleryImage extends PirSharedGalleryResource { purchasePlan?: ImagePurchasePlan; /** The architecture of the image. Applicable to OS disks only. */ architecture?: Architecture; + /** Privacy statement uri for the current community gallery image. */ + privacyStatementUri?: string; + /** End-user license agreement for the current community gallery image. */ + eula?: string; } /** Specifies information about the gallery image version that you want to create or update. */ @@ -8492,6 +8596,30 @@ export enum KnownGalleryExtendedLocationType { */ export type GalleryExtendedLocationType = string; +/** Known values of {@link PolicyViolationCategory} that the service accepts. */ +export enum KnownPolicyViolationCategory { + /** Other */ + Other = "Other", + /** ImageFlaggedUnsafe */ + ImageFlaggedUnsafe = "ImageFlaggedUnsafe", + /** CopyrightValidation */ + CopyrightValidation = "CopyrightValidation", + /** IpTheft */ + IpTheft = "IpTheft" +} + +/** + * Defines values for PolicyViolationCategory. \ + * {@link KnownPolicyViolationCategory} can be used interchangeably with PolicyViolationCategory, + * this enum contains the known values that the service supports. + * ### Known values supported by the service + * **Other** \ + * **ImageFlaggedUnsafe** \ + * **CopyrightValidation** \ + * **IpTheft** + */ +export type PolicyViolationCategory = string; + /** Known values of {@link AggregatedReplicationState} that the service accepts. */ export enum KnownAggregatedReplicationState { /** Unknown */ @@ -8738,6 +8866,11 @@ export type ResourceSkuRestrictionsReasonCode = | "NotAvailableForSubscription"; /** Defines values for HostCaching. */ export type HostCaching = "None" | "ReadOnly" | "ReadWrite"; +/** Defines values for GalleryApplicationCustomActionParameterType. */ +export type GalleryApplicationCustomActionParameterType = + | "String" + | "ConfigurationDataBlob" + | "LogOutputBlob"; /** Optional parameters. */ export interface OperationsListOptionalParams @@ -9325,14 +9458,7 @@ export type VirtualMachineScaleSetVMsRunCommandResponse = RunCommandResult; /** Optional parameters. */ export interface VirtualMachineScaleSetVMsListNextOptionalParams - extends coreClient.OperationOptions { - /** 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type VirtualMachineScaleSetVMsListNextResponse = VirtualMachineScaleSetVMListResult; @@ -9640,22 +9766,14 @@ export type VirtualMachinesListByLocationNextResponse = VirtualMachineListResult /** Optional parameters. */ export interface VirtualMachinesListNextOptionalParams - extends coreClient.OperationOptions { - /** 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type VirtualMachinesListNextResponse = VirtualMachineListResult; /** Optional parameters. */ export interface VirtualMachinesListAllNextOptionalParams - extends coreClient.OperationOptions { - /** 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listAllNext operation. */ export type VirtualMachinesListAllNextResponse = VirtualMachineListResult; @@ -9826,10 +9944,7 @@ export type AvailabilitySetsListAvailableSizesResponse = VirtualMachineSizeListR /** Optional parameters. */ export interface AvailabilitySetsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply to the operation. Allowed values are 'instanceView'. */ - expand?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ export type AvailabilitySetsListBySubscriptionNextResponse = AvailabilitySetListResult; @@ -10290,20 +10405,14 @@ export type CapacityReservationGroupsListBySubscriptionResponse = CapacityReserv /** Optional parameters. */ export interface CapacityReservationGroupsListByResourceGroupNextOptionalParams - extends coreClient.OperationOptions { - /** 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByResourceGroupNext operation. */ export type CapacityReservationGroupsListByResourceGroupNextResponse = CapacityReservationGroupListResult; /** Optional parameters. */ export interface CapacityReservationGroupsListBySubscriptionNextOptionalParams - extends coreClient.OperationOptions { - /** 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listBySubscriptionNext operation. */ export type CapacityReservationGroupsListBySubscriptionNextResponse = CapacityReservationGroupListResult; @@ -10465,10 +10574,7 @@ export type VirtualMachineRunCommandsListNextResponse = RunCommandListResult; /** Optional parameters. */ export interface VirtualMachineRunCommandsListByVirtualMachineNextOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listByVirtualMachineNext operation. */ export type VirtualMachineRunCommandsListByVirtualMachineNextResponse = VirtualMachineRunCommandsListResult; @@ -10528,10 +10634,7 @@ export type VirtualMachineScaleSetVMRunCommandsListResponse = VirtualMachineRunC /** Optional parameters. */ export interface VirtualMachineScaleSetVMRunCommandsListNextOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply on the operation. */ - expand?: string; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type VirtualMachineScaleSetVMRunCommandsListNextResponse = VirtualMachineRunCommandsListResult; @@ -10965,12 +11068,7 @@ export type ResourceSkusListResponse = ResourceSkusResult; /** Optional parameters. */ export interface ResourceSkusListNextOptionalParams - extends coreClient.OperationOptions { - /** 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; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type ResourceSkusListNextResponse = ResourceSkusResult; @@ -11301,10 +11399,7 @@ export type SharedGalleriesGetResponse = SharedGallery; /** Optional parameters. */ export interface SharedGalleriesListNextOptionalParams - extends coreClient.OperationOptions { - /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ - sharedTo?: SharedToValues; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type SharedGalleriesListNextResponse = SharedGalleryList; @@ -11328,10 +11423,7 @@ export type SharedGalleryImagesGetResponse = SharedGalleryImage; /** Optional parameters. */ export interface SharedGalleryImagesListNextOptionalParams - extends coreClient.OperationOptions { - /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ - sharedTo?: SharedToValues; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type SharedGalleryImagesListNextResponse = SharedGalleryImageList; @@ -11355,10 +11447,7 @@ export type SharedGalleryImageVersionsGetResponse = SharedGalleryImageVersion; /** Optional parameters. */ export interface SharedGalleryImageVersionsListNextOptionalParams - extends coreClient.OperationOptions { - /** The query parameter to decide what shared galleries to fetch when doing listing operations. */ - sharedTo?: SharedToValues; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type SharedGalleryImageVersionsListNextResponse = SharedGalleryImageVersionList; @@ -11499,10 +11588,7 @@ export type CloudServiceRoleInstancesGetRemoteDesktopFileResponse = { /** Optional parameters. */ export interface CloudServiceRoleInstancesListNextOptionalParams - extends coreClient.OperationOptions { - /** The expand expression to apply to the operation. 'UserData' is not supported for cloud services. */ - expand?: InstanceViewTypes; -} + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type CloudServiceRoleInstancesListNextResponse = RoleInstanceListResult; diff --git a/sdk/compute/arm-compute/src/models/mappers.ts b/sdk/compute/arm-compute/src/models/mappers.ts index 4e6072824d41..925742906360 100644 --- a/sdk/compute/arm-compute/src/models/mappers.ts +++ b/sdk/compute/arm-compute/src/models/mappers.ts @@ -743,6 +743,12 @@ export const VirtualMachineScaleSetOSProfile: coreClient.CompositeMapper = { type: { name: "Boolean" } + }, + requireGuestProvisionSignal: { + serializedName: "requireGuestProvisionSignal", + type: { + name: "Boolean" + } } } } @@ -8906,6 +8912,12 @@ export const TargetRegion: coreClient.CompositeMapper = { name: "Composite", className: "EncryptionImages" } + }, + excludeFromLatest: { + serializedName: "excludeFromLatest", + type: { + name: "Boolean" + } } } } @@ -9046,7 +9058,7 @@ export const GalleryImageVersionStorageProfile: coreClient.CompositeMapper = { serializedName: "source", type: { name: "Composite", - className: "GalleryArtifactVersionSource" + className: "GalleryArtifactVersionFullSource" } }, osDiskImage: { @@ -9082,12 +9094,6 @@ export const GalleryArtifactVersionSource: coreClient.CompositeMapper = { type: { name: "String" } - }, - uri: { - serializedName: "uri", - type: { - name: "String" - } } } } @@ -9116,7 +9122,43 @@ export const GalleryDiskImage: coreClient.CompositeMapper = { serializedName: "source", type: { name: "Composite", - className: "GalleryArtifactVersionSource" + className: "GalleryDiskImageSource" + } + } + } + } +}; + +export const PolicyViolation: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "PolicyViolation", + modelProperties: { + category: { + serializedName: "category", + type: { + name: "String" + } + }, + details: { + serializedName: "details", + type: { + name: "String" + } + } + } + } +}; + +export const GalleryArtifactSafetyProfileBase: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryArtifactSafetyProfileBase", + modelProperties: { + allowDeletionOfReplicatedLocations: { + serializedName: "allowDeletionOfReplicatedLocations", + type: { + name: "Boolean" } } } @@ -9189,6 +9231,88 @@ export const RegionalReplicationStatus: coreClient.CompositeMapper = { } }; +export const GalleryApplicationCustomAction: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryApplicationCustomAction", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + script: { + serializedName: "script", + required: true, + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + }, + parameters: { + serializedName: "parameters", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GalleryApplicationCustomActionParameter" + } + } + } + } + } + } +}; + +export const GalleryApplicationCustomActionParameter: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryApplicationCustomActionParameter", + modelProperties: { + name: { + serializedName: "name", + required: true, + type: { + name: "String" + } + }, + required: { + serializedName: "required", + type: { + name: "Boolean" + } + }, + type: { + serializedName: "type", + type: { + name: "Enum", + allowedValues: ["String", "ConfigurationDataBlob", "LogOutputBlob"] + } + }, + defaultValue: { + serializedName: "defaultValue", + type: { + name: "String" + } + }, + description: { + serializedName: "description", + type: { + name: "String" + } + } + } + } +}; + export const UserArtifactSource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -11104,6 +11228,27 @@ export const ManagedArtifact: coreClient.CompositeMapper = { } }; +export const LatestGalleryImageVersion: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "LatestGalleryImageVersion", + modelProperties: { + latestVersionName: { + serializedName: "latestVersionName", + type: { + name: "String" + } + }, + location: { + serializedName: "location", + type: { + name: "String" + } + } + } + } +}; + export const ImageReference: coreClient.CompositeMapper = { type: { name: "Composite", @@ -12208,6 +12353,12 @@ export const VirtualMachineScaleSet: coreClient.CompositeMapper = { type: { name: "DateTime" } + }, + constrainedMaximumCapacity: { + serializedName: "properties.constrainedMaximumCapacity", + type: { + name: "Boolean" + } } } } @@ -14085,6 +14236,13 @@ export const GalleryImageVersion: coreClient.CompositeMapper = { className: "GalleryImageVersionStorageProfile" } }, + safetyProfile: { + serializedName: "properties.safetyProfile", + type: { + name: "Composite", + className: "GalleryImageVersionSafetyProfile" + } + }, replicationStatus: { serializedName: "properties.replicationStatus", type: { @@ -14138,6 +14296,18 @@ export const GalleryApplication: coreClient.CompositeMapper = { name: "Enum", allowedValues: ["Windows", "Linux"] } + }, + customActions: { + serializedName: "properties.customActions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GalleryApplicationCustomAction" + } + } + } } } } @@ -14156,6 +14326,13 @@ export const GalleryApplicationVersion: coreClient.CompositeMapper = { className: "GalleryApplicationVersionPublishingProfile" } }, + safetyProfile: { + serializedName: "properties.safetyProfile", + type: { + name: "Composite", + className: "GalleryApplicationVersionSafetyProfile" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -15680,6 +15857,13 @@ export const GalleryImageVersionUpdate: coreClient.CompositeMapper = { className: "GalleryImageVersionStorageProfile" } }, + safetyProfile: { + serializedName: "properties.safetyProfile", + type: { + name: "Composite", + className: "GalleryImageVersionSafetyProfile" + } + }, replicationStatus: { serializedName: "properties.replicationStatus", type: { @@ -15733,6 +15917,18 @@ export const GalleryApplicationUpdate: coreClient.CompositeMapper = { name: "Enum", allowedValues: ["Windows", "Linux"] } + }, + customActions: { + serializedName: "properties.customActions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GalleryApplicationCustomAction" + } + } + } } } } @@ -15751,6 +15947,13 @@ export const GalleryApplicationVersionUpdate: coreClient.CompositeMapper = { className: "GalleryApplicationVersionPublishingProfile" } }, + safetyProfile: { + serializedName: "properties.safetyProfile", + type: { + name: "Composite", + className: "GalleryApplicationVersionSafetyProfile" + } + }, provisioningState: { serializedName: "properties.provisioningState", readOnly: true, @@ -15818,6 +16021,18 @@ export const GalleryApplicationVersionPublishingProfile: coreClient.CompositeMap type: { name: "Boolean" } + }, + customActions: { + serializedName: "customActions", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GalleryApplicationCustomAction" + } + } + } } } } @@ -15857,6 +16072,44 @@ export const DataDiskImageEncryption: coreClient.CompositeMapper = { } }; +export const GalleryArtifactVersionFullSource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryArtifactVersionFullSource", + modelProperties: { + ...GalleryArtifactVersionSource.type.modelProperties, + communityGalleryImageId: { + serializedName: "communityGalleryImageId", + type: { + name: "String" + } + } + } + } +}; + +export const GalleryDiskImageSource: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryDiskImageSource", + modelProperties: { + ...GalleryArtifactVersionSource.type.modelProperties, + uri: { + serializedName: "uri", + type: { + name: "String" + } + }, + storageAccountId: { + serializedName: "storageAccountId", + type: { + name: "String" + } + } + } + } +}; + export const GalleryOSDiskImage: coreClient.CompositeMapper = { type: { name: "Composite", @@ -15884,6 +16137,46 @@ export const GalleryDataDiskImage: coreClient.CompositeMapper = { } }; +export const GalleryImageVersionSafetyProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryImageVersionSafetyProfile", + modelProperties: { + ...GalleryArtifactSafetyProfileBase.type.modelProperties, + reportedForPolicyViolation: { + serializedName: "reportedForPolicyViolation", + readOnly: true, + type: { + name: "Boolean" + } + }, + policyViolations: { + serializedName: "policyViolations", + readOnly: true, + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "PolicyViolation" + } + } + } + } + } + } +}; + +export const GalleryApplicationVersionSafetyProfile: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GalleryApplicationVersionSafetyProfile", + modelProperties: { + ...GalleryArtifactSafetyProfileBase.type.modelProperties + } + } +}; + export const PirSharedGalleryResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -16248,6 +16541,18 @@ export const SharedGalleryImage: coreClient.CompositeMapper = { type: { name: "String" } + }, + privacyStatementUri: { + serializedName: "properties.privacyStatementUri", + type: { + name: "String" + } + }, + eula: { + serializedName: "properties.eula", + type: { + name: "String" + } } } } diff --git a/sdk/compute/arm-compute/src/models/parameters.ts b/sdk/compute/arm-compute/src/models/parameters.ts index 13fbba5e0b90..64f6867d1107 100644 --- a/sdk/compute/arm-compute/src/models/parameters.ts +++ b/sdk/compute/arm-compute/src/models/parameters.ts @@ -110,7 +110,7 @@ export const $host: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-08-01", + defaultValue: "2022-11-01", isConstant: true, serializedName: "api-version", type: { @@ -1079,7 +1079,7 @@ export const galleryName: OperationURLParameter = { export const apiVersion3: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2022-01-03", + defaultValue: "2022-03-03", isConstant: true, serializedName: "api-version", type: { diff --git a/sdk/compute/arm-compute/src/operations/availabilitySets.ts b/sdk/compute/arm-compute/src/operations/availabilitySets.ts index 27fab002ab76..ea4f34024e99 100644 --- a/sdk/compute/arm-compute/src/operations/availabilitySets.ts +++ b/sdk/compute/arm-compute/src/operations/availabilitySets.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { AvailabilitySets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,10 +17,13 @@ import { AvailabilitySet, AvailabilitySetsListBySubscriptionNextOptionalParams, AvailabilitySetsListBySubscriptionOptionalParams, + AvailabilitySetsListBySubscriptionResponse, AvailabilitySetsListNextOptionalParams, AvailabilitySetsListOptionalParams, + AvailabilitySetsListResponse, VirtualMachineSize, AvailabilitySetsListAvailableSizesOptionalParams, + AvailabilitySetsListAvailableSizesResponse, AvailabilitySetsCreateOrUpdateOptionalParams, AvailabilitySetsCreateOrUpdateResponse, AvailabilitySetUpdate, @@ -28,9 +32,6 @@ import { AvailabilitySetsDeleteOptionalParams, AvailabilitySetsGetOptionalParams, AvailabilitySetsGetResponse, - AvailabilitySetsListBySubscriptionResponse, - AvailabilitySetsListResponse, - AvailabilitySetsListAvailableSizesResponse, AvailabilitySetsListBySubscriptionNextResponse, AvailabilitySetsListNextResponse } from "../models"; @@ -63,22 +64,34 @@ export class AvailabilitySetsImpl implements AvailabilitySets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: AvailabilitySetsListBySubscriptionOptionalParams + options?: AvailabilitySetsListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: AvailabilitySetsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -107,19 +120,29 @@ export class AvailabilitySetsImpl implements AvailabilitySets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, options, settings); } }; } private async *listPagingPage( resourceGroupName: string, - options?: AvailabilitySetsListOptionalParams + options?: AvailabilitySetsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: AvailabilitySetsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -127,7 +150,9 @@ export class AvailabilitySetsImpl implements AvailabilitySets { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -164,11 +189,15 @@ export class AvailabilitySetsImpl implements AvailabilitySets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listAvailableSizesPagingPage( resourceGroupName, availabilitySetName, - options + options, + settings ); } }; @@ -177,9 +206,11 @@ export class AvailabilitySetsImpl implements AvailabilitySets { private async *listAvailableSizesPagingPage( resourceGroupName: string, availabilitySetName: string, - options?: AvailabilitySetsListAvailableSizesOptionalParams + options?: AvailabilitySetsListAvailableSizesOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAvailableSizes( + let result: AvailabilitySetsListAvailableSizesResponse; + result = await this._listAvailableSizes( resourceGroupName, availabilitySetName, options @@ -516,7 +547,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.expand1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -536,7 +566,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/capacityReservationGroups.ts b/sdk/compute/arm-compute/src/operations/capacityReservationGroups.ts index 52366178da1b..83e4a5f2e5bc 100644 --- a/sdk/compute/arm-compute/src/operations/capacityReservationGroups.ts +++ b/sdk/compute/arm-compute/src/operations/capacityReservationGroups.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CapacityReservationGroups } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,8 +17,10 @@ import { CapacityReservationGroup, CapacityReservationGroupsListByResourceGroupNextOptionalParams, CapacityReservationGroupsListByResourceGroupOptionalParams, + CapacityReservationGroupsListByResourceGroupResponse, CapacityReservationGroupsListBySubscriptionNextOptionalParams, CapacityReservationGroupsListBySubscriptionOptionalParams, + CapacityReservationGroupsListBySubscriptionResponse, CapacityReservationGroupsCreateOrUpdateOptionalParams, CapacityReservationGroupsCreateOrUpdateResponse, CapacityReservationGroupUpdate, @@ -26,8 +29,6 @@ import { CapacityReservationGroupsDeleteOptionalParams, CapacityReservationGroupsGetOptionalParams, CapacityReservationGroupsGetResponse, - CapacityReservationGroupsListByResourceGroupResponse, - CapacityReservationGroupsListBySubscriptionResponse, CapacityReservationGroupsListByResourceGroupNextResponse, CapacityReservationGroupsListBySubscriptionNextResponse } from "../models"; @@ -64,19 +65,33 @@ export class CapacityReservationGroupsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: CapacityReservationGroupsListByResourceGroupOptionalParams + options?: CapacityReservationGroupsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CapacityReservationGroupsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -84,7 +99,9 @@ export class CapacityReservationGroupsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -116,22 +133,34 @@ export class CapacityReservationGroupsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: CapacityReservationGroupsListBySubscriptionOptionalParams + options?: CapacityReservationGroupsListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CapacityReservationGroupsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -429,7 +458,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.expand6], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -450,7 +478,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.expand6], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/capacityReservations.ts b/sdk/compute/arm-compute/src/operations/capacityReservations.ts index 5f884dfb80e9..afa2242d0a9c 100644 --- a/sdk/compute/arm-compute/src/operations/capacityReservations.ts +++ b/sdk/compute/arm-compute/src/operations/capacityReservations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CapacityReservations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { CapacityReservation, CapacityReservationsListByCapacityReservationGroupNextOptionalParams, CapacityReservationsListByCapacityReservationGroupOptionalParams, + CapacityReservationsListByCapacityReservationGroupResponse, CapacityReservationsCreateOrUpdateOptionalParams, CapacityReservationsCreateOrUpdateResponse, CapacityReservationUpdate, @@ -26,7 +28,6 @@ import { CapacityReservationsDeleteOptionalParams, CapacityReservationsGetOptionalParams, CapacityReservationsGetResponse, - CapacityReservationsListByCapacityReservationGroupResponse, CapacityReservationsListByCapacityReservationGroupNextResponse } from "../models"; @@ -67,11 +68,15 @@ export class CapacityReservationsImpl implements CapacityReservations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByCapacityReservationGroupPagingPage( resourceGroupName, capacityReservationGroupName, - options + options, + settings ); } }; @@ -80,15 +85,22 @@ export class CapacityReservationsImpl implements CapacityReservations { private async *listByCapacityReservationGroupPagingPage( resourceGroupName: string, capacityReservationGroupName: string, - options?: CapacityReservationsListByCapacityReservationGroupOptionalParams + options?: CapacityReservationsListByCapacityReservationGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByCapacityReservationGroup( - resourceGroupName, - capacityReservationGroupName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CapacityReservationsListByCapacityReservationGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByCapacityReservationGroup( + resourceGroupName, + capacityReservationGroupName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByCapacityReservationGroupNext( resourceGroupName, @@ -97,7 +109,9 @@ export class CapacityReservationsImpl implements CapacityReservations { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -634,7 +648,6 @@ const listByCapacityReservationGroupNextOperationSpec: coreClient.OperationSpec bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/cloudServiceOperatingSystems.ts b/sdk/compute/arm-compute/src/operations/cloudServiceOperatingSystems.ts index 3de69186dd57..503d7225c653 100644 --- a/sdk/compute/arm-compute/src/operations/cloudServiceOperatingSystems.ts +++ b/sdk/compute/arm-compute/src/operations/cloudServiceOperatingSystems.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CloudServiceOperatingSystems } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,15 +17,15 @@ import { OSVersion, CloudServiceOperatingSystemsListOSVersionsNextOptionalParams, CloudServiceOperatingSystemsListOSVersionsOptionalParams, + CloudServiceOperatingSystemsListOSVersionsResponse, OSFamily, CloudServiceOperatingSystemsListOSFamiliesNextOptionalParams, CloudServiceOperatingSystemsListOSFamiliesOptionalParams, + CloudServiceOperatingSystemsListOSFamiliesResponse, CloudServiceOperatingSystemsGetOSVersionOptionalParams, CloudServiceOperatingSystemsGetOSVersionResponse, - CloudServiceOperatingSystemsListOSVersionsResponse, CloudServiceOperatingSystemsGetOSFamilyOptionalParams, CloudServiceOperatingSystemsGetOSFamilyResponse, - CloudServiceOperatingSystemsListOSFamiliesResponse, CloudServiceOperatingSystemsListOSVersionsNextResponse, CloudServiceOperatingSystemsListOSFamiliesNextResponse } from "../models"; @@ -62,19 +63,29 @@ export class CloudServiceOperatingSystemsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listOSVersionsPagingPage(location, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listOSVersionsPagingPage(location, options, settings); } }; } private async *listOSVersionsPagingPage( location: string, - options?: CloudServiceOperatingSystemsListOSVersionsOptionalParams + options?: CloudServiceOperatingSystemsListOSVersionsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listOSVersions(location, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CloudServiceOperatingSystemsListOSVersionsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listOSVersions(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listOSVersionsNext( location, @@ -82,7 +93,9 @@ export class CloudServiceOperatingSystemsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -114,19 +127,29 @@ export class CloudServiceOperatingSystemsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listOSFamiliesPagingPage(location, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listOSFamiliesPagingPage(location, options, settings); } }; } private async *listOSFamiliesPagingPage( location: string, - options?: CloudServiceOperatingSystemsListOSFamiliesOptionalParams + options?: CloudServiceOperatingSystemsListOSFamiliesOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listOSFamilies(location, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CloudServiceOperatingSystemsListOSFamiliesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listOSFamilies(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listOSFamiliesNext( location, @@ -134,7 +157,9 @@ export class CloudServiceOperatingSystemsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -351,7 +376,6 @@ const listOSVersionsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion4], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -372,7 +396,6 @@ const listOSFamiliesNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion4], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/cloudServiceRoleInstances.ts b/sdk/compute/arm-compute/src/operations/cloudServiceRoleInstances.ts index 711f2bdc0e0b..549c445a23ff 100644 --- a/sdk/compute/arm-compute/src/operations/cloudServiceRoleInstances.ts +++ b/sdk/compute/arm-compute/src/operations/cloudServiceRoleInstances.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CloudServiceRoleInstances } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,12 +19,12 @@ import { RoleInstance, CloudServiceRoleInstancesListNextOptionalParams, CloudServiceRoleInstancesListOptionalParams, + CloudServiceRoleInstancesListResponse, CloudServiceRoleInstancesDeleteOptionalParams, CloudServiceRoleInstancesGetOptionalParams, CloudServiceRoleInstancesGetResponse, CloudServiceRoleInstancesGetInstanceViewOptionalParams, CloudServiceRoleInstancesGetInstanceViewResponse, - CloudServiceRoleInstancesListResponse, CloudServiceRoleInstancesRestartOptionalParams, CloudServiceRoleInstancesReimageOptionalParams, CloudServiceRoleInstancesRebuildOptionalParams, @@ -70,11 +71,15 @@ export class CloudServiceRoleInstancesImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, cloudServiceName, - options + options, + settings ); } }; @@ -83,11 +88,18 @@ export class CloudServiceRoleInstancesImpl private async *listPagingPage( resourceGroupName: string, cloudServiceName: string, - options?: CloudServiceRoleInstancesListOptionalParams + options?: CloudServiceRoleInstancesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, cloudServiceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CloudServiceRoleInstancesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, cloudServiceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -96,7 +108,9 @@ export class CloudServiceRoleInstancesImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -763,7 +777,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.expand2, Parameters.apiVersion4], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/cloudServiceRoles.ts b/sdk/compute/arm-compute/src/operations/cloudServiceRoles.ts index 8467d0d614e5..b72e85ce8ca7 100644 --- a/sdk/compute/arm-compute/src/operations/cloudServiceRoles.ts +++ b/sdk/compute/arm-compute/src/operations/cloudServiceRoles.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CloudServiceRoles } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,9 @@ import { CloudServiceRole, CloudServiceRolesListNextOptionalParams, CloudServiceRolesListOptionalParams, + CloudServiceRolesListResponse, CloudServiceRolesGetOptionalParams, CloudServiceRolesGetResponse, - CloudServiceRolesListResponse, CloudServiceRolesListNextResponse } from "../models"; @@ -59,11 +60,15 @@ export class CloudServiceRolesImpl implements CloudServiceRoles { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, cloudServiceName, - options + options, + settings ); } }; @@ -72,11 +77,18 @@ export class CloudServiceRolesImpl implements CloudServiceRoles { private async *listPagingPage( resourceGroupName: string, cloudServiceName: string, - options?: CloudServiceRolesListOptionalParams + options?: CloudServiceRolesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, cloudServiceName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CloudServiceRolesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, cloudServiceName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -85,7 +97,9 @@ export class CloudServiceRolesImpl implements CloudServiceRoles { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -218,7 +232,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion4], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/cloudServices.ts b/sdk/compute/arm-compute/src/operations/cloudServices.ts index 33a72de43fa0..4226077df7e7 100644 --- a/sdk/compute/arm-compute/src/operations/cloudServices.ts +++ b/sdk/compute/arm-compute/src/operations/cloudServices.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CloudServices } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,8 +19,10 @@ import { CloudService, CloudServicesListAllNextOptionalParams, CloudServicesListAllOptionalParams, + CloudServicesListAllResponse, CloudServicesListNextOptionalParams, CloudServicesListOptionalParams, + CloudServicesListResponse, CloudServicesCreateOrUpdateOptionalParams, CloudServicesCreateOrUpdateResponse, CloudServicesUpdateOptionalParams, @@ -29,8 +32,6 @@ import { CloudServicesGetResponse, CloudServicesGetInstanceViewOptionalParams, CloudServicesGetInstanceViewResponse, - CloudServicesListAllResponse, - CloudServicesListResponse, CloudServicesStartOptionalParams, CloudServicesPowerOffOptionalParams, CloudServicesRestartOptionalParams, @@ -71,22 +72,34 @@ export class CloudServicesImpl implements CloudServices { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAllPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAllPagingPage(options, settings); } }; } private async *listAllPagingPage( - options?: CloudServicesListAllOptionalParams + options?: CloudServicesListAllOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAll(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CloudServicesListAllResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAll(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAllNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -116,19 +129,29 @@ export class CloudServicesImpl implements CloudServices { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, options, settings); } }; } private async *listPagingPage( resourceGroupName: string, - options?: CloudServicesListOptionalParams + options?: CloudServicesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CloudServicesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -136,7 +159,9 @@ export class CloudServicesImpl implements CloudServices { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -1332,7 +1357,6 @@ const listAllNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion4], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1352,7 +1376,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion4], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/cloudServicesUpdateDomain.ts b/sdk/compute/arm-compute/src/operations/cloudServicesUpdateDomain.ts index 9b2c6c83eede..d1600cd5868f 100644 --- a/sdk/compute/arm-compute/src/operations/cloudServicesUpdateDomain.ts +++ b/sdk/compute/arm-compute/src/operations/cloudServicesUpdateDomain.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CloudServicesUpdateDomain } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,10 +19,10 @@ import { UpdateDomain, CloudServicesUpdateDomainListUpdateDomainsNextOptionalParams, CloudServicesUpdateDomainListUpdateDomainsOptionalParams, + CloudServicesUpdateDomainListUpdateDomainsResponse, CloudServicesUpdateDomainWalkUpdateDomainOptionalParams, CloudServicesUpdateDomainGetUpdateDomainOptionalParams, CloudServicesUpdateDomainGetUpdateDomainResponse, - CloudServicesUpdateDomainListUpdateDomainsResponse, CloudServicesUpdateDomainListUpdateDomainsNextResponse } from "../models"; @@ -62,11 +63,15 @@ export class CloudServicesUpdateDomainImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listUpdateDomainsPagingPage( resourceGroupName, cloudServiceName, - options + options, + settings ); } }; @@ -75,15 +80,22 @@ export class CloudServicesUpdateDomainImpl private async *listUpdateDomainsPagingPage( resourceGroupName: string, cloudServiceName: string, - options?: CloudServicesUpdateDomainListUpdateDomainsOptionalParams + options?: CloudServicesUpdateDomainListUpdateDomainsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listUpdateDomains( - resourceGroupName, - cloudServiceName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CloudServicesUpdateDomainListUpdateDomainsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listUpdateDomains( + resourceGroupName, + cloudServiceName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listUpdateDomainsNext( resourceGroupName, @@ -92,7 +104,9 @@ export class CloudServicesUpdateDomainImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -344,7 +358,6 @@ const listUpdateDomainsNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion4], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts index e02826b48f30..cdc9af0968b1 100644 --- a/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts +++ b/sdk/compute/arm-compute/src/operations/communityGalleryImageVersions.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CommunityGalleryImageVersions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,9 @@ import { CommunityGalleryImageVersion, CommunityGalleryImageVersionsListNextOptionalParams, CommunityGalleryImageVersionsListOptionalParams, + CommunityGalleryImageVersionsListResponse, CommunityGalleryImageVersionsGetOptionalParams, CommunityGalleryImageVersionsGetResponse, - CommunityGalleryImageVersionsListResponse, CommunityGalleryImageVersionsListNextResponse } from "../models"; @@ -62,12 +63,16 @@ export class CommunityGalleryImageVersionsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( location, publicGalleryName, galleryImageName, - options + options, + settings ); } }; @@ -77,16 +82,23 @@ export class CommunityGalleryImageVersionsImpl location: string, publicGalleryName: string, galleryImageName: string, - options?: CommunityGalleryImageVersionsListOptionalParams + options?: CommunityGalleryImageVersionsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - location, - publicGalleryName, - galleryImageName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CommunityGalleryImageVersionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + location, + publicGalleryName, + galleryImageName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( location, @@ -96,7 +108,9 @@ export class CommunityGalleryImageVersionsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -246,7 +260,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts b/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts index e19e6909f82d..71e60e4eea4e 100644 --- a/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts +++ b/sdk/compute/arm-compute/src/operations/communityGalleryImages.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { CommunityGalleryImages } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,9 @@ import { CommunityGalleryImage, CommunityGalleryImagesListNextOptionalParams, CommunityGalleryImagesListOptionalParams, + CommunityGalleryImagesListResponse, CommunityGalleryImagesGetOptionalParams, CommunityGalleryImagesGetResponse, - CommunityGalleryImagesListResponse, CommunityGalleryImagesListNextResponse } from "../models"; @@ -54,8 +55,16 @@ export class CommunityGalleryImagesImpl implements CommunityGalleryImages { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(location, publicGalleryName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + location, + publicGalleryName, + options, + settings + ); } }; } @@ -63,11 +72,18 @@ export class CommunityGalleryImagesImpl implements CommunityGalleryImages { private async *listPagingPage( location: string, publicGalleryName: string, - options?: CommunityGalleryImagesListOptionalParams + options?: CommunityGalleryImagesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(location, publicGalleryName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: CommunityGalleryImagesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, publicGalleryName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( location, @@ -76,7 +92,9 @@ export class CommunityGalleryImagesImpl implements CommunityGalleryImages { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -208,7 +226,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/dedicatedHostGroups.ts b/sdk/compute/arm-compute/src/operations/dedicatedHostGroups.ts index 4c2686f6013d..170c778719b9 100644 --- a/sdk/compute/arm-compute/src/operations/dedicatedHostGroups.ts +++ b/sdk/compute/arm-compute/src/operations/dedicatedHostGroups.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DedicatedHostGroups } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,8 +17,10 @@ import { DedicatedHostGroup, DedicatedHostGroupsListByResourceGroupNextOptionalParams, DedicatedHostGroupsListByResourceGroupOptionalParams, + DedicatedHostGroupsListByResourceGroupResponse, DedicatedHostGroupsListBySubscriptionNextOptionalParams, DedicatedHostGroupsListBySubscriptionOptionalParams, + DedicatedHostGroupsListBySubscriptionResponse, DedicatedHostGroupsCreateOrUpdateOptionalParams, DedicatedHostGroupsCreateOrUpdateResponse, DedicatedHostGroupUpdate, @@ -26,8 +29,6 @@ import { DedicatedHostGroupsDeleteOptionalParams, DedicatedHostGroupsGetOptionalParams, DedicatedHostGroupsGetResponse, - DedicatedHostGroupsListByResourceGroupResponse, - DedicatedHostGroupsListBySubscriptionResponse, DedicatedHostGroupsListByResourceGroupNextResponse, DedicatedHostGroupsListBySubscriptionNextResponse } from "../models"; @@ -63,19 +64,33 @@ export class DedicatedHostGroupsImpl implements DedicatedHostGroups { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: DedicatedHostGroupsListByResourceGroupOptionalParams + options?: DedicatedHostGroupsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DedicatedHostGroupsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -83,7 +98,9 @@ export class DedicatedHostGroupsImpl implements DedicatedHostGroups { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -115,22 +132,34 @@ export class DedicatedHostGroupsImpl implements DedicatedHostGroups { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: DedicatedHostGroupsListBySubscriptionOptionalParams + options?: DedicatedHostGroupsListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DedicatedHostGroupsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -423,7 +452,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -444,7 +472,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/dedicatedHosts.ts b/sdk/compute/arm-compute/src/operations/dedicatedHosts.ts index 949944446d4e..f442a3bf83ab 100644 --- a/sdk/compute/arm-compute/src/operations/dedicatedHosts.ts +++ b/sdk/compute/arm-compute/src/operations/dedicatedHosts.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DedicatedHosts } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { DedicatedHost, DedicatedHostsListByHostGroupNextOptionalParams, DedicatedHostsListByHostGroupOptionalParams, + DedicatedHostsListByHostGroupResponse, DedicatedHostsCreateOrUpdateOptionalParams, DedicatedHostsCreateOrUpdateResponse, DedicatedHostUpdate, @@ -26,7 +28,6 @@ import { DedicatedHostsDeleteOptionalParams, DedicatedHostsGetOptionalParams, DedicatedHostsGetResponse, - DedicatedHostsListByHostGroupResponse, DedicatedHostsRestartOptionalParams, DedicatedHostsListByHostGroupNextResponse } from "../models"; @@ -68,11 +69,15 @@ export class DedicatedHostsImpl implements DedicatedHosts { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByHostGroupPagingPage( resourceGroupName, hostGroupName, - options + options, + settings ); } }; @@ -81,15 +86,22 @@ export class DedicatedHostsImpl implements DedicatedHosts { private async *listByHostGroupPagingPage( resourceGroupName: string, hostGroupName: string, - options?: DedicatedHostsListByHostGroupOptionalParams + options?: DedicatedHostsListByHostGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByHostGroup( - resourceGroupName, - hostGroupName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DedicatedHostsListByHostGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByHostGroup( + resourceGroupName, + hostGroupName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByHostGroupNext( resourceGroupName, @@ -98,7 +110,9 @@ export class DedicatedHostsImpl implements DedicatedHosts { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -721,7 +735,6 @@ const listByHostGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/diskAccesses.ts b/sdk/compute/arm-compute/src/operations/diskAccesses.ts index 31f43351a52c..a2ffbb53c0d5 100644 --- a/sdk/compute/arm-compute/src/operations/diskAccesses.ts +++ b/sdk/compute/arm-compute/src/operations/diskAccesses.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DiskAccesses } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,11 +19,14 @@ import { DiskAccess, DiskAccessesListByResourceGroupNextOptionalParams, DiskAccessesListByResourceGroupOptionalParams, + DiskAccessesListByResourceGroupResponse, DiskAccessesListNextOptionalParams, DiskAccessesListOptionalParams, + DiskAccessesListResponse, PrivateEndpointConnection, DiskAccessesListPrivateEndpointConnectionsNextOptionalParams, DiskAccessesListPrivateEndpointConnectionsOptionalParams, + DiskAccessesListPrivateEndpointConnectionsResponse, DiskAccessesCreateOrUpdateOptionalParams, DiskAccessesCreateOrUpdateResponse, DiskAccessUpdate, @@ -31,8 +35,6 @@ import { DiskAccessesGetOptionalParams, DiskAccessesGetResponse, DiskAccessesDeleteOptionalParams, - DiskAccessesListByResourceGroupResponse, - DiskAccessesListResponse, DiskAccessesGetPrivateLinkResourcesOptionalParams, DiskAccessesGetPrivateLinkResourcesResponse, DiskAccessesUpdateAPrivateEndpointConnectionOptionalParams, @@ -40,7 +42,6 @@ import { DiskAccessesGetAPrivateEndpointConnectionOptionalParams, DiskAccessesGetAPrivateEndpointConnectionResponse, DiskAccessesDeleteAPrivateEndpointConnectionOptionalParams, - DiskAccessesListPrivateEndpointConnectionsResponse, DiskAccessesListByResourceGroupNextResponse, DiskAccessesListNextResponse, DiskAccessesListPrivateEndpointConnectionsNextResponse @@ -76,19 +77,33 @@ export class DiskAccessesImpl implements DiskAccesses { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: DiskAccessesListByResourceGroupOptionalParams + options?: DiskAccessesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DiskAccessesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -96,7 +111,9 @@ export class DiskAccessesImpl implements DiskAccesses { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -127,22 +144,34 @@ export class DiskAccessesImpl implements DiskAccesses { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: DiskAccessesListOptionalParams + options?: DiskAccessesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DiskAccessesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -179,11 +208,15 @@ export class DiskAccessesImpl implements DiskAccesses { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPrivateEndpointConnectionsPagingPage( resourceGroupName, diskAccessName, - options + options, + settings ); } }; @@ -192,15 +225,22 @@ export class DiskAccessesImpl implements DiskAccesses { private async *listPrivateEndpointConnectionsPagingPage( resourceGroupName: string, diskAccessName: string, - options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams + options?: DiskAccessesListPrivateEndpointConnectionsOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listPrivateEndpointConnections( - resourceGroupName, - diskAccessName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DiskAccessesListPrivateEndpointConnectionsResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listPrivateEndpointConnections( + resourceGroupName, + diskAccessName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listPrivateEndpointConnectionsNext( resourceGroupName, @@ -209,7 +249,9 @@ export class DiskAccessesImpl implements DiskAccesses { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -1159,7 +1201,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1180,7 +1221,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -1200,7 +1240,6 @@ const listPrivateEndpointConnectionsNextOperationSpec: coreClient.OperationSpec bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/diskEncryptionSets.ts b/sdk/compute/arm-compute/src/operations/diskEncryptionSets.ts index 03dcd61f6673..f5bdccc130f7 100644 --- a/sdk/compute/arm-compute/src/operations/diskEncryptionSets.ts +++ b/sdk/compute/arm-compute/src/operations/diskEncryptionSets.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DiskEncryptionSets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,10 +19,13 @@ import { DiskEncryptionSet, DiskEncryptionSetsListByResourceGroupNextOptionalParams, DiskEncryptionSetsListByResourceGroupOptionalParams, + DiskEncryptionSetsListByResourceGroupResponse, DiskEncryptionSetsListNextOptionalParams, DiskEncryptionSetsListOptionalParams, + DiskEncryptionSetsListResponse, DiskEncryptionSetsListAssociatedResourcesNextOptionalParams, DiskEncryptionSetsListAssociatedResourcesOptionalParams, + DiskEncryptionSetsListAssociatedResourcesResponse, DiskEncryptionSetsCreateOrUpdateOptionalParams, DiskEncryptionSetsCreateOrUpdateResponse, DiskEncryptionSetUpdate, @@ -30,9 +34,6 @@ import { DiskEncryptionSetsGetOptionalParams, DiskEncryptionSetsGetResponse, DiskEncryptionSetsDeleteOptionalParams, - DiskEncryptionSetsListByResourceGroupResponse, - DiskEncryptionSetsListResponse, - DiskEncryptionSetsListAssociatedResourcesResponse, DiskEncryptionSetsListByResourceGroupNextResponse, DiskEncryptionSetsListNextResponse, DiskEncryptionSetsListAssociatedResourcesNextResponse @@ -68,19 +69,33 @@ export class DiskEncryptionSetsImpl implements DiskEncryptionSets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: DiskEncryptionSetsListByResourceGroupOptionalParams + options?: DiskEncryptionSetsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DiskEncryptionSetsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -88,7 +103,9 @@ export class DiskEncryptionSetsImpl implements DiskEncryptionSets { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -119,22 +136,34 @@ export class DiskEncryptionSetsImpl implements DiskEncryptionSets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: DiskEncryptionSetsListOptionalParams + options?: DiskEncryptionSetsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DiskEncryptionSetsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -171,11 +200,15 @@ export class DiskEncryptionSetsImpl implements DiskEncryptionSets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listAssociatedResourcesPagingPage( resourceGroupName, diskEncryptionSetName, - options + options, + settings ); } }; @@ -184,15 +217,22 @@ export class DiskEncryptionSetsImpl implements DiskEncryptionSets { private async *listAssociatedResourcesPagingPage( resourceGroupName: string, diskEncryptionSetName: string, - options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams + options?: DiskEncryptionSetsListAssociatedResourcesOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAssociatedResources( - resourceGroupName, - diskEncryptionSetName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DiskEncryptionSetsListAssociatedResourcesResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAssociatedResources( + resourceGroupName, + diskEncryptionSetName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAssociatedResourcesNext( resourceGroupName, @@ -201,7 +241,9 @@ export class DiskEncryptionSetsImpl implements DiskEncryptionSets { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -803,7 +845,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -824,7 +865,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -844,7 +884,6 @@ const listAssociatedResourcesNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/diskRestorePointOperations.ts b/sdk/compute/arm-compute/src/operations/diskRestorePointOperations.ts index 2fa018947006..0e823530506c 100644 --- a/sdk/compute/arm-compute/src/operations/diskRestorePointOperations.ts +++ b/sdk/compute/arm-compute/src/operations/diskRestorePointOperations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { DiskRestorePointOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,9 +19,9 @@ import { DiskRestorePoint, DiskRestorePointListByRestorePointNextOptionalParams, DiskRestorePointListByRestorePointOptionalParams, + DiskRestorePointListByRestorePointResponse, DiskRestorePointGetOptionalParams, DiskRestorePointGetResponse, - DiskRestorePointListByRestorePointResponse, GrantAccessData, DiskRestorePointGrantAccessOptionalParams, DiskRestorePointGrantAccessResponse, @@ -69,12 +70,16 @@ export class DiskRestorePointOperationsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByRestorePointPagingPage( resourceGroupName, restorePointCollectionName, vmRestorePointName, - options + options, + settings ); } }; @@ -84,16 +89,23 @@ export class DiskRestorePointOperationsImpl resourceGroupName: string, restorePointCollectionName: string, vmRestorePointName: string, - options?: DiskRestorePointListByRestorePointOptionalParams + options?: DiskRestorePointListByRestorePointOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByRestorePoint( - resourceGroupName, - restorePointCollectionName, - vmRestorePointName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DiskRestorePointListByRestorePointResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByRestorePoint( + resourceGroupName, + restorePointCollectionName, + vmRestorePointName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByRestorePointNext( resourceGroupName, @@ -103,7 +115,9 @@ export class DiskRestorePointOperationsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -538,7 +552,6 @@ const listByRestorePointNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/disks.ts b/sdk/compute/arm-compute/src/operations/disks.ts index c3cfb80b97ad..c638e18f33f3 100644 --- a/sdk/compute/arm-compute/src/operations/disks.ts +++ b/sdk/compute/arm-compute/src/operations/disks.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Disks } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,8 +19,10 @@ import { Disk, DisksListByResourceGroupNextOptionalParams, DisksListByResourceGroupOptionalParams, + DisksListByResourceGroupResponse, DisksListNextOptionalParams, DisksListOptionalParams, + DisksListResponse, DisksCreateOrUpdateOptionalParams, DisksCreateOrUpdateResponse, DiskUpdate, @@ -28,8 +31,6 @@ import { DisksGetOptionalParams, DisksGetResponse, DisksDeleteOptionalParams, - DisksListByResourceGroupResponse, - DisksListResponse, GrantAccessData, DisksGrantAccessOptionalParams, DisksGrantAccessResponse, @@ -68,19 +69,33 @@ export class DisksImpl implements Disks { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: DisksListByResourceGroupOptionalParams + options?: DisksListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DisksListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -88,7 +103,9 @@ export class DisksImpl implements Disks { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -119,22 +136,34 @@ export class DisksImpl implements Disks { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: DisksListOptionalParams + options?: DisksListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: DisksListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -854,7 +883,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiskList } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -872,7 +900,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.DiskList } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/galleries.ts b/sdk/compute/arm-compute/src/operations/galleries.ts index 552a801b9f3c..f61ec96453e2 100644 --- a/sdk/compute/arm-compute/src/operations/galleries.ts +++ b/sdk/compute/arm-compute/src/operations/galleries.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Galleries } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,8 +19,10 @@ import { Gallery, GalleriesListByResourceGroupNextOptionalParams, GalleriesListByResourceGroupOptionalParams, + GalleriesListByResourceGroupResponse, GalleriesListNextOptionalParams, GalleriesListOptionalParams, + GalleriesListResponse, GalleriesCreateOrUpdateOptionalParams, GalleriesCreateOrUpdateResponse, GalleryUpdate, @@ -28,8 +31,6 @@ import { GalleriesGetOptionalParams, GalleriesGetResponse, GalleriesDeleteOptionalParams, - GalleriesListByResourceGroupResponse, - GalleriesListResponse, GalleriesListByResourceGroupNextResponse, GalleriesListNextResponse } from "../models"; @@ -64,19 +65,33 @@ export class GalleriesImpl implements Galleries { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: GalleriesListByResourceGroupOptionalParams + options?: GalleriesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: GalleriesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -84,7 +99,9 @@ export class GalleriesImpl implements Galleries { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -115,22 +132,34 @@ export class GalleriesImpl implements Galleries { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: GalleriesListOptionalParams + options?: GalleriesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: GalleriesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -652,7 +681,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -673,7 +701,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/galleryApplicationVersions.ts b/sdk/compute/arm-compute/src/operations/galleryApplicationVersions.ts index 3464de198742..9f77fc30bddb 100644 --- a/sdk/compute/arm-compute/src/operations/galleryApplicationVersions.ts +++ b/sdk/compute/arm-compute/src/operations/galleryApplicationVersions.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { GalleryApplicationVersions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { GalleryApplicationVersion, GalleryApplicationVersionsListByGalleryApplicationNextOptionalParams, GalleryApplicationVersionsListByGalleryApplicationOptionalParams, + GalleryApplicationVersionsListByGalleryApplicationResponse, GalleryApplicationVersionsCreateOrUpdateOptionalParams, GalleryApplicationVersionsCreateOrUpdateResponse, GalleryApplicationVersionUpdate, @@ -26,7 +28,6 @@ import { GalleryApplicationVersionsGetOptionalParams, GalleryApplicationVersionsGetResponse, GalleryApplicationVersionsDeleteOptionalParams, - GalleryApplicationVersionsListByGalleryApplicationResponse, GalleryApplicationVersionsListByGalleryApplicationNextResponse } from "../models"; @@ -72,12 +73,16 @@ export class GalleryApplicationVersionsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByGalleryApplicationPagingPage( resourceGroupName, galleryName, galleryApplicationName, - options + options, + settings ); } }; @@ -87,16 +92,23 @@ export class GalleryApplicationVersionsImpl resourceGroupName: string, galleryName: string, galleryApplicationName: string, - options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams + options?: GalleryApplicationVersionsListByGalleryApplicationOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByGalleryApplication( - resourceGroupName, - galleryName, - galleryApplicationName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: GalleryApplicationVersionsListByGalleryApplicationResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByGalleryApplication( + resourceGroupName, + galleryName, + galleryApplicationName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByGalleryApplicationNext( resourceGroupName, @@ -106,7 +118,9 @@ export class GalleryApplicationVersionsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -702,7 +716,6 @@ const listByGalleryApplicationNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/galleryApplications.ts b/sdk/compute/arm-compute/src/operations/galleryApplications.ts index 8691334a3b64..1d3ad5f7bb04 100644 --- a/sdk/compute/arm-compute/src/operations/galleryApplications.ts +++ b/sdk/compute/arm-compute/src/operations/galleryApplications.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { GalleryApplications } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { GalleryApplication, GalleryApplicationsListByGalleryNextOptionalParams, GalleryApplicationsListByGalleryOptionalParams, + GalleryApplicationsListByGalleryResponse, GalleryApplicationsCreateOrUpdateOptionalParams, GalleryApplicationsCreateOrUpdateResponse, GalleryApplicationUpdate, @@ -26,7 +28,6 @@ import { GalleryApplicationsGetOptionalParams, GalleryApplicationsGetResponse, GalleryApplicationsDeleteOptionalParams, - GalleryApplicationsListByGalleryResponse, GalleryApplicationsListByGalleryNextResponse } from "../models"; @@ -67,11 +68,15 @@ export class GalleryApplicationsImpl implements GalleryApplications { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByGalleryPagingPage( resourceGroupName, galleryName, - options + options, + settings ); } }; @@ -80,15 +85,22 @@ export class GalleryApplicationsImpl implements GalleryApplications { private async *listByGalleryPagingPage( resourceGroupName: string, galleryName: string, - options?: GalleryApplicationsListByGalleryOptionalParams + options?: GalleryApplicationsListByGalleryOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByGallery( - resourceGroupName, - galleryName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: GalleryApplicationsListByGalleryResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByGallery( + resourceGroupName, + galleryName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByGalleryNext( resourceGroupName, @@ -97,7 +109,9 @@ export class GalleryApplicationsImpl implements GalleryApplications { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -631,7 +645,6 @@ const listByGalleryNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts index 0b48802a3267..b651f6ce527f 100644 --- a/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts +++ b/sdk/compute/arm-compute/src/operations/galleryImageVersions.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { GalleryImageVersions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { GalleryImageVersion, GalleryImageVersionsListByGalleryImageNextOptionalParams, GalleryImageVersionsListByGalleryImageOptionalParams, + GalleryImageVersionsListByGalleryImageResponse, GalleryImageVersionsCreateOrUpdateOptionalParams, GalleryImageVersionsCreateOrUpdateResponse, GalleryImageVersionUpdate, @@ -26,7 +28,6 @@ import { GalleryImageVersionsGetOptionalParams, GalleryImageVersionsGetResponse, GalleryImageVersionsDeleteOptionalParams, - GalleryImageVersionsListByGalleryImageResponse, GalleryImageVersionsListByGalleryImageNextResponse } from "../models"; @@ -70,12 +71,16 @@ export class GalleryImageVersionsImpl implements GalleryImageVersions { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByGalleryImagePagingPage( resourceGroupName, galleryName, galleryImageName, - options + options, + settings ); } }; @@ -85,16 +90,23 @@ export class GalleryImageVersionsImpl implements GalleryImageVersions { resourceGroupName: string, galleryName: string, galleryImageName: string, - options?: GalleryImageVersionsListByGalleryImageOptionalParams + options?: GalleryImageVersionsListByGalleryImageOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByGalleryImage( - resourceGroupName, - galleryName, - galleryImageName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: GalleryImageVersionsListByGalleryImageResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByGalleryImage( + resourceGroupName, + galleryName, + galleryImageName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByGalleryImageNext( resourceGroupName, @@ -104,7 +116,9 @@ export class GalleryImageVersionsImpl implements GalleryImageVersions { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -679,7 +693,6 @@ const listByGalleryImageNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/galleryImages.ts b/sdk/compute/arm-compute/src/operations/galleryImages.ts index adfa21e47a72..d83af3978740 100644 --- a/sdk/compute/arm-compute/src/operations/galleryImages.ts +++ b/sdk/compute/arm-compute/src/operations/galleryImages.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { GalleryImages } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { GalleryImage, GalleryImagesListByGalleryNextOptionalParams, GalleryImagesListByGalleryOptionalParams, + GalleryImagesListByGalleryResponse, GalleryImagesCreateOrUpdateOptionalParams, GalleryImagesCreateOrUpdateResponse, GalleryImageUpdate, @@ -26,7 +28,6 @@ import { GalleryImagesGetOptionalParams, GalleryImagesGetResponse, GalleryImagesDeleteOptionalParams, - GalleryImagesListByGalleryResponse, GalleryImagesListByGalleryNextResponse } from "../models"; @@ -67,11 +68,15 @@ export class GalleryImagesImpl implements GalleryImages { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByGalleryPagingPage( resourceGroupName, galleryName, - options + options, + settings ); } }; @@ -80,15 +85,22 @@ export class GalleryImagesImpl implements GalleryImages { private async *listByGalleryPagingPage( resourceGroupName: string, galleryName: string, - options?: GalleryImagesListByGalleryOptionalParams + options?: GalleryImagesListByGalleryOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByGallery( - resourceGroupName, - galleryName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: GalleryImagesListByGalleryResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByGallery( + resourceGroupName, + galleryName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByGalleryNext( resourceGroupName, @@ -97,7 +109,9 @@ export class GalleryImagesImpl implements GalleryImages { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -631,7 +645,6 @@ const listByGalleryNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/images.ts b/sdk/compute/arm-compute/src/operations/images.ts index 2cdf89be6513..cec5902f6ba9 100644 --- a/sdk/compute/arm-compute/src/operations/images.ts +++ b/sdk/compute/arm-compute/src/operations/images.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Images } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,8 +19,10 @@ import { Image, ImagesListByResourceGroupNextOptionalParams, ImagesListByResourceGroupOptionalParams, + ImagesListByResourceGroupResponse, ImagesListNextOptionalParams, ImagesListOptionalParams, + ImagesListResponse, ImagesCreateOrUpdateOptionalParams, ImagesCreateOrUpdateResponse, ImageUpdate, @@ -28,8 +31,6 @@ import { ImagesDeleteOptionalParams, ImagesGetOptionalParams, ImagesGetResponse, - ImagesListByResourceGroupResponse, - ImagesListResponse, ImagesListByResourceGroupNextResponse, ImagesListNextResponse } from "../models"; @@ -64,19 +65,33 @@ export class ImagesImpl implements Images { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ImagesListByResourceGroupOptionalParams + options?: ImagesListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ImagesListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -84,7 +99,9 @@ export class ImagesImpl implements Images { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -116,22 +133,34 @@ export class ImagesImpl implements Images { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: ImagesListOptionalParams + options?: ImagesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ImagesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -643,7 +672,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -664,7 +692,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/operations.ts b/sdk/compute/arm-compute/src/operations/operations.ts index 815008e5d644..179dc78a0e09 100644 --- a/sdk/compute/arm-compute/src/operations/operations.ts +++ b/sdk/compute/arm-compute/src/operations/operations.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { Operations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -46,16 +46,21 @@ export class OperationsImpl implements Operations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: OperationsListOptionalParams + options?: OperationsListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); + let result: OperationsListResponse; + result = await this._list(options); yield result.value || []; } diff --git a/sdk/compute/arm-compute/src/operations/proximityPlacementGroups.ts b/sdk/compute/arm-compute/src/operations/proximityPlacementGroups.ts index c0014990f2ce..f132008f1fa9 100644 --- a/sdk/compute/arm-compute/src/operations/proximityPlacementGroups.ts +++ b/sdk/compute/arm-compute/src/operations/proximityPlacementGroups.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ProximityPlacementGroups } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,8 +17,10 @@ import { ProximityPlacementGroup, ProximityPlacementGroupsListBySubscriptionNextOptionalParams, ProximityPlacementGroupsListBySubscriptionOptionalParams, + ProximityPlacementGroupsListBySubscriptionResponse, ProximityPlacementGroupsListByResourceGroupNextOptionalParams, ProximityPlacementGroupsListByResourceGroupOptionalParams, + ProximityPlacementGroupsListByResourceGroupResponse, ProximityPlacementGroupsCreateOrUpdateOptionalParams, ProximityPlacementGroupsCreateOrUpdateResponse, ProximityPlacementGroupUpdate, @@ -26,8 +29,6 @@ import { ProximityPlacementGroupsDeleteOptionalParams, ProximityPlacementGroupsGetOptionalParams, ProximityPlacementGroupsGetResponse, - ProximityPlacementGroupsListBySubscriptionResponse, - ProximityPlacementGroupsListByResourceGroupResponse, ProximityPlacementGroupsListBySubscriptionNextResponse, ProximityPlacementGroupsListByResourceGroupNextResponse } from "../models"; @@ -60,22 +61,34 @@ export class ProximityPlacementGroupsImpl implements ProximityPlacementGroups { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: ProximityPlacementGroupsListBySubscriptionOptionalParams + options?: ProximityPlacementGroupsListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ProximityPlacementGroupsListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -104,19 +117,33 @@ export class ProximityPlacementGroupsImpl implements ProximityPlacementGroups { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: ProximityPlacementGroupsListByResourceGroupOptionalParams + options?: ProximityPlacementGroupsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ProximityPlacementGroupsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -124,7 +151,9 @@ export class ProximityPlacementGroupsImpl implements ProximityPlacementGroups { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -417,7 +446,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -437,7 +465,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/resourceSkus.ts b/sdk/compute/arm-compute/src/operations/resourceSkus.ts index a039e650b6c2..f500d42fc553 100644 --- a/sdk/compute/arm-compute/src/operations/resourceSkus.ts +++ b/sdk/compute/arm-compute/src/operations/resourceSkus.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { ResourceSkus } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -48,22 +49,34 @@ export class ResourceSkusImpl implements ResourceSkus { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: ResourceSkusListOptionalParams + options?: ResourceSkusListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: ResourceSkusListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -128,11 +141,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ResourceSkusResult } }, - queryParameters: [ - Parameters.filter, - Parameters.apiVersion2, - Parameters.includeExtendedLocations - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/restorePointCollections.ts b/sdk/compute/arm-compute/src/operations/restorePointCollections.ts index 298ebd4b74f4..5d092f484754 100644 --- a/sdk/compute/arm-compute/src/operations/restorePointCollections.ts +++ b/sdk/compute/arm-compute/src/operations/restorePointCollections.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { RestorePointCollections } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,8 +19,10 @@ import { RestorePointCollection, RestorePointCollectionsListNextOptionalParams, RestorePointCollectionsListOptionalParams, + RestorePointCollectionsListResponse, RestorePointCollectionsListAllNextOptionalParams, RestorePointCollectionsListAllOptionalParams, + RestorePointCollectionsListAllResponse, RestorePointCollectionsCreateOrUpdateOptionalParams, RestorePointCollectionsCreateOrUpdateResponse, RestorePointCollectionUpdate, @@ -28,8 +31,6 @@ import { RestorePointCollectionsDeleteOptionalParams, RestorePointCollectionsGetOptionalParams, RestorePointCollectionsGetResponse, - RestorePointCollectionsListResponse, - RestorePointCollectionsListAllResponse, RestorePointCollectionsListNextResponse, RestorePointCollectionsListAllNextResponse } from "../models"; @@ -64,19 +65,29 @@ export class RestorePointCollectionsImpl implements RestorePointCollections { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, options, settings); } }; } private async *listPagingPage( resourceGroupName: string, - options?: RestorePointCollectionsListOptionalParams + options?: RestorePointCollectionsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: RestorePointCollectionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -84,7 +95,9 @@ export class RestorePointCollectionsImpl implements RestorePointCollections { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -114,22 +127,34 @@ export class RestorePointCollectionsImpl implements RestorePointCollections { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAllPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAllPagingPage(options, settings); } }; } private async *listAllPagingPage( - options?: RestorePointCollectionsListAllOptionalParams + options?: RestorePointCollectionsListAllOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAll(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: RestorePointCollectionsListAllResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAll(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAllNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -489,7 +514,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -510,7 +534,6 @@ const listAllNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleries.ts b/sdk/compute/arm-compute/src/operations/sharedGalleries.ts index f5abdd93c621..fbfc216914cd 100644 --- a/sdk/compute/arm-compute/src/operations/sharedGalleries.ts +++ b/sdk/compute/arm-compute/src/operations/sharedGalleries.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SharedGalleries } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -52,23 +53,35 @@ export class SharedGalleriesImpl implements SharedGalleries { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(location, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(location, options, settings); } }; } private async *listPagingPage( location: string, - options?: SharedGalleriesListOptionalParams + options?: SharedGalleriesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(location, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SharedGalleriesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(location, continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -187,7 +200,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts b/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts index c7dbaca5dbdd..d079ce61a9b9 100644 --- a/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts +++ b/sdk/compute/arm-compute/src/operations/sharedGalleryImageVersions.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SharedGalleryImageVersions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -63,12 +64,16 @@ export class SharedGalleryImageVersionsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( location, galleryUniqueName, galleryImageName, - options + options, + settings ); } }; @@ -78,16 +83,23 @@ export class SharedGalleryImageVersionsImpl location: string, galleryUniqueName: string, galleryImageName: string, - options?: SharedGalleryImageVersionsListOptionalParams + options?: SharedGalleryImageVersionsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - location, - galleryUniqueName, - galleryImageName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SharedGalleryImageVersionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + location, + galleryUniqueName, + galleryImageName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( location, @@ -97,7 +109,9 @@ export class SharedGalleryImageVersionsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -250,7 +264,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts b/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts index f7b0d7bb59df..4f5bc150e926 100644 --- a/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts +++ b/sdk/compute/arm-compute/src/operations/sharedGalleryImages.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SharedGalleryImages } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -54,8 +55,16 @@ export class SharedGalleryImagesImpl implements SharedGalleryImages { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(location, galleryUniqueName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + location, + galleryUniqueName, + options, + settings + ); } }; } @@ -63,11 +72,18 @@ export class SharedGalleryImagesImpl implements SharedGalleryImages { private async *listPagingPage( location: string, galleryUniqueName: string, - options?: SharedGalleryImagesListOptionalParams + options?: SharedGalleryImagesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(location, galleryUniqueName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SharedGalleryImagesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, galleryUniqueName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( location, @@ -76,7 +92,9 @@ export class SharedGalleryImagesImpl implements SharedGalleryImages { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -209,7 +227,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion3, Parameters.sharedTo], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/snapshots.ts b/sdk/compute/arm-compute/src/operations/snapshots.ts index 4d0aa75b50e1..f4323659fdfe 100644 --- a/sdk/compute/arm-compute/src/operations/snapshots.ts +++ b/sdk/compute/arm-compute/src/operations/snapshots.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { Snapshots } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,8 +19,10 @@ import { Snapshot, SnapshotsListByResourceGroupNextOptionalParams, SnapshotsListByResourceGroupOptionalParams, + SnapshotsListByResourceGroupResponse, SnapshotsListNextOptionalParams, SnapshotsListOptionalParams, + SnapshotsListResponse, SnapshotsCreateOrUpdateOptionalParams, SnapshotsCreateOrUpdateResponse, SnapshotUpdate, @@ -28,8 +31,6 @@ import { SnapshotsGetOptionalParams, SnapshotsGetResponse, SnapshotsDeleteOptionalParams, - SnapshotsListByResourceGroupResponse, - SnapshotsListResponse, GrantAccessData, SnapshotsGrantAccessOptionalParams, SnapshotsGrantAccessResponse, @@ -68,19 +69,33 @@ export class SnapshotsImpl implements Snapshots { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: SnapshotsListByResourceGroupOptionalParams + options?: SnapshotsListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SnapshotsListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -88,7 +103,9 @@ export class SnapshotsImpl implements Snapshots { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -119,22 +136,34 @@ export class SnapshotsImpl implements Snapshots { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(options, settings); } }; } private async *listPagingPage( - options?: SnapshotsListOptionalParams + options?: SnapshotsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SnapshotsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -863,7 +892,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SnapshotList } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -881,7 +909,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.SnapshotList } }, - queryParameters: [Parameters.apiVersion1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/sshPublicKeys.ts b/sdk/compute/arm-compute/src/operations/sshPublicKeys.ts index e53a341cb169..069c4705476c 100644 --- a/sdk/compute/arm-compute/src/operations/sshPublicKeys.ts +++ b/sdk/compute/arm-compute/src/operations/sshPublicKeys.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { SshPublicKeys } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -16,9 +17,9 @@ import { SshPublicKeyResource, SshPublicKeysListBySubscriptionNextOptionalParams, SshPublicKeysListBySubscriptionOptionalParams, + SshPublicKeysListBySubscriptionResponse, SshPublicKeysListByResourceGroupNextOptionalParams, SshPublicKeysListByResourceGroupOptionalParams, - SshPublicKeysListBySubscriptionResponse, SshPublicKeysListByResourceGroupResponse, SshPublicKeysCreateOptionalParams, SshPublicKeysCreateResponse, @@ -63,22 +64,34 @@ export class SshPublicKeysImpl implements SshPublicKeys { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listBySubscriptionPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listBySubscriptionPagingPage(options, settings); } }; } private async *listBySubscriptionPagingPage( - options?: SshPublicKeysListBySubscriptionOptionalParams + options?: SshPublicKeysListBySubscriptionOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listBySubscription(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SshPublicKeysListBySubscriptionResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listBySubscription(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listBySubscriptionNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -108,19 +121,33 @@ export class SshPublicKeysImpl implements SshPublicKeys { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByResourceGroupPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByResourceGroupPagingPage( + resourceGroupName, + options, + settings + ); } }; } private async *listByResourceGroupPagingPage( resourceGroupName: string, - options?: SshPublicKeysListByResourceGroupOptionalParams + options?: SshPublicKeysListByResourceGroupOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByResourceGroup(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: SshPublicKeysListByResourceGroupResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByResourceGroup(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByResourceGroupNext( resourceGroupName, @@ -128,7 +155,9 @@ export class SshPublicKeysImpl implements SshPublicKeys { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -465,7 +494,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -485,7 +513,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/usageOperations.ts b/sdk/compute/arm-compute/src/operations/usageOperations.ts index bc6a70ec7a94..c554e62731ef 100644 --- a/sdk/compute/arm-compute/src/operations/usageOperations.ts +++ b/sdk/compute/arm-compute/src/operations/usageOperations.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { UsageOperations } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -51,23 +52,35 @@ export class UsageOperationsImpl implements UsageOperations { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(location, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(location, options, settings); } }; } private async *listPagingPage( location: string, - options?: UsageListOptionalParams + options?: UsageListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(location, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: UsageListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(location, continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -148,7 +161,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.location, diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineExtensionImages.ts b/sdk/compute/arm-compute/src/operations/virtualMachineExtensionImages.ts index 2d5b9aef5d2c..8d337c4325b7 100644 --- a/sdk/compute/arm-compute/src/operations/virtualMachineExtensionImages.ts +++ b/sdk/compute/arm-compute/src/operations/virtualMachineExtensionImages.ts @@ -37,19 +37,19 @@ export class VirtualMachineExtensionImagesImpl * Gets a virtual machine extension image. * @param location The name of a supported Azure region. * @param publisherName - * @param version * @param typeParam + * @param version * @param options The options parameters. */ get( location: string, publisherName: string, - version: string, typeParam: string, + version: string, options?: VirtualMachineExtensionImagesGetOptionalParams ): Promise { return this.client.sendOperationRequest( - { location, publisherName, version, typeParam, options }, + { location, publisherName, typeParam, version, options }, getOperationSpec ); } diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineRunCommands.ts b/sdk/compute/arm-compute/src/operations/virtualMachineRunCommands.ts index ab56e1be054c..459c9cc5fc75 100644 --- a/sdk/compute/arm-compute/src/operations/virtualMachineRunCommands.ts +++ b/sdk/compute/arm-compute/src/operations/virtualMachineRunCommands.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { VirtualMachineRunCommands } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,10 +19,11 @@ import { RunCommandDocumentBase, VirtualMachineRunCommandsListNextOptionalParams, VirtualMachineRunCommandsListOptionalParams, + VirtualMachineRunCommandsListResponse, VirtualMachineRunCommand, VirtualMachineRunCommandsListByVirtualMachineNextOptionalParams, VirtualMachineRunCommandsListByVirtualMachineOptionalParams, - VirtualMachineRunCommandsListResponse, + VirtualMachineRunCommandsListByVirtualMachineResponse, VirtualMachineRunCommandsGetOptionalParams, VirtualMachineRunCommandsGetResponse, VirtualMachineRunCommandsCreateOrUpdateOptionalParams, @@ -32,7 +34,6 @@ import { VirtualMachineRunCommandsDeleteOptionalParams, VirtualMachineRunCommandsGetByVirtualMachineOptionalParams, VirtualMachineRunCommandsGetByVirtualMachineResponse, - VirtualMachineRunCommandsListByVirtualMachineResponse, VirtualMachineRunCommandsListNextResponse, VirtualMachineRunCommandsListByVirtualMachineNextResponse } from "../models"; @@ -68,23 +69,35 @@ export class VirtualMachineRunCommandsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(location, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(location, options, settings); } }; } private async *listPagingPage( location: string, - options?: VirtualMachineRunCommandsListOptionalParams + options?: VirtualMachineRunCommandsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(location, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineRunCommandsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext(location, continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -120,11 +133,15 @@ export class VirtualMachineRunCommandsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listByVirtualMachinePagingPage( resourceGroupName, vmName, - options + options, + settings ); } }; @@ -133,15 +150,22 @@ export class VirtualMachineRunCommandsImpl private async *listByVirtualMachinePagingPage( resourceGroupName: string, vmName: string, - options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams + options?: VirtualMachineRunCommandsListByVirtualMachineOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByVirtualMachine( - resourceGroupName, - vmName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineRunCommandsListByVirtualMachineResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByVirtualMachine( + resourceGroupName, + vmName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByVirtualMachineNext( resourceGroupName, @@ -150,7 +174,9 @@ export class VirtualMachineRunCommandsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -738,7 +764,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.RunCommandListResult } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.location, @@ -759,7 +784,6 @@ const listByVirtualMachineNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.expand1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetExtensions.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetExtensions.ts index 5748bb923a9e..302f11644fd7 100644 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetExtensions.ts +++ b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetExtensions.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { VirtualMachineScaleSetExtensions } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { VirtualMachineScaleSetExtension, VirtualMachineScaleSetExtensionsListNextOptionalParams, VirtualMachineScaleSetExtensionsListOptionalParams, + VirtualMachineScaleSetExtensionsListResponse, VirtualMachineScaleSetExtensionsCreateOrUpdateOptionalParams, VirtualMachineScaleSetExtensionsCreateOrUpdateResponse, VirtualMachineScaleSetExtensionUpdate, @@ -26,7 +28,6 @@ import { VirtualMachineScaleSetExtensionsDeleteOptionalParams, VirtualMachineScaleSetExtensionsGetOptionalParams, VirtualMachineScaleSetExtensionsGetResponse, - VirtualMachineScaleSetExtensionsListResponse, VirtualMachineScaleSetExtensionsListNextResponse } from "../models"; @@ -63,8 +64,16 @@ export class VirtualMachineScaleSetExtensionsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, vmScaleSetName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage( + resourceGroupName, + vmScaleSetName, + options, + settings + ); } }; } @@ -72,11 +81,18 @@ export class VirtualMachineScaleSetExtensionsImpl private async *listPagingPage( resourceGroupName: string, vmScaleSetName: string, - options?: VirtualMachineScaleSetExtensionsListOptionalParams + options?: VirtualMachineScaleSetExtensionsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, vmScaleSetName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineScaleSetExtensionsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, vmScaleSetName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -85,7 +101,9 @@ export class VirtualMachineScaleSetExtensionsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -604,7 +622,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMRunCommands.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMRunCommands.ts index 39247fa20f71..1cd694a32089 100644 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMRunCommands.ts +++ b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMRunCommands.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { VirtualMachineScaleSetVMRunCommands } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { VirtualMachineRunCommand, VirtualMachineScaleSetVMRunCommandsListNextOptionalParams, VirtualMachineScaleSetVMRunCommandsListOptionalParams, + VirtualMachineScaleSetVMRunCommandsListResponse, VirtualMachineScaleSetVMRunCommandsCreateOrUpdateOptionalParams, VirtualMachineScaleSetVMRunCommandsCreateOrUpdateResponse, VirtualMachineRunCommandUpdate, @@ -26,7 +28,6 @@ import { VirtualMachineScaleSetVMRunCommandsDeleteOptionalParams, VirtualMachineScaleSetVMRunCommandsGetOptionalParams, VirtualMachineScaleSetVMRunCommandsGetResponse, - VirtualMachineScaleSetVMRunCommandsListResponse, VirtualMachineScaleSetVMRunCommandsListNextResponse } from "../models"; @@ -70,12 +71,16 @@ export class VirtualMachineScaleSetVMRunCommandsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, vmScaleSetName, instanceId, - options + options, + settings ); } }; @@ -85,16 +90,23 @@ export class VirtualMachineScaleSetVMRunCommandsImpl resourceGroupName: string, vmScaleSetName: string, instanceId: string, - options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams + options?: VirtualMachineScaleSetVMRunCommandsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - vmScaleSetName, - instanceId, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineScaleSetVMRunCommandsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + vmScaleSetName, + instanceId, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -104,7 +116,9 @@ export class VirtualMachineScaleSetVMRunCommandsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -665,7 +679,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.expand1], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMs.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMs.ts index 963856ca7419..09ca5b32488a 100644 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMs.ts +++ b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSetVMs.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { VirtualMachineScaleSetVMs } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,6 +19,7 @@ import { VirtualMachineScaleSetVM, VirtualMachineScaleSetVMsListNextOptionalParams, VirtualMachineScaleSetVMsListOptionalParams, + VirtualMachineScaleSetVMsListResponse, VirtualMachineScaleSetVMsReimageOptionalParams, VirtualMachineScaleSetVMsReimageAllOptionalParams, VirtualMachineScaleSetVMsDeallocateOptionalParams, @@ -28,7 +30,6 @@ import { VirtualMachineScaleSetVMsGetResponse, VirtualMachineScaleSetVMsGetInstanceViewOptionalParams, VirtualMachineScaleSetVMsGetInstanceViewResponse, - VirtualMachineScaleSetVMsListResponse, VirtualMachineScaleSetVMsPowerOffOptionalParams, VirtualMachineScaleSetVMsRestartOptionalParams, VirtualMachineScaleSetVMsStartOptionalParams, @@ -80,11 +81,15 @@ export class VirtualMachineScaleSetVMsImpl [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listPagingPage( resourceGroupName, virtualMachineScaleSetName, - options + options, + settings ); } }; @@ -93,15 +98,22 @@ export class VirtualMachineScaleSetVMsImpl private async *listPagingPage( resourceGroupName: string, virtualMachineScaleSetName: string, - options?: VirtualMachineScaleSetVMsListOptionalParams + options?: VirtualMachineScaleSetVMsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list( - resourceGroupName, - virtualMachineScaleSetName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineScaleSetVMsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list( + resourceGroupName, + virtualMachineScaleSetName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -110,7 +122,9 @@ export class VirtualMachineScaleSetVMsImpl options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -1647,12 +1661,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.expand1, - Parameters.filter, - Parameters.select - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSets.ts b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSets.ts index ba9bad087677..ae0e7cd261f1 100644 --- a/sdk/compute/arm-compute/src/operations/virtualMachineScaleSets.ts +++ b/sdk/compute/arm-compute/src/operations/virtualMachineScaleSets.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { VirtualMachineScaleSets } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,17 +19,21 @@ import { VirtualMachineScaleSet, VirtualMachineScaleSetsListByLocationNextOptionalParams, VirtualMachineScaleSetsListByLocationOptionalParams, + VirtualMachineScaleSetsListByLocationResponse, VirtualMachineScaleSetsListNextOptionalParams, VirtualMachineScaleSetsListOptionalParams, + VirtualMachineScaleSetsListResponse, VirtualMachineScaleSetsListAllNextOptionalParams, VirtualMachineScaleSetsListAllOptionalParams, + VirtualMachineScaleSetsListAllResponse, VirtualMachineScaleSetSku, VirtualMachineScaleSetsListSkusNextOptionalParams, VirtualMachineScaleSetsListSkusOptionalParams, + VirtualMachineScaleSetsListSkusResponse, UpgradeOperationHistoricalStatusInfo, VirtualMachineScaleSetsGetOSUpgradeHistoryNextOptionalParams, VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, - VirtualMachineScaleSetsListByLocationResponse, + VirtualMachineScaleSetsGetOSUpgradeHistoryResponse, VirtualMachineScaleSetsCreateOrUpdateOptionalParams, VirtualMachineScaleSetsCreateOrUpdateResponse, VirtualMachineScaleSetUpdate, @@ -42,10 +47,6 @@ import { VirtualMachineScaleSetsDeleteInstancesOptionalParams, VirtualMachineScaleSetsGetInstanceViewOptionalParams, VirtualMachineScaleSetsGetInstanceViewResponse, - VirtualMachineScaleSetsListResponse, - VirtualMachineScaleSetsListAllResponse, - VirtualMachineScaleSetsListSkusResponse, - VirtualMachineScaleSetsGetOSUpgradeHistoryResponse, VirtualMachineScaleSetsPowerOffOptionalParams, VirtualMachineScaleSetsRestartOptionalParams, VirtualMachineScaleSetsStartOptionalParams, @@ -97,19 +98,29 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByLocationPagingPage(location, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByLocationPagingPage(location, options, settings); } }; } private async *listByLocationPagingPage( location: string, - options?: VirtualMachineScaleSetsListByLocationOptionalParams + options?: VirtualMachineScaleSetsListByLocationOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByLocation(location, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineScaleSetsListByLocationResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByLocation(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByLocationNext( location, @@ -117,7 +128,9 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -147,19 +160,29 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, options, settings); } }; } private async *listPagingPage( resourceGroupName: string, - options?: VirtualMachineScaleSetsListOptionalParams + options?: VirtualMachineScaleSetsListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineScaleSetsListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -167,7 +190,9 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -197,22 +222,34 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAllPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAllPagingPage(options, settings); } }; } private async *listAllPagingPage( - options?: VirtualMachineScaleSetsListAllOptionalParams + options?: VirtualMachineScaleSetsListAllOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAll(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineScaleSetsListAllResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAll(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAllNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -248,11 +285,15 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listSkusPagingPage( resourceGroupName, vmScaleSetName, - options + options, + settings ); } }; @@ -261,15 +302,18 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { private async *listSkusPagingPage( resourceGroupName: string, vmScaleSetName: string, - options?: VirtualMachineScaleSetsListSkusOptionalParams + options?: VirtualMachineScaleSetsListSkusOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listSkus( - resourceGroupName, - vmScaleSetName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineScaleSetsListSkusResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listSkus(resourceGroupName, vmScaleSetName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listSkusNext( resourceGroupName, @@ -278,7 +322,9 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -319,11 +365,15 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.getOSUpgradeHistoryPagingPage( resourceGroupName, vmScaleSetName, - options + options, + settings ); } }; @@ -332,15 +382,22 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { private async *getOSUpgradeHistoryPagingPage( resourceGroupName: string, vmScaleSetName: string, - options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams + options?: VirtualMachineScaleSetsGetOSUpgradeHistoryOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._getOSUpgradeHistory( - resourceGroupName, - vmScaleSetName, - options - ); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachineScaleSetsGetOSUpgradeHistoryResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._getOSUpgradeHistory( + resourceGroupName, + vmScaleSetName, + options + ); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._getOSUpgradeHistoryNext( resourceGroupName, @@ -349,7 +406,9 @@ export class VirtualMachineScaleSetsImpl implements VirtualMachineScaleSets { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -2385,7 +2444,6 @@ const listByLocationNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.location, @@ -2406,7 +2464,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -2427,7 +2484,6 @@ const listAllNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -2447,7 +2503,6 @@ const listSkusNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -2469,7 +2524,6 @@ const getOSUpgradeHistoryNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operations/virtualMachineSizes.ts b/sdk/compute/arm-compute/src/operations/virtualMachineSizes.ts index b95f88ea0177..ad6b8563010b 100644 --- a/sdk/compute/arm-compute/src/operations/virtualMachineSizes.ts +++ b/sdk/compute/arm-compute/src/operations/virtualMachineSizes.ts @@ -6,7 +6,7 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; import { VirtualMachineSizes } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -49,17 +49,22 @@ export class VirtualMachineSizesImpl implements VirtualMachineSizes { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(location, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(location, options, settings); } }; } private async *listPagingPage( location: string, - options?: VirtualMachineSizesListOptionalParams + options?: VirtualMachineSizesListOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(location, options); + let result: VirtualMachineSizesListResponse; + result = await this._list(location, options); yield result.value || []; } diff --git a/sdk/compute/arm-compute/src/operations/virtualMachines.ts b/sdk/compute/arm-compute/src/operations/virtualMachines.ts index aaf302d1d269..78a86d4bd3cb 100644 --- a/sdk/compute/arm-compute/src/operations/virtualMachines.ts +++ b/sdk/compute/arm-compute/src/operations/virtualMachines.ts @@ -6,7 +6,8 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; +import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; +import { setContinuationToken } from "../pagingHelper"; import { VirtualMachines } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; @@ -18,13 +19,16 @@ import { VirtualMachine, VirtualMachinesListByLocationNextOptionalParams, VirtualMachinesListByLocationOptionalParams, + VirtualMachinesListByLocationResponse, VirtualMachinesListNextOptionalParams, VirtualMachinesListOptionalParams, + VirtualMachinesListResponse, VirtualMachinesListAllNextOptionalParams, VirtualMachinesListAllOptionalParams, + VirtualMachinesListAllResponse, VirtualMachineSize, VirtualMachinesListAvailableSizesOptionalParams, - VirtualMachinesListByLocationResponse, + VirtualMachinesListAvailableSizesResponse, VirtualMachineCaptureParameters, VirtualMachinesCaptureOptionalParams, VirtualMachinesCaptureResponse, @@ -41,9 +45,6 @@ import { VirtualMachinesConvertToManagedDisksOptionalParams, VirtualMachinesDeallocateOptionalParams, VirtualMachinesGeneralizeOptionalParams, - VirtualMachinesListResponse, - VirtualMachinesListAllResponse, - VirtualMachinesListAvailableSizesResponse, VirtualMachinesPowerOffOptionalParams, VirtualMachinesReapplyOptionalParams, VirtualMachinesRestartOptionalParams, @@ -97,19 +98,29 @@ export class VirtualMachinesImpl implements VirtualMachines { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listByLocationPagingPage(location, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listByLocationPagingPage(location, options, settings); } }; } private async *listByLocationPagingPage( location: string, - options?: VirtualMachinesListByLocationOptionalParams + options?: VirtualMachinesListByLocationOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listByLocation(location, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachinesListByLocationResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listByLocation(location, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listByLocationNext( location, @@ -117,7 +128,9 @@ export class VirtualMachinesImpl implements VirtualMachines { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -148,19 +161,29 @@ export class VirtualMachinesImpl implements VirtualMachines { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listPagingPage(resourceGroupName, options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listPagingPage(resourceGroupName, options, settings); } }; } private async *listPagingPage( resourceGroupName: string, - options?: VirtualMachinesListOptionalParams + options?: VirtualMachinesListOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._list(resourceGroupName, options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachinesListResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._list(resourceGroupName, options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listNext( resourceGroupName, @@ -168,7 +191,9 @@ export class VirtualMachinesImpl implements VirtualMachines { options ); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -197,22 +222,34 @@ export class VirtualMachinesImpl implements VirtualMachines { [Symbol.asyncIterator]() { return this; }, - byPage: () => { - return this.listAllPagingPage(options); + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } + return this.listAllPagingPage(options, settings); } }; } private async *listAllPagingPage( - options?: VirtualMachinesListAllOptionalParams + options?: VirtualMachinesListAllOptionalParams, + settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAll(options); - yield result.value || []; - let continuationToken = result.nextLink; + let result: VirtualMachinesListAllResponse; + let continuationToken = settings?.continuationToken; + if (!continuationToken) { + result = await this._listAll(options); + let page = result.value || []; + continuationToken = result.nextLink; + setContinuationToken(page, continuationToken); + yield page; + } while (continuationToken) { result = await this._listAllNext(continuationToken, options); continuationToken = result.nextLink; - yield result.value || []; + let page = result.value || []; + setContinuationToken(page, continuationToken); + yield page; } } @@ -247,11 +284,15 @@ export class VirtualMachinesImpl implements VirtualMachines { [Symbol.asyncIterator]() { return this; }, - byPage: () => { + byPage: (settings?: PageSettings) => { + if (settings?.maxPageSize) { + throw new Error("maxPageSize is not supported by this operation."); + } return this.listAvailableSizesPagingPage( resourceGroupName, vmName, - options + options, + settings ); } }; @@ -260,13 +301,11 @@ export class VirtualMachinesImpl implements VirtualMachines { private async *listAvailableSizesPagingPage( resourceGroupName: string, vmName: string, - options?: VirtualMachinesListAvailableSizesOptionalParams + options?: VirtualMachinesListAvailableSizesOptionalParams, + _settings?: PageSettings ): AsyncIterableIterator { - let result = await this._listAvailableSizes( - resourceGroupName, - vmName, - options - ); + let result: VirtualMachinesListAvailableSizesResponse; + result = await this._listAvailableSizes(resourceGroupName, vmName, options); yield result.value || []; } @@ -2468,7 +2507,6 @@ const listByLocationNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.location, @@ -2489,7 +2527,6 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.subscriptionId, @@ -2510,11 +2547,6 @@ const listAllNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.CloudError } }, - queryParameters: [ - Parameters.apiVersion, - Parameters.filter, - Parameters.statusOnly - ], urlParameters: [ Parameters.$host, Parameters.subscriptionId, diff --git a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensionImages.ts b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensionImages.ts index 9ffcfbb96ad9..34eeb14c3eeb 100644 --- a/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensionImages.ts +++ b/sdk/compute/arm-compute/src/operationsInterfaces/virtualMachineExtensionImages.ts @@ -21,15 +21,15 @@ export interface VirtualMachineExtensionImages { * Gets a virtual machine extension image. * @param location The name of a supported Azure region. * @param publisherName - * @param version * @param typeParam + * @param version * @param options The options parameters. */ get( location: string, publisherName: string, - version: string, typeParam: string, + version: string, options?: VirtualMachineExtensionImagesGetOptionalParams ): Promise; /** diff --git a/sdk/compute/arm-compute/src/pagingHelper.ts b/sdk/compute/arm-compute/src/pagingHelper.ts new file mode 100644 index 000000000000..269a2b9814b5 --- /dev/null +++ b/sdk/compute/arm-compute/src/pagingHelper.ts @@ -0,0 +1,39 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +export interface PageInfo { + continuationToken?: string; +} + +const pageMap = new WeakMap(); + +/** + * Given the last `.value` produced by the `byPage` iterator, + * returns a continuation token that can be used to begin paging from + * that point later. + * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator. + * @returns The continuation token that can be passed into byPage() during future calls. + */ +export function getContinuationToken(page: unknown): string | undefined { + if (typeof page !== "object" || page === null) { + return undefined; + } + return pageMap.get(page)?.continuationToken; +} + +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined +): void { + if (typeof page !== "object" || page === null || !continuationToken) { + return; + } + const pageInfo = pageMap.get(page) ?? {}; + pageInfo.continuationToken = continuationToken; + pageMap.set(page, pageInfo); +} diff --git a/sdk/compute/arm-compute/test/sampleTest.ts b/sdk/compute/arm-compute/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/compute/arm-compute/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/compute/arm-compute/tsconfig.json b/sdk/compute/arm-compute/tsconfig.json index b84abc8423ab..3e6ae96443f3 100644 --- a/sdk/compute/arm-compute/tsconfig.json +++ b/sdk/compute/arm-compute/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-compute": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"