@azure/arm-commerce 4.0.0-alpha.20250109.1 → 4.0.0-alpha.20250113.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (246) hide show
  1. package/README.md +4 -6
  2. package/dist/browser/index.d.ts +5 -0
  3. package/{dist-esm/src → dist/browser}/index.d.ts.map +1 -1
  4. package/{dist-esm/src → dist/browser}/index.js +4 -4
  5. package/dist/browser/index.js.map +1 -0
  6. package/dist/browser/models/index.js.map +1 -0
  7. package/dist/browser/models/mappers.js.map +1 -0
  8. package/dist/browser/models/parameters.js.map +1 -0
  9. package/dist/browser/operations/index.d.ts +3 -0
  10. package/{dist-esm/src → dist/browser}/operations/index.d.ts.map +1 -1
  11. package/{dist-esm/src → dist/browser}/operations/index.js +2 -2
  12. package/dist/browser/operations/index.js.map +1 -0
  13. package/{dist-esm/src → dist/browser}/operations/rateCard.d.ts +3 -3
  14. package/dist/browser/operations/rateCard.d.ts.map +1 -0
  15. package/{dist-esm/src → dist/browser}/operations/rateCard.js +2 -2
  16. package/dist/browser/operations/rateCard.js.map +1 -0
  17. package/{dist-esm/src → dist/browser}/operations/usageAggregates.d.ts +3 -3
  18. package/dist/browser/operations/usageAggregates.d.ts.map +1 -0
  19. package/{dist-esm/src → dist/browser}/operations/usageAggregates.js +3 -3
  20. package/dist/browser/operations/usageAggregates.js.map +1 -0
  21. package/dist/browser/operationsInterfaces/index.d.ts +3 -0
  22. package/{dist-esm/src → dist/browser}/operationsInterfaces/index.d.ts.map +1 -1
  23. package/{dist-esm/src → dist/browser}/operationsInterfaces/index.js +2 -2
  24. package/dist/browser/operationsInterfaces/index.js.map +1 -0
  25. package/{dist-esm/src → dist/browser}/operationsInterfaces/rateCard.d.ts +1 -1
  26. package/dist/browser/operationsInterfaces/rateCard.d.ts.map +1 -0
  27. package/dist/browser/operationsInterfaces/rateCard.js.map +1 -0
  28. package/{dist-esm/src → dist/browser}/operationsInterfaces/usageAggregates.d.ts +1 -1
  29. package/dist/browser/operationsInterfaces/usageAggregates.d.ts.map +1 -0
  30. package/dist/browser/operationsInterfaces/usageAggregates.js.map +1 -0
  31. package/dist/browser/package.json +3 -0
  32. package/dist/browser/pagingHelper.js.map +1 -0
  33. package/{dist-esm/src → dist/browser}/usageManagementClient.d.ts +2 -2
  34. package/dist/browser/usageManagementClient.d.ts.map +1 -0
  35. package/{dist-esm/src → dist/browser}/usageManagementClient.js +15 -18
  36. package/dist/browser/usageManagementClient.js.map +1 -0
  37. package/dist/commonjs/index.d.ts +5 -0
  38. package/dist/commonjs/index.d.ts.map +1 -0
  39. package/dist/commonjs/index.js +19 -0
  40. package/dist/commonjs/index.js.map +1 -0
  41. package/{types/arm-commerce.d.ts → dist/commonjs/models/index.d.ts} +178 -258
  42. package/dist/commonjs/models/index.d.ts.map +1 -0
  43. package/dist/commonjs/models/index.js +10 -0
  44. package/dist/commonjs/models/index.js.map +1 -0
  45. package/dist/commonjs/models/mappers.d.ts +19 -0
  46. package/dist/commonjs/models/mappers.d.ts.map +1 -0
  47. package/dist/commonjs/models/mappers.js +436 -0
  48. package/dist/commonjs/models/mappers.js.map +1 -0
  49. package/dist/commonjs/models/parameters.d.ts +13 -0
  50. package/dist/commonjs/models/parameters.d.ts.map +1 -0
  51. package/dist/commonjs/models/parameters.js +124 -0
  52. package/dist/commonjs/models/parameters.js.map +1 -0
  53. package/dist/commonjs/operations/index.d.ts +3 -0
  54. package/dist/commonjs/operations/index.d.ts.map +1 -0
  55. package/dist/commonjs/operations/index.js +13 -0
  56. package/dist/commonjs/operations/index.js.map +1 -0
  57. package/dist/commonjs/operations/rateCard.d.ts +27 -0
  58. package/dist/commonjs/operations/rateCard.d.ts.map +1 -0
  59. package/dist/commonjs/operations/rateCard.js +60 -0
  60. package/dist/commonjs/operations/rateCard.js.map +1 -0
  61. package/dist/commonjs/operations/usageAggregates.d.ts +38 -0
  62. package/dist/commonjs/operations/usageAggregates.d.ts.map +1 -0
  63. package/dist/commonjs/operations/usageAggregates.js +162 -0
  64. package/dist/commonjs/operations/usageAggregates.js.map +1 -0
  65. package/dist/commonjs/operationsInterfaces/index.d.ts +3 -0
  66. package/dist/commonjs/operationsInterfaces/index.d.ts.map +1 -0
  67. package/dist/commonjs/operationsInterfaces/index.js +13 -0
  68. package/dist/commonjs/operationsInterfaces/index.js.map +1 -0
  69. package/dist/commonjs/operationsInterfaces/rateCard.d.ts +19 -0
  70. package/dist/commonjs/operationsInterfaces/rateCard.d.ts.map +1 -0
  71. package/dist/commonjs/operationsInterfaces/rateCard.js +10 -0
  72. package/dist/commonjs/operationsInterfaces/rateCard.js.map +1 -0
  73. package/dist/commonjs/operationsInterfaces/usageAggregates.d.ts +13 -0
  74. package/dist/commonjs/operationsInterfaces/usageAggregates.d.ts.map +1 -0
  75. package/dist/commonjs/operationsInterfaces/usageAggregates.js +10 -0
  76. package/dist/commonjs/operationsInterfaces/usageAggregates.js.map +1 -0
  77. package/dist/commonjs/package.json +3 -0
  78. package/dist/commonjs/pagingHelper.d.ts +13 -0
  79. package/dist/commonjs/pagingHelper.d.ts.map +1 -0
  80. package/dist/commonjs/pagingHelper.js +36 -0
  81. package/dist/commonjs/pagingHelper.js.map +1 -0
  82. package/dist/commonjs/usageManagementClient.d.ts +22 -0
  83. package/dist/commonjs/usageManagementClient.d.ts.map +1 -0
  84. package/dist/commonjs/usageManagementClient.js +104 -0
  85. package/dist/commonjs/usageManagementClient.js.map +1 -0
  86. package/dist/esm/index.d.ts +5 -0
  87. package/dist/esm/index.d.ts.map +1 -0
  88. package/{src/index.ts → dist/esm/index.js} +5 -5
  89. package/dist/esm/index.js.map +1 -0
  90. package/dist/esm/models/index.d.ts +178 -0
  91. package/dist/esm/models/index.d.ts.map +1 -0
  92. package/{src/operations/index.ts → dist/esm/models/index.js} +2 -3
  93. package/dist/esm/models/index.js.map +1 -0
  94. package/dist/esm/models/mappers.d.ts +19 -0
  95. package/dist/esm/models/mappers.d.ts.map +1 -0
  96. package/dist/esm/models/mappers.js +433 -0
  97. package/dist/esm/models/mappers.js.map +1 -0
  98. package/dist/esm/models/parameters.d.ts +13 -0
  99. package/dist/esm/models/parameters.d.ts.map +1 -0
  100. package/dist/esm/models/parameters.js +121 -0
  101. package/dist/esm/models/parameters.js.map +1 -0
  102. package/dist/esm/operations/index.d.ts +3 -0
  103. package/dist/esm/operations/index.d.ts.map +1 -0
  104. package/dist/esm/operations/index.js +10 -0
  105. package/dist/esm/operations/index.js.map +1 -0
  106. package/dist/esm/operations/rateCard.d.ts +27 -0
  107. package/dist/esm/operations/rateCard.d.ts.map +1 -0
  108. package/dist/esm/operations/rateCard.js +55 -0
  109. package/dist/esm/operations/rateCard.js.map +1 -0
  110. package/dist/esm/operations/usageAggregates.d.ts +38 -0
  111. package/dist/esm/operations/usageAggregates.d.ts.map +1 -0
  112. package/dist/esm/operations/usageAggregates.js +158 -0
  113. package/dist/esm/operations/usageAggregates.js.map +1 -0
  114. package/dist/esm/operationsInterfaces/index.d.ts +3 -0
  115. package/dist/esm/operationsInterfaces/index.d.ts.map +1 -0
  116. package/dist/esm/operationsInterfaces/index.js +10 -0
  117. package/dist/esm/operationsInterfaces/index.js.map +1 -0
  118. package/dist/esm/operationsInterfaces/rateCard.d.ts +19 -0
  119. package/dist/esm/operationsInterfaces/rateCard.d.ts.map +1 -0
  120. package/dist/esm/operationsInterfaces/rateCard.js +9 -0
  121. package/dist/esm/operationsInterfaces/rateCard.js.map +1 -0
  122. package/dist/esm/operationsInterfaces/usageAggregates.d.ts +13 -0
  123. package/dist/esm/operationsInterfaces/usageAggregates.d.ts.map +1 -0
  124. package/dist/esm/operationsInterfaces/usageAggregates.js +9 -0
  125. package/dist/esm/operationsInterfaces/usageAggregates.js.map +1 -0
  126. package/dist/esm/package.json +3 -0
  127. package/dist/esm/pagingHelper.d.ts +13 -0
  128. package/dist/esm/pagingHelper.d.ts.map +1 -0
  129. package/dist/esm/pagingHelper.js +32 -0
  130. package/dist/esm/pagingHelper.js.map +1 -0
  131. package/dist/esm/usageManagementClient.d.ts +22 -0
  132. package/dist/esm/usageManagementClient.d.ts.map +1 -0
  133. package/dist/esm/usageManagementClient.js +99 -0
  134. package/dist/esm/usageManagementClient.js.map +1 -0
  135. package/dist/react-native/index.d.ts +5 -0
  136. package/dist/react-native/index.d.ts.map +1 -0
  137. package/dist/react-native/index.js +13 -0
  138. package/dist/react-native/index.js.map +1 -0
  139. package/dist/react-native/models/index.d.ts +178 -0
  140. package/dist/react-native/models/index.d.ts.map +1 -0
  141. package/dist/react-native/models/index.js +9 -0
  142. package/dist/react-native/models/index.js.map +1 -0
  143. package/dist/react-native/models/mappers.d.ts +19 -0
  144. package/dist/react-native/models/mappers.d.ts.map +1 -0
  145. package/dist/react-native/models/mappers.js +433 -0
  146. package/dist/react-native/models/mappers.js.map +1 -0
  147. package/dist/react-native/models/parameters.d.ts +13 -0
  148. package/dist/react-native/models/parameters.d.ts.map +1 -0
  149. package/dist/react-native/models/parameters.js +121 -0
  150. package/dist/react-native/models/parameters.js.map +1 -0
  151. package/dist/react-native/operations/index.d.ts +3 -0
  152. package/dist/react-native/operations/index.d.ts.map +1 -0
  153. package/dist/react-native/operations/index.js +10 -0
  154. package/dist/react-native/operations/index.js.map +1 -0
  155. package/dist/react-native/operations/rateCard.d.ts +27 -0
  156. package/dist/react-native/operations/rateCard.d.ts.map +1 -0
  157. package/dist/react-native/operations/rateCard.js +55 -0
  158. package/dist/react-native/operations/rateCard.js.map +1 -0
  159. package/dist/react-native/operations/usageAggregates.d.ts +38 -0
  160. package/dist/react-native/operations/usageAggregates.d.ts.map +1 -0
  161. package/dist/react-native/operations/usageAggregates.js +158 -0
  162. package/dist/react-native/operations/usageAggregates.js.map +1 -0
  163. package/dist/react-native/operationsInterfaces/index.d.ts +3 -0
  164. package/dist/react-native/operationsInterfaces/index.d.ts.map +1 -0
  165. package/dist/react-native/operationsInterfaces/index.js +10 -0
  166. package/dist/react-native/operationsInterfaces/index.js.map +1 -0
  167. package/dist/react-native/operationsInterfaces/rateCard.d.ts +19 -0
  168. package/dist/react-native/operationsInterfaces/rateCard.d.ts.map +1 -0
  169. package/dist/react-native/operationsInterfaces/rateCard.js +9 -0
  170. package/dist/react-native/operationsInterfaces/rateCard.js.map +1 -0
  171. package/dist/react-native/operationsInterfaces/usageAggregates.d.ts +13 -0
  172. package/dist/react-native/operationsInterfaces/usageAggregates.d.ts.map +1 -0
  173. package/dist/react-native/operationsInterfaces/usageAggregates.js +9 -0
  174. package/dist/react-native/operationsInterfaces/usageAggregates.js.map +1 -0
  175. package/dist/react-native/package.json +3 -0
  176. package/dist/react-native/pagingHelper.d.ts +13 -0
  177. package/dist/react-native/pagingHelper.d.ts.map +1 -0
  178. package/dist/react-native/pagingHelper.js +32 -0
  179. package/dist/react-native/pagingHelper.js.map +1 -0
  180. package/dist/react-native/usageManagementClient.d.ts +22 -0
  181. package/dist/react-native/usageManagementClient.d.ts.map +1 -0
  182. package/dist/react-native/usageManagementClient.js +99 -0
  183. package/dist/react-native/usageManagementClient.js.map +1 -0
  184. package/package.json +59 -29
  185. package/dist/index.js +0 -936
  186. package/dist/index.js.map +0 -1
  187. package/dist/index.min.js +0 -1
  188. package/dist/index.min.js.map +0 -1
  189. package/dist-esm/samples-dev/getRateCard.d.ts +0 -2
  190. package/dist-esm/samples-dev/getRateCard.d.ts.map +0 -1
  191. package/dist-esm/samples-dev/getRateCard.js +0 -30
  192. package/dist-esm/samples-dev/getRateCard.js.map +0 -1
  193. package/dist-esm/samples-dev/rateCardGetSample.d.ts +0 -2
  194. package/dist-esm/samples-dev/rateCardGetSample.d.ts.map +0 -1
  195. package/dist-esm/samples-dev/rateCardGetSample.js +0 -30
  196. package/dist-esm/samples-dev/rateCardGetSample.js.map +0 -1
  197. package/dist-esm/src/index.d.ts +0 -5
  198. package/dist-esm/src/index.js.map +0 -1
  199. package/dist-esm/src/models/index.js.map +0 -1
  200. package/dist-esm/src/models/mappers.js.map +0 -1
  201. package/dist-esm/src/models/parameters.js.map +0 -1
  202. package/dist-esm/src/operations/index.d.ts +0 -3
  203. package/dist-esm/src/operations/index.js.map +0 -1
  204. package/dist-esm/src/operations/rateCard.d.ts.map +0 -1
  205. package/dist-esm/src/operations/rateCard.js.map +0 -1
  206. package/dist-esm/src/operations/usageAggregates.d.ts.map +0 -1
  207. package/dist-esm/src/operations/usageAggregates.js.map +0 -1
  208. package/dist-esm/src/operationsInterfaces/index.d.ts +0 -3
  209. package/dist-esm/src/operationsInterfaces/index.js.map +0 -1
  210. package/dist-esm/src/operationsInterfaces/rateCard.d.ts.map +0 -1
  211. package/dist-esm/src/operationsInterfaces/rateCard.js.map +0 -1
  212. package/dist-esm/src/operationsInterfaces/usageAggregates.d.ts.map +0 -1
  213. package/dist-esm/src/operationsInterfaces/usageAggregates.js.map +0 -1
  214. package/dist-esm/src/pagingHelper.js.map +0 -1
  215. package/dist-esm/src/usageManagementClient.d.ts.map +0 -1
  216. package/dist-esm/src/usageManagementClient.js.map +0 -1
  217. package/dist-esm/test/commerce_examples.d.ts +0 -4
  218. package/dist-esm/test/commerce_examples.d.ts.map +0 -1
  219. package/dist-esm/test/commerce_examples.js +0 -60
  220. package/dist-esm/test/commerce_examples.js.map +0 -1
  221. package/src/models/index.ts +0 -211
  222. package/src/models/mappers.ts +0 -460
  223. package/src/models/parameters.ts +0 -137
  224. package/src/operations/rateCard.ts +0 -69
  225. package/src/operations/usageAggregates.ts +0 -206
  226. package/src/operationsInterfaces/index.ts +0 -10
  227. package/src/operationsInterfaces/rateCard.ts +0 -30
  228. package/src/operationsInterfaces/usageAggregates.ts +0 -26
  229. package/src/pagingHelper.ts +0 -39
  230. package/src/usageManagementClient.ts +0 -143
  231. package/tsconfig.json +0 -33
  232. /package/{dist-esm/src → dist/browser}/models/index.d.ts +0 -0
  233. /package/{dist-esm/src → dist/browser}/models/index.d.ts.map +0 -0
  234. /package/{dist-esm/src → dist/browser}/models/index.js +0 -0
  235. /package/{dist-esm/src → dist/browser}/models/mappers.d.ts +0 -0
  236. /package/{dist-esm/src → dist/browser}/models/mappers.d.ts.map +0 -0
  237. /package/{dist-esm/src → dist/browser}/models/mappers.js +0 -0
  238. /package/{dist-esm/src → dist/browser}/models/parameters.d.ts +0 -0
  239. /package/{dist-esm/src → dist/browser}/models/parameters.d.ts.map +0 -0
  240. /package/{dist-esm/src → dist/browser}/models/parameters.js +0 -0
  241. /package/{dist-esm/src → dist/browser}/operationsInterfaces/rateCard.js +0 -0
  242. /package/{dist-esm/src → dist/browser}/operationsInterfaces/usageAggregates.js +0 -0
  243. /package/{dist-esm/src → dist/browser}/pagingHelper.d.ts +0 -0
  244. /package/{dist-esm/src → dist/browser}/pagingHelper.d.ts.map +0 -0
  245. /package/{dist-esm/src → dist/browser}/pagingHelper.js +0 -0
  246. /package/{types → dist/commonjs}/tsdoc-metadata.json +0 -0
