@azure/arm-reservations 9.0.1-alpha.20250718.1 → 9.0.1-alpha.20250721.1

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.
Files changed (107) hide show
  1. package/dist/browser/azureReservationAPI.js +42 -45
  2. package/dist/browser/azureReservationAPI.js.map +1 -1
  3. package/dist/browser/lroImpl.js +7 -3
  4. package/dist/browser/lroImpl.js.map +1 -1
  5. package/dist/browser/models/mappers.js +21 -9
  6. package/dist/browser/models/mappers.js.map +1 -1
  7. package/dist/browser/operations/calculateExchange.js +12 -6
  8. package/dist/browser/operations/calculateExchange.js.map +1 -1
  9. package/dist/browser/operations/calculateRefund.js +1 -0
  10. package/dist/browser/operations/calculateRefund.js.map +1 -1
  11. package/dist/browser/operations/exchange.js +12 -6
  12. package/dist/browser/operations/exchange.js.map +1 -1
  13. package/dist/browser/operations/operation.js +23 -40
  14. package/dist/browser/operations/operation.js.map +1 -1
  15. package/dist/browser/operations/quota.js +45 -52
  16. package/dist/browser/operations/quota.js.map +1 -1
  17. package/dist/browser/operations/quotaRequestStatus.js +23 -40
  18. package/dist/browser/operations/quotaRequestStatus.js.map +1 -1
  19. package/dist/browser/operations/reservation.js +111 -142
  20. package/dist/browser/operations/reservation.js.map +1 -1
  21. package/dist/browser/operations/reservationOrder.js +34 -46
  22. package/dist/browser/operations/reservationOrder.js.map +1 -1
  23. package/dist/browser/operations/return.js +12 -6
  24. package/dist/browser/operations/return.js.map +1 -1
  25. package/dist/browser/pagingHelper.js +2 -4
  26. package/dist/browser/pagingHelper.js.map +1 -1
  27. package/dist/commonjs/azureReservationAPI.js +42 -44
  28. package/dist/commonjs/azureReservationAPI.js.map +1 -1
  29. package/dist/commonjs/lroImpl.js +7 -3
  30. package/dist/commonjs/lroImpl.js.map +1 -1
  31. package/dist/commonjs/models/mappers.js +21 -9
  32. package/dist/commonjs/models/mappers.js.map +1 -1
  33. package/dist/commonjs/operations/calculateExchange.js +12 -6
  34. package/dist/commonjs/operations/calculateExchange.js.map +1 -1
  35. package/dist/commonjs/operations/calculateRefund.js +1 -0
  36. package/dist/commonjs/operations/calculateRefund.js.map +1 -1
  37. package/dist/commonjs/operations/exchange.js +12 -6
  38. package/dist/commonjs/operations/exchange.js.map +1 -1
  39. package/dist/commonjs/operations/operation.js +23 -39
  40. package/dist/commonjs/operations/operation.js.map +1 -1
  41. package/dist/commonjs/operations/quota.js +45 -51
  42. package/dist/commonjs/operations/quota.js.map +1 -1
  43. package/dist/commonjs/operations/quotaRequestStatus.js +23 -39
  44. package/dist/commonjs/operations/quotaRequestStatus.js.map +1 -1
  45. package/dist/commonjs/operations/reservation.js +111 -141
  46. package/dist/commonjs/operations/reservation.js.map +1 -1
  47. package/dist/commonjs/operations/reservationOrder.js +34 -45
  48. package/dist/commonjs/operations/reservationOrder.js.map +1 -1
  49. package/dist/commonjs/operations/return.js +12 -6
  50. package/dist/commonjs/operations/return.js.map +1 -1
  51. package/dist/commonjs/pagingHelper.js +2 -4
  52. package/dist/commonjs/pagingHelper.js.map +1 -1
  53. package/dist/commonjs/tsdoc-metadata.json +11 -11
  54. package/dist/esm/azureReservationAPI.js +42 -45
  55. package/dist/esm/azureReservationAPI.js.map +1 -1
  56. package/dist/esm/lroImpl.js +7 -3
  57. package/dist/esm/lroImpl.js.map +1 -1
  58. package/dist/esm/models/mappers.js +21 -9
  59. package/dist/esm/models/mappers.js.map +1 -1
  60. package/dist/esm/operations/calculateExchange.js +12 -6
  61. package/dist/esm/operations/calculateExchange.js.map +1 -1
  62. package/dist/esm/operations/calculateRefund.js +1 -0
  63. package/dist/esm/operations/calculateRefund.js.map +1 -1
  64. package/dist/esm/operations/exchange.js +12 -6
  65. package/dist/esm/operations/exchange.js.map +1 -1
  66. package/dist/esm/operations/operation.js +23 -40
  67. package/dist/esm/operations/operation.js.map +1 -1
  68. package/dist/esm/operations/quota.js +45 -52
  69. package/dist/esm/operations/quota.js.map +1 -1
  70. package/dist/esm/operations/quotaRequestStatus.js +23 -40
  71. package/dist/esm/operations/quotaRequestStatus.js.map +1 -1
  72. package/dist/esm/operations/reservation.js +111 -142
  73. package/dist/esm/operations/reservation.js.map +1 -1
  74. package/dist/esm/operations/reservationOrder.js +34 -46
  75. package/dist/esm/operations/reservationOrder.js.map +1 -1
  76. package/dist/esm/operations/return.js +12 -6
  77. package/dist/esm/operations/return.js.map +1 -1
  78. package/dist/esm/pagingHelper.js +2 -4
  79. package/dist/esm/pagingHelper.js.map +1 -1
  80. package/dist/react-native/azureReservationAPI.js +42 -45
  81. package/dist/react-native/azureReservationAPI.js.map +1 -1
  82. package/dist/react-native/lroImpl.js +7 -3
  83. package/dist/react-native/lroImpl.js.map +1 -1
  84. package/dist/react-native/models/mappers.js +21 -9
  85. package/dist/react-native/models/mappers.js.map +1 -1
  86. package/dist/react-native/operations/calculateExchange.js +12 -6
  87. package/dist/react-native/operations/calculateExchange.js.map +1 -1
  88. package/dist/react-native/operations/calculateRefund.js +1 -0
  89. package/dist/react-native/operations/calculateRefund.js.map +1 -1
  90. package/dist/react-native/operations/exchange.js +12 -6
  91. package/dist/react-native/operations/exchange.js.map +1 -1
  92. package/dist/react-native/operations/operation.js +23 -40
  93. package/dist/react-native/operations/operation.js.map +1 -1
  94. package/dist/react-native/operations/quota.js +45 -52
  95. package/dist/react-native/operations/quota.js.map +1 -1
  96. package/dist/react-native/operations/quotaRequestStatus.js +23 -40
  97. package/dist/react-native/operations/quotaRequestStatus.js.map +1 -1
  98. package/dist/react-native/operations/reservation.js +111 -142
  99. package/dist/react-native/operations/reservation.js.map +1 -1
  100. package/dist/react-native/operations/reservationOrder.js +34 -46
  101. package/dist/react-native/operations/reservationOrder.js.map +1 -1
  102. package/dist/react-native/operations/return.js +12 -6
  103. package/dist/react-native/operations/return.js.map +1 -1
  104. package/dist/react-native/pagingHelper.js +2 -4
  105. package/dist/react-native/pagingHelper.js.map +1 -1
  106. package/package.json +2 -2
  107. package/review/arm-reservations-node.api.md +1675 -1675
