@azure/arm-reservations 9.0.1-alpha.20250620.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.api.md → arm-reservations-node.api.md} +0 -0
@@ -16,6 +16,7 @@ const core_lro_1 = require("@azure/core-lro");
16
16
  const lroImpl_js_1 = require("../lroImpl.js");
17
17
  /** Class containing CalculateExchange operations. */
18
18
  class CalculateExchangeImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class CalculateExchange class.
21
22
  * @param client Reference to the service client
@@ -34,14 +35,19 @@ class CalculateExchangeImpl {
34
35
  return this.client.sendOperationRequest(args, spec);
35
36
  };
36
37
  const sendOperationFn = async (args, spec) => {
37
- var _a;
38
38
  let currentRawResponse = undefined;
39
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
39
+ const providedCallback = args.options?.onResponse;
40
40
  const callback = (rawResponse, flatResponse) => {
41
41
  currentRawResponse = rawResponse;
42
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
42
+ providedCallback?.(rawResponse, flatResponse);
43
+ };
44
+ const updatedArgs = {
45
+ ...args,
46
+ options: {
47
+ ...args.options,
48
+ onResponse: callback
49
+ }
43
50
  };
44
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
45
51
  const flatResponse = await directSendOperation(updatedArgs, spec);
46
52
  return {
47
53
  flatResponse,
@@ -58,8 +64,8 @@ class CalculateExchangeImpl {
58
64
  spec: postOperationSpec
59
65
  });
60
66
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
61
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
62
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
67
+ restoreFrom: options?.resumeFrom,
68
+ intervalInMs: options?.updateIntervalInMs,
63
69
  resourceLocationConfig: "azure-async-operation"
64
70
  });
65
71
  await poller.poll();
