@azure/arm-costmanagement 1.0.0-alpha.20250718.1 → 1.0.0-alpha.20250730.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 (163) hide show
  1. package/dist/browser/costManagementClient.js +28 -5
  2. package/dist/browser/costManagementClient.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 +256 -117
  6. package/dist/browser/models/mappers.js.map +1 -1
  7. package/dist/browser/operations/alerts.js +1 -0
  8. package/dist/browser/operations/alerts.js.map +1 -1
  9. package/dist/browser/operations/benefitRecommendations.js +23 -40
  10. package/dist/browser/operations/benefitRecommendations.js.map +1 -1
  11. package/dist/browser/operations/benefitUtilizationSummaries.js +89 -157
  12. package/dist/browser/operations/benefitUtilizationSummaries.js.map +1 -1
  13. package/dist/browser/operations/dimensions.js +19 -53
  14. package/dist/browser/operations/dimensions.js.map +1 -1
  15. package/dist/browser/operations/exports.js +1 -0
  16. package/dist/browser/operations/exports.js.map +1 -1
  17. package/dist/browser/operations/forecast.js +1 -0
  18. package/dist/browser/operations/forecast.js.map +1 -1
  19. package/dist/browser/operations/generateCostDetailsReport.js +23 -12
  20. package/dist/browser/operations/generateCostDetailsReport.js.map +1 -1
  21. package/dist/browser/operations/generateDetailedCostReport.js +12 -6
  22. package/dist/browser/operations/generateDetailedCostReport.js.map +1 -1
  23. package/dist/browser/operations/generateDetailedCostReportOperationResults.js +12 -6
  24. package/dist/browser/operations/generateDetailedCostReportOperationResults.js.map +1 -1
  25. package/dist/browser/operations/generateDetailedCostReportOperationStatus.js +1 -0
  26. package/dist/browser/operations/generateDetailedCostReportOperationStatus.js.map +1 -1
  27. package/dist/browser/operations/generateReservationDetailsReport.js +23 -12
  28. package/dist/browser/operations/generateReservationDetailsReport.js.map +1 -1
  29. package/dist/browser/operations/operations.js +23 -40
  30. package/dist/browser/operations/operations.js.map +1 -1
  31. package/dist/browser/operations/priceSheet.js +23 -12
  32. package/dist/browser/operations/priceSheet.js.map +1 -1
  33. package/dist/browser/operations/query.js +1 -0
  34. package/dist/browser/operations/query.js.map +1 -1
  35. package/dist/browser/operations/scheduledActions.js +45 -79
  36. package/dist/browser/operations/scheduledActions.js.map +1 -1
  37. package/dist/browser/operations/views.js +45 -79
  38. package/dist/browser/operations/views.js.map +1 -1
  39. package/dist/browser/pagingHelper.js +2 -4
  40. package/dist/browser/pagingHelper.js.map +1 -1
  41. package/dist/commonjs/costManagementClient.js +28 -5
  42. package/dist/commonjs/costManagementClient.js.map +1 -1
  43. package/dist/commonjs/lroImpl.js +7 -3
  44. package/dist/commonjs/lroImpl.js.map +1 -1
  45. package/dist/commonjs/models/mappers.js +256 -117
  46. package/dist/commonjs/models/mappers.js.map +1 -1
  47. package/dist/commonjs/operations/alerts.js +1 -0
  48. package/dist/commonjs/operations/alerts.js.map +1 -1
  49. package/dist/commonjs/operations/benefitRecommendations.js +23 -39
  50. package/dist/commonjs/operations/benefitRecommendations.js.map +1 -1
  51. package/dist/commonjs/operations/benefitUtilizationSummaries.js +89 -156
  52. package/dist/commonjs/operations/benefitUtilizationSummaries.js.map +1 -1
  53. package/dist/commonjs/operations/dimensions.js +19 -52
  54. package/dist/commonjs/operations/dimensions.js.map +1 -1
  55. package/dist/commonjs/operations/exports.js +1 -0
  56. package/dist/commonjs/operations/exports.js.map +1 -1
  57. package/dist/commonjs/operations/forecast.js +1 -0
  58. package/dist/commonjs/operations/forecast.js.map +1 -1
  59. package/dist/commonjs/operations/generateCostDetailsReport.js +23 -12
  60. package/dist/commonjs/operations/generateCostDetailsReport.js.map +1 -1
  61. package/dist/commonjs/operations/generateDetailedCostReport.js +12 -6
  62. package/dist/commonjs/operations/generateDetailedCostReport.js.map +1 -1
  63. package/dist/commonjs/operations/generateDetailedCostReportOperationResults.js +12 -6
  64. package/dist/commonjs/operations/generateDetailedCostReportOperationResults.js.map +1 -1
  65. package/dist/commonjs/operations/generateDetailedCostReportOperationStatus.js +1 -0
  66. package/dist/commonjs/operations/generateDetailedCostReportOperationStatus.js.map +1 -1
  67. package/dist/commonjs/operations/generateReservationDetailsReport.js +23 -12
  68. package/dist/commonjs/operations/generateReservationDetailsReport.js.map +1 -1
  69. package/dist/commonjs/operations/operations.js +23 -39
  70. package/dist/commonjs/operations/operations.js.map +1 -1
  71. package/dist/commonjs/operations/priceSheet.js +23 -12
  72. package/dist/commonjs/operations/priceSheet.js.map +1 -1
  73. package/dist/commonjs/operations/query.js +1 -0
  74. package/dist/commonjs/operations/query.js.map +1 -1
  75. package/dist/commonjs/operations/scheduledActions.js +45 -78
  76. package/dist/commonjs/operations/scheduledActions.js.map +1 -1
  77. package/dist/commonjs/operations/views.js +45 -78
  78. package/dist/commonjs/operations/views.js.map +1 -1
  79. package/dist/commonjs/pagingHelper.js +2 -4
  80. package/dist/commonjs/pagingHelper.js.map +1 -1
  81. package/dist/commonjs/tsdoc-metadata.json +11 -11
  82. package/dist/esm/costManagementClient.js +28 -5
  83. package/dist/esm/costManagementClient.js.map +1 -1
  84. package/dist/esm/lroImpl.js +7 -3
  85. package/dist/esm/lroImpl.js.map +1 -1
  86. package/dist/esm/models/mappers.js +256 -117
  87. package/dist/esm/models/mappers.js.map +1 -1
  88. package/dist/esm/operations/alerts.js +1 -0
  89. package/dist/esm/operations/alerts.js.map +1 -1
  90. package/dist/esm/operations/benefitRecommendations.js +23 -40
  91. package/dist/esm/operations/benefitRecommendations.js.map +1 -1
  92. package/dist/esm/operations/benefitUtilizationSummaries.js +89 -157
  93. package/dist/esm/operations/benefitUtilizationSummaries.js.map +1 -1
  94. package/dist/esm/operations/dimensions.js +19 -53
  95. package/dist/esm/operations/dimensions.js.map +1 -1
  96. package/dist/esm/operations/exports.js +1 -0
  97. package/dist/esm/operations/exports.js.map +1 -1
  98. package/dist/esm/operations/forecast.js +1 -0
  99. package/dist/esm/operations/forecast.js.map +1 -1
  100. package/dist/esm/operations/generateCostDetailsReport.js +23 -12
  101. package/dist/esm/operations/generateCostDetailsReport.js.map +1 -1
  102. package/dist/esm/operations/generateDetailedCostReport.js +12 -6
  103. package/dist/esm/operations/generateDetailedCostReport.js.map +1 -1
  104. package/dist/esm/operations/generateDetailedCostReportOperationResults.js +12 -6
  105. package/dist/esm/operations/generateDetailedCostReportOperationResults.js.map +1 -1
  106. package/dist/esm/operations/generateDetailedCostReportOperationStatus.js +1 -0
  107. package/dist/esm/operations/generateDetailedCostReportOperationStatus.js.map +1 -1
  108. package/dist/esm/operations/generateReservationDetailsReport.js +23 -12
  109. package/dist/esm/operations/generateReservationDetailsReport.js.map +1 -1
  110. package/dist/esm/operations/operations.js +23 -40
  111. package/dist/esm/operations/operations.js.map +1 -1
  112. package/dist/esm/operations/priceSheet.js +23 -12
  113. package/dist/esm/operations/priceSheet.js.map +1 -1
  114. package/dist/esm/operations/query.js +1 -0
  115. package/dist/esm/operations/query.js.map +1 -1
  116. package/dist/esm/operations/scheduledActions.js +45 -79
  117. package/dist/esm/operations/scheduledActions.js.map +1 -1
  118. package/dist/esm/operations/views.js +45 -79
  119. package/dist/esm/operations/views.js.map +1 -1
  120. package/dist/esm/pagingHelper.js +2 -4
  121. package/dist/esm/pagingHelper.js.map +1 -1
  122. package/dist/react-native/costManagementClient.js +28 -5
  123. package/dist/react-native/costManagementClient.js.map +1 -1
  124. package/dist/react-native/lroImpl.js +7 -3
  125. package/dist/react-native/lroImpl.js.map +1 -1
  126. package/dist/react-native/models/mappers.js +256 -117
  127. package/dist/react-native/models/mappers.js.map +1 -1
  128. package/dist/react-native/operations/alerts.js +1 -0
  129. package/dist/react-native/operations/alerts.js.map +1 -1
  130. package/dist/react-native/operations/benefitRecommendations.js +23 -40
  131. package/dist/react-native/operations/benefitRecommendations.js.map +1 -1
  132. package/dist/react-native/operations/benefitUtilizationSummaries.js +89 -157
  133. package/dist/react-native/operations/benefitUtilizationSummaries.js.map +1 -1
  134. package/dist/react-native/operations/dimensions.js +19 -53
  135. package/dist/react-native/operations/dimensions.js.map +1 -1
  136. package/dist/react-native/operations/exports.js +1 -0
  137. package/dist/react-native/operations/exports.js.map +1 -1
  138. package/dist/react-native/operations/forecast.js +1 -0
  139. package/dist/react-native/operations/forecast.js.map +1 -1
  140. package/dist/react-native/operations/generateCostDetailsReport.js +23 -12
  141. package/dist/react-native/operations/generateCostDetailsReport.js.map +1 -1
  142. package/dist/react-native/operations/generateDetailedCostReport.js +12 -6
  143. package/dist/react-native/operations/generateDetailedCostReport.js.map +1 -1
  144. package/dist/react-native/operations/generateDetailedCostReportOperationResults.js +12 -6
  145. package/dist/react-native/operations/generateDetailedCostReportOperationResults.js.map +1 -1
  146. package/dist/react-native/operations/generateDetailedCostReportOperationStatus.js +1 -0
  147. package/dist/react-native/operations/generateDetailedCostReportOperationStatus.js.map +1 -1
  148. package/dist/react-native/operations/generateReservationDetailsReport.js +23 -12
  149. package/dist/react-native/operations/generateReservationDetailsReport.js.map +1 -1
  150. package/dist/react-native/operations/operations.js +23 -40
  151. package/dist/react-native/operations/operations.js.map +1 -1
  152. package/dist/react-native/operations/priceSheet.js +23 -12
  153. package/dist/react-native/operations/priceSheet.js.map +1 -1
  154. package/dist/react-native/operations/query.js +1 -0
  155. package/dist/react-native/operations/query.js.map +1 -1
  156. package/dist/react-native/operations/scheduledActions.js +45 -79
  157. package/dist/react-native/operations/scheduledActions.js.map +1 -1
  158. package/dist/react-native/operations/views.js +45 -79
  159. package/dist/react-native/operations/views.js.map +1 -1
  160. package/dist/react-native/pagingHelper.js +2 -4
  161. package/dist/react-native/pagingHelper.js.map +1 -1
  162. package/package.json +2 -2
  163. package/review/arm-costmanagement-node.api.md +2064 -2064
