@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.
- package/dist/browser/costManagementClient.js +28 -5
- package/dist/browser/costManagementClient.js.map +1 -1
- package/dist/browser/lroImpl.js +7 -3
- package/dist/browser/lroImpl.js.map +1 -1
- package/dist/browser/models/mappers.js +256 -117
- package/dist/browser/models/mappers.js.map +1 -1
- package/dist/browser/operations/alerts.js +1 -0
- package/dist/browser/operations/alerts.js.map +1 -1
- package/dist/browser/operations/benefitRecommendations.js +23 -40
- package/dist/browser/operations/benefitRecommendations.js.map +1 -1
- package/dist/browser/operations/benefitUtilizationSummaries.js +89 -157
- package/dist/browser/operations/benefitUtilizationSummaries.js.map +1 -1
- package/dist/browser/operations/dimensions.js +19 -53
- package/dist/browser/operations/dimensions.js.map +1 -1
- package/dist/browser/operations/exports.js +1 -0
- package/dist/browser/operations/exports.js.map +1 -1
- package/dist/browser/operations/forecast.js +1 -0
- package/dist/browser/operations/forecast.js.map +1 -1
- package/dist/browser/operations/generateCostDetailsReport.js +23 -12
- package/dist/browser/operations/generateCostDetailsReport.js.map +1 -1
- package/dist/browser/operations/generateDetailedCostReport.js +12 -6
- package/dist/browser/operations/generateDetailedCostReport.js.map +1 -1
- package/dist/browser/operations/generateDetailedCostReportOperationResults.js +12 -6
- package/dist/browser/operations/generateDetailedCostReportOperationResults.js.map +1 -1
- package/dist/browser/operations/generateDetailedCostReportOperationStatus.js +1 -0
- package/dist/browser/operations/generateDetailedCostReportOperationStatus.js.map +1 -1
- package/dist/browser/operations/generateReservationDetailsReport.js +23 -12
- package/dist/browser/operations/generateReservationDetailsReport.js.map +1 -1
- package/dist/browser/operations/operations.js +23 -40
- package/dist/browser/operations/operations.js.map +1 -1
- package/dist/browser/operations/priceSheet.js +23 -12
- package/dist/browser/operations/priceSheet.js.map +1 -1
- package/dist/browser/operations/query.js +1 -0
- package/dist/browser/operations/query.js.map +1 -1
- package/dist/browser/operations/scheduledActions.js +45 -79
- package/dist/browser/operations/scheduledActions.js.map +1 -1
- package/dist/browser/operations/views.js +45 -79
- package/dist/browser/operations/views.js.map +1 -1
- package/dist/browser/pagingHelper.js +2 -4
- package/dist/browser/pagingHelper.js.map +1 -1
- package/dist/commonjs/costManagementClient.js +28 -5
- package/dist/commonjs/costManagementClient.js.map +1 -1
- package/dist/commonjs/lroImpl.js +7 -3
- package/dist/commonjs/lroImpl.js.map +1 -1
- package/dist/commonjs/models/mappers.js +256 -117
- package/dist/commonjs/models/mappers.js.map +1 -1
- package/dist/commonjs/operations/alerts.js +1 -0
- package/dist/commonjs/operations/alerts.js.map +1 -1
- package/dist/commonjs/operations/benefitRecommendations.js +23 -39
- package/dist/commonjs/operations/benefitRecommendations.js.map +1 -1
- package/dist/commonjs/operations/benefitUtilizationSummaries.js +89 -156
- package/dist/commonjs/operations/benefitUtilizationSummaries.js.map +1 -1
- package/dist/commonjs/operations/dimensions.js +19 -52
- package/dist/commonjs/operations/dimensions.js.map +1 -1
- package/dist/commonjs/operations/exports.js +1 -0
- package/dist/commonjs/operations/exports.js.map +1 -1
- package/dist/commonjs/operations/forecast.js +1 -0
- package/dist/commonjs/operations/forecast.js.map +1 -1
- package/dist/commonjs/operations/generateCostDetailsReport.js +23 -12
- package/dist/commonjs/operations/generateCostDetailsReport.js.map +1 -1
- package/dist/commonjs/operations/generateDetailedCostReport.js +12 -6
- package/dist/commonjs/operations/generateDetailedCostReport.js.map +1 -1
- package/dist/commonjs/operations/generateDetailedCostReportOperationResults.js +12 -6
- package/dist/commonjs/operations/generateDetailedCostReportOperationResults.js.map +1 -1
- package/dist/commonjs/operations/generateDetailedCostReportOperationStatus.js +1 -0
- package/dist/commonjs/operations/generateDetailedCostReportOperationStatus.js.map +1 -1
- package/dist/commonjs/operations/generateReservationDetailsReport.js +23 -12
- package/dist/commonjs/operations/generateReservationDetailsReport.js.map +1 -1
- package/dist/commonjs/operations/operations.js +23 -39
- package/dist/commonjs/operations/operations.js.map +1 -1
- package/dist/commonjs/operations/priceSheet.js +23 -12
- package/dist/commonjs/operations/priceSheet.js.map +1 -1
- package/dist/commonjs/operations/query.js +1 -0
- package/dist/commonjs/operations/query.js.map +1 -1
- package/dist/commonjs/operations/scheduledActions.js +45 -78
- package/dist/commonjs/operations/scheduledActions.js.map +1 -1
- package/dist/commonjs/operations/views.js +45 -78
- package/dist/commonjs/operations/views.js.map +1 -1
- package/dist/commonjs/pagingHelper.js +2 -4
- package/dist/commonjs/pagingHelper.js.map +1 -1
- package/dist/commonjs/tsdoc-metadata.json +11 -11
- package/dist/esm/costManagementClient.js +28 -5
- package/dist/esm/costManagementClient.js.map +1 -1
- package/dist/esm/lroImpl.js +7 -3
- package/dist/esm/lroImpl.js.map +1 -1
- package/dist/esm/models/mappers.js +256 -117
- package/dist/esm/models/mappers.js.map +1 -1
- package/dist/esm/operations/alerts.js +1 -0
- package/dist/esm/operations/alerts.js.map +1 -1
- package/dist/esm/operations/benefitRecommendations.js +23 -40
- package/dist/esm/operations/benefitRecommendations.js.map +1 -1
- package/dist/esm/operations/benefitUtilizationSummaries.js +89 -157
- package/dist/esm/operations/benefitUtilizationSummaries.js.map +1 -1
- package/dist/esm/operations/dimensions.js +19 -53
- package/dist/esm/operations/dimensions.js.map +1 -1
- package/dist/esm/operations/exports.js +1 -0
- package/dist/esm/operations/exports.js.map +1 -1
- package/dist/esm/operations/forecast.js +1 -0
- package/dist/esm/operations/forecast.js.map +1 -1
- package/dist/esm/operations/generateCostDetailsReport.js +23 -12
- package/dist/esm/operations/generateCostDetailsReport.js.map +1 -1
- package/dist/esm/operations/generateDetailedCostReport.js +12 -6
- package/dist/esm/operations/generateDetailedCostReport.js.map +1 -1
- package/dist/esm/operations/generateDetailedCostReportOperationResults.js +12 -6
- package/dist/esm/operations/generateDetailedCostReportOperationResults.js.map +1 -1
- package/dist/esm/operations/generateDetailedCostReportOperationStatus.js +1 -0
- package/dist/esm/operations/generateDetailedCostReportOperationStatus.js.map +1 -1
- package/dist/esm/operations/generateReservationDetailsReport.js +23 -12
- package/dist/esm/operations/generateReservationDetailsReport.js.map +1 -1
- package/dist/esm/operations/operations.js +23 -40
- package/dist/esm/operations/operations.js.map +1 -1
- package/dist/esm/operations/priceSheet.js +23 -12
- package/dist/esm/operations/priceSheet.js.map +1 -1
- package/dist/esm/operations/query.js +1 -0
- package/dist/esm/operations/query.js.map +1 -1
- package/dist/esm/operations/scheduledActions.js +45 -79
- package/dist/esm/operations/scheduledActions.js.map +1 -1
- package/dist/esm/operations/views.js +45 -79
- package/dist/esm/operations/views.js.map +1 -1
- package/dist/esm/pagingHelper.js +2 -4
- package/dist/esm/pagingHelper.js.map +1 -1
- package/dist/react-native/costManagementClient.js +28 -5
- package/dist/react-native/costManagementClient.js.map +1 -1
- package/dist/react-native/lroImpl.js +7 -3
- package/dist/react-native/lroImpl.js.map +1 -1
- package/dist/react-native/models/mappers.js +256 -117
- package/dist/react-native/models/mappers.js.map +1 -1
- package/dist/react-native/operations/alerts.js +1 -0
- package/dist/react-native/operations/alerts.js.map +1 -1
- package/dist/react-native/operations/benefitRecommendations.js +23 -40
- package/dist/react-native/operations/benefitRecommendations.js.map +1 -1
- package/dist/react-native/operations/benefitUtilizationSummaries.js +89 -157
- package/dist/react-native/operations/benefitUtilizationSummaries.js.map +1 -1
- package/dist/react-native/operations/dimensions.js +19 -53
- package/dist/react-native/operations/dimensions.js.map +1 -1
- package/dist/react-native/operations/exports.js +1 -0
- package/dist/react-native/operations/exports.js.map +1 -1
- package/dist/react-native/operations/forecast.js +1 -0
- package/dist/react-native/operations/forecast.js.map +1 -1
- package/dist/react-native/operations/generateCostDetailsReport.js +23 -12
- package/dist/react-native/operations/generateCostDetailsReport.js.map +1 -1
- package/dist/react-native/operations/generateDetailedCostReport.js +12 -6
- package/dist/react-native/operations/generateDetailedCostReport.js.map +1 -1
- package/dist/react-native/operations/generateDetailedCostReportOperationResults.js +12 -6
- package/dist/react-native/operations/generateDetailedCostReportOperationResults.js.map +1 -1
- package/dist/react-native/operations/generateDetailedCostReportOperationStatus.js +1 -0
- package/dist/react-native/operations/generateDetailedCostReportOperationStatus.js.map +1 -1
- package/dist/react-native/operations/generateReservationDetailsReport.js +23 -12
- package/dist/react-native/operations/generateReservationDetailsReport.js.map +1 -1
- package/dist/react-native/operations/operations.js +23 -40
- package/dist/react-native/operations/operations.js.map +1 -1
- package/dist/react-native/operations/priceSheet.js +23 -12
- package/dist/react-native/operations/priceSheet.js.map +1 -1
- package/dist/react-native/operations/query.js +1 -0
- package/dist/react-native/operations/query.js.map +1 -1
- package/dist/react-native/operations/scheduledActions.js +45 -79
- package/dist/react-native/operations/scheduledActions.js.map +1 -1
- package/dist/react-native/operations/views.js +45 -79
- package/dist/react-native/operations/views.js.map +1 -1
- package/dist/react-native/pagingHelper.js +2 -4
- package/dist/react-native/pagingHelper.js.map +1 -1
- package/package.json +2 -2
- package/review/arm-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,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAS9C,6DAA6D;AAC7D,MAAM,OAAO,6BAA6B;IAIxC;;;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,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E;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,sCAAsC;SAC3D;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;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"]}
|
|
1
|
+
{"version":3,"file":"generateCostDetailsReport.js","sourceRoot":"","sources":["../../../src/operations/generateCostDetailsReport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAS9C,6DAA6D;AAC7D,MAAM,OAAO,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,CAAC,CAAC;QACF,MAAM,eAAe,GAAG,KAAK,EAC3B,IAAmC,EACnC,IAA8B,EAC9B,EAAE;YACF,IAAI,kB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,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"]}
|
|
@@ -12,6 +12,7 @@ import { createHttpPoller } from "@azure/core-lro";
|
|
|
12
12
|
import { createLroSpec } from "../lroImpl.js";
|
|
13
13
|
/** Class containing GenerateDetailedCostReport operations. */
|
|
14
14
|
export class GenerateDetailedCostReportImpl {
|
|
15
|
+
client;
|
|
15
16
|
/**
|
|
16
17
|
* Initialize a new instance of the class GenerateDetailedCostReport class.
|
|
17
18
|
* @param client Reference to the service client
|
|
@@ -35,14 +36,19 @@ export class GenerateDetailedCostReportImpl {
|
|
|
35
36
|
return this.client.sendOperationRequest(args, spec);
|
|
36
37
|
};
|
|
37
38
|
const sendOperationFn = async (args, spec) => {
|
|
38
|
-
var _a;
|
|
39
39
|
let currentRawResponse = undefined;
|
|
40
|
-
const providedCallback =
|
|
40
|
+
const providedCallback = args.options?.onResponse;
|
|
41
41
|
const callback = (rawResponse, flatResponse) => {
|
|
42
42
|
currentRawResponse = rawResponse;
|
|
43
|
-
providedCallback
|
|
43
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
44
|
+
};
|
|
45
|
+
const updatedArgs = {
|
|
46
|
+
...args,
|
|
47
|
+
options: {
|
|
48
|
+
...args.options,
|
|
49
|
+
onResponse: callback
|
|
50
|
+
}
|
|
44
51
|
};
|
|
45
|
-
const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
|
|
46
52
|
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
47
53
|
return {
|
|
48
54
|
flatResponse,
|
|
@@ -59,8 +65,8 @@ export class GenerateDetailedCostReportImpl {
|
|
|
59
65
|
spec: createOperationOperationSpec
|
|
60
66
|
});
|
|
61
67
|
const poller = await createHttpPoller(lro, {
|
|
62
|
-
restoreFrom: options
|
|
63
|
-
intervalInMs: options
|
|
68
|
+
restoreFrom: options?.resumeFrom,
|
|
69
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
64
70
|
resourceLocationConfig: "location"
|
|
65
71
|
});
|
|
66
72
|
await poller.poll();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateDetailedCostReport.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAO9C,8DAA8D;AAC9D,MAAM,OAAO,8BAA8B;
|
|
1
|
+
{"version":3,"file":"generateDetailedCostReport.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAO9C,8DAA8D;AAC9D,MAAM,OAAO,8BAA8B;IAExB,MAAM,CAAuB;IAE9C;;;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,KA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;QAEjE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAC3E,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;IAChC,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,4BAA4B,GAA6B;IAC7D,IAAI,EACF,wEAAwE;IAC1E,UAAU,EAAE,MAAM;IAClB,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,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"]}
|
|
@@ -12,6 +12,7 @@ import { createHttpPoller } from "@azure/core-lro";
|
|
|
12
12
|
import { createLroSpec } from "../lroImpl.js";
|
|
13
13
|
/** Class containing GenerateDetailedCostReportOperationResults operations. */
|
|
14
14
|
export class GenerateDetailedCostReportOperationResultsImpl {
|
|
15
|
+
client;
|
|
15
16
|
/**
|
|
16
17
|
* Initialize a new instance of the class GenerateDetailedCostReportOperationResults class.
|
|
17
18
|
* @param client Reference to the service client
|
|
@@ -32,14 +33,19 @@ export class GenerateDetailedCostReportOperationResultsImpl {
|
|
|
32
33
|
return this.client.sendOperationRequest(args, spec);
|
|
33
34
|
};
|
|
34
35
|
const sendOperationFn = async (args, spec) => {
|
|
35
|
-
var _a;
|
|
36
36
|
let currentRawResponse = undefined;
|
|
37
|
-
const providedCallback =
|
|
37
|
+
const providedCallback = args.options?.onResponse;
|
|
38
38
|
const callback = (rawResponse, flatResponse) => {
|
|
39
39
|
currentRawResponse = rawResponse;
|
|
40
|
-
providedCallback
|
|
40
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
41
|
+
};
|
|
42
|
+
const updatedArgs = {
|
|
43
|
+
...args,
|
|
44
|
+
options: {
|
|
45
|
+
...args.options,
|
|
46
|
+
onResponse: callback
|
|
47
|
+
}
|
|
41
48
|
};
|
|
42
|
-
const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
|
|
43
49
|
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
44
50
|
return {
|
|
45
51
|
flatResponse,
|
|
@@ -56,8 +62,8 @@ export class GenerateDetailedCostReportOperationResultsImpl {
|
|
|
56
62
|
spec: getOperationSpec
|
|
57
63
|
});
|
|
58
64
|
const poller = await createHttpPoller(lro, {
|
|
59
|
-
restoreFrom: options
|
|
60
|
-
intervalInMs: options
|
|
65
|
+
restoreFrom: options?.resumeFrom,
|
|
66
|
+
intervalInMs: options?.updateIntervalInMs
|
|
61
67
|
});
|
|
62
68
|
await poller.poll();
|
|
63
69
|
return poller;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateDetailedCostReportOperationResults.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReportOperationResults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9C,8EAA8E;AAC9E,MAAM,OAAO,8CAA8C;
|
|
1
|
+
{"version":3,"file":"generateDetailedCostReportOperationResults.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReportOperationResults.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAM9C,8EAA8E;AAC9E,MAAM,OAAO,8CAA8C;IAExC,MAAM,CAAuB;IAE9C;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;OAO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AAO,EAAE,UAAU;YAChC,YAAY,EAAE,OAAO,EAAE,kBAAkB;SAC1C,CAAC,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC;IAChB,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,eAAe,CACnB,WAAmB,EACnB,KAAa,EACb,OAAqE;QAErE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QAChE,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;IAChC,CAAC;CACF;AACD,2BAA2B;AAC3B,MAAM,UAAU,GAAG,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,WAAW,CAAC,KAAK,CAAC,CAAC;AAE3E,MAAM,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"]}
|
|
@@ -10,6 +10,7 @@ import * as Mappers from "../models/mappers.js";
|
|
|
10
10
|
import * as Parameters from "../models/parameters.js";
|
|
11
11
|
/** Class containing GenerateDetailedCostReportOperationStatus operations. */
|
|
12
12
|
export class GenerateDetailedCostReportOperationStatusImpl {
|
|
13
|
+
client;
|
|
13
14
|
/**
|
|
14
15
|
* Initialize a new instance of the class GenerateDetailedCostReportOperationStatus class.
|
|
15
16
|
* @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,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,6EAA6E;AAC7E,MAAM,OAAO,6CAA6C;
|
|
1
|
+
{"version":3,"file":"generateDetailedCostReportOperationStatus.js","sourceRoot":"","sources":["../../../src/operations/generateDetailedCostReportOperationStatus.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAOtD,6EAA6E;AAC7E,MAAM,OAAO,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;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"]}
|
|
@@ -12,6 +12,7 @@ import { createHttpPoller } from "@azure/core-lro";
|
|
|
12
12
|
import { createLroSpec } from "../lroImpl.js";
|
|
13
13
|
/** Class containing GenerateReservationDetailsReport operations. */
|
|
14
14
|
export class GenerateReservationDetailsReportImpl {
|
|
15
|
+
client;
|
|
15
16
|
/**
|
|
16
17
|
* Initialize a new instance of the class GenerateReservationDetailsReport class.
|
|
17
18
|
* @param client Reference to the service client
|
|
@@ -34,14 +35,19 @@ export class GenerateReservationDetailsReportImpl {
|
|
|
34
35
|
return this.client.sendOperationRequest(args, spec);
|
|
35
36
|
};
|
|
36
37
|
const sendOperationFn = async (args, spec) => {
|
|
37
|
-
var _a;
|
|
38
38
|
let currentRawResponse = undefined;
|
|
39
|
-
const providedCallback =
|
|
39
|
+
const providedCallback = args.options?.onResponse;
|
|
40
40
|
const callback = (rawResponse, flatResponse) => {
|
|
41
41
|
currentRawResponse = rawResponse;
|
|
42
|
-
providedCallback
|
|
42
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
43
|
+
};
|
|
44
|
+
const updatedArgs = {
|
|
45
|
+
...args,
|
|
46
|
+
options: {
|
|
47
|
+
...args.options,
|
|
48
|
+
onResponse: callback
|
|
49
|
+
}
|
|
43
50
|
};
|
|
44
|
-
const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
|
|
45
51
|
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
46
52
|
return {
|
|
47
53
|
flatResponse,
|
|
@@ -58,8 +64,8 @@ export class GenerateReservationDetailsReportImpl {
|
|
|
58
64
|
spec: byBillingAccountIdOperationSpec
|
|
59
65
|
});
|
|
60
66
|
const poller = await createHttpPoller(lro, {
|
|
61
|
-
restoreFrom: options
|
|
62
|
-
intervalInMs: options
|
|
67
|
+
restoreFrom: options?.resumeFrom,
|
|
68
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
63
69
|
resourceLocationConfig: "location"
|
|
64
70
|
});
|
|
65
71
|
await poller.poll();
|
|
@@ -95,14 +101,19 @@ export class GenerateReservationDetailsReportImpl {
|
|
|
95
101
|
return this.client.sendOperationRequest(args, spec);
|
|
96
102
|
};
|
|
97
103
|
const sendOperationFn = async (args, spec) => {
|
|
98
|
-
var _a;
|
|
99
104
|
let currentRawResponse = undefined;
|
|
100
|
-
const providedCallback =
|
|
105
|
+
const providedCallback = args.options?.onResponse;
|
|
101
106
|
const callback = (rawResponse, flatResponse) => {
|
|
102
107
|
currentRawResponse = rawResponse;
|
|
103
|
-
providedCallback
|
|
108
|
+
providedCallback?.(rawResponse, flatResponse);
|
|
109
|
+
};
|
|
110
|
+
const updatedArgs = {
|
|
111
|
+
...args,
|
|
112
|
+
options: {
|
|
113
|
+
...args.options,
|
|
114
|
+
onResponse: callback
|
|
115
|
+
}
|
|
104
116
|
};
|
|
105
|
-
const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
|
|
106
117
|
const flatResponse = await directSendOperation(updatedArgs, spec);
|
|
107
118
|
return {
|
|
108
119
|
flatResponse,
|
|
@@ -119,8 +130,8 @@ export class GenerateReservationDetailsReportImpl {
|
|
|
119
130
|
spec: byBillingProfileIdOperationSpec
|
|
120
131
|
});
|
|
121
132
|
const poller = await createHttpPoller(lro, {
|
|
122
|
-
restoreFrom: options
|
|
123
|
-
intervalInMs: options
|
|
133
|
+
restoreFrom: options?.resumeFrom,
|
|
134
|
+
intervalInMs: options?.updateIntervalInMs,
|
|
124
135
|
resourceLocationConfig: "location"
|
|
125
136
|
});
|
|
126
137
|
await poller.poll();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateReservationDetailsReport.js","sourceRoot":"","sources":["../../../src/operations/generateReservationDetailsReport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAQ9C,oEAAoE;AACpE,MAAM,OAAO,oCAAoC;IAI/C;;;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,eAAe,GAAG,KAAK,EAC3B,IAAmC,EACnC,IAA8B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,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,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"]}
|
|
1
|
+
{"version":3,"file":"generateReservationDetailsReport.js","sourceRoot":"","sources":["../../../src/operations/generateReservationDetailsReport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAEtD,OAAO,EAGL,gBAAgB,EACjB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAQ9C,oEAAoE;AACpE,MAAM,OAAO,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,eAAe,GAAG,KAAK,EAC3B,IAAmC,EACnC,IAA8B,EAC9B,EAAE;YACF,IAAI,kBAAkB,GAEN,SAAS,CAAC;YAC1B,MAAM,gBAAgB,GAAG,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC;YAClD,MAAM,QAAQ,GAAmC,CAC/C,WAA6C,EAC7C,YAAqB,EACrB,EAAE;gBACF,kBAAkB,GAAG,WAAW,CAAC;gBACjC,gBAAgB,EAAE,CAAC,WAAW,EAAE,YAAY,CAAC,CAAC;YAChD,CAAC,CAAC;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,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"]}
|
|
@@ -5,7 +5,6 @@
|
|
|
5
5
|
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
6
|
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
7
|
*/
|
|
8
|
-
import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
|
|
9
8
|
import { setContinuationToken } from "../pagingHelper.js";
|
|
10
9
|
import * as coreClient from "@azure/core-client";
|
|
11
10
|
import * as Mappers from "../models/mappers.js";
|
|
@@ -13,6 +12,7 @@ import * as Parameters from "../models/parameters.js";
|
|
|
13
12
|
/// <reference lib="esnext.asynciterable" />
|
|
14
13
|
/** Class containing Operations operations. */
|
|
15
14
|
export class OperationsImpl {
|
|
15
|
+
client;
|
|
16
16
|
/**
|
|
17
17
|
* Initialize a new instance of the class Operations class.
|
|
18
18
|
* @param client Reference to the service client
|
|
@@ -34,52 +34,35 @@ export class OperationsImpl {
|
|
|
34
34
|
return this;
|
|
35
35
|
},
|
|
36
36
|
byPage: (settings) => {
|
|
37
|
-
if (settings
|
|
37
|
+
if (settings?.maxPageSize) {
|
|
38
38
|
throw new Error("maxPageSize is not supported by this operation.");
|
|
39
39
|
}
|
|
40
40
|
return this.listPagingPage(options, settings);
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
listPagingPage(options, settings) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}
|
|
62
|
-
});
|
|
44
|
+
async *listPagingPage(options, settings) {
|
|
45
|
+
let result;
|
|
46
|
+
let continuationToken = settings?.continuationToken;
|
|
47
|
+
if (!continuationToken) {
|
|
48
|
+
result = await this._list(options);
|
|
49
|
+
let page = result.value || [];
|
|
50
|
+
continuationToken = result.nextLink;
|
|
51
|
+
setContinuationToken(page, continuationToken);
|
|
52
|
+
yield page;
|
|
53
|
+
}
|
|
54
|
+
while (continuationToken) {
|
|
55
|
+
result = await this._listNext(continuationToken, options);
|
|
56
|
+
continuationToken = result.nextLink;
|
|
57
|
+
let page = result.value || [];
|
|
58
|
+
setContinuationToken(page, continuationToken);
|
|
59
|
+
yield page;
|
|
60
|
+
}
|
|
63
61
|
}
|
|
64
|
-
listPagingAll(options) {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
for (var _d = true, _e = __asyncValues(this.listPagingPage(options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
|
|
69
|
-
_c = _f.value;
|
|
70
|
-
_d = false;
|
|
71
|
-
const page = _c;
|
|
72
|
-
yield __await(yield* __asyncDelegator(__asyncValues(page)));
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
76
|
-
finally {
|
|
77
|
-
try {
|
|
78
|
-
if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
|
|
79
|
-
}
|
|
80
|
-
finally { if (e_1) throw e_1.error; }
|
|
81
|
-
}
|
|
82
|
-
});
|
|
62
|
+
async *listPagingAll(options) {
|
|
63
|
+
for await (const page of this.listPagingPage(options)) {
|
|
64
|
+
yield* page;
|
|
65
|
+
}
|
|
83
66
|
}
|
|
84
67
|
/**
|
|
85
68
|
* 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
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/operations/operations.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AACjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AAUtD,4CAA4C;AAC5C,8CAA8C;AAC9C,MAAM,OAAO,cAAc;IACR,MAAM,CAAuB;IAE9C;;;OAGG;IACH,YAAY,MAA4B;QACtC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;OAGG;IACI,IAAI,CACT,OAAsC;QA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,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"]}
|