diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index f52e8265a995..4b90eaaae54b 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -3252,7 +3252,7 @@ packages: version: 0.0.0 '@rush-temp/arm-quota@file:projects/arm-quota.tgz': - resolution: {integrity: sha512-y7L0hKG1puKuCcNIdu0kivas9EGP6ND2IWgRD1qL7RubTaUCFtXicYUGGt+HdyCBk5TDFJ422ecyA21gXy+gFA==, 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': @@ -14176,17 +14176,17 @@ 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 - ts-node: 10.9.2(@types/node@18.19.68)(typescript@5.7.2) + mocha: 10.8.2 + ts-node: 10.9.2(@types/node@18.19.68)(typescript@5.6.3) tslib: 2.8.1 - typescript: 5.7.2 + tsx: 4.19.2 + typescript: 5.6.3 transitivePeerDependencies: - '@swc/core' - '@swc/wasm' diff --git a/sdk/quota/arm-quota/CHANGELOG.md b/sdk/quota/arm-quota/CHANGELOG.md index 287c997e4172..8bd919d1defa 100644 --- a/sdk/quota/arm-quota/CHANGELOG.md +++ b/sdk/quota/arm-quota/CHANGELOG.md @@ -1,15 +1,136 @@ # Release History - -## 1.1.0-beta.2 (Unreleased) - + +## 1.1.0-beta.2 (2024-12-19) +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 GroupQuotas + - Added operation group GroupQuotaSubscriptionAllocation + - Added operation group GroupQuotaSubscriptionAllocationRequest + - Added operation group GroupQuotaSubscriptionRequests + - Added operation group GroupQuotaSubscriptions + - Added Interface AllocatedQuotaToSubscriptionList + - Added Interface AllocatedToSubscription + - Added Interface ErrorAdditionalInfo + - Added Interface ErrorDetail + - Added Interface ErrorResponse + - Added Interface GroupQuotaDetails + - Added Interface GroupQuotaDetailsName + - Added Interface GroupQuotaLimit + - Added Interface GroupQuotaLimitList + - Added Interface GroupQuotaLimitListProperties + - Added Interface GroupQuotaLimitProperties + - Added Interface GroupQuotaLimitsListOptionalParams + - Added Interface GroupQuotaLimitsRequestGetOptionalParams + - Added Interface GroupQuotaLimitsRequestListNextOptionalParams + - Added Interface GroupQuotaLimitsRequestListOptionalParams + - Added Interface GroupQuotaLimitsRequestUpdateHeaders + - Added Interface GroupQuotaLimitsRequestUpdateOptionalParams + - Added Interface GroupQuotaList + - Added Interface GroupQuotaRequestBase + - Added Interface GroupQuotaRequestBaseProperties + - Added Interface GroupQuotaRequestBasePropertiesName + - Added Interface GroupQuotasCreateOrUpdateHeaders + - Added Interface GroupQuotasCreateOrUpdateOptionalParams + - Added Interface GroupQuotasDeleteHeaders + - Added Interface GroupQuotasDeleteOptionalParams + - Added Interface GroupQuotasEntity + - Added Interface GroupQuotasEntityBase + - Added Interface GroupQuotasEntityBasePatch + - Added Interface GroupQuotasEntityPatch + - Added Interface GroupQuotasEntityPatchProperties + - Added Interface GroupQuotasEntityProperties + - 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 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 SubscriptionQuotaAllocationsProperties + - Added Interface SubscriptionQuotaAllocationsStatusList + - Added Interface SubscriptionQuotaDetails + - Added Interface SubscriptionQuotaDetailsName + - Added Interface SystemData + - Added Type Alias CreatedByType + - Added Type Alias GroupQuotaLimitsListResponse + - Added Type Alias GroupQuotaLimitsRequestGetResponse + - Added Type Alias GroupQuotaLimitsRequestListNextResponse + - Added Type Alias GroupQuotaLimitsRequestListResponse + - Added Type Alias GroupQuotaLimitsRequestUpdateResponse + - 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 RequestState + - Added Enum KnownCreatedByType + - 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 85120969e402..77f523ae376a 100644 --- a/sdk/quota/arm-quota/README.md +++ b/sdk/quota/arm-quota/README.md @@ -6,7 +6,7 @@ Microsoft Azure Quota Resource Provider. This Swagger is for Azure Group Quota u [Source code](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/quota/arm-quota) | [Package (NPM)](https://www.npmjs.com/package/@azure/arm-quota) | -[API reference documentation](https://learn.microsoft.com/javascript/api/@azure/arm-quota?view=azure-node-preview) | +[API reference documentation](https://docs.microsoft.com/javascript/api/@azure/arm-quota?view=azure-node-preview) | [Samples](https://github.com/Azure-Samples/azure-samples-js-management) ## Getting started @@ -44,9 +44,8 @@ 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://learn.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal). +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). ```javascript const { AzureQuotaExtensionAPI } = require("@azure/arm-quota"); @@ -64,8 +63,8 @@ const client = new AzureQuotaExtensionAPI(new DefaultAzureCredential(), subscrip // const client = new AzureQuotaExtensionAPI(credential, subscriptionId); ``` -### JavaScript Bundle +### JavaScript Bundle To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling). ## Key concepts @@ -101,7 +100,7 @@ If you'd like to contribute to this library, please read the [contributing guide ![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-js%2Fsdk%2Fquota%2Farm-quota%2FREADME.png) -[azure_cli]: https://learn.microsoft.com/cli/azure +[azure_cli]: https://docs.microsoft.com/cli/azure [azure_sub]: https://azure.microsoft.com/free/ [azure_sub]: https://azure.microsoft.com/free/ [azure_portal]: https://portal.azure.com diff --git a/sdk/quota/arm-quota/_meta.json b/sdk/quota/arm-quota/_meta.json index 29710fcaeb6f..08533cda9a70 100644 --- a/sdk/quota/arm-quota/_meta.json +++ b/sdk/quota/arm-quota/_meta.json @@ -1,8 +1,8 @@ { - "commit": "c4e661cdf92c8f579574008d0cd11874cc303da0", + "commit": "28d96a06ffbbf34ca7ab64bf6ebc8ff411174cbc", "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 c0e4fa826dfe..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.7.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..2f2f6846aa01 100644 --- a/sdk/quota/arm-quota/review/arm-quota.api.md +++ b/sdk/quota/arm-quota/review/arm-quota.api.md @@ -10,18 +10,6 @@ import { OperationState } from '@azure/core-lro'; import { PagedAsyncIterableIterator } from '@azure/core-paging'; import { SimplePollerLike } from '@azure/core-lro'; -// @public -export interface AdditionalAttributes { - environment?: EnvironmentType; - groupId: GroupingId; -} - -// @public -export interface AdditionalAttributesPatch { - environment?: EnvironmentType; - groupId?: GroupingId; -} - // @public export interface AllocatedQuotaToSubscriptionList { value?: AllocatedToSubscription[]; @@ -46,8 +34,6 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { // (undocumented) groupQuotaLimitsRequest: GroupQuotaLimitsRequest; // (undocumented) - groupQuotaLocationSettings: GroupQuotaLocationSettings; - // (undocumented) groupQuotas: GroupQuotas; // (undocumented) groupQuotaSubscriptionAllocation: GroupQuotaSubscriptionAllocation; @@ -58,8 +44,6 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { // (undocumented) groupQuotaSubscriptions: GroupQuotaSubscriptions; // (undocumented) - groupQuotaUsages: GroupQuotaUsages; - // (undocumented) quota: Quota; // (undocumented) quotaOperation: QuotaOperation; @@ -78,12 +62,6 @@ export interface AzureQuotaExtensionAPIOptionalParams extends coreClient.Service endpoint?: string; } -// @public -export interface BillingAccountId { - // (undocumented) - id?: string; -} - // @public export interface CommonResourceProperties { readonly id?: string; @@ -115,12 +93,6 @@ export interface CurrentUsagesBase { readonly type?: string; } -// @public -export type EnforcementState = string; - -// @public -export type EnvironmentType = string; - // @public export interface ErrorAdditionalInfo { readonly info?: Record; @@ -149,15 +121,6 @@ export interface ExceptionResponse { // @public export function getContinuationToken(page: unknown): string | undefined; -// @public -export interface GroupingId { - groupingIdType?: GroupingIdType; - value?: string; -} - -// @public -export type GroupingIdType = string; - // @public export interface GroupQuotaDetails { readonly allocatedToSubscriptions?: AllocatedQuotaToSubscriptionList; @@ -165,7 +128,7 @@ export interface GroupQuotaDetails { comment?: string; limit?: number; readonly name?: GroupQuotaDetailsName; - region?: string; + resourceName?: string; readonly unit?: string; } @@ -176,36 +139,32 @@ export interface GroupQuotaDetailsName { } // @public -export interface GroupQuotaLimit extends ProxyResource { - properties?: GroupQuotaDetails; +export interface GroupQuotaLimit { + properties?: GroupQuotaLimitProperties; } // @public -export interface GroupQuotaLimitList { - readonly nextLink?: string; - value?: GroupQuotaLimit[]; +export interface GroupQuotaLimitList extends ProxyResource { + // (undocumented) + properties?: GroupQuotaLimitListProperties; } -// @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; +// @public (undocumented) +export interface GroupQuotaLimitListProperties { + readonly nextLink?: string; + readonly provisioningState?: RequestState; + value?: GroupQuotaLimit[]; } // @public -export interface GroupQuotaLimitsGetOptionalParams extends coreClient.OperationOptions { +export interface GroupQuotaLimitProperties extends GroupQuotaDetails { } // @public -export type GroupQuotaLimitsGetResponse = GroupQuotaLimit; - -// @public -export interface GroupQuotaLimitsListNextOptionalParams extends coreClient.OperationOptions { +export interface GroupQuotaLimits { + list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLimitsListOptionalParams): Promise; } -// @public -export type GroupQuotaLimitsListNextResponse = GroupQuotaLimitList; - // @public export interface GroupQuotaLimitsListOptionalParams extends coreClient.OperationOptions { } @@ -215,31 +174,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 +210,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 { @@ -284,71 +224,6 @@ export interface GroupQuotaList { value?: GroupQuotasEntity[]; } -// @public -export interface GroupQuotaLocationSettings { - beginCreateOrUpdate(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLocationSettingsCreateOrUpdateOptionalParams): Promise, GroupQuotaLocationSettingsCreateOrUpdateResponse>>; - beginCreateOrUpdateAndWait(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLocationSettingsCreateOrUpdateOptionalParams): Promise; - beginUpdate(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLocationSettingsUpdateOptionalParams): Promise, GroupQuotaLocationSettingsUpdateResponse>>; - beginUpdateAndWait(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLocationSettingsUpdateOptionalParams): Promise; - get(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaLocationSettingsGetOptionalParams): Promise; - list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, options?: GroupQuotaLocationSettingsListOptionalParams): PagedAsyncIterableIterator; -} - -// @public -export interface GroupQuotaLocationSettingsCreateOrUpdateHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; -} - -// @public -export interface GroupQuotaLocationSettingsCreateOrUpdateOptionalParams extends coreClient.OperationOptions { - locationSettings?: GroupQuotasEnforcementResponse; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type GroupQuotaLocationSettingsCreateOrUpdateResponse = GroupQuotasEnforcementResponse; - -// @public -export interface GroupQuotaLocationSettingsGetOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaLocationSettingsGetResponse = GroupQuotasEnforcementResponse; - -// @public -export interface GroupQuotaLocationSettingsListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaLocationSettingsListNextResponse = GroupQuotasEnforcementListResponse; - -// @public -export interface GroupQuotaLocationSettingsListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaLocationSettingsListResponse = GroupQuotasEnforcementListResponse; - -// @public -export interface GroupQuotaLocationSettingsUpdateHeaders { - azureAsyncOperation?: string; - location?: string; - retryAfter?: number; -} - -// @public -export interface GroupQuotaLocationSettingsUpdateOptionalParams extends coreClient.OperationOptions { - locationSettings?: GroupQuotasEnforcementResponse; - resumeFrom?: string; - updateIntervalInMs?: number; -} - -// @public -export type GroupQuotaLocationSettingsUpdateResponse = GroupQuotasEnforcementResponse; - // @public export interface GroupQuotaRequestBase { // (undocumented) @@ -414,47 +289,34 @@ export interface GroupQuotasDeleteOptionalParams extends coreClient.OperationOpt // @public export type GroupQuotasDeleteResponse = GroupQuotasDeleteHeaders; -// @public -export interface GroupQuotasEnforcementListResponse { - readonly nextLink?: string; - value?: GroupQuotasEnforcementResponse[]; -} - -// @public -export interface GroupQuotasEnforcementResponse extends ProxyResource { - // (undocumented) - properties?: GroupQuotasEnforcementResponseProperties; -} - -// @public (undocumented) -export interface GroupQuotasEnforcementResponseProperties { - enforcementEnabled?: EnforcementState; - readonly faultCode?: string; - readonly provisioningState?: RequestState; -} - // @public export interface GroupQuotasEntity extends ProxyResource { - properties?: GroupQuotasEntityBase; + properties?: GroupQuotasEntityProperties; } // @public export interface GroupQuotasEntityBase { - additionalAttributes?: AdditionalAttributes; displayName?: string; readonly provisioningState?: RequestState; } // @public export interface GroupQuotasEntityBasePatch { - additionalAttributes?: AdditionalAttributesPatch; displayName?: string; readonly provisioningState?: RequestState; } // @public export interface GroupQuotasEntityPatch extends ProxyResource { - properties?: GroupQuotasEntityBasePatch; + properties?: GroupQuotasEntityPatchProperties; +} + +// @public +export interface GroupQuotasEntityPatchProperties extends GroupQuotasEntityBasePatch { +} + +// @public +export interface GroupQuotasEntityProperties extends GroupQuotasEntityBase { } // @public @@ -480,24 +342,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; -} - -// @public -export interface GroupQuotaSubscriptionAllocationGetOptionalParams extends coreClient.OperationOptions { + list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaSubscriptionAllocationListOptionalParams): Promise; } -// @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 +354,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 +395,7 @@ export interface GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams ext } // @public -export type GroupQuotaSubscriptionAllocationRequestUpdateResponse = QuotaAllocationRequestStatus; +export type GroupQuotaSubscriptionAllocationRequestUpdateResponse = SubscriptionQuotaAllocationsList; // @public export interface GroupQuotaSubscriptionId extends ProxyResource { @@ -583,7 +412,7 @@ export interface GroupQuotaSubscriptionIdList { // @public (undocumented) export interface GroupQuotaSubscriptionIdProperties { readonly provisioningState?: RequestState; - readonly subscriptionId?: string; + subscriptionId?: string; } // @public @@ -730,11 +559,6 @@ export interface GroupQuotasUpdateOptionalParams extends coreClient.OperationOpt // @public export type GroupQuotasUpdateResponse = GroupQuotasEntity; -// @public -export interface GroupQuotaUsages { - list(managementGroupId: string, groupQuotaName: string, resourceProviderName: string, location: string, options?: GroupQuotaUsagesListOptionalParams): PagedAsyncIterableIterator; -} - // @public export interface GroupQuotaUsagesBase { limit?: number; @@ -749,20 +573,6 @@ export interface GroupQuotaUsagesBaseName { value?: string; } -// @public -export interface GroupQuotaUsagesListNextOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaUsagesListNextResponse = ResourceUsageList; - -// @public -export interface GroupQuotaUsagesListOptionalParams extends coreClient.OperationOptions { -} - -// @public -export type GroupQuotaUsagesListResponse = ResourceUsageList; - // @public export enum KnownCreatedByType { Application = "Application", @@ -771,25 +581,6 @@ export enum KnownCreatedByType { User = "User" } -// @public -export enum KnownEnforcementState { - Disabled = "Disabled", - Enabled = "Enabled", - NotAvailable = "NotAvailable" -} - -// @public -export enum KnownEnvironmentType { - NonProduction = "NonProduction", - Production = "Production" -} - -// @public -export enum KnownGroupingIdType { - BillingId = "BillingId", - ServiceTreeId = "ServiceTreeId" -} - // @public export enum KnownLimitType { LimitValue = "LimitValue" @@ -1233,16 +1024,27 @@ export interface SubscriptionQuotaAllocationRequestList { } // @public -export interface SubscriptionQuotaAllocations extends ProxyResource { - properties?: SubscriptionQuotaDetails; +export interface SubscriptionQuotaAllocations { + properties?: SubscriptionQuotaAllocationsProperties; } // @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[]; } +// @public +export interface SubscriptionQuotaAllocationsProperties extends SubscriptionQuotaDetails { +} + // @public export interface SubscriptionQuotaAllocationsStatusList { readonly nextLink?: string; @@ -1253,7 +1055,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..1cbe64ea3052 100644 --- a/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts +++ b/sdk/quota/arm-quota/src/azureQuotaExtensionAPI.ts @@ -8,18 +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, - GroupQuotaUsagesImpl, - GroupQuotaLocationSettingsImpl, + GroupQuotaSubscriptionAllocationImpl, UsagesImpl, QuotaImpl, QuotaRequestStatusImpl, @@ -29,12 +31,10 @@ import { GroupQuotas, GroupQuotaSubscriptions, GroupQuotaSubscriptionRequests, - GroupQuotaLimits, GroupQuotaLimitsRequest, - GroupQuotaSubscriptionAllocation, + GroupQuotaLimits, GroupQuotaSubscriptionAllocationRequest, - GroupQuotaUsages, - GroupQuotaLocationSettings, + GroupQuotaSubscriptionAllocation, Usages, Quota, QuotaRequestStatus, @@ -100,7 +100,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 +111,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 +128,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,18 +142,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-12-18-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.groupQuotaUsages = new GroupQuotaUsagesImpl(this); - this.groupQuotaLocationSettings = new GroupQuotaLocationSettingsImpl(this); + this.groupQuotaLimits = new GroupQuotaLimitsImpl(this); + this.groupQuotaSubscriptionAllocationRequest = + new GroupQuotaSubscriptionAllocationRequestImpl(this); + this.groupQuotaSubscriptionAllocation = + new GroupQuotaSubscriptionAllocationImpl(this); this.usages = new UsagesImpl(this); this.quota = new QuotaImpl(this); this.quotaRequestStatus = new QuotaRequestStatusImpl(this); @@ -164,7 +167,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,12 +191,10 @@ export class AzureQuotaExtensionAPI extends coreClient.ServiceClient { groupQuotas: GroupQuotas; groupQuotaSubscriptions: GroupQuotaSubscriptions; groupQuotaSubscriptionRequests: GroupQuotaSubscriptionRequests; - groupQuotaLimits: GroupQuotaLimits; groupQuotaLimitsRequest: GroupQuotaLimitsRequest; - groupQuotaSubscriptionAllocation: GroupQuotaSubscriptionAllocation; + groupQuotaLimits: GroupQuotaLimits; groupQuotaSubscriptionAllocationRequest: GroupQuotaSubscriptionAllocationRequest; - groupQuotaUsages: GroupQuotaUsages; - groupQuotaLocationSettings: GroupQuotaLocationSettings; + groupQuotaSubscriptionAllocation: GroupQuotaSubscriptionAllocation; usages: Usages; quota: Quota; quotaRequestStatus: QuotaRequestStatus; 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..b1fd59f0633e 100644 --- a/sdk/quota/arm-quota/src/models/index.ts +++ b/sdk/quota/arm-quota/src/models/index.ts @@ -14,8 +14,6 @@ export type LimitJsonObjectUnion = LimitJsonObject | LimitObject; export interface GroupQuotasEntityBase { /** Display name of the GroupQuota entity. */ displayName?: string; - /** Additional attributes to filter/restrict the subscriptions, which can be added to the subscriptionIds. */ - additionalAttributes?: AdditionalAttributes; /** * Provisioning state of the operation. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -23,22 +21,6 @@ export interface GroupQuotasEntityBase { readonly provisioningState?: RequestState; } -/** Additional attribute or filter to allow subscriptions meeting the requirements to be part of the GroupQuota. */ -export interface AdditionalAttributes { - /** The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if applicable. */ - groupId: GroupingId; - /** Environment name. */ - environment?: EnvironmentType; -} - -/** The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if applicable. */ -export interface GroupingId { - /** GroupingId type. It is a required property. More types of groupIds can be supported in future. */ - groupingIdType?: GroupingIdType; - /** GroupId value based on the groupingType selected - Billing Id or ServiceTreeId. */ - value?: string; -} - /** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** @@ -140,8 +122,6 @@ export interface ErrorAdditionalInfo { export interface GroupQuotasEntityBasePatch { /** Display name of the GroupQuota entity. */ displayName?: string; - /** Additional attributes to filter/restrict the subscriptions, which can be added to the subscriptionIds. */ - additionalAttributes?: AdditionalAttributesPatch; /** * Provisioning state of the operation. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -149,14 +129,6 @@ export interface GroupQuotasEntityBasePatch { readonly provisioningState?: RequestState; } -/** Additional attribute or filter to allow subscriptions meeting the requirements to be part of the GroupQuota. */ -export interface AdditionalAttributesPatch { - /** The grouping Id for the group quota. It can be Billing Id or ServiceTreeId if applicable. */ - groupId?: GroupingId; - /** Environment name. */ - environment?: EnvironmentType; -} - /** List of Group Quotas at MG level. */ export interface GroupQuotaList { /** List of Group Quotas at MG level. */ @@ -169,11 +141,8 @@ export interface GroupQuotaList { } export interface GroupQuotaSubscriptionIdProperties { - /** - * An Azure subscriptionId. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly subscriptionId?: string; + /** An Azure subscriptionId. */ + subscriptionId?: string; /** * Status of this subscriptionId being associated with the GroupQuotasEntity. * NOTE: This property will not be serialized. It can only be populated by the server. @@ -215,24 +184,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?: GroupQuotaLimitProperties; +} + /** 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 +263,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 +327,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 +342,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?: SubscriptionQuotaAllocationsProperties; +} + /** 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; /** @@ -453,69 +442,6 @@ export interface QuotaAllocationRequestStatusList { readonly nextLink?: string; } -/** List of resource usages and quotas for GroupQuota. */ -export interface ResourceUsageList { - /** List of resource usages at Group Quotas. */ - value?: ResourceUsages[]; - /** - * 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; -} - -/** Resource details with usages and GroupQuota. */ -export interface GroupQuotaUsagesBase { - /** 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. */ - name?: GroupQuotaUsagesBaseName; - /** Quota/limits for the resource. */ - limit?: number; - /** Usages for the resource. */ - usages?: number; - /** - * Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. Based on - https://armwiki.azurewebsites.net/api_contracts/UsagesAPIContract.html?q=usages . Different RPs may have different units, Count, type as int64 should work for most of the integer values. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly unit?: 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. */ -export interface GroupQuotaUsagesBaseName { - /** Resource name. */ - value?: string; - /** - * Resource display name. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly localizedValue?: string; -} - -export interface GroupQuotasEnforcementResponseProperties { - /** Is the GroupQuota Enforcement enabled for the Azure region. */ - enforcementEnabled?: EnforcementState; - /** - * Request status. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly provisioningState?: RequestState; - /** - * Details of the failure. - * NOTE: This property will not be serialized. It can only be populated by the server. - */ - readonly faultCode?: string; -} - -/** List of Azure regions, where the group quotas is enabled for enforcement. */ -export interface GroupQuotasEnforcementListResponse { - /** List of Azure Regions. */ - value?: GroupQuotasEnforcementResponse[]; - /** - * 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; -} - /** Resource usage. */ export interface CurrentUsagesBase { /** @@ -845,9 +771,41 @@ export interface ResourceBaseRequest { readonly unit?: string; } -/** A Billing Account Id. */ -export interface BillingAccountId { - id?: string; +/** List of resource usages and quotas for GroupQuota. */ +export interface ResourceUsageList { + /** List of resource usages at Group Quotas. */ + value?: ResourceUsages[]; + /** + * 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; +} + +/** Resource details with usages and GroupQuota. */ +export interface GroupQuotaUsagesBase { + /** 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. */ + name?: GroupQuotaUsagesBaseName; + /** Quota/limits for the resource. */ + limit?: number; + /** Usages for the resource. */ + usages?: number; + /** + * Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. Based on - https://armwiki.azurewebsites.net/api_contracts/UsagesAPIContract.html?q=usages . Different RPs may have different units, Count, type as int64 should work for most of the integer values. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly unit?: 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. */ +export interface GroupQuotaUsagesBaseName { + /** Resource name. */ + value?: string; + /** + * Resource display name. + * NOTE: This property will not be serialized. It can only be populated by the server. + */ + readonly localizedValue?: string; } /** Resource properties. */ @@ -1029,9 +987,23 @@ export interface QuotaRequestStatusDetails { properties?: Record; } +/** Properties */ +export interface GroupQuotasEntityProperties extends GroupQuotasEntityBase {} + /** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} +/** Properties */ +export interface GroupQuotasEntityPatchProperties + extends GroupQuotasEntityBasePatch {} + +/** Group Quota properties for the specified resource. */ +export interface GroupQuotaLimitProperties extends GroupQuotaDetails {} + +/** Quota properties for the specified resource. */ +export interface SubscriptionQuotaAllocationsProperties + extends SubscriptionQuotaDetails {} + /** The resource quota limit value. */ export interface LimitObject extends LimitJsonObject { /** Polymorphic discriminator, which specifies the different types this object can be */ @@ -1044,8 +1016,8 @@ export interface LimitObject extends LimitJsonObject { /** Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. */ export interface GroupQuotasEntity extends ProxyResource { - /** Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. */ - properties?: GroupQuotasEntityBase; + /** Properties */ + properties?: GroupQuotasEntityProperties; } /** The provisioning state for the operation. */ @@ -1055,8 +1027,8 @@ export interface LROResponse extends ProxyResource { /** Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. */ export interface GroupQuotasEntityPatch extends ProxyResource { - /** Properties and filters for ShareQuota. The request parameter is optional, if there are no filters specified. */ - properties?: GroupQuotasEntityBasePatch; + /** Properties */ + properties?: GroupQuotasEntityPatchProperties; } /** This represents a Azure subscriptionId that is associated with a GroupQuotasEntity. */ @@ -1069,10 +1041,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 +1051,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. */ @@ -1097,11 +1067,6 @@ export interface ResourceUsages extends ProxyResource { properties?: GroupQuotaUsagesBase; } -/** The GroupQuota Enforcement status for a Azure Location/Region. */ -export interface GroupQuotasEnforcementResponse extends ProxyResource { - properties?: GroupQuotasEnforcementResponseProperties; -} - /** Defines headers for GroupQuotas_createOrUpdate operation. */ export interface GroupQuotasCreateOrUpdateHeaders { /** The recommended number of seconds to wait before calling the URI specified in Azure-AsyncOperation. */ @@ -1222,26 +1187,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 +1207,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. */ @@ -1302,46 +1227,6 @@ export interface GroupQuotaSubscriptionAllocationRequestUpdateHeaders { azureAsyncOperation?: string; } -/** Defines headers for GroupQuotaLocationSettings_createOrUpdate operation. */ -export interface GroupQuotaLocationSettingsCreateOrUpdateHeaders { - /** 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 GroupQuotaLocationSettings_update operation. */ -export interface GroupQuotaLocationSettingsUpdateHeaders { - /** 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 Usages_get operation. */ export interface UsagesGetHeaders { /** Current entity state version. Should be treated as opaque and used to make conditional HTTP requests. */ @@ -1378,42 +1263,6 @@ export interface QuotaListNextHeaders { eTag?: string; } -/** Known values of {@link GroupingIdType} that the service accepts. */ -export enum KnownGroupingIdType { - /** ServiceTreeId */ - ServiceTreeId = "ServiceTreeId", - /** BillingId */ - BillingId = "BillingId", -} - -/** - * Defines values for GroupingIdType. \ - * {@link KnownGroupingIdType} can be used interchangeably with GroupingIdType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **ServiceTreeId** \ - * **BillingId** - */ -export type GroupingIdType = string; - -/** Known values of {@link EnvironmentType} that the service accepts. */ -export enum KnownEnvironmentType { - /** NonProduction */ - NonProduction = "NonProduction", - /** Production */ - Production = "Production", -} - -/** - * Defines values for EnvironmentType. \ - * {@link KnownEnvironmentType} can be used interchangeably with EnvironmentType, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **NonProduction** \ - * **Production** - */ -export type EnvironmentType = string; - /** Known values of {@link RequestState} that the service accepts. */ export enum KnownRequestState { /** Accepted */ @@ -1471,27 +1320,6 @@ export enum KnownCreatedByType { */ export type CreatedByType = string; -/** Known values of {@link EnforcementState} that the service accepts. */ -export enum KnownEnforcementState { - /** Enabled */ - Enabled = "Enabled", - /** Disabled */ - Disabled = "Disabled", - /** NotAvailable */ - NotAvailable = "NotAvailable", -} - -/** - * Defines values for EnforcementState. \ - * {@link KnownEnforcementState} can be used interchangeably with EnforcementState, - * this enum contains the known values that the service supports. - * ### Known values supported by the service - * **Enabled** \ - * **Disabled** \ - * **NotAvailable** - */ -export type EnforcementState = string; - /** Known values of {@link UsagesTypes} that the service accepts. */ export enum KnownUsagesTypes { /** Individual */ @@ -1571,7 +1399,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 +1413,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 +1427,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 +1446,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 +1469,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 +1485,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 +1494,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 +1516,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 +1544,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,74 +1555,37 @@ 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 {} - -/** Contains response data for the list operation. */ -export type GroupQuotaLimitsRequestListResponse = SubmittedResourceRequestStatusList; - -/** Optional parameters. */ -export interface GroupQuotaLimitsRequestListNextOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the listNext operation. */ -export type GroupQuotaLimitsRequestListNextResponse = SubmittedResourceRequestStatusList; - -/** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationListOptionalParams +export interface GroupQuotaLimitsRequestListOptionalParams 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 GroupQuotaLimitsRequestListResponse = + SubmittedResourceRequestStatusList; /** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationListNextOptionalParams +export interface GroupQuotaLimitsRequestListNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type GroupQuotaSubscriptionAllocationListNextResponse = SubscriptionQuotaAllocationsList; - -/** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationRequestGetOptionalParams - extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GroupQuotaSubscriptionAllocationRequestGetResponse = QuotaAllocationRequestStatus; +export type GroupQuotaLimitsRequestListNextResponse = + SubmittedResourceRequestStatusList; /** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationRequestListOptionalParams +export interface GroupQuotaLimitsListOptionalParams 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; +export type GroupQuotaLimitsListResponse = GroupQuotaLimitList; /** Optional parameters. */ export interface GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams @@ -1822,74 +1597,40 @@ export interface GroupQuotaSubscriptionAllocationRequestUpdateOptionalParams } /** Contains response data for the update operation. */ -export type GroupQuotaSubscriptionAllocationRequestUpdateResponse = QuotaAllocationRequestStatus; +export type GroupQuotaSubscriptionAllocationRequestUpdateResponse = + SubscriptionQuotaAllocationsList; /** Optional parameters. */ -export interface GroupQuotaSubscriptionAllocationRequestListNextOptionalParams +export interface GroupQuotaSubscriptionAllocationRequestGetOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type GroupQuotaSubscriptionAllocationRequestListNextResponse = - QuotaAllocationRequestStatusList; +/** Contains response data for the get operation. */ +export type GroupQuotaSubscriptionAllocationRequestGetResponse = + QuotaAllocationRequestStatus; /** Optional parameters. */ -export interface GroupQuotaUsagesListOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaSubscriptionAllocationRequestListOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the list operation. */ -export type GroupQuotaUsagesListResponse = ResourceUsageList; +export type GroupQuotaSubscriptionAllocationRequestListResponse = + QuotaAllocationRequestStatusList; /** Optional parameters. */ -export interface GroupQuotaUsagesListNextOptionalParams extends coreClient.OperationOptions {} +export interface GroupQuotaSubscriptionAllocationRequestListNextOptionalParams + extends coreClient.OperationOptions {} /** Contains response data for the listNext operation. */ -export type GroupQuotaUsagesListNextResponse = ResourceUsageList; - -/** Optional parameters. */ -export interface GroupQuotaLocationSettingsCreateOrUpdateOptionalParams - extends coreClient.OperationOptions { - /** The GroupQuota body details for creation or update of a GroupQuota entity. */ - locationSettings?: GroupQuotasEnforcementResponse; - /** 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 GroupQuotaLocationSettingsCreateOrUpdateResponse = GroupQuotasEnforcementResponse; - -/** Optional parameters. */ -export interface GroupQuotaLocationSettingsUpdateOptionalParams - extends coreClient.OperationOptions { - /** The GroupQuota body details for creation or update of a GroupQuota entity. */ - locationSettings?: GroupQuotasEnforcementResponse; - /** 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 GroupQuotaLocationSettingsUpdateResponse = GroupQuotasEnforcementResponse; - -/** Optional parameters. */ -export interface GroupQuotaLocationSettingsGetOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the get operation. */ -export type GroupQuotaLocationSettingsGetResponse = GroupQuotasEnforcementResponse; - -/** Optional parameters. */ -export interface GroupQuotaLocationSettingsListOptionalParams extends coreClient.OperationOptions {} - -/** Contains response data for the list operation. */ -export type GroupQuotaLocationSettingsListResponse = GroupQuotasEnforcementListResponse; +export type GroupQuotaSubscriptionAllocationRequestListNextResponse = + QuotaAllocationRequestStatusList; /** Optional parameters. */ -export interface GroupQuotaLocationSettingsListNextOptionalParams +export interface GroupQuotaSubscriptionAllocationListOptionalParams extends coreClient.OperationOptions {} -/** Contains response data for the listNext operation. */ -export type GroupQuotaLocationSettingsListNextResponse = GroupQuotasEnforcementListResponse; +/** Contains response data for the list operation. */ +export type GroupQuotaSubscriptionAllocationListResponse = + SubscriptionQuotaAllocationsList; /** Optional parameters. */ export interface UsagesGetOptionalParams extends coreClient.OperationOptions {} @@ -1904,7 +1645,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 +1658,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 +1687,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 +1723,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..bd7341f06984 100644 --- a/sdk/quota/arm-quota/src/models/mappers.ts +++ b/sdk/quota/arm-quota/src/models/mappers.ts @@ -19,13 +19,6 @@ export const GroupQuotasEntityBase: coreClient.CompositeMapper = { name: "String", }, }, - additionalAttributes: { - serializedName: "additionalAttributes", - type: { - name: "Composite", - className: "AdditionalAttributes", - }, - }, provisioningState: { serializedName: "provisioningState", readOnly: true, @@ -37,49 +30,6 @@ export const GroupQuotasEntityBase: coreClient.CompositeMapper = { }, }; -export const AdditionalAttributes: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AdditionalAttributes", - modelProperties: { - groupId: { - serializedName: "groupId", - type: { - name: "Composite", - className: "GroupingId", - }, - }, - environment: { - serializedName: "environment", - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GroupingId: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupingId", - modelProperties: { - groupingIdType: { - serializedName: "groupingIdType", - type: { - name: "String", - }, - }, - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - }, - }, -}; - export const Resource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -285,13 +235,6 @@ export const GroupQuotasEntityBasePatch: coreClient.CompositeMapper = { name: "String", }, }, - additionalAttributes: { - serializedName: "additionalAttributes", - type: { - name: "Composite", - className: "AdditionalAttributesPatch", - }, - }, provisioningState: { serializedName: "provisioningState", readOnly: true, @@ -303,28 +246,6 @@ export const GroupQuotasEntityBasePatch: coreClient.CompositeMapper = { }, }; -export const AdditionalAttributesPatch: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "AdditionalAttributesPatch", - modelProperties: { - groupId: { - serializedName: "groupId", - type: { - name: "Composite", - className: "GroupingId", - }, - }, - environment: { - serializedName: "environment", - type: { - name: "String", - }, - }, - }, - }, -}; - export const GroupQuotaList: coreClient.CompositeMapper = { type: { name: "Composite", @@ -360,7 +281,6 @@ export const GroupQuotaSubscriptionIdProperties: coreClient.CompositeMapper = { modelProperties: { subscriptionId: { serializedName: "subscriptionId", - readOnly: true, type: { name: "String", }, @@ -404,11 +324,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 +401,7 @@ export const GroupQuotaSubscriptionRequestStatusList: coreClient.CompositeMapper element: { type: { name: "Composite", - className: "GroupQuotaSubscriptionRequestStatus", + className: "GroupQuotaLimit", }, }, }, @@ -432,28 +417,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: "GroupQuotaLimitProperties", }, }, }, @@ -465,8 +438,8 @@ export const GroupQuotaDetails: coreClient.CompositeMapper = { name: "Composite", className: "GroupQuotaDetails", modelProperties: { - region: { - serializedName: "region", + resourceName: { + serializedName: "resourceName", type: { name: "String", }, @@ -483,13 +456,6 @@ export const GroupQuotaDetails: coreClient.CompositeMapper = { name: "String", }, }, - name: { - serializedName: "name", - type: { - name: "Composite", - className: "GroupQuotaDetailsName", - }, - }, unit: { serializedName: "unit", readOnly: true, @@ -497,6 +463,13 @@ export const GroupQuotaDetails: coreClient.CompositeMapper = { name: "String", }, }, + name: { + serializedName: "name", + type: { + name: "Composite", + className: "GroupQuotaDetailsName", + }, + }, availableLimit: { serializedName: "availableLimit", readOnly: true, @@ -580,70 +553,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 +692,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: "SubscriptionQuotaAllocationsProperties", }, }, }, @@ -779,8 +749,8 @@ export const SubscriptionQuotaDetails: coreClient.CompositeMapper = { name: "Composite", className: "SubscriptionQuotaDetails", modelProperties: { - region: { - serializedName: "region", + resourceName: { + serializedName: "resourceName", type: { name: "String", }, @@ -832,42 +802,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", - }, - }, - requestSubmitTime: { - serializedName: "requestSubmitTime", - readOnly: true, - type: { - name: "DateTime", +export const QuotaAllocationRequestStatusProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "QuotaAllocationRequestStatusProperties", + modelProperties: { + requestedResource: { + serializedName: "requestedResource", + type: { + name: "Composite", + className: "QuotaAllocationRequestBase", + }, }, - }, - provisioningState: { - serializedName: "provisioningState", - readOnly: true, - type: { - name: "String", + requestSubmitTime: { + serializedName: "requestSubmitTime", + readOnly: true, + type: { + name: "DateTime", + }, }, - }, - faultCode: { - serializedName: "faultCode", - readOnly: true, - type: { - name: "String", + provisioningState: { + serializedName: "provisioningState", + readOnly: true, + type: { + name: "String", + }, + }, + faultCode: { + serializedName: "faultCode", + readOnly: true, + type: { + name: "String", + }, }, }, }, - }, -}; + }; export const QuotaAllocationRequestBase: coreClient.CompositeMapper = { type: { @@ -885,56 +856,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", + name: { + serializedName: "name", + type: { + name: "Composite", + className: "QuotaAllocationRequestBasePropertiesName", + }, }, - }, - region: { - serializedName: "region", - type: { - name: "String", + 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: { @@ -964,148 +937,6 @@ export const QuotaAllocationRequestStatusList: coreClient.CompositeMapper = { }, }; -export const ResourceUsageList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "ResourceUsageList", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "ResourceUsages", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GroupQuotaUsagesBase: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaUsagesBase", - modelProperties: { - name: { - serializedName: "name", - type: { - name: "Composite", - className: "GroupQuotaUsagesBaseName", - }, - }, - limit: { - serializedName: "limit", - type: { - name: "Number", - }, - }, - usages: { - serializedName: "usages", - type: { - name: "Number", - }, - }, - unit: { - serializedName: "unit", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GroupQuotaUsagesBaseName: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaUsagesBaseName", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "String", - }, - }, - localizedValue: { - serializedName: "localizedValue", - readOnly: true, - 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", - }, - }, - faultCode: { - serializedName: "faultCode", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - -export const GroupQuotasEnforcementListResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotasEnforcementListResponse", - modelProperties: { - value: { - serializedName: "value", - type: { - name: "Sequence", - element: { - type: { - name: "Composite", - className: "GroupQuotasEnforcementResponse", - }, - }, - }, - }, - nextLink: { - serializedName: "nextLink", - readOnly: true, - type: { - name: "String", - }, - }, - }, - }, -}; - export const CurrentUsagesBase: coreClient.CompositeMapper = { type: { name: "Composite", @@ -1744,33 +1575,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,19 +1625,77 @@ export const SubscriptionGroupQuotaAssignment: coreClient.CompositeMapper = { }, }; -export const SubscriptionQuotaAllocationsStatusList: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "SubscriptionQuotaAllocationsStatusList", - modelProperties: { - value: { - serializedName: "value", - type: { +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", + }, + }, + }, + }, + }; + +export const ResourceBaseRequest: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceBaseRequest", + modelProperties: { + resourceName: { + serializedName: "resourceName", + readOnly: true, + type: { + name: "String", + }, + }, + limit: { + serializedName: "limit", + type: { + name: "Number", + }, + }, + unit: { + serializedName: "unit", + readOnly: true, + type: { + name: "String", + }, + }, + }, + }, +}; + +export const ResourceUsageList: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "ResourceUsageList", + modelProperties: { + value: { + serializedName: "value", + type: { name: "Sequence", element: { type: { name: "Composite", - className: "SubmittedResourceRequestStatus", + className: "ResourceUsages", }, }, }, @@ -1821,16 +1711,16 @@ export const SubscriptionQuotaAllocationsStatusList: coreClient.CompositeMapper }, }; -export const ResourceBaseRequest: coreClient.CompositeMapper = { +export const GroupQuotaUsagesBase: coreClient.CompositeMapper = { type: { name: "Composite", - className: "ResourceBaseRequest", + className: "GroupQuotaUsagesBase", modelProperties: { - resourceName: { - serializedName: "resourceName", - readOnly: true, + name: { + serializedName: "name", type: { - name: "String", + name: "Composite", + className: "GroupQuotaUsagesBaseName", }, }, limit: { @@ -1839,6 +1729,12 @@ export const ResourceBaseRequest: coreClient.CompositeMapper = { name: "Number", }, }, + usages: { + serializedName: "usages", + type: { + name: "Number", + }, + }, unit: { serializedName: "unit", readOnly: true, @@ -1850,13 +1746,20 @@ export const ResourceBaseRequest: coreClient.CompositeMapper = { }, }; -export const BillingAccountId: coreClient.CompositeMapper = { +export const GroupQuotaUsagesBaseName: coreClient.CompositeMapper = { type: { name: "Composite", - className: "BillingAccountId", + className: "GroupQuotaUsagesBaseName", modelProperties: { - id: { - serializedName: "id", + value: { + serializedName: "value", + type: { + name: "String", + }, + }, + localizedValue: { + serializedName: "localizedValue", + readOnly: true, type: { name: "String", }, @@ -1943,42 +1846,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: { @@ -2208,6 +2112,16 @@ export const QuotaRequestStatusDetails: coreClient.CompositeMapper = { }, }; +export const GroupQuotasEntityProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GroupQuotasEntityProperties", + modelProperties: { + ...GroupQuotasEntityBase.type.modelProperties, + }, + }, +}; + export const ProxyResource: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2218,6 +2132,37 @@ export const ProxyResource: coreClient.CompositeMapper = { }, }; +export const GroupQuotasEntityPatchProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GroupQuotasEntityPatchProperties", + modelProperties: { + ...GroupQuotasEntityBasePatch.type.modelProperties, + }, + }, +}; + +export const GroupQuotaLimitProperties: coreClient.CompositeMapper = { + type: { + name: "Composite", + className: "GroupQuotaLimitProperties", + modelProperties: { + ...GroupQuotaDetails.type.modelProperties, + }, + }, +}; + +export const SubscriptionQuotaAllocationsProperties: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "SubscriptionQuotaAllocationsProperties", + modelProperties: { + ...SubscriptionQuotaDetails.type.modelProperties, + }, + }, + }; + export const LimitObject: coreClient.CompositeMapper = { serializedName: "LimitValue", type: { @@ -2254,7 +2199,7 @@ export const GroupQuotasEntity: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "GroupQuotasEntityBase", + className: "GroupQuotasEntityProperties", }, }, }, @@ -2288,7 +2233,7 @@ export const GroupQuotasEntityPatch: coreClient.CompositeMapper = { serializedName: "properties", type: { name: "Composite", - className: "GroupQuotasEntityBasePatch", + className: "GroupQuotasEntityPatchProperties", }, }, }, @@ -2329,17 +2274,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 +2308,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", }, }, }, @@ -2414,23 +2359,6 @@ export const ResourceUsages: coreClient.CompositeMapper = { }, }; -export const GroupQuotasEnforcementResponse: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotasEnforcementResponse", - modelProperties: { - ...ProxyResource.type.modelProperties, - properties: { - serializedName: "properties", - type: { - name: "Composite", - className: "GroupQuotasEnforcementResponseProperties", - }, - }, - }, - }, -}; - export const GroupQuotasCreateOrUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", @@ -2512,146 +2440,39 @@ 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", - }, - }, - location: { - serializedName: "location", - 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", - }, - }, - location: { - serializedName: "location", - 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 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 GroupQuotaSubscriptionAllocationRequestCreateOrUpdateHeaders: coreClient.CompositeMapper = +export const GroupQuotaSubscriptionsUpdateHeaders: coreClient.CompositeMapper = { type: { name: "Composite", - className: "GroupQuotaSubscriptionAllocationRequestCreateOrUpdateHeaders", + className: "GroupQuotaSubscriptionsUpdateHeaders", modelProperties: { retryAfter: { serializedName: "retry-after", @@ -2675,86 +2496,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 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 GroupQuotaLocationSettingsCreateOrUpdateHeaders: coreClient.CompositeMapper = { - type: { - name: "Composite", - className: "GroupQuotaLocationSettingsCreateOrUpdateHeaders", - modelProperties: { - retryAfter: { - serializedName: "retry-after", - type: { - name: "Number", +export const GroupQuotaLimitsRequestUpdateHeaders: coreClient.CompositeMapper = + { + type: { + name: "Composite", + className: "GroupQuotaLimitsRequestUpdateHeaders", + 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 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 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..1f4ebb7ae7cb 100644 --- a/sdk/quota/arm-quota/src/models/parameters.ts +++ b/sdk/quota/arm-quota/src/models/parameters.ts @@ -14,9 +14,8 @@ import { import { GroupQuotasEntity as GroupQuotasEntityMapper, GroupQuotasEntityPatch as GroupQuotasEntityPatchMapper, - SubmittedResourceRequestStatus as SubmittedResourceRequestStatusMapper, - QuotaAllocationRequestStatus as QuotaAllocationRequestStatusMapper, - GroupQuotasEnforcementResponse as GroupQuotasEnforcementResponseMapper, + GroupQuotaLimitList as GroupQuotaLimitListMapper, + SubscriptionQuotaAllocationsList as SubscriptionQuotaAllocationsListMapper, CurrentQuotaLimitBase as CurrentQuotaLimitBaseMapper, } from "../models/mappers"; @@ -95,7 +94,7 @@ export const groupQuotaName: OperationURLParameter = { export const apiVersion: OperationQueryParameter = { parameterPath: "apiVersion", mapper: { - defaultValue: "2023-06-01-preview", + defaultValue: "2024-12-18-preview", isConstant: true, serializedName: "api-version", type: { @@ -143,11 +142,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 deleted file mode 100644 index 7f61552aa44d..000000000000 --- a/sdk/quota/arm-quota/src/operations/groupQuotaLocationSettings.ts +++ /dev/null @@ -1,603 +0,0 @@ -/* - * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { GroupQuotaLocationSettings } 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 { SimplePollerLike, OperationState, createHttpPoller } from "@azure/core-lro"; -import { createLroSpec } from "../lroImpl"; -import { - GroupQuotasEnforcementResponse, - GroupQuotaLocationSettingsListNextOptionalParams, - GroupQuotaLocationSettingsListOptionalParams, - GroupQuotaLocationSettingsListResponse, - GroupQuotaLocationSettingsCreateOrUpdateOptionalParams, - GroupQuotaLocationSettingsCreateOrUpdateResponse, - GroupQuotaLocationSettingsUpdateOptionalParams, - GroupQuotaLocationSettingsUpdateResponse, - GroupQuotaLocationSettingsGetOptionalParams, - GroupQuotaLocationSettingsGetResponse, - GroupQuotaLocationSettingsListNextResponse, -} from "../models"; - -/// -/** Class containing GroupQuotaLocationSettings operations. */ -export class GroupQuotaLocationSettingsImpl implements GroupQuotaLocationSettings { - private readonly client: AzureQuotaExtensionAPI; - - /** - * Initialize a new instance of the class GroupQuotaLocationSettings class. - * @param client Reference to the service client - */ - constructor(client: AzureQuotaExtensionAPI) { - this.client = client; - } - - /** - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * The locations not included in GroupQuota Enforcement will not be listed, the regions in failed - * status with listed as status Failed. - * @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 options The options parameters. - */ - public list( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - options?: GroupQuotaLocationSettingsListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll( - managementGroupId, - groupQuotaName, - resourceProviderName, - 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, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - options?: GroupQuotaLocationSettingsListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GroupQuotaLocationSettingsListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list(managementGroupId, groupQuotaName, resourceProviderName, 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, - options?: GroupQuotaLocationSettingsListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - managementGroupId, - groupQuotaName, - resourceProviderName, - options, - )) { - yield* page; - } - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The - * resource provider will start using the group quotas as the overall quota for the subscriptions - * included in the GroupQuota. The subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is - * used, then submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable - * GroupQuota Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check - * the example - GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - async beginCreateOrUpdate( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GroupQuotaLocationSettingsCreateOrUpdateResponse - > - > { - 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, - location, - options, - }, - spec: createOrUpdateOperationSpec, - }); - const poller = await createHttpPoller< - GroupQuotaLocationSettingsCreateOrUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The - * resource provider will start using the group quotas as the overall quota for the subscriptions - * included in the GroupQuota. The subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is - * used, then submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable - * GroupQuota Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check - * the example - GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - async beginCreateOrUpdateAndWait( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsCreateOrUpdateOptionalParams, - ): Promise { - const poller = await this.beginCreateOrUpdate( - managementGroupId, - groupQuotaName, - resourceProviderName, - location, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The - * resource provider will start using the group quotas as the overall quota for the subscriptions - * included in the GroupQuota. The subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is - * used, then submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable - * GroupQuota Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check - * the example - GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - async beginUpdate( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GroupQuotaLocationSettingsUpdateResponse - > - > { - 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, - location, - options, - }, - spec: updateOperationSpec, - }); - const poller = await createHttpPoller< - GroupQuotaLocationSettingsUpdateResponse, - OperationState - >(lro, { - restoreFrom: options?.resumeFrom, - intervalInMs: options?.updateIntervalInMs, - }); - await poller.poll(); - return poller; - } - - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The - * resource provider will start using the group quotas as the overall quota for the subscriptions - * included in the GroupQuota. The subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is - * used, then submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable - * GroupQuota Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check - * the example - GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - async beginUpdateAndWait( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsUpdateOptionalParams, - ): Promise { - const poller = await this.beginUpdate( - managementGroupId, - groupQuotaName, - resourceProviderName, - location, - options, - ); - return poller.pollUntilDone(); - } - - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where - * GroupQuota enforcement is not enabled will return Not Found. - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - get( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsGetOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - groupQuotaName, - resourceProviderName, - location, - options, - }, - getOperationSpec, - ); - } - - /** - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * The locations not included in GroupQuota Enforcement will not be listed, the regions in failed - * status with listed as status Failed. - * @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 options The options parameters. - */ - private _list( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - options?: GroupQuotaLocationSettingsListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { managementGroupId, groupQuotaName, resourceProviderName, 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?: GroupQuotaLocationSettingsListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - groupQuotaName, - resourceProviderName, - nextLink, - options, - }, - listNextOperationSpec, - ); - } -} -// 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}/locationSettings/{location}", - httpMethod: "PUT", - responses: { - 200: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - 201: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - 202: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - 204: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.locationSettings, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.resourceProviderName, - Parameters.location, - ], - 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}/locationSettings/{location}", - httpMethod: "PATCH", - responses: { - 200: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - 201: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - 202: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - 204: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - requestBody: Parameters.locationSettings, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.resourceProviderName, - Parameters.location, - ], - headerParameters: [Parameters.contentType, Parameters.accept], - mediaType: "json", - serializer, -}; -const getOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings/{location}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GroupQuotasEnforcementResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.resourceProviderName, - Parameters.location, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationSettings", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GroupQuotasEnforcementListResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.resourceProviderName, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.GroupQuotasEnforcementListResponse, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.nextLink, - Parameters.resourceProviderName, - ], - headerParameters: [Parameters.accept], - serializer, -}; 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/groupQuotaUsages.ts b/sdk/quota/arm-quota/src/operations/groupQuotaUsages.ts deleted file mode 100644 index 4ebdf94ee653..000000000000 --- a/sdk/quota/arm-quota/src/operations/groupQuotaUsages.ts +++ /dev/null @@ -1,248 +0,0 @@ -/* - * 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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging"; -import { setContinuationToken } from "../pagingHelper"; -import { GroupQuotaUsages } 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 { - ResourceUsages, - GroupQuotaUsagesListNextOptionalParams, - GroupQuotaUsagesListOptionalParams, - GroupQuotaUsagesListResponse, - GroupQuotaUsagesListNextResponse, -} from "../models"; - -/// -/** Class containing GroupQuotaUsages operations. */ -export class GroupQuotaUsagesImpl implements GroupQuotaUsages { - private readonly client: AzureQuotaExtensionAPI; - - /** - * Initialize a new instance of the class GroupQuotaUsages class. - * @param client Reference to the service client - */ - constructor(client: AzureQuotaExtensionAPI) { - this.client = client; - } - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - public list( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaUsagesListOptionalParams, - ): PagedAsyncIterableIterator { - const iter = this.listPagingAll( - managementGroupId, - groupQuotaName, - resourceProviderName, - location, - 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, - location, - options, - settings, - ); - }, - }; - } - - private async *listPagingPage( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaUsagesListOptionalParams, - settings?: PageSettings, - ): AsyncIterableIterator { - let result: GroupQuotaUsagesListResponse; - let continuationToken = settings?.continuationToken; - if (!continuationToken) { - result = await this._list( - managementGroupId, - groupQuotaName, - resourceProviderName, - location, - options, - ); - let page = result.value || []; - continuationToken = result.nextLink; - setContinuationToken(page, continuationToken); - yield page; - } - while (continuationToken) { - result = await this._listNext( - managementGroupId, - groupQuotaName, - resourceProviderName, - location, - continuationToken, - options, - ); - continuationToken = result.nextLink; - let page = result.value || []; - setContinuationToken(page, continuationToken); - yield page; - } - } - - private async *listPagingAll( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaUsagesListOptionalParams, - ): AsyncIterableIterator { - for await (const page of this.listPagingPage( - managementGroupId, - groupQuotaName, - resourceProviderName, - location, - options, - )) { - yield* page; - } - } - - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - private _list( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaUsagesListOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - groupQuotaName, - resourceProviderName, - 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 location The name of the Azure region. - * @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, - location: string, - nextLink: string, - options?: GroupQuotaUsagesListNextOptionalParams, - ): Promise { - return this.client.sendOperationRequest( - { - managementGroupId, - groupQuotaName, - resourceProviderName, - location, - nextLink, - options, - }, - listNextOperationSpec, - ); - } -} -// Operation Specifications -const serializer = coreClient.createSerializer(Mappers, /* isXml */ false); - -const listOperationSpec: coreClient.OperationSpec = { - path: "/providers/Microsoft.Management/managementGroups/{managementGroupId}/providers/Microsoft.Quota/groupQuotas/{groupQuotaName}/resourceProviders/{resourceProviderName}/locationUsages/{location}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceUsageList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - queryParameters: [Parameters.apiVersion], - urlParameters: [ - Parameters.$host, - Parameters.managementGroupId, - Parameters.groupQuotaName, - Parameters.resourceProviderName, - Parameters.location, - ], - headerParameters: [Parameters.accept], - serializer, -}; -const listNextOperationSpec: coreClient.OperationSpec = { - path: "{nextLink}", - httpMethod: "GET", - responses: { - 200: { - bodyMapper: Mappers.ResourceUsageList, - }, - default: { - bodyMapper: Mappers.ErrorResponse, - }, - }, - 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/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..46cf12e2e6ce 100644 --- a/sdk/quota/arm-quota/src/operations/index.ts +++ b/sdk/quota/arm-quota/src/operations/index.ts @@ -9,12 +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 "./groupQuotaUsages"; -export * from "./groupQuotaLocationSettings"; +export * from "./groupQuotaSubscriptionAllocation"; export * from "./usages"; export * from "./quota"; export * from "./quotaRequestStatus"; 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/groupQuotaLocationSettings.ts b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLocationSettings.ts deleted file mode 100644 index ab41a4527d60..000000000000 --- a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaLocationSettings.ts +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { SimplePollerLike, OperationState } from "@azure/core-lro"; -import { - GroupQuotasEnforcementResponse, - GroupQuotaLocationSettingsListOptionalParams, - GroupQuotaLocationSettingsCreateOrUpdateOptionalParams, - GroupQuotaLocationSettingsCreateOrUpdateResponse, - GroupQuotaLocationSettingsUpdateOptionalParams, - GroupQuotaLocationSettingsUpdateResponse, - GroupQuotaLocationSettingsGetOptionalParams, - GroupQuotaLocationSettingsGetResponse, -} from "../models"; - -/// -/** Interface representing a GroupQuotaLocationSettings. */ -export interface GroupQuotaLocationSettings { - /** - * Returns only the list of the Azure regions settings, where the GroupQuotas enforcement is enabled. - * The locations not included in GroupQuota Enforcement will not be listed, the regions in failed - * status with listed as status Failed. - * @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 options The options parameters. - */ - list( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - options?: GroupQuotaLocationSettingsListOptionalParams, - ): PagedAsyncIterableIterator; - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The - * resource provider will start using the group quotas as the overall quota for the subscriptions - * included in the GroupQuota. The subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is - * used, then submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable - * GroupQuota Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check - * the example - GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - beginCreateOrUpdate( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsCreateOrUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GroupQuotaLocationSettingsCreateOrUpdateResponse - > - >; - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The - * resource provider will start using the group quotas as the overall quota for the subscriptions - * included in the GroupQuota. The subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is - * used, then submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable - * GroupQuota Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check - * the example - GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - beginCreateOrUpdateAndWait( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsCreateOrUpdateOptionalParams, - ): Promise; - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The - * resource provider will start using the group quotas as the overall quota for the subscriptions - * included in the GroupQuota. The subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is - * used, then submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable - * GroupQuota Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check - * the example - GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - beginUpdate( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsUpdateOptionalParams, - ): Promise< - SimplePollerLike< - OperationState, - GroupQuotaLocationSettingsUpdateResponse - > - >; - /** - * Enables the GroupQuotas enforcement for the resource provider and the location specified. The - * resource provider will start using the group quotas as the overall quota for the subscriptions - * included in the GroupQuota. The subscriptions cannot request quota at subscription level. - * The subscriptions share the GroupQuotaLimits assigned to the GroupQuota. If the GroupQuotaLimits is - * used, then submit a groupQuotaLimit request for the specific resource - provider/location/resource. - * Once the GroupQuota Enforcement is enabled then, it cannot be deleted or reverted back. To disable - * GroupQuota Enforcement - - * 1. Remove all the subscriptions from the groupQuota using the delete API for Subscriptions (Check - * the example - GroupQuotaSubscriptions_Delete). - * 2. Ten delete the GroupQuota (Check the example - GroupQuotas_Delete). - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - beginUpdateAndWait( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsUpdateOptionalParams, - ): Promise; - /** - * Gets the GroupQuotas enforcement settings for the ResourceProvider/location. The locations, where - * GroupQuota enforcement is not enabled will return Not Found. - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - get( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaLocationSettingsGetOptionalParams, - ): 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/groupQuotaUsages.ts b/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaUsages.ts deleted file mode 100644 index f962818f2d9b..000000000000 --- a/sdk/quota/arm-quota/src/operationsInterfaces/groupQuotaUsages.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 { PagedAsyncIterableIterator } from "@azure/core-paging"; -import { ResourceUsages, GroupQuotaUsagesListOptionalParams } from "../models"; - -/// -/** Interface representing a GroupQuotaUsages. */ -export interface GroupQuotaUsages { - /** - * Gets the GroupQuotas usages and limits(quota). Location is required paramter. - * @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 location The name of the Azure region. - * @param options The options parameters. - */ - list( - managementGroupId: string, - groupQuotaName: string, - resourceProviderName: string, - location: string, - options?: GroupQuotaUsagesListOptionalParams, - ): PagedAsyncIterableIterator; -} 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..46cf12e2e6ce 100644 --- a/sdk/quota/arm-quota/src/operationsInterfaces/index.ts +++ b/sdk/quota/arm-quota/src/operationsInterfaces/index.ts @@ -9,12 +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 "./groupQuotaUsages"; -export * from "./groupQuotaLocationSettings"; +export * from "./groupQuotaSubscriptionAllocation"; export * from "./usages"; export * from "./quota"; export * from "./quotaRequestStatus"; 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