@@ -16,6 +16,7 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
16
16
  /// <reference lib="esnext.asynciterable" />
17
17
  /** Class containing QuotaRequestStatus operations. */
18
18
  class QuotaRequestStatusImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class QuotaRequestStatus class.
21
22
  * @param client Reference to the service client
@@ -41,52 +42,35 @@ class QuotaRequestStatusImpl {
41
42
  return this;
42
43
  },
43
44
  byPage: (settings) => {
44
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
45
+ if (settings?.maxPageSize) {
45
46
  throw new Error("maxPageSize is not supported by this operation.");
46
47
  }
47
48
  return this.listPagingPage(subscriptionId, providerId, location, options, settings);
48
49
  }
49
50
  };
50
51
  }
51
- listPagingPage(subscriptionId, providerId, location, options, settings) {
52
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
53
- let result;
54
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
55
- if (!continuationToken) {
56
- result = yield tslib_1.__await(this._list(subscriptionId, providerId, location, options));
57
- let page = result.value || [];
58
- continuationToken = result.nextLink;
59
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
60
- yield yield tslib_1.__await(page);
61
- }
62
- while (continuationToken) {
63
- result = yield tslib_1.__await(this._listNext(subscriptionId, providerId, location, continuationToken, options));
64
- continuationToken = result.nextLink;
65
- let page = result.value || [];
66
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
67
- yield yield tslib_1.__await(page);
68
- }
69
- });
52
+ async *listPagingPage(subscriptionId, providerId, location, options, settings) {
53
+ let result;
54
+ let continuationToken = settings?.continuationToken;
55
+ if (!continuationToken) {
56
+ result = await this._list(subscriptionId, providerId, location, options);
57
+ let page = result.value || [];
58
+ continuationToken = result.nextLink;
59
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
60
+ yield page;
61
+ }
62
+ while (continuationToken) {
63
+ result = await this._listNext(subscriptionId, providerId, location, continuationToken, options);
64
+ continuationToken = result.nextLink;
65
+ let page = result.value || [];
66
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
67
+ yield page;
68
+ }
70
69
  }
