From 3e08e0b642cbf14102711e69db97eba39ead7c87 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 12 Dec 2024 20:39:56 +0000 Subject: [PATCH] CodeGen from PR 31866 in Azure/azure-rest-api-specs Merge 0783d0c8f85f52be2830eab3f1ac1a36e0e935f0 into 85ed8fc06e19c902c95b531cbd8a643428d5f28d --- common/config/rush/pnpm-lock.yaml | 36 +- sdk/quota/arm-quota/CHANGELOG.md | 166 +++- sdk/quota/arm-quota/README.md | 1 - sdk/quota/arm-quota/_meta.json | 10 +- sdk/quota/arm-quota/api-extractor.json | 2 +- sdk/quota/arm-quota/package.json | 67 +- sdk/quota/arm-quota/review/arm-quota.api.md | 113 +-- sdk/quota/arm-quota/sample.env | 5 +- .../arm-quota/src/azureQuotaExtensionAPI.ts | 50 +- sdk/quota/arm-quota/src/lroImpl.ts | 5 +- sdk/quota/arm-quota/src/models/index.ts | 328 +++---- sdk/quota/arm-quota/src/models/mappers.ts | 927 +++++++++--------- sdk/quota/arm-quota/src/models/parameters.ts | 52 +- .../src/operations/groupQuotaLimits.ts | 247 +---- .../src/operations/groupQuotaLimitsRequest.ts | 199 +--- .../operations/groupQuotaLocationSettings.ts | 23 +- .../groupQuotaSubscriptionAllocation.ts | 219 +---- ...groupQuotaSubscriptionAllocationRequest.ts | 329 ++----- .../groupQuotaSubscriptionRequests.ts | 30 +- .../src/operations/groupQuotaSubscriptions.ts | 59 +- .../arm-quota/src/operations/groupQuotas.ts | 84 +- sdk/quota/arm-quota/src/operations/index.ts | 4 +- sdk/quota/arm-quota/src/operations/quota.ts | 77 +- .../src/operations/quotaOperation.ts | 9 +- .../src/operations/quotaRequestStatus.ts | 15 +- sdk/quota/arm-quota/src/operations/usages.ts | 22 +- .../operationsInterfaces/groupQuotaLimits.ts | 45 +- .../groupQuotaLimitsRequest.ts | 71 +- .../groupQuotaSubscriptionAllocation.ts | 50 +- ...groupQuotaSubscriptionAllocationRequest.ts | 95 +- .../src/operationsInterfaces/groupQuotas.ts | 10 +- .../src/operationsInterfaces/index.ts | 4 +- .../src/operationsInterfaces/quota.ts | 9 +- .../operationsInterfaces/quotaOperation.ts | 4 +- sdk/quota/arm-quota/src/pagingHelper.ts | 5 +- sdk/quota/arm-quota/test/sampleTest.ts | 43 + sdk/quota/arm-quota/tsconfig.json | 21 +- 37 files changed, 1461 insertions(+), 1975 deletions(-) create mode 100644 sdk/quota/arm-quota/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 99371afd82ed..bfe44f6eca95 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3259,7 +3259,7 @@ packages: version: 0.0.0 '@rush-temp/arm-quota@file:projects/arm-quota.tgz': - resolution: {integrity: sha512-RszIfSdeseV5e7QjKSQKwJG9tcJ0GiD/KoFPvMs0Y8JKiBeRmYBTO21+kHcSjmzvfzyyL1yqsVLeisqrlbfA3A==, tarball: file:projects/arm-quota.tgz} + resolution: {integrity: sha512-ALxcQhAYQMEnYdEksVYIHGg1kwh/Z+OlcyEXQLqfBYBN2vN8DZVrUu6i9XKcZPOadzd9syho/piqcBcWL8RKgA==, tarball: file:projects/arm-quota.tgz} version: 0.0.0 '@rush-temp/arm-recoveryservices-siterecovery@file:projects/arm-recoveryservices-siterecovery.tgz': @@ -3599,7 +3599,7 @@ packages: version: 0.0.0 '@rush-temp/container-registry@file:projects/container-registry.tgz': - resolution: {integrity: sha512-AHxtCyVOmgFDmFKYr3jgh/D9GLdlJJaGeuvAhCxciN8PpRLPF/CUjp+eNzZeAd+h352yM1xYh/luQzCHcsLKtw==, tarball: file:projects/container-registry.tgz} + resolution: {integrity: sha512-TiZ/Z7Ox5LgTvY4HsWVTLaLv+P137p9P473qmw1lqDcrffv+rrg8tQhLFYdK/xc5I+rypBVT75msDDqwPrRBGA==, tarball: file:projects/container-registry.tgz} version: 0.0.0 '@rush-temp/core-amqp@file:projects/core-amqp.tgz': @@ -6663,6 +6663,11 @@ packages: mlly@1.7.3: resolution: {integrity: sha512-xUsx5n/mN0uQf4V548PKQ+YShA4/IW0KI1dZhrNrPCLG+xizETbHTkOa1f8/xut9JRPp8kQuMnz0oqwkTiLo/A==} + mocha@10.8.2: + resolution: {integrity: sha512-VZlYo/WE8t1tstuRmqgeyBgCbJc/lEdopaa+axcKzTBJ+UIdlAB9XnmvTCAH4pwR4ElNInaedhEBmZD8iCSVEg==} + engines: {node: '>= 14.0.0'} + hasBin: true + mocha@11.0.2: resolution: {integrity: sha512-IpLqigxxL825rKCce2hlJL6qiUNgxbjhpS79SA6NN+Quzrf6wzLezwk4LcfIJp/OUD5BVWTM/nCYc3oQ5uqmfw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} @@ -14310,16 +14315,16 @@ snapshots: dependencies: '@azure-tools/test-credential': 1.3.1 '@azure-tools/test-recorder': 3.5.2 - '@azure/abort-controller': 1.1.0 '@azure/core-lro': 2.7.2 '@types/chai': 4.3.20 '@types/mocha': 10.0.10 '@types/node': 18.19.68 chai: 4.5.0 dotenv: 16.4.7 - mocha: 11.0.2 + mocha: 10.8.2 ts-node: 10.9.2(@types/node@18.19.68)(typescript@5.6.3) tslib: 2.8.1 + tsx: 4.19.2 typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' @@ -22942,6 +22947,29 @@ snapshots: pkg-types: 1.2.1 ufo: 1.5.4 + mocha@10.8.2: + dependencies: + ansi-colors: 4.1.3 + browser-stdout: 1.3.1 + chokidar: 3.6.0 + debug: 4.4.0(supports-color@8.1.1) + diff: 5.2.0 + escape-string-regexp: 4.0.0 + find-up: 5.0.0 + glob: 8.1.0 + he: 1.2.0 + js-yaml: 4.1.0 + log-symbols: 4.1.0 + minimatch: 5.1.6 + ms: 2.1.3 + serialize-javascript: 6.0.2 + strip-json-comments: 3.1.1 + supports-color: 8.1.1 + workerpool: 6.5.1 + yargs: 16.2.0 + yargs-parser: 20.2.9 + yargs-unparser: 2.0.0 + mocha@11.0.2: dependencies: ansi-colors: 4.1.3 diff --git a/sdk/quota/arm-quota/CHANGELOG.md b/sdk/quota/arm-quota/CHANGELOG.md index 287c997e4172..f0a98b400e89 100644 --- a/sdk/quota/arm-quota/CHANGELOG.md +++ b/sdk/quota/arm-quota/CHANGELOG.md @@ -1,15 +1,163 @@ # Release History - -## 1.1.0-beta.2 (Unreleased) - + +## 1.1.0-beta.2 (2024-12-12) +Compared with version 1.0.0 + ### Features Added -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Added operation group GroupQuotaLimits + - Added operation group GroupQuotaLimitsRequest + - Added operation group GroupQuotaLocationSettings + - Added operation group GroupQuotas + - Added operation group GroupQuotaSubscriptionAllocation + - Added operation group GroupQuotaSubscriptionAllocationRequest + - Added operation group GroupQuotaSubscriptionRequests + - Added operation group GroupQuotaSubscriptions + - Added operation group GroupQuotaUsages + - Added Interface AdditionalAttributes + - Added Interface AdditionalAttributesPatch + - Added Interface AllocatedQuotaToSubscriptionList + - Added Interface AllocatedToSubscription + - Added Interface BillingAccountId + - Added Interface ErrorAdditionalInfo + - Added Interface ErrorDetail + - Added Interface ErrorResponse + - Added Interface GroupingId + - Added Interface GroupQuotaDetails + - Added Interface GroupQuotaDetailsName + - Added Interface GroupQuotaLimit + - Added Interface GroupQuotaLimitList + - Added Interface GroupQuotaLimitListProperties + - Added Interface GroupQuotaLimitsListOptionalParams + - Added Interface GroupQuotaLimitsRequestGetOptionalParams + - Added Interface GroupQuotaLimitsRequestListNextOptionalParams + - Added Interface GroupQuotaLimitsRequestListOptionalParams + - Added Interface GroupQuotaLimitsRequestUpdateHeaders + - Added Interface GroupQuotaLimitsRequestUpdateOptionalParams + - Added Interface GroupQuotaList + - Added Interface GroupQuotaLocationSettingsCreateOrUpdateHeaders + - Added Interface GroupQuotaLocationSettingsCreateOrUpdateOptionalParams + - Added Interface GroupQuotaLocationSettingsGetOptionalParams + - Added Interface GroupQuotaLocationSettingsListNextOptionalParams + - Added Interface GroupQuotaLocationSettingsListOptionalParams + - Added Interface GroupQuotaLocationSettingsUpdateHeaders + - Added Interface GroupQuotaLocationSettingsUpdateOptionalParams + - Added Interface GroupQuotaRequestBase + - Added Interface GroupQuotaRequestBaseProperties + - Added Interface GroupQuotaRequestBasePropertiesName + - Added Interface GroupQuotasCreateOrUpdateHeaders + - Added Interface GroupQuotasCreateOrUpdateOptionalParams + - Added Interface GroupQuotasDeleteHeaders + - Added Interface GroupQuotasDeleteOptionalParams + - Added Interface GroupQuotasEnforcementListResponse + - Added Interface GroupQuotasEnforcementResponse + - Added Interface GroupQuotasEnforcementResponseProperties + - Added Interface GroupQuotasEntity + - Added Interface GroupQuotasEntityBase + - Added Interface GroupQuotasEntityBasePatch + - Added Interface GroupQuotasEntityPatch + - Added Interface GroupQuotasGetOptionalParams + - Added Interface GroupQuotasListNextOptionalParams + - Added Interface GroupQuotasListOptionalParams + - Added Interface GroupQuotaSubscriptionAllocationListOptionalParams + - Added Interface GroupQuotaSubscriptionAllocationRequestGetOptionalParams + - Added Interface GroupQuotaSubscriptionAllocationRequestListNextOptionalParams + - Added Interface GroupQuotaSubscriptionAllocationRequestListOptionalParams + - Added Interface GroupQuotaSubscriptionAllocationRequestUpdateHeaders + - Added Interface GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams + - Added Interface GroupQuotaSubscriptionId + - Added Interface GroupQuotaSubscriptionIdList + - Added Interface GroupQuotaSubscriptionIdProperties + - Added Interface GroupQuotaSubscriptionRequestsGetOptionalParams + - Added Interface GroupQuotaSubscriptionRequestsListNextOptionalParams + - Added Interface GroupQuotaSubscriptionRequestsListOptionalParams + - Added Interface GroupQuotaSubscriptionRequestStatus + - Added Interface GroupQuotaSubscriptionRequestStatusList + - Added Interface GroupQuotaSubscriptionRequestStatusProperties + - Added Interface GroupQuotaSubscriptionsCreateOrUpdateHeaders + - Added Interface GroupQuotaSubscriptionsCreateOrUpdateOptionalParams + - Added Interface GroupQuotaSubscriptionsDeleteHeaders + - Added Interface GroupQuotaSubscriptionsDeleteOptionalParams + - Added Interface GroupQuotaSubscriptionsGetOptionalParams + - Added Interface GroupQuotaSubscriptionsListNextOptionalParams + - Added Interface GroupQuotaSubscriptionsListOptionalParams + - Added Interface GroupQuotaSubscriptionsUpdateHeaders + - Added Interface GroupQuotaSubscriptionsUpdateOptionalParams + - Added Interface GroupQuotasUpdateHeaders + - Added Interface GroupQuotasUpdateOptionalParams + - Added Interface GroupQuotaUsagesBase + - Added Interface GroupQuotaUsagesBaseName + - Added Interface GroupQuotaUsagesListNextOptionalParams + - Added Interface GroupQuotaUsagesListOptionalParams + - Added Interface LROResponse + - Added Interface LROResponseProperties + - Added Interface ProxyResource + - Added Interface QuotaAllocationRequestBase + - Added Interface QuotaAllocationRequestBaseProperties + - Added Interface QuotaAllocationRequestBasePropertiesName + - Added Interface QuotaAllocationRequestStatus + - Added Interface QuotaAllocationRequestStatusList + - Added Interface QuotaAllocationRequestStatusProperties + - Added Interface Resource + - Added Interface ResourceBaseRequest + - Added Interface ResourceUsageList + - Added Interface ResourceUsages + - Added Interface SubmittedResourceRequestStatus + - Added Interface SubmittedResourceRequestStatusList + - Added Interface SubmittedResourceRequestStatusProperties + - Added Interface SubscriptionGroupQuotaAssignment + - Added Interface SubscriptionQuotaAllocationRequestList + - Added Interface SubscriptionQuotaAllocations + - Added Interface SubscriptionQuotaAllocationsList + - Added Interface SubscriptionQuotaAllocationsListProperties + - Added Interface SubscriptionQuotaAllocationsStatusList + - Added Interface SubscriptionQuotaDetails + - Added Interface SubscriptionQuotaDetailsName + - Added Interface SystemData + - Added Type Alias CreatedByType + - Added Type Alias EnforcementState + - Added Type Alias EnvironmentType + - Added Type Alias GroupingIdType + - Added Type Alias GroupQuotaLimitsListResponse + - Added Type Alias GroupQuotaLimitsRequestGetResponse + - Added Type Alias GroupQuotaLimitsRequestListNextResponse + - Added Type Alias GroupQuotaLimitsRequestListResponse + - Added Type Alias GroupQuotaLimitsRequestUpdateResponse + - Added Type Alias GroupQuotaLocationSettingsCreateOrUpdateResponse + - Added Type Alias GroupQuotaLocationSettingsGetResponse + - Added Type Alias GroupQuotaLocationSettingsListNextResponse + - Added Type Alias GroupQuotaLocationSettingsListResponse + - Added Type Alias GroupQuotaLocationSettingsUpdateResponse + - Added Type Alias GroupQuotasCreateOrUpdateResponse + - Added Type Alias GroupQuotasDeleteResponse + - Added Type Alias GroupQuotasGetResponse + - Added Type Alias GroupQuotasListNextResponse + - Added Type Alias GroupQuotasListResponse + - Added Type Alias GroupQuotaSubscriptionAllocationListResponse + - Added Type Alias GroupQuotaSubscriptionAllocationRequestGetResponse + - Added Type Alias GroupQuotaSubscriptionAllocationRequestListNextResponse + - Added Type Alias GroupQuotaSubscriptionAllocationRequestListResponse + - Added Type Alias GroupQuotaSubscriptionAllocationRequestUpdateResponse + - Added Type Alias GroupQuotaSubscriptionRequestsGetResponse + - Added Type Alias GroupQuotaSubscriptionRequestsListNextResponse + - Added Type Alias GroupQuotaSubscriptionRequestsListResponse + - Added Type Alias GroupQuotaSubscriptionsCreateOrUpdateResponse + - Added Type Alias GroupQuotaSubscriptionsDeleteResponse + - Added Type Alias GroupQuotaSubscriptionsGetResponse + - Added Type Alias GroupQuotaSubscriptionsListNextResponse + - Added Type Alias GroupQuotaSubscriptionsListResponse + - Added Type Alias GroupQuotaSubscriptionsUpdateResponse + - Added Type Alias GroupQuotasUpdateResponse + - Added Type Alias GroupQuotaUsagesListNextResponse + - Added Type Alias GroupQuotaUsagesListResponse + - Added Type Alias RequestState + - Added Enum KnownCreatedByType + - Added Enum KnownEnforcementState + - Added Enum KnownEnvironmentType + - Added Enum KnownGroupingIdType + - Added Enum KnownRequestState + + ## 1.1.0-beta.1 (2024-04-24) ### Features Added diff --git a/sdk/quota/arm-quota/README.md b/sdk/quota/arm-quota/README.md index 543cb5442ae1..77f523ae376a 100644 --- a/sdk/quota/arm-quota/README.md +++ b/sdk/quota/arm-quota/README.md @@ -44,7 +44,6 @@ npm install @azure/identity ``` You will also need to **register a new AAD application and grant access to AzureQuotaExtensionApi** by assigning the suitable role to your service principal (note: roles such as `"Owner"` will not grant the necessary permissions). -Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables: `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, `AZURE_CLIENT_SECRET`. For more information about how to create an Azure AD Application check out [this guide](https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). diff --git a/sdk/quota/arm-quota/_meta.json b/sdk/quota/arm-quota/_meta.json index 29710fcaeb6f..6dfeda606c31 100644 --- a/sdk/quota/arm-quota/_meta.json +++ b/sdk/quota/arm-quota/_meta.json @@ -1,8 +1,8 @@ { - "commit": "c4e661cdf92c8f579574008d0cd11874cc303da0", + "commit": "c754f1fbbb8d61365749a6f78376f3e82a2a6e0b", "readme": "specification/quota/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --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\\quota\\resource-manager\\readme.md --use=@autorest/typescript@6.0.20 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --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/quota/resource-manager/readme.md --use=@autorest/typescript@^6.0.12", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "release_tool": "@azure-tools/js-sdk-release-tools@2.7.5", - "use": "@autorest/typescript@6.0.20" -} + "release_tool": "@azure-tools/js-sdk-release-tools@2.7.16", + "use": "@autorest/typescript@^6.0.12" +} \ No newline at end of file diff --git a/sdk/quota/arm-quota/api-extractor.json b/sdk/quota/arm-quota/api-extractor.json index de874aef8343..86edd97760ca 100644 --- a/sdk/quota/arm-quota/api-extractor.json +++ b/sdk/quota/arm-quota/api-extractor.json @@ -28,4 +28,4 @@ } } } -} +} \ No newline at end of file diff --git a/sdk/quota/arm-quota/package.json b/sdk/quota/arm-quota/package.json index 8779a2875878..0e05dd0c67a3 100644 --- a/sdk/quota/arm-quota/package.json +++ b/sdk/quota/arm-quota/package.json @@ -8,11 +8,11 @@ "node": ">=18.0.0" }, "dependencies": { - "@azure/abort-controller": "^1.0.0", - "@azure/core-auth": "^1.6.0", - "@azure/core-client": "^1.7.0", "@azure/core-lro": "^2.5.4", + "@azure/abort-controller": "^2.1.2", "@azure/core-paging": "^1.2.0", + "@azure/core-client": "^1.7.0", + "@azure/core-auth": "^1.6.0", "@azure/core-rest-pipeline": "^1.14.0", "tslib": "^2.2.0" }, @@ -28,18 +28,19 @@ "module": "./dist-esm/src/index.js", "types": "./types/arm-quota.d.ts", "devDependencies": { - "@azure-tools/test-credential": "^1.1.0", - "@azure-tools/test-recorder": "^3.0.0", + "typescript": "~5.6.2", + "dotenv": "^16.0.0", "@azure/dev-tool": "^1.0.0", "@azure/identity": "^4.2.1", - "@types/chai": "^4.2.8", + "@azure-tools/test-recorder": "^3.0.0", + "@azure-tools/test-credential": "^1.1.0", + "mocha": "^10.0.0", "@types/mocha": "^10.0.0", - "@types/node": "^18.0.0", + "tsx": "^4.7.1", + "@types/chai": "^4.2.8", "chai": "^4.2.0", - "dotenv": "^16.0.0", - "mocha": "^11.0.2", - "ts-node": "^10.0.0", - "typescript": "~5.6.2" + "@types/node": "^18.0.0", + "ts-node": "^10.0.0" }, "repository": { "type": "git", @@ -67,28 +68,28 @@ ], "scripts": { "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && dev-tool run vendored mkdirp ./review && npm run extract-api", - "build:browser": "echo skipped", - "build:node": "echo skipped", - "build:samples": "dev-tool run typecheck --paths samples-dev/*.ts && dev-tool samples publish -f", - "build:test": "echo skipped", - "check-format": "dev-tool run vendored prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", - "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", - "execute:samples": "dev-tool samples run samples-dev", - "extract-api": "dev-tool run extract-api", - "format": "dev-tool run vendored prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.{ts,cts,mts}\" \"test/**/*.{ts,cts,mts}\" \"*.{js,cjs,mjs,json}\" \"samples-dev/*.ts\"", - "integration-test": "npm run integration-test:node && npm run integration-test:browser", - "integration-test:browser": "echo skipped", - "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", - "lint": "echo skipped", "minify": "dev-tool run vendored uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", - "pack": "npm pack 2>&1", "prepack": "npm run build", + "pack": "npm pack 2>&1", + "extract-api": "dev-tool run extract-api", + "lint": "echo skipped", + "clean": "dev-tool run vendored rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "build:node": "echo skipped", + "build:browser": "echo skipped", + "build:test": "echo skipped", + "build:samples": "echo skipped.", + "check-format": "echo skipped", + "execute:samples": "echo skipped", + "format": "echo skipped", "test": "npm run integration-test", - "test:browser": "echo skipped", "test:node": "echo skipped", + "test:browser": "echo skipped", "unit-test": "npm run unit-test:node && npm run unit-test:browser", - "unit-test:browser": "echo skipped", "unit-test:node": "dev-tool run vendored cross-env TEST_MODE=playback npm run integration-test:node", + "unit-test:browser": "echo skipped", + "integration-test": "npm run integration-test:node && npm run integration-test:browser", + "integration-test:node": "dev-tool run test:node-ts-input -- --timeout 1200000 'test/*.ts'", + "integration-test:browser": "echo skipped", "update-snippets": "echo skipped" }, "sideEffects": false, @@ -101,13 +102,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-quota?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota" +} \ No newline at end of file diff --git a/sdk/quota/arm-quota/review/arm-quota.api.md b/sdk/quota/arm-quota/review/arm-quota.api.md index 30a27ab06b86..25e68e5320ec 100644 --- a/sdk/quota/arm-quota/review/arm-quota.api.md +++ b/sdk/quota/arm-quota/review/arm-quota.api.md @@ -165,7 +165,7 @@ export interface GroupQuotaDetails { comment?: string; limit?: number; readonly name?: GroupQuotaDetailsName; - region?: string; + resourceName?: string; readonly unit?: string; } @@ -176,36 +176,28 @@ export interface GroupQuotaDetailsName { } // @public -export interface GroupQuotaLimit extends ProxyResource { +export interface GroupQuotaLimit { properties?: GroupQuotaDetails; } // @public -export interface GroupQuotaLimitList { +export interface GroupQuotaLimitList extends ProxyResource { + // (undocumented) + properties?: GroupQuotaLimitListProperties; +} + +// @public (undocumented) +export interface GroupQuotaLimitListProperties { readonly nextLink?: string; + readonly provisioningState?: RequestState; value?: GroupQuotaLimit[]; } // @public export interface GroupQuotaLimits { - get(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, filter: string, options?: GroupQuotaLimitsGetOptionalParams): Promise; - list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, filter: string, options?: GroupQuotaLimitsListOptionalParams): PagedAsyncIterableIterator; + list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLimitsListOptionalParams): Promise; } -// @public -export interface GroupQuotaLimitsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaLimitsGetResponse = GroupQuotaLimit; - -// @public -export interface GroupQuotaLimitsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaLimitsListNextResponse = GroupQuotaLimitList; - // @public export interface GroupQuotaLimitsListOptionalParams extends coreClient.OperationOptions { } @@ -215,31 +207,12 @@ export type GroupQuotaLimitsListResponse = GroupQuotaLimitList; // @public export interface GroupQuotaLimitsRequest { - beginCreateOrUpdate(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, options?: GroupQuotaLimitsRequestCreateOrUpdateOptionalParams): Promise, GroupQuotaLimitsRequestCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, options?: GroupQuotaLimitsRequestCreateOrUpdateOptionalParams): Promise; - beginUpdate(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, options?: GroupQuotaLimitsRequestUpdateOptionalParams): Promise, GroupQuotaLimitsRequestUpdateResponse>>; - beginUpdateAndWait(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, options?: GroupQuotaLimitsRequestUpdateOptionalParams): Promise; + beginUpdate(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLimitsRequestUpdateOptionalParams): Promise, GroupQuotaLimitsRequestUpdateResponse>>; + beginUpdateAndWait(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLimitsRequestUpdateOptionalParams): Promise; get(managementGroupId: string, groupQuotaName: string, requestId: string, options?: GroupQuotaLimitsRequestGetOptionalParams): Promise; list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, filter: string, options?: GroupQuotaLimitsRequestListOptionalParams): PagedAsyncIterableIterator; } -// @public -export interface GroupQuotaLimitsRequestCreateOrUpdateHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; -} - -// @public -export interface GroupQuotaLimitsRequestCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - groupQuotaRequest?: SubmittedResourceRequestStatus; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type GroupQuotaLimitsRequestCreateOrUpdateResponse = SubmittedResourceRequestStatus; - // @public export interface GroupQuotaLimitsRequestGetOptionalParams extends coreClient.OperationOptions { } @@ -270,13 +243,13 @@ export interface GroupQuotaLimitsRequestUpdateHeaders { // @public export interface GroupQuotaLimitsRequestUpdateOptionalParams extends coreClient.OperationOptions { - groupQuotaRequest?: SubmittedResourceRequestStatus; + groupQuotaRequest?: GroupQuotaLimitList; resumeFrom?: string; updateIntervalInMs?: number; } // @public -export type GroupQuotaLimitsRequestUpdateResponse = SubmittedResourceRequestStatus; +export type GroupQuotaLimitsRequestUpdateResponse = GroupQuotaLimitList; // @public export interface GroupQuotaList { @@ -480,24 +453,9 @@ export type GroupQuotasListResponse = GroupQuotaList; // @public export interface GroupQuotaSubscriptionAllocation { - get(managementGroupId: string, groupQuotaName: string, resourceName: string, filter: string, options?: GroupQuotaSubscriptionAllocationGetOptionalParams): Promise; - list(managementGroupId: string, groupQuotaName: string, filter: string, options?: GroupQuotaSubscriptionAllocationListOptionalParams): PagedAsyncIterableIterator; + list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaSubscriptionAllocationListOptionalParams): Promise; } -// @public -export interface GroupQuotaSubscriptionAllocationGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaSubscriptionAllocationGetResponse = SubscriptionQuotaAllocations; - -// @public -export interface GroupQuotaSubscriptionAllocationListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaSubscriptionAllocationListNextResponse = SubscriptionQuotaAllocationsList; - // @public export interface GroupQuotaSubscriptionAllocationListOptionalParams extends coreClient.OperationOptions { } @@ -507,30 +465,12 @@ export type GroupQuotaSubscriptionAllocationListResponse = SubscriptionQuotaAllo // @public export interface GroupQuotaSubscriptionAllocationRequest { - beginCreateOrUpdate(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, allocateQuotaRequest: QuotaAllocationRequestStatus, options?: GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams): Promise, GroupQuotaSubscriptionAllocationRequestCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, allocateQuotaRequest: QuotaAllocationRequestStatus, options?: GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams): Promise; - beginUpdate(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, allocateQuotaRequest: QuotaAllocationRequestStatus, options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams): Promise, GroupQuotaSubscriptionAllocationRequestUpdateResponse>>; - beginUpdateAndWait(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, resourceName: string, allocateQuotaRequest: QuotaAllocationRequestStatus, options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams): Promise; - get(managementGroupId: string, groupQuotaName: string, allocationId: string, options?: GroupQuotaSubscriptionAllocationRequestGetOptionalParams): Promise; + beginUpdate(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, allocateQuotaRequest: SubscriptionQuotaAllocationsList, options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams): Promise, GroupQuotaSubscriptionAllocationRequestUpdateResponse>>; + beginUpdateAndWait(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, allocateQuotaRequest: SubscriptionQuotaAllocationsList, options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams): Promise; + get(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, allocationId: string, options?: GroupQuotaSubscriptionAllocationRequestGetOptionalParams): Promise; list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, filter: string, options?: GroupQuotaSubscriptionAllocationRequestListOptionalParams): PagedAsyncIterableIterator; } -// @public -export interface GroupQuotaSubscriptionAllocationRequestCreateOrUpdateHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; -} - -// @public -export interface GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type GroupQuotaSubscriptionAllocationRequestCreateOrUpdateResponse = QuotaAllocationRequestStatus; - // @public export interface GroupQuotaSubscriptionAllocationRequestGetOptionalParams extends coreClient.OperationOptions { } @@ -566,7 +506,7 @@ export interface GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams ext } // @public -export type GroupQuotaSubscriptionAllocationRequestUpdateResponse = QuotaAllocationRequestStatus; +export type GroupQuotaSubscriptionAllocationRequestUpdateResponse = SubscriptionQuotaAllocationsList; // @public export interface GroupQuotaSubscriptionId extends ProxyResource { @@ -1233,13 +1173,20 @@ export interface SubscriptionQuotaAllocationRequestList { } // @public -export interface SubscriptionQuotaAllocations extends ProxyResource { +export interface SubscriptionQuotaAllocations { properties?: SubscriptionQuotaDetails; } // @public -export interface SubscriptionQuotaAllocationsList { +export interface SubscriptionQuotaAllocationsList extends ProxyResource { + // (undocumented) + properties?: SubscriptionQuotaAllocationsListProperties; +} + +// @public (undocumented) +export interface SubscriptionQuotaAllocationsListProperties { readonly nextLink?: string; + readonly provisioningState?: RequestState; value?: SubscriptionQuotaAllocations[]; } @@ -1253,7 +1200,7 @@ export interface SubscriptionQuotaAllocationsStatusList { export interface SubscriptionQuotaDetails { limit?: number; readonly name?: SubscriptionQuotaDetailsName; - region?: string; + resourceName?: string; readonly shareableQuota?: number; } diff --git a/sdk/quota/arm-quota/sample.env b/sdk/quota/arm-quota/sample.env index 672847a3fea0..508439fc7d62 100644 --- a/sdk/quota/arm-quota/sample.env +++ b/sdk/quota/arm-quota/sample.env @@ -1,4 +1 @@ -# App registration secret for AAD authentication -AZURE_CLIENT_SECRET= -AZURE_CLIENT_ID= -AZURE_TENANT_ID= \ No newline at end of file +# Feel free to add your own environment variables. \ No newline at end of file diff --git a/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts b/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts index dd7b24aaa85a..fdcc3c31a2d0 100644 --- a/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts +++ b/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts @@ -8,16 +8,20 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; -import { PipelineRequest, PipelineResponse, SendRequest } from "@azure/core-rest-pipeline"; +import { + PipelineRequest, + PipelineResponse, + SendRequest, +} from "@azure/core-rest-pipeline"; import * as coreAuth from "@azure/core-auth"; import { GroupQuotasImpl, GroupQuotaSubscriptionsImpl, GroupQuotaSubscriptionRequestsImpl, - GroupQuotaLimitsImpl, GroupQuotaLimitsRequestImpl, - GroupQuotaSubscriptionAllocationImpl, + GroupQuotaLimitsImpl, GroupQuotaSubscriptionAllocationRequestImpl, + GroupQuotaSubscriptionAllocationImpl, GroupQuotaUsagesImpl, GroupQuotaLocationSettingsImpl, UsagesImpl, @@ -29,10 +33,10 @@ import { GroupQuotas, GroupQuotaSubscriptions, GroupQuotaSubscriptionRequests, - GroupQuotaLimits, GroupQuotaLimitsRequest, - GroupQuotaSubscriptionAllocation, + GroupQuotaLimits, GroupQuotaSubscriptionAllocationRequest, + GroupQuotaSubscriptionAllocation, GroupQuotaUsages, GroupQuotaLocationSettings, Usages, @@ -100,7 +104,8 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { userAgentOptions: { userAgentPrefix, }, - endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com", + endpoint: + options.endpoint ?? options.baseUri ?? "https://management.azure.com", }; super(optionsWithDefaults); @@ -110,7 +115,8 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { options.pipeline.getOrderedPolicies(); bearerTokenAuthenticationPolicyFound = pipelinePolicies.some( (pipelinePolicy) => - pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName, + pipelinePolicy.name === + coreRestPipeline.bearerTokenAuthenticationPolicyName, ); } if ( @@ -126,9 +132,11 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { coreRestPipeline.bearerTokenAuthenticationPolicy({ credential: credentials, scopes: - optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`, + optionsWithDefaults.credentialScopes ?? + `${optionsWithDefaults.endpoint}/.default`, challengeCallbacks: { - authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge, + authorizeRequestOnChallenge: + coreClient.authorizeRequestOnClaimChallenge, }, }), ); @@ -138,16 +146,17 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { // Assigning values to Constant parameters this.$host = options.$host || "https://management.azure.com"; - this.apiVersion = options.apiVersion || "2023-06-01-preview"; + this.apiVersion = options.apiVersion || "2024-10-15-preview"; this.groupQuotas = new GroupQuotasImpl(this); this.groupQuotaSubscriptions = new GroupQuotaSubscriptionsImpl(this); - this.groupQuotaSubscriptionRequests = new GroupQuotaSubscriptionRequestsImpl(this); - this.groupQuotaLimits = new GroupQuotaLimitsImpl(this); + this.groupQuotaSubscriptionRequests = + new GroupQuotaSubscriptionRequestsImpl(this); this.groupQuotaLimitsRequest = new GroupQuotaLimitsRequestImpl(this); - this.groupQuotaSubscriptionAllocation = new GroupQuotaSubscriptionAllocationImpl(this); - this.groupQuotaSubscriptionAllocationRequest = new GroupQuotaSubscriptionAllocationRequestImpl( - this, - ); + this.groupQuotaLimits = new GroupQuotaLimitsImpl(this); + this.groupQuotaSubscriptionAllocationRequest = + new GroupQuotaSubscriptionAllocationRequestImpl(this); + this.groupQuotaSubscriptionAllocation = + new GroupQuotaSubscriptionAllocationImpl(this); this.groupQuotaUsages = new GroupQuotaUsagesImpl(this); this.groupQuotaLocationSettings = new GroupQuotaLocationSettingsImpl(this); this.usages = new UsagesImpl(this); @@ -164,7 +173,10 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { } const apiVersionPolicy = { name: "CustomApiVersionPolicy", - async sendRequest(request: PipelineRequest, next: SendRequest): Promise { + async sendRequest( + request: PipelineRequest, + next: SendRequest, + ): Promise { const param = request.url.split("?"); if (param.length > 1) { const newParams = param[1].split("&").map((item) => { @@ -185,10 +197,10 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { groupQuotas: GroupQuotas; groupQuotaSubscriptions: GroupQuotaSubscriptions; groupQuotaSubscriptionRequests: GroupQuotaSubscriptionRequests; - groupQuotaLimits: GroupQuotaLimits; groupQuotaLimitsRequest: GroupQuotaLimitsRequest; - groupQuotaSubscriptionAllocation: GroupQuotaSubscriptionAllocation; + groupQuotaLimits: GroupQuotaLimits; groupQuotaSubscriptionAllocationRequest: GroupQuotaSubscriptionAllocationRequest; + groupQuotaSubscriptionAllocation: GroupQuotaSubscriptionAllocation; groupQuotaUsages: GroupQuotaUsages; groupQuotaLocationSettings: GroupQuotaLocationSettings; usages: Usages; diff --git a/sdk/quota/arm-quota/src/lroImpl.ts b/sdk/quota/arm-quota/src/lroImpl.ts index 0f3d9221b16d..5f88efab981b 100644 --- a/sdk/quota/arm-quota/src/lroImpl.ts +++ b/sdk/quota/arm-quota/src/lroImpl.ts @@ -26,7 +26,10 @@ export function createLroSpec(inputs: { requestMethod: spec.httpMethod, requestPath: spec.path!, sendInitialRequest: () => sendOperationFn(args, spec), - sendPollRequest: (path: string, options?: { abortSignal?: AbortSignalLike }) => { + sendPollRequest: ( + path: string, + options?: { abortSignal?: AbortSignalLike }, + ) => { const { requestBody, ...restSpec } = spec; return sendOperationFn(args, { ...restSpec, diff --git a/sdk/quota/arm-quota/src/models/index.ts b/sdk/quota/arm-quota/src/models/index.ts index 26cb9d436b4a..8b8164f1fb6b 100644 --- a/sdk/quota/arm-quota/src/models/index.ts +++ b/sdk/quota/arm-quota/src/models/index.ts @@ -215,24 +215,45 @@ export interface GroupQuotaSubscriptionRequestStatusProperties { readonly provisioningState?: RequestState; } +export interface GroupQuotaLimitListProperties { + /** + * Request status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: RequestState; + /** List of Group Quota Limit details. */ + value?: GroupQuotaLimit[]; + /** + * The URL to use for getting the next set of results. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly nextLink?: string; +} + +/** Group Quota limit. */ +export interface GroupQuotaLimit { + /** Group Quota properties for the specified resource. */ + properties?: GroupQuotaDetails; +} + /** Group Quota details. */ export interface GroupQuotaDetails { - /** Location/Azure region for the quota requested for resource. */ - region?: string; + /** The resource name, such as SKU name. */ + resourceName?: string; /** The current Group Quota Limit at the parentId level. */ limit?: number; /** Any comment related to quota request. */ comment?: string; /** - * Name of the resource provided by the resource provider. This property is already included in the request URI, so it is a readonly property returned in the response. + * The usages units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET response in the request body of your PUT operation. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly name?: GroupQuotaDetailsName; + readonly unit?: string; /** - * The usages units, such as Count and Bytes. When requesting quota, use the **unit** value returned in the GET response in the request body of your PUT operation. + * Name of the resource provided by the resource provider. This property is already included in the request URI, so it is a readonly property returned in the response. * NOTE: This property will not be serialized. It can only be populated by the server. */ - readonly unit?: string; + readonly name?: GroupQuotaDetailsName; /** * The available Group Quota Limit at the MG level. This Group quota can be allocated to subscription(s). * NOTE: This property will not be serialized. It can only be populated by the server. @@ -273,17 +294,6 @@ export interface AllocatedToSubscription { quotaAllocated?: number; } -/** List of Group Quota Limit details. */ -export interface GroupQuotaLimitList { - /** List of Group Quota Limit details. */ - value?: GroupQuotaLimit[]; - /** - * The URL to use for getting the next set of results. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly nextLink?: string; -} - export interface SubmittedResourceRequestStatusProperties { /** Requested Resource. */ requestedResource?: GroupQuotaRequestBase; @@ -348,8 +358,12 @@ export interface SubmittedResourceRequestStatusList { readonly nextLink?: string; } -/** Subscription quota list. */ -export interface SubscriptionQuotaAllocationsList { +export interface SubscriptionQuotaAllocationsListProperties { + /** + * Request status. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly provisioningState?: RequestState; /** Subscription quota list. */ value?: SubscriptionQuotaAllocations[]; /** @@ -359,10 +373,16 @@ export interface SubscriptionQuotaAllocationsList { readonly nextLink?: string; } +/** Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. */ +export interface SubscriptionQuotaAllocations { + /** Quota properties for the specified resource. */ + properties?: SubscriptionQuotaDetails; +} + /** Subscription Quota details. */ export interface SubscriptionQuotaDetails { - /** Location/Azure region for the quota requested for resource. */ - region?: string; + /** The resource name, such as SKU name. */ + resourceName?: string; /** The total quota limit for the subscription. */ limit?: number; /** @@ -1069,10 +1089,9 @@ export interface GroupQuotaSubscriptionRequestStatus extends ProxyResource { properties?: GroupQuotaSubscriptionRequestStatusProperties; } -/** Group Quota limit. */ -export interface GroupQuotaLimit extends ProxyResource { - /** Group Quota properties for the specified resource. */ - properties?: GroupQuotaDetails; +/** List of Group Quota Limit details. */ +export interface GroupQuotaLimitList extends ProxyResource { + properties?: GroupQuotaLimitListProperties; } /** Status of a single GroupQuota request. */ @@ -1080,10 +1099,9 @@ export interface SubmittedResourceRequestStatus extends ProxyResource { properties?: SubmittedResourceRequestStatusProperties; } -/** Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. This will include the GroupQuota and total quota allocated to the subscription. Only the Group quota allocated to the subscription can be allocated back to the MG Group Quota. */ -export interface SubscriptionQuotaAllocations extends ProxyResource { - /** Quota properties for the specified resource. */ - properties?: SubscriptionQuotaDetails; +/** Subscription quota list. */ +export interface SubscriptionQuotaAllocationsList extends ProxyResource { + properties?: SubscriptionQuotaAllocationsListProperties; } /** The subscription quota allocation status. */ @@ -1222,26 +1240,6 @@ export interface GroupQuotaSubscriptionsDeleteHeaders { azureAsyncOperation?: string; } -/** Defines headers for GroupQuotaLimitsRequest_createOrUpdate operation. */ -export interface GroupQuotaLimitsRequestCreateOrUpdateHeaders { - /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ - retryAfter?: number; - /** - * URL for determining when an operation has completed. Send a GET request to the URL in Location header. - * The URI should return a 202 until the operation reaches a terminal state and 200 once it reaches a terminal state. - * - * For more info: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#202-accepted-and-location-headers. New guidelines - https://github.com/microsoft/api-guidelines/blob/vNext/Guidelines.md#131-resource-based-long-running-operations-relo - */ - location?: string; - /** - * URL for checking the ongoing status of the operation. - * To get the status of the asynchronous operation, send a GET request to the URL in Azure-AsyncOperation header value. - * - * For more info: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#asynchronous-operations - */ - azureAsyncOperation?: string; -} - /** Defines headers for GroupQuotaLimitsRequest_update operation. */ export interface GroupQuotaLimitsRequestUpdateHeaders { /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ @@ -1262,26 +1260,6 @@ export interface GroupQuotaLimitsRequestUpdateHeaders { azureAsyncOperation?: string; } -/** Defines headers for GroupQuotaSubscriptionAllocationRequest_createOrUpdate operation. */ -export interface GroupQuotaSubscriptionAllocationRequestCreateOrUpdateHeaders { - /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ - retryAfter?: number; - /** - * URL for determining when an operation has completed. Send a GET request to the URL in Location header. - * The URI should return a 202 until the operation reaches a terminal state and 200 once it reaches a terminal state. - * - * For more info: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#202-accepted-and-location-headers - */ - location?: string; - /** - * URL for checking the ongoing status of the operation. - * To get the status of the asynchronous operation, send a GET request to the URL in Azure-AsyncOperation header value. - * - * For more info: https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/Addendum.md#asynchronous-operations - */ - azureAsyncOperation?: string; -} - /** Defines headers for GroupQuotaSubscriptionAllocationRequest_update operation. */ export interface GroupQuotaSubscriptionAllocationRequestUpdateHeaders { /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ @@ -1571,7 +1549,8 @@ export enum KnownQuotaLimitTypes { export type QuotaLimitTypes = string; /** Optional parameters. */ -export interface GroupQuotasCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface GroupQuotasCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { /** The GroupQuota body details for creation or update of a GroupQuota entity. */ groupQuotaPutRequestBody?: GroupQuotasEntity; /** Delay to wait until next poll, in milliseconds. */ @@ -1584,7 +1563,8 @@ export interface GroupQuotasCreateOrUpdateOptionalParams extends coreClient.Oper export type GroupQuotasCreateOrUpdateResponse = GroupQuotasEntity; /** Optional parameters. */ -export interface GroupQuotasUpdateOptionalParams extends coreClient.OperationOptions { +export interface GroupQuotasUpdateOptionalParams + extends coreClient.OperationOptions { /** The GroupQuotas Patch Request. */ groupQuotasPatchRequestBody?: GroupQuotasEntityPatch; /** Delay to wait until next poll, in milliseconds. */ @@ -1597,13 +1577,15 @@ export interface GroupQuotasUpdateOptionalParams extends coreClient.OperationOpt export type GroupQuotasUpdateResponse = GroupQuotasEntity; /** Optional parameters. */ -export interface GroupQuotasGetOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotasGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type GroupQuotasGetResponse = GroupQuotasEntity; /** Optional parameters. */ -export interface GroupQuotasDeleteOptionalParams extends coreClient.OperationOptions { +export interface GroupQuotasDeleteOptionalParams + extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -1614,13 +1596,15 @@ export interface GroupQuotasDeleteOptionalParams extends coreClient.OperationOpt export type GroupQuotasDeleteResponse = GroupQuotasDeleteHeaders; /** Optional parameters. */ -export interface GroupQuotasListOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotasListOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type GroupQuotasListResponse = GroupQuotaList; /** Optional parameters. */ -export interface GroupQuotasListNextOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotasListNextOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type GroupQuotasListNextResponse = GroupQuotaList; @@ -1635,10 +1619,12 @@ export interface GroupQuotaSubscriptionsCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type GroupQuotaSubscriptionsCreateOrUpdateResponse = GroupQuotaSubscriptionId; +export type GroupQuotaSubscriptionsCreateOrUpdateResponse = + GroupQuotaSubscriptionId; /** Optional parameters. */ -export interface GroupQuotaSubscriptionsUpdateOptionalParams extends coreClient.OperationOptions { +export interface GroupQuotaSubscriptionsUpdateOptionalParams + extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -1649,7 +1635,8 @@ export interface GroupQuotaSubscriptionsUpdateOptionalParams extends coreClient. export type GroupQuotaSubscriptionsUpdateResponse = GroupQuotaSubscriptionId; /** Optional parameters. */ -export interface GroupQuotaSubscriptionsDeleteOptionalParams extends coreClient.OperationOptions { +export interface GroupQuotaSubscriptionsDeleteOptionalParams + extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -1657,16 +1644,19 @@ export interface GroupQuotaSubscriptionsDeleteOptionalParams extends coreClient. } /** Contains response data for the delete operation. */ -export type GroupQuotaSubscriptionsDeleteResponse = GroupQuotaSubscriptionsDeleteHeaders; +export type GroupQuotaSubscriptionsDeleteResponse = + GroupQuotaSubscriptionsDeleteHeaders; /** Optional parameters. */ -export interface GroupQuotaSubscriptionsGetOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaSubscriptionsGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type GroupQuotaSubscriptionsGetResponse = GroupQuotaSubscriptionId; /** Optional parameters. */ -export interface GroupQuotaSubscriptionsListOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaSubscriptionsListOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type GroupQuotaSubscriptionsListResponse = GroupQuotaSubscriptionIdList; @@ -1676,21 +1666,24 @@ export interface GroupQuotaSubscriptionsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type GroupQuotaSubscriptionsListNextResponse = GroupQuotaSubscriptionIdList; +export type GroupQuotaSubscriptionsListNextResponse = + GroupQuotaSubscriptionIdList; /** Optional parameters. */ export interface GroupQuotaSubscriptionRequestsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type GroupQuotaSubscriptionRequestsListResponse = GroupQuotaSubscriptionRequestStatusList; +export type GroupQuotaSubscriptionRequestsListResponse = + GroupQuotaSubscriptionRequestStatusList; /** Optional parameters. */ export interface GroupQuotaSubscriptionRequestsGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type GroupQuotaSubscriptionRequestsGetResponse = GroupQuotaSubscriptionRequestStatus; +export type GroupQuotaSubscriptionRequestsGetResponse = + GroupQuotaSubscriptionRequestStatus; /** Optional parameters. */ export interface GroupQuotaSubscriptionRequestsListNextOptionalParams @@ -1701,41 +1694,10 @@ export type GroupQuotaSubscriptionRequestsListNextResponse = GroupQuotaSubscriptionRequestStatusList; /** Optional parameters. */ -export interface GroupQuotaLimitsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GroupQuotaLimitsGetResponse = GroupQuotaLimit; - -/** Optional parameters. */ -export interface GroupQuotaLimitsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type GroupQuotaLimitsListResponse = GroupQuotaLimitList; - -/** Optional parameters. */ -export interface GroupQuotaLimitsListNextOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type GroupQuotaLimitsListNextResponse = GroupQuotaLimitList; - -/** Optional parameters. */ -export interface GroupQuotaLimitsRequestCreateOrUpdateOptionalParams +export interface GroupQuotaLimitsRequestUpdateOptionalParams extends coreClient.OperationOptions { /** The GroupQuotaRequest body details for specific resourceProvider/location/resources. */ - groupQuotaRequest?: SubmittedResourceRequestStatus; - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GroupQuotaLimitsRequestCreateOrUpdateResponse = SubmittedResourceRequestStatus; - -/** Optional parameters. */ -export interface GroupQuotaLimitsRequestUpdateOptionalParams extends coreClient.OperationOptions { - /** The GroupQuotaRequest body details for specific resourceProvider/location/resources. */ - groupQuotaRequest?: SubmittedResourceRequestStatus; + groupQuotaRequest?: GroupQuotaLimitList; /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -1743,86 +1705,66 @@ export interface GroupQuotaLimitsRequestUpdateOptionalParams extends coreClient. } /** Contains response data for the update operation. */ -export type GroupQuotaLimitsRequestUpdateResponse = SubmittedResourceRequestStatus; +export type GroupQuotaLimitsRequestUpdateResponse = GroupQuotaLimitList; /** Optional parameters. */ -export interface GroupQuotaLimitsRequestGetOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaLimitsRequestGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type GroupQuotaLimitsRequestGetResponse = SubmittedResourceRequestStatus; /** Optional parameters. */ -export interface GroupQuotaLimitsRequestListOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaLimitsRequestListOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type GroupQuotaLimitsRequestListResponse = SubmittedResourceRequestStatusList; +export type GroupQuotaLimitsRequestListResponse = + SubmittedResourceRequestStatusList; /** Optional parameters. */ export interface GroupQuotaLimitsRequestListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type GroupQuotaLimitsRequestListNextResponse = SubmittedResourceRequestStatusList; +export type GroupQuotaLimitsRequestListNextResponse = + SubmittedResourceRequestStatusList; /** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationListOptionalParams +export interface GroupQuotaLimitsListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type GroupQuotaSubscriptionAllocationListResponse = SubscriptionQuotaAllocationsList; - -/** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GroupQuotaSubscriptionAllocationGetResponse = SubscriptionQuotaAllocations; +export type GroupQuotaLimitsListResponse = GroupQuotaLimitList; /** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationListNextOptionalParams - extends coreClient.OperationOptions {} +export interface GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams + extends coreClient.OperationOptions { + /** Delay to wait until next poll, in milliseconds. */ + updateIntervalInMs?: number; + /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ + resumeFrom?: string; +} -/** Contains response data for the listNext operation. */ -export type GroupQuotaSubscriptionAllocationListNextResponse = SubscriptionQuotaAllocationsList; +/** Contains response data for the update operation. */ +export type GroupQuotaSubscriptionAllocationRequestUpdateResponse = + SubscriptionQuotaAllocationsList; /** Optional parameters. */ export interface GroupQuotaSubscriptionAllocationRequestGetOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type GroupQuotaSubscriptionAllocationRequestGetResponse = QuotaAllocationRequestStatus; +export type GroupQuotaSubscriptionAllocationRequestGetResponse = + QuotaAllocationRequestStatus; /** Optional parameters. */ export interface GroupQuotaSubscriptionAllocationRequestListOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type GroupQuotaSubscriptionAllocationRequestListResponse = QuotaAllocationRequestStatusList; - -/** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the createOrUpdate operation. */ -export type GroupQuotaSubscriptionAllocationRequestCreateOrUpdateResponse = - QuotaAllocationRequestStatus; - -/** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams - extends coreClient.OperationOptions { - /** Delay to wait until next poll, in milliseconds. */ - updateIntervalInMs?: number; - /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ - resumeFrom?: string; -} - -/** Contains response data for the update operation. */ -export type GroupQuotaSubscriptionAllocationRequestUpdateResponse = QuotaAllocationRequestStatus; +export type GroupQuotaSubscriptionAllocationRequestListResponse = + QuotaAllocationRequestStatusList; /** Optional parameters. */ export interface GroupQuotaSubscriptionAllocationRequestListNextOptionalParams @@ -1833,13 +1775,23 @@ export type GroupQuotaSubscriptionAllocationRequestListNextResponse = QuotaAllocationRequestStatusList; /** Optional parameters. */ -export interface GroupQuotaUsagesListOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaSubscriptionAllocationListOptionalParams + extends coreClient.OperationOptions {} + +/** Contains response data for the list operation. */ +export type GroupQuotaSubscriptionAllocationListResponse = + SubscriptionQuotaAllocationsList; + +/** Optional parameters. */ +export interface GroupQuotaUsagesListOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type GroupQuotaUsagesListResponse = ResourceUsageList; /** Optional parameters. */ -export interface GroupQuotaUsagesListNextOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaUsagesListNextOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type GroupQuotaUsagesListNextResponse = ResourceUsageList; @@ -1856,7 +1808,8 @@ export interface GroupQuotaLocationSettingsCreateOrUpdateOptionalParams } /** Contains response data for the createOrUpdate operation. */ -export type GroupQuotaLocationSettingsCreateOrUpdateResponse = GroupQuotasEnforcementResponse; +export type GroupQuotaLocationSettingsCreateOrUpdateResponse = + GroupQuotasEnforcementResponse; /** Optional parameters. */ export interface GroupQuotaLocationSettingsUpdateOptionalParams @@ -1870,26 +1823,32 @@ export interface GroupQuotaLocationSettingsUpdateOptionalParams } /** Contains response data for the update operation. */ -export type GroupQuotaLocationSettingsUpdateResponse = GroupQuotasEnforcementResponse; +export type GroupQuotaLocationSettingsUpdateResponse = + GroupQuotasEnforcementResponse; /** Optional parameters. */ -export interface GroupQuotaLocationSettingsGetOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaLocationSettingsGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ -export type GroupQuotaLocationSettingsGetResponse = GroupQuotasEnforcementResponse; +export type GroupQuotaLocationSettingsGetResponse = + GroupQuotasEnforcementResponse; /** Optional parameters. */ -export interface GroupQuotaLocationSettingsListOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaLocationSettingsListOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type GroupQuotaLocationSettingsListResponse = GroupQuotasEnforcementListResponse; +export type GroupQuotaLocationSettingsListResponse = + GroupQuotasEnforcementListResponse; /** Optional parameters. */ export interface GroupQuotaLocationSettingsListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type GroupQuotaLocationSettingsListNextResponse = GroupQuotasEnforcementListResponse; +export type GroupQuotaLocationSettingsListNextResponse = + GroupQuotasEnforcementListResponse; /** Optional parameters. */ export interface UsagesGetOptionalParams extends coreClient.OperationOptions {} @@ -1904,7 +1863,8 @@ export interface UsagesListOptionalParams extends coreClient.OperationOptions {} export type UsagesListResponse = UsagesListHeaders & UsagesLimits; /** Optional parameters. */ -export interface UsagesListNextOptionalParams extends coreClient.OperationOptions {} +export interface UsagesListNextOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type UsagesListNextResponse = UsagesListNextHeaders & UsagesLimits; @@ -1916,7 +1876,8 @@ export interface QuotaGetOptionalParams extends coreClient.OperationOptions {} export type QuotaGetResponse = QuotaGetHeaders & CurrentQuotaLimitBase; /** Optional parameters. */ -export interface QuotaCreateOrUpdateOptionalParams extends coreClient.OperationOptions { +export interface QuotaCreateOrUpdateOptionalParams + extends coreClient.OperationOptions { /** Delay to wait until next poll, in milliseconds. */ updateIntervalInMs?: number; /** A serialized poller which can be used to resume an existing paused Long-Running-Operation. */ @@ -1944,19 +1905,22 @@ export interface QuotaListOptionalParams extends coreClient.OperationOptions {} export type QuotaListResponse = QuotaListHeaders & QuotaLimits; /** Optional parameters. */ -export interface QuotaListNextOptionalParams extends coreClient.OperationOptions {} +export interface QuotaListNextOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type QuotaListNextResponse = QuotaListNextHeaders & QuotaLimits; /** Optional parameters. */ -export interface QuotaRequestStatusGetOptionalParams extends coreClient.OperationOptions {} +export interface QuotaRequestStatusGetOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the get operation. */ export type QuotaRequestStatusGetResponse = QuotaRequestDetails; /** Optional parameters. */ -export interface QuotaRequestStatusListOptionalParams extends coreClient.OperationOptions { +export interface QuotaRequestStatusListOptionalParams + extends coreClient.OperationOptions { /** * | Field | Supported operators * |---------------------|------------------------ @@ -1977,25 +1941,29 @@ export interface QuotaRequestStatusListOptionalParams extends coreClient.Operati export type QuotaRequestStatusListResponse = QuotaRequestDetailsList; /** Optional parameters. */ -export interface QuotaRequestStatusListNextOptionalParams extends coreClient.OperationOptions {} +export interface QuotaRequestStatusListNextOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type QuotaRequestStatusListNextResponse = QuotaRequestDetailsList; /** Optional parameters. */ -export interface QuotaOperationListOptionalParams extends coreClient.OperationOptions {} +export interface QuotaOperationListOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ export type QuotaOperationListResponse = OperationList; /** Optional parameters. */ -export interface QuotaOperationListNextOptionalParams extends coreClient.OperationOptions {} +export interface QuotaOperationListNextOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ export type QuotaOperationListNextResponse = OperationList; /** Optional parameters. */ -export interface AzureQuotaExtensionAPIOptionalParams extends coreClient.ServiceClientOptions { +export interface AzureQuotaExtensionAPIOptionalParams + extends coreClient.ServiceClientOptions { /** server parameter */ $host?: string; /** Api Version */ diff --git a/sdk/quota/arm-quota/src/models/mappers.ts b/sdk/quota/arm-quota/src/models/mappers.ts index 9440fd724f1a..8a4a46bdd6a8 100644 --- a/sdk/quota/arm-quota/src/models/mappers.ts +++ b/sdk/quota/arm-quota/src/models/mappers.ts @@ -404,11 +404,76 @@ export const GroupQuotaSubscriptionIdList: coreClient.CompositeMapper = { }, }; -export const GroupQuotaSubscriptionRequestStatusList: coreClient.CompositeMapper = { +export const GroupQuotaSubscriptionRequestStatusList: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaSubscriptionRequestStatusList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "GroupQuotaSubscriptionRequestStatus", + }, + }, + }, + }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const GroupQuotaSubscriptionRequestStatusProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaSubscriptionRequestStatusProperties", + modelProperties: { + subscriptionId: { + serializedName: "subscriptionId", + type: { + name: "String", + }, + }, + requestSubmitTime: { + serializedName: "requestSubmitTime", + type: { + name: "DateTime", + }, + }, + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, + }; + +export const GroupQuotaLimitListProperties: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GroupQuotaSubscriptionRequestStatusList", + className: "GroupQuotaLimitListProperties", modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, value: { serializedName: "value", type: { @@ -416,7 +481,7 @@ export const GroupQuotaSubscriptionRequestStatusList: coreClient.CompositeMapper element: { type: { name: "Composite", - className: "GroupQuotaSubscriptionRequestStatus", + className: "GroupQuotaLimit", }, }, }, @@ -432,28 +497,16 @@ export const GroupQuotaSubscriptionRequestStatusList: coreClient.CompositeMapper }, }; -export const GroupQuotaSubscriptionRequestStatusProperties: coreClient.CompositeMapper = { +export const GroupQuotaLimit: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GroupQuotaSubscriptionRequestStatusProperties", + className: "GroupQuotaLimit", modelProperties: { - subscriptionId: { - serializedName: "subscriptionId", - type: { - name: "String", - }, - }, - requestSubmitTime: { - serializedName: "requestSubmitTime", - type: { - name: "DateTime", - }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, + properties: { + serializedName: "properties", type: { - name: "String", + name: "Composite", + className: "GroupQuotaDetails", }, }, }, @@ -465,8 +518,8 @@ export const GroupQuotaDetails: coreClient.CompositeMapper = { name: "Composite", className: "GroupQuotaDetails", modelProperties: { - region: { - serializedName: "region", + resourceName: { + serializedName: "resourceName", type: { name: "String", }, @@ -483,13 +536,6 @@ export const GroupQuotaDetails: coreClient.CompositeMapper = { name: "String", }, }, - name: { - serializedName: "name", - type: { - name: "Composite", - className: "GroupQuotaDetailsName", - }, - }, unit: { serializedName: "unit", readOnly: true, @@ -497,6 +543,13 @@ export const GroupQuotaDetails: coreClient.CompositeMapper = { name: "String", }, }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "GroupQuotaDetailsName", + }, + }, availableLimit: { serializedName: "availableLimit", readOnly: true, @@ -580,70 +633,43 @@ export const AllocatedToSubscription: coreClient.CompositeMapper = { }, }; -export const GroupQuotaLimitList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaLimitList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GroupQuotaLimit", - }, +export const SubmittedResourceRequestStatusProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SubmittedResourceRequestStatusProperties", + modelProperties: { + requestedResource: { + serializedName: "requestedResource", + type: { + name: "Composite", + className: "GroupQuotaRequestBase", }, }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const SubmittedResourceRequestStatusProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubmittedResourceRequestStatusProperties", - modelProperties: { - requestedResource: { - serializedName: "requestedResource", - type: { - name: "Composite", - className: "GroupQuotaRequestBase", - }, - }, - requestSubmitTime: { - serializedName: "requestSubmitTime", - readOnly: true, - type: { - name: "DateTime", + requestSubmitTime: { + serializedName: "requestSubmitTime", + readOnly: true, + type: { + name: "DateTime", + }, }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, }, - }, - faultCode: { - serializedName: "faultCode", - readOnly: true, - type: { - name: "String", + faultCode: { + serializedName: "faultCode", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; export const GroupQuotaRequestBase: coreClient.CompositeMapper = { type: { @@ -746,28 +772,52 @@ export const SubmittedResourceRequestStatusList: coreClient.CompositeMapper = { }, }; -export const SubscriptionQuotaAllocationsList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubscriptionQuotaAllocationsList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubscriptionQuotaAllocations", +export const SubscriptionQuotaAllocationsListProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SubscriptionQuotaAllocationsListProperties", + modelProperties: { + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubscriptionQuotaAllocations", + }, }, }, }, + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, + }, }, - nextLink: { - serializedName: "nextLink", - readOnly: true, + }, + }; + +export const SubscriptionQuotaAllocations: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "SubscriptionQuotaAllocations", + modelProperties: { + properties: { + serializedName: "properties", type: { - name: "String", + name: "Composite", + className: "SubscriptionQuotaDetails", }, }, }, @@ -779,8 +829,8 @@ export const SubscriptionQuotaDetails: coreClient.CompositeMapper = { name: "Composite", className: "SubscriptionQuotaDetails", modelProperties: { - region: { - serializedName: "region", + resourceName: { + serializedName: "resourceName", type: { name: "String", }, @@ -832,42 +882,43 @@ export const SubscriptionQuotaDetailsName: coreClient.CompositeMapper = { }, }; -export const QuotaAllocationRequestStatusProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaAllocationRequestStatusProperties", - modelProperties: { - requestedResource: { - serializedName: "requestedResource", - type: { - name: "Composite", - className: "QuotaAllocationRequestBase", +export const QuotaAllocationRequestStatusProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "QuotaAllocationRequestStatusProperties", + modelProperties: { + requestedResource: { + serializedName: "requestedResource", + type: { + name: "Composite", + className: "QuotaAllocationRequestBase", + }, }, - }, - requestSubmitTime: { - serializedName: "requestSubmitTime", - readOnly: true, - type: { - name: "DateTime", + requestSubmitTime: { + serializedName: "requestSubmitTime", + readOnly: true, + type: { + name: "DateTime", + }, }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, }, - }, - faultCode: { - serializedName: "faultCode", - readOnly: true, - type: { - name: "String", + faultCode: { + serializedName: "faultCode", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; export const QuotaAllocationRequestBase: coreClient.CompositeMapper = { type: { @@ -885,56 +936,58 @@ export const QuotaAllocationRequestBase: coreClient.CompositeMapper = { }, }; -export const QuotaAllocationRequestBaseProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaAllocationRequestBaseProperties", - modelProperties: { - limit: { - serializedName: "limit", - type: { - name: "Number", +export const QuotaAllocationRequestBaseProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "QuotaAllocationRequestBaseProperties", + modelProperties: { + limit: { + serializedName: "limit", + type: { + name: "Number", + }, }, - }, - name: { - serializedName: "name", - type: { - name: "Composite", - className: "QuotaAllocationRequestBasePropertiesName", - }, - }, - region: { - serializedName: "region", - type: { - name: "String", + name: { + serializedName: "name", + type: { + name: "Composite", + className: "QuotaAllocationRequestBasePropertiesName", + }, + }, + region: { + serializedName: "region", + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const QuotaAllocationRequestBasePropertiesName: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaAllocationRequestBasePropertiesName", - modelProperties: { - value: { - serializedName: "value", - readOnly: true, - type: { - name: "String", +export const QuotaAllocationRequestBasePropertiesName: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "QuotaAllocationRequestBasePropertiesName", + modelProperties: { + value: { + serializedName: "value", + readOnly: true, + type: { + name: "String", + }, }, - }, - localizedValue: { - serializedName: "localizedValue", - readOnly: true, - type: { - name: "String", + localizedValue: { + serializedName: "localizedValue", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; export const QuotaAllocationRequestStatusList: coreClient.CompositeMapper = { type: { @@ -1049,34 +1102,35 @@ export const GroupQuotaUsagesBaseName: coreClient.CompositeMapper = { }, }; -export const GroupQuotasEnforcementResponseProperties: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotasEnforcementResponseProperties", - modelProperties: { - enforcementEnabled: { - serializedName: "enforcementEnabled", - type: { - name: "String", +export const GroupQuotasEnforcementResponseProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotasEnforcementResponseProperties", + modelProperties: { + enforcementEnabled: { + serializedName: "enforcementEnabled", + type: { + name: "String", + }, }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, }, - }, - faultCode: { - serializedName: "faultCode", - readOnly: true, - type: { - name: "String", + faultCode: { + serializedName: "faultCode", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; export const GroupQuotasEnforcementListResponse: coreClient.CompositeMapper = { type: { @@ -1744,33 +1798,34 @@ export const OperationDisplay: coreClient.CompositeMapper = { }, }; -export const SubscriptionQuotaAllocationRequestList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubscriptionQuotaAllocationRequestList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "QuotaAllocationRequestStatus", +export const SubscriptionQuotaAllocationRequestList: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SubscriptionQuotaAllocationRequestList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "QuotaAllocationRequestStatus", + }, }, }, }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; export const SubscriptionGroupQuotaAssignment: coreClient.CompositeMapper = { type: { @@ -1793,33 +1848,34 @@ export const SubscriptionGroupQuotaAssignment: coreClient.CompositeMapper = { }, }; -export const SubscriptionQuotaAllocationsStatusList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubscriptionQuotaAllocationsStatusList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "SubmittedResourceRequestStatus", +export const SubscriptionQuotaAllocationsStatusList: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SubscriptionQuotaAllocationsStatusList", + modelProperties: { + value: { + serializedName: "value", + type: { + name: "Sequence", + element: { + type: { + name: "Composite", + className: "SubmittedResourceRequestStatus", + }, }, }, }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", + nextLink: { + serializedName: "nextLink", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; export const ResourceBaseRequest: coreClient.CompositeMapper = { type: { @@ -1943,42 +1999,43 @@ export const CreateGenericQuotaRequestParameters: coreClient.CompositeMapper = { }, }; -export const QuotaRequestOneResourceSubmitResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "QuotaRequestOneResourceSubmitResponse", - modelProperties: { - id: { - serializedName: "id", - readOnly: true, - type: { - name: "String", +export const QuotaRequestOneResourceSubmitResponse: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "QuotaRequestOneResourceSubmitResponse", + modelProperties: { + id: { + serializedName: "id", + readOnly: true, + type: { + name: "String", + }, }, - }, - name: { - serializedName: "name", - readOnly: true, - type: { - name: "String", + name: { + serializedName: "name", + readOnly: true, + type: { + name: "String", + }, }, - }, - type: { - serializedName: "type", - readOnly: true, type: { - name: "String", + serializedName: "type", + readOnly: true, + type: { + name: "String", + }, }, - }, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "QuotaRequestOneResourceProperties", + properties: { + serializedName: "properties", + type: { + name: "Composite", + className: "QuotaRequestOneResourceProperties", + }, }, }, }, - }, -}; + }; export const QuotaRequestOneResourceProperties: coreClient.CompositeMapper = { type: { @@ -2329,17 +2386,17 @@ export const GroupQuotaSubscriptionRequestStatus: coreClient.CompositeMapper = { }, }; -export const GroupQuotaLimit: coreClient.CompositeMapper = { +export const GroupQuotaLimitList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GroupQuotaLimit", + className: "GroupQuotaLimitList", modelProperties: { ...ProxyResource.type.modelProperties, properties: { serializedName: "properties", type: { name: "Composite", - className: "GroupQuotaDetails", + className: "GroupQuotaLimitListProperties", }, }, }, @@ -2363,17 +2420,17 @@ export const SubmittedResourceRequestStatus: coreClient.CompositeMapper = { }, }; -export const SubscriptionQuotaAllocations: coreClient.CompositeMapper = { +export const SubscriptionQuotaAllocationsList: coreClient.CompositeMapper = { type: { name: "Composite", - className: "SubscriptionQuotaAllocations", + className: "SubscriptionQuotaAllocationsList", modelProperties: { ...ProxyResource.type.modelProperties, properties: { serializedName: "properties", type: { name: "Composite", - className: "SubscriptionQuotaDetails", + className: "SubscriptionQuotaAllocationsListProperties", }, }, }, @@ -2512,146 +2569,95 @@ export const GroupQuotasDeleteHeaders: coreClient.CompositeMapper = { }, }; -export const GroupQuotaSubscriptionsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaSubscriptionsCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GroupQuotaSubscriptionsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaSubscriptionsUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", - }, - }, - location: { - serializedName: "location", - type: { - name: "String", - }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GroupQuotaSubscriptionsDeleteHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaSubscriptionsDeleteHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", +export const GroupQuotaSubscriptionsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaSubscriptionsCreateOrUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, }, - }, - location: { - serializedName: "location", - type: { - name: "String", + location: { + serializedName: "location", + type: { + name: "String", + }, }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const GroupQuotaLimitsRequestCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaLimitsRequestCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", +export const GroupQuotaSubscriptionsUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaSubscriptionsUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, }, - }, - location: { - serializedName: "location", - type: { - name: "String", + location: { + serializedName: "location", + type: { + name: "String", + }, }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const GroupQuotaLimitsRequestUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaLimitsRequestUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", +export const GroupQuotaSubscriptionsDeleteHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaSubscriptionsDeleteHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, }, - }, - location: { - serializedName: "location", - type: { - name: "String", + location: { + serializedName: "location", + type: { + name: "String", + }, }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const GroupQuotaSubscriptionAllocationRequestCreateOrUpdateHeaders: coreClient.CompositeMapper = +export const GroupQuotaLimitsRequestUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GroupQuotaSubscriptionAllocationRequestCreateOrUpdateHeaders", + className: "GroupQuotaLimitsRequestUpdateHeaders", modelProperties: { retryAfter: { serializedName: "retry-after", @@ -2675,86 +2681,89 @@ export const GroupQuotaSubscriptionAllocationRequestCreateOrUpdateHeaders: coreC }, }; -export const GroupQuotaSubscriptionAllocationRequestUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaSubscriptionAllocationRequestUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", +export const GroupQuotaSubscriptionAllocationRequestUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaSubscriptionAllocationRequestUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, }, - }, - location: { - serializedName: "location", - type: { - name: "String", + location: { + serializedName: "location", + type: { + name: "String", + }, }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const GroupQuotaLocationSettingsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaLocationSettingsCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", +export const GroupQuotaLocationSettingsCreateOrUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaLocationSettingsCreateOrUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, }, - }, - location: { - serializedName: "location", - type: { - name: "String", + location: { + serializedName: "location", + type: { + name: "String", + }, }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, }, }, }, - }, -}; + }; -export const GroupQuotaLocationSettingsUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaLocationSettingsUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", +export const GroupQuotaLocationSettingsUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaLocationSettingsUpdateHeaders", + modelProperties: { + retryAfter: { + serializedName: "retry-after", + type: { + name: "Number", + }, }, - }, - location: { - serializedName: "location", - type: { - name: "String", + location: { + serializedName: "location", + type: { + name: "String", + }, }, - }, - azureAsyncOperation: { - serializedName: "azure-asyncoperation", - type: { - name: "String", + azureAsyncOperation: { + serializedName: "azure-asyncoperation", + type: { + name: "String", + }, }, }, }, - }, -}; + }; export const UsagesGetHeaders: coreClient.CompositeMapper = { type: { diff --git a/sdk/quota/arm-quota/src/models/parameters.ts b/sdk/quota/arm-quota/src/models/parameters.ts index cb578e6a83ef..9408f5816f56 100644 --- a/sdk/quota/arm-quota/src/models/parameters.ts +++ b/sdk/quota/arm-quota/src/models/parameters.ts @@ -14,8 +14,8 @@ import { import { GroupQuotasEntity as GroupQuotasEntityMapper, GroupQuotasEntityPatch as GroupQuotasEntityPatchMapper, - SubmittedResourceRequestStatus as SubmittedResourceRequestStatusMapper, - QuotaAllocationRequestStatus as QuotaAllocationRequestStatusMapper, + GroupQuotaLimitList as GroupQuotaLimitListMapper, + SubscriptionQuotaAllocationsList as SubscriptionQuotaAllocationsListMapper, GroupQuotasEnforcementResponse as GroupQuotasEnforcementResponseMapper, CurrentQuotaLimitBase as CurrentQuotaLimitBaseMapper, } from "../models/mappers"; @@ -95,7 +95,7 @@ export const groupQuotaName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-06-01-preview", + defaultValue: "2024-10-15-preview", isConstant: true, serializedName: "api-version", type: { @@ -143,11 +143,18 @@ export const requestId: OperationURLParameter = { }, }; +export const groupQuotaRequest: OperationParameter = { + parameterPath: ["options", "groupQuotaRequest"], + mapper: GroupQuotaLimitListMapper, +}; + export const resourceProviderName: OperationURLParameter = { parameterPath: "resourceProviderName", mapper: { constraints: { - Pattern: new RegExp("^((?!-)[a-zA-Z0-9-]{1,63}(? /** Class containing GroupQuotaLimits operations. */ export class GroupQuotaLimitsImpl implements GroupQuotaLimits { private readonly client: AzureQuotaExtensionAPI; @@ -37,171 +29,21 @@ export class GroupQuotaLimitsImpl implements GroupQuotaLimits { } /** - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed + * in $filter=resourceName eq {SKU}. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus + * @param location The name of the Azure region. * @param options The options parameters. */ - public list( + list( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - filter: string, - options?: GroupQuotaLimitsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll( - managementGroupId, - groupQuotaName, - resourceProviderName, - filter, - options, - ); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage( - managementGroupId, - groupQuotaName, - resourceProviderName, - filter, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - filter: string, - options?: GroupQuotaLimitsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GroupQuotaLimitsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list( - managementGroupId, - groupQuotaName, - resourceProviderName, - filter, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - managementGroupId, - groupQuotaName, - resourceProviderName, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - filter: string, - options?: GroupQuotaLimitsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - managementGroupId, - groupQuotaName, - resourceProviderName, - filter, - options, - )) { - yield* page; - } - } - - /** - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the - * resourceProviders, resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus - * @param options The options parameters. - */ - get( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - resourceName: string, - filter: string, - options?: GroupQuotaLimitsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - groupQuotaName, - resourceProviderName, - resourceName, - filter, - options, - }, - getOperationSpec, - ); - } - - /** - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus - * @param options The options parameters. - */ - private _list( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - filter: string, + location: string, options?: GroupQuotaLimitsListOptionalParams, ): Promise { return this.client.sendOperationRequest( @@ -209,90 +51,18 @@ export class GroupQuotaLimitsImpl implements GroupQuotaLimits { managementGroupId, groupQuotaName, resourceProviderName, - filter, + location, options, }, listOperationSpec, ); } - - /** - * ListNext - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - nextLink: string, - options?: GroupQuotaLimitsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - groupQuotaName, - resourceProviderName, - nextLink, - options, - }, - listNextOperationSpec, - ); - } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const getOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{resourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GroupQuotaLimit, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.resourceProviderName, - Parameters.resourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GroupQuotaLimitList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.resourceProviderName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}", httpMethod: "GET", responses: { 200: { @@ -302,12 +72,13 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName, - Parameters.nextLink, Parameters.resourceProviderName, + Parameters.location, ], headerParameters: [Parameters.accept], serializer, diff --git a/sdk/quota/arm-quota/src/operations/groupQuotaLimitsRequest.ts b/sdk/quota/arm-quota/src/operations/groupQuotaLimitsRequest.ts index e4efaaed425d..7808ac9f469e 100644 --- a/sdk/quota/arm-quota/src/operations/groupQuotaLimitsRequest.ts +++ b/sdk/quota/arm-quota/src/operations/groupQuotaLimitsRequest.ts @@ -13,15 +13,17 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI"; -import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { SubmittedResourceRequestStatus, GroupQuotaLimitsRequestListNextOptionalParams, GroupQuotaLimitsRequestListOptionalParams, GroupQuotaLimitsRequestListResponse, - GroupQuotaLimitsRequestCreateOrUpdateOptionalParams, - GroupQuotaLimitsRequestCreateOrUpdateResponse, GroupQuotaLimitsRequestUpdateOptionalParams, GroupQuotaLimitsRequestUpdateResponse, GroupQuotaLimitsRequestGetOptionalParams, @@ -150,128 +152,9 @@ export class GroupQuotaLimitsRequestImpl implements GroupQuotaLimitsRequest { } /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - * resourceName ("name": {"value" : "resourceName") properties are specified in the request body. Only - * 1 resource quota can be requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - * retry-after duration in seconds to check the intermediate status. This API provides the finals - * status with the request details and status. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - resourceName: string, - options?: GroupQuotaLimitsRequestCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GroupQuotaLimitsRequestCreateOrUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { - managementGroupId, - groupQuotaName, - resourceProviderName, - resourceName, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GroupQuotaLimitsRequestCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; - } - - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - * resourceName ("name": {"value" : "resourceName") properties are specified in the request body. Only - * 1 resource quota can be requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - * retry-after duration in seconds to check the intermediate status. This API provides the finals - * status with the request details and status. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - resourceName: string, - options?: GroupQuotaLimitsRequestCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - managementGroupId, - groupQuotaName, - resourceProviderName, - resourceName, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - * resourceName properties are specified in the request body. Only 1 resource quota can be requested. - * Please note that patch request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName + * properties are specified in the request body. Only 1 resource quota can be requested. Please note + * that patch request creates a new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with * retry-after duration in seconds to check the intermediate status. This API provides the finals * status with the request details and status. @@ -280,14 +163,14 @@ export class GroupQuotaLimitsRequestImpl implements GroupQuotaLimitsRequest { * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param options The options parameters. */ async beginUpdate( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, + location: string, options?: GroupQuotaLimitsRequestUpdateOptionalParams, ): Promise< SimplePollerLike< @@ -305,7 +188,8 @@ export class GroupQuotaLimitsRequestImpl implements GroupQuotaLimitsRequest { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -338,7 +222,7 @@ export class GroupQuotaLimitsRequestImpl implements GroupQuotaLimitsRequest { managementGroupId, groupQuotaName, resourceProviderName, - resourceName, + location, options, }, spec: updateOperationSpec, @@ -356,9 +240,9 @@ export class GroupQuotaLimitsRequestImpl implements GroupQuotaLimitsRequest { } /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - * resourceName properties are specified in the request body. Only 1 resource quota can be requested. - * Please note that patch request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName + * properties are specified in the request body. Only 1 resource quota can be requested. Please note + * that patch request creates a new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with * retry-after duration in seconds to check the intermediate status. This API provides the finals * status with the request details and status. @@ -367,21 +251,21 @@ export class GroupQuotaLimitsRequestImpl implements GroupQuotaLimitsRequest { * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param options The options parameters. */ async beginUpdateAndWait( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, + location: string, options?: GroupQuotaLimitsRequestUpdateOptionalParams, ): Promise { const poller = await this.beginUpdate( managementGroupId, groupQuotaName, resourceProviderName, - resourceName, + location, options, ); return poller.pollUntilDone(); @@ -472,54 +356,21 @@ export class GroupQuotaLimitsRequestImpl implements GroupQuotaLimitsRequest { // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaRequests/{resourceName}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.SubmittedResourceRequestStatus, - }, - 201: { - bodyMapper: Mappers.SubmittedResourceRequestStatus, - }, - 202: { - bodyMapper: Mappers.SubmittedResourceRequestStatus, - }, - 204: { - bodyMapper: Mappers.SubmittedResourceRequestStatus, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.groupQuotaRequest, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.resourceProviderName, - Parameters.resourceName, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; const updateOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaRequests/{resourceName}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/groupQuotaLimits/{location}", httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.SubmittedResourceRequestStatus, + bodyMapper: Mappers.GroupQuotaLimitList, }, 201: { - bodyMapper: Mappers.SubmittedResourceRequestStatus, + bodyMapper: Mappers.GroupQuotaLimitList, }, 202: { - bodyMapper: Mappers.SubmittedResourceRequestStatus, + bodyMapper: Mappers.GroupQuotaLimitList, }, 204: { - bodyMapper: Mappers.SubmittedResourceRequestStatus, + bodyMapper: Mappers.GroupQuotaLimitList, }, default: { bodyMapper: Mappers.ErrorResponse, @@ -532,7 +383,7 @@ const updateOperationSpec: coreClient.OperationSpec = { Parameters.managementGroupId, Parameters.groupQuotaName, Parameters.resourceProviderName, - Parameters.resourceName, + Parameters.location, ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", diff --git a/sdk/quota/arm-quota/src/operations/groupQuotaLocationSettings.ts b/sdk/quota/arm-quota/src/operations/groupQuotaLocationSettings.ts index 7f61552aa44d..4f5a464c5c59 100644 --- a/sdk/quota/arm-quota/src/operations/groupQuotaLocationSettings.ts +++ b/sdk/quota/arm-quota/src/operations/groupQuotaLocationSettings.ts @@ -13,7 +13,11 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI"; -import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { GroupQuotasEnforcementResponse, @@ -31,7 +35,9 @@ import { /// /** Class containing GroupQuotaLocationSettings operations. */ -export class GroupQuotaLocationSettingsImpl implements GroupQuotaLocationSettings { +export class GroupQuotaLocationSettingsImpl + implements GroupQuotaLocationSettings +{ private readonly client: AzureQuotaExtensionAPI; /** @@ -97,7 +103,12 @@ export class GroupQuotaLocationSettingsImpl implements GroupQuotaLocationSetting let result: GroupQuotaLocationSettingsListResponse; let continuationToken = settings?.continuationToken; if (!continuationToken) { - result = await this._list(managementGroupId, groupQuotaName, resourceProviderName, options); + result = await this._list( + managementGroupId, + groupQuotaName, + resourceProviderName, + options, + ); let page = result.value || []; continuationToken = result.nextLink; setContinuationToken(page, continuationToken); @@ -175,7 +186,8 @@ export class GroupQuotaLocationSettingsImpl implements GroupQuotaLocationSetting args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -301,7 +313,8 @@ export class GroupQuotaLocationSettingsImpl implements GroupQuotaLocationSetting args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, diff --git a/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionAllocation.ts b/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionAllocation.ts index 1348184132fb..c9c68215c794 100644 --- a/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionAllocation.ts +++ b/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionAllocation.ts @@ -6,26 +6,20 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; import { GroupQuotaSubscriptionAllocation } from "../operationsInterfaces"; import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI"; import { - SubscriptionQuotaAllocations, - GroupQuotaSubscriptionAllocationListNextOptionalParams, GroupQuotaSubscriptionAllocationListOptionalParams, GroupQuotaSubscriptionAllocationListResponse, - GroupQuotaSubscriptionAllocationGetOptionalParams, - GroupQuotaSubscriptionAllocationGetResponse, - GroupQuotaSubscriptionAllocationListNextResponse, } from "../models"; -/// /** Class containing GroupQuotaSubscriptionAllocation operations. */ -export class GroupQuotaSubscriptionAllocationImpl implements GroupQuotaSubscriptionAllocation { +export class GroupQuotaSubscriptionAllocationImpl + implements GroupQuotaSubscriptionAllocation +{ private readonly client: AzureQuotaExtensionAPI; /** @@ -37,209 +31,42 @@ export class GroupQuotaSubscriptionAllocationImpl implements GroupQuotaSubscript } /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This - * will include the GroupQuota and total quota allocated to the subscription. Only the Group quota - * allocated to the subscription can be allocated back to the MG Group Quota. Use the $filter parameter - * to filter out the specific resource based on the ResourceProvider/Location. $filter is a required - * parameter. + * Gets all the quota allocated to a subscription for the specified resource provider and location for + * resource names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total + * quota allocated to the subscription. Only the Group quota allocated to the subscription can be + * allocated back to the MG Group Quota. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. * @param options The options parameters. */ - public list( + list( managementGroupId: string, groupQuotaName: string, - filter: string, - options?: GroupQuotaSubscriptionAllocationListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll(managementGroupId, groupQuotaName, filter, options); - return { - next() { - return iter.next(); - }, - [Symbol.asyncIterator]() { - return this; - }, - byPage: (settings?: PageSettings) => { - if (settings?.maxPageSize) { - throw new Error("maxPageSize is not supported by this operation."); - } - return this.listPagingPage(managementGroupId, groupQuotaName, filter, options, settings); - }, - }; - } - - private async *listPagingPage( - managementGroupId: string, - groupQuotaName: string, - filter: string, - options?: GroupQuotaSubscriptionAllocationListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GroupQuotaSubscriptionAllocationListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(managementGroupId, groupQuotaName, filter, options); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext(managementGroupId, groupQuotaName, continuationToken, options); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - managementGroupId: string, - groupQuotaName: string, - filter: string, - options?: GroupQuotaSubscriptionAllocationListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - managementGroupId, - groupQuotaName, - filter, - options, - )) { - yield* page; - } - } - - /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This - * will include the GroupQuota and total quota allocated to the subscription. Only the Group quota - * allocated to the subscription can be allocated back to the MG Group Quota. Use the $filter parameter - * to filter out the specific resource based on the ResourceProvider/Location. $filter is a required - * parameter. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus - * @param options The options parameters. - */ - private _list( - managementGroupId: string, - groupQuotaName: string, - filter: string, + resourceProviderName: string, + location: string, options?: GroupQuotaSubscriptionAllocationListOptionalParams, ): Promise { return this.client.sendOperationRequest( - { managementGroupId, groupQuotaName, filter, options }, + { + managementGroupId, + groupQuotaName, + resourceProviderName, + location, + options, + }, listOperationSpec, ); } - - /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. - * This will include the GroupQuota and total quota allocated to the subscription. Only the Group quota - * allocated to the subscription can be allocated back to the MG Group Quota. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus - * @param options The options parameters. - */ - get( - managementGroupId: string, - groupQuotaName: string, - resourceName: string, - filter: string, - options?: GroupQuotaSubscriptionAllocationGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, groupQuotaName, resourceName, filter, options }, - getOperationSpec, - ); - } - - /** - * ListNext - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param nextLink The nextLink from the previous successful call to the List method. - * @param options The options parameters. - */ - private _listNext( - managementGroupId: string, - groupQuotaName: string, - nextLink: string, - options?: GroupQuotaSubscriptionAllocationListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, groupQuotaName, nextLink, options }, - listNextOperationSpec, - ); - } } // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocations", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SubscriptionQuotaAllocationsList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.subscriptionId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocations/{resourceName}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.SubscriptionQuotaAllocations, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion, Parameters.filter], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.subscriptionId, - Parameters.resourceName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}", httpMethod: "GET", responses: { 200: { @@ -249,12 +76,14 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName, - Parameters.nextLink, Parameters.subscriptionId, + Parameters.resourceProviderName, + Parameters.location, ], headerParameters: [Parameters.accept], serializer, diff --git a/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionAllocationRequest.ts b/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionAllocationRequest.ts index 0bb26de7a33e..8ee1c6a79407 100644 --- a/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionAllocationRequest.ts +++ b/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionAllocationRequest.ts @@ -13,19 +13,22 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI"; -import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { QuotaAllocationRequestStatus, GroupQuotaSubscriptionAllocationRequestListNextOptionalParams, GroupQuotaSubscriptionAllocationRequestListOptionalParams, GroupQuotaSubscriptionAllocationRequestListResponse, - GroupQuotaSubscriptionAllocationRequestGetOptionalParams, - GroupQuotaSubscriptionAllocationRequestGetResponse, - GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams, - GroupQuotaSubscriptionAllocationRequestCreateOrUpdateResponse, + SubscriptionQuotaAllocationsList, GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, GroupQuotaSubscriptionAllocationRequestUpdateResponse, + GroupQuotaSubscriptionAllocationRequestGetOptionalParams, + GroupQuotaSubscriptionAllocationRequestGetResponse, GroupQuotaSubscriptionAllocationRequestListNextResponse, } from "../models"; @@ -152,98 +155,47 @@ export class GroupQuotaSubscriptionAllocationRequestImpl } } - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param allocationId Request Id. - * @param options The options parameters. - */ - get( - managementGroupId: string, - groupQuotaName: string, - allocationId: string, - options?: GroupQuotaSubscriptionAllocationRequestGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, groupQuotaName, allocationId, options }, - getOperationSpec, - ); - } - - /** - * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for - * location is required. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus - * @param options The options parameters. - */ - private _list( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - filter: string, - options?: GroupQuotaSubscriptionAllocationRequestListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - groupQuotaName, - resourceProviderName, - filter, - options, - }, - listOperationSpec, - ); - } - /** * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to * subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= * usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back - * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. + * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. User + * can collect unused quotas from multiple subscriptions within the groupQuota and assign the + * groupQuota to the subscription, where it's needed. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param allocateQuotaRequest Quota requests payload. * @param options The options parameters. */ - async beginCreateOrUpdate( + async beginUpdate( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, - allocateQuotaRequest: QuotaAllocationRequestStatus, - options?: GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams, + location: string, + allocateQuotaRequest: SubscriptionQuotaAllocationsList, + options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, ): Promise< SimplePollerLike< - OperationState, - GroupQuotaSubscriptionAllocationRequestCreateOrUpdateResponse + OperationState, + GroupQuotaSubscriptionAllocationRequestUpdateResponse > > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, - ): Promise => { + ): Promise => { return this.client.sendOperationRequest(args, spec); }; const sendOperationFn = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -276,15 +228,15 @@ export class GroupQuotaSubscriptionAllocationRequestImpl managementGroupId, groupQuotaName, resourceProviderName, - resourceName, + location, allocateQuotaRequest, options, }, - spec: createOrUpdateOperationSpec, + spec: updateOperationSpec, }); const poller = await createHttpPoller< - GroupQuotaSubscriptionAllocationRequestCreateOrUpdateResponse, - OperationState + GroupQuotaSubscriptionAllocationRequestUpdateResponse, + OperationState >(lro, { restoreFrom: options?.resumeFrom, intervalInMs: options?.updateIntervalInMs, @@ -298,29 +250,31 @@ export class GroupQuotaSubscriptionAllocationRequestImpl * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to * subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= * usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back - * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. + * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. User + * can collect unused quotas from multiple subscriptions within the groupQuota and assign the + * groupQuota to the subscription, where it's needed. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param allocateQuotaRequest Quota requests payload. * @param options The options parameters. */ - async beginCreateOrUpdateAndWait( + async beginUpdateAndWait( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, - allocateQuotaRequest: QuotaAllocationRequestStatus, - options?: GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( + location: string, + allocateQuotaRequest: SubscriptionQuotaAllocationsList, + options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, + ): Promise { + const poller = await this.beginUpdate( managementGroupId, groupQuotaName, resourceProviderName, - resourceName, + location, allocateQuotaRequest, options, ); @@ -328,128 +282,66 @@ export class GroupQuotaSubscriptionAllocationRequestImpl } /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - * subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= - * usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back - * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. User - * can collect unused quotas from multiple subscriptions within the groupQuota and assign the - * groupQuota to the subscription, where it's needed. + * Get the quota allocation request status for the subscriptionId by allocationId. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param allocationId Request Id. * @param options The options parameters. */ - async beginUpdate( + get( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, - allocateQuotaRequest: QuotaAllocationRequestStatus, - options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GroupQuotaSubscriptionAllocationRequestUpdateResponse - > - > { - const directSendOperation = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ): Promise => { - return this.client.sendOperationRequest(args, spec); - }; - const sendOperationFn = async ( - args: coreClient.OperationArguments, - spec: coreClient.OperationSpec, - ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; - const providedCallback = args.options?.onResponse; - const callback: coreClient.RawResponseCallback = ( - rawResponse: coreClient.FullOperationResponse, - flatResponse: unknown, - ) => { - currentRawResponse = rawResponse; - providedCallback?.(rawResponse, flatResponse); - }; - const updatedArgs = { - ...args, - options: { - ...args.options, - onResponse: callback, - }, - }; - const flatResponse = await directSendOperation(updatedArgs, spec); - return { - flatResponse, - rawResponse: { - statusCode: currentRawResponse!.status, - body: currentRawResponse!.parsedBody, - headers: currentRawResponse!.headers.toJSON(), - }, - }; - }; - - const lro = createLroSpec({ - sendOperationFn, - args: { + allocationId: string, + options?: GroupQuotaSubscriptionAllocationRequestGetOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { managementGroupId, groupQuotaName, resourceProviderName, - resourceName, - allocateQuotaRequest, + allocationId, options, }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GroupQuotaSubscriptionAllocationRequestUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "location", - }); - await poller.poll(); - return poller; + getOperationSpec, + ); } /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - * subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= - * usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back - * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. User - * can collect unused quotas from multiple subscriptions within the groupQuota and assign the - * groupQuota to the subscription, where it's needed. + * Get all the quotaAllocationRequests for a resourceProvider/location. The filter paramter for + * location is required. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param filter | Field | Supported operators + * |---------------------|------------------------ + * + * location eq {location} + * Example: $filter=location eq eastus * @param options The options parameters. */ - async beginUpdateAndWait( + private _list( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, - allocateQuotaRequest: QuotaAllocationRequestStatus, - options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - managementGroupId, - groupQuotaName, - resourceProviderName, - resourceName, - allocateQuotaRequest, - options, + filter: string, + options?: GroupQuotaSubscriptionAllocationRequestListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { + managementGroupId, + groupQuotaName, + resourceProviderName, + filter, + options, + }, + listOperationSpec, ); - return poller.pollUntilDone(); } /** @@ -484,71 +376,51 @@ export class GroupQuotaSubscriptionAllocationRequestImpl // Operation Specifications const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); -const getOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/quotaAllocationRequests/{allocationId}", - httpMethod: "GET", +const updateOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocations/{location}", + httpMethod: "PATCH", responses: { 200: { - bodyMapper: Mappers.QuotaAllocationRequestStatus, + bodyMapper: Mappers.SubscriptionQuotaAllocationsList, }, - default: { - bodyMapper: Mappers.ErrorResponse, + 201: { + bodyMapper: Mappers.SubscriptionQuotaAllocationsList, }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.subscriptionId, - Parameters.allocationId, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.QuotaAllocationRequestStatusList, + 202: { + bodyMapper: Mappers.SubscriptionQuotaAllocationsList, + }, + 204: { + bodyMapper: Mappers.SubscriptionQuotaAllocationsList, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, - queryParameters: [Parameters.apiVersion, Parameters.filter], + requestBody: Parameters.allocateQuotaRequest, + queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName, Parameters.subscriptionId, Parameters.resourceProviderName, + Parameters.location, ], - headerParameters: [Parameters.accept], + headerParameters: [Parameters.contentType, Parameters.accept], + mediaType: "json", serializer, }; -const createOrUpdateOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{resourceName}", - httpMethod: "PUT", +const getOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{allocationId}", + httpMethod: "GET", responses: { 200: { bodyMapper: Mappers.QuotaAllocationRequestStatus, }, - 201: { - bodyMapper: Mappers.QuotaAllocationRequestStatus, - }, - 202: { - bodyMapper: Mappers.QuotaAllocationRequestStatus, - }, - 204: { - bodyMapper: Mappers.QuotaAllocationRequestStatus, - }, default: { bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.allocateQuotaRequest, queryParameters: [Parameters.apiVersion], urlParameters: [ Parameters.$host, @@ -556,44 +428,31 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { Parameters.groupQuotaName, Parameters.subscriptionId, Parameters.resourceProviderName, - Parameters.resourceName, + Parameters.allocationId, ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", + headerParameters: [Parameters.accept], serializer, }; -const updateOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests/{resourceName}", - httpMethod: "PATCH", +const listOperationSpec: coreClient.OperationSpec = { + path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/subscriptions/{subscriptionId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/quotaAllocationRequests", + httpMethod: "GET", responses: { 200: { - bodyMapper: Mappers.QuotaAllocationRequestStatus, - }, - 201: { - bodyMapper: Mappers.QuotaAllocationRequestStatus, - }, - 202: { - bodyMapper: Mappers.QuotaAllocationRequestStatus, - }, - 204: { - bodyMapper: Mappers.QuotaAllocationRequestStatus, + bodyMapper: Mappers.QuotaAllocationRequestStatusList, }, default: { bodyMapper: Mappers.ErrorResponse, }, }, - requestBody: Parameters.allocateQuotaRequest, - queryParameters: [Parameters.apiVersion], + queryParameters: [Parameters.apiVersion, Parameters.filter], urlParameters: [ Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName, Parameters.subscriptionId, Parameters.resourceProviderName, - Parameters.resourceName, ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", + headerParameters: [Parameters.accept], serializer, }; const listNextOperationSpec: coreClient.OperationSpec = { diff --git a/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionRequests.ts b/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionRequests.ts index 86b1e142bb45..f7cdbb2c26c2 100644 --- a/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionRequests.ts +++ b/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptionRequests.ts @@ -25,7 +25,9 @@ import { /// /** Class containing GroupQuotaSubscriptionRequests operations. */ -export class GroupQuotaSubscriptionRequestsImpl implements GroupQuotaSubscriptionRequests { +export class GroupQuotaSubscriptionRequestsImpl + implements GroupQuotaSubscriptionRequests +{ private readonly client: AzureQuotaExtensionAPI; /** @@ -61,7 +63,12 @@ export class GroupQuotaSubscriptionRequestsImpl implements GroupQuotaSubscriptio if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(managementGroupId, groupQuotaName, options, settings); + return this.listPagingPage( + managementGroupId, + groupQuotaName, + options, + settings, + ); }, }; } @@ -82,7 +89,12 @@ export class GroupQuotaSubscriptionRequestsImpl implements GroupQuotaSubscriptio yield page; } while (continuationToken) { - result = await this._listNext(managementGroupId, groupQuotaName, continuationToken, options); + result = await this._listNext( + managementGroupId, + groupQuotaName, + continuationToken, + options, + ); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -95,7 +107,11 @@ export class GroupQuotaSubscriptionRequestsImpl implements GroupQuotaSubscriptio groupQuotaName: string, options?: GroupQuotaSubscriptionRequestsListOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listPagingPage(managementGroupId, groupQuotaName, options)) { + for await (const page of this.listPagingPage( + managementGroupId, + groupQuotaName, + options, + )) { yield* page; } } @@ -177,7 +193,11 @@ const listOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.groupQuotaName, + ], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptions.ts b/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptions.ts index da07a8d22d62..3cac9ab1a0c8 100644 --- a/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptions.ts +++ b/sdk/quota/arm-quota/src/operations/groupQuotaSubscriptions.ts @@ -13,7 +13,11 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI"; -import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { GroupQuotaSubscriptionId, @@ -68,7 +72,12 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { if (settings?.maxPageSize) { throw new Error("maxPageSize is not supported by this operation."); } - return this.listPagingPage(managementGroupId, groupQuotaName, options, settings); + return this.listPagingPage( + managementGroupId, + groupQuotaName, + options, + settings, + ); }, }; } @@ -89,7 +98,12 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { yield page; } while (continuationToken) { - result = await this._listNext(managementGroupId, groupQuotaName, continuationToken, options); + result = await this._listNext( + managementGroupId, + groupQuotaName, + continuationToken, + options, + ); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -102,7 +116,11 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { groupQuotaName: string, options?: GroupQuotaSubscriptionsListOptionalParams, ): AsyncIterableIterator { - for await (const page of this.listPagingPage(managementGroupId, groupQuotaName, options)) { + for await (const page of this.listPagingPage( + managementGroupId, + groupQuotaName, + options, + )) { yield* page; } } @@ -137,7 +155,8 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -196,7 +215,11 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { groupQuotaName: string, options?: GroupQuotaSubscriptionsCreateOrUpdateOptionalParams, ): Promise { - const poller = await this.beginCreateOrUpdate(managementGroupId, groupQuotaName, options); + const poller = await this.beginCreateOrUpdate( + managementGroupId, + groupQuotaName, + options, + ); return poller.pollUntilDone(); } @@ -229,7 +252,8 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -287,7 +311,11 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { groupQuotaName: string, options?: GroupQuotaSubscriptionsUpdateOptionalParams, ): Promise { - const poller = await this.beginUpdate(managementGroupId, groupQuotaName, options); + const poller = await this.beginUpdate( + managementGroupId, + groupQuotaName, + options, + ); return poller.pollUntilDone(); } @@ -319,7 +347,8 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -376,7 +405,11 @@ export class GroupQuotaSubscriptionsImpl implements GroupQuotaSubscriptions { groupQuotaName: string, options?: GroupQuotaSubscriptionsDeleteOptionalParams, ): Promise { - const poller = await this.beginDelete(managementGroupId, groupQuotaName, options); + const poller = await this.beginDelete( + managementGroupId, + groupQuotaName, + options, + ); return poller.pollUntilDone(); } @@ -563,7 +596,11 @@ const listOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.groupQuotaName, + ], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/quota/arm-quota/src/operations/groupQuotas.ts b/sdk/quota/arm-quota/src/operations/groupQuotas.ts index 6ebeeb33eeca..25d2870dc02d 100644 --- a/sdk/quota/arm-quota/src/operations/groupQuotas.ts +++ b/sdk/quota/arm-quota/src/operations/groupQuotas.ts @@ -13,7 +13,11 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI"; -import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { GroupQuotasEntity, @@ -86,7 +90,11 @@ export class GroupQuotasImpl implements GroupQuotas { yield page; } while (continuationToken) { - result = await this._listNext(managementGroupId, continuationToken, options); + result = await this._listNext( + managementGroupId, + continuationToken, + options, + ); continuationToken = result.nextLink; let page = result.value || []; setContinuationToken(page, continuationToken); @@ -135,7 +143,8 @@ export class GroupQuotasImpl implements GroupQuotas { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -196,7 +205,11 @@ export class GroupQuotasImpl implements GroupQuotas { groupQuotaName: string, options?: GroupQuotasCreateOrUpdateOptionalParams, ): Promise { - const poller = await this.beginCreateOrUpdate(managementGroupId, groupQuotaName, options); + const poller = await this.beginCreateOrUpdate( + managementGroupId, + groupQuotaName, + options, + ); return poller.pollUntilDone(); } @@ -220,7 +233,10 @@ export class GroupQuotasImpl implements GroupQuotas { groupQuotaName: string, options?: GroupQuotasUpdateOptionalParams, ): Promise< - SimplePollerLike, GroupQuotasUpdateResponse> + SimplePollerLike< + OperationState, + GroupQuotasUpdateResponse + > > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -232,7 +248,8 @@ export class GroupQuotasImpl implements GroupQuotas { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -296,7 +313,11 @@ export class GroupQuotasImpl implements GroupQuotas { groupQuotaName: string, options?: GroupQuotasUpdateOptionalParams, ): Promise { - const poller = await this.beginUpdate(managementGroupId, groupQuotaName, options); + const poller = await this.beginUpdate( + managementGroupId, + groupQuotaName, + options, + ); return poller.pollUntilDone(); } @@ -332,7 +353,10 @@ export class GroupQuotasImpl implements GroupQuotas { groupQuotaName: string, options?: GroupQuotasDeleteOptionalParams, ): Promise< - SimplePollerLike, GroupQuotasDeleteResponse> + SimplePollerLike< + OperationState, + GroupQuotasDeleteResponse + > > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -344,7 +368,8 @@ export class GroupQuotasImpl implements GroupQuotas { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -401,7 +426,11 @@ export class GroupQuotasImpl implements GroupQuotas { groupQuotaName: string, options?: GroupQuotasDeleteOptionalParams, ): Promise { - const poller = await this.beginDelete(managementGroupId, groupQuotaName, options); + const poller = await this.beginDelete( + managementGroupId, + groupQuotaName, + options, + ); return poller.pollUntilDone(); } @@ -415,7 +444,10 @@ export class GroupQuotasImpl implements GroupQuotas { managementGroupId: string, options?: GroupQuotasListOptionalParams, ): Promise { - return this.client.sendOperationRequest({ managementGroupId, options }, listOperationSpec); + return this.client.sendOperationRequest( + { managementGroupId, options }, + listOperationSpec, + ); } /** @@ -460,7 +492,11 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.groupQuotaPutRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.groupQuotaName, + ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, @@ -487,7 +523,11 @@ const updateOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.groupQuotasPatchRequestBody, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.groupQuotaName, + ], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, @@ -504,7 +544,11 @@ const getOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.groupQuotaName, + ], headerParameters: [Parameters.accept], serializer, }; @@ -529,7 +573,11 @@ const deleteOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.groupQuotaName], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.groupQuotaName, + ], headerParameters: [Parameters.accept], serializer, }; @@ -560,7 +608,11 @@ const listNextOperationSpec: coreClient.OperationSpec = { bodyMapper: Mappers.ErrorResponse, }, }, - urlParameters: [Parameters.$host, Parameters.managementGroupId, Parameters.nextLink], + urlParameters: [ + Parameters.$host, + Parameters.managementGroupId, + Parameters.nextLink, + ], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/quota/arm-quota/src/operations/index.ts b/sdk/quota/arm-quota/src/operations/index.ts index dae24df54192..aafe918a6b95 100644 --- a/sdk/quota/arm-quota/src/operations/index.ts +++ b/sdk/quota/arm-quota/src/operations/index.ts @@ -9,10 +9,10 @@ export * from "./groupQuotas"; export * from "./groupQuotaSubscriptions"; export * from "./groupQuotaSubscriptionRequests"; -export * from "./groupQuotaLimits"; export * from "./groupQuotaLimitsRequest"; -export * from "./groupQuotaSubscriptionAllocation"; +export * from "./groupQuotaLimits"; export * from "./groupQuotaSubscriptionAllocationRequest"; +export * from "./groupQuotaSubscriptionAllocation"; export * from "./groupQuotaUsages"; export * from "./groupQuotaLocationSettings"; export * from "./usages"; diff --git a/sdk/quota/arm-quota/src/operations/quota.ts b/sdk/quota/arm-quota/src/operations/quota.ts index 18d8a7abcf6b..b3e3511a8583 100644 --- a/sdk/quota/arm-quota/src/operations/quota.ts +++ b/sdk/quota/arm-quota/src/operations/quota.ts @@ -13,7 +13,11 @@ import * as coreClient from "@azure/core-client"; import * as Mappers from "../models/mappers"; import * as Parameters from "../models/parameters"; import { AzureQuotaExtensionAPI } from "../azureQuotaExtensionAPI"; -import { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; +import { + SimplePollerLike, + OperationState, + createHttpPoller, +} from "@azure/core-lro"; import { createLroSpec } from "../lroImpl"; import { CurrentQuotaLimitBase, @@ -124,7 +128,10 @@ export class QuotaImpl implements Quota { scope: string, options?: QuotaGetOptionalParams, ): Promise { - return this.client.sendOperationRequest({ resourceName, scope, options }, getOperationSpec); + return this.client.sendOperationRequest( + { resourceName, scope, options }, + getOperationSpec, + ); } /** @@ -153,7 +160,10 @@ export class QuotaImpl implements Quota { createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams, ): Promise< - SimplePollerLike, QuotaCreateOrUpdateResponse> + SimplePollerLike< + OperationState, + QuotaCreateOrUpdateResponse + > > { const directSendOperation = async ( args: coreClient.OperationArguments, @@ -165,7 +175,8 @@ export class QuotaImpl implements Quota { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -235,7 +246,12 @@ export class QuotaImpl implements Quota { createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams, ): Promise { - const poller = await this.beginCreateOrUpdate(resourceName, scope, createQuotaRequest, options); + const poller = await this.beginCreateOrUpdate( + resourceName, + scope, + createQuotaRequest, + options, + ); return poller.pollUntilDone(); } @@ -263,7 +279,9 @@ export class QuotaImpl implements Quota { scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams, - ): Promise, QuotaUpdateResponse>> { + ): Promise< + SimplePollerLike, QuotaUpdateResponse> + > { const directSendOperation = async ( args: coreClient.OperationArguments, spec: coreClient.OperationSpec, @@ -274,7 +292,8 @@ export class QuotaImpl implements Quota { args: coreClient.OperationArguments, spec: coreClient.OperationSpec, ) => { - let currentRawResponse: coreClient.FullOperationResponse | undefined = undefined; + let currentRawResponse: coreClient.FullOperationResponse | undefined = + undefined; const providedCallback = args.options?.onResponse; const callback: coreClient.RawResponseCallback = ( rawResponse: coreClient.FullOperationResponse, @@ -306,14 +325,14 @@ export class QuotaImpl implements Quota { args: { resourceName, scope, createQuotaRequest, options }, spec: updateOperationSpec, }); - const poller = await createHttpPoller>( - lro, - { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - resourceLocationConfig: "original-uri", - }, - ); + const poller = await createHttpPoller< + QuotaUpdateResponse, + OperationState + >(lro, { + restoreFrom: options?.resumeFrom, + intervalInMs: options?.updateIntervalInMs, + resourceLocationConfig: "original-uri", + }); await poller.poll(); return poller; } @@ -343,7 +362,12 @@ export class QuotaImpl implements Quota { createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams, ): Promise { - const poller = await this.beginUpdate(resourceName, scope, createQuotaRequest, options); + const poller = await this.beginUpdate( + resourceName, + scope, + createQuotaRequest, + options, + ); return poller.pollUntilDone(); } @@ -357,8 +381,14 @@ export class QuotaImpl implements Quota { * resource. * @param options The options parameters. */ - private _list(scope: string, options?: QuotaListOptionalParams): Promise { - return this.client.sendOperationRequest({ scope, options }, listOperationSpec); + private _list( + scope: string, + options?: QuotaListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec, + ); } /** @@ -376,7 +406,10 @@ export class QuotaImpl implements Quota { nextLink: string, options?: QuotaListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest({ scope, nextLink, options }, listNextOperationSpec); + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listNextOperationSpec, + ); } } // Operation Specifications @@ -395,7 +428,7 @@ const getOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceName1, Parameters.scope], + urlParameters: [Parameters.$host, Parameters.resourceName, Parameters.scope], headerParameters: [Parameters.accept], serializer, }; @@ -421,7 +454,7 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.createQuotaRequest, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceName1, Parameters.scope], + urlParameters: [Parameters.$host, Parameters.resourceName, Parameters.scope], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, @@ -448,7 +481,7 @@ const updateOperationSpec: coreClient.OperationSpec = { }, requestBody: Parameters.createQuotaRequest, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceName1, Parameters.scope], + urlParameters: [Parameters.$host, Parameters.resourceName, Parameters.scope], headerParameters: [Parameters.contentType, Parameters.accept], mediaType: "json", serializer, diff --git a/sdk/quota/arm-quota/src/operations/quotaOperation.ts b/sdk/quota/arm-quota/src/operations/quotaOperation.ts index c136d135d756..8aeda8f1248a 100644 --- a/sdk/quota/arm-quota/src/operations/quotaOperation.ts +++ b/sdk/quota/arm-quota/src/operations/quotaOperation.ts @@ -92,7 +92,9 @@ export class QuotaOperationImpl implements QuotaOperation { * List all the operations supported by the Microsoft.Quota resource provider. * @param options The options parameters. */ - private _list(options?: QuotaOperationListOptionalParams): Promise { + private _list( + options?: QuotaOperationListOptionalParams, + ): Promise { return this.client.sendOperationRequest({ options }, listOperationSpec); } @@ -105,7 +107,10 @@ export class QuotaOperationImpl implements QuotaOperation { nextLink: string, options?: QuotaOperationListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec); + return this.client.sendOperationRequest( + { nextLink, options }, + listNextOperationSpec, + ); } } // Operation Specifications diff --git a/sdk/quota/arm-quota/src/operations/quotaRequestStatus.ts b/sdk/quota/arm-quota/src/operations/quotaRequestStatus.ts index d5e308630493..8fae0e3378a7 100644 --- a/sdk/quota/arm-quota/src/operations/quotaRequestStatus.ts +++ b/sdk/quota/arm-quota/src/operations/quotaRequestStatus.ts @@ -116,7 +116,10 @@ export class QuotaRequestStatusImpl implements QuotaRequestStatus { scope: string, options?: QuotaRequestStatusGetOptionalParams, ): Promise { - return this.client.sendOperationRequest({ id, scope, options }, getOperationSpec); + return this.client.sendOperationRequest( + { id, scope, options }, + getOperationSpec, + ); } /** @@ -133,7 +136,10 @@ export class QuotaRequestStatusImpl implements QuotaRequestStatus { scope: string, options?: QuotaRequestStatusListOptionalParams, ): Promise { - return this.client.sendOperationRequest({ scope, options }, listOperationSpec); + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec, + ); } /** @@ -151,7 +157,10 @@ export class QuotaRequestStatusImpl implements QuotaRequestStatus { nextLink: string, options?: QuotaRequestStatusListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest({ scope, nextLink, options }, listNextOperationSpec); + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listNextOperationSpec, + ); } } // Operation Specifications diff --git a/sdk/quota/arm-quota/src/operations/usages.ts b/sdk/quota/arm-quota/src/operations/usages.ts index aba998ba96b7..9135a410ea4c 100644 --- a/sdk/quota/arm-quota/src/operations/usages.ts +++ b/sdk/quota/arm-quota/src/operations/usages.ts @@ -116,7 +116,10 @@ export class UsagesImpl implements Usages { scope: string, options?: UsagesGetOptionalParams, ): Promise { - return this.client.sendOperationRequest({ resourceName, scope, options }, getOperationSpec); + return this.client.sendOperationRequest( + { resourceName, scope, options }, + getOperationSpec, + ); } /** @@ -128,8 +131,14 @@ export class UsagesImpl implements Usages { * resource. * @param options The options parameters. */ - private _list(scope: string, options?: UsagesListOptionalParams): Promise { - return this.client.sendOperationRequest({ scope, options }, listOperationSpec); + private _list( + scope: string, + options?: UsagesListOptionalParams, + ): Promise { + return this.client.sendOperationRequest( + { scope, options }, + listOperationSpec, + ); } /** @@ -147,7 +156,10 @@ export class UsagesImpl implements Usages { nextLink: string, options?: UsagesListNextOptionalParams, ): Promise { - return this.client.sendOperationRequest({ scope, nextLink, options }, listNextOperationSpec); + return this.client.sendOperationRequest( + { scope, nextLink, options }, + listNextOperationSpec, + ); } } // Operation Specifications @@ -166,7 +178,7 @@ const getOperationSpec: coreClient.OperationSpec = { }, }, queryParameters: [Parameters.apiVersion], - urlParameters: [Parameters.$host, Parameters.resourceName1, Parameters.scope], + urlParameters: [Parameters.$host, Parameters.resourceName, Parameters.scope], headerParameters: [Parameters.accept], serializer, }; diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLimits.ts b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLimits.ts index b7ca8444484a..cb22a7816005 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLimits.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLimits.ts @@ -6,62 +6,29 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { - GroupQuotaLimit, GroupQuotaLimitsListOptionalParams, - GroupQuotaLimitsGetOptionalParams, - GroupQuotaLimitsGetResponse, + GroupQuotaLimitsListResponse, } from "../models"; -/// /** Interface representing a GroupQuotaLimits. */ export interface GroupQuotaLimits { /** - * Gets the GroupQuotaLimits for the all resource for a specific resourceProvider and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. + * Gets the GroupQuotaLimits for the specified resource provider and location for resource names passed + * in $filter=resourceName eq {SKU}. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus + * @param location The name of the Azure region. * @param options The options parameters. */ list( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - filter: string, + location: string, options?: GroupQuotaLimitsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets the GroupQuotaLimits for the specific resource for a specific resource based on the - * resourceProviders, resourceName and $filter passed. - * The $filter=location eq {location} is required to location specific resources groupQuota. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus - * @param options The options parameters. - */ - get( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - resourceName: string, - filter: string, - options?: GroupQuotaLimitsGetOptionalParams, - ): Promise; + ): Promise; } diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLimitsRequest.ts b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLimitsRequest.ts index c89f490687f1..187cd71888f9 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLimitsRequest.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLimitsRequest.ts @@ -11,8 +11,6 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { SubmittedResourceRequestStatus, GroupQuotaLimitsRequestListOptionalParams, - GroupQuotaLimitsRequestCreateOrUpdateOptionalParams, - GroupQuotaLimitsRequestCreateOrUpdateResponse, GroupQuotaLimitsRequestUpdateOptionalParams, GroupQuotaLimitsRequestUpdateResponse, GroupQuotaLimitsRequestGetOptionalParams, @@ -44,9 +42,9 @@ export interface GroupQuotaLimitsRequest { options?: GroupQuotaLimitsRequestListOptionalParams, ): PagedAsyncIterableIterator; /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - * resourceName ("name": {"value" : "resourceName") properties are specified in the request body. Only - * 1 resource quota can be requested. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName + * properties are specified in the request body. Only 1 resource quota can be requested. Please note + * that patch request creates a new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with * retry-after duration in seconds to check the intermediate status. This API provides the finals * status with the request details and status. @@ -55,63 +53,14 @@ export interface GroupQuotaLimitsRequest { * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param options The options parameters. - */ - beginCreateOrUpdate( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - resourceName: string, - options?: GroupQuotaLimitsRequestCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GroupQuotaLimitsRequestCreateOrUpdateResponse - > - >; - /** - * Put the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - * resourceName ("name": {"value" : "resourceName") properties are specified in the request body. Only - * 1 resource quota can be requested. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - * retry-after duration in seconds to check the intermediate status. This API provides the finals - * status with the request details and status. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - resourceName: string, - options?: GroupQuotaLimitsRequestCreateOrUpdateOptionalParams, - ): Promise; - /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - * resourceName properties are specified in the request body. Only 1 resource quota can be requested. - * Please note that patch request creates a new groupQuota request. - * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with - * retry-after duration in seconds to check the intermediate status. This API provides the finals - * status with the request details and status. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param options The options parameters. */ beginUpdate( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, + location: string, options?: GroupQuotaLimitsRequestUpdateOptionalParams, ): Promise< SimplePollerLike< @@ -120,9 +69,9 @@ export interface GroupQuotaLimitsRequest { > >; /** - * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. the location and - * resourceName properties are specified in the request body. Only 1 resource quota can be requested. - * Please note that patch request creates a new groupQuota request. + * Create the GroupQuota requests for a specific ResourceProvider/Location/Resource. The resourceName + * properties are specified in the request body. Only 1 resource quota can be requested. Please note + * that patch request creates a new groupQuota request. * Use the polling API - OperationsStatus URI specified in Azure-AsyncOperation header field, with * retry-after duration in seconds to check the intermediate status. This API provides the finals * status with the request details and status. @@ -131,14 +80,14 @@ export interface GroupQuotaLimitsRequest { * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param options The options parameters. */ beginUpdateAndWait( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, + location: string, options?: GroupQuotaLimitsRequestUpdateOptionalParams, ): Promise; /** diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaSubscriptionAllocation.ts b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaSubscriptionAllocation.ts index a5eb77fe694b..aab1b2acf690 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaSubscriptionAllocation.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaSubscriptionAllocation.ts @@ -6,59 +6,31 @@ * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ -import { PagedAsyncIterableIterator } from "@azure/core-paging"; import { - SubscriptionQuotaAllocations, GroupQuotaSubscriptionAllocationListOptionalParams, - GroupQuotaSubscriptionAllocationGetOptionalParams, - GroupQuotaSubscriptionAllocationGetResponse, + GroupQuotaSubscriptionAllocationListResponse, } from "../models"; -/// /** Interface representing a GroupQuotaSubscriptionAllocation. */ export interface GroupQuotaSubscriptionAllocation { /** - * Gets all the quota allocated to a subscription for the specific Resource Provider, Location. This - * will include the GroupQuota and total quota allocated to the subscription. Only the Group quota - * allocated to the subscription can be allocated back to the MG Group Quota. Use the $filter parameter - * to filter out the specific resource based on the ResourceProvider/Location. $filter is a required - * parameter. + * Gets all the quota allocated to a subscription for the specified resource provider and location for + * resource names passed in $filter=resourceName eq {SKU}. This will include the GroupQuota and total + * quota allocated to the subscription. Only the Group quota allocated to the subscription can be + * allocated back to the MG Group Quota. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus + * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only + * Microsoft.Compute resource provider supports this API. + * @param location The name of the Azure region. * @param options The options parameters. */ list( managementGroupId: string, groupQuotaName: string, - filter: string, + resourceProviderName: string, + location: string, options?: GroupQuotaSubscriptionAllocationListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Gets Quota allocated to a subscription for the specific Resource Provider, Location, ResourceName. - * This will include the GroupQuota and total quota allocated to the subscription. Only the Group quota - * allocated to the subscription can be allocated back to the MG Group Quota. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceName Resource name. - * @param filter | Field | Supported operators - * |---------------------|------------------------ - * - * location eq {location} - * Example: $filter=location eq eastus - * @param options The options parameters. - */ - get( - managementGroupId: string, - groupQuotaName: string, - resourceName: string, - filter: string, - options?: GroupQuotaSubscriptionAllocationGetOptionalParams, - ): Promise; + ): Promise; } diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaSubscriptionAllocationRequest.ts b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaSubscriptionAllocationRequest.ts index 1f07cf9bf50b..c3e19e0564e0 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaSubscriptionAllocationRequest.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaSubscriptionAllocationRequest.ts @@ -11,12 +11,11 @@ import { SimplePollerLike, OperationState } from "@azure/core-lro"; import { QuotaAllocationRequestStatus, GroupQuotaSubscriptionAllocationRequestListOptionalParams, - GroupQuotaSubscriptionAllocationRequestGetOptionalParams, - GroupQuotaSubscriptionAllocationRequestGetResponse, - GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams, - GroupQuotaSubscriptionAllocationRequestCreateOrUpdateResponse, + SubscriptionQuotaAllocationsList, GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, GroupQuotaSubscriptionAllocationRequestUpdateResponse, + GroupQuotaSubscriptionAllocationRequestGetOptionalParams, + GroupQuotaSubscriptionAllocationRequestGetResponse, } from "../models"; /// @@ -44,69 +43,35 @@ export interface GroupQuotaSubscriptionAllocationRequest { filter: string, options?: GroupQuotaSubscriptionAllocationRequestListOptionalParams, ): PagedAsyncIterableIterator; - /** - * Get the quota allocation request status for the subscriptionId by allocationId. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param allocationId Request Id. - * @param options The options parameters. - */ - get( - managementGroupId: string, - groupQuotaName: string, - allocationId: string, - options?: GroupQuotaSubscriptionAllocationRequestGetOptionalParams, - ): Promise; /** * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to * subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= * usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back - * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. + * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. User + * can collect unused quotas from multiple subscriptions within the groupQuota and assign the + * groupQuota to the subscription, where it's needed. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param allocateQuotaRequest Quota requests payload. * @param options The options parameters. */ - beginCreateOrUpdate( + beginUpdate( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, - allocateQuotaRequest: QuotaAllocationRequestStatus, - options?: GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams, + location: string, + allocateQuotaRequest: SubscriptionQuotaAllocationsList, + options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, ): Promise< SimplePollerLike< - OperationState, - GroupQuotaSubscriptionAllocationRequestCreateOrUpdateResponse + OperationState, + GroupQuotaSubscriptionAllocationRequestUpdateResponse > >; - /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - * subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= - * usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back - * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. - * @param managementGroupId Management Group Id. - * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context - * tenantId/MgId. - * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only - * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - resourceName: string, - allocateQuotaRequest: QuotaAllocationRequestStatus, - options?: GroupQuotaSubscriptionAllocationRequestCreateOrUpdateOptionalParams, - ): Promise; /** * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to * subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= @@ -119,45 +84,33 @@ export interface GroupQuotaSubscriptionAllocationRequest { * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. + * @param location The name of the Azure region. * @param allocateQuotaRequest Quota requests payload. * @param options The options parameters. */ - beginUpdate( + beginUpdateAndWait( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, - allocateQuotaRequest: QuotaAllocationRequestStatus, + location: string, + allocateQuotaRequest: SubscriptionQuotaAllocationsList, options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GroupQuotaSubscriptionAllocationRequestUpdateResponse - > - >; + ): Promise; /** - * Request to assign quota from group quota to a specific Subscription. The assign GroupQuota to - * subscriptions or reduce the quota allocated to subscription to give back the unused quota ( quota >= - * usages) to the groupQuota. So, this API can be used to assign Quota to subscriptions and assign back - * unused quota to group quota, which can be assigned to another subscriptions in the GroupQuota. User - * can collect unused quotas from multiple subscriptions within the groupQuota and assign the - * groupQuota to the subscription, where it's needed. + * Get the quota allocation request status for the subscriptionId by allocationId. * @param managementGroupId Management Group Id. * @param groupQuotaName The GroupQuota name. The name should be unique for the provided context * tenantId/MgId. * @param resourceProviderName The resource provider name, such as - Microsoft.Compute. Currently only * Microsoft.Compute resource provider supports this API. - * @param resourceName Resource name. - * @param allocateQuotaRequest Quota requests payload. + * @param allocationId Request Id. * @param options The options parameters. */ - beginUpdateAndWait( + get( managementGroupId: string, groupQuotaName: string, resourceProviderName: string, - resourceName: string, - allocateQuotaRequest: QuotaAllocationRequestStatus, - options?: GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams, - ): Promise; + allocationId: string, + options?: GroupQuotaSubscriptionAllocationRequestGetOptionalParams, + ): Promise; } diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotas.ts b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotas.ts index c48d4e52b45c..f8ed4fe8347e 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotas.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotas.ts @@ -93,7 +93,10 @@ export interface GroupQuotas { groupQuotaName: string, options?: GroupQuotasUpdateOptionalParams, ): Promise< - SimplePollerLike, GroupQuotasUpdateResponse> + SimplePollerLike< + OperationState, + GroupQuotasUpdateResponse + > >; /** * Updates the GroupQuotas for the name passed. A GroupQuotas RequestId will be returned by the @@ -141,7 +144,10 @@ export interface GroupQuotas { groupQuotaName: string, options?: GroupQuotasDeleteOptionalParams, ): Promise< - SimplePollerLike, GroupQuotasDeleteResponse> + SimplePollerLike< + OperationState, + GroupQuotasDeleteResponse + > >; /** * Deletes the GroupQuotas for the name passed. All the remaining shareQuota in the GroupQuotas will be diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/index.ts b/sdk/quota/arm-quota/src/operationsInterfaces/index.ts index dae24df54192..aafe918a6b95 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/index.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/index.ts @@ -9,10 +9,10 @@ export * from "./groupQuotas"; export * from "./groupQuotaSubscriptions"; export * from "./groupQuotaSubscriptionRequests"; -export * from "./groupQuotaLimits"; export * from "./groupQuotaLimitsRequest"; -export * from "./groupQuotaSubscriptionAllocation"; +export * from "./groupQuotaLimits"; export * from "./groupQuotaSubscriptionAllocationRequest"; +export * from "./groupQuotaSubscriptionAllocation"; export * from "./groupQuotaUsages"; export * from "./groupQuotaLocationSettings"; export * from "./usages"; diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/quota.ts b/sdk/quota/arm-quota/src/operationsInterfaces/quota.ts index b44ba898efdc..57f15d2ed5a5 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/quota.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/quota.ts @@ -81,7 +81,10 @@ export interface Quota { createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaCreateOrUpdateOptionalParams, ): Promise< - SimplePollerLike, QuotaCreateOrUpdateResponse> + SimplePollerLike< + OperationState, + QuotaCreateOrUpdateResponse + > >; /** * Create or update the quota limit for the specified resource with the requested value. To update the @@ -133,7 +136,9 @@ export interface Quota { scope: string, createQuotaRequest: CurrentQuotaLimitBase, options?: QuotaUpdateOptionalParams, - ): Promise, QuotaUpdateResponse>>; + ): Promise< + SimplePollerLike, QuotaUpdateResponse> + >; /** * Update the quota limit for a specific resource to the specified value: * 1. Use the Usages-GET and Quota-GET operations to determine the remaining quota for the specific diff --git a/sdk/quota/arm-quota/src/operationsInterfaces/quotaOperation.ts b/sdk/quota/arm-quota/src/operationsInterfaces/quotaOperation.ts index 50b8d40d957d..352e9824f8b6 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/quotaOperation.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/quotaOperation.ts @@ -16,5 +16,7 @@ export interface QuotaOperation { * List all the operations supported by the Microsoft.Quota resource provider. * @param options The options parameters. */ - list(options?: QuotaOperationListOptionalParams): PagedAsyncIterableIterator; + list( + options?: QuotaOperationListOptionalParams, + ): PagedAsyncIterableIterator; } diff --git a/sdk/quota/arm-quota/src/pagingHelper.ts b/sdk/quota/arm-quota/src/pagingHelper.ts index e362819bdfc4..205cccc26592 100644 --- a/sdk/quota/arm-quota/src/pagingHelper.ts +++ b/sdk/quota/arm-quota/src/pagingHelper.ts @@ -26,7 +26,10 @@ export function getContinuationToken(page: unknown): string | undefined { return pageMap.get(page)?.continuationToken; } -export function setContinuationToken(page: unknown, continuationToken: string | undefined): void { +export function setContinuationToken( + page: unknown, + continuationToken: string | undefined, +): void { if (typeof page !== "object" || page === null || !continuationToken) { return; } diff --git a/sdk/quota/arm-quota/test/sampleTest.ts b/sdk/quota/arm-quota/test/sampleTest.ts new file mode 100644 index 000000000000..d64be981b694 --- /dev/null +++ b/sdk/quota/arm-quota/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/quota/arm-quota/tsconfig.json b/sdk/quota/arm-quota/tsconfig.json index 287d01a5c41f..b35d05ad6e9d 100644 --- a/sdk/quota/arm-quota/tsconfig.json +++ b/sdk/quota/arm-quota/tsconfig.json @@ -9,14 +9,19 @@ "esModuleInterop": true, "allowSyntheticDefaultImports": true, "forceConsistentCasingInFileNames": true, - "lib": ["es6", "dom"], + "lib": [ + "es6", + "dom" + ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-quota": ["./src/index"] - } + "importHelpers": true }, - "include": ["./src/**/*.ts", "./test/**/*.ts", "samples-dev/**/*.ts"], - "exclude": ["node_modules"] -} + "include": [ + "src/**/*.ts", + "test/**/*.ts" + ], + "exclude": [ + "node_modules" + ] +} \ No newline at end of file