@azure/arm-commerce 4.0.0-beta.3 → 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 +30 -24
- 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 -87
- package/CHANGELOG.md +0 -11
- package/dist/index.js +0 -935
- 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 -6
- package/dist-esm/src/index.d.ts.map +0 -1
- package/dist-esm/src/index.js +0 -13
- 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 -156
- 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/pagingHelper.d.ts +0 -13
- package/dist-esm/src/pagingHelper.d.ts.map +0 -1
- package/dist-esm/src/pagingHelper.js +0 -32
- package/dist-esm/src/pagingHelper.js.map +0 -1
- package/dist-esm/src/usageManagementClient.d.ts +0 -22
- package/dist-esm/src/usageManagementClient.d.ts.map +0 -1
- package/dist-esm/src/usageManagementClient.js +0 -102
- 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 -56
- package/dist-esm/test/commerce_examples.js.map +0 -1
- package/review/arm-commerce.api.md +0 -181
- package/rollup.config.js +0 -122
- package/src/index.ts +0 -13
- package/src/models/index.ts +0 -211
- 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 -206
- package/src/operationsInterfaces/index.ts +0 -10
- package/src/operationsInterfaces/rateCard.ts +0 -30
- package/src/operationsInterfaces/usageAggregates.ts +0 -26
- package/src/pagingHelper.ts +0 -39
- package/src/usageManagementClient.ts +0 -143
- package/tsconfig.json +0 -33
- package/types/arm-commerce.d.ts +0 -258
|
@@ -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,209 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var models_exports = {};
|
|
19
|
+
__export(models_exports, {
|
|
20
|
+
KnownVersions: () => KnownVersions,
|
|
21
|
+
_usageAggregationListResultDeserializer: () => _usageAggregationListResultDeserializer,
|
|
22
|
+
_usageAggregationPropertiesDeserializer: () => _usageAggregationPropertiesDeserializer,
|
|
23
|
+
errorObjectResponseDeserializer: () => errorObjectResponseDeserializer,
|
|
24
|
+
errorResponseDeserializer: () => errorResponseDeserializer,
|
|
25
|
+
meterInfoArrayDeserializer: () => meterInfoArrayDeserializer,
|
|
26
|
+
meterInfoDeserializer: () => meterInfoDeserializer,
|
|
27
|
+
monetaryCommitmentDeserializer: () => monetaryCommitmentDeserializer,
|
|
28
|
+
monetaryCreditDeserializer: () => monetaryCreditDeserializer,
|
|
29
|
+
offerTermInfoDeserializer: () => offerTermInfoDeserializer,
|
|
30
|
+
offerTermInfoUnionArrayDeserializer: () => offerTermInfoUnionArrayDeserializer,
|
|
31
|
+
offerTermInfoUnionDeserializer: () => offerTermInfoUnionDeserializer,
|
|
32
|
+
recurringChargeDeserializer: () => recurringChargeDeserializer,
|
|
33
|
+
resourceRateCardInfoDeserializer: () => resourceRateCardInfoDeserializer,
|
|
34
|
+
usageAggregationArrayDeserializer: () => usageAggregationArrayDeserializer,
|
|
35
|
+
usageAggregationDeserializer: () => usageAggregationDeserializer,
|
|
36
|
+
usageSampleDeserializer: () => usageSampleDeserializer
|
|
37
|
+
});
|
|
38
|
+
module.exports = __toCommonJS(models_exports);
|
|
39
|
+
function _usageAggregationListResultDeserializer(item) {
|
|
40
|
+
return {
|
|
41
|
+
value: usageAggregationArrayDeserializer(item["value"]),
|
|
42
|
+
nextLink: item["nextLink"]
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
function usageAggregationArrayDeserializer(result) {
|
|
46
|
+
return result.map((item) => {
|
|
47
|
+
return usageAggregationDeserializer(item);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
function usageAggregationDeserializer(item) {
|
|
51
|
+
return {
|
|
52
|
+
id: item["id"],
|
|
53
|
+
name: item["name"],
|
|
54
|
+
type: item["type"],
|
|
55
|
+
...!item["properties"] ? item["properties"] : _usageAggregationPropertiesDeserializer(item["properties"])
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function usageSampleDeserializer(item) {
|
|
59
|
+
return {
|
|
60
|
+
subscriptionId: item["subscriptionId"],
|
|
61
|
+
meterId: item["meterId"],
|
|
62
|
+
usageStartTime: !item["usageStartTime"] ? item["usageStartTime"] : new Date(item["usageStartTime"]),
|
|
63
|
+
usageEndTime: !item["usageEndTime"] ? item["usageEndTime"] : new Date(item["usageEndTime"]),
|
|
64
|
+
quantity: item["quantity"],
|
|
65
|
+
unit: item["unit"],
|
|
66
|
+
meterName: item["meterName"],
|
|
67
|
+
meterCategory: item["meterCategory"],
|
|
68
|
+
meterSubCategory: item["meterSubCategory"],
|
|
69
|
+
meterRegion: item["meterRegion"],
|
|
70
|
+
infoFields: item["infoFields"],
|
|
71
|
+
instanceData: item["instanceData"]
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
function errorObjectResponseDeserializer(item) {
|
|
75
|
+
return {
|
|
76
|
+
error: !item["error"] ? item["error"] : errorResponseDeserializer(item["error"])
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
function errorResponseDeserializer(item) {
|
|
80
|
+
return {
|
|
81
|
+
code: item["code"],
|
|
82
|
+
message: item["message"]
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function resourceRateCardInfoDeserializer(item) {
|
|
86
|
+
return {
|
|
87
|
+
currency: item["Currency"],
|
|
88
|
+
locale: item["Locale"],
|
|
89
|
+
isTaxIncluded: item["IsTaxIncluded"],
|
|
90
|
+
offerTerms: !item["OfferTerms"] ? item["OfferTerms"] : offerTermInfoUnionArrayDeserializer(item["OfferTerms"]),
|
|
91
|
+
meters: !item["Meters"] ? item["Meters"] : meterInfoArrayDeserializer(item["Meters"])
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
function offerTermInfoUnionArrayDeserializer(result) {
|
|
95
|
+
return result.map((item) => {
|
|
96
|
+
return offerTermInfoUnionDeserializer(item);
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
function offerTermInfoDeserializer(item) {
|
|
100
|
+
return {
|
|
101
|
+
name: item["Name"],
|
|
102
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"])
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function offerTermInfoUnionDeserializer(item) {
|
|
106
|
+
switch (item["Name"]) {
|
|
107
|
+
case "Monetary Credit":
|
|
108
|
+
return monetaryCreditDeserializer(item);
|
|
109
|
+
case "Monetary Commitment":
|
|
110
|
+
return monetaryCommitmentDeserializer(item);
|
|
111
|
+
case "Recurring Charge":
|
|
112
|
+
return recurringChargeDeserializer(item);
|
|
113
|
+
default:
|
|
114
|
+
return offerTermInfoDeserializer(item);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function monetaryCreditDeserializer(item) {
|
|
118
|
+
return {
|
|
119
|
+
name: item["Name"],
|
|
120
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
121
|
+
credit: item["Credit"],
|
|
122
|
+
excludedMeterIds: !item["ExcludedMeterIds"] ? item["ExcludedMeterIds"] : item["ExcludedMeterIds"].map((p) => {
|
|
123
|
+
return p;
|
|
124
|
+
})
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
function monetaryCommitmentDeserializer(item) {
|
|
128
|
+
return {
|
|
129
|
+
name: item["Name"],
|
|
130
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
131
|
+
tieredDiscount: !item["TieredDiscount"] ? item["TieredDiscount"] : Object.fromEntries(
|
|
132
|
+
Object.entries(item["TieredDiscount"]).map(([k, p]) => [k, p])
|
|
133
|
+
),
|
|
134
|
+
excludedMeterIds: !item["ExcludedMeterIds"] ? item["ExcludedMeterIds"] : item["ExcludedMeterIds"].map((p) => {
|
|
135
|
+
return p;
|
|
136
|
+
})
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function recurringChargeDeserializer(item) {
|
|
140
|
+
return {
|
|
141
|
+
name: item["Name"],
|
|
142
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
143
|
+
recurringCharge: item["RecurringCharge"]
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
function meterInfoArrayDeserializer(result) {
|
|
147
|
+
return result.map((item) => {
|
|
148
|
+
return meterInfoDeserializer(item);
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
function meterInfoDeserializer(item) {
|
|
152
|
+
return {
|
|
153
|
+
meterId: item["MeterId"],
|
|
154
|
+
meterName: item["MeterName"],
|
|
155
|
+
meterCategory: item["MeterCategory"],
|
|
156
|
+
meterSubCategory: item["MeterSubCategory"],
|
|
157
|
+
unit: item["Unit"],
|
|
158
|
+
meterTags: !item["MeterTags"] ? item["MeterTags"] : item["MeterTags"].map((p) => {
|
|
159
|
+
return p;
|
|
160
|
+
}),
|
|
161
|
+
meterRegion: item["MeterRegion"],
|
|
162
|
+
meterRates: !item["MeterRates"] ? item["MeterRates"] : Object.fromEntries(
|
|
163
|
+
Object.entries(item["MeterRates"]).map(([k, p]) => [k, p])
|
|
164
|
+
),
|
|
165
|
+
effectiveDate: !item["EffectiveDate"] ? item["EffectiveDate"] : new Date(item["EffectiveDate"]),
|
|
166
|
+
includedQuantity: item["IncludedQuantity"]
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
var KnownVersions = /* @__PURE__ */ ((KnownVersions2) => {
|
|
170
|
+
KnownVersions2["V20150601Preview"] = "2015-06-01-preview";
|
|
171
|
+
return KnownVersions2;
|
|
172
|
+
})(KnownVersions || {});
|
|
173
|
+
function _usageAggregationPropertiesDeserializer(item) {
|
|
174
|
+
return {
|
|
175
|
+
subscriptionId: item["subscriptionId"],
|
|
176
|
+
meterId: item["meterId"],
|
|
177
|
+
usageStartTime: !item["usageStartTime"] ? item["usageStartTime"] : new Date(item["usageStartTime"]),
|
|
178
|
+
usageEndTime: !item["usageEndTime"] ? item["usageEndTime"] : new Date(item["usageEndTime"]),
|
|
179
|
+
quantity: item["quantity"],
|
|
180
|
+
unit: item["unit"],
|
|
181
|
+
meterName: item["meterName"],
|
|
182
|
+
meterCategory: item["meterCategory"],
|
|
183
|
+
meterSubCategory: item["meterSubCategory"],
|
|
184
|
+
meterRegion: item["meterRegion"],
|
|
185
|
+
infoFields: item["infoFields"],
|
|
186
|
+
instanceData: item["instanceData"]
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
190
|
+
0 && (module.exports = {
|
|
191
|
+
KnownVersions,
|
|
192
|
+
_usageAggregationListResultDeserializer,
|
|
193
|
+
_usageAggregationPropertiesDeserializer,
|
|
194
|
+
errorObjectResponseDeserializer,
|
|
195
|
+
errorResponseDeserializer,
|
|
196
|
+
meterInfoArrayDeserializer,
|
|
197
|
+
meterInfoDeserializer,
|
|
198
|
+
monetaryCommitmentDeserializer,
|
|
199
|
+
monetaryCreditDeserializer,
|
|
200
|
+
offerTermInfoDeserializer,
|
|
201
|
+
offerTermInfoUnionArrayDeserializer,
|
|
202
|
+
offerTermInfoUnionDeserializer,
|
|
203
|
+
recurringChargeDeserializer,
|
|
204
|
+
resourceRateCardInfoDeserializer,
|
|
205
|
+
usageAggregationArrayDeserializer,
|
|
206
|
+
usageAggregationDeserializer,
|
|
207
|
+
usageSampleDeserializer
|
|
208
|
+
});
|
|
209
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/models/models.ts"],
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["KnownVersions"]
|
|
7
|
+
}
|
|
@@ -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,52 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
var cloudSettingHelpers_exports = {};
|
|
19
|
+
__export(cloudSettingHelpers_exports, {
|
|
20
|
+
AzureClouds: () => AzureClouds,
|
|
21
|
+
getArmEndpoint: () => getArmEndpoint
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(cloudSettingHelpers_exports);
|
|
24
|
+
var AzureClouds = /* @__PURE__ */ ((AzureClouds2) => {
|
|
25
|
+
AzureClouds2["AZURE_PUBLIC_CLOUD"] = "AZURE_PUBLIC_CLOUD";
|
|
26
|
+
AzureClouds2["AZURE_CHINA_CLOUD"] = "AZURE_CHINA_CLOUD";
|
|
27
|
+
AzureClouds2["AZURE_US_GOVERNMENT"] = "AZURE_US_GOVERNMENT";
|
|
28
|
+
return AzureClouds2;
|
|
29
|
+
})(AzureClouds || {});
|
|
30
|
+
function getArmEndpoint(cloudSetting) {
|
|
31
|
+
if (cloudSetting === void 0) {
|
|
32
|
+
return void 0;
|
|
33
|
+
}
|
|
34
|
+
const cloudEndpoints = {
|
|
35
|
+
AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/",
|
|
36
|
+
AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/",
|
|
37
|
+
AZURE_PUBLIC_CLOUD: "https://management.azure.com/"
|
|
38
|
+
};
|
|
39
|
+
if (cloudSetting in cloudEndpoints) {
|
|
40
|
+
return cloudEndpoints[cloudSetting];
|
|
41
|
+
} else {
|
|
42
|
+
throw new Error(
|
|
43
|
+
`Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
AzureClouds,
|
|
50
|
+
getArmEndpoint
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=cloudSettingHelpers.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/static-helpers/cloudSettingHelpers.ts"],
|
|
4
|
+
"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"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOO,IAAK,cAAL,kBAAKA,iBAAL;AAEL,EAAAA,aAAA,wBAAqB;AAErB,EAAAA,aAAA,uBAAoB;AAEpB,EAAAA,aAAA,yBAAsB;AANZ,SAAAA;AAAA,GAAA;AAkBL,SAAS,eAAe,cAAyD;AACtF,MAAI,iBAAiB,QAAW;AAC9B,WAAO;AAAA,EACT;AACA,QAAM,iBAA2D;AAAA,IAC/D,mBAAmB;AAAA,IACnB,qBAAqB;AAAA,IACrB,oBAAoB;AAAA,EACtB;AACA,MAAI,gBAAgB,gBAAgB;AAClC,WAAO,eAAe,YAAY;AAAA,EACpC,OAAO;AACL,UAAM,IAAI;AAAA,MACR,0BAA0B,YAAY;AAAA,IACxC;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["AzureClouds"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
2
|
+
/**
|
|
3
|
+
* Options for the byPage method
|
|
4
|
+
*/
|
|
5
|
+
export interface PageSettings {
|
|
6
|
+
/**
|
|
7
|
+
* A reference to a specific page to start iterating from.
|
|
8
|
+
*/
|
|
9
|
+
continuationToken?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* An interface that describes a page of results.
|
|
13
|
+
*/
|
|
14
|
+
export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
|
|
15
|
+
/**
|
|
16
|
+
* The token that keeps track of where to continue the iterator
|
|
17
|
+
*/
|
|
18
|
+
continuationToken?: string;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* An interface that allows async iterable iteration both to completion and by page.
|
|
22
|
+
*/
|
|
23
|
+
export interface PagedAsyncIterableIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
24
|
+
/**
|
|
25
|
+
* The next method, part of the iteration protocol
|
|
26
|
+
*/
|
|
27
|
+
next(): Promise<IteratorResult<TElement>>;
|
|
28
|
+
/**
|
|
29
|
+
* The connection to the async iterator, part of the iteration protocol
|
|
30
|
+
*/
|
|
31
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
32
|
+
/**
|
|
33
|
+
* Return an AsyncIterableIterator that works a page at a time
|
|
34
|
+
*/
|
|
35
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* An interface that describes how to communicate with the service.
|
|
39
|
+
*/
|
|
40
|
+
export interface PagedResult<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings> {
|
|
41
|
+
/**
|
|
42
|
+
* Link to the first page of results.
|
|
43
|
+
*/
|
|
44
|
+
firstPageLink?: string;
|
|
45
|
+
/**
|
|
46
|
+
* A method that returns a page of results.
|
|
47
|
+
*/
|
|
48
|
+
getPage: (pageLink?: string) => Promise<{
|
|
49
|
+
page: TPage;
|
|
50
|
+
nextPageLink?: string;
|
|
51
|
+
} | undefined>;
|
|
52
|
+
/**
|
|
53
|
+
* a function to implement the `byPage` method on the paged async iterator.
|
|
54
|
+
*/
|
|
55
|
+
byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
56
|
+
/**
|
|
57
|
+
* A function to extract elements from a page.
|
|
58
|
+
*/
|
|
59
|
+
toElements?: (page: TPage) => TElement[];
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Options for the paging helper
|
|
63
|
+
*/
|
|
64
|
+
export interface BuildPagedAsyncIteratorOptions {
|
|
65
|
+
itemName?: string;
|
|
66
|
+
nextLinkName?: string;
|
|
67
|
+
nextLinkMethod?: "GET" | "POST";
|
|
68
|
+
apiVersion?: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Helper to paginate results in a generic way and return a PagedAsyncIterableIterator
|
|
72
|
+
*/
|
|
73
|
+
export declare function buildPagedAsyncIterator<TElement, TPage = TElement[], TPageSettings extends PageSettings = PageSettings, TResponse extends PathUncheckedResponse = PathUncheckedResponse>(client: Client, getInitialResponse: () => PromiseLike<TResponse>, processResponseBody: (result: TResponse) => PromiseLike<unknown>, expectedStatuses: string[], options?: BuildPagedAsyncIteratorOptions): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
74
|
+
//# sourceMappingURL=pagingHelpers.d.ts.map
|