@@ -1 +1 @@
1
- {"version":3,"file":"generateCostDetailsReport.js","sourceRoot":"","sources":["../../../src/operations/generateCostDetailsReport.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAS9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E,UAAU,CAAC,WAAW,CAAC;IAC5E,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 { GenerateCostDetailsReport } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n GenerateCostDetailsReportRequestDefinition,\n GenerateCostDetailsReportCreateOperationOptionalParams,\n GenerateCostDetailsReportCreateOperationResponse,\n GenerateCostDetailsReportGetOperationResultsOptionalParams,\n GenerateCostDetailsReportGetOperationResultsResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateCostDetailsReport operations. */\nexport class GenerateCostDetailsReportImpl\n implements GenerateCostDetailsReport {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateCostDetailsReport class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * This API is the replacement for all previously release Usage Details APIs. Request to generate a\n * cost details report for the provided date range, billing period (Only enterprise customers) or\n * Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202\n * with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll\n * to get the result of the report generation. The 'Retry-After' provides the duration to wait before\n * polling for the generated report. A call to poll the report operation will provide a 202 response\n * with a 'Location' header if the operation is still in progress. Once the report generation operation\n * completes, the polling endpoint will provide a 200 response along with details on the report blob(s)\n * that are available for download. The details on the file(s) available for download will be available\n * in the polling response body. To Understand cost details (formerly known as usage details) fields\n * found in files ,see\n * https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param parameters Parameters supplied to the Create cost details operation.\n * @param options The options parameters.\n */\n async beginCreateOperation(\n scope: string,\n parameters: GenerateCostDetailsReportRequestDefinition,\n options?: GenerateCostDetailsReportCreateOperationOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<GenerateCostDetailsReportCreateOperationResponse>,\n GenerateCostDetailsReportCreateOperationResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateCostDetailsReportCreateOperationResponse> => {\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: { scope, parameters, options },\n spec: createOperationOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateCostDetailsReportCreateOperationResponse,\n OperationState<GenerateCostDetailsReportCreateOperationResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * This API is the replacement for all previously release Usage Details APIs. Request to generate a\n * cost details report for the provided date range, billing period (Only enterprise customers) or\n * Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202\n * with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll\n * to get the result of the report generation. The 'Retry-After' provides the duration to wait before\n * polling for the generated report. A call to poll the report operation will provide a 202 response\n * with a 'Location' header if the operation is still in progress. Once the report generation operation\n * completes, the polling endpoint will provide a 200 response along with details on the report blob(s)\n * that are available for download. The details on the file(s) available for download will be available\n * in the polling response body. To Understand cost details (formerly known as usage details) fields\n * found in files ,see\n * https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param parameters Parameters supplied to the Create cost details operation.\n * @param options The options parameters.\n */\n async beginCreateOperationAndWait(\n scope: string,\n parameters: GenerateCostDetailsReportRequestDefinition,\n options?: GenerateCostDetailsReportCreateOperationOptionalParams\n ): Promise<GenerateCostDetailsReportCreateOperationResponse> {\n const poller = await this.beginCreateOperation(scope, parameters, options);\n return poller.pollUntilDone();\n }\n\n /**\n * Get the result of the specified operation. This link is provided in the CostDetails creation request\n * response Location header.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param operationId The target operation Id.\n * @param options The options parameters.\n */\n async beginGetOperationResults(\n scope: string,\n operationId: string,\n options?: GenerateCostDetailsReportGetOperationResultsOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<GenerateCostDetailsReportGetOperationResultsResponse>,\n GenerateCostDetailsReportGetOperationResultsResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateCostDetailsReportGetOperationResultsResponse> => {\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: { scope, operationId, options },\n spec: getOperationResultsOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateCostDetailsReportGetOperationResultsResponse,\n OperationState<GenerateCostDetailsReportGetOperationResultsResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Get the result of the specified operation. This link is provided in the CostDetails creation request\n * response Location header.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param operationId The target operation Id.\n * @param options The options parameters.\n */\n async beginGetOperationResultsAndWait(\n scope: string,\n operationId: string,\n options?: GenerateCostDetailsReportGetOperationResultsOptionalParams\n ): Promise<GenerateCostDetailsReportGetOperationResultsResponse> {\n const poller = await this.beginGetOperationResults(\n scope,\n operationId,\n options\n );\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createOperationOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 201: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 202: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 204: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n default: {\n bodyMapper: Mappers.GenerateCostDetailsReportErrorResponse\n }\n },\n requestBody: Parameters.parameters5,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getOperationResultsOperationSpec: coreClient.OperationSpec = {\n path:\n \"/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 201: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 202: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 204: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1, Parameters.operationId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
1
+ {"version":3,"file":"generateCostDetailsReport.js","sourceRoot":"","sources":["../../../src/operations/generateCostDetailsReport.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAS9C,6DAA6D;AAC7D,MAAa,6BAA6B;IAEvB,MAAM,CAAuB;IAE9C;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;;;;;;;;OAiBG;IACH,KAAK,CAAC,oBAAoB,CACxB,KAAa,EACb,UAAsD,EACtD,OAAgE;QAOhE,MAAM,mBAAmB,GAAG,KAAK,EAC/B,IAAmC,EACnC,IAA8B,EAC6B,EAAE;YAC7D,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtD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Ae,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;IACpD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC;IAC7D,SAAS,EAAE,MAAM;IACjB,UAAU;CACX,CAAC;AACF,MAAM,gCAAgC,GAA6B;IACjE,IAAI,EACF,uFAAuF;IACzF,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2BAA2B;SAChD;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC;IAC5E,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 { GenerateCostDetailsReport } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n GenerateCostDetailsReportRequestDefinition,\n GenerateCostDetailsReportCreateOperationOptionalParams,\n GenerateCostDetailsReportCreateOperationResponse,\n GenerateCostDetailsReportGetOperationResultsOptionalParams,\n GenerateCostDetailsReportGetOperationResultsResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateCostDetailsReport operations. */\nexport class GenerateCostDetailsReportImpl\n implements GenerateCostDetailsReport {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateCostDetailsReport class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * This API is the replacement for all previously release Usage Details APIs. Request to generate a\n * cost details report for the provided date range, billing period (Only enterprise customers) or\n * Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202\n * with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll\n * to get the result of the report generation. The 'Retry-After' provides the duration to wait before\n * polling for the generated report. A call to poll the report operation will provide a 202 response\n * with a 'Location' header if the operation is still in progress. Once the report generation operation\n * completes, the polling endpoint will provide a 200 response along with details on the report blob(s)\n * that are available for download. The details on the file(s) available for download will be available\n * in the polling response body. To Understand cost details (formerly known as usage details) fields\n * found in files ,see\n * https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param parameters Parameters supplied to the Create cost details operation.\n * @param options The options parameters.\n */\n async beginCreateOperation(\n scope: string,\n parameters: GenerateCostDetailsReportRequestDefinition,\n options?: GenerateCostDetailsReportCreateOperationOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<GenerateCostDetailsReportCreateOperationResponse>,\n GenerateCostDetailsReportCreateOperationResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateCostDetailsReportCreateOperationResponse> => {\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: { scope, parameters, options },\n spec: createOperationOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateCostDetailsReportCreateOperationResponse,\n OperationState<GenerateCostDetailsReportCreateOperationResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * This API is the replacement for all previously release Usage Details APIs. Request to generate a\n * cost details report for the provided date range, billing period (Only enterprise customers) or\n * Invoice Id asynchronously at a certain scope. The initial call to request a report will return a 202\n * with a 'Location' and 'Retry-After' header. The 'Location' header will provide the endpoint to poll\n * to get the result of the report generation. The 'Retry-After' provides the duration to wait before\n * polling for the generated report. A call to poll the report operation will provide a 202 response\n * with a 'Location' header if the operation is still in progress. Once the report generation operation\n * completes, the polling endpoint will provide a 200 response along with details on the report blob(s)\n * that are available for download. The details on the file(s) available for download will be available\n * in the polling response body. To Understand cost details (formerly known as usage details) fields\n * found in files ,see\n * https://learn.microsoft.com/azure/cost-management-billing/automate/understand-usage-details-fields\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param parameters Parameters supplied to the Create cost details operation.\n * @param options The options parameters.\n */\n async beginCreateOperationAndWait(\n scope: string,\n parameters: GenerateCostDetailsReportRequestDefinition,\n options?: GenerateCostDetailsReportCreateOperationOptionalParams\n ): Promise<GenerateCostDetailsReportCreateOperationResponse> {\n const poller = await this.beginCreateOperation(scope, parameters, options);\n return poller.pollUntilDone();\n }\n\n /**\n * Get the result of the specified operation. This link is provided in the CostDetails creation request\n * response Location header.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param operationId The target operation Id.\n * @param options The options parameters.\n */\n async beginGetOperationResults(\n scope: string,\n operationId: string,\n options?: GenerateCostDetailsReportGetOperationResultsOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<GenerateCostDetailsReportGetOperationResultsResponse>,\n GenerateCostDetailsReportGetOperationResultsResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateCostDetailsReportGetOperationResultsResponse> => {\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: { scope, operationId, options },\n spec: getOperationResultsOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateCostDetailsReportGetOperationResultsResponse,\n OperationState<GenerateCostDetailsReportGetOperationResultsResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Get the result of the specified operation. This link is provided in the CostDetails creation request\n * response Location header.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param operationId The target operation Id.\n * @param options The options parameters.\n */\n async beginGetOperationResultsAndWait(\n scope: string,\n operationId: string,\n options?: GenerateCostDetailsReportGetOperationResultsOptionalParams\n ): Promise<GenerateCostDetailsReportGetOperationResultsResponse> {\n const poller = await this.beginGetOperationResults(\n scope,\n operationId,\n options\n );\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createOperationOperationSpec: coreClient.OperationSpec = {\n path: \"/{scope}/providers/Microsoft.CostManagement/generateCostDetailsReport\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 201: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 202: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 204: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n default: {\n bodyMapper: Mappers.GenerateCostDetailsReportErrorResponse\n }\n },\n requestBody: Parameters.parameters5,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\nconst getOperationResultsOperationSpec: coreClient.OperationSpec = {\n path:\n \"/{scope}/providers/Microsoft.CostManagement/costDetailsOperationResults/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 201: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 202: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n 204: {\n bodyMapper: Mappers.CostDetailsOperationResults\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1, Parameters.operationId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -16,6 +16,7 @@ const core_lro_1 = require("@azure/core-lro");
16
16
  const lroImpl_js_1 = require("../lroImpl.js");
17
17
  /** Class containing GenerateDetailedCostReport operations. */
18
18
  class GenerateDetailedCostReportImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class GenerateDetailedCostReport class.
21
22
  * @param client Reference to the service client
@@ -39,14 +40,19 @@ class GenerateDetailedCostReportImpl {
39
40
  return this.client.sendOperationRequest(args, spec);
40
41
  };
41
42
  const sendOperationFn = async (args, spec) => {
42
- var _a;
43
43
  let currentRawResponse = undefined;
44
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
44
+ const providedCallback = args.options?.onResponse;
45
45
  const callback = (rawResponse, flatResponse) => {
46
46
  currentRawResponse = rawResponse;
47
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
47
+ providedCallback?.(rawResponse, flatResponse);
48
+ };
49
+ const updatedArgs = {
50
+ ...args,
51
+ options: {
52
+ ...args.options,
53
+ onResponse: callback
54
+ }
48
55
  };
49
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
50
56
  const flatResponse = await directSendOperation(updatedArgs, spec);
51
57
  return {
52
58
  flatResponse,
@@ -63,8 +69,8 @@ class GenerateDetailedCostReportImpl {
63
69
  spec: createOperationOperationSpec
64
70
  });
65
71
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
66
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
67
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
72
+ restoreFrom: options?.resumeFrom,
73
+ intervalInMs: options?.updateIntervalInMs,
68
74
  resourceLocationConfig: "location"
69
75
  });
70
76
  await poller.poll();
@@ -1 +1 @@
1
- {"version":3,"file":"generateDetailedCostReport.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReport.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAO9C,8DAA8D;AAC9D,MAAa,8BAA8B;IAIzC;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,oBAAoB,CACxB,KAAa,EACb,UAAgD,EAChD,OAAiE;QAOjE,MAAM,mBAAmB,GAAG,KAAK,EAC/B,IAAmC,EACnC,IAA8B,EAC8B,EAAE;YAC9D,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,GAAG,WAAW,CAAC;gBACjC,gBAAgB,aAAhB,gBAAgB,uBAAhB,gBAAgB,CAAG,WAAW,EAAE,YAAY,CAAC,CAAC;YAChD,CAAC,CAAC;YACF,MAAM,WAAW,mCACZ,IAAI,KACP,OAAO,kCACF,IAAI,CAAC,OAAO,KACf,UAAU,EAAE,QAAQ,MAEvB,CAAC;YACF,MAAM,YAAY,GAAG,MAAM,mBAAmB,CAAC,WAAW,EAAE,IAAI,CAAC,CAAC;YAClE,OAAO;gBACL,YAAY;gBACZ,WAAW,EAAE;oBACX,UAA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AAE;YACH,UAAU,EAAE,OAAO,CAAC,yCAAyC;SAC9D;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yCAAyC;SAC9D;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,uCAAuC;SAC5D;KACF;IACD,WAAW,EAAE,UAAU,CAAC,WAAW;IACnC,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC;IACpD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,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 { GenerateDetailedCostReport } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n GenerateDetailedCostReportDefinition,\n GenerateDetailedCostReportCreateOperationOptionalParams,\n GenerateDetailedCostReportCreateOperationResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateDetailedCostReport operations. */\nexport class GenerateDetailedCostReportImpl\n implements GenerateDetailedCostReport {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateDetailedCostReport class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Generates the detailed cost report for provided date range, billing period(only enterprise\n * customers) or Invoice ID asynchronously at a certain scope. Call returns a 202 with header\n * Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation\n * will provide the status and if the operation is completed the blob file where generated detailed\n * cost report is being stored.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param parameters Parameters supplied to the Create detailed cost report operation.\n * @param options The options parameters.\n */\n async beginCreateOperation(\n scope: string,\n parameters: GenerateDetailedCostReportDefinition,\n options?: GenerateDetailedCostReportCreateOperationOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<GenerateDetailedCostReportCreateOperationResponse>,\n GenerateDetailedCostReportCreateOperationResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateDetailedCostReportCreateOperationResponse> => {\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: { scope, parameters, options },\n spec: createOperationOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateDetailedCostReportCreateOperationResponse,\n OperationState<GenerateDetailedCostReportCreateOperationResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Generates the detailed cost report for provided date range, billing period(only enterprise\n * customers) or Invoice ID asynchronously at a certain scope. Call returns a 202 with header\n * Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation\n * will provide the status and if the operation is completed the blob file where generated detailed\n * cost report is being stored.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param parameters Parameters supplied to the Create detailed cost report operation.\n * @param options The options parameters.\n */\n async beginCreateOperationAndWait(\n scope: string,\n parameters: GenerateDetailedCostReportDefinition,\n options?: GenerateDetailedCostReportCreateOperationOptionalParams\n ): Promise<GenerateDetailedCostReportCreateOperationResponse> {\n const poller = await this.beginCreateOperation(scope, parameters, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createOperationOperationSpec: coreClient.OperationSpec = {\n path:\n \"/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 201: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 202: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 204: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n default: {\n bodyMapper: Mappers.GenerateDetailedCostReportErrorResponse\n }\n },\n requestBody: Parameters.parameters6,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\n"]}
1
+ {"version":3,"file":"generateDetailedCostReport.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReport.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAO9C,8DAA8D;AAC9D,MAAa,8BAA8B;IAExB,MAAM,CAAuB;IAE9C;;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gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,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 { GenerateDetailedCostReport } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n GenerateDetailedCostReportDefinition,\n GenerateDetailedCostReportCreateOperationOptionalParams,\n GenerateDetailedCostReportCreateOperationResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateDetailedCostReport operations. */\nexport class GenerateDetailedCostReportImpl\n implements GenerateDetailedCostReport {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateDetailedCostReport class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Generates the detailed cost report for provided date range, billing period(only enterprise\n * customers) or Invoice ID asynchronously at a certain scope. Call returns a 202 with header\n * Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation\n * will provide the status and if the operation is completed the blob file where generated detailed\n * cost report is being stored.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param parameters Parameters supplied to the Create detailed cost report operation.\n * @param options The options parameters.\n */\n async beginCreateOperation(\n scope: string,\n parameters: GenerateDetailedCostReportDefinition,\n options?: GenerateDetailedCostReportCreateOperationOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<GenerateDetailedCostReportCreateOperationResponse>,\n GenerateDetailedCostReportCreateOperationResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateDetailedCostReportCreateOperationResponse> => {\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: { scope, parameters, options },\n spec: createOperationOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateDetailedCostReportCreateOperationResponse,\n OperationState<GenerateDetailedCostReportCreateOperationResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Generates the detailed cost report for provided date range, billing period(only enterprise\n * customers) or Invoice ID asynchronously at a certain scope. Call returns a 202 with header\n * Azure-Consumption-AsyncOperation providing a link to the operation created. A call on the operation\n * will provide the status and if the operation is completed the blob file where generated detailed\n * cost report is being stored.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param parameters Parameters supplied to the Create detailed cost report operation.\n * @param options The options parameters.\n */\n async beginCreateOperationAndWait(\n scope: string,\n parameters: GenerateDetailedCostReportDefinition,\n options?: GenerateDetailedCostReportCreateOperationOptionalParams\n ): Promise<GenerateDetailedCostReportCreateOperationResponse> {\n const poller = await this.beginCreateOperation(scope, parameters, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst createOperationOperationSpec: coreClient.OperationSpec = {\n path:\n \"/{scope}/providers/Microsoft.CostManagement/generateDetailedCostReport\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 201: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 202: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 204: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n default: {\n bodyMapper: Mappers.GenerateDetailedCostReportErrorResponse\n }\n },\n requestBody: Parameters.parameters6,\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1],\n headerParameters: [Parameters.accept, Parameters.contentType],\n mediaType: \"json\",\n serializer\n};\n"]}
@@ -16,6 +16,7 @@ const core_lro_1 = require("@azure/core-lro");
16
16
  const lroImpl_js_1 = require("../lroImpl.js");
17
17
  /** Class containing GenerateDetailedCostReportOperationResults operations. */
18
18
  class GenerateDetailedCostReportOperationResultsImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class GenerateDetailedCostReportOperationResults class.
21
22
  * @param client Reference to the service client
@@ -36,14 +37,19 @@ class GenerateDetailedCostReportOperationResultsImpl {
36
37
  return this.client.sendOperationRequest(args, spec);
37
38
  };
38
39
  const sendOperationFn = async (args, spec) => {
39
- var _a;
40
40
  let currentRawResponse = undefined;
41
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
41
+ const providedCallback = args.options?.onResponse;
42
42
  const callback = (rawResponse, flatResponse) => {
43
43
  currentRawResponse = rawResponse;
44
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
44
+ providedCallback?.(rawResponse, flatResponse);
45
+ };
46
+ const updatedArgs = {
47
+ ...args,
48
+ options: {
49
+ ...args.options,
50
+ onResponse: callback
51
+ }
45
52
  };
46
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
47
53
  const flatResponse = await directSendOperation(updatedArgs, spec);
48
54
  return {
49
55
  flatResponse,
@@ -60,8 +66,8 @@ class GenerateDetailedCostReportOperationResultsImpl {
60
66
  spec: getOperationSpec
61
67
  });
62
68
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
63
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
64
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
69
+ restoreFrom: options?.resumeFrom,
70
+ intervalInMs: options?.updateIntervalInMs
65
71
  });