71
- listPagingAll(subscriptionId, providerId, location, options) {
72
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
73
- var _a, e_1, _b, _c;
74
- try {
75
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPagingPage(subscriptionId, providerId, location, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
76
- _c = _f.value;
77
- _d = false;
78
- const page = _c;
79
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
80
- }
81
- }
82
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
83
- finally {
84
- try {
85
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
86
- }
87
- finally { if (e_1) throw e_1.error; }
88
- }
89
- });
70
+ async *listPagingAll(subscriptionId, providerId, location, options) {
71
+ for await (const page of this.listPagingPage(subscriptionId, providerId, location, options)) {
72
+ yield* page;
73
+ }
90
74
  }
91
75
  /**
92
76
  * For the specified Azure region (location), get the details and status of the quota request by the
@@ -1 +1 @@
1
- {"version":3,"file":"quotaRequestStatus.js","sourceRoot":"","sources":["../../../src/operations/quotaRequestStatus.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAYtD,4CAA4C;AAC5C,sDAAsD;AACtD,MAAa,sBAAsB;IAGjC;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACI,IAAI,CACT,cAAsB,EACtB,UAAkB,EAClB,QAAgB,EAChB,OAA8C;QAE9C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAC7B,cAAc,EACd,UAAU,EACV,QAAQ,EACR,OAAO,C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E,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;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;KACrB;IACD,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 { AzureReservationAPI } from \"../azureReservationAPI.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: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class QuotaRequestStatus class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * For the specified Azure region (location), subscription, and resource provider, get the history of\n * the quota requests for the past year. To select specific quota requests, use the oData filter.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param options The options parameters.\n */\n public list(\n subscriptionId: string,\n providerId: string,\n location: string,\n options?: QuotaRequestStatusListOptionalParams\n ): PagedAsyncIterableIterator<QuotaRequestDetails> {\n const iter = this.listPagingAll(\n subscriptionId,\n providerId,\n location,\n options\n );\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(\n subscriptionId,\n providerId,\n location,\n options,\n settings\n );\n }\n };\n }\n\n private async *listPagingPage(\n subscriptionId: string,\n providerId: string,\n location: 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(subscriptionId, providerId, location, 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(\n subscriptionId,\n providerId,\n location,\n continuationToken,\n options\n );\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n subscriptionId: string,\n providerId: string,\n location: string,\n options?: QuotaRequestStatusListOptionalParams\n ): AsyncIterableIterator<QuotaRequestDetails> {\n for await (const page of this.listPagingPage(\n subscriptionId,\n providerId,\n location,\n options\n )) {\n yield* page;\n }\n }\n\n /**\n * For the specified Azure region (location), get the details and status of the quota request by the\n * quota request ID for the resources of the resource provider. The PUT request for the quota (service\n * limit) returns a response with the requestId parameter.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param id Quota Request ID.\n * @param options The options parameters.\n */\n get(\n subscriptionId: string,\n providerId: string,\n location: string,\n id: string,\n options?: QuotaRequestStatusGetOptionalParams\n ): Promise<QuotaRequestStatusGetResponse> {\n return this.client.sendOperationRequest(\n { subscriptionId, providerId, location, id, options },\n getOperationSpec\n );\n }\n\n /**\n * For the specified Azure region (location), subscription, and resource provider, get the history of\n * the quota requests for the past year. To select specific quota requests, use the oData filter.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param options The options parameters.\n */\n private _list(\n subscriptionId: string,\n providerId: string,\n location: string,\n options?: QuotaRequestStatusListOptionalParams\n ): Promise<QuotaRequestStatusListResponse> {\n return this.client.sendOperationRequest(\n { subscriptionId, providerId, location, options },\n listOperationSpec\n );\n }\n\n /**\n * ListNext\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\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 subscriptionId: string,\n providerId: string,\n location: string,\n nextLink: string,\n options?: QuotaRequestStatusListNextOptionalParams\n ): Promise<QuotaRequestStatusListNextResponse> {\n return this.client.sendOperationRequest(\n { subscriptionId, providerId, location, nextLink, options },\n listNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetails\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse\n }\n },\n queryParameters: [Parameters.apiVersion1],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1,\n Parameters.id\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetailsList\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse\n }\n },\n queryParameters: [\n Parameters.filter,\n Parameters.apiVersion1,\n Parameters.top,\n Parameters.skiptoken1\n ],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1\n ],\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: [\n Parameters.$host,\n Parameters.nextLink,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1\n ],\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,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAYtD,4CAA4C;AAC5C,sDAAsD;AACtD,MAAa,sBAAsB;IAChB,MAAM,CAAsB;IAE7C;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACI,IAAI,CACT,cAAsB,EACtB,UAAkB,EAClB,QAAgB,EAChB,OAA8C;QAE9C,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAC7B,cAAc,EACd,UAAU,EACV,QAAQ,EACR,OAAO,CACR,CAAC;QACF,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,M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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 { AzureReservationAPI } from \"../azureReservationAPI.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: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class QuotaRequestStatus class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * For the specified Azure region (location), subscription, and resource provider, get the history of\n * the quota requests for the past year. To select specific quota requests, use the oData filter.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param options The options parameters.\n */\n public list(\n subscriptionId: string,\n providerId: string,\n location: string,\n options?: QuotaRequestStatusListOptionalParams\n ): PagedAsyncIterableIterator<QuotaRequestDetails> {\n const iter = this.listPagingAll(\n subscriptionId,\n providerId,\n location,\n options\n );\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(\n subscriptionId,\n providerId,\n location,\n options,\n settings\n );\n }\n };\n }\n\n private async *listPagingPage(\n subscriptionId: string,\n providerId: string,\n location: 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(subscriptionId, providerId, location, 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(\n subscriptionId,\n providerId,\n location,\n continuationToken,\n options\n );\n continuationToken = result.nextLink;\n let page = result.value || [];\n setContinuationToken(page, continuationToken);\n yield page;\n }\n }\n\n private async *listPagingAll(\n subscriptionId: string,\n providerId: string,\n location: string,\n options?: QuotaRequestStatusListOptionalParams\n ): AsyncIterableIterator<QuotaRequestDetails> {\n for await (const page of this.listPagingPage(\n subscriptionId,\n providerId,\n location,\n options\n )) {\n yield* page;\n }\n }\n\n /**\n * For the specified Azure region (location), get the details and status of the quota request by the\n * quota request ID for the resources of the resource provider. The PUT request for the quota (service\n * limit) returns a response with the requestId parameter.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param id Quota Request ID.\n * @param options The options parameters.\n */\n get(\n subscriptionId: string,\n providerId: string,\n location: string,\n id: string,\n options?: QuotaRequestStatusGetOptionalParams\n ): Promise<QuotaRequestStatusGetResponse> {\n return this.client.sendOperationRequest(\n { subscriptionId, providerId, location, id, options },\n getOperationSpec\n );\n }\n\n /**\n * For the specified Azure region (location), subscription, and resource provider, get the history of\n * the quota requests for the past year. To select specific quota requests, use the oData filter.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param options The options parameters.\n */\n private _list(\n subscriptionId: string,\n providerId: string,\n location: string,\n options?: QuotaRequestStatusListOptionalParams\n ): Promise<QuotaRequestStatusListResponse> {\n return this.client.sendOperationRequest(\n { subscriptionId, providerId, location, options },\n listOperationSpec\n );\n }\n\n /**\n * ListNext\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\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 subscriptionId: string,\n providerId: string,\n location: string,\n nextLink: string,\n options?: QuotaRequestStatusListNextOptionalParams\n ): Promise<QuotaRequestStatusListNextResponse> {\n return this.client.sendOperationRequest(\n { subscriptionId, providerId, location, nextLink, options },\n listNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests/{id}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetails\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse\n }\n },\n queryParameters: [Parameters.apiVersion1],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1,\n Parameters.id\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimitsRequests\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaRequestDetailsList\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse\n }\n },\n queryParameters: [\n Parameters.filter,\n Parameters.apiVersion1,\n Parameters.top,\n Parameters.skiptoken1\n ],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1\n ],\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: [\n Parameters.$host,\n Parameters.nextLink,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -18,6 +18,7 @@ const lroImpl_js_1 = require("../lroImpl.js");
18
18
  /// <reference lib="esnext.asynciterable" />
19
19
  /** Class containing Reservation operations. */
