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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/dist/browser/azureReservationAPI.js +42 -45
  2. package/dist/browser/azureReservationAPI.js.map +1 -1
  3. package/dist/browser/lroImpl.js +7 -3
  4. package/dist/browser/lroImpl.js.map +1 -1
  5. package/dist/browser/models/mappers.js +21 -9
  6. package/dist/browser/models/mappers.js.map +1 -1
  7. package/dist/browser/operations/calculateExchange.js +12 -6
  8. package/dist/browser/operations/calculateExchange.js.map +1 -1
  9. package/dist/browser/operations/calculateRefund.js +1 -0
  10. package/dist/browser/operations/calculateRefund.js.map +1 -1
  11. package/dist/browser/operations/exchange.js +12 -6
  12. package/dist/browser/operations/exchange.js.map +1 -1
  13. package/dist/browser/operations/operation.js +23 -40
  14. package/dist/browser/operations/operation.js.map +1 -1
  15. package/dist/browser/operations/quota.js +45 -52
  16. package/dist/browser/operations/quota.js.map +1 -1
  17. package/dist/browser/operations/quotaRequestStatus.js +23 -40
  18. package/dist/browser/operations/quotaRequestStatus.js.map +1 -1
  19. package/dist/browser/operations/reservation.js +111 -142
  20. package/dist/browser/operations/reservation.js.map +1 -1
  21. package/dist/browser/operations/reservationOrder.js +34 -46
  22. package/dist/browser/operations/reservationOrder.js.map +1 -1
  23. package/dist/browser/operations/return.js +12 -6
  24. package/dist/browser/operations/return.js.map +1 -1
  25. package/dist/browser/pagingHelper.js +2 -4
  26. package/dist/browser/pagingHelper.js.map +1 -1
  27. package/dist/commonjs/azureReservationAPI.js +42 -44
  28. package/dist/commonjs/azureReservationAPI.js.map +1 -1
  29. package/dist/commonjs/lroImpl.js +7 -3
  30. package/dist/commonjs/lroImpl.js.map +1 -1
  31. package/dist/commonjs/models/mappers.js +21 -9
  32. package/dist/commonjs/models/mappers.js.map +1 -1
  33. package/dist/commonjs/operations/calculateExchange.js +12 -6
  34. package/dist/commonjs/operations/calculateExchange.js.map +1 -1
  35. package/dist/commonjs/operations/calculateRefund.js +1 -0
  36. package/dist/commonjs/operations/calculateRefund.js.map +1 -1
  37. package/dist/commonjs/operations/exchange.js +12 -6
  38. package/dist/commonjs/operations/exchange.js.map +1 -1
  39. package/dist/commonjs/operations/operation.js +23 -39
  40. package/dist/commonjs/operations/operation.js.map +1 -1
  41. package/dist/commonjs/operations/quota.js +45 -51
  42. package/dist/commonjs/operations/quota.js.map +1 -1
  43. package/dist/commonjs/operations/quotaRequestStatus.js +23 -39
  44. package/dist/commonjs/operations/quotaRequestStatus.js.map +1 -1
  45. package/dist/commonjs/operations/reservation.js +111 -141
  46. package/dist/commonjs/operations/reservation.js.map +1 -1
  47. package/dist/commonjs/operations/reservationOrder.js +34 -45
  48. package/dist/commonjs/operations/reservationOrder.js.map +1 -1
  49. package/dist/commonjs/operations/return.js +12 -6
  50. package/dist/commonjs/operations/return.js.map +1 -1
  51. package/dist/commonjs/pagingHelper.js +2 -4
  52. package/dist/commonjs/pagingHelper.js.map +1 -1
  53. package/dist/commonjs/tsdoc-metadata.json +11 -11
  54. package/dist/esm/azureReservationAPI.js +42 -45
  55. package/dist/esm/azureReservationAPI.js.map +1 -1
  56. package/dist/esm/lroImpl.js +7 -3
  57. package/dist/esm/lroImpl.js.map +1 -1
  58. package/dist/esm/models/mappers.js +21 -9
  59. package/dist/esm/models/mappers.js.map +1 -1
  60. package/dist/esm/operations/calculateExchange.js +12 -6
  61. package/dist/esm/operations/calculateExchange.js.map +1 -1
  62. package/dist/esm/operations/calculateRefund.js +1 -0
  63. package/dist/esm/operations/calculateRefund.js.map +1 -1
  64. package/dist/esm/operations/exchange.js +12 -6
  65. package/dist/esm/operations/exchange.js.map +1 -1
  66. package/dist/esm/operations/operation.js +23 -40
  67. package/dist/esm/operations/operation.js.map +1 -1
  68. package/dist/esm/operations/quota.js +45 -52
  69. package/dist/esm/operations/quota.js.map +1 -1
  70. package/dist/esm/operations/quotaRequestStatus.js +23 -40
  71. package/dist/esm/operations/quotaRequestStatus.js.map +1 -1
  72. package/dist/esm/operations/reservation.js +111 -142
  73. package/dist/esm/operations/reservation.js.map +1 -1
  74. package/dist/esm/operations/reservationOrder.js +34 -46
  75. package/dist/esm/operations/reservationOrder.js.map +1 -1
  76. package/dist/esm/operations/return.js +12 -6
  77. package/dist/esm/operations/return.js.map +1 -1
  78. package/dist/esm/pagingHelper.js +2 -4
  79. package/dist/esm/pagingHelper.js.map +1 -1
  80. package/dist/react-native/azureReservationAPI.js +42 -45
  81. package/dist/react-native/azureReservationAPI.js.map +1 -1
  82. package/dist/react-native/lroImpl.js +7 -3
  83. package/dist/react-native/lroImpl.js.map +1 -1
  84. package/dist/react-native/models/mappers.js +21 -9
  85. package/dist/react-native/models/mappers.js.map +1 -1
  86. package/dist/react-native/operations/calculateExchange.js +12 -6
  87. package/dist/react-native/operations/calculateExchange.js.map +1 -1
  88. package/dist/react-native/operations/calculateRefund.js +1 -0
  89. package/dist/react-native/operations/calculateRefund.js.map +1 -1
  90. package/dist/react-native/operations/exchange.js +12 -6
  91. package/dist/react-native/operations/exchange.js.map +1 -1
  92. package/dist/react-native/operations/operation.js +23 -40
  93. package/dist/react-native/operations/operation.js.map +1 -1
  94. package/dist/react-native/operations/quota.js +45 -52
  95. package/dist/react-native/operations/quota.js.map +1 -1
  96. package/dist/react-native/operations/quotaRequestStatus.js +23 -40
  97. package/dist/react-native/operations/quotaRequestStatus.js.map +1 -1
  98. package/dist/react-native/operations/reservation.js +111 -142
  99. package/dist/react-native/operations/reservation.js.map +1 -1
  100. package/dist/react-native/operations/reservationOrder.js +34 -46
  101. package/dist/react-native/operations/reservationOrder.js.map +1 -1
  102. package/dist/react-native/operations/return.js +12 -6
  103. package/dist/react-native/operations/return.js.map +1 -1
  104. package/dist/react-native/pagingHelper.js +2 -4
  105. package/dist/react-native/pagingHelper.js.map +1 -1
  106. package/package.json +2 -2
  107. package/review/arm-reservations-node.api.md +1675 -1675