66
72
  await poller.poll();
67
73
  return poller;
@@ -1 +1 @@
1
- {"version":3,"file":"generateDetailedCostReportOperationResults.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReportOperationResults.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAM9C,8EAA8E;AAC9E,MAAa,8CAA8C;IAIzD;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,QAAQ,CACZ,WAAmB,EACnB,KAAa,EACb,OAAqE;QAOrE,MAAM,mBAAmB,GAAG,KAAK,EAC/B,IAAmC,EACnC,IAA8B,EACkC,EAAE;YAClE,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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Q,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAChE,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;IAChC,CAAC;CACF;AArGD,wGAqGC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,gBAAgB,GAA6B;IACjD,IAAI,EACF,4EAA4E;IAC9E,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yCAAyC;SAC9D;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yCAAyC;SAC9D;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yCAAyC;SAC9D;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yCAAyC;SAC9D;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC;IAC5E,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 { GenerateDetailedCostReportOperationResults } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n GenerateDetailedCostReportOperationResultsGetOptionalParams,\n GenerateDetailedCostReportOperationResultsGetResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateDetailedCostReportOperationResults operations. */\nexport class GenerateDetailedCostReportOperationResultsImpl\n implements GenerateDetailedCostReportOperationResults {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateDetailedCostReportOperationResults class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Gets the result of the specified operation. The link with this operationId is provided as a response\n * header of the initial request.\n * @param operationId The target operation Id.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param options The options parameters.\n */\n async beginGet(\n operationId: string,\n scope: string,\n options?: GenerateDetailedCostReportOperationResultsGetOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<GenerateDetailedCostReportOperationResultsGetResponse>,\n GenerateDetailedCostReportOperationResultsGetResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateDetailedCostReportOperationResultsGetResponse> => {\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: { operationId, scope, options },\n spec: getOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateDetailedCostReportOperationResultsGetResponse,\n OperationState<GenerateDetailedCostReportOperationResultsGetResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Gets the result of the specified operation. The link with this operationId is provided as a response\n * header of the initial request.\n * @param operationId The target operation Id.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param options The options parameters.\n */\n async beginGetAndWait(\n operationId: string,\n scope: string,\n options?: GenerateDetailedCostReportOperationResultsGetOptionalParams\n ): Promise<GenerateDetailedCostReportOperationResultsGetResponse> {\n const poller = await this.beginGet(operationId, scope, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path:\n \"/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 201: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 202: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 204: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1, Parameters.operationId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
1
+ {"version":3,"file":"generateDetailedCostReportOperationResults.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReportOperationResults.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAM9C,8EAA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,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 { GenerateDetailedCostReportOperationResults } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n GenerateDetailedCostReportOperationResultsGetOptionalParams,\n GenerateDetailedCostReportOperationResultsGetResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateDetailedCostReportOperationResults operations. */\nexport class GenerateDetailedCostReportOperationResultsImpl\n implements GenerateDetailedCostReportOperationResults {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateDetailedCostReportOperationResults class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Gets the result of the specified operation. The link with this operationId is provided as a response\n * header of the initial request.\n * @param operationId The target operation Id.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param options The options parameters.\n */\n async beginGet(\n operationId: string,\n scope: string,\n options?: GenerateDetailedCostReportOperationResultsGetOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<GenerateDetailedCostReportOperationResultsGetResponse>,\n GenerateDetailedCostReportOperationResultsGetResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateDetailedCostReportOperationResultsGetResponse> => {\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: { operationId, scope, options },\n spec: getOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateDetailedCostReportOperationResultsGetResponse,\n OperationState<GenerateDetailedCostReportOperationResultsGetResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Gets the result of the specified operation. The link with this operationId is provided as a response\n * header of the initial request.\n * @param operationId The target operation Id.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param options The options parameters.\n */\n async beginGetAndWait(\n operationId: string,\n scope: string,\n options?: GenerateDetailedCostReportOperationResultsGetOptionalParams\n ): Promise<GenerateDetailedCostReportOperationResultsGetResponse> {\n const poller = await this.beginGet(operationId, scope, options);\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path:\n \"/{scope}/providers/Microsoft.CostManagement/operationResults/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 201: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 202: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n 204: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1, Parameters.operationId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -14,6 +14,7 @@ const Mappers = tslib_1.__importStar(require("../models/mappers.js"));
14
14
  const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
15
15
  /** Class containing GenerateDetailedCostReportOperationStatus operations. */
16
16
  class GenerateDetailedCostReportOperationStatusImpl {
17
+ client;
17
18
  /**
18
19
  * Initialize a new instance of the class GenerateDetailedCostReportOperationStatus class.
19
20
  * @param client Reference to the service client
@@ -1 +1 @@
1
- {"version":3,"file":"generateDetailedCostReportOperationStatus.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReportOperationStatus.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAOtD,6EAA6E;AAC7E,MAAa,6CAA6C;IAIxD;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CACD,WAAmB,EACnB,KAAa,EACb,OAAoE;QAEpE,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,EAC/B,gBAAgB,CACjB,CAAC;IACJ,CAAC;CACF;AA9BD,sGA8BC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,gBAAgB,GAA6B;IACjD,IAAI,EACF,2EAA2E;IAC7E,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2CAA2C;SAChE;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC;IAC5E,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 { GenerateDetailedCostReportOperationStatus } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n GenerateDetailedCostReportOperationStatusGetOptionalParams,\n GenerateDetailedCostReportOperationStatusGetResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateDetailedCostReportOperationStatus operations. */\nexport class GenerateDetailedCostReportOperationStatusImpl\n implements GenerateDetailedCostReportOperationStatus {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateDetailedCostReportOperationStatus class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport\n * creation request response header.\n * @param operationId The target operation Id.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param options The options parameters.\n */\n get(\n operationId: string,\n scope: string,\n options?: GenerateDetailedCostReportOperationStatusGetOptionalParams\n ): Promise<GenerateDetailedCostReportOperationStatusGetResponse> {\n return this.client.sendOperationRequest(\n { operationId, scope, options },\n getOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path:\n \"/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationStatuses\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1, Parameters.operationId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
1
+ {"version":3,"file":"generateDetailedCostReportOperationStatus.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReportOperationStatus.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAOtD,6EAA6E;AAC7E,MAAa,6CAA6C;IAEvC,MAAM,CAAuB;IAE9C;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;OAOG;IACH,GAAG,CACD,WAAmB,EACnB,KAAa,EACb,OAAoE;QAEpE,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CACrC,EAAE,WAAW,EAAE,KAAK,EAAE,OAAO,EAAE,EAC/B,gBAAgB,CACjB,CAAC;IACJ,CAAC;CACF;AA9BD,sGA8BC;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,gBAAgB,GAA6B;IACjD,IAAI,EACF,2EAA2E;IAC7E,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,2CAA2C;SAChE;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,WAAW,CAAC;IAC5E,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 { GenerateDetailedCostReportOperationStatus } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n GenerateDetailedCostReportOperationStatusGetOptionalParams,\n GenerateDetailedCostReportOperationStatusGetResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateDetailedCostReportOperationStatus operations. */\nexport class GenerateDetailedCostReportOperationStatusImpl\n implements GenerateDetailedCostReportOperationStatus {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateDetailedCostReportOperationStatus class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Get the status of the specified operation. This link is provided in the GenerateDetailedCostReport\n * creation request response header.\n * @param operationId The target operation Id.\n * @param scope The ARM Resource ID for subscription, resource group, billing account, or other billing\n * scopes. For details, see https://aka.ms/costmgmt/scopes.\n * @param options The options parameters.\n */\n get(\n operationId: string,\n scope: string,\n options?: GenerateDetailedCostReportOperationStatusGetOptionalParams\n ): Promise<GenerateDetailedCostReportOperationStatusGetResponse> {\n return this.client.sendOperationRequest(\n { operationId, scope, options },\n getOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getOperationSpec: coreClient.OperationSpec = {\n path:\n \"/{scope}/providers/Microsoft.CostManagement/operationStatus/{operationId}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.GenerateDetailedCostReportOperationStatuses\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host, Parameters.scope1, Parameters.operationId],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -16,6 +16,7 @@ const core_lro_1 = require("@azure/core-lro");
16
16
  const lroImpl_js_1 = require("../lroImpl.js");
17
17
  /** Class containing GenerateReservationDetailsReport operations. */
18
18
  class GenerateReservationDetailsReportImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class GenerateReservationDetailsReport class.
21
22
  * @param client Reference to the service client
@@ -38,14 +39,19 @@ class GenerateReservationDetailsReportImpl {
38
39
  return this.client.sendOperationRequest(args, spec);
39
40
  };
40
41
  const sendOperationFn = async (args, spec) => {
41
- var _a;
42
42
  let currentRawResponse = undefined;
43
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
43
+ const providedCallback = args.options?.onResponse;
44
44
  const callback = (rawResponse, flatResponse) => {
45
45
  currentRawResponse = rawResponse;
46
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
46
+ providedCallback?.(rawResponse, flatResponse);
47
+ };
48
+ const updatedArgs = {
49
+ ...args,
50
+ options: {
51
+ ...args.options,
52
+ onResponse: callback
53
+ }
47
54
  };
48
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
49
55
  const flatResponse = await directSendOperation(updatedArgs, spec);
50
56
  return {
51
57
  flatResponse,
@@ -62,8 +68,8 @@ class GenerateReservationDetailsReportImpl {
62
68
  spec: byBillingAccountIdOperationSpec
63
69
  });
64
70
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
65
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
66
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
71
+ restoreFrom: options?.resumeFrom,
72
+ intervalInMs: options?.updateIntervalInMs,
67
73
  resourceLocationConfig: "location"
68
74
  });
69
75
  await poller.poll();
@@ -99,14 +105,19 @@ class GenerateReservationDetailsReportImpl {
99
105
  return this.client.sendOperationRequest(args, spec);
100
106
  };
101
107
  const sendOperationFn = async (args, spec) => {
102
- var _a;
103
108
  let currentRawResponse = undefined;
104
- const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
109
+ const providedCallback = args.options?.onResponse;
105
110
  const callback = (rawResponse, flatResponse) => {
106
111
  currentRawResponse = rawResponse;
107
- providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
112
+ providedCallback?.(rawResponse, flatResponse);
113
+ };
114
+ const updatedArgs = {
115
+ ...args,
116
+ options: {
117
+ ...args.options,
118
+ onResponse: callback
119
+ }
108
120
  };
109
- const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
110
121
  const flatResponse = await directSendOperation(updatedArgs, spec);
111
122
  return {
112
123
  flatResponse,
@@ -123,8 +134,8 @@ class GenerateReservationDetailsReportImpl {
123
134
  spec: byBillingProfileIdOperationSpec
124
135
  });
125
136
  const poller = await (0, core_lro_1.createHttpPoller)(lro, {
126
- restoreFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
127
- intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs,
137
+ restoreFrom: options?.resumeFrom,
138
+ intervalInMs: options?.updateIntervalInMs,
128
139
  resourceLocationConfig: "location"
129
140
  });
130
141
  await poller.poll();
@@ -1 +1 @@
1
- {"version":3,"file":"generateReservationDetailsReport.js","sourceRoot":"","sources":["../../../src/operations/generateReservationDetailsReport.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIy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eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,OAAO;KACnB;IACD,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,gBAAgB;QAC3B,UAAU,CAAC,gBAAgB;KAC5B;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 { GenerateReservationDetailsReport } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n GenerateReservationDetailsReportByBillingAccountIdOptionalParams,\n GenerateReservationDetailsReportByBillingAccountIdResponse,\n GenerateReservationDetailsReportByBillingProfileIdOptionalParams,\n GenerateReservationDetailsReportByBillingProfileIdResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateReservationDetailsReport operations. */\nexport class GenerateReservationDetailsReportImpl\n implements GenerateReservationDetailsReport {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateReservationDetailsReport class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Generates the reservations details report for provided date range asynchronously based on enrollment\n * id. The Reservation usage details can be viewed only by certain enterprise roles. For more details\n * on the roles see,\n * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role\n * @param billingAccountId Enrollment ID (Legacy BillingAccount ID)\n * @param startDate Start Date\n * @param endDate End Date\n * @param options The options parameters.\n */\n async beginByBillingAccountId(\n billingAccountId: string,\n startDate: string,\n endDate: string,\n options?: GenerateReservationDetailsReportByBillingAccountIdOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<\n GenerateReservationDetailsReportByBillingAccountIdResponse\n >,\n GenerateReservationDetailsReportByBillingAccountIdResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateReservationDetailsReportByBillingAccountIdResponse> => {\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: { billingAccountId, startDate, endDate, options },\n spec: byBillingAccountIdOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateReservationDetailsReportByBillingAccountIdResponse,\n OperationState<GenerateReservationDetailsReportByBillingAccountIdResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Generates the reservations details report for provided date range asynchronously based on enrollment\n * id. The Reservation usage details can be viewed only by certain enterprise roles. For more details\n * on the roles see,\n * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role\n * @param billingAccountId Enrollment ID (Legacy BillingAccount ID)\n * @param startDate Start Date\n * @param endDate End Date\n * @param options The options parameters.\n */\n async beginByBillingAccountIdAndWait(\n billingAccountId: string,\n startDate: string,\n endDate: string,\n options?: GenerateReservationDetailsReportByBillingAccountIdOptionalParams\n ): Promise<GenerateReservationDetailsReportByBillingAccountIdResponse> {\n const poller = await this.beginByBillingAccountId(\n billingAccountId,\n startDate,\n endDate,\n options\n );\n return poller.pollUntilDone();\n }\n\n /**\n * Generates the reservations details report for provided date range asynchronously by billing profile.\n * The Reservation usage details can be viewed by only certain enterprise roles by default. For more\n * details on the roles see,\n * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access\n * @param billingAccountId Billing account ID\n * @param billingProfileId Billing profile ID.\n * @param startDate Start Date\n * @param endDate End Date\n * @param options The options parameters.\n */\n async beginByBillingProfileId(\n billingAccountId: string,\n billingProfileId: string,\n startDate: string,\n endDate: string,\n options?: GenerateReservationDetailsReportByBillingProfileIdOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<\n GenerateReservationDetailsReportByBillingProfileIdResponse\n >,\n GenerateReservationDetailsReportByBillingProfileIdResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateReservationDetailsReportByBillingProfileIdResponse> => {\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: { billingAccountId, billingProfileId, startDate, endDate, options },\n spec: byBillingProfileIdOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateReservationDetailsReportByBillingProfileIdResponse,\n OperationState<GenerateReservationDetailsReportByBillingProfileIdResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Generates the reservations details report for provided date range asynchronously by billing profile.\n * The Reservation usage details can be viewed by only certain enterprise roles by default. For more\n * details on the roles see,\n * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access\n * @param billingAccountId Billing account ID\n * @param billingProfileId Billing profile ID.\n * @param startDate Start Date\n * @param endDate End Date\n * @param options The options parameters.\n */\n async beginByBillingProfileIdAndWait(\n billingAccountId: string,\n billingProfileId: string,\n startDate: string,\n endDate: string,\n options?: GenerateReservationDetailsReportByBillingProfileIdOptionalParams\n ): Promise<GenerateReservationDetailsReportByBillingProfileIdResponse> {\n const poller = await this.beginByBillingProfileId(\n billingAccountId,\n billingProfileId,\n startDate,\n endDate,\n options\n );\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst byBillingAccountIdOperationSpec: coreClient.OperationSpec = {\n path:\n \"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationStatus\n },\n 201: {\n bodyMapper: Mappers.OperationStatus\n },\n 202: {\n bodyMapper: Mappers.OperationStatus\n },\n 204: {\n bodyMapper: Mappers.OperationStatus\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.startDate,\n Parameters.endDate\n ],\n urlParameters: [Parameters.$host, Parameters.billingAccountId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst byBillingProfileIdOperationSpec: coreClient.OperationSpec = {\n path:\n \"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationStatus\n },\n 201: {\n bodyMapper: Mappers.OperationStatus\n },\n 202: {\n bodyMapper: Mappers.OperationStatus\n },\n 204: {\n bodyMapper: Mappers.OperationStatus\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.startDate,\n Parameters.endDate\n ],\n urlParameters: [\n Parameters.$host,\n Parameters.billingAccountId,\n Parameters.billingProfileId\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
1
+ {"version":3,"file":"generateReservationDetailsReport.js","sourceRoot":"","sources":["../../../src/operations/generateReservationDetailsReport.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAEtD,8CAIyB;AACzB,8CAA8C;AAQ9C,oEAAoE;AACpE,MAAa,oCAAoC;IAE9B,MAAM,CAAuB;IAE9C;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,uBAAuB,CAC3B,gBAAwB,EACxB,SAAiB,EACjB,OAAe,EACf,OAA0E;QAS1E,MAAM,mBAAmB,GAAG,KAAK,EAC/B,IAAmC,EACnC,IAA8B,EACuC,EAAE;YACvE,OAAO,IAAI,CAAC,MAAM,CAAC,oBAAoB,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;QACtD,CAAC,CAAC;QACF,MAAM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ACpC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,OAAO;KACnB;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC;IAC9D,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,+BAA+B,GAA6B;IAChE,IAAI,EACF,wKAAwK;IAC1K,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,eAAe;SACpC;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,eAAe;SACpC;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,eAAe;SACpC;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,eAAe;SACpC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;KACF;IACD,eAAe,EAAE;QACf,UAAU,CAAC,UAAU;QACrB,UAAU,CAAC,SAAS;QACpB,UAAU,CAAC,OAAO;KACnB;IACD,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,gBAAgB;QAC3B,UAAU,CAAC,gBAAgB;KAC5B;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 { GenerateReservationDetailsReport } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n SimplePollerLike,\n OperationState,\n createHttpPoller\n} from \"@azure/core-lro\";\nimport { createLroSpec } from \"../lroImpl.js\";\nimport {\n GenerateReservationDetailsReportByBillingAccountIdOptionalParams,\n GenerateReservationDetailsReportByBillingAccountIdResponse,\n GenerateReservationDetailsReportByBillingProfileIdOptionalParams,\n GenerateReservationDetailsReportByBillingProfileIdResponse\n} from \"../models/index.js\";\n\n/** Class containing GenerateReservationDetailsReport operations. */\nexport class GenerateReservationDetailsReportImpl\n implements GenerateReservationDetailsReport {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class GenerateReservationDetailsReport class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Generates the reservations details report for provided date range asynchronously based on enrollment\n * id. The Reservation usage details can be viewed only by certain enterprise roles. For more details\n * on the roles see,\n * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role\n * @param billingAccountId Enrollment ID (Legacy BillingAccount ID)\n * @param startDate Start Date\n * @param endDate End Date\n * @param options The options parameters.\n */\n async beginByBillingAccountId(\n billingAccountId: string,\n startDate: string,\n endDate: string,\n options?: GenerateReservationDetailsReportByBillingAccountIdOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<\n GenerateReservationDetailsReportByBillingAccountIdResponse\n >,\n GenerateReservationDetailsReportByBillingAccountIdResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateReservationDetailsReportByBillingAccountIdResponse> => {\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: { billingAccountId, startDate, endDate, options },\n spec: byBillingAccountIdOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateReservationDetailsReportByBillingAccountIdResponse,\n OperationState<GenerateReservationDetailsReportByBillingAccountIdResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Generates the reservations details report for provided date range asynchronously based on enrollment\n * id. The Reservation usage details can be viewed only by certain enterprise roles. For more details\n * on the roles see,\n * https://docs.microsoft.com/azure/cost-management-billing/manage/understand-ea-roles#usage-and-costs-access-by-role\n * @param billingAccountId Enrollment ID (Legacy BillingAccount ID)\n * @param startDate Start Date\n * @param endDate End Date\n * @param options The options parameters.\n */\n async beginByBillingAccountIdAndWait(\n billingAccountId: string,\n startDate: string,\n endDate: string,\n options?: GenerateReservationDetailsReportByBillingAccountIdOptionalParams\n ): Promise<GenerateReservationDetailsReportByBillingAccountIdResponse> {\n const poller = await this.beginByBillingAccountId(\n billingAccountId,\n startDate,\n endDate,\n options\n );\n return poller.pollUntilDone();\n }\n\n /**\n * Generates the reservations details report for provided date range asynchronously by billing profile.\n * The Reservation usage details can be viewed by only certain enterprise roles by default. For more\n * details on the roles see,\n * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access\n * @param billingAccountId Billing account ID\n * @param billingProfileId Billing profile ID.\n * @param startDate Start Date\n * @param endDate End Date\n * @param options The options parameters.\n */\n async beginByBillingProfileId(\n billingAccountId: string,\n billingProfileId: string,\n startDate: string,\n endDate: string,\n options?: GenerateReservationDetailsReportByBillingProfileIdOptionalParams\n ): Promise<\n SimplePollerLike<\n OperationState<\n GenerateReservationDetailsReportByBillingProfileIdResponse\n >,\n GenerateReservationDetailsReportByBillingProfileIdResponse\n >\n > {\n const directSendOperation = async (\n args: coreClient.OperationArguments,\n spec: coreClient.OperationSpec\n ): Promise<GenerateReservationDetailsReportByBillingProfileIdResponse> => {\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: { billingAccountId, billingProfileId, startDate, endDate, options },\n spec: byBillingProfileIdOperationSpec\n });\n const poller = await createHttpPoller<\n GenerateReservationDetailsReportByBillingProfileIdResponse,\n OperationState<GenerateReservationDetailsReportByBillingProfileIdResponse>\n >(lro, {\n restoreFrom: options?.resumeFrom,\n intervalInMs: options?.updateIntervalInMs,\n resourceLocationConfig: \"location\"\n });\n await poller.poll();\n return poller;\n }\n\n /**\n * Generates the reservations details report for provided date range asynchronously by billing profile.\n * The Reservation usage details can be viewed by only certain enterprise roles by default. For more\n * details on the roles see,\n * https://docs.microsoft.com/azure/cost-management-billing/reservations/reservation-utilization#view-utilization-in-the-azure-portal-with-azure-rbac-access\n * @param billingAccountId Billing account ID\n * @param billingProfileId Billing profile ID.\n * @param startDate Start Date\n * @param endDate End Date\n * @param options The options parameters.\n */\n async beginByBillingProfileIdAndWait(\n billingAccountId: string,\n billingProfileId: string,\n startDate: string,\n endDate: string,\n options?: GenerateReservationDetailsReportByBillingProfileIdOptionalParams\n ): Promise<GenerateReservationDetailsReportByBillingProfileIdResponse> {\n const poller = await this.beginByBillingProfileId(\n billingAccountId,\n billingProfileId,\n startDate,\n endDate,\n options\n );\n return poller.pollUntilDone();\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst byBillingAccountIdOperationSpec: coreClient.OperationSpec = {\n path:\n \"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/providers/Microsoft.CostManagement/generateReservationDetailsReport\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationStatus\n },\n 201: {\n bodyMapper: Mappers.OperationStatus\n },\n 202: {\n bodyMapper: Mappers.OperationStatus\n },\n 204: {\n bodyMapper: Mappers.OperationStatus\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.startDate,\n Parameters.endDate\n ],\n urlParameters: [Parameters.$host, Parameters.billingAccountId],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst byBillingProfileIdOperationSpec: coreClient.OperationSpec = {\n path:\n \"/providers/Microsoft.Billing/billingAccounts/{billingAccountId}/billingProfiles/{billingProfileId}/providers/Microsoft.CostManagement/generateReservationDetailsReport\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationStatus\n },\n 201: {\n bodyMapper: Mappers.OperationStatus\n },\n 202: {\n bodyMapper: Mappers.OperationStatus\n },\n 204: {\n bodyMapper: Mappers.OperationStatus\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n queryParameters: [\n Parameters.apiVersion,\n Parameters.startDate,\n Parameters.endDate\n ],\n urlParameters: [\n Parameters.$host,\n Parameters.billingAccountId,\n Parameters.billingProfileId\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
@@ -16,6 +16,7 @@ const Parameters = tslib_1.__importStar(require("../models/parameters.js"));
16
16
  /// <reference lib="esnext.asynciterable" />
17
17
  /** Class containing Operations operations. */
18
18
  class OperationsImpl {
19
+ client;
19
20
  /**
20
21
  * Initialize a new instance of the class Operations class.
21
22
  * @param client Reference to the service client
@@ -37,52 +38,35 @@ class OperationsImpl {
37
38
  return this;
38
39
  },
39
40
  byPage: (settings) => {
40
- if (settings === null || settings === void 0 ? void 0 : settings.maxPageSize) {
41
+ if (settings?.maxPageSize) {
41
42
  throw new Error("maxPageSize is not supported by this operation.");
42
43
  }
43
44
  return this.listPagingPage(options, settings);
44
45
  }
45
46
  };
46
47
  }
47
- listPagingPage(options, settings) {
48
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingPage_1() {
49
- let result;
50
- let continuationToken = settings === null || settings === void 0 ? void 0 : settings.continuationToken;
51
- if (!continuationToken) {
52
- result = yield tslib_1.__await(this._list(options));
53
- let page = result.value || [];
54
- continuationToken = result.nextLink;
55
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
56
- yield yield tslib_1.__await(page);
57
- }
58
- while (continuationToken) {
59
- result = yield tslib_1.__await(this._listNext(continuationToken, options));
60
- continuationToken = result.nextLink;
61
- let page = result.value || [];
62
- (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
63
- yield yield tslib_1.__await(page);
64
- }
65
- });
48
+ async *listPagingPage(options, settings) {
49
+ let result;
50
+ let continuationToken = settings?.continuationToken;
51
+ if (!continuationToken) {
52
+ result = await this._list(options);
53
+ let page = result.value || [];
54
+ continuationToken = result.nextLink;
55
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
56
+ yield page;
57
+ }
58
+ while (continuationToken) {
59
+ result = await this._listNext(continuationToken, options);
60
+ continuationToken = result.nextLink;
61
+ let page = result.value || [];
62
+ (0, pagingHelper_js_1.setContinuationToken)(page, continuationToken);
63
+ yield page;
64
+ }
66
65
  }
67
- listPagingAll(options) {
68
- return tslib_1.__asyncGenerator(this, arguments, function* listPagingAll_1() {
69
- var _a, e_1, _b, _c;
70
- try {
71
- for (var _d = true, _e = tslib_1.__asyncValues(this.listPagingPage(options)), _f; _f = yield tslib_1.__await(_e.next()), _a = _f.done, !_a; _d = true) {
72
- _c = _f.value;
73
- _d = false;
74
- const page = _c;
75
- yield tslib_1.__await(yield* tslib_1.__asyncDelegator(tslib_1.__asyncValues(page)));
76
- }
77
- }
78
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
79
- finally {
80
- try {
81
- if (!_d && !_a && (_b = _e.return)) yield tslib_1.__await(_b.call(_e));
82
- }
83
- finally { if (e_1) throw e_1.error; }
84
- }
85
- });
66
+ async *listPagingAll(options) {
67
+ for await (const page of this.listPagingPage(options)) {
68
+ yield* page;
69
+ }
86
70
  }
87
71
  /**
88
72
  * Lists all of the available cost management REST API operations.
@@ -1 +1 @@
1
- {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/operations/operations.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAUtD,4CAA4C;AAC5C,8CAA8C;AAC9C,MAAa,cAAc;IAGzB;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,IAAI,CACT,OAAsC;QAEtC,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,IA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AU,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 { Operations } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n CostManagementOperation,\n OperationsListNextOptionalParams,\n OperationsListOptionalParams,\n OperationsListResponse,\n OperationsListNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Operations operations. */\nexport class OperationsImpl implements Operations {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class Operations class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Lists all of the available cost management REST API operations.\n * @param options The options parameters.\n */\n public list(\n options?: OperationsListOptionalParams\n ): PagedAsyncIterableIterator<CostManagementOperation> {\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?: OperationsListOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<CostManagementOperation[]> {\n let result: OperationsListResponse;\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?: OperationsListOptionalParams\n ): AsyncIterableIterator<CostManagementOperation> {\n for await (const page of this.listPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Lists all of the available cost management REST API operations.\n * @param options The options parameters.\n */\n private _list(\n options?: OperationsListOptionalParams\n ): Promise<OperationsListResponse> {\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?: OperationsListNextOptionalParams\n ): Promise<OperationsListNextResponse> {\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.CostManagement/operations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationListResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\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.OperationListResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n urlParameters: [Parameters.$host, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
1
+ {"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/operations/operations.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAGH,wDAA0D;AAE1D,uEAAiD;AACjD,sEAAgD;AAChD,4EAAsD;AAUtD,4CAA4C;AAC5C,8CAA8C;AAC9C,MAAa,cAA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IAClB,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,mBAAmB;SACxC;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,aAAa;SAClC;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 { Operations } 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 { CostManagementClient } from \"../costManagementClient.js\";\nimport {\n CostManagementOperation,\n OperationsListNextOptionalParams,\n OperationsListOptionalParams,\n OperationsListResponse,\n OperationsListNextResponse\n} from \"../models/index.js\";\n\n/// <reference lib=\"esnext.asynciterable\" />\n/** Class containing Operations operations. */\nexport class OperationsImpl implements Operations {\n private readonly client: CostManagementClient;\n\n /**\n * Initialize a new instance of the class Operations class.\n * @param client Reference to the service client\n */\n constructor(client: CostManagementClient) {\n this.client = client;\n }\n\n /**\n * Lists all of the available cost management REST API operations.\n * @param options The options parameters.\n */\n public list(\n options?: OperationsListOptionalParams\n ): PagedAsyncIterableIterator<CostManagementOperation> {\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?: OperationsListOptionalParams,\n settings?: PageSettings\n ): AsyncIterableIterator<CostManagementOperation[]> {\n let result: OperationsListResponse;\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?: OperationsListOptionalParams\n ): AsyncIterableIterator<CostManagementOperation> {\n for await (const page of this.listPagingPage(options)) {\n yield* page;\n }\n }\n\n /**\n * Lists all of the available cost management REST API operations.\n * @param options The options parameters.\n */\n private _list(\n options?: OperationsListOptionalParams\n ): Promise<OperationsListResponse> {\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?: OperationsListNextOptionalParams\n ): Promise<OperationsListNextResponse> {\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.CostManagement/operations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.OperationListResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\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.OperationListResult\n },\n default: {\n bodyMapper: Mappers.ErrorResponse\n }\n },\n urlParameters: [Parameters.$host, Parameters.nextLink],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}