20
20
  class ReservationImpl {
21
+ client;
21
22
  /**
22
23
  * Initialize a new instance of the class Reservation class.
23
24
  * @param client Reference to the service client
@@ -40,52 +41,35 @@ class ReservationImpl {
40
41
  return this;
41
42
  },
42
43
  byPage: (settings) => {
43
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
44
+ if (settings?.maxPageSize) {
44
45
  throw new Error("maxPageSize is not supported by this operation.");
45
46
  }
46
47
  return this.listPagingPage(reservationOrderId, options, settings);
47
48
  }
48
49
  };
49
50
  }
50
- listPagingPage(reservationOrderId, options, settings) {
51
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
52
- let result;
53
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
54
- if (!continuationToken) {
55
- result = yield tslib_1.__await(this._list(reservationOrderId, options));
56
- let page = result.value || [];
57
- continuationToken = result.nextLink;
58
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
59
- yield yield tslib_1.__await(page);
60
- }
61
- while (continuationToken) {
62
- result = yield tslib_1.__await(this._listNext(reservationOrderId, continuationToken, options));
63
- continuationToken = result.nextLink;
64
- let page = result.value || [];
65
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
66
- yield yield tslib_1.__await(page);
67
- }
68
- });
51
+ async *listPagingPage(reservationOrderId, options, settings) {
52
+ let result;
53
+ let continuationToken = settings?.continuationToken;
54
+ if (!continuationToken) {
55
+ result = await this._list(reservationOrderId, options);
56
+ let page = result.value || [];
57
+ continuationToken = result.nextLink;
58
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
59
+ yield page;
60
+ }
61
+ while (continuationToken) {
62
+ result = await this._listNext(reservationOrderId, continuationToken, options);
63
+ continuationToken = result.nextLink;
64
+ let page = result.value || [];
65
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
66
+ yield page;
67
+ }
69
68
  }
70
- listPagingAll(reservationOrderId, options) {
71
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
72
- var _a, e_1, _b, _c;
73
- try {
74
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPagingPage(reservationOrderId, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
75
- _c = _f.value;
76
- _d = false;
77
- const page = _c;
78
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__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 tslib_1.__await(_b.call(_e));
85
- }
86
- finally { if (e_1) throw e_1.error; }
87
- }
88
- });
69
+ async *listPagingAll(reservationOrderId, options) {
70
+ for await (const page of this.listPagingPage(reservationOrderId, options)) {
71
+ yield* page;
72
+ }
89
73
  }
90
74
  /**
91
75
  * List of all the revisions for the `Reservation`.
@@ -103,52 +87,35 @@ class ReservationImpl {
103
87
  return this;
104
88
  },
105
89
  byPage: (settings) => {
106
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
90
+ if (settings?.maxPageSize) {
107
91
  throw new Error("maxPageSize is not supported by this operation.");
108
92
  }
109
93
  return this.listRevisionsPagingPage(reservationOrderId, reservationId, options, settings);
110
94
  }
111
95
  };
112
96
  }
113
- listRevisionsPagingPage(reservationOrderId, reservationId, options, settings) {
114
- return tslib_1.__asyncGenerator(this, arguments, function* listRevisionsPagingPage_1() {
115
- let result;
116
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
117
- if (!continuationToken) {
118
- result = yield tslib_1.__await(this._listRevisions(reservationOrderId, reservationId, options));
119
- let page = result.value || [];
120
- continuationToken = result.nextLink;
121
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
122
- yield yield tslib_1.__await(page);
123
- }
124
- while (continuationToken) {
125
- result = yield tslib_1.__await(this._listRevisionsNext(reservationOrderId, reservationId, continuationToken, options));
126
- continuationToken = result.nextLink;
127
- let page = result.value || [];
128
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
129
- yield yield tslib_1.__await(page);
130
- }
131
- });
97
+ async *listRevisionsPagingPage(reservationOrderId, reservationId, options, settings) {
98
+ let result;
99
+ let continuationToken = settings?.continuationToken;
100
+ if (!continuationToken) {
101
+ result = await this._listRevisions(reservationOrderId, reservationId, options);
102
+ let page = result.value || [];
103
+ continuationToken = result.nextLink;
104
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
105
+ yield page;
106
+ }
107
+ while (continuationToken) {
108
+ result = await this._listRevisionsNext(reservationOrderId, reservationId, continuationToken, options);
109
+ continuationToken = result.nextLink;
110
+ let page = result.value || [];
111
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
112
+ yield page;
113
+ }
132
114
  }
133
- listRevisionsPagingAll(reservationOrderId, reservationId, options) {
134
- return tslib_1.__asyncGenerator(this, arguments, function* listRevisionsPagingAll_1() {
135
- var _a, e_2, _b, _c;
136
- try {
137
- for (var _d = true, _e = tslib_1.__asyncValues(this.listRevisionsPagingPage(reservationOrderId, reservationId, options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
138
- _c = _f.value;
139
- _d = false;
140
- const page = _c;
141
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
142
- }
143
- }
144
- catch (e_2_1) { e_2 = { error: e_2_1 }; }
145
- finally {
146
- try {
147
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
148
- }
149
- finally { if (e_2) throw e_2.error; }
150
- }
151
- });
115
+ async *listRevisionsPagingAll(reservationOrderId, reservationId, options) {
116
+ for await (const page of this.listRevisionsPagingPage(reservationOrderId, reservationId, options)) {
117
+ yield* page;
118
+ }
152
119
  }
153
120
  /**
154
121
  * List the reservations and the roll up counts of reservations group by provisioning states that the
@@ -165,52 +132,35 @@ class ReservationImpl {
165
132
  return this;
166
133
  },
167
134
  byPage: (settings) => {
168
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
135
+ if (settings?.maxPageSize) {
169
136
  throw new Error("maxPageSize is not supported by this operation.");
170
137
  }
171
138
  return this.listAllPagingPage(options, settings);
172
139
  }
173
140
  };
174
141
  }
175
- listAllPagingPage(options, settings) {
176
- return tslib_1.__asyncGenerator(this, arguments, function* listAllPagingPage_1() {
177
- let result;
178
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
179
- if (!continuationToken) {
180
- result = yield tslib_1.__await(this._listAll(options));
181
- let page = result.value || [];
182
- continuationToken = result.nextLink;
183
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
184
- yield yield tslib_1.__await(page);
185
- }
186
- while (continuationToken) {
187
- result = yield tslib_1.__await(this._listAllNext(continuationToken, options));
188
- continuationToken = result.nextLink;
189
- let page = result.value || [];
190
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
191
- yield yield tslib_1.__await(page);
192
- }
193
- });
142
+ async *listAllPagingPage(options, settings) {
143
+ let result;
144
+ let continuationToken = settings?.continuationToken;
145
+ if (!continuationToken) {
146
+ result = await this._listAll(options);
147
+ let page = result.value || [];
148
+ continuationToken = result.nextLink;
149
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
150
+ yield page;
151
+ }
152
+ while (continuationToken) {
153
+ result = await this._listAllNext(continuationToken, options);
154
+ continuationToken = result.nextLink;
155
+ let page = result.value || [];
156
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
157
+ yield page;
158
+ }
194
159
  }
195
- listAllPagingAll(options) {
196
- return tslib_1.__asyncGenerator(this, arguments, function* listAllPagingAll_1() {
197
- var _a, e_3, _b, _c;
198
- try {
199
- for (var _d = true, _e = tslib_1.__asyncValues(this.listAllPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
200
- _c = _f.value;
201
- _d = false;
202
- const page = _c;
203
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
204
- }
205
- }
206
- catch (e_3_1) { e_3 = { error: e_3_1 }; }
207
- finally {
208
- try {
209
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
210
- }
211
- finally { if (e_3) throw e_3.error; }
212
- }
213
- });
160
+ async *listAllPagingAll(options) {
161
+ for await (const page of this.listAllPagingPage(options)) {
162
+ yield* page;
163
+ }
214
164
  }
215
165
  /**
216
166
  * Check whether the scopes from request is valid for `Reservation`.
@@ -225,14 +175,19 @@ class ReservationImpl {
225
175
  return this.client.sendOperationRequest(args, spec);
226
176
  };
227
177
  const sendOperationFn = async (args, spec) => {
228
- var _a;
229
178
  let currentRawResponse = undefined;
230
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
179
+ const providedCallback = args.options?.onResponse;
231
180
  const callback = (rawResponse, flatResponse) => {
232
181
  currentRawResponse = rawResponse;
233
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
182
+ providedCallback?.(rawResponse, flatResponse);
183
+ };
184
+ const updatedArgs = {
185
+ ...args,
186
+ options: {
187
+ ...args.options,
188
+ onResponse: callback
189
+ }
234
190
  };
235
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
236
191
  const flatResponse = await directSendOperation(updatedArgs, spec);
237
192
  return {
238
193
  flatResponse,
@@ -249,8 +204,8 @@ class ReservationImpl {
249
204
  spec: availableScopesOperationSpec
250
205
  });
251
206
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
252
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
253
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
207
+ restoreFrom: options?.resumeFrom,
208
+ intervalInMs: options?.updateIntervalInMs
254
209
  });
255
210
  await poller.poll();
256
211
  return poller;
@@ -278,14 +233,19 @@ class ReservationImpl {
278
233
  return this.client.sendOperationRequest(args, spec);
279
234
  };
280
235
  const sendOperationFn = async (args, spec) => {
281
- var _a;
282
236
  let currentRawResponse = undefined;
283
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
237
+ const providedCallback = args.options?.onResponse;
284
238
  const callback = (rawResponse, flatResponse) => {
285
239
  currentRawResponse = rawResponse;
286
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
240
+ providedCallback?.(rawResponse, flatResponse);
241
+ };
242
+ const updatedArgs = {
243
+ ...args,
244
+ options: {
245
+ ...args.options,
246
+ onResponse: callback
247
+ }
287
248
  };
288
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
289
249
  const flatResponse = await directSendOperation(updatedArgs, spec);
290
250
  return {
291
251
  flatResponse,
@@ -302,8 +262,8 @@ class ReservationImpl {
302
262
  spec: splitOperationSpec
303
263
  });
304
264
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
305
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
306
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
265
+ restoreFrom: options?.resumeFrom,
266
+ intervalInMs: options?.updateIntervalInMs,
307
267
  resourceLocationConfig: "location"
308
268
  });
309
269
  await poller.poll();
@@ -331,14 +291,19 @@ class ReservationImpl {
331
291
  return this.client.sendOperationRequest(args, spec);
332
292
  };
333
293
  const sendOperationFn = async (args, spec) => {
334
- var _a;
335
294
  let currentRawResponse = undefined;
336
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
295
+ const providedCallback = args.options?.onResponse;
337
296
  const callback = (rawResponse, flatResponse) => {
338
297
  currentRawResponse = rawResponse;
339
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
298
+ providedCallback?.(rawResponse, flatResponse);
299
+ };
300
+ const updatedArgs = {
301
+ ...args,
302
+ options: {
303
+ ...args.options,
304
+ onResponse: callback
305
+ }
340
306
  };
341
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
342
307
  const flatResponse = await directSendOperation(updatedArgs, spec);
343
308
  return {
344
309
  flatResponse,
@@ -355,8 +320,8 @@ class ReservationImpl {
355
320
  spec: mergeOperationSpec
356
321
  });
357
322
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
358
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
359
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
323
+ restoreFrom: options?.resumeFrom,
324
+ intervalInMs: options?.updateIntervalInMs,
360
325
  resourceLocationConfig: "location"
361
326
  });
362
327
  await poller.poll();
@@ -402,14 +367,19 @@ class ReservationImpl {
402
367
  return this.client.sendOperationRequest(args, spec);
403
368
  };
404
369
  const sendOperationFn = async (args, spec) => {
405
- var _a;
406
370
  let currentRawResponse = undefined;
407
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
371
+ const providedCallback = args.options?.onResponse;
408
372
  const callback = (rawResponse, flatResponse) => {
409
373
  currentRawResponse = rawResponse;
410
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
374
+ providedCallback?.(rawResponse, flatResponse);
375
+ };
376
+ const updatedArgs = {
377
+ ...args,
378
+ options: {
379
+ ...args.options,
380
+ onResponse: callback
381
+ }
411
382
  };
412
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
413
383
  const flatResponse = await directSendOperation(updatedArgs, spec);
414
384
  return {
415
385
  flatResponse,
@@ -426,8 +396,8 @@ class ReservationImpl {
426
396
  spec: updateOperationSpec
427
397
  });
428
398
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
429
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
430
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
399
+ restoreFrom: options?.resumeFrom,
400
+ intervalInMs: options?.updateIntervalInMs,
431
401
  resourceLocationConfig: "azure-async-operation"
432
402
  });
433
403
  await poller.poll();