@@ -1,206 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
-
9
- import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
- import { setContinuationToken } from "../pagingHelper";
11
- import { UsageAggregates } from "../operationsInterfaces";
12
- import * as coreClient from "@azure/core-client";
13
- import * as Mappers from "../models/mappers";
14
- import * as Parameters from "../models/parameters";
15
- import { UsageManagementClient } from "../usageManagementClient";
16
- import {
17
- UsageAggregation,
18
- UsageAggregatesListNextOptionalParams,
19
- UsageAggregatesListOptionalParams,
20
- UsageAggregatesListResponse,
21
- UsageAggregatesListNextResponse
22
- } from "../models";
23
-
24
- /// <reference lib="esnext.asynciterable" />
25
- /** Class containing UsageAggregates operations. */
26
- export class UsageAggregatesImpl implements UsageAggregates {
27
- private readonly client: UsageManagementClient;
28
-
29
- /**
30
- * Initialize a new instance of the class UsageAggregates class.
31
- * @param client Reference to the service client
32
- */
33
- constructor(client: UsageManagementClient) {
34
- this.client = client;
35
- }
36
-
37
- /**
38
- * Query aggregated Azure subscription consumption data for a date range.
39
- * @param reportedStartTime The start of the time range to retrieve data for.
40
- * @param reportedEndTime The end of the time range to retrieve data for.
41
- * @param options The options parameters.
42
- */
43
- public list(
44
- reportedStartTime: Date,
45
- reportedEndTime: Date,
46
- options?: UsageAggregatesListOptionalParams
47
- ): PagedAsyncIterableIterator<UsageAggregation> {
48
- const iter = this.listPagingAll(
49
- reportedStartTime,
50
- reportedEndTime,
51
- options
52
- );
53
- return {
54
- next() {
55
- return iter.next();
56
- },
57
- [Symbol.asyncIterator]() {
58
- return this;
59
- },
60
- byPage: (settings?: PageSettings) => {
61
- if (settings?.maxPageSize) {
62
- throw new Error("maxPageSize is not supported by this operation.");
63
- }
64
- return this.listPagingPage(
65
- reportedStartTime,
66
- reportedEndTime,
67
- options,
68
- settings
69
- );
70
- }
71
- };
72
- }
73
-
74
- private async *listPagingPage(
75
- reportedStartTime: Date,
76
- reportedEndTime: Date,
77
- options?: UsageAggregatesListOptionalParams,
78
- settings?: PageSettings
79
- ): AsyncIterableIterator<UsageAggregation[]> {
80
- let result: UsageAggregatesListResponse;
81
- let continuationToken = settings?.continuationToken;
82
- if (!continuationToken) {
83
- result = await this._list(reportedStartTime, reportedEndTime, options);
84
- let page = result.value || [];
85
- continuationToken = result.nextLink;
86
- setContinuationToken(page, continuationToken);
87
- yield page;
88
- }
89
- while (continuationToken) {
90
- result = await this._listNext(
91
- reportedStartTime,
92
- reportedEndTime,
93
- continuationToken,
94
- options
95
- );
96
- continuationToken = result.nextLink;
97
- let page = result.value || [];
98
- setContinuationToken(page, continuationToken);
99
- yield page;
100
- }
101
- }
102
-
103
- private async *listPagingAll(
104
- reportedStartTime: Date,
105
- reportedEndTime: Date,
106
- options?: UsageAggregatesListOptionalParams
107
- ): AsyncIterableIterator<UsageAggregation> {
108
- for await (const page of this.listPagingPage(
109
- reportedStartTime,
110
- reportedEndTime,
111
- options
112
- )) {
113
- yield* page;
114
- }
115
- }
116
-
117
- /**
118
- * Query aggregated Azure subscription consumption data for a date range.
119
- * @param reportedStartTime The start of the time range to retrieve data for.
120
- * @param reportedEndTime The end of the time range to retrieve data for.
121
- * @param options The options parameters.
122
- */
123
- private _list(
124
- reportedStartTime: Date,
125
- reportedEndTime: Date,
126
- options?: UsageAggregatesListOptionalParams
127
- ): Promise<UsageAggregatesListResponse> {
128
- return this.client.sendOperationRequest(
129
- { reportedStartTime, reportedEndTime, options },
130
- listOperationSpec
131
- );
132
- }
133
-
134
- /**
135
- * ListNext
136
- * @param reportedStartTime The start of the time range to retrieve data for.
137
- * @param reportedEndTime The end of the time range to retrieve data for.
138
- * @param nextLink The nextLink from the previous successful call to the List method.
139
- * @param options The options parameters.
140
- */
141
- private _listNext(
142
- reportedStartTime: Date,
143
- reportedEndTime: Date,
144
- nextLink: string,
145
- options?: UsageAggregatesListNextOptionalParams
146
- ): Promise<UsageAggregatesListNextResponse> {
147
- return this.client.sendOperationRequest(
148
- { reportedStartTime, reportedEndTime, nextLink, options },
149
- listNextOperationSpec
150
- );
151
- }
152
- }
153
- // Operation Specifications
154
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
155
-
156
- const listOperationSpec: coreClient.OperationSpec = {
157
- path:
158
- "/subscriptions/{subscriptionId}/providers/Microsoft.Commerce/UsageAggregates",
159
- httpMethod: "GET",
160
- responses: {
161
- 200: {
162
- bodyMapper: Mappers.UsageAggregationListResult
163
- },
164
- default: {
165
- bodyMapper: Mappers.ErrorResponse
166
- }
167
- },
168
- queryParameters: [
169
- Parameters.reportedStartTime,
170
- Parameters.reportedEndTime,
171
- Parameters.showDetails,
172
- Parameters.aggregationGranularity,
173
- Parameters.continuationToken,
174
- Parameters.apiVersion
175
- ],
176
- urlParameters: [Parameters.$host, Parameters.subscriptionId],
177
- headerParameters: [Parameters.accept],
178
- serializer
179
- };
180
- const listNextOperationSpec: coreClient.OperationSpec = {
181
- path: "{nextLink}",
182
- httpMethod: "GET",
183
- responses: {
184
- 200: {
185
- bodyMapper: Mappers.UsageAggregationListResult
186
- },
187
- default: {
188
- bodyMapper: Mappers.ErrorResponse
189
- }
190
- },
191
- queryParameters: [
192
- Parameters.reportedStartTime,
193
- Parameters.reportedEndTime,
194
- Parameters.showDetails,
195
- Parameters.aggregationGranularity,
196
- Parameters.continuationToken,
197
- Parameters.apiVersion
198
- ],
199
- urlParameters: [
200
- Parameters.$host,
201
- Parameters.subscriptionId,
202
- Parameters.nextLink
203
- ],
204
- headerParameters: [Parameters.accept],
205
- serializer
206
- };
@@ -1,10 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
-
9
- export * from "./usageAggregates";
10
- export * from "./rateCard";
@@ -1,30 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
-
9
- import { RateCardGetOptionalParams, RateCardGetResponse } from "../models";
10
-
11
- /** Interface representing a RateCard. */
12
- export interface RateCard {
13
- /**
14
- * Enables you to query for the resource/meter metadata and related prices used in a given subscription
15
- * by Offer ID, Currency, Locale and Region. The metadata associated with the billing meters, including
16
- * but not limited to service names, types, resources, units of measure, and regions, is subject to
17
- * change at any time and without notice. If you intend to use this billing data in an automated
18
- * fashion, please use the billing meter GUID to uniquely identify each billable item. If the billing
19
- * meter GUID is scheduled to change due to a new billing model, you will be notified in advance of the
20
- * change.
21
- * @param filter The filter to apply on the operation. It ONLY supports the 'eq' and 'and' logical
22
- * operators at this time. All the 4 query parameters 'OfferDurableId', 'Currency', 'Locale', 'Region'
23
- * are required to be a part of the $filter.
24
- * @param options The options parameters.
25
- */
26
- get(
27
- filter: string,
28
- options?: RateCardGetOptionalParams
29
- ): Promise<RateCardGetResponse>;
30
- }
@@ -1,26 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
-
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
- import { UsageAggregation, UsageAggregatesListOptionalParams } from "../models";
11
-
12
- /// <reference lib="esnext.asynciterable" />
13
- /** Interface representing a UsageAggregates. */
14
- export interface UsageAggregates {
15
- /**
16
- * Query aggregated Azure subscription consumption data for a date range.
17
- * @param reportedStartTime The start of the time range to retrieve data for.
18
- * @param reportedEndTime The end of the time range to retrieve data for.
19
- * @param options The options parameters.
20
- */
21
- list(
22
- reportedStartTime: Date,
23
- reportedEndTime: Date,
24
- options?: UsageAggregatesListOptionalParams
25
- ): PagedAsyncIterableIterator<UsageAggregation>;
26
- }
@@ -1,39 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
-
9
- export interface PageInfo {
10
- continuationToken?: string;
11
- }
12
-
13
- const pageMap = new WeakMap<object, PageInfo>();
14
-
15
- /**
16
- * Given a result page from a pageable operation, returns a
17
- * continuation token that can be used to begin paging from
18
- * that point later.
19
- * @param page A result object from calling .byPage() on a paged operation.
20
- * @returns The continuation token that can be passed into byPage().
21
- */
22
- export function getContinuationToken(page: unknown): string | undefined {
23
- if (typeof page !== "object" || page === null) {
24
- return undefined;
25
- }
26
- return pageMap.get(page)?.continuationToken;
27
- }
28
-
29
- export function setContinuationToken(
30
- page: unknown,
31
- continuationToken: string | undefined
32
- ): void {
33
- if (typeof page !== "object" || page === null || !continuationToken) {
34
- return;
35
- }
36
- const pageInfo = pageMap.get(page) ?? {};
37
- pageInfo.continuationToken = continuationToken;
38
- pageMap.set(page, pageInfo);
39
- }
@@ -1,143 +0,0 @@
1
- /*
2
- * Copyright (c) Microsoft Corporation.
3
- * Licensed under the MIT License.
4
- *
5
- * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
- */
8
-
9
- import * as coreClient from "@azure/core-client";
10
- import * as coreRestPipeline from "@azure/core-rest-pipeline";
11
- import {
12
- PipelineRequest,
13
- PipelineResponse,
14
- SendRequest
15
- } from "@azure/core-rest-pipeline";
16
- import * as coreAuth from "@azure/core-auth";
17
- import { UsageAggregatesImpl, RateCardImpl } from "./operations";
18
- import { UsageAggregates, RateCard } from "./operationsInterfaces";
19
- import { UsageManagementClientOptionalParams } from "./models";
20
-
21
- export class UsageManagementClient extends coreClient.ServiceClient {
22
- $host: string;
23
- apiVersion: string;
24
- subscriptionId: string;
25
-
26
- /**
27
- * Initializes a new instance of the UsageManagementClient class.
28
- * @param credentials Subscription credentials which uniquely identify client subscription.
29
- * @param subscriptionId It uniquely identifies Microsoft Azure subscription. The subscription ID forms
30
- * part of the URI for every service call.
31
- * @param options The parameter options
32
- */
33
- constructor(
34
- credentials: coreAuth.TokenCredential,
35
- subscriptionId: string,
36
- options?: UsageManagementClientOptionalParams
37
- ) {
38
- if (credentials === undefined) {
39
- throw new Error("'credentials' cannot be null");
40
- }
41
- if (subscriptionId === undefined) {
42
- throw new Error("'subscriptionId' cannot be null");
43
- }
44
-
45
- // Initializing default values for options
46
- if (!options) {
47
- options = {};
48
- }
49
- const defaults: UsageManagementClientOptionalParams = {
50
- requestContentType: "application/json; charset=utf-8",
51
- credential: credentials
52
- };
53
-
54
- const packageDetails = `azsdk-js-arm-commerce/4.0.0-beta.4`;
55
- const userAgentPrefix =
56
- options.userAgentOptions && options.userAgentOptions.userAgentPrefix
57
- ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
58
- : `${packageDetails}`;
59
-
60
- const optionsWithDefaults = {
61
- ...defaults,
62
- ...options,
63
- userAgentOptions: {
64
- userAgentPrefix
65
- },
66
- endpoint:
67
- options.endpoint ?? options.baseUri ?? "https://management.azure.com"
68
- };
69
- super(optionsWithDefaults);
70
-
71
- let bearerTokenAuthenticationPolicyFound: boolean = false;
72
- if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
73
- const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();
74
- bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
75
- (pipelinePolicy) =>
76
- pipelinePolicy.name ===
77
- coreRestPipeline.bearerTokenAuthenticationPolicyName
78
- );
79
- }
80
- if (
81
- !options ||
82
- !options.pipeline ||
83
- options.pipeline.getOrderedPolicies().length == 0 ||
84
- !bearerTokenAuthenticationPolicyFound
85
- ) {
86
- this.pipeline.removePolicy({
87
- name: coreRestPipeline.bearerTokenAuthenticationPolicyName
88
- });
89
- this.pipeline.addPolicy(
90
- coreRestPipeline.bearerTokenAuthenticationPolicy({
91
- credential: credentials,
92
- scopes:
93
- optionsWithDefaults.credentialScopes ??
94
- `${optionsWithDefaults.endpoint}/.default`,
95
- challengeCallbacks: {
96
- authorizeRequestOnChallenge:
97
- coreClient.authorizeRequestOnClaimChallenge
98
- }
99
- })
100
- );
101
- }
102
- // Parameter assignments
103
- this.subscriptionId = subscriptionId;
104
-
105
- // Assigning values to Constant parameters
106
- this.$host = options.$host || "https://management.azure.com";
107
- this.apiVersion = options.apiVersion || "2015-06-01-preview";
108
- this.usageAggregates = new UsageAggregatesImpl(this);
109
- this.rateCard = new RateCardImpl(this);
110
- this.addCustomApiVersionPolicy(options.apiVersion);
111
- }
112
-
113
- /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
114
- private addCustomApiVersionPolicy(apiVersion?: string) {
115
- if (!apiVersion) {
116
- return;
117
- }
118
- const apiVersionPolicy = {
119
- name: "CustomApiVersionPolicy",
120
- async sendRequest(
121
- request: PipelineRequest,
122
- next: SendRequest
123
- ): Promise<PipelineResponse> {
124
- const param = request.url.split("?");
125
- if (param.length > 1) {
126
- const newParams = param[1].split("&").map((item) => {
127
- if (item.indexOf("api-version") > -1) {
128
- return "api-version=" + apiVersion;
129
- } else {
130
- return item;
131
- }
132
- });
133
- request.url = param[0] + "?" + newParams.join("&");
134
- }
135
- return next(request);
136
- }
137
- };
138
- this.pipeline.addPolicy(apiVersionPolicy);
139
- }
140
-
141
- usageAggregates: UsageAggregates;
142
- rateCard: RateCard;
143
- }
package/tsconfig.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "module": "es6",
4
- "moduleResolution": "node",
5
- "strict": true,
6
- "target": "es6",
7
- "sourceMap": true,
8
- "declarationMap": true,
9
- "esModuleInterop": true,
10
- "allowSyntheticDefaultImports": true,
11
- "forceConsistentCasingInFileNames": true,
12
- "lib": [
13
- "es6",
14
- "dom"
15
- ],
16
- "declaration": true,
17
- "outDir": "./dist-esm",
18
- "importHelpers": true,
19
- "paths": {
20
- "@azure/arm-commerce": [
21
- "./src/index"
22
- ]
23
- }
24
- },
25
- "include": [
26
- "./src/**/*.ts",
27
- "./test/**/*.ts",
28
- "samples-dev/**/*.ts"
29
- ],
30
- "exclude": [
31
- "node_modules"
32
- ]
33
- }
File without changes
File without changes
File without changes