@@ -12,6 +12,7 @@ import { createHttpPoller } from "@azure/core-lro";
12
12
  import { createLroSpec } from "../lroImpl.js";
13
13
  /** Class containing CalculateExchange operations. */
14
14
  export class CalculateExchangeImpl {
15
+ client;
15
16
  /**
16
17
  * Initialize a new instance of the class CalculateExchange class.
17
18
  * @param client Reference to the service client
@@ -30,14 +31,19 @@ export class CalculateExchangeImpl {
30
31
  return this.client.sendOperationRequest(args, spec);
31
32
  };
32
33
  const sendOperationFn = async (args, spec) => {
33
- var _a;
34
34
  let currentRawResponse = undefined;
35
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
35
+ const providedCallback = args.options?.onResponse;
36
36
  const callback = (rawResponse, flatResponse) => {
37
37
  currentRawResponse = rawResponse;
38
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
38
+ providedCallback?.(rawResponse, flatResponse);
39
+ };
40
+ const updatedArgs = {
41
+ ...args,
42
+ options: {
43
+ ...args.options,
44
+ onResponse: callback
45
+ }
39
46
  };
40
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
41
47
  const flatResponse = await directSendOperation(updatedArgs, spec);
42
48
  return {
43
49
  flatResponse,
@@ -54,8 +60,8 @@ export class CalculateExchangeImpl {
54
60
  spec: postOperationSpec
55
61
  });
56
62
  const poller = await createHttpPoller(lro, {
57
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
58
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
63
+ restoreFrom: options?.resumeFrom,
64
+ intervalInMs: options?.updateIntervalInMs,
59
65
  resourceLocationConfig: "azure-async-operation"
60
66
  });
61
67
  await poller.poll();
@@ -1 +1 @@
1
- {"version":3,"file":"calculateExchange.js","sourceRoot":"","sources":["../../../src/operations/calculateExchange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAA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AAO,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"]}
1
+ {"version":3,"file":"calculateExchange.js","sourceRoot":"","sources":["../../../src/operations/calculateExchange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAO9C,qDAAqD;AACrD,MAAM,OAAO,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,MA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GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wCAAwC;SAC7D;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wCAAwC;SAC7D;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wCAAwC;SAC7D;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,wCAAwC;SAC7D;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,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"]}
@@ -10,6 +10,7 @@ import * as Mappers from "../models/mappers.js";
10
10
  import * as Parameters from "../models/parameters.js";
11
11
  /** Class containing CalculateRefund operations. */
12
12
  export class CalculateRefundImpl {
13
+ client;
13
14
  /**
14
15
  * Initialize a new instance of the class CalculateRefund class.
15
16
  * @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,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAQtD,mDAAmD;AACnD,MAAM,OAAO,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;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,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAQtD,mDAAmD;AACnD,MAAM,OAAO,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;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"]}
@@ -12,6 +12,7 @@ import { createHttpPoller } from "@azure/core-lro";
12
12
  import { createLroSpec } from "../lroImpl.js";
13
13
  /** Class containing Exchange operations. */
14
14
  export class ExchangeImpl {
15
+ client;
15
16
  /**
16
17
  * Initialize a new instance of the class Exchange class.
17
18
  * @param client Reference to the service client
@@ -30,14 +31,19 @@ export class ExchangeImpl {
30
31
  return this.client.sendOperationRequest(args, spec);
31
32
  };
32
33
  const sendOperationFn = async (args, spec) => {
33
- var _a;
34
34
  let currentRawResponse = undefined;
35
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
35
+ const providedCallback = args.options?.onResponse;
36
36
  const callback = (rawResponse, flatResponse) => {
37
37
  currentRawResponse = rawResponse;
38
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
38
+ providedCallback?.(rawResponse, flatResponse);
39
+ };
40
+ const updatedArgs = {
41
+ ...args,
42
+ options: {
43
+ ...args.options,
44
+ onResponse: callback
45
+ }
39
46
  };
40
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
41
47
  const flatResponse = await directSendOperation(updatedArgs, spec);
42
48
  return {
43
49
  flatResponse,
@@ -54,8 +60,8 @@ export class ExchangeImpl {
54
60
  spec: postOperationSpec
55
61
  });
56
62
  const poller = await createHttpPoller(lro, {
57
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
58
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
63
+ restoreFrom: options?.resumeFrom,
64
+ intervalInMs: options?.updateIntervalInMs,
59
65
  resourceLocationConfig: "azure-async-operation"
60
66
  });
61
67
  await poller.poll();
@@ -1 +1 @@
1
- {"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../../src/operations/exchange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAO9C,4CAA4C;AAC5C,MAAM,OAAO,YAAY;IAGvB;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,IAAqB,EACrB,OAAoC;QAIpC,MAAM,mBAAmB,GAAG,KAAK,EAC/B,IAAmC,EACnC,IAA8B,EACC,EAAE;YACjC,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,MAAA,IAAI,CAAC,OAAO,0CAAE,UAAU,CAAC;YAClD,MAAM,QAAQ,GAAmC,CAC/C,WAA6C,EAC7C,YAAqB,EACrB,EAAE;gBACF,kBAAkB,GAA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AO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,wCAAwC;IAC9C,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,+BAA+B;SACpD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,+BAA+B;SACpD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,+BAA+B;SACpD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,+BAA+B;SACpD;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,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"]}
1
+ {"version":3,"file":"exchange.js","sourceRoot":"","sources":["../../../src/operations/exchange.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAO9C,4CAA4C;AAC5C,MAAM,OAAO,YAAY;IACN,MAAM,CAAsB;IAE7C;;;OAGG;IACH,YAAY,MAA2B;QACrC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CACb,IAAqB,EACrB,OAAoC;QAIpC,MAAM,mBAAmB,GAAG,KAAK,EAC/B,IAAmC,EACnC,IAA8B,EACC,EAAE;YACjC,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtD,CAAC,CAAC;QACF,MAAM,eAAe,GAAG,KAA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AM,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;IAChC,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,wCAAwC;IAC9C,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,+BAA+B;SACpD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,+BAA+B;SACpD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,+BAA+B;SACpD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,+BAA+B;SACpD;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,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"]}
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import { setContinuationToken } from "../pagingHelper.js";
10
9
  import * as coreClient from "@azure/core-client";
11
10
  import * as Mappers from "../models/mappers.js";
@@ -13,6 +12,7 @@ import * as Parameters from "../models/parameters.js";
13
12
  /// <reference lib="esnext.asynciterable" />
14
13
  /** Class containing Operation operations. */
15
14
  export class OperationImpl {
15
+ client;
16
16
  /**
17
17
  * Initialize a new instance of the class Operation class.
18
18
  * @param client Reference to the service client
@@ -34,52 +34,35 @@ export class OperationImpl {
34
34
  return this;
35
35
  },
36
36
  byPage: (settings) => {
37
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
37
+ if (settings?.maxPageSize) {
38
38
  throw new Error("maxPageSize is not supported by this operation.");
39
39
  }
40
40
  return this.listPagingPage(options, settings);
41
41
  }
42
42
  };
43
43
  }
44
- listPagingPage(options, settings) {
45
- return __asyncGenerator(this, arguments, function* listPagingPage_1() {
46
- let result;
47
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
48
- if (!continuationToken) {
49
- result = yield __await(this._list(options));
50
- let page = result.value || [];
51
- continuationToken = result.nextLink;
52
- setContinuationToken(page, continuationToken);
53
- yield yield __await(page);
54
- }
55
- while (continuationToken) {
56
- result = yield __await(this._listNext(continuationToken, options));
57
- continuationToken = result.nextLink;
58
- let page = result.value || [];
59
- setContinuationToken(page, continuationToken);
60
- yield yield __await(page);
61
- }
62
- });
44
+ async *listPagingPage(options, settings) {
45
+ let result;
46
+ let continuationToken = settings?.continuationToken;
47
+ if (!continuationToken) {
48
+ result = await this._list(options);
49
+ let page = result.value || [];
50
+ continuationToken = result.nextLink;
51
+ setContinuationToken(page, continuationToken);
52
+ yield page;
53
+ }
54
+ while (continuationToken) {
55
+ result = await this._listNext(continuationToken, options);
56
+ continuationToken = result.nextLink;
57
+ let page = result.value || [];
58
+ setContinuationToken(page, continuationToken);
59
+ yield page;
60
+ }
63
61
  }
64
- listPagingAll(options) {
65
- return __asyncGenerator(this, arguments, function* listPagingAll_1() {
66
- var _a, e_1, _b, _c;
67
- try {
68
- for (var _d = true, _e = __asyncValues(this.listPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
69
- _c = _f.value;
70
- _d = false;
71
- const page = _c;
72
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
73
- }
74
- }
75
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
76
- finally {
77
- try {
78
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
79
- }
80
- finally { if (e_1) throw e_1.error; }
81
- }
82
- });
62
+ async *listPagingAll(options) {
63
+ for await (const page of this.listPagingPage(options)) {
64
+ yield* page;
65
+ }
83
66
  }
84
67
  /**
85
68
  * List all the operations.
@@ -1 +1 @@
1
- {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/operations/operation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAUtD,4CAA4C;AAC5C,6CAA6C;AAC7C,MAAM,OAAO,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,CAAC;oBAC1B,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;gBACrE,CAAC;gBACD,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;YAChD,CAAC;SACF,CAAC;IACJ,CAAC;IAEc,cAAc,CAC3B,OAAqC,EACrC,QAAuB;;YAEvB,IAAI,MAA6B,CAAC;YAClC,IAAI,iBAAiB,GAAG,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,iBAAiB,CAAC;YACpD,IAAI,CAAC,iBAAiB,EAAE,CAAC;gBACvB,MAAM,GAAG,cAAM,IAAI,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AC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,0CAA0C;IAChD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;IACjC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;QACD,OAAO,EAAE;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"]}
1
+ {"version":3,"file":"operation.js","sourceRoot":"","sources":["../../../src/operations/operation.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAUtD,4CAA4C;AAC5C,6CAA6C;AAC7C,MAAM,OAAO,aAAa;IACP,MAAM,CAAsB;IAE7C;;;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;gBACl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oBAAoB,CAAC,EAAE,OAAO,EAAE,EAAE,iBAAiB,CAAC,CAAC;IAC1E,CAAC;IAED;;;;OAIG;IACK,SAAS,CACf,QAAgB,EAChB,OAAyC;QAEzC,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,QAAQ,EAAE,OAAO,EAAE,EACrB,qBAAqB,CACtB,CAAC;IACJ,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EAAE,0CAA0C;IAChD,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,UAAU;SAC/B;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;IACjC,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;QACD,OAAO,EAAE;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"]}
@@ -5,7 +5,6 @@
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
9
8
  import { setContinuationToken } from "../pagingHelper.js";
10
9
  import * as coreClient from "@azure/core-client";
11
10
  import * as Mappers from "../models/mappers.js";
@@ -15,6 +14,7 @@ import { createLroSpec } from "../lroImpl.js";
15
14
  /// <reference lib="esnext.asynciterable" />
16
15
  /** Class containing Quota operations. */
17
16
  export class QuotaImpl {
17
+ client;
18
18
  /**
19
19
  * Initialize a new instance of the class Quota class.
20
20
  * @param client Reference to the service client
@@ -40,52 +40,35 @@ export class QuotaImpl {
40
40
  return this;
41
41
  },
42
42
  byPage: (settings) => {
43
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
43
+ if (settings?.maxPageSize) {
44
44
  throw new Error("maxPageSize is not supported by this operation.");
45
45
  }
46
46
  return this.listPagingPage(subscriptionId, providerId, location, options, settings);
47
47
  }
48
48
  };
49
49
  }
50
- listPagingPage(subscriptionId, providerId, location, options, settings) {
51
- return __asyncGenerator(this, arguments, function* listPagingPage_1() {
52
- let result;
53
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
54
- if (!continuationToken) {
55
- result = yield __await(this._list(subscriptionId, providerId, location, options));
56
- let page = result.value || [];
57
- continuationToken = result.nextLink;
58
- setContinuationToken(page, continuationToken);
59
- yield yield __await(page);
60
- }
61
- while (continuationToken) {
62
- result = yield __await(this._listNext(subscriptionId, providerId, location, continuationToken, options));
63
- continuationToken = result.nextLink;
64
- let page = result.value || [];
65
- setContinuationToken(page, continuationToken);
66
- yield yield __await(page);
67
- }
68
- });
50
+ async *listPagingPage(subscriptionId, providerId, location, options, settings) {
51
+ let result;
52
+ let continuationToken = settings?.continuationToken;
53
+ if (!continuationToken) {
54
+ result = await this._list(subscriptionId, providerId, location, options);
55
+ let page = result.value || [];
56
+ continuationToken = result.nextLink;
57
+ setContinuationToken(page, continuationToken);
58
+ yield page;
59
+ }
60
+ while (continuationToken) {
61
+ result = await this._listNext(subscriptionId, providerId, location, continuationToken, options);
62
+ continuationToken = result.nextLink;
63
+ let page = result.value || [];
64
+ setContinuationToken(page, continuationToken);
65
+ yield page;
66
+ }
69
67
  }
70
- listPagingAll(subscriptionId, providerId, location, options) {
71
- return __asyncGenerator(this, arguments, function* listPagingAll_1() {
72
- var _a, e_1, _b, _c;
73
- try {
74
- for (var _d = true, _e = __asyncValues(this.listPagingPage(subscriptionId, providerId, location, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
75
- _c = _f.value;
76
- _d = false;
77
- const page = _c;
78
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
79
- }
80
- }
81
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
82
- finally {
83
- try {
84
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
85
- }
86
- finally { if (e_1) throw e_1.error; }
87
- }
88
- });
68
+ async *listPagingAll(subscriptionId, providerId, location, options) {
69
+ for await (const page of this.listPagingPage(subscriptionId, providerId, location, options)) {
70
+ yield* page;
71
+ }
89
72
  }
90
73
  /**
91
74
  * Get the current quota (service limit) and usage of a resource. You can use the response from the GET
@@ -121,14 +104,19 @@ export class QuotaImpl {
121
104
  return this.client.sendOperationRequest(args, spec);
122
105
  };
123
106
  const sendOperationFn = async (args, spec) => {
124
- var _a;
125
107
  let currentRawResponse = undefined;
126
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
108
+ const providedCallback = args.options?.onResponse;
127
109
  const callback = (rawResponse, flatResponse) => {
128
110
  currentRawResponse = rawResponse;
129
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
111
+ providedCallback?.(rawResponse, flatResponse);
112
+ };
113
+ const updatedArgs = {
114
+ ...args,
115
+ options: {
116
+ ...args.options,
117
+ onResponse: callback
118
+ }
130
119
  };
131
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
132
120
  const flatResponse = await directSendOperation(updatedArgs, spec);
133
121
  return {
134
122
  flatResponse,
@@ -152,8 +140,8 @@ export class QuotaImpl {
152
140
  spec: createOrUpdateOperationSpec
153
141
  });
154
142
  const poller = await createHttpPoller(lro, {
155
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
156
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
143
+ restoreFrom: options?.resumeFrom,
144
+ intervalInMs: options?.updateIntervalInMs,
157
145
  resourceLocationConfig: "original-uri"
158
146
  });
159
147
  await poller.poll();
@@ -199,14 +187,19 @@ export class QuotaImpl {
199
187
  return this.client.sendOperationRequest(args, spec);
200
188
  };
201
189
  const sendOperationFn = async (args, spec) => {
202
- var _a;
203
190
  let currentRawResponse = undefined;
204
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
191
+ const providedCallback = args.options?.onResponse;
205
192
  const callback = (rawResponse, flatResponse) => {
206
193
  currentRawResponse = rawResponse;
207
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
194
+ providedCallback?.(rawResponse, flatResponse);
195
+ };
196
+ const updatedArgs = {
197
+ ...args,
198
+ options: {
199
+ ...args.options,
200
+ onResponse: callback
201
+ }
208
202
  };
209
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
210
203
  const flatResponse = await directSendOperation(updatedArgs, spec);
211
204
  return {
212
205
  flatResponse,
@@ -230,8 +223,8 @@ export class QuotaImpl {
230
223
  spec: updateOperationSpec
231
224
  });
232
225
  const poller = await createHttpPoller(lro, {
233
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
234
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
226
+ restoreFrom: options?.resumeFrom,
227
+ intervalInMs: options?.updateIntervalInMs,
235
228
  resourceLocationConfig: "original-uri"
236
229
  });
237
230
  await poller.poll();
@@ -1 +1 @@
1
- {"version":3,"file":"quota.js","sourceRoot":"","sources":["../../../src/operations/quota.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAe9C,4CAA4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AAE,CAAC,UAAU,CAAC,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,iBAAiB,GAA6B;IAClD,IAAI,EACF,gIAAgI;IAClI,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,WAAW;YAC/B,aAAa,EAAE,OAAO,CAAC,gBAAgB;SACxC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC;IACzC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;KACrB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,YAAY;IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,WAAW;YAC/B,aAAa,EAAE,OAAO,CAAC,oBAAoB;SAC5C;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,iBAAiB;SACtC;KACF;IACD,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;KACrB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { 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,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAe9C,4CAA4C;AAC5C,yCAAyC;AACzC,MAAM,OAAO,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,CA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KAAK;QAChB,UAAU,CAAC,QAAQ;QACnB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;KACrB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { PagedAsyncIterableIterator, PageSettings } from \"@azure/core-paging\";\nimport { setContinuationToken } from \"../pagingHelper.js\";\nimport { 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"]}