@azure/arm-commerce 4.0.0-beta.2 → 4.0.0-beta.4
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/LICENSE +3 -3
- package/README.md +31 -25
- package/dist/browser/api/index.d.ts +3 -0
- package/dist/browser/api/index.js +4 -0
- package/dist/browser/api/index.js.map +1 -0
- package/dist/browser/api/rateCard/index.d.ts +3 -0
- package/dist/browser/api/rateCard/index.js +4 -0
- package/dist/browser/api/rateCard/index.js.map +1 -0
- package/dist/browser/api/rateCard/operations.d.ts +9 -0
- package/dist/browser/api/rateCard/operations.js +33 -0
- package/dist/browser/api/rateCard/operations.js.map +1 -0
- package/dist/browser/api/rateCard/options.d.ts +5 -0
- package/dist/browser/api/rateCard/options.js +4 -0
- package/dist/browser/api/rateCard/options.js.map +1 -0
- package/dist/browser/api/usageAggregates/index.d.ts +3 -0
- package/dist/browser/api/usageAggregates/index.js +4 -0
- package/dist/browser/api/usageAggregates/index.js.map +1 -0
- package/dist/browser/api/usageAggregates/operations.d.ts +10 -0
- package/dist/browser/api/usageAggregates/operations.js +47 -0
- package/dist/browser/api/usageAggregates/operations.js.map +1 -0
- package/dist/browser/api/usageAggregates/options.d.ts +12 -0
- package/dist/browser/api/usageAggregates/options.js +4 -0
- package/dist/browser/api/usageAggregates/options.js.map +1 -0
- package/dist/browser/api/usageManagementContext.d.ts +20 -0
- package/dist/browser/api/usageManagementContext.js +23 -0
- package/dist/browser/api/usageManagementContext.js.map +1 -0
- package/dist/browser/classic/index.d.ts +3 -0
- package/dist/browser/classic/index.js +4 -0
- package/dist/browser/classic/index.js.map +1 -0
- package/dist/browser/classic/rateCard/index.d.ts +10 -0
- package/dist/browser/classic/rateCard/index.js +14 -0
- package/dist/browser/classic/rateCard/index.js.map +1 -0
- package/dist/browser/classic/usageAggregates/index.d.ts +11 -0
- package/dist/browser/classic/usageAggregates/index.js +14 -0
- package/dist/browser/classic/usageAggregates/index.js.map +1 -0
- package/dist/browser/index.d.ts +14 -0
- package/dist/browser/index.js +7 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/logger.d.ts +2 -0
- package/dist/browser/logger.js +5 -0
- package/dist/browser/logger.js.map +1 -0
- package/dist/browser/models/index.d.ts +3 -0
- package/dist/browser/models/index.js +4 -0
- package/dist/browser/models/index.js.map +1 -0
- package/dist/browser/models/models.d.ts +193 -0
- package/dist/browser/models/models.js +169 -0
- package/dist/browser/models/models.js.map +1 -0
- package/dist/browser/package.json +3 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.js +38 -0
- package/dist/browser/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/browser/static-helpers/pagingHelpers.js +143 -0
- package/dist/browser/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/browser/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/browser/static-helpers/urlTemplate.js +200 -0
- package/dist/browser/static-helpers/urlTemplate.js.map +1 -0
- package/dist/browser/usageManagementClient.d.ts +17 -0
- package/dist/browser/usageManagementClient.js +32 -0
- package/dist/browser/usageManagementClient.js.map +1 -0
- package/dist/commonjs/api/index.d.ts +3 -0
- package/dist/commonjs/api/index.js +28 -0
- package/dist/commonjs/api/index.js.map +7 -0
- package/dist/commonjs/api/rateCard/index.d.ts +3 -0
- package/dist/commonjs/api/rateCard/index.js +28 -0
- package/dist/commonjs/api/rateCard/index.js.map +7 -0
- package/dist/commonjs/api/rateCard/operations.d.ts +9 -0
- package/dist/commonjs/api/rateCard/operations.js +64 -0
- package/dist/commonjs/api/rateCard/operations.js.map +7 -0
- package/dist/commonjs/api/rateCard/options.d.ts +5 -0
- package/dist/commonjs/api/rateCard/options.js +16 -0
- package/dist/commonjs/api/rateCard/options.js.map +7 -0
- package/dist/commonjs/api/usageAggregates/index.d.ts +3 -0
- package/dist/commonjs/api/usageAggregates/index.js +28 -0
- package/dist/commonjs/api/usageAggregates/index.js.map +7 -0
- package/dist/commonjs/api/usageAggregates/operations.d.ts +10 -0
- package/dist/commonjs/api/usageAggregates/operations.js +83 -0
- package/dist/commonjs/api/usageAggregates/operations.js.map +7 -0
- package/dist/commonjs/api/usageAggregates/options.d.ts +12 -0
- package/dist/commonjs/api/usageAggregates/options.js +16 -0
- package/dist/commonjs/api/usageAggregates/options.js.map +7 -0
- package/dist/commonjs/api/usageManagementContext.d.ts +20 -0
- package/dist/commonjs/api/usageManagementContext.js +45 -0
- package/dist/commonjs/api/usageManagementContext.js.map +7 -0
- package/dist/commonjs/classic/index.d.ts +3 -0
- package/dist/commonjs/classic/index.js +16 -0
- package/dist/commonjs/classic/index.js.map +7 -0
- package/dist/commonjs/classic/rateCard/index.d.ts +10 -0
- package/dist/commonjs/classic/rateCard/index.js +38 -0
- package/dist/commonjs/classic/rateCard/index.js.map +7 -0
- package/dist/commonjs/classic/usageAggregates/index.d.ts +11 -0
- package/dist/commonjs/classic/usageAggregates/index.js +38 -0
- package/dist/commonjs/classic/usageAggregates/index.js.map +7 -0
- package/dist/commonjs/index.d.ts +14 -0
- package/dist/commonjs/index.js +34 -0
- package/dist/commonjs/index.js.map +7 -0
- package/dist/commonjs/logger.d.ts +2 -0
- package/dist/commonjs/logger.js +29 -0
- package/dist/commonjs/logger.js.map +7 -0
- package/dist/commonjs/models/index.d.ts +3 -0
- package/dist/commonjs/models/index.js +28 -0
- package/dist/commonjs/models/index.js.map +7 -0
- package/dist/commonjs/models/models.d.ts +193 -0
- package/dist/commonjs/models/models.js +209 -0
- package/dist/commonjs/models/models.js.map +7 -0
- package/dist/commonjs/package.json +3 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.js +52 -0
- package/dist/commonjs/static-helpers/cloudSettingHelpers.js.map +7 -0
- package/dist/commonjs/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js +143 -0
- package/dist/commonjs/static-helpers/pagingHelpers.js.map +7 -0
- package/dist/commonjs/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/commonjs/static-helpers/urlTemplate.js +197 -0
- package/dist/commonjs/static-helpers/urlTemplate.js.map +7 -0
- package/{types → dist/commonjs}/tsdoc-metadata.json +11 -11
- package/dist/commonjs/usageManagementClient.d.ts +17 -0
- package/dist/commonjs/usageManagementClient.js +54 -0
- package/dist/commonjs/usageManagementClient.js.map +7 -0
- package/dist/esm/api/index.d.ts +3 -0
- package/dist/esm/api/index.js +4 -0
- package/dist/esm/api/index.js.map +1 -0
- package/dist/esm/api/rateCard/index.d.ts +3 -0
- package/dist/esm/api/rateCard/index.js +4 -0
- package/dist/esm/api/rateCard/index.js.map +1 -0
- package/dist/esm/api/rateCard/operations.d.ts +9 -0
- package/dist/esm/api/rateCard/operations.js +33 -0
- package/dist/esm/api/rateCard/operations.js.map +1 -0
- package/dist/esm/api/rateCard/options.d.ts +5 -0
- package/dist/esm/api/rateCard/options.js +4 -0
- package/dist/esm/api/rateCard/options.js.map +1 -0
- package/dist/esm/api/usageAggregates/index.d.ts +3 -0
- package/dist/esm/api/usageAggregates/index.js +4 -0
- package/dist/esm/api/usageAggregates/index.js.map +1 -0
- package/dist/esm/api/usageAggregates/operations.d.ts +10 -0
- package/dist/esm/api/usageAggregates/operations.js +47 -0
- package/dist/esm/api/usageAggregates/operations.js.map +1 -0
- package/dist/esm/api/usageAggregates/options.d.ts +12 -0
- package/dist/esm/api/usageAggregates/options.js +4 -0
- package/dist/esm/api/usageAggregates/options.js.map +1 -0
- package/dist/esm/api/usageManagementContext.d.ts +20 -0
- package/dist/esm/api/usageManagementContext.js +23 -0
- package/dist/esm/api/usageManagementContext.js.map +1 -0
- package/dist/esm/classic/index.d.ts +3 -0
- package/dist/esm/classic/index.js +4 -0
- package/dist/esm/classic/index.js.map +1 -0
- package/dist/esm/classic/rateCard/index.d.ts +10 -0
- package/dist/esm/classic/rateCard/index.js +14 -0
- package/dist/esm/classic/rateCard/index.js.map +1 -0
- package/dist/esm/classic/usageAggregates/index.d.ts +11 -0
- package/dist/esm/classic/usageAggregates/index.js +14 -0
- package/dist/esm/classic/usageAggregates/index.js.map +1 -0
- package/dist/esm/index.d.ts +14 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/logger.d.ts +2 -0
- package/dist/esm/logger.js +5 -0
- package/dist/esm/logger.js.map +1 -0
- package/dist/esm/models/index.d.ts +3 -0
- package/dist/esm/models/index.js +4 -0
- package/dist/esm/models/index.js.map +1 -0
- package/dist/esm/models/models.d.ts +193 -0
- package/dist/esm/models/models.js +169 -0
- package/dist/esm/models/models.js.map +1 -0
- package/dist/esm/package.json +3 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.js +38 -0
- package/dist/esm/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/esm/static-helpers/pagingHelpers.js +143 -0
- package/dist/esm/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/esm/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/esm/static-helpers/urlTemplate.js +200 -0
- package/dist/esm/static-helpers/urlTemplate.js.map +1 -0
- package/dist/esm/usageManagementClient.d.ts +17 -0
- package/dist/esm/usageManagementClient.js +32 -0
- package/dist/esm/usageManagementClient.js.map +1 -0
- package/dist/react-native/api/index.d.ts +3 -0
- package/dist/react-native/api/index.js +4 -0
- package/dist/react-native/api/index.js.map +1 -0
- package/dist/react-native/api/rateCard/index.d.ts +3 -0
- package/dist/react-native/api/rateCard/index.js +4 -0
- package/dist/react-native/api/rateCard/index.js.map +1 -0
- package/dist/react-native/api/rateCard/operations.d.ts +9 -0
- package/dist/react-native/api/rateCard/operations.js +33 -0
- package/dist/react-native/api/rateCard/operations.js.map +1 -0
- package/dist/react-native/api/rateCard/options.d.ts +5 -0
- package/dist/react-native/api/rateCard/options.js +4 -0
- package/dist/react-native/api/rateCard/options.js.map +1 -0
- package/dist/react-native/api/usageAggregates/index.d.ts +3 -0
- package/dist/react-native/api/usageAggregates/index.js +4 -0
- package/dist/react-native/api/usageAggregates/index.js.map +1 -0
- package/dist/react-native/api/usageAggregates/operations.d.ts +10 -0
- package/dist/react-native/api/usageAggregates/operations.js +47 -0
- package/dist/react-native/api/usageAggregates/operations.js.map +1 -0
- package/dist/react-native/api/usageAggregates/options.d.ts +12 -0
- package/dist/react-native/api/usageAggregates/options.js +4 -0
- package/dist/react-native/api/usageAggregates/options.js.map +1 -0
- package/dist/react-native/api/usageManagementContext.d.ts +20 -0
- package/dist/react-native/api/usageManagementContext.js +23 -0
- package/dist/react-native/api/usageManagementContext.js.map +1 -0
- package/dist/react-native/classic/index.d.ts +3 -0
- package/dist/react-native/classic/index.js +4 -0
- package/dist/react-native/classic/index.js.map +1 -0
- package/dist/react-native/classic/rateCard/index.d.ts +10 -0
- package/dist/react-native/classic/rateCard/index.js +14 -0
- package/dist/react-native/classic/rateCard/index.js.map +1 -0
- package/dist/react-native/classic/usageAggregates/index.d.ts +11 -0
- package/dist/react-native/classic/usageAggregates/index.js +14 -0
- package/dist/react-native/classic/usageAggregates/index.js.map +1 -0
- package/dist/react-native/index.d.ts +14 -0
- package/dist/react-native/index.js +7 -0
- package/dist/react-native/index.js.map +1 -0
- package/dist/react-native/logger.d.ts +2 -0
- package/dist/react-native/logger.js +5 -0
- package/dist/react-native/logger.js.map +1 -0
- package/dist/react-native/models/index.d.ts +3 -0
- package/dist/react-native/models/index.js +4 -0
- package/dist/react-native/models/index.js.map +1 -0
- package/dist/react-native/models/models.d.ts +193 -0
- package/dist/react-native/models/models.js +169 -0
- package/dist/react-native/models/models.js.map +1 -0
- package/dist/react-native/package.json +3 -0
- package/dist/react-native/static-helpers/cloudSettingHelpers.d.ts +22 -0
- package/dist/react-native/static-helpers/cloudSettingHelpers.js +38 -0
- package/dist/react-native/static-helpers/cloudSettingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/pagingHelpers.d.ts +74 -0
- package/dist/react-native/static-helpers/pagingHelpers.js +143 -0
- package/dist/react-native/static-helpers/pagingHelpers.js.map +1 -0
- package/dist/react-native/static-helpers/urlTemplate.d.ts +5 -0
- package/dist/react-native/static-helpers/urlTemplate.js +200 -0
- package/dist/react-native/static-helpers/urlTemplate.js.map +1 -0
- package/dist/react-native/usageManagementClient.d.ts +17 -0
- package/dist/react-native/usageManagementClient.js +32 -0
- package/dist/react-native/usageManagementClient.js.map +1 -0
- package/package.json +164 -83
- package/CHANGELOG.md +0 -11
- package/dist/index.js +0 -843
- package/dist/index.js.map +0 -1
- package/dist/index.min.js +0 -1
- package/dist/index.min.js.map +0 -1
- package/dist-esm/samples-dev/getRateCard.d.ts +0 -2
- package/dist-esm/samples-dev/getRateCard.d.ts.map +0 -1
- package/dist-esm/samples-dev/getRateCard.js +0 -30
- package/dist-esm/samples-dev/getRateCard.js.map +0 -1
- package/dist-esm/samples-dev/rateCardGetSample.d.ts +0 -2
- package/dist-esm/samples-dev/rateCardGetSample.d.ts.map +0 -1
- package/dist-esm/samples-dev/rateCardGetSample.js +0 -30
- package/dist-esm/samples-dev/rateCardGetSample.js.map +0 -1
- package/dist-esm/src/index.d.ts +0 -5
- package/dist-esm/src/index.d.ts.map +0 -1
- package/dist-esm/src/index.js +0 -12
- package/dist-esm/src/index.js.map +0 -1
- package/dist-esm/src/models/index.d.ts +0 -178
- package/dist-esm/src/models/index.d.ts.map +0 -1
- package/dist-esm/src/models/index.js +0 -9
- package/dist-esm/src/models/index.js.map +0 -1
- package/dist-esm/src/models/mappers.d.ts +0 -19
- package/dist-esm/src/models/mappers.d.ts.map +0 -1
- package/dist-esm/src/models/mappers.js +0 -433
- package/dist-esm/src/models/mappers.js.map +0 -1
- package/dist-esm/src/models/parameters.d.ts +0 -13
- package/dist-esm/src/models/parameters.d.ts.map +0 -1
- package/dist-esm/src/models/parameters.js +0 -121
- package/dist-esm/src/models/parameters.js.map +0 -1
- package/dist-esm/src/operations/index.d.ts +0 -3
- package/dist-esm/src/operations/index.d.ts.map +0 -1
- package/dist-esm/src/operations/index.js +0 -10
- package/dist-esm/src/operations/index.js.map +0 -1
- package/dist-esm/src/operations/rateCard.d.ts +0 -27
- package/dist-esm/src/operations/rateCard.d.ts.map +0 -1
- package/dist-esm/src/operations/rateCard.js +0 -55
- package/dist-esm/src/operations/rateCard.js.map +0 -1
- package/dist-esm/src/operations/usageAggregates.d.ts +0 -38
- package/dist-esm/src/operations/usageAggregates.d.ts.map +0 -1
- package/dist-esm/src/operations/usageAggregates.js +0 -144
- package/dist-esm/src/operations/usageAggregates.js.map +0 -1
- package/dist-esm/src/operationsInterfaces/index.d.ts +0 -3
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +0 -1
- package/dist-esm/src/operationsInterfaces/index.js +0 -10
- package/dist-esm/src/operationsInterfaces/index.js.map +0 -1
- package/dist-esm/src/operationsInterfaces/rateCard.d.ts +0 -19
- package/dist-esm/src/operationsInterfaces/rateCard.d.ts.map +0 -1
- package/dist-esm/src/operationsInterfaces/rateCard.js +0 -9
- package/dist-esm/src/operationsInterfaces/rateCard.js.map +0 -1
- package/dist-esm/src/operationsInterfaces/usageAggregates.d.ts +0 -13
- package/dist-esm/src/operationsInterfaces/usageAggregates.d.ts.map +0 -1
- package/dist-esm/src/operationsInterfaces/usageAggregates.js +0 -9
- package/dist-esm/src/operationsInterfaces/usageAggregates.js.map +0 -1
- package/dist-esm/src/usageManagementClient.d.ts +0 -20
- package/dist-esm/src/usageManagementClient.d.ts.map +0 -1
- package/dist-esm/src/usageManagementClient.js +0 -54
- package/dist-esm/src/usageManagementClient.js.map +0 -1
- package/dist-esm/test/commerce_examples.d.ts +0 -4
- package/dist-esm/test/commerce_examples.d.ts.map +0 -1
- package/dist-esm/test/commerce_examples.js +0 -58
- package/dist-esm/test/commerce_examples.js.map +0 -1
- package/review/arm-commerce.api.md +0 -178
- package/rollup.config.js +0 -122
- package/src/index.ts +0 -12
- package/src/models/index.ts +0 -210
- package/src/models/mappers.ts +0 -460
- package/src/models/parameters.ts +0 -137
- package/src/operations/index.ts +0 -10
- package/src/operations/rateCard.ts +0 -69
- package/src/operations/usageAggregates.ts +0 -188
- package/src/operationsInterfaces/index.ts +0 -10
- package/src/operationsInterfaces/rateCard.ts +0 -30
- package/src/operationsInterfaces/usageAggregates.ts +0 -26
- package/src/usageManagementClient.ts +0 -79
- package/tsconfig.json +0 -33
- package/types/arm-commerce.d.ts +0 -247
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/rateCard/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,GAAG,EAAE,MAAM,kCAAkC,CAAC;AAUvD,SAAS,YAAY,CAAC,OAA+B;IACnD,OAAO;QACL,GAAG,EAAE,CAAC,MAAc,EAAE,OAAmC,EAAE,EAAE,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC;KAC5F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,OAA+B;IACpE,OAAO;QACL,GAAG,YAAY,CAAC,OAAO,CAAC;KACzB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { UsageManagementContext } from \"../../api/usageManagementContext.js\";\nimport { get } from \"../../api/rateCard/operations.js\";\nimport type { RateCardGetOptionalParams } from \"../../api/rateCard/options.js\";\nimport type { ResourceRateCardInfo } from \"../../models/models.js\";\n\n/** Interface representing a RateCard operations. */\nexport interface RateCardOperations {\n /** Enables you to query for the resource/meter metadata and related prices used in a given subscription by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including but not limited to service names, types, resources, units of measure, and regions, is subject to change at any time and without notice. If you intend to use this billing data in an automated fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the change. */\n get: (filter: string, options?: RateCardGetOptionalParams) => Promise<ResourceRateCardInfo>;\n}\n\nfunction _getRateCard(context: UsageManagementContext) {\n return {\n get: (filter: string, options?: RateCardGetOptionalParams) => get(context, filter, options),\n };\n}\n\nexport function _getRateCardOperations(context: UsageManagementContext): RateCardOperations {\n return {\n ..._getRateCard(context),\n };\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { UsageManagementContext } from "../../api/usageManagementContext.js";
|
|
2
|
+
import type { UsageAggregatesListOptionalParams } from "../../api/usageAggregates/options.js";
|
|
3
|
+
import type { UsageAggregation } from "../../models/models.js";
|
|
4
|
+
import type { PagedAsyncIterableIterator } from "../../static-helpers/pagingHelpers.js";
|
|
5
|
+
/** Interface representing a UsageAggregates operations. */
|
|
6
|
+
export interface UsageAggregatesOperations {
|
|
7
|
+
/** Query aggregated Azure subscription consumption data for a date range. */
|
|
8
|
+
list: (reportedStartTime: Date, reportedEndTime: Date, options?: UsageAggregatesListOptionalParams) => PagedAsyncIterableIterator<UsageAggregation>;
|
|
9
|
+
}
|
|
10
|
+
export declare function _getUsageAggregatesOperations(context: UsageManagementContext): UsageAggregatesOperations;
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { list } from "../../api/usageAggregates/operations.js";
|
|
4
|
+
function _getUsageAggregates(context) {
|
|
5
|
+
return {
|
|
6
|
+
list: (reportedStartTime, reportedEndTime, options) => list(context, reportedStartTime, reportedEndTime, options),
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function _getUsageAggregatesOperations(context) {
|
|
10
|
+
return {
|
|
11
|
+
..._getUsageAggregates(context),
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/classic/usageAggregates/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,IAAI,EAAE,MAAM,yCAAyC,CAAC;AAe/D,SAAS,mBAAmB,CAAC,OAA+B;IAC1D,OAAO;QACL,IAAI,EAAE,CACJ,iBAAuB,EACvB,eAAqB,EACrB,OAA2C,EAC3C,EAAE,CAAC,IAAI,CAAC,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,OAAO,CAAC;KAChE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,6BAA6B,CAC3C,OAA+B;IAE/B,OAAO;QACL,GAAG,mBAAmB,CAAC,OAAO,CAAC;KAChC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { UsageManagementContext } from \"../../api/usageManagementContext.js\";\nimport { list } from \"../../api/usageAggregates/operations.js\";\nimport type { UsageAggregatesListOptionalParams } from \"../../api/usageAggregates/options.js\";\nimport type { UsageAggregation } from \"../../models/models.js\";\nimport type { PagedAsyncIterableIterator } from \"../../static-helpers/pagingHelpers.js\";\n\n/** Interface representing a UsageAggregates operations. */\nexport interface UsageAggregatesOperations {\n /** Query aggregated Azure subscription consumption data for a date range. */\n list: (\n reportedStartTime: Date,\n reportedEndTime: Date,\n options?: UsageAggregatesListOptionalParams,\n ) => PagedAsyncIterableIterator<UsageAggregation>;\n}\n\nfunction _getUsageAggregates(context: UsageManagementContext) {\n return {\n list: (\n reportedStartTime: Date,\n reportedEndTime: Date,\n options?: UsageAggregatesListOptionalParams,\n ) => list(context, reportedStartTime, reportedEndTime, options),\n };\n}\n\nexport function _getUsageAggregatesOperations(\n context: UsageManagementContext,\n): UsageAggregatesOperations {\n return {\n ..._getUsageAggregates(context),\n };\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { AzureSupportedClouds } from "./static-helpers/cloudSettingHelpers.js";
|
|
2
|
+
import { AzureClouds } from "./static-helpers/cloudSettingHelpers.js";
|
|
3
|
+
import type { PageSettings, ContinuablePage, PagedAsyncIterableIterator } from "./static-helpers/pagingHelpers.js";
|
|
4
|
+
export { UsageManagementClient } from "./usageManagementClient.js";
|
|
5
|
+
export type { UsageAggregation, UsageSample, ErrorObjectResponse, ErrorResponse, ResourceRateCardInfo, OfferTermInfo, OfferTermInfoUnion, OfferTermInfoName, MonetaryCredit, MonetaryCommitment, RecurringCharge, MeterInfo, AggregationGranularity, } from "./models/index.js";
|
|
6
|
+
export { KnownVersions } from "./models/index.js";
|
|
7
|
+
export type { UsageManagementClientOptionalParams } from "./api/index.js";
|
|
8
|
+
export type { RateCardGetOptionalParams } from "./api/rateCard/index.js";
|
|
9
|
+
export type { UsageAggregatesListOptionalParams } from "./api/usageAggregates/index.js";
|
|
10
|
+
export type { RateCardOperations, UsageAggregatesOperations } from "./classic/index.js";
|
|
11
|
+
export type { PageSettings, ContinuablePage, PagedAsyncIterableIterator };
|
|
12
|
+
export { AzureClouds };
|
|
13
|
+
export type { AzureSupportedClouds };
|
|
14
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { AzureClouds } from "./static-helpers/cloudSettingHelpers.js";
|
|
4
|
+
export { UsageManagementClient } from "./usageManagementClient.js";
|
|
5
|
+
export { KnownVersions } from "./models/index.js";
|
|
6
|
+
export { AzureClouds };
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,WAAW,EAAE,MAAM,yCAAyC,CAAC;AAOtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAgBnE,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAMlD,OAAO,EAAE,WAAW,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { AzureSupportedClouds } from \"./static-helpers/cloudSettingHelpers.js\";\nimport { AzureClouds } from \"./static-helpers/cloudSettingHelpers.js\";\nimport type {\n PageSettings,\n ContinuablePage,\n PagedAsyncIterableIterator,\n} from \"./static-helpers/pagingHelpers.js\";\n\nexport { UsageManagementClient } from \"./usageManagementClient.js\";\nexport type {\n UsageAggregation,\n UsageSample,\n ErrorObjectResponse,\n ErrorResponse,\n ResourceRateCardInfo,\n OfferTermInfo,\n OfferTermInfoUnion,\n OfferTermInfoName,\n MonetaryCredit,\n MonetaryCommitment,\n RecurringCharge,\n MeterInfo,\n AggregationGranularity,\n} from \"./models/index.js\";\nexport { KnownVersions } from \"./models/index.js\";\nexport type { UsageManagementClientOptionalParams } from \"./api/index.js\";\nexport type { RateCardGetOptionalParams } from \"./api/rateCard/index.js\";\nexport type { UsageAggregatesListOptionalParams } from \"./api/usageAggregates/index.js\";\nexport type { RateCardOperations, UsageAggregatesOperations } from \"./classic/index.js\";\nexport type { PageSettings, ContinuablePage, PagedAsyncIterableIterator };\nexport { AzureClouds };\nexport type { AzureSupportedClouds };\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,MAAM,CAAC,MAAM,MAAM,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { createClientLogger } from \"@azure/logger\";\nexport const logger = createClientLogger(\"arm-commerce\");\n"]}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export type { UsageAggregation, UsageSample, ErrorObjectResponse, ErrorResponse, ResourceRateCardInfo, OfferTermInfo, OfferTermInfoUnion, OfferTermInfoName, MonetaryCredit, MonetaryCommitment, RecurringCharge, MeterInfo, AggregationGranularity, } from "./models.js";
|
|
2
|
+
export { KnownVersions } from "./models.js";
|
|
3
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/models/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiBlC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport type {\n UsageAggregation,\n UsageSample,\n ErrorObjectResponse,\n ErrorResponse,\n ResourceRateCardInfo,\n OfferTermInfo,\n OfferTermInfoUnion,\n OfferTermInfoName,\n MonetaryCredit,\n MonetaryCommitment,\n RecurringCharge,\n MeterInfo,\n AggregationGranularity,\n} from \"./models.js\";\nexport { KnownVersions } from \"./models.js\";\n"]}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file contains only generated model types and their (de)serializers.
|
|
3
|
+
* Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input.
|
|
4
|
+
*/
|
|
5
|
+
/** The response of a UsageAggregation list operation. */
|
|
6
|
+
export interface _UsageAggregationListResult {
|
|
7
|
+
/** The UsageAggregation items on this page */
|
|
8
|
+
value: UsageAggregation[];
|
|
9
|
+
/** The link to the next page of items */
|
|
10
|
+
nextLink?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function _usageAggregationListResultDeserializer(item: any): _UsageAggregationListResult;
|
|
13
|
+
export declare function usageAggregationArrayDeserializer(result: Array<UsageAggregation>): any[];
|
|
14
|
+
/** Describes the usageAggregation. */
|
|
15
|
+
export interface UsageAggregation {
|
|
16
|
+
/** Unique Id for the usage aggregate. */
|
|
17
|
+
id?: string;
|
|
18
|
+
/** Name of the usage aggregate. */
|
|
19
|
+
name?: string;
|
|
20
|
+
/** Type of the resource being returned. */
|
|
21
|
+
type?: string;
|
|
22
|
+
/** The subscription identifier for the Azure user. */
|
|
23
|
+
subscriptionId?: string;
|
|
24
|
+
/** Unique ID for the resource that was consumed (aka ResourceID). */
|
|
25
|
+
meterId?: string;
|
|
26
|
+
/** UTC start time for the usage bucket to which this usage aggregate belongs. */
|
|
27
|
+
usageStartTime?: Date;
|
|
28
|
+
/** UTC end time for the usage bucket to which this usage aggregate belongs. */
|
|
29
|
+
usageEndTime?: Date;
|
|
30
|
+
/** The amount of the resource consumption that occurred in this time frame. */
|
|
31
|
+
quantity?: number;
|
|
32
|
+
/** The unit in which the usage for this resource is being counted, e.g. Hours, GB. */
|
|
33
|
+
unit?: string;
|
|
34
|
+
/** Friendly name of the resource being consumed. */
|
|
35
|
+
meterName?: string;
|
|
36
|
+
/** Category of the consumed resource. */
|
|
37
|
+
meterCategory?: string;
|
|
38
|
+
/** Sub-category of the consumed resource. */
|
|
39
|
+
meterSubCategory?: string;
|
|
40
|
+
/** Region of the meterId used for billing purposes */
|
|
41
|
+
meterRegion?: string;
|
|
42
|
+
/** Key-value pairs of instance details (legacy format). */
|
|
43
|
+
infoFields?: any;
|
|
44
|
+
/** Key-value pairs of instance details represented as a string. */
|
|
45
|
+
instanceData?: string;
|
|
46
|
+
}
|
|
47
|
+
export declare function usageAggregationDeserializer(item: any): UsageAggregation;
|
|
48
|
+
/** Describes a sample of the usageAggregation. */
|
|
49
|
+
export interface UsageSample {
|
|
50
|
+
/** The subscription identifier for the Azure user. */
|
|
51
|
+
subscriptionId?: string;
|
|
52
|
+
/** Unique ID for the resource that was consumed (aka ResourceID). */
|
|
53
|
+
meterId?: string;
|
|
54
|
+
/** UTC start time for the usage bucket to which this usage aggregate belongs. */
|
|
55
|
+
usageStartTime?: Date;
|
|
56
|
+
/** UTC end time for the usage bucket to which this usage aggregate belongs. */
|
|
57
|
+
usageEndTime?: Date;
|
|
58
|
+
/** The amount of the resource consumption that occurred in this time frame. */
|
|
59
|
+
quantity?: number;
|
|
60
|
+
/** The unit in which the usage for this resource is being counted, e.g. Hours, GB. */
|
|
61
|
+
unit?: string;
|
|
62
|
+
/** Friendly name of the resource being consumed. */
|
|
63
|
+
meterName?: string;
|
|
64
|
+
/** Category of the consumed resource. */
|
|
65
|
+
meterCategory?: string;
|
|
66
|
+
/** Sub-category of the consumed resource. */
|
|
67
|
+
meterSubCategory?: string;
|
|
68
|
+
/** Region of the meterId used for billing purposes */
|
|
69
|
+
meterRegion?: string;
|
|
70
|
+
/** Key-value pairs of instance details (legacy format). */
|
|
71
|
+
infoFields?: any;
|
|
72
|
+
/** Key-value pairs of instance details represented as a string. */
|
|
73
|
+
instanceData?: string;
|
|
74
|
+
}
|
|
75
|
+
export declare function usageSampleDeserializer(item: any): UsageSample;
|
|
76
|
+
/** Describes the format of Error response with a wrapper object */
|
|
77
|
+
export interface ErrorObjectResponse {
|
|
78
|
+
/** Wrapper object for error information */
|
|
79
|
+
error?: ErrorResponse;
|
|
80
|
+
}
|
|
81
|
+
export declare function errorObjectResponseDeserializer(item: any): ErrorObjectResponse;
|
|
82
|
+
/** Describes the format of Error response. */
|
|
83
|
+
export interface ErrorResponse {
|
|
84
|
+
/** Error code */
|
|
85
|
+
code?: string;
|
|
86
|
+
/** Error message indicating why the operation failed. */
|
|
87
|
+
message?: string;
|
|
88
|
+
}
|
|
89
|
+
export declare function errorResponseDeserializer(item: any): ErrorResponse;
|
|
90
|
+
/** Price and Metadata information for resources */
|
|
91
|
+
export interface ResourceRateCardInfo {
|
|
92
|
+
/** The currency in which the rates are provided. */
|
|
93
|
+
currency?: string;
|
|
94
|
+
/** The culture in which the resource information is localized. */
|
|
95
|
+
locale?: string;
|
|
96
|
+
/** All rates are pretax, so this will always be returned as 'false'. */
|
|
97
|
+
isTaxIncluded?: boolean;
|
|
98
|
+
/** A list of offer terms. */
|
|
99
|
+
offerTerms?: OfferTermInfoUnion[];
|
|
100
|
+
/** A list of meters. */
|
|
101
|
+
meters?: MeterInfo[];
|
|
102
|
+
}
|
|
103
|
+
export declare function resourceRateCardInfoDeserializer(item: any): ResourceRateCardInfo;
|
|
104
|
+
export declare function offerTermInfoUnionArrayDeserializer(result: Array<OfferTermInfoUnion>): any[];
|
|
105
|
+
/** Describes the offer term. */
|
|
106
|
+
export interface OfferTermInfo {
|
|
107
|
+
/** Name of the offer term */
|
|
108
|
+
/** The discriminator possible values: Monetary Credit, Monetary Commitment, Recurring Charge */
|
|
109
|
+
name: OfferTermInfoName;
|
|
110
|
+
/** Indicates the date from which the offer term is effective. */
|
|
111
|
+
effectiveDate?: Date;
|
|
112
|
+
}
|
|
113
|
+
export declare function offerTermInfoDeserializer(item: any): OfferTermInfo;
|
|
114
|
+
/** Alias for OfferTermInfoUnion */
|
|
115
|
+
export type OfferTermInfoUnion = MonetaryCredit | MonetaryCommitment | RecurringCharge | OfferTermInfo;
|
|
116
|
+
export declare function offerTermInfoUnionDeserializer(item: any): OfferTermInfoUnion;
|
|
117
|
+
/** Name of the offer term */
|
|
118
|
+
export type OfferTermInfoName = "Recurring Charge" | "Monetary Commitment" | "Monetary Credit";
|
|
119
|
+
/** Indicates that this is a monetary credit offer. */
|
|
120
|
+
export interface MonetaryCredit extends OfferTermInfo {
|
|
121
|
+
/** The amount of credit provided under the terms of the given offer level. */
|
|
122
|
+
credit?: number;
|
|
123
|
+
/** An array of meter ids that are excluded from the given offer terms. */
|
|
124
|
+
excludedMeterIds?: string[];
|
|
125
|
+
/** Name of the offer term */
|
|
126
|
+
name: "Monetary Credit";
|
|
127
|
+
}
|
|
128
|
+
export declare function monetaryCreditDeserializer(item: any): MonetaryCredit;
|
|
129
|
+
/** Indicates that a monetary commitment is required for this offer */
|
|
130
|
+
export interface MonetaryCommitment extends OfferTermInfo {
|
|
131
|
+
/** The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'. */
|
|
132
|
+
tieredDiscount?: Record<string, number>;
|
|
133
|
+
/** An array of meter ids that are excluded from the given offer terms. */
|
|
134
|
+
excludedMeterIds?: string[];
|
|
135
|
+
/** Name of the offer term */
|
|
136
|
+
name: "Monetary Commitment";
|
|
137
|
+
}
|
|
138
|
+
export declare function monetaryCommitmentDeserializer(item: any): MonetaryCommitment;
|
|
139
|
+
/** Indicates a recurring charge is present for this offer. */
|
|
140
|
+
export interface RecurringCharge extends OfferTermInfo {
|
|
141
|
+
/** The amount of recurring charge as per the offer term. */
|
|
142
|
+
recurringCharge?: number;
|
|
143
|
+
/** Name of the offer term */
|
|
144
|
+
name: "Recurring Charge";
|
|
145
|
+
}
|
|
146
|
+
export declare function recurringChargeDeserializer(item: any): RecurringCharge;
|
|
147
|
+
export declare function meterInfoArrayDeserializer(result: Array<MeterInfo>): any[];
|
|
148
|
+
/** Detailed information about the meter. */
|
|
149
|
+
export interface MeterInfo {
|
|
150
|
+
/** The unique identifier of the resource. */
|
|
151
|
+
meterId?: string;
|
|
152
|
+
/** The name of the meter, within the given meter category */
|
|
153
|
+
meterName?: string;
|
|
154
|
+
/** The category of the meter, e.g., 'Cloud services', 'Networking', etc.. */
|
|
155
|
+
meterCategory?: string;
|
|
156
|
+
/** The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. */
|
|
157
|
+
meterSubCategory?: string;
|
|
158
|
+
/** The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc. */
|
|
159
|
+
unit?: string;
|
|
160
|
+
/** Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party. */
|
|
161
|
+
meterTags?: string[];
|
|
162
|
+
/** The region in which the Azure service is available. */
|
|
163
|
+
meterRegion?: string;
|
|
164
|
+
/** The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price */
|
|
165
|
+
meterRates?: Record<string, number>;
|
|
166
|
+
/** Indicates the date from which the meter rate is effective. */
|
|
167
|
+
effectiveDate?: Date;
|
|
168
|
+
/** The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged. */
|
|
169
|
+
includedQuantity?: number;
|
|
170
|
+
}
|
|
171
|
+
export declare function meterInfoDeserializer(item: any): MeterInfo;
|
|
172
|
+
/** Type of AggregationGranularity */
|
|
173
|
+
export type AggregationGranularity = "Daily" | "Hourly";
|
|
174
|
+
/** The available API versions. */
|
|
175
|
+
export declare enum KnownVersions {
|
|
176
|
+
/** The 2015-06-01-preview API version. */
|
|
177
|
+
V20150601Preview = "2015-06-01-preview"
|
|
178
|
+
}
|
|
179
|
+
export declare function _usageAggregationPropertiesDeserializer(item: any): {
|
|
180
|
+
subscriptionId: any;
|
|
181
|
+
meterId: any;
|
|
182
|
+
usageStartTime: any;
|
|
183
|
+
usageEndTime: any;
|
|
184
|
+
quantity: any;
|
|
185
|
+
unit: any;
|
|
186
|
+
meterName: any;
|
|
187
|
+
meterCategory: any;
|
|
188
|
+
meterSubCategory: any;
|
|
189
|
+
meterRegion: any;
|
|
190
|
+
infoFields: any;
|
|
191
|
+
instanceData: any;
|
|
192
|
+
};
|
|
193
|
+
//# sourceMappingURL=models.d.ts.map
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
export function _usageAggregationListResultDeserializer(item) {
|
|
4
|
+
return {
|
|
5
|
+
value: usageAggregationArrayDeserializer(item["value"]),
|
|
6
|
+
nextLink: item["nextLink"],
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
export function usageAggregationArrayDeserializer(result) {
|
|
10
|
+
return result.map((item) => {
|
|
11
|
+
return usageAggregationDeserializer(item);
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
export function usageAggregationDeserializer(item) {
|
|
15
|
+
return {
|
|
16
|
+
id: item["id"],
|
|
17
|
+
name: item["name"],
|
|
18
|
+
type: item["type"],
|
|
19
|
+
...(!item["properties"]
|
|
20
|
+
? item["properties"]
|
|
21
|
+
: _usageAggregationPropertiesDeserializer(item["properties"])),
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export function usageSampleDeserializer(item) {
|
|
25
|
+
return {
|
|
26
|
+
subscriptionId: item["subscriptionId"],
|
|
27
|
+
meterId: item["meterId"],
|
|
28
|
+
usageStartTime: !item["usageStartTime"]
|
|
29
|
+
? item["usageStartTime"]
|
|
30
|
+
: new Date(item["usageStartTime"]),
|
|
31
|
+
usageEndTime: !item["usageEndTime"] ? item["usageEndTime"] : new Date(item["usageEndTime"]),
|
|
32
|
+
quantity: item["quantity"],
|
|
33
|
+
unit: item["unit"],
|
|
34
|
+
meterName: item["meterName"],
|
|
35
|
+
meterCategory: item["meterCategory"],
|
|
36
|
+
meterSubCategory: item["meterSubCategory"],
|
|
37
|
+
meterRegion: item["meterRegion"],
|
|
38
|
+
infoFields: item["infoFields"],
|
|
39
|
+
instanceData: item["instanceData"],
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export function errorObjectResponseDeserializer(item) {
|
|
43
|
+
return {
|
|
44
|
+
error: !item["error"] ? item["error"] : errorResponseDeserializer(item["error"]),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function errorResponseDeserializer(item) {
|
|
48
|
+
return {
|
|
49
|
+
code: item["code"],
|
|
50
|
+
message: item["message"],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export function resourceRateCardInfoDeserializer(item) {
|
|
54
|
+
return {
|
|
55
|
+
currency: item["Currency"],
|
|
56
|
+
locale: item["Locale"],
|
|
57
|
+
isTaxIncluded: item["IsTaxIncluded"],
|
|
58
|
+
offerTerms: !item["OfferTerms"]
|
|
59
|
+
? item["OfferTerms"]
|
|
60
|
+
: offerTermInfoUnionArrayDeserializer(item["OfferTerms"]),
|
|
61
|
+
meters: !item["Meters"] ? item["Meters"] : meterInfoArrayDeserializer(item["Meters"]),
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export function offerTermInfoUnionArrayDeserializer(result) {
|
|
65
|
+
return result.map((item) => {
|
|
66
|
+
return offerTermInfoUnionDeserializer(item);
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
export function offerTermInfoDeserializer(item) {
|
|
70
|
+
return {
|
|
71
|
+
name: item["Name"],
|
|
72
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
export function offerTermInfoUnionDeserializer(item) {
|
|
76
|
+
switch (item["Name"]) {
|
|
77
|
+
case "Monetary Credit":
|
|
78
|
+
return monetaryCreditDeserializer(item);
|
|
79
|
+
case "Monetary Commitment":
|
|
80
|
+
return monetaryCommitmentDeserializer(item);
|
|
81
|
+
case "Recurring Charge":
|
|
82
|
+
return recurringChargeDeserializer(item);
|
|
83
|
+
default:
|
|
84
|
+
return offerTermInfoDeserializer(item);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
export function monetaryCreditDeserializer(item) {
|
|
88
|
+
return {
|
|
89
|
+
name: item["Name"],
|
|
90
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
91
|
+
credit: item["Credit"],
|
|
92
|
+
excludedMeterIds: !item["ExcludedMeterIds"]
|
|
93
|
+
? item["ExcludedMeterIds"]
|
|
94
|
+
: item["ExcludedMeterIds"].map((p) => {
|
|
95
|
+
return p;
|
|
96
|
+
}),
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export function monetaryCommitmentDeserializer(item) {
|
|
100
|
+
return {
|
|
101
|
+
name: item["Name"],
|
|
102
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
103
|
+
tieredDiscount: !item["TieredDiscount"]
|
|
104
|
+
? item["TieredDiscount"]
|
|
105
|
+
: Object.fromEntries(Object.entries(item["TieredDiscount"]).map(([k, p]) => [k, p])),
|
|
106
|
+
excludedMeterIds: !item["ExcludedMeterIds"]
|
|
107
|
+
? item["ExcludedMeterIds"]
|
|
108
|
+
: item["ExcludedMeterIds"].map((p) => {
|
|
109
|
+
return p;
|
|
110
|
+
}),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
export function recurringChargeDeserializer(item) {
|
|
114
|
+
return {
|
|
115
|
+
name: item["Name"],
|
|
116
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
117
|
+
recurringCharge: item["RecurringCharge"],
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
export function meterInfoArrayDeserializer(result) {
|
|
121
|
+
return result.map((item) => {
|
|
122
|
+
return meterInfoDeserializer(item);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
export function meterInfoDeserializer(item) {
|
|
126
|
+
return {
|
|
127
|
+
meterId: item["MeterId"],
|
|
128
|
+
meterName: item["MeterName"],
|
|
129
|
+
meterCategory: item["MeterCategory"],
|
|
130
|
+
meterSubCategory: item["MeterSubCategory"],
|
|
131
|
+
unit: item["Unit"],
|
|
132
|
+
meterTags: !item["MeterTags"]
|
|
133
|
+
? item["MeterTags"]
|
|
134
|
+
: item["MeterTags"].map((p) => {
|
|
135
|
+
return p;
|
|
136
|
+
}),
|
|
137
|
+
meterRegion: item["MeterRegion"],
|
|
138
|
+
meterRates: !item["MeterRates"]
|
|
139
|
+
? item["MeterRates"]
|
|
140
|
+
: Object.fromEntries(Object.entries(item["MeterRates"]).map(([k, p]) => [k, p])),
|
|
141
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
142
|
+
includedQuantity: item["IncludedQuantity"],
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/** The available API versions. */
|
|
146
|
+
export var KnownVersions;
|
|
147
|
+
(function (KnownVersions) {
|
|
148
|
+
/** The 2015-06-01-preview API version. */
|
|
149
|
+
KnownVersions["V20150601Preview"] = "2015-06-01-preview";
|
|
150
|
+
})(KnownVersions || (KnownVersions = {}));
|
|
151
|
+
export function _usageAggregationPropertiesDeserializer(item) {
|
|
152
|
+
return {
|
|
153
|
+
subscriptionId: item["subscriptionId"],
|
|
154
|
+
meterId: item["meterId"],
|
|
155
|
+
usageStartTime: !item["usageStartTime"]
|
|
156
|
+
? item["usageStartTime"]
|
|
157
|
+
: new Date(item["usageStartTime"]),
|
|
158
|
+
usageEndTime: !item["usageEndTime"] ? item["usageEndTime"] : new Date(item["usageEndTime"]),
|
|
159
|
+
quantity: item["quantity"],
|
|
160
|
+
unit: item["unit"],
|
|
161
|
+
meterName: item["meterName"],
|
|
162
|
+
meterCategory: item["meterCategory"],
|
|
163
|
+
meterSubCategory: item["meterSubCategory"],
|
|
164
|
+
meterRegion: item["meterRegion"],
|
|
165
|
+
infoFields: item["infoFields"],
|
|
166
|
+
instanceData: item["instanceData"],
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/models/models.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAgBlC,MAAM,UAAU,uCAAuC,CAAC,IAAS;IAC/D,OAAO;QACL,KAAK,EAAE,iCAAiC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACvD,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;KAC3B,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,iCAAiC,CAAC,MAA+B;IAC/E,OAAO,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACzB,OAAO,4BAA4B,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC;AAoCD,MAAM,UAAU,4BAA4B,CAAC,IAAS;IACpD,OAAO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AAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACpC,YAAY,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3F,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC;QAC1B,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC;QAClB,SAAS,EAAE,IAAI,CAAC,WAAW,CAAC;QAC5B,aAAa,EAAE,IAAI,CAAC,eAAe,CAAC;QACpC,gBAAgB,EAAE,IAAI,CAAC,kBAAkB,CAAC;QAC1C,WAAW,EAAE,IAAI,CAAC,aAAa,CAAC;QAChC,UAAU,EAAE,IAAI,CAAC,YAAY,CAAC;QAC9B,YAAY,EAAE,IAAI,CAAC,cAAc,CAAC;KACnC,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * This file contains only generated model types and their (de)serializers.\n * Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input.\n */\n/* eslint-disable @typescript-eslint/naming-convention */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n/** The response of a UsageAggregation list operation. */\nexport interface _UsageAggregationListResult {\n /** The UsageAggregation items on this page */\n value: UsageAggregation[];\n /** The link to the next page of items */\n nextLink?: string;\n}\n\nexport function _usageAggregationListResultDeserializer(item: any): _UsageAggregationListResult {\n return {\n value: usageAggregationArrayDeserializer(item[\"value\"]),\n nextLink: item[\"nextLink\"],\n };\n}\n\nexport function usageAggregationArrayDeserializer(result: Array<UsageAggregation>): any[] {\n return result.map((item) => {\n return usageAggregationDeserializer(item);\n });\n}\n\n/** Describes the usageAggregation. */\nexport interface UsageAggregation {\n /** Unique Id for the usage aggregate. */\n id?: string;\n /** Name of the usage aggregate. */\n name?: string;\n /** Type of the resource being returned. */\n type?: string;\n /** The subscription identifier for the Azure user. */\n subscriptionId?: string;\n /** Unique ID for the resource that was consumed (aka ResourceID). */\n meterId?: string;\n /** UTC start time for the usage bucket to which this usage aggregate belongs. */\n usageStartTime?: Date;\n /** UTC end time for the usage bucket to which this usage aggregate belongs. */\n usageEndTime?: Date;\n /** The amount of the resource consumption that occurred in this time frame. */\n quantity?: number;\n /** The unit in which the usage for this resource is being counted, e.g. Hours, GB. */\n unit?: string;\n /** Friendly name of the resource being consumed. */\n meterName?: string;\n /** Category of the consumed resource. */\n meterCategory?: string;\n /** Sub-category of the consumed resource. */\n meterSubCategory?: string;\n /** Region of the meterId used for billing purposes */\n meterRegion?: string;\n /** Key-value pairs of instance details (legacy format). */\n infoFields?: any;\n /** Key-value pairs of instance details represented as a string. */\n instanceData?: string;\n}\n\nexport function usageAggregationDeserializer(item: any): UsageAggregation {\n return {\n id: item[\"id\"],\n name: item[\"name\"],\n type: item[\"type\"],\n ...(!item[\"properties\"]\n ? item[\"properties\"]\n : _usageAggregationPropertiesDeserializer(item[\"properties\"])),\n };\n}\n\n/** Describes a sample of the usageAggregation. */\nexport interface UsageSample {\n /** The subscription identifier for the Azure user. */\n subscriptionId?: string;\n /** Unique ID for the resource that was consumed (aka ResourceID). */\n meterId?: string;\n /** UTC start time for the usage bucket to which this usage aggregate belongs. */\n usageStartTime?: Date;\n /** UTC end time for the usage bucket to which this usage aggregate belongs. */\n usageEndTime?: Date;\n /** The amount of the resource consumption that occurred in this time frame. */\n quantity?: number;\n /** The unit in which the usage for this resource is being counted, e.g. Hours, GB. */\n unit?: string;\n /** Friendly name of the resource being consumed. */\n meterName?: string;\n /** Category of the consumed resource. */\n meterCategory?: string;\n /** Sub-category of the consumed resource. */\n meterSubCategory?: string;\n /** Region of the meterId used for billing purposes */\n meterRegion?: string;\n /** Key-value pairs of instance details (legacy format). */\n infoFields?: any;\n /** Key-value pairs of instance details represented as a string. */\n instanceData?: string;\n}\n\nexport function usageSampleDeserializer(item: any): UsageSample {\n return {\n subscriptionId: item[\"subscriptionId\"],\n meterId: item[\"meterId\"],\n usageStartTime: !item[\"usageStartTime\"]\n ? item[\"usageStartTime\"]\n : new Date(item[\"usageStartTime\"]),\n usageEndTime: !item[\"usageEndTime\"] ? item[\"usageEndTime\"] : new Date(item[\"usageEndTime\"]),\n quantity: item[\"quantity\"],\n unit: item[\"unit\"],\n meterName: item[\"meterName\"],\n meterCategory: item[\"meterCategory\"],\n meterSubCategory: item[\"meterSubCategory\"],\n meterRegion: item[\"meterRegion\"],\n infoFields: item[\"infoFields\"],\n instanceData: item[\"instanceData\"],\n };\n}\n\n/** Describes the format of Error response with a wrapper object */\nexport interface ErrorObjectResponse {\n /** Wrapper object for error information */\n error?: ErrorResponse;\n}\n\nexport function errorObjectResponseDeserializer(item: any): ErrorObjectResponse {\n return {\n error: !item[\"error\"] ? item[\"error\"] : errorResponseDeserializer(item[\"error\"]),\n };\n}\n\n/** Describes the format of Error response. */\nexport interface ErrorResponse {\n /** Error code */\n code?: string;\n /** Error message indicating why the operation failed. */\n message?: string;\n}\n\nexport function errorResponseDeserializer(item: any): ErrorResponse {\n return {\n code: item[\"code\"],\n message: item[\"message\"],\n };\n}\n\n/** Price and Metadata information for resources */\nexport interface ResourceRateCardInfo {\n /** The currency in which the rates are provided. */\n currency?: string;\n /** The culture in which the resource information is localized. */\n locale?: string;\n /** All rates are pretax, so this will always be returned as 'false'. */\n isTaxIncluded?: boolean;\n /** A list of offer terms. */\n offerTerms?: OfferTermInfoUnion[];\n /** A list of meters. */\n meters?: MeterInfo[];\n}\n\nexport function resourceRateCardInfoDeserializer(item: any): ResourceRateCardInfo {\n return {\n currency: item[\"Currency\"],\n locale: item[\"Locale\"],\n isTaxIncluded: item[\"IsTaxIncluded\"],\n offerTerms: !item[\"OfferTerms\"]\n ? item[\"OfferTerms\"]\n : offerTermInfoUnionArrayDeserializer(item[\"OfferTerms\"]),\n meters: !item[\"Meters\"] ? item[\"Meters\"] : meterInfoArrayDeserializer(item[\"Meters\"]),\n };\n}\n\nexport function offerTermInfoUnionArrayDeserializer(result: Array<OfferTermInfoUnion>): any[] {\n return result.map((item) => {\n return offerTermInfoUnionDeserializer(item);\n });\n}\n\n/** Describes the offer term. */\nexport interface OfferTermInfo {\n /** Name of the offer term */\n /** The discriminator possible values: Monetary Credit, Monetary Commitment, Recurring Charge */\n name: OfferTermInfoName;\n /** Indicates the date from which the offer term is effective. */\n effectiveDate?: Date;\n}\n\nexport function offerTermInfoDeserializer(item: any): OfferTermInfo {\n return {\n name: item[\"Name\"],\n effectiveDate: !item[\"EffectiveDate\"] ? item[\"EffectiveDate\"] : new Date(item[\"EffectiveDate\"]),\n };\n}\n\n/** Alias for OfferTermInfoUnion */\nexport type OfferTermInfoUnion =\n | MonetaryCredit\n | MonetaryCommitment\n | RecurringCharge\n | OfferTermInfo;\n\nexport function offerTermInfoUnionDeserializer(item: any): OfferTermInfoUnion {\n switch (item[\"Name\"]) {\n case \"Monetary Credit\":\n return monetaryCreditDeserializer(item as MonetaryCredit);\n\n case \"Monetary Commitment\":\n return monetaryCommitmentDeserializer(item as MonetaryCommitment);\n\n case \"Recurring Charge\":\n return recurringChargeDeserializer(item as RecurringCharge);\n\n default:\n return offerTermInfoDeserializer(item);\n }\n}\n\n/** Name of the offer term */\nexport type OfferTermInfoName = \"Recurring Charge\" | \"Monetary Commitment\" | \"Monetary Credit\";\n\n/** Indicates that this is a monetary credit offer. */\nexport interface MonetaryCredit extends OfferTermInfo {\n /** The amount of credit provided under the terms of the given offer level. */\n credit?: number;\n /** An array of meter ids that are excluded from the given offer terms. */\n excludedMeterIds?: string[];\n /** Name of the offer term */\n name: \"Monetary Credit\";\n}\n\nexport function monetaryCreditDeserializer(item: any): MonetaryCredit {\n return {\n name: item[\"Name\"],\n effectiveDate: !item[\"EffectiveDate\"] ? item[\"EffectiveDate\"] : new Date(item[\"EffectiveDate\"]),\n credit: item[\"Credit\"],\n excludedMeterIds: !item[\"ExcludedMeterIds\"]\n ? item[\"ExcludedMeterIds\"]\n : item[\"ExcludedMeterIds\"].map((p: any) => {\n return p;\n }),\n };\n}\n\n/** Indicates that a monetary commitment is required for this offer */\nexport interface MonetaryCommitment extends OfferTermInfo {\n /** The list of key/value pairs for the tiered meter rates, in the format 'key':'value' where key = price, and value = the corresponding discount percentage. This field is used only by offer terms of type 'Monetary Commitment'. */\n tieredDiscount?: Record<string, number>;\n /** An array of meter ids that are excluded from the given offer terms. */\n excludedMeterIds?: string[];\n /** Name of the offer term */\n name: \"Monetary Commitment\";\n}\n\nexport function monetaryCommitmentDeserializer(item: any): MonetaryCommitment {\n return {\n name: item[\"Name\"],\n effectiveDate: !item[\"EffectiveDate\"] ? item[\"EffectiveDate\"] : new Date(item[\"EffectiveDate\"]),\n tieredDiscount: !item[\"TieredDiscount\"]\n ? item[\"TieredDiscount\"]\n : Object.fromEntries(\n Object.entries(item[\"TieredDiscount\"]).map(([k, p]: [string, any]) => [k, p]),\n ),\n excludedMeterIds: !item[\"ExcludedMeterIds\"]\n ? item[\"ExcludedMeterIds\"]\n : item[\"ExcludedMeterIds\"].map((p: any) => {\n return p;\n }),\n };\n}\n\n/** Indicates a recurring charge is present for this offer. */\nexport interface RecurringCharge extends OfferTermInfo {\n /** The amount of recurring charge as per the offer term. */\n recurringCharge?: number;\n /** Name of the offer term */\n name: \"Recurring Charge\";\n}\n\nexport function recurringChargeDeserializer(item: any): RecurringCharge {\n return {\n name: item[\"Name\"],\n effectiveDate: !item[\"EffectiveDate\"] ? item[\"EffectiveDate\"] : new Date(item[\"EffectiveDate\"]),\n recurringCharge: item[\"RecurringCharge\"],\n };\n}\n\nexport function meterInfoArrayDeserializer(result: Array<MeterInfo>): any[] {\n return result.map((item) => {\n return meterInfoDeserializer(item);\n });\n}\n\n/** Detailed information about the meter. */\nexport interface MeterInfo {\n /** The unique identifier of the resource. */\n meterId?: string;\n /** The name of the meter, within the given meter category */\n meterName?: string;\n /** The category of the meter, e.g., 'Cloud services', 'Networking', etc.. */\n meterCategory?: string;\n /** The subcategory of the meter, e.g., 'A6 Cloud services', 'ExpressRoute (IXP)', etc.. */\n meterSubCategory?: string;\n /** The unit in which the meter consumption is charged, e.g., 'Hours', 'GB', etc. */\n unit?: string;\n /** Provides additional meter data. 'Third Party' indicates a meter with no discount. Blanks indicate First Party. */\n meterTags?: string[];\n /** The region in which the Azure service is available. */\n meterRegion?: string;\n /** The list of key/value pairs for the meter rates, in the format 'key':'value' where key = the meter quantity, and value = the corresponding price */\n meterRates?: Record<string, number>;\n /** Indicates the date from which the meter rate is effective. */\n effectiveDate?: Date;\n /** The resource quantity that is included in the offer at no cost. Consumption beyond this quantity will be charged. */\n includedQuantity?: number;\n}\n\nexport function meterInfoDeserializer(item: any): MeterInfo {\n return {\n meterId: item[\"MeterId\"],\n meterName: item[\"MeterName\"],\n meterCategory: item[\"MeterCategory\"],\n meterSubCategory: item[\"MeterSubCategory\"],\n unit: item[\"Unit\"],\n meterTags: !item[\"MeterTags\"]\n ? item[\"MeterTags\"]\n : item[\"MeterTags\"].map((p: any) => {\n return p;\n }),\n meterRegion: item[\"MeterRegion\"],\n meterRates: !item[\"MeterRates\"]\n ? item[\"MeterRates\"]\n : Object.fromEntries(\n Object.entries(item[\"MeterRates\"]).map(([k, p]: [string, any]) => [k, p]),\n ),\n effectiveDate: !item[\"EffectiveDate\"] ? item[\"EffectiveDate\"] : new Date(item[\"EffectiveDate\"]),\n includedQuantity: item[\"IncludedQuantity\"],\n };\n}\n\n/** Type of AggregationGranularity */\nexport type AggregationGranularity = \"Daily\" | \"Hourly\";\n\n/** The available API versions. */\nexport enum KnownVersions {\n /** The 2015-06-01-preview API version. */\n V20150601Preview = \"2015-06-01-preview\",\n}\n\nexport function _usageAggregationPropertiesDeserializer(item: any) {\n return {\n subscriptionId: item[\"subscriptionId\"],\n meterId: item[\"meterId\"],\n usageStartTime: !item[\"usageStartTime\"]\n ? item[\"usageStartTime\"]\n : new Date(item[\"usageStartTime\"]),\n usageEndTime: !item[\"usageEndTime\"] ? item[\"usageEndTime\"] : new Date(item[\"usageEndTime\"]),\n quantity: item[\"quantity\"],\n unit: item[\"unit\"],\n meterName: item[\"meterName\"],\n meterCategory: item[\"meterCategory\"],\n meterSubCategory: item[\"meterSubCategory\"],\n meterRegion: item[\"meterRegion\"],\n infoFields: item[\"infoFields\"],\n instanceData: item[\"instanceData\"],\n };\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* An enum to describe Azure Cloud environments.
|
|
3
|
+
* @enum {string}
|
|
4
|
+
*/
|
|
5
|
+
export declare enum AzureClouds {
|
|
6
|
+
/** Azure public cloud, which is the default cloud for Azure SDKs. */
|
|
7
|
+
AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
|
|
8
|
+
/** Azure China cloud */
|
|
9
|
+
AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
|
|
10
|
+
/** Azure US government cloud */
|
|
11
|
+
AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
|
|
12
|
+
}
|
|
13
|
+
/** The supported values for cloud setting as a string literal type */
|
|
14
|
+
export type AzureSupportedClouds = `${AzureClouds}`;
|
|
15
|
+
/**
|
|
16
|
+
* Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
|
|
17
|
+
* @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
|
|
18
|
+
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
|
|
19
|
+
* @throws {Error} Throws an error if an unknown cloud setting is provided.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined;
|
|
22
|
+
//# sourceMappingURL=cloudSettingHelpers.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
/**
|
|
4
|
+
* An enum to describe Azure Cloud environments.
|
|
5
|
+
* @enum {string}
|
|
6
|
+
*/
|
|
7
|
+
export var AzureClouds;
|
|
8
|
+
(function (AzureClouds) {
|
|
9
|
+
/** Azure public cloud, which is the default cloud for Azure SDKs. */
|
|
10
|
+
AzureClouds["AZURE_PUBLIC_CLOUD"] = "AZURE_PUBLIC_CLOUD";
|
|
11
|
+
/** Azure China cloud */
|
|
12
|
+
AzureClouds["AZURE_CHINA_CLOUD"] = "AZURE_CHINA_CLOUD";
|
|
13
|
+
/** Azure US government cloud */
|
|
14
|
+
AzureClouds["AZURE_US_GOVERNMENT"] = "AZURE_US_GOVERNMENT";
|
|
15
|
+
})(AzureClouds || (AzureClouds = {}));
|
|
16
|
+
/**
|
|
17
|
+
* Gets the Azure Resource Manager endpoint URL for the specified cloud setting.
|
|
18
|
+
* @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.
|
|
19
|
+
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
|
|
20
|
+
* @throws {Error} Throws an error if an unknown cloud setting is provided.
|
|
21
|
+
*/
|
|
22
|
+
export function getArmEndpoint(cloudSetting) {
|
|
23
|
+
if (cloudSetting === undefined) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const cloudEndpoints = {
|
|
27
|
+
AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/",
|
|
28
|
+
AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/",
|
|
29
|
+
AZURE_PUBLIC_CLOUD: "https://management.azure.com/",
|
|
30
|
+
};
|
|
31
|
+
if (cloudSetting in cloudEndpoints) {
|
|
32
|
+
return cloudEndpoints[cloudSetting];
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
throw new Error(`Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=cloudSettingHelpers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudSettingHelpers.js","sourceRoot":"","sources":["../../../src/static-helpers/cloudSettingHelpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,qEAAqE;IACrE,wDAAyC,CAAA;IACzC,wBAAwB;IACxB,sDAAuC,CAAA;IACvC,gCAAgC;IAChC,0DAA2C,CAAA;AAC7C,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAKD;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,YAAmC;IAChE,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAC/B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,cAAc,GAA6C;QAC/D,iBAAiB,EAAE,sCAAsC;QACzD,mBAAmB,EAAE,uCAAuC;QAC5D,kBAAkB,EAAE,+BAA+B;KACpD,CAAC;IACF,IAAI,YAAY,IAAI,cAAc,EAAE,CAAC;QACnC,OAAO,cAAc,CAAC,YAAY,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CACb,0BAA0B,YAAY,6DAA6D,CACpG,CAAC;IACJ,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * An enum to describe Azure Cloud environments.\n * @enum {string}\n */\nexport enum AzureClouds {\n /** Azure public cloud, which is the default cloud for Azure SDKs. */\n AZURE_PUBLIC_CLOUD = \"AZURE_PUBLIC_CLOUD\",\n /** Azure China cloud */\n AZURE_CHINA_CLOUD = \"AZURE_CHINA_CLOUD\",\n /** Azure US government cloud */\n AZURE_US_GOVERNMENT = \"AZURE_US_GOVERNMENT\",\n}\n\n/** The supported values for cloud setting as a string literal type */\nexport type AzureSupportedClouds = `${AzureClouds}`;\n\n/**\n * Gets the Azure Resource Manager endpoint URL for the specified cloud setting.\n * @param cloudSetting - The Azure cloud environment setting. Use one of the AzureClouds enum values.\n * @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.\n * @throws {Error} Throws an error if an unknown cloud setting is provided.\n */\nexport function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined {\n if (cloudSetting === undefined) {\n return undefined;\n }\n const cloudEndpoints: Record<keyof typeof AzureClouds, string> = {\n AZURE_CHINA_CLOUD: \"https://management.chinacloudapi.cn/\",\n AZURE_US_GOVERNMENT: \"https://management.usgovcloudapi.net/\",\n AZURE_PUBLIC_CLOUD: \"https://management.azure.com/\",\n };\n if (cloudSetting in cloudEndpoints) {\n return cloudEndpoints[cloudSetting];\n } else {\n throw new Error(\n `Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`,\n );\n }\n}\n"]}
|