@@ -1 +1 @@
1
- {"version":3,"file":"calculateExchange.js","sourceRoot":"","sources":["../../../src/operations/calculateExchange.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEA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AC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;IACjC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,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 { CalculateExchange } 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 SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n CalculateExchangeRequest,\n CalculateExchangePostOptionalParams,\n CalculateExchangePostResponse\n} from \"../models/index.js\";\n\n/** Class containing CalculateExchange operations. */\nexport class CalculateExchangeImpl implements CalculateExchange {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class CalculateExchange class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * Calculates price for exchanging `Reservations` if there are no policy errors.\n *\n * @param body Request containing purchases and refunds that need to be executed.\n * @param options The options parameters.\n */\n async beginPost(\n body: CalculateExchangeRequest,\n options?: CalculateExchangePostOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<CalculateExchangePostResponse>,\n CalculateExchangePostResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<CalculateExchangePostResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperationFn = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = createLroSpec({\n sendOperationFn,\n args: { body, options },\n spec: postOperationSpec\n });\n const poller = await createHttpPoller<\n CalculateExchangePostResponse,\n OperationState<CalculateExchangePostResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"azure-async-operation\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Calculates price for exchanging `Reservations` if there are no policy errors.\n *\n * @param body Request containing purchases and refunds that need to be executed.\n * @param options The options parameters.\n */\n async beginPostAndWait(\n body: CalculateExchangeRequest,\n options?: CalculateExchangePostOptionalParams\n ): Promise<CalculateExchangePostResponse> {\n const poller = await this.beginPost(body, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst postOperationSpec: coreClient.OperationSpec = {\n path: \"/providers/Microsoft.Capacity/calculateExchange\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CalculateExchangeOperationResultResponse\n },\n 201: {\n bodyMapper: Mappers.CalculateExchangeOperationResultResponse\n },\n 202: {\n bodyMapper: Mappers.CalculateExchangeOperationResultResponse\n },\n 204: {\n bodyMapper: Mappers.CalculateExchangeOperationResultResponse\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n requestBody: Parameters.body7,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
1
+ {"version":3,"file":"calculateExchange.js","sourceRoot":"","sources":["../../../src/operations/calculateExchange.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAO9C,qDAAqD;AACrD,MAAa,qBAAqB;IACf,MAAM,CAAsB;IAE7C;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,IAA8B,EAC9B,OAA6C;QAO7C,MAAM,mBAAmB,GAAG,KAAK,EAC/B,IAAmC,EACnC,IAA8B,EACU,EAAE;YAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtD,CAAC,CAAC;QACF,MAAM,eAAe,GAAG,KAAK,EAC3B,IAAmC,EACnC,IAA8B,EAC9B,EAAE;YACF,IAAI,kBAAkB,GAEN,SAAS,CAAC;YAC1B,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC;YAClD,MAAM,QAAQ,GAAmC,CAC/C,WAA6C,EAC7C,YAAqB,EACrB,EAAE;gBACF,kBAAkB,GAAG,WAAW,CAAC;gBACjC,gBAAgB,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;YAChD,CAAC,CAAC;YACF,MAAM,WAAW,GAAG;gBAClB,GAAG,IAAI;gBACP,OAAO,EAAE;oBACP,GAAG,IAAI,CAAC,OAAO;oBACf,UAAU,EAAE,QAAQ;iBACrB;aACF,CAAC;YACF,MAAM,YAAY,GAAG,MAAM,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YAClE,OAAO;gBACL,YAAY;gBACZ,WAAW,EAAE;oBACX,UAAU,EAAE,kBAAmB,CAAC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OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;IACjC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,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 { CalculateExchange } 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 SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n CalculateExchangeRequest,\n CalculateExchangePostOptionalParams,\n CalculateExchangePostResponse\n} from \"../models/index.js\";\n\n/** Class containing CalculateExchange operations. */\nexport class CalculateExchangeImpl implements CalculateExchange {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class CalculateExchange class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * Calculates price for exchanging `Reservations` if there are no policy errors.\n *\n * @param body Request containing purchases and refunds that need to be executed.\n * @param options The options parameters.\n */\n async beginPost(\n body: CalculateExchangeRequest,\n options?: CalculateExchangePostOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<CalculateExchangePostResponse>,\n CalculateExchangePostResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<CalculateExchangePostResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperationFn = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = createLroSpec({\n sendOperationFn,\n args: { body, options },\n spec: postOperationSpec\n });\n const poller = await createHttpPoller<\n CalculateExchangePostResponse,\n OperationState<CalculateExchangePostResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"azure-async-operation\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Calculates price for exchanging `Reservations` if there are no policy errors.\n *\n * @param body Request containing purchases and refunds that need to be executed.\n * @param options The options parameters.\n */\n async beginPostAndWait(\n body: CalculateExchangeRequest,\n options?: CalculateExchangePostOptionalParams\n ): Promise<CalculateExchangePostResponse> {\n const poller = await this.beginPost(body, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst postOperationSpec: coreClient.OperationSpec = {\n path: \"/providers/Microsoft.Capacity/calculateExchange\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CalculateExchangeOperationResultResponse\n },\n 201: {\n bodyMapper: Mappers.CalculateExchangeOperationResultResponse\n },\n 202: {\n bodyMapper: Mappers.CalculateExchangeOperationResultResponse\n },\n 204: {\n bodyMapper: Mappers.CalculateExchangeOperationResultResponse\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n requestBody: Parameters.body7,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
@@ -14,6 +14,7 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
14
14
  const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /** Class containing CalculateRefund operations. */
16
16
  class CalculateRefundImpl {
17
+ client;
17
18
  /**
18
19
  * Initialize a new instance of the class CalculateRefund class.
19
20
  * @param client Reference to the service client
@@ -1 +1 @@
1
- {"version":3,"file":"calculateRefund.js","sourceRoot":"","sources":["../../../src/operations/calculateRefund.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAQtD,mDAAmD;AACnD,MAAa,mBAAmB;IAG9B;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,kBAA0B,EAC1B,IAA4B,EAC5B,OAA2C;QAE3C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE,EACrC,iBAAiB,CAClB,CAAC;IACJ,CAAC;CACF;AA5BD,kDA4BC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EACF,sFAAsF;IACxF,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAChE,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,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 { CalculateRefund } 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 CalculateRefundRequest,\n CalculateRefundPostOptionalParams,\n CalculateRefundPostResponse\n} from \"../models/index.js\";\n\n/** Class containing CalculateRefund operations. */\nexport class CalculateRefundImpl implements CalculateRefund {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class CalculateRefund class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * Calculate price for returning `Reservations` if there are no policy errors.\n *\n * @param reservationOrderId Order Id of the reservation\n * @param body Information needed for calculating refund of a reservation.\n * @param options The options parameters.\n */\n post(\n reservationOrderId: string,\n body: CalculateRefundRequest,\n options?: CalculateRefundPostOptionalParams\n ): Promise<CalculateRefundPostResponse> {\n return this.client.sendOperationRequest(\n { reservationOrderId, body, options },\n postOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst postOperationSpec: coreClient.OperationSpec = {\n path:\n \"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CalculateRefundResponse\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n requestBody: Parameters.body5,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.reservationOrderId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
1
+ {"version":3,"file":"calculateRefund.js","sourceRoot":"","sources":["../../../src/operations/calculateRefund.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAQtD,mDAAmD;AACnD,MAAa,mBAAmB;IACb,MAAM,CAAsB;IAE7C;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,kBAA0B,EAC1B,IAA4B,EAC5B,OAA2C;QAE3C,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE,EACrC,iBAAiB,CAClB,CAAC;IACJ,CAAC;CACF;AA5BD,kDA4BC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EACF,sFAAsF;IACxF,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,uBAAuB;SAC5C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,WAAW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,kBAAkB,CAAC;IAChE,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,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 { CalculateRefund } 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 CalculateRefundRequest,\n CalculateRefundPostOptionalParams,\n CalculateRefundPostResponse\n} from \"../models/index.js\";\n\n/** Class containing CalculateRefund operations. */\nexport class CalculateRefundImpl implements CalculateRefund {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class CalculateRefund class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * Calculate price for returning `Reservations` if there are no policy errors.\n *\n * @param reservationOrderId Order Id of the reservation\n * @param body Information needed for calculating refund of a reservation.\n * @param options The options parameters.\n */\n post(\n reservationOrderId: string,\n body: CalculateRefundRequest,\n options?: CalculateRefundPostOptionalParams\n ): Promise<CalculateRefundPostResponse> {\n return this.client.sendOperationRequest(\n { reservationOrderId, body, options },\n postOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst postOperationSpec: coreClient.OperationSpec = {\n path:\n \"/providers/Microsoft.Capacity/reservationOrders/{reservationOrderId}/calculateRefund\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CalculateRefundResponse\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n requestBody: Parameters.body5,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.reservationOrderId],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
@@ -16,6 +16,7 @@ const core_lro_1 = require("@azure/core-lro");
16
16
  const lroImpl_js_1 = require("../lroImpl.js");
17
17
  /** Class containing Exchange operations. */
18
18
  class ExchangeImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class Exchange class.
21
22
  * @param client Reference to the service client
@@ -34,14 +35,19 @@ class ExchangeImpl {
34
35
  return this.client.sendOperationRequest(args, spec);
35
36
  };
36
37
  const sendOperationFn = async (args, spec) => {
37
- var _a;
38
38
  let currentRawResponse = undefined;
39
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
39
+ const providedCallback = args.options?.onResponse;
40
40
  const callback = (rawResponse, flatResponse) => {
41
41
  currentRawResponse = rawResponse;
42
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
42
+ providedCallback?.(rawResponse, flatResponse);
43
+ };
44
+ const updatedArgs = {
45
+ ...args,
46
+ options: {
47
+ ...args.options,
48
+ onResponse: callback
49
+ }
43
50
  };
44
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
45
51
  const flatResponse = await directSendOperation(updatedArgs, spec);
46
52
  return {
47
53
  flatResponse,
@@ -58,8 +64,8 @@ class ExchangeImpl {
58
64
  spec: postOperationSpec
59
65
  });
60
66
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
61
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
62
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
67
+ restoreFrom: options?.resumeFrom,
68
+ intervalInMs: options?.updateIntervalInMs,
63
69
  resourceLocationConfig: "azure-async-operation"
64
70
  });
65
71
  await poller.poll();
@@ -1 +1 @@
1
- {"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../../src/operations/exchange.ts"],"names":[],"mappings":";AAAA;;;;;;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AAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;IACjC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,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 { Exchange } 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 SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n ExchangeRequest,\n ExchangePostOptionalParams,\n ExchangePostResponse\n} from \"../models/index.js\";\n\n/** Class containing Exchange operations. */\nexport class ExchangeImpl implements Exchange {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class Exchange class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.\n *\n * @param body Request containing the refunds and purchases that need to be executed.\n * @param options The options parameters.\n */\n async beginPost(\n body: ExchangeRequest,\n options?: ExchangePostOptionalParams\n ): Promise<\n SimplePollerLike<OperationState<ExchangePostResponse>, ExchangePostResponse>\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<ExchangePostResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperationFn = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = createLroSpec({\n sendOperationFn,\n args: { body, options },\n spec: postOperationSpec\n });\n const poller = await createHttpPoller<\n ExchangePostResponse,\n OperationState<ExchangePostResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"azure-async-operation\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.\n *\n * @param body Request containing the refunds and purchases that need to be executed.\n * @param options The options parameters.\n */\n async beginPostAndWait(\n body: ExchangeRequest,\n options?: ExchangePostOptionalParams\n ): Promise<ExchangePostResponse> {\n const poller = await this.beginPost(body, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst postOperationSpec: coreClient.OperationSpec = {\n path: \"/providers/Microsoft.Capacity/exchange\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.ExchangeOperationResultResponse\n },\n 201: {\n bodyMapper: Mappers.ExchangeOperationResultResponse\n },\n 202: {\n bodyMapper: Mappers.ExchangeOperationResultResponse\n },\n 204: {\n bodyMapper: Mappers.ExchangeOperationResultResponse\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n requestBody: Parameters.body8,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
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AW,EAAE,UAAU,CAAC,KAAK;IAC7B,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;IACjC,gBAAgB,EAAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,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 { Exchange } 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 SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n ExchangeRequest,\n ExchangePostOptionalParams,\n ExchangePostResponse\n} from \"../models/index.js\";\n\n/** Class containing Exchange operations. */\nexport class ExchangeImpl implements Exchange {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class Exchange class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.\n *\n * @param body Request containing the refunds and purchases that need to be executed.\n * @param options The options parameters.\n */\n async beginPost(\n body: ExchangeRequest,\n options?: ExchangePostOptionalParams\n ): Promise<\n SimplePollerLike<OperationState<ExchangePostResponse>, ExchangePostResponse>\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<ExchangePostResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperationFn = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = createLroSpec({\n sendOperationFn,\n args: { body, options },\n spec: postOperationSpec\n });\n const poller = await createHttpPoller<\n ExchangePostResponse,\n OperationState<ExchangePostResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"azure-async-operation\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Returns one or more `Reservations` in exchange for one or more `Reservation` purchases.\n *\n * @param body Request containing the refunds and purchases that need to be executed.\n * @param options The options parameters.\n */\n async beginPostAndWait(\n body: ExchangeRequest,\n options?: ExchangePostOptionalParams\n ): Promise<ExchangePostResponse> {\n const poller = await this.beginPost(body, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst postOperationSpec: coreClient.OperationSpec = {\n path: \"/providers/Microsoft.Capacity/exchange\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.ExchangeOperationResultResponse\n },\n 201: {\n bodyMapper: Mappers.ExchangeOperationResultResponse\n },\n 202: {\n bodyMapper: Mappers.ExchangeOperationResultResponse\n },\n 204: {\n bodyMapper: Mappers.ExchangeOperationResultResponse\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n requestBody: Parameters.body8,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\n"]}
@@ -16,6 +16,7 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
16
16
  /// <reference lib="esnext.asynciterable" />
17
17
  /** Class containing Operation operations. */
18
18
  class OperationImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class Operation class.
21
22
  * @param client Reference to the service client
@@ -37,52 +38,35 @@ class OperationImpl {
37
38
  return this;
38
39
  },
39
40
  byPage: (settings) => {
40
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
41
+ if (settings?.maxPageSize) {
41
42
  throw new Error("maxPageSize is not supported by this operation.");
42
43
  }
43
44
  return this.listPagingPage(options, settings);
44
45
  }
45
46
  };
46
47
  }
47
- listPagingPage(options, settings) {
48
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
49
- let result;
50
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
51
- if (!continuationToken) {
52
- result = yield tslib_1.__await(this._list(options));
53
- let page = result.value || [];
54
- continuationToken = result.nextLink;
55
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
56
- yield yield tslib_1.__await(page);
57
- }
58
- while (continuationToken) {
59
- result = yield tslib_1.__await(this._listNext(continuationToken, options));
60
- continuationToken = result.nextLink;
61
- let page = result.value || [];
62
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
63
- yield yield tslib_1.__await(page);
64
- }
65
- });
48
+ async *listPagingPage(options, settings) {
49
+ let result;
50
+ let continuationToken = settings?.continuationToken;
51
+ if (!continuationToken) {
52
+ result = await this._list(options);
53
+ let page = result.value || [];
54
+ continuationToken = result.nextLink;
55
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
56
+ yield page;
57
+ }
58
+ while (continuationToken) {
59
+ result = await this._listNext(continuationToken, options);
60
+ continuationToken = result.nextLink;
61
+ let page = result.value || [];
62
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
63
+ yield page;
64
+ }
66
65
  }
67
- listPagingAll(options) {
68
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
69
- var _a, e_1, _b, _c;
70
- try {
71
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
72
- _c = _f.value;
73
- _d = false;
74
- const page = _c;
75
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
76
- }
77
- }
78
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
79
- finally {
80
- try {
81
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
82
- }
83
- finally { if (e_1) throw e_1.error; }
84
- }
85
- });
66
+ async *listPagingAll(options) {
67
+ for await (const page of this.listPagingPage(options)) {
68
+ yield* page;
69
+ }
86
70
  }
87
71
  /**
88
72
  * List all the operations.
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/operations/operation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAUtD,4CAA4C;AAC5C,6CAA6C;AAC7C,MAAa,aAAa;IAGxB;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,IAAI,CACT,OAAqC;QAErC,MAAM,IAAI,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACzC,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,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW,EAAE,CA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AM,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 { Operation } 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 OperationResponse,\n OperationListNextOptionalParams,\n OperationListOptionalParams,\n OperationListResponse,\n OperationListNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Operation operations. */\nexport class OperationImpl implements Operation {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class Operation class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * List all the operations.\n * @param options The options parameters.\n */\n public list(\n options?: OperationListOptionalParams\n ): PagedAsyncIterableIterator<OperationResponse> {\n const iter = this.listPagingAll(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(options, settings);\n }\n };\n }\n\n private async *listPagingPage(\n options?: OperationListOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<OperationResponse[]> {\n let result: OperationListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(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(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 options?: OperationListOptionalParams\n ): AsyncIterableIterator<OperationResponse> {\n for await (const page of this.listPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * List all the operations.\n * @param options The options parameters.\n */\n private _list(\n options?: OperationListOptionalParams\n ): Promise<OperationListResponse> {\n return this.client.sendOperationRequest({ options }, listOperationSpec);\n }\n\n /**\n * ListNext\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 nextLink: string,\n options?: OperationListNextOptionalParams\n ): Promise<OperationListNextResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n listNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/providers/Microsoft.Capacity/operations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationList\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationList\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n urlParameters: [Parameters.$host, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/operations/operation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAUtD,4CAA4C;AAC5C,6CAA6C;AAC7C,MAAa,aAAa;IACP,MAAM,CAAsB;IAE7C;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED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YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC;IACtD,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 { Operation } 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 OperationResponse,\n OperationListNextOptionalParams,\n OperationListOptionalParams,\n OperationListResponse,\n OperationListNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Operation operations. */\nexport class OperationImpl implements Operation {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class Operation class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * List all the operations.\n * @param options The options parameters.\n */\n public list(\n options?: OperationListOptionalParams\n ): PagedAsyncIterableIterator<OperationResponse> {\n const iter = this.listPagingAll(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(options, settings);\n }\n };\n }\n\n private async *listPagingPage(\n options?: OperationListOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<OperationResponse[]> {\n let result: OperationListResponse;\n let continuationToken = settings?.continuationToken;\n if (!continuationToken) {\n result = await this._list(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(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 options?: OperationListOptionalParams\n ): AsyncIterableIterator<OperationResponse> {\n for await (const page of this.listPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * List all the operations.\n * @param options The options parameters.\n */\n private _list(\n options?: OperationListOptionalParams\n ): Promise<OperationListResponse> {\n return this.client.sendOperationRequest({ options }, listOperationSpec);\n }\n\n /**\n * ListNext\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 nextLink: string,\n options?: OperationListNextOptionalParams\n ): Promise<OperationListNextResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n listNextOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationSpec: coreClient.OperationSpec = {\n path: \"/providers/Microsoft.Capacity/operations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationList\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationList\n },\n default: {\n bodyMapper: Mappers.ErrorModel\n }\n },\n urlParameters: [Parameters.$host, Parameters.nextLink],\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 Quota operations. */
20
20
  class QuotaImpl {
21
+ client;
21
22
  /**
22
23
  * Initialize a new instance of the class Quota class.
23
24
  * @param client Reference to the service client
@@ -43,52 +44,35 @@ class QuotaImpl {
43
44
  return this;
44
45
  },
45
46
  byPage: (settings) => {
46
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
47
+ if (settings?.maxPageSize) {
47
48
  throw new Error("maxPageSize is not supported by this operation.");
48
49
  }
49
50
  return this.listPagingPage(subscriptionId, providerId, location, options, settings);
50
51
  }
51
52
  };
52
53
  }
53
- listPagingPage(subscriptionId, providerId, location, options, settings) {
54
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
55
- let result;
56
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
57
- if (!continuationToken) {
58
- result = yield tslib_1.__await(this._list(subscriptionId, providerId, location, options));
59
- let page = result.value || [];
60
- continuationToken = result.nextLink;
61
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
62
- yield yield tslib_1.__await(page);
63
- }
64
- while (continuationToken) {
65
- result = yield tslib_1.__await(this._listNext(subscriptionId, providerId, location, continuationToken, options));
66
- continuationToken = result.nextLink;
67
- let page = result.value || [];
68
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
69
- yield yield tslib_1.__await(page);
70
- }
71
- });
54
+ async *listPagingPage(subscriptionId, providerId, location, options, settings) {
55
+ let result;
56
+ let continuationToken = settings?.continuationToken;
57
+ if (!continuationToken) {
58
+ result = await this._list(subscriptionId, providerId, location, options);
59
+ let page = result.value || [];
60
+ continuationToken = result.nextLink;
61
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
62
+ yield page;
63
+ }
64
+ while (continuationToken) {
65
+ result = await this._listNext(subscriptionId, providerId, location, continuationToken, options);
66
+ continuationToken = result.nextLink;
67
+ let page = result.value || [];
68
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
69
+ yield page;
70
+ }
72
71
  }
73
- listPagingAll(subscriptionId, providerId, location, options) {
74
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
75
- var _a, e_1, _b, _c;
76
- try {
77
- 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) {
78
- _c = _f.value;
79
- _d = false;
80
- const page = _c;
81
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
82
- }
83
- }
84
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
85
- finally {
86
- try {
87
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
88
- }
89
- finally { if (e_1) throw e_1.error; }
90
- }
91
- });
72
+ async *listPagingAll(subscriptionId, providerId, location, options) {
73
+ for await (const page of this.listPagingPage(subscriptionId, providerId, location, options)) {
74
+ yield* page;
75
+ }
92
76
  }
93
77
  /**
94
78
  * Get the current quota (service limit) and usage of a resource. You can use the response from the GET
@@ -124,14 +108,19 @@ class QuotaImpl {
124
108
  return this.client.sendOperationRequest(args, spec);
125
109
  };
126
110
  const sendOperationFn = async (args, spec) => {
127
- var _a;
128
111
  let currentRawResponse = undefined;
129
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
112
+ const providedCallback = args.options?.onResponse;
130
113
  const callback = (rawResponse, flatResponse) => {
131
114
  currentRawResponse = rawResponse;
132
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
115
+ providedCallback?.(rawResponse, flatResponse);
116
+ };
117
+ const updatedArgs = {
118
+ ...args,
119
+ options: {
120
+ ...args.options,
121
+ onResponse: callback
122
+ }
133
123
  };
134
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
135
124
  const flatResponse = await directSendOperation(updatedArgs, spec);
136
125
  return {
137
126
  flatResponse,
@@ -155,8 +144,8 @@ class QuotaImpl {
155
144
  spec: createOrUpdateOperationSpec
156
145
  });
157
146
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
158
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
159
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
147
+ restoreFrom: options?.resumeFrom,
148
+ intervalInMs: options?.updateIntervalInMs,
160
149
  resourceLocationConfig: "original-uri"
161
150
  });
162
151
  await poller.poll();
@@ -202,14 +191,19 @@ class QuotaImpl {
202
191
  return this.client.sendOperationRequest(args, spec);
203
192
  };
204
193
  const sendOperationFn = async (args, spec) => {
205
- var _a;
206
194
  let currentRawResponse = undefined;
207
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
195
+ const providedCallback = args.options?.onResponse;
208
196
  const callback = (rawResponse, flatResponse) => {
209
197
  currentRawResponse = rawResponse;
210
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
198
+ providedCallback?.(rawResponse, flatResponse);
199
+ };
200
+ const updatedArgs = {
201
+ ...args,
202
+ options: {
203
+ ...args.options,
204
+ onResponse: callback
205
+ }
211
206
  };
212
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
213
207
  const flatResponse = await directSendOperation(updatedArgs, spec);
214
208
  return {
215
209
  flatResponse,
@@ -233,8 +227,8 @@ class QuotaImpl {
233
227
  spec: updateOperationSpec
234
228
  });
235
229
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
236
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
237
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
230
+ restoreFrom: options?.resumeFrom,
231
+ intervalInMs: options?.updateIntervalInMs,
238
232
  resourceLocationConfig: "original-uri"
239
233
  });
240
234
  await poller.poll();
@@ -1 +1 @@
1
- {"version":3,"file":"quota.js","sourceRoot":"","sources":["../../../src/operations/quota.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAg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ensed 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 { Quota } 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 SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n CurrentQuotaLimitBase,\n QuotaListNextOptionalParams,\n QuotaListOptionalParams,\n QuotaListResponse,\n QuotaGetOptionalParams,\n QuotaGetResponse,\n QuotaCreateOrUpdateOptionalParams,\n QuotaCreateOrUpdateResponse,\n QuotaUpdateOptionalParams,\n QuotaUpdateResponse,\n QuotaListNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Quota operations. */\nexport class QuotaImpl implements Quota {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class Quota class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * Gets a list of current quotas (service limits) and usage for all resources. The response from the\n * list quota operation can be leveraged to request quota updates.\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?: QuotaListOptionalParams\n ): PagedAsyncIterableIterator<CurrentQuotaLimitBase> {\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?: QuotaListOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<CurrentQuotaLimitBase[]> {\n let result: QuotaListResponse;\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?: QuotaListOptionalParams\n ): AsyncIterableIterator<CurrentQuotaLimitBase> {\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 * Get the current quota (service limit) and usage of a resource. You can use the response from the GET\n * operation to submit quota update request.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param options The options parameters.\n */\n get(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n options?: QuotaGetOptionalParams\n ): Promise<QuotaGetResponse> {\n return this.client.sendOperationRequest(\n { subscriptionId, providerId, location, resourceName, options },\n getOperationSpec\n );\n }\n\n /**\n * Create or update the quota (service limits) of a resource to the requested value.\n * Steps:\n * 1. Make the Get request to get the quota information for specific resource.\n * 2. To increase the quota, update the limit field in the response from Get request to new value.\n * 3. Submit the JSON to the quota request API to update the quota.\n * The Create quota request may be constructed as follows. The PUT operation can be used to update\n * the quota.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param createQuotaRequest Quota requests payload.\n * @param options The options parameters.\n */\n async beginCreateOrUpdate(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n createQuotaRequest: CurrentQuotaLimitBase,\n options?: QuotaCreateOrUpdateOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<QuotaCreateOrUpdateResponse>,\n QuotaCreateOrUpdateResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<QuotaCreateOrUpdateResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperationFn = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = createLroSpec({\n sendOperationFn,\n args: {\n subscriptionId,\n providerId,\n location,\n resourceName,\n createQuotaRequest,\n options\n },\n spec: createOrUpdateOperationSpec\n });\n const poller = await createHttpPoller<\n QuotaCreateOrUpdateResponse,\n OperationState<QuotaCreateOrUpdateResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"original-uri\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Create or update the quota (service limits) of a resource to the requested value.\n * Steps:\n * 1. Make the Get request to get the quota information for specific resource.\n * 2. To increase the quota, update the limit field in the response from Get request to new value.\n * 3. Submit the JSON to the quota request API to update the quota.\n * The Create quota request may be constructed as follows. The PUT operation can be used to update\n * the quota.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param createQuotaRequest Quota requests payload.\n * @param options The options parameters.\n */\n async beginCreateOrUpdateAndWait(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n createQuotaRequest: CurrentQuotaLimitBase,\n options?: QuotaCreateOrUpdateOptionalParams\n ): Promise<QuotaCreateOrUpdateResponse> {\n const poller = await this.beginCreateOrUpdate(\n subscriptionId,\n providerId,\n location,\n resourceName,\n createQuotaRequest,\n options\n );\n return poller.pollUntilDone();\n }\n\n /**\n * Update the quota (service limits) of this resource to the requested value.\n * • To get the quota information for specific resource, send a GET request.\n * • To increase the quota, update the limit field from the GET response to a new value.\n * • To update the quota value, submit the JSON response to the quota request API to update the\n * quota.\n * • To update the quota. use the PATCH operation.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param createQuotaRequest Payload for the quota request.\n * @param options The options parameters.\n */\n async beginUpdate(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n createQuotaRequest: CurrentQuotaLimitBase,\n options?: QuotaUpdateOptionalParams\n ): Promise<\n SimplePollerLike<OperationState<QuotaUpdateResponse>, QuotaUpdateResponse>\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<QuotaUpdateResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperationFn = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = createLroSpec({\n sendOperationFn,\n args: {\n subscriptionId,\n providerId,\n location,\n resourceName,\n createQuotaRequest,\n options\n },\n spec: updateOperationSpec\n });\n const poller = await createHttpPoller<\n QuotaUpdateResponse,\n OperationState<QuotaUpdateResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"original-uri\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Update the quota (service limits) of this resource to the requested value.\n * • To get the quota information for specific resource, send a GET request.\n * • To increase the quota, update the limit field from the GET response to a new value.\n * • To update the quota value, submit the JSON response to the quota request API to update the\n * quota.\n * • To update the quota. use the PATCH operation.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param createQuotaRequest Payload for the quota request.\n * @param options The options parameters.\n */\n async beginUpdateAndWait(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n createQuotaRequest: CurrentQuotaLimitBase,\n options?: QuotaUpdateOptionalParams\n ): Promise<QuotaUpdateResponse> {\n const poller = await this.beginUpdate(\n subscriptionId,\n providerId,\n location,\n resourceName,\n createQuotaRequest,\n options\n );\n return poller.pollUntilDone();\n }\n\n /**\n * Gets a list of current quotas (service limits) and usage for all resources. The response from the\n * list quota operation can be leveraged to request quota updates.\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?: QuotaListOptionalParams\n ): Promise<QuotaListResponse> {\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?: QuotaListNextOptionalParams\n ): Promise<QuotaListNextResponse> {\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}/serviceLimits/{resourceName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CurrentQuotaLimitBase,\n headersMapper: Mappers.QuotaGetHeaders\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.resourceName\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst createOrUpdateOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 201: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 202: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 204: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse\n }\n },\n requestBody: Parameters.createQuotaRequest,\n queryParameters: [Parameters.apiVersion1],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1,\n Parameters.resourceName\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst updateOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 201: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 202: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 204: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse\n }\n },\n requestBody: Parameters.createQuotaRequest,\n queryParameters: [Parameters.apiVersion1],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1,\n Parameters.resourceName\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaLimits,\n headersMapper: Mappers.QuotaListHeaders\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 ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaLimits,\n headersMapper: Mappers.QuotaListNextHeaders\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":"quota.js","sourceRoot":"","sources":["../../../src/operations/quota.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAe9C,4CAA4C;AAC5C,yCAAyC;AACzC,MAAa,SAAS;IACH,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,OAAiC;QAEjC,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,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,CACxB,cAAc,EACd,UAAU,EACV,QAAQ,EACR,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;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 { Quota } 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 SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n CurrentQuotaLimitBase,\n QuotaListNextOptionalParams,\n QuotaListOptionalParams,\n QuotaListResponse,\n QuotaGetOptionalParams,\n QuotaGetResponse,\n QuotaCreateOrUpdateOptionalParams,\n QuotaCreateOrUpdateResponse,\n QuotaUpdateOptionalParams,\n QuotaUpdateResponse,\n QuotaListNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Quota operations. */\nexport class QuotaImpl implements Quota {\n private readonly client: AzureReservationAPI;\n\n /**\n * Initialize a new instance of the class Quota class.\n * @param client Reference to the service client\n */\n constructor(client: AzureReservationAPI) {\n this.client = client;\n }\n\n /**\n * Gets a list of current quotas (service limits) and usage for all resources. The response from the\n * list quota operation can be leveraged to request quota updates.\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?: QuotaListOptionalParams\n ): PagedAsyncIterableIterator<CurrentQuotaLimitBase> {\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?: QuotaListOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<CurrentQuotaLimitBase[]> {\n let result: QuotaListResponse;\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?: QuotaListOptionalParams\n ): AsyncIterableIterator<CurrentQuotaLimitBase> {\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 * Get the current quota (service limit) and usage of a resource. You can use the response from the GET\n * operation to submit quota update request.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param options The options parameters.\n */\n get(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n options?: QuotaGetOptionalParams\n ): Promise<QuotaGetResponse> {\n return this.client.sendOperationRequest(\n { subscriptionId, providerId, location, resourceName, options },\n getOperationSpec\n );\n }\n\n /**\n * Create or update the quota (service limits) of a resource to the requested value.\n * Steps:\n * 1. Make the Get request to get the quota information for specific resource.\n * 2. To increase the quota, update the limit field in the response from Get request to new value.\n * 3. Submit the JSON to the quota request API to update the quota.\n * The Create quota request may be constructed as follows. The PUT operation can be used to update\n * the quota.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param createQuotaRequest Quota requests payload.\n * @param options The options parameters.\n */\n async beginCreateOrUpdate(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n createQuotaRequest: CurrentQuotaLimitBase,\n options?: QuotaCreateOrUpdateOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<QuotaCreateOrUpdateResponse>,\n QuotaCreateOrUpdateResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<QuotaCreateOrUpdateResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperationFn = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = createLroSpec({\n sendOperationFn,\n args: {\n subscriptionId,\n providerId,\n location,\n resourceName,\n createQuotaRequest,\n options\n },\n spec: createOrUpdateOperationSpec\n });\n const poller = await createHttpPoller<\n QuotaCreateOrUpdateResponse,\n OperationState<QuotaCreateOrUpdateResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"original-uri\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Create or update the quota (service limits) of a resource to the requested value.\n * Steps:\n * 1. Make the Get request to get the quota information for specific resource.\n * 2. To increase the quota, update the limit field in the response from Get request to new value.\n * 3. Submit the JSON to the quota request API to update the quota.\n * The Create quota request may be constructed as follows. The PUT operation can be used to update\n * the quota.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param createQuotaRequest Quota requests payload.\n * @param options The options parameters.\n */\n async beginCreateOrUpdateAndWait(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n createQuotaRequest: CurrentQuotaLimitBase,\n options?: QuotaCreateOrUpdateOptionalParams\n ): Promise<QuotaCreateOrUpdateResponse> {\n const poller = await this.beginCreateOrUpdate(\n subscriptionId,\n providerId,\n location,\n resourceName,\n createQuotaRequest,\n options\n );\n return poller.pollUntilDone();\n }\n\n /**\n * Update the quota (service limits) of this resource to the requested value.\n * • To get the quota information for specific resource, send a GET request.\n * • To increase the quota, update the limit field from the GET response to a new value.\n * • To update the quota value, submit the JSON response to the quota request API to update the\n * quota.\n * • To update the quota. use the PATCH operation.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param createQuotaRequest Payload for the quota request.\n * @param options The options parameters.\n */\n async beginUpdate(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n createQuotaRequest: CurrentQuotaLimitBase,\n options?: QuotaUpdateOptionalParams\n ): Promise<\n SimplePollerLike<OperationState<QuotaUpdateResponse>, QuotaUpdateResponse>\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<QuotaUpdateResponse> => {\n return this.client.sendOperationRequest(args, spec);\n };\n const sendOperationFn = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ) => {\n let currentRawResponse:\n | coreClient.FullOperationResponse\n | undefined = undefined;\n const providedCallback = args.options?.onResponse;\n const callback: coreClient.RawResponseCallback = (\n rawResponse: coreClient.FullOperationResponse,\n flatResponse: unknown\n ) => {\n currentRawResponse = rawResponse;\n providedCallback?.(rawResponse, flatResponse);\n };\n const updatedArgs = {\n ...args,\n options: {\n ...args.options,\n onResponse: callback\n }\n };\n const flatResponse = await directSendOperation(updatedArgs, spec);\n return {\n flatResponse,\n rawResponse: {\n statusCode: currentRawResponse!.status,\n body: currentRawResponse!.parsedBody,\n headers: currentRawResponse!.headers.toJSON()\n }\n };\n };\n\n const lro = createLroSpec({\n sendOperationFn,\n args: {\n subscriptionId,\n providerId,\n location,\n resourceName,\n createQuotaRequest,\n options\n },\n spec: updateOperationSpec\n });\n const poller = await createHttpPoller<\n QuotaUpdateResponse,\n OperationState<QuotaUpdateResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"original-uri\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Update the quota (service limits) of this resource to the requested value.\n * • To get the quota information for specific resource, send a GET request.\n * • To increase the quota, update the limit field from the GET response to a new value.\n * • To update the quota value, submit the JSON response to the quota request API to update the\n * quota.\n * • To update the quota. use the PATCH operation.\n * @param subscriptionId Azure subscription ID.\n * @param providerId Azure resource provider ID.\n * @param location Azure region.\n * @param resourceName The resource name for a resource provider, such as SKU name for\n * Microsoft.Compute, Sku or TotalLowPriorityCores for Microsoft.MachineLearningServices\n * @param createQuotaRequest Payload for the quota request.\n * @param options The options parameters.\n */\n async beginUpdateAndWait(\n subscriptionId: string,\n providerId: string,\n location: string,\n resourceName: string,\n createQuotaRequest: CurrentQuotaLimitBase,\n options?: QuotaUpdateOptionalParams\n ): Promise<QuotaUpdateResponse> {\n const poller = await this.beginUpdate(\n subscriptionId,\n providerId,\n location,\n resourceName,\n createQuotaRequest,\n options\n );\n return poller.pollUntilDone();\n }\n\n /**\n * Gets a list of current quotas (service limits) and usage for all resources. The response from the\n * list quota operation can be leveraged to request quota updates.\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?: QuotaListOptionalParams\n ): Promise<QuotaListResponse> {\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?: QuotaListNextOptionalParams\n ): Promise<QuotaListNextResponse> {\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}/serviceLimits/{resourceName}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CurrentQuotaLimitBase,\n headersMapper: Mappers.QuotaGetHeaders\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.resourceName\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst createOrUpdateOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}\",\n httpMethod: \"PUT\",\n responses: {\n 200: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 201: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 202: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 204: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse\n }\n },\n requestBody: Parameters.createQuotaRequest,\n queryParameters: [Parameters.apiVersion1],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1,\n Parameters.resourceName\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst updateOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}\",\n httpMethod: \"PATCH\",\n responses: {\n 200: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 201: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 202: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n 204: {\n bodyMapper: Mappers.CurrentQuotaLimitBase\n },\n default: {\n bodyMapper: Mappers.ExceptionResponse\n }\n },\n requestBody: Parameters.createQuotaRequest,\n queryParameters: [Parameters.apiVersion1],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.providerId,\n Parameters.location1,\n Parameters.resourceName\n ],\n headerParameters: [Parameters.contentType, Parameters.accept],\n mediaType: \"json\",\n serializer\n};\nconst listOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaLimits,\n headersMapper: Mappers.QuotaListHeaders\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 ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst listNextOperationSpec: coreClient.OperationSpec = {\n path: \"{nextLink}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.QuotaLimits,\n headersMapper: Mappers.QuotaListNextHeaders\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"]}