@azure/arm-quota 1.1.1-alpha.20250619.1 → 1.1.1-alpha.20250718.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/azureQuotaExtensionAPI.js +24 -5
- package/dist/browser/azureQuotaExtensionAPI.js.map +1 -1
- package/dist/browser/lroImpl.js +7 -3
- package/dist/browser/lroImpl.js.map +1 -1
- package/dist/browser/models/mappers.js +72 -28
- package/dist/browser/models/mappers.js.map +1 -1
- package/dist/browser/operations/groupQuotaLimits.js +1 -0
- package/dist/browser/operations/groupQuotaLimits.js.map +1 -1
- package/dist/browser/operations/groupQuotaLimitsRequest.js +34 -46
- package/dist/browser/operations/groupQuotaLimitsRequest.js.map +1 -1
- package/dist/browser/operations/groupQuotaSubscriptionAllocation.js +1 -0
- package/dist/browser/operations/groupQuotaSubscriptionAllocation.js.map +1 -1
- package/dist/browser/operations/groupQuotaSubscriptionAllocationRequest.js +34 -46
- package/dist/browser/operations/groupQuotaSubscriptionAllocationRequest.js.map +1 -1
- package/dist/browser/operations/groupQuotaSubscriptionRequests.js +23 -40
- package/dist/browser/operations/groupQuotaSubscriptionRequests.js.map +1 -1
- package/dist/browser/operations/groupQuotaSubscriptions.js +56 -58
- package/dist/browser/operations/groupQuotaSubscriptions.js.map +1 -1
- package/dist/browser/operations/groupQuotas.js +56 -58
- package/dist/browser/operations/groupQuotas.js.map +1 -1
- package/dist/browser/operations/quota.js +45 -52
- package/dist/browser/operations/quota.js.map +1 -1
- package/dist/browser/operations/quotaOperation.js +23 -40
- package/dist/browser/operations/quotaOperation.js.map +1 -1
- package/dist/browser/operations/quotaRequestStatus.js +23 -40
- package/dist/browser/operations/quotaRequestStatus.js.map +1 -1
- package/dist/browser/operations/usages.js +23 -40
- package/dist/browser/operations/usages.js.map +1 -1
- package/dist/browser/pagingHelper.js +2 -4
- package/dist/browser/pagingHelper.js.map +1 -1
- package/dist/commonjs/azureQuotaExtensionAPI.js +24 -5
- package/dist/commonjs/azureQuotaExtensionAPI.js.map +1 -1
- package/dist/commonjs/lroImpl.js +7 -3
- package/dist/commonjs/lroImpl.js.map +1 -1
- package/dist/commonjs/models/mappers.js +72 -28
- package/dist/commonjs/models/mappers.js.map +1 -1
- package/dist/commonjs/operations/groupQuotaLimits.js +1 -0
- package/dist/commonjs/operations/groupQuotaLimits.js.map +1 -1
- package/dist/commonjs/operations/groupQuotaLimitsRequest.js +34 -45
- package/dist/commonjs/operations/groupQuotaLimitsRequest.js.map +1 -1
- package/dist/commonjs/operations/groupQuotaSubscriptionAllocation.js +1 -0
- package/dist/commonjs/operations/groupQuotaSubscriptionAllocation.js.map +1 -1
- package/dist/commonjs/operations/groupQuotaSubscriptionAllocationRequest.js +34 -45
- package/dist/commonjs/operations/groupQuotaSubscriptionAllocationRequest.js.map +1 -1
- package/dist/commonjs/operations/groupQuotaSubscriptionRequests.js +23 -39
- package/dist/commonjs/operations/groupQuotaSubscriptionRequests.js.map +1 -1
- package/dist/commonjs/operations/groupQuotaSubscriptions.js +56 -57
- package/dist/commonjs/operations/groupQuotaSubscriptions.js.map +1 -1
- package/dist/commonjs/operations/groupQuotas.js +56 -57
- package/dist/commonjs/operations/groupQuotas.js.map +1 -1
- package/dist/commonjs/operations/quota.js +45 -51
- package/dist/commonjs/operations/quota.js.map +1 -1
- package/dist/commonjs/operations/quotaOperation.js +23 -39
- package/dist/commonjs/operations/quotaOperation.js.map +1 -1
- package/dist/commonjs/operations/quotaRequestStatus.js +23 -39
- package/dist/commonjs/operations/quotaRequestStatus.js.map +1 -1
- package/dist/commonjs/operations/usages.js +23 -39
- package/dist/commonjs/operations/usages.js.map +1 -1
- package/dist/commonjs/pagingHelper.js +2 -4
- package/dist/commonjs/pagingHelper.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/azureQuotaExtensionAPI.js +24 -5
- package/dist/esm/azureQuotaExtensionAPI.js.map +1 -1
- package/dist/esm/lroImpl.js +7 -3
- package/dist/esm/lroImpl.js.map +1 -1
- package/dist/esm/models/mappers.js +72 -28
- package/dist/esm/models/mappers.js.map +1 -1
- package/dist/esm/operations/groupQuotaLimits.js +1 -0
- package/dist/esm/operations/groupQuotaLimits.js.map +1 -1
- package/dist/esm/operations/groupQuotaLimitsRequest.js +34 -46
- package/dist/esm/operations/groupQuotaLimitsRequest.js.map +1 -1
- package/dist/esm/operations/groupQuotaSubscriptionAllocation.js +1 -0
- package/dist/esm/operations/groupQuotaSubscriptionAllocation.js.map +1 -1
- package/dist/esm/operations/groupQuotaSubscriptionAllocationRequest.js +34 -46
- package/dist/esm/operations/groupQuotaSubscriptionAllocationRequest.js.map +1 -1
- package/dist/esm/operations/groupQuotaSubscriptionRequests.js +23 -40
- package/dist/esm/operations/groupQuotaSubscriptionRequests.js.map +1 -1
- package/dist/esm/operations/groupQuotaSubscriptions.js +56 -58
- package/dist/esm/operations/groupQuotaSubscriptions.js.map +1 -1
- package/dist/esm/operations/groupQuotas.js +56 -58
- package/dist/esm/operations/groupQuotas.js.map +1 -1
- package/dist/esm/operations/quota.js +45 -52
- package/dist/esm/operations/quota.js.map +1 -1
- package/dist/esm/operations/quotaOperation.js +23 -40
- package/dist/esm/operations/quotaOperation.js.map +1 -1
- package/dist/esm/operations/quotaRequestStatus.js +23 -40
- package/dist/esm/operations/quotaRequestStatus.js.map +1 -1
- package/dist/esm/operations/usages.js +23 -40
- package/dist/esm/operations/usages.js.map +1 -1
- package/dist/esm/pagingHelper.js +2 -4
- package/dist/esm/pagingHelper.js.map +1 -1
- package/dist/react-native/azureQuotaExtensionAPI.js +24 -5
- package/dist/react-native/azureQuotaExtensionAPI.js.map +1 -1
- package/dist/react-native/lroImpl.js +7 -3
- package/dist/react-native/lroImpl.js.map +1 -1
- package/dist/react-native/models/mappers.js +72 -28
- package/dist/react-native/models/mappers.js.map +1 -1
- package/dist/react-native/operations/groupQuotaLimits.js +1 -0
- package/dist/react-native/operations/groupQuotaLimits.js.map +1 -1
- package/dist/react-native/operations/groupQuotaLimitsRequest.js +34 -46
- package/dist/react-native/operations/groupQuotaLimitsRequest.js.map +1 -1
- package/dist/react-native/operations/groupQuotaSubscriptionAllocation.js +1 -0
- package/dist/react-native/operations/groupQuotaSubscriptionAllocation.js.map +1 -1
- package/dist/react-native/operations/groupQuotaSubscriptionAllocationRequest.js +34 -46
- package/dist/react-native/operations/groupQuotaSubscriptionAllocationRequest.js.map +1 -1
- package/dist/react-native/operations/groupQuotaSubscriptionRequests.js +23 -40
- package/dist/react-native/operations/groupQuotaSubscriptionRequests.js.map +1 -1
- package/dist/react-native/operations/groupQuotaSubscriptions.js +56 -58
- package/dist/react-native/operations/groupQuotaSubscriptions.js.map +1 -1
- package/dist/react-native/operations/groupQuotas.js +56 -58
- package/dist/react-native/operations/groupQuotas.js.map +1 -1
- package/dist/react-native/operations/quota.js +45 -52
- package/dist/react-native/operations/quota.js.map +1 -1
- package/dist/react-native/operations/quotaOperation.js +23 -40
- package/dist/react-native/operations/quotaOperation.js.map +1 -1
- package/dist/react-native/operations/quotaRequestStatus.js +23 -40
- package/dist/react-native/operations/quotaRequestStatus.js.map +1 -1
- package/dist/react-native/operations/usages.js +23 -40
- package/dist/react-native/operations/usages.js.map +1 -1
- package/dist/react-native/pagingHelper.js +2 -4
- package/dist/react-native/pagingHelper.js.map +1 -1
- package/package.json +2 -2
- /package/review/{arm-quota.api.md → arm-quota-node.api.md} +0 -0
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
9
8
|
import { setContinuationToken } from "../pagingHelper.js";
|
|
10
9
|
import * as coreClient from "@azure/core-client";
|
|
11
10
|
import * as Mappers from "../models/mappers.js";
|
|
@@ -13,6 +12,7 @@ import * as Parameters from "../models/parameters.js";
|
|
|
13
12
|
/// <reference lib="esnext.asynciterable" />
|
|
14
13
|
/** Class containing QuotaRequestStatus operations. */
|
|
15
14
|
export class QuotaRequestStatusImpl {
|
|
15
|
+
client;
|
|
16
16
|
/**
|
|
17
17
|
* Initialize a new instance of the class QuotaRequestStatus class.
|
|
18
18
|
* @param client Reference to the service client
|
|
@@ -40,52 +40,35 @@ export class QuotaRequestStatusImpl {
|
|
|
40
40
|
return this;
|
|
41
41
|
},
|
|
42
42
|
byPage: (settings) => {
|
|
43
|
-
if (settings
|
|
43
|
+
if (settings?.maxPageSize) {
|
|
44
44
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
45
45
|
}
|
|
46
46
|
return this.listPagingPage(scope, options, settings);
|
|
47
47
|
},
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
listPagingPage(scope, options, settings) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
});
|
|
50
|
+
async *listPagingPage(scope, options, settings) {
|
|
51
|
+
let result;
|
|
52
|
+
let continuationToken = settings?.continuationToken;
|
|
53
|
+
if (!continuationToken) {
|
|
54
|
+
result = await this._list(scope, options);
|
|
55
|
+
let page = result.value || [];
|
|
56
|
+
continuationToken = result.nextLink;
|
|
57
|
+
setContinuationToken(page, continuationToken);
|
|
58
|
+
yield page;
|
|
59
|
+
}
|
|
60
|
+
while (continuationToken) {
|
|
61
|
+
result = await this._listNext(scope, continuationToken, options);
|
|
62
|
+
continuationToken = result.nextLink;
|
|
63
|
+
let page = result.value || [];
|
|
64
|
+
setContinuationToken(page, continuationToken);
|
|
65
|
+
yield page;
|
|
66
|
+
}
|
|
69
67
|
}
|
|
70
|
-
listPagingAll(scope, options) {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
for (var _d = true, _e = __asyncValues(this.listPagingPage(scope, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
75
|
-
_c = _f.value;
|
|
76
|
-
_d = false;
|
|
77
|
-
const page = _c;
|
|
78
|
-
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
82
|
-
finally {
|
|
83
|
-
try {
|
|
84
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
85
|
-
}
|
|
86
|
-
finally { if (e_1) throw e_1.error; }
|
|
87
|
-
}
|
|
88
|
-
});
|
|
68
|
+
async *listPagingAll(scope, options) {
|
|
69
|
+
for await (const page of this.listPagingPage(scope, options)) {
|
|
70
|
+
yield* page;
|
|
71
|
+
}
|
|
89
72
|
}
|
|
90
73
|
/**
|
|
91
74
|
* Get the quota request details and status by quota request ID for the resources of the resource
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quotaRequestStatus.js","sourceRoot":"","sources":["../../../src/operations/quotaRequestStatus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAYtD,4CAA4C;AAC5C,sDAAsD;AACtD,MAAM,OAAO,sBAAsB;IAGjC;;;OAGG;IACH,YAAY,MAA8B;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;OASG;IACI,IAAI,CACT,KAAa,EACb,OAA8C;QAE9C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAA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;SACxC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,EAAE,CAAC;IAClE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,kDAAkD;IACxD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,OAAO;QAClB,UAAU,CAAC,GAAG;QACd,UAAU,CAAC,SAAS;KACrB;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;IACnD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC;IACxE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { QuotaRequestStatus } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { AzureQuotaExtensionAPI } from \"../azureQuotaExtensionAPI.js\";\nimport {\n QuotaRequestDetails,\n QuotaRequestStatusListNextOptionalParams,\n QuotaRequestStatusListOptionalParams,\n QuotaRequestStatusListResponse,\n QuotaRequestStatusGetOptionalParams,\n QuotaRequestStatusGetResponse,\n QuotaRequestStatusListNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing QuotaRequestStatus operations. */\nexport class QuotaRequestStatusImpl implements QuotaRequestStatus {\n private readonly client: AzureQuotaExtensionAPI;\n\n /**\n * Initialize a new instance of the class QuotaRequestStatus class.\n * @param client Reference to the service client\n */\n constructor(client: AzureQuotaExtensionAPI) {\n this.client = client;\n }\n\n /**\n * For the specified scope, get the current quota requests for a one year period ending at the time is\n * made. Use the **oData** filter to select quota requests.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n public list(\n scope: string,\n options?: QuotaRequestStatusListOptionalParams,\n ): PagedAsyncIterableIterator<QuotaRequestDetails> {\n const iter = this.listPagingAll(scope, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listPagingPage(scope, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n scope: string,\n options?: QuotaRequestStatusListOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<QuotaRequestDetails[]> {\n let result: QuotaRequestStatusListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(scope, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listNext(scope, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n scope: string,\n options?: QuotaRequestStatusListOptionalParams,\n ): AsyncIterableIterator<QuotaRequestDetails> {\n for await (const page of this.listPagingPage(scope, options)) {\n yield* page;\n }\n }\n\n /**\n * Get the quota request details and status by quota request ID for the resources of the resource\n * provider at a specific location. The quota request ID **id** is returned in the response of the PUT\n * operation.\n * @param id Quota request ID.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n get(\n id: string,\n scope: string,\n options?: QuotaRequestStatusGetOptionalParams,\n ): Promise<QuotaRequestStatusGetResponse> {\n return this.client.sendOperationRequest(\n { id, scope, options },\n getOperationSpec,\n );\n }\n\n /**\n * For the specified scope, get the current quota requests for a one year period ending at the time is\n * made. Use the **oData** filter to select quota requests.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n private _list(\n scope: string,\n options?: QuotaRequestStatusListOptionalParams,\n ): Promise<QuotaRequestStatusListResponse> {\n return this.client.sendOperationRequest(\n { scope, options },\n listOperationSpec,\n );\n }\n\n /**\n * ListNext\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n scope: string,\n nextLink: string,\n options?: QuotaRequestStatusListNextOptionalParams,\n ): Promise<QuotaRequestStatusListNextResponse> {\n return this.client.sendOperationRequest(\n { scope, nextLink, options },\n listNextOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Quota/quotaRequests/{id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetails,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope, Parameters.id],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Quota/quotaRequests\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetailsList,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.filter1,\n Parameters.top,\n Parameters.skiptoken,\n ],\n urlParameters: [Parameters.$host, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetailsList,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"quotaRequestStatus.js","sourceRoot":"","sources":["../../../src/operations/quotaRequestStatus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAYtD,4CAA4C;AAC5C,sDAAsD;AACtD,MAAM,OAAO,sBAAsB;IAChB,MAAM,CAAyB;IAEhD;;;OAGG;IACH,YAAY,MAA8B;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;OASG;IACI,IAAI,CACT,KAAa,EACb,OAA8C;QAE9C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI,QAAQ,EAAE,WAAW,EAAE,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;YACvD,CAAC;SACF,CAAC;IACJ,CAAC;IAEO,KAAK,CAAC,CAAC,cAAc,CAC3B,KAAa,EACb,OAA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K,EAAE,UAAU,CAAC,KAAK,CAAC;IACnD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC;IACxE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { QuotaRequestStatus } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { AzureQuotaExtensionAPI } from \"../azureQuotaExtensionAPI.js\";\nimport {\n QuotaRequestDetails,\n QuotaRequestStatusListNextOptionalParams,\n QuotaRequestStatusListOptionalParams,\n QuotaRequestStatusListResponse,\n QuotaRequestStatusGetOptionalParams,\n QuotaRequestStatusGetResponse,\n QuotaRequestStatusListNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing QuotaRequestStatus operations. */\nexport class QuotaRequestStatusImpl implements QuotaRequestStatus {\n private readonly client: AzureQuotaExtensionAPI;\n\n /**\n * Initialize a new instance of the class QuotaRequestStatus class.\n * @param client Reference to the service client\n */\n constructor(client: AzureQuotaExtensionAPI) {\n this.client = client;\n }\n\n /**\n * For the specified scope, get the current quota requests for a one year period ending at the time is\n * made. Use the **oData** filter to select quota requests.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n public list(\n scope: string,\n options?: QuotaRequestStatusListOptionalParams,\n ): PagedAsyncIterableIterator<QuotaRequestDetails> {\n const iter = this.listPagingAll(scope, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listPagingPage(scope, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n scope: string,\n options?: QuotaRequestStatusListOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<QuotaRequestDetails[]> {\n let result: QuotaRequestStatusListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(scope, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listNext(scope, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n scope: string,\n options?: QuotaRequestStatusListOptionalParams,\n ): AsyncIterableIterator<QuotaRequestDetails> {\n for await (const page of this.listPagingPage(scope, options)) {\n yield* page;\n }\n }\n\n /**\n * Get the quota request details and status by quota request ID for the resources of the resource\n * provider at a specific location. The quota request ID **id** is returned in the response of the PUT\n * operation.\n * @param id Quota request ID.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n get(\n id: string,\n scope: string,\n options?: QuotaRequestStatusGetOptionalParams,\n ): Promise<QuotaRequestStatusGetResponse> {\n return this.client.sendOperationRequest(\n { id, scope, options },\n getOperationSpec,\n );\n }\n\n /**\n * For the specified scope, get the current quota requests for a one year period ending at the time is\n * made. Use the **oData** filter to select quota requests.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n private _list(\n scope: string,\n options?: QuotaRequestStatusListOptionalParams,\n ): Promise<QuotaRequestStatusListResponse> {\n return this.client.sendOperationRequest(\n { scope, options },\n listOperationSpec,\n );\n }\n\n /**\n * ListNext\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n scope: string,\n nextLink: string,\n options?: QuotaRequestStatusListNextOptionalParams,\n ): Promise<QuotaRequestStatusListNextResponse> {\n return this.client.sendOperationRequest(\n { scope, nextLink, options },\n listNextOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Quota/quotaRequests/{id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetails,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope, Parameters.id],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Quota/quotaRequests\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetailsList,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.filter1,\n Parameters.top,\n Parameters.skiptoken,\n ],\n urlParameters: [Parameters.$host, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetailsList,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
9
8
|
import { setContinuationToken } from "../pagingHelper.js";
|
|
10
9
|
import * as coreClient from "@azure/core-client";
|
|
11
10
|
import * as Mappers from "../models/mappers.js";
|
|
@@ -13,6 +12,7 @@ import * as Parameters from "../models/parameters.js";
|
|
|
13
12
|
/// <reference lib="esnext.asynciterable" />
|
|
14
13
|
/** Class containing Usages operations. */
|
|
15
14
|
export class UsagesImpl {
|
|
15
|
+
client;
|
|
16
16
|
/**
|
|
17
17
|
* Initialize a new instance of the class Usages class.
|
|
18
18
|
* @param client Reference to the service client
|
|
@@ -39,52 +39,35 @@ export class UsagesImpl {
|
|
|
39
39
|
return this;
|
|
40
40
|
},
|
|
41
41
|
byPage: (settings) => {
|
|
42
|
-
if (settings
|
|
42
|
+
if (settings?.maxPageSize) {
|
|
43
43
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
44
44
|
}
|
|
45
45
|
return this.listPagingPage(scope, options, settings);
|
|
46
46
|
},
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
listPagingPage(scope, options, settings) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
});
|
|
49
|
+
async *listPagingPage(scope, options, settings) {
|
|
50
|
+
let result;
|
|
51
|
+
let continuationToken = settings?.continuationToken;
|
|
52
|
+
if (!continuationToken) {
|
|
53
|
+
result = await this._list(scope, options);
|
|
54
|
+
let page = result.value || [];
|
|
55
|
+
continuationToken = result.nextLink;
|
|
56
|
+
setContinuationToken(page, continuationToken);
|
|
57
|
+
yield page;
|
|
58
|
+
}
|
|
59
|
+
while (continuationToken) {
|
|
60
|
+
result = await this._listNext(scope, continuationToken, options);
|
|
61
|
+
continuationToken = result.nextLink;
|
|
62
|
+
let page = result.value || [];
|
|
63
|
+
setContinuationToken(page, continuationToken);
|
|
64
|
+
yield page;
|
|
65
|
+
}
|
|
68
66
|
}
|
|
69
|
-
listPagingAll(scope, options) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
for (var _d = true, _e = __asyncValues(this.listPagingPage(scope, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
74
|
-
_c = _f.value;
|
|
75
|
-
_d = false;
|
|
76
|
-
const page = _c;
|
|
77
|
-
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
81
|
-
finally {
|
|
82
|
-
try {
|
|
83
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
84
|
-
}
|
|
85
|
-
finally { if (e_1) throw e_1.error; }
|
|
86
|
-
}
|
|
87
|
-
});
|
|
67
|
+
async *listPagingAll(scope, options) {
|
|
68
|
+
for await (const page of this.listPagingPage(scope, options)) {
|
|
69
|
+
yield* page;
|
|
70
|
+
}
|
|
88
71
|
}
|
|
89
72
|
/**
|
|
90
73
|
* Get the current usage of a resource.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usages.js","sourceRoot":"","sources":["../../../src/operations/usages.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAYtD,4CAA4C;AAC5C,0CAA0C;AAC1C,MAAM,OAAO,UAAU;IAGrB;;;OAGG;IACH,YAAY,MAA8B;QACxC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;OAQG;IACI,IAAI,CACT,KAAa,EACb,OAAkC;QAElC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAChD,OAAO;YACL,IAAI;gBACF,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;YACrB,CAAC;YACD,CAAC,MAAM,CAAC,aAAa,CAAC;gBACpB,OAAO,IAAI,CAAC;YACd,CAAC;YACD,MAAM,EAAE,CAAC,QAAuB,EAAE,EAAE;gBAClC,IAAI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,CAAC,YAAY,EAAE,UAAU,CAAC,KAAK,CAAC;IAC5E,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,2CAA2C;IACjD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,YAAY;YAChC,aAAa,EAAE,OAAO,CAAC,iBAAiB;SACzC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC;IACnD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,YAAY;YAChC,aAAa,EAAE,OAAO,CAAC,qBAAqB;SAC7C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC;IACxE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { Usages } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { AzureQuotaExtensionAPI } from \"../azureQuotaExtensionAPI.js\";\nimport {\n CurrentUsagesBase,\n UsagesListNextOptionalParams,\n UsagesListOptionalParams,\n UsagesListResponse,\n UsagesGetOptionalParams,\n UsagesGetResponse,\n UsagesListNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Usages operations. */\nexport class UsagesImpl implements Usages {\n private readonly client: AzureQuotaExtensionAPI;\n\n /**\n * Initialize a new instance of the class Usages class.\n * @param client Reference to the service client\n */\n constructor(client: AzureQuotaExtensionAPI) {\n this.client = client;\n }\n\n /**\n * Get a list of current usage for all resources for the scope specified.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n public list(\n scope: string,\n options?: UsagesListOptionalParams,\n ): PagedAsyncIterableIterator<CurrentUsagesBase> {\n const iter = this.listPagingAll(scope, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listPagingPage(scope, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n scope: string,\n options?: UsagesListOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<CurrentUsagesBase[]> {\n let result: UsagesListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(scope, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listNext(scope, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n scope: string,\n options?: UsagesListOptionalParams,\n ): AsyncIterableIterator<CurrentUsagesBase> {\n for await (const page of this.listPagingPage(scope, options)) {\n yield* page;\n }\n }\n\n /**\n * Get the current usage of a resource.\n * @param resourceName Resource name for a given resource provider. For example:\n * - SKU name for Microsoft.Compute\n * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * For Microsoft.Network PublicIPAddresses.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n get(\n resourceName: string,\n scope: string,\n options?: UsagesGetOptionalParams,\n ): Promise<UsagesGetResponse> {\n return this.client.sendOperationRequest(\n { resourceName, scope, options },\n getOperationSpec,\n );\n }\n\n /**\n * Get a list of current usage for all resources for the scope specified.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n private _list(\n scope: string,\n options?: UsagesListOptionalParams,\n ): Promise<UsagesListResponse> {\n return this.client.sendOperationRequest(\n { scope, options },\n listOperationSpec,\n );\n }\n\n /**\n * ListNext\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n scope: string,\n nextLink: string,\n options?: UsagesListNextOptionalParams,\n ): Promise<UsagesListNextResponse> {\n return this.client.sendOperationRequest(\n { scope, nextLink, options },\n listNextOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Quota/usages/{resourceName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CurrentUsagesBase,\n headersMapper: Mappers.UsagesGetHeaders,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.resourceName, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Quota/usages\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsagesLimits,\n headersMapper: Mappers.UsagesListHeaders,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsagesLimits,\n headersMapper: Mappers.UsagesListNextHeaders,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
|
|
1
|
+
{"version":3,"file":"usages.js","sourceRoot":"","sources":["../../../src/operations/usages.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAA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E,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC;IACxE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { Usages } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { AzureQuotaExtensionAPI } from \"../azureQuotaExtensionAPI.js\";\nimport {\n CurrentUsagesBase,\n UsagesListNextOptionalParams,\n UsagesListOptionalParams,\n UsagesListResponse,\n UsagesGetOptionalParams,\n UsagesGetResponse,\n UsagesListNextResponse,\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Usages operations. */\nexport class UsagesImpl implements Usages {\n private readonly client: AzureQuotaExtensionAPI;\n\n /**\n * Initialize a new instance of the class Usages class.\n * @param client Reference to the service client\n */\n constructor(client: AzureQuotaExtensionAPI) {\n this.client = client;\n }\n\n /**\n * Get a list of current usage for all resources for the scope specified.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n public list(\n scope: string,\n options?: UsagesListOptionalParams,\n ): PagedAsyncIterableIterator<CurrentUsagesBase> {\n const iter = this.listPagingAll(scope, options);\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings?: PageSettings) => {\n if (settings?.maxPageSize) {\n throw new Error(\"maxPageSize is not supported by this operation.\");\n }\n return this.listPagingPage(scope, options, settings);\n },\n };\n }\n\n private async *listPagingPage(\n scope: string,\n options?: UsagesListOptionalParams,\n settings?: PageSettings,\n ): AsyncIterableIterator<CurrentUsagesBase[]> {\n let result: UsagesListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(scope, options);\n let page = result.value || [];\n continuationToken = result.nextLink;\n setContinuationToken(page, continuationToken);\n yield page;\n }\n while (continuationToken) {\n result = await this._listNext(scope, continuationToken, options);\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n scope: string,\n options?: UsagesListOptionalParams,\n ): AsyncIterableIterator<CurrentUsagesBase> {\n for await (const page of this.listPagingPage(scope, options)) {\n yield* page;\n }\n }\n\n /**\n * Get the current usage of a resource.\n * @param resourceName Resource name for a given resource provider. For example:\n * - SKU name for Microsoft.Compute\n * - SKU or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * For Microsoft.Network PublicIPAddresses.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n get(\n resourceName: string,\n scope: string,\n options?: UsagesGetOptionalParams,\n ): Promise<UsagesGetResponse> {\n return this.client.sendOperationRequest(\n { resourceName, scope, options },\n getOperationSpec,\n );\n }\n\n /**\n * Get a list of current usage for all resources for the scope specified.\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param options The options parameters.\n */\n private _list(\n scope: string,\n options?: UsagesListOptionalParams,\n ): Promise<UsagesListResponse> {\n return this.client.sendOperationRequest(\n { scope, options },\n listOperationSpec,\n );\n }\n\n /**\n * ListNext\n * @param scope The target Azure resource URI. For example,\n * `/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/qms-test/providers/Microsoft.Batch/batchAccounts/testAccount/`.\n * This is the target Azure resource URI for the List GET operation. If a `{resourceName}` is added\n * after `/quotas`, then it's the target Azure resource URI in the GET operation for the specific\n * resource.\n * @param nextLink The nextLink from the previous successful call to the List method.\n * @param options The options parameters.\n */\n private _listNext(\n scope: string,\n nextLink: string,\n options?: UsagesListNextOptionalParams,\n ): Promise<UsagesListNextResponse> {\n return this.client.sendOperationRequest(\n { scope, nextLink, options },\n listNextOperationSpec,\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Quota/usages/{resourceName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CurrentUsagesBase,\n headersMapper: Mappers.UsagesGetHeaders,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.resourceName, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.Quota/usages\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsagesLimits,\n headersMapper: Mappers.UsagesListHeaders,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.UsagesLimits,\n headersMapper: Mappers.UsagesListNextHeaders,\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse,\n },\n },\n urlParameters: [Parameters.$host, Parameters.nextLink, Parameters.scope],\n headerParameters: [Parameters.accept],\n serializer,\n};\n"]}
|
|
@@ -14,18 +14,16 @@ const pageMap = new WeakMap();
|
|
|
14
14
|
* @returns The continuation token that can be passed into byPage() during future calls.
|
|
15
15
|
*/
|
|
16
16
|
export function getContinuationToken(page) {
|
|
17
|
-
var _a;
|
|
18
17
|
if (typeof page !== "object" || page === null) {
|
|
19
18
|
return undefined;
|
|
20
19
|
}
|
|
21
|
-
return
|
|
20
|
+
return pageMap.get(page)?.continuationToken;
|
|
22
21
|
}
|
|
23
22
|
export function setContinuationToken(page, continuationToken) {
|
|
24
|
-
var _a;
|
|
25
23
|
if (typeof page !== "object" || page === null || !continuationToken) {
|
|
26
24
|
return;
|
|
27
25
|
}
|
|
28
|
-
const pageInfo =
|
|
26
|
+
const pageInfo = pageMap.get(page) ?? {};
|
|
29
27
|
pageInfo.continuationToken = continuationToken;
|
|
30
28
|
pageMap.set(page, pageInfo);
|
|
31
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa
|
|
1
|
+
{"version":3,"file":"pagingHelper.js","sourceRoot":"","sources":["../../src/pagingHelper.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH,MAAM,OAAO,GAAG,IAAI,OAAO,EAAoB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAAa;IAChD,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAC9C,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAC;AAC9C,CAAC;AAED,MAAM,UAAU,oBAAoB,CAClC,IAAa,EACb,iBAAqC;IAErC,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,KAAK,IAAI,IAAI,CAAC,iBAAiB,EAAE,CAAC;QACpE,OAAO;IACT,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IACzC,QAAQ,CAAC,iBAAiB,GAAG,iBAAiB,CAAC;IAC/C,OAAO,CAAC,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;AAC9B,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport interface PageInfo {\n continuationToken?: string;\n}\n\nconst pageMap = new WeakMap<object, PageInfo>();\n\n/**\n * Given the last `.value` produced by the `byPage` iterator,\n * returns a continuation token that can be used to begin paging from\n * that point later.\n * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.\n * @returns The continuation token that can be passed into byPage() during future calls.\n */\nexport function getContinuationToken(page: unknown): string | undefined {\n if (typeof page !== \"object\" || page === null) {\n return undefined;\n }\n return pageMap.get(page)?.continuationToken;\n}\n\nexport function setContinuationToken(\n page: unknown,\n continuationToken: string | undefined,\n): void {\n if (typeof page !== \"object\" || page === null || !continuationToken) {\n return;\n }\n const pageInfo = pageMap.get(page) ?? {};\n pageInfo.continuationToken = continuationToken;\n pageMap.set(page, pageInfo);\n}\n"]}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"sdk-type": "mgmt",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "A generated SDK for AzureQuotaExtensionAPI.",
|
|
6
|
-
"version": "1.1.1-alpha.
|
|
6
|
+
"version": "1.1.1-alpha.20250718.2",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20.0.0"
|
|
9
9
|
},
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
},
|
|
93
93
|
"type": "module",
|
|
94
94
|
"tshy": {
|
|
95
|
-
"project": "
|
|
95
|
+
"project": "../../../tsconfig.src.build.json",
|
|
96
96
|
"exports": {
|
|
97
97
|
"./package.json": "./package.json",
|
|
98
98
|
".": "./src/index.ts"
|
|
File without changes
|