@azure/arm-commitmentplans 1.3.1 → 2.0.0-beta.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 (164) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/LICENSE +21 -0
  3. package/README.md +69 -80
  4. package/dist/index.js +1794 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/azureMLCommitmentPlansManagementClient.d.ts +22 -0
  9. package/dist-esm/src/azureMLCommitmentPlansManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/azureMLCommitmentPlansManagementClient.js +55 -0
  11. package/dist-esm/src/azureMLCommitmentPlansManagementClient.js.map +1 -0
  12. package/dist-esm/src/index.d.ts +5 -0
  13. package/dist-esm/src/index.d.ts.map +1 -0
  14. package/dist-esm/src/index.js +12 -0
  15. package/dist-esm/src/index.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +522 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +27 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +24 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/{esm → dist-esm/src}/models/mappers.js +352 -337
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +15 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +125 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/commitmentAssociations.d.ts +55 -0
  29. package/dist-esm/src/operations/commitmentAssociations.d.ts.map +1 -0
  30. package/dist-esm/src/operations/commitmentAssociations.js +203 -0
  31. package/dist-esm/src/operations/commitmentAssociations.js.map +1 -0
  32. package/dist-esm/src/operations/commitmentPlans.d.ts +84 -0
  33. package/dist-esm/src/operations/commitmentPlans.d.ts.map +1 -0
  34. package/dist-esm/src/operations/commitmentPlans.js +332 -0
  35. package/dist-esm/src/operations/commitmentPlans.js.map +1 -0
  36. package/{esm → dist-esm/src}/operations/index.d.ts +1 -0
  37. package/dist-esm/src/operations/index.d.ts.map +1 -0
  38. package/{esm → dist-esm/src}/operations/index.js +4 -5
  39. package/dist-esm/src/operations/index.js.map +1 -0
  40. package/dist-esm/src/operations/operations.d.ts +26 -0
  41. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  42. package/dist-esm/src/operations/operations.js +87 -0
  43. package/dist-esm/src/operations/operations.js.map +1 -0
  44. package/dist-esm/src/operations/skus.d.ts +26 -0
  45. package/dist-esm/src/operations/skus.d.ts.map +1 -0
  46. package/dist-esm/src/operations/skus.js +87 -0
  47. package/dist-esm/src/operations/skus.js.map +1 -0
  48. package/dist-esm/src/operations/usageHistory.d.ts +38 -0
  49. package/dist-esm/src/operations/usageHistory.d.ts.map +1 -0
  50. package/dist-esm/src/operations/usageHistory.js +131 -0
  51. package/dist-esm/src/operations/usageHistory.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/commitmentAssociations.d.ts +30 -0
  53. package/dist-esm/src/operationsInterfaces/commitmentAssociations.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/commitmentAssociations.js +9 -0
  55. package/dist-esm/src/operationsInterfaces/commitmentAssociations.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts +48 -0
  57. package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/commitmentPlans.js +9 -0
  59. package/dist-esm/src/operationsInterfaces/commitmentPlans.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
  61. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/index.js +13 -0
  63. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  65. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/skus.d.ts +11 -0
  69. package/dist-esm/src/operationsInterfaces/skus.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/skus.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/skus.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/usageHistory.d.ts +13 -0
  73. package/dist-esm/src/operationsInterfaces/usageHistory.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/usageHistory.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/usageHistory.js.map +1 -0
  76. package/dist-esm/test/sampleTest.d.ts +2 -0
  77. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  78. package/dist-esm/test/sampleTest.js +40 -0
  79. package/dist-esm/test/sampleTest.js.map +1 -0
  80. package/package.json +74 -33
  81. package/review/arm-commitmentplans.api.md +405 -0
  82. package/rollup.config.js +184 -27
  83. package/src/azureMLCommitmentPlansManagementClient.ts +82 -41
  84. package/src/index.ts +12 -0
  85. package/src/models/index.ts +388 -745
  86. package/src/models/mappers.ts +354 -336
  87. package/src/models/parameters.ts +87 -35
  88. package/src/operations/commitmentAssociations.ts +183 -174
  89. package/src/operations/commitmentPlans.ts +277 -340
  90. package/src/operations/index.ts +4 -5
  91. package/src/operations/operations.ts +95 -0
  92. package/src/operations/skus.ts +65 -48
  93. package/src/operations/usageHistory.ts +135 -89
  94. package/src/operationsInterfaces/commitmentAssociations.ts +62 -0
  95. package/src/operationsInterfaces/commitmentPlans.ts +92 -0
  96. package/src/operationsInterfaces/index.ts +13 -0
  97. package/src/operationsInterfaces/operations.ts +22 -0
  98. package/src/operationsInterfaces/skus.ts +22 -0
  99. package/src/operationsInterfaces/usageHistory.ts +26 -0
  100. package/tsconfig.json +6 -5
  101. package/types/arm-commitmentplans.d.ts +706 -0
  102. package/types/tsdoc-metadata.json +11 -0
  103. package/dist/arm-commitmentplans.js +0 -1659
  104. package/dist/arm-commitmentplans.js.map +0 -1
  105. package/dist/arm-commitmentplans.min.js +0 -1
  106. package/dist/arm-commitmentplans.min.js.map +0 -1
  107. package/esm/azureMLCommitmentPlansManagementClient.d.ts +0 -27
  108. package/esm/azureMLCommitmentPlansManagementClient.d.ts.map +0 -1
  109. package/esm/azureMLCommitmentPlansManagementClient.js +0 -41
  110. package/esm/azureMLCommitmentPlansManagementClient.js.map +0 -1
  111. package/esm/azureMLCommitmentPlansManagementClientContext.d.ts +0 -22
  112. package/esm/azureMLCommitmentPlansManagementClientContext.d.ts.map +0 -1
  113. package/esm/azureMLCommitmentPlansManagementClientContext.js +0 -61
  114. package/esm/azureMLCommitmentPlansManagementClientContext.js.map +0 -1
  115. package/esm/models/commitmentAssociationsMappers.d.ts +0 -2
  116. package/esm/models/commitmentAssociationsMappers.d.ts.map +0 -1
  117. package/esm/models/commitmentAssociationsMappers.js +0 -11
  118. package/esm/models/commitmentAssociationsMappers.js.map +0 -1
  119. package/esm/models/commitmentPlansMappers.d.ts +0 -2
  120. package/esm/models/commitmentPlansMappers.d.ts.map +0 -1
  121. package/esm/models/commitmentPlansMappers.js +0 -11
  122. package/esm/models/commitmentPlansMappers.js.map +0 -1
  123. package/esm/models/index.d.ts +0 -901
  124. package/esm/models/index.d.ts.map +0 -1
  125. package/esm/models/index.js +0 -10
  126. package/esm/models/index.js.map +0 -1
  127. package/esm/models/mappers.d.ts +0 -23
  128. package/esm/models/mappers.d.ts.map +0 -1
  129. package/esm/models/mappers.js.map +0 -1
  130. package/esm/models/parameters.d.ts +0 -10
  131. package/esm/models/parameters.d.ts.map +0 -1
  132. package/esm/models/parameters.js +0 -93
  133. package/esm/models/parameters.js.map +0 -1
  134. package/esm/models/skusMappers.d.ts +0 -2
  135. package/esm/models/skusMappers.d.ts.map +0 -1
  136. package/esm/models/skusMappers.js +0 -11
  137. package/esm/models/skusMappers.js.map +0 -1
  138. package/esm/models/usageHistoryMappers.d.ts +0 -2
  139. package/esm/models/usageHistoryMappers.d.ts.map +0 -1
  140. package/esm/models/usageHistoryMappers.js +0 -11
  141. package/esm/models/usageHistoryMappers.js.map +0 -1
  142. package/esm/operations/commitmentAssociations.d.ts +0 -103
  143. package/esm/operations/commitmentAssociations.d.ts.map +0 -1
  144. package/esm/operations/commitmentAssociations.js +0 -157
  145. package/esm/operations/commitmentAssociations.js.map +0 -1
  146. package/esm/operations/commitmentPlans.d.ts +0 -175
  147. package/esm/operations/commitmentPlans.d.ts.map +0 -1
  148. package/esm/operations/commitmentPlans.js +0 -273
  149. package/esm/operations/commitmentPlans.js.map +0 -1
  150. package/esm/operations/index.d.ts.map +0 -1
  151. package/esm/operations/index.js.map +0 -1
  152. package/esm/operations/skus.d.ts +0 -28
  153. package/esm/operations/skus.d.ts.map +0 -1
  154. package/esm/operations/skus.js +0 -54
  155. package/esm/operations/skus.js.map +0 -1
  156. package/esm/operations/usageHistory.d.ts +0 -52
  157. package/esm/operations/usageHistory.d.ts.map +0 -1
  158. package/esm/operations/usageHistory.js +0 -85
  159. package/esm/operations/usageHistory.js.map +0 -1
  160. package/src/azureMLCommitmentPlansManagementClientContext.ts +0 -68
  161. package/src/models/commitmentAssociationsMappers.ts +0 -24
  162. package/src/models/commitmentPlansMappers.ts +0 -24
  163. package/src/models/skusMappers.ts +0 -20
  164. package/src/models/usageHistoryMappers.ts +0 -16
@@ -1,13 +1,12 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
9
+ export * from "./operations";
11
10
  export * from "./skus";
12
11
  export * from "./commitmentAssociations";
13
12
  export * from "./commitmentPlans";
@@ -0,0 +1,95 @@
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 { Operations } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
+ import * as Parameters from "../models/parameters";
14
+ import { AzureMLCommitmentPlansManagementClient } from "../azureMLCommitmentPlansManagementClient";
15
+ import {
16
+ OperationEntity,
17
+ OperationsListOptionalParams,
18
+ OperationsListResponse
19
+ } from "../models";
20
+
21
+ /// <reference lib="esnext.asynciterable" />
22
+ /** Class containing Operations operations. */
23
+ export class OperationsImpl implements Operations {
24
+ private readonly client: AzureMLCommitmentPlansManagementClient;
25
+
26
+ /**
27
+ * Initialize a new instance of the class Operations class.
28
+ * @param client Reference to the service client
29
+ */
30
+ constructor(client: AzureMLCommitmentPlansManagementClient) {
31
+ this.client = client;
32
+ }
33
+
34
+ /**
35
+ * Lists all of the available Azure Machine Learning Studio Commitment Plan RP REST API operations.
36
+ * @param options The options parameters.
37
+ */
38
+ public list(
39
+ options?: OperationsListOptionalParams
40
+ ): PagedAsyncIterableIterator<OperationEntity> {
41
+ const iter = this.listPagingAll(options);
42
+ return {
43
+ next() {
44
+ return iter.next();
45
+ },
46
+ [Symbol.asyncIterator]() {
47
+ return this;
48
+ },
49
+ byPage: () => {
50
+ return this.listPagingPage(options);
51
+ }
52
+ };
53
+ }
54
+
55
+ private async *listPagingPage(
56
+ options?: OperationsListOptionalParams
57
+ ): AsyncIterableIterator<OperationEntity[]> {
58
+ let result = await this._list(options);
59
+ yield result.value || [];
60
+ }
61
+
62
+ private async *listPagingAll(
63
+ options?: OperationsListOptionalParams
64
+ ): AsyncIterableIterator<OperationEntity> {
65
+ for await (const page of this.listPagingPage(options)) {
66
+ yield* page;
67
+ }
68
+ }
69
+
70
+ /**
71
+ * Lists all of the available Azure Machine Learning Studio Commitment Plan RP REST API operations.
72
+ * @param options The options parameters.
73
+ */
74
+ private _list(
75
+ options?: OperationsListOptionalParams
76
+ ): Promise<OperationsListResponse> {
77
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
78
+ }
79
+ }
80
+ // Operation Specifications
81
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
82
+
83
+ const listOperationSpec: coreClient.OperationSpec = {
84
+ path: "/providers/Microsoft.MachineLearning/operations",
85
+ httpMethod: "GET",
86
+ responses: {
87
+ 200: {
88
+ bodyMapper: Mappers.OperationEntityListResult
89
+ }
90
+ },
91
+ queryParameters: [Parameters.apiVersion],
92
+ urlParameters: [Parameters.$host],
93
+ headerParameters: [Parameters.accept],
94
+ serializer
95
+ };
@@ -1,77 +1,94 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/skusMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Skus } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { AzureMLCommitmentPlansManagementClientContext } from "../azureMLCommitmentPlansManagementClientContext";
14
+ import { AzureMLCommitmentPlansManagementClient } from "../azureMLCommitmentPlansManagementClient";
15
+ import {
16
+ CatalogSku,
17
+ SkusListOptionalParams,
18
+ SkusListResponse
19
+ } from "../models";
16
20
 
17
- /** Class representing a Skus. */
18
- export class Skus {
19
- private readonly client: AzureMLCommitmentPlansManagementClientContext;
21
+ /// <reference lib="esnext.asynciterable" />
22
+ /** Class containing Skus operations. */
23
+ export class SkusImpl implements Skus {
24
+ private readonly client: AzureMLCommitmentPlansManagementClient;
20
25
 
21
26
  /**
22
- * Create a Skus.
23
- * @param {AzureMLCommitmentPlansManagementClientContext} client Reference to the service client.
27
+ * Initialize a new instance of the class Skus class.
28
+ * @param client Reference to the service client
24
29
  */
25
- constructor(client: AzureMLCommitmentPlansManagementClientContext) {
30
+ constructor(client: AzureMLCommitmentPlansManagementClient) {
26
31
  this.client = client;
27
32
  }
28
33
 
29
34
  /**
30
35
  * Lists the available commitment plan SKUs.
31
- * @param [options] The optional parameters
32
- * @returns Promise<Models.SkusListResponse>
36
+ * @param options The options parameters.
33
37
  */
34
- list(options?: msRest.RequestOptionsBase): Promise<Models.SkusListResponse>;
35
- /**
36
- * @param callback The callback
37
- */
38
- list(callback: msRest.ServiceCallback<Models.SkuListResult>): void;
38
+ public list(
39
+ options?: SkusListOptionalParams
40
+ ): PagedAsyncIterableIterator<CatalogSku> {
41
+ const iter = this.listPagingAll(options);
42
+ return {
43
+ next() {
44
+ return iter.next();
45
+ },
46
+ [Symbol.asyncIterator]() {
47
+ return this;
48
+ },
49
+ byPage: () => {
50
+ return this.listPagingPage(options);
51
+ }
52
+ };
53
+ }
54
+
55
+ private async *listPagingPage(
56
+ options?: SkusListOptionalParams
57
+ ): AsyncIterableIterator<CatalogSku[]> {
58
+ let result = await this._list(options);
59
+ yield result.value || [];
60
+ }
61
+
62
+ private async *listPagingAll(
63
+ options?: SkusListOptionalParams
64
+ ): AsyncIterableIterator<CatalogSku> {
65
+ for await (const page of this.listPagingPage(options)) {
66
+ yield* page;
67
+ }
68
+ }
69
+
39
70
  /**
40
- * @param options The optional parameters
41
- * @param callback The callback
71
+ * Lists the available commitment plan SKUs.
72
+ * @param options The options parameters.
42
73
  */
43
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.SkuListResult>): void;
44
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.SkuListResult>, callback?: msRest.ServiceCallback<Models.SkuListResult>): Promise<Models.SkusListResponse> {
45
- return this.client.sendOperationRequest(
46
- {
47
- options
48
- },
49
- listOperationSpec,
50
- callback) as Promise<Models.SkusListResponse>;
74
+ private _list(options?: SkusListOptionalParams): Promise<SkusListResponse> {
75
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
51
76
  }
52
77
  }
53
-
54
78
  // Operation Specifications
55
- const serializer = new msRest.Serializer(Mappers);
56
- const listOperationSpec: msRest.OperationSpec = {
79
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
80
+
81
+ const listOperationSpec: coreClient.OperationSpec = {
82
+ path:
83
+ "/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/skus",
57
84
  httpMethod: "GET",
58
- path: "subscriptions/{subscriptionId}/providers/Microsoft.MachineLearning/skus",
59
- urlParameters: [
60
- Parameters.subscriptionId
61
- ],
62
- queryParameters: [
63
- Parameters.apiVersion
64
- ],
65
- headerParameters: [
66
- Parameters.acceptLanguage
67
- ],
68
85
  responses: {
69
86
  200: {
70
87
  bodyMapper: Mappers.SkuListResult
71
- },
72
- default: {
73
- bodyMapper: Mappers.CloudError
74
88
  }
75
89
  },
90
+ queryParameters: [Parameters.apiVersion],
91
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
92
+ headerParameters: [Parameters.accept],
76
93
  serializer
77
94
  };
@@ -1,28 +1,35 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/usageHistoryMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { UsageHistory } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { AzureMLCommitmentPlansManagementClientContext } from "../azureMLCommitmentPlansManagementClientContext";
14
+ import { AzureMLCommitmentPlansManagementClient } from "../azureMLCommitmentPlansManagementClient";
15
+ import {
16
+ PlanUsageHistory,
17
+ UsageHistoryListNextOptionalParams,
18
+ UsageHistoryListOptionalParams,
19
+ UsageHistoryListResponse,
20
+ UsageHistoryListNextResponse
21
+ } from "../models";
16
22
 
17
- /** Class representing a UsageHistory. */
18
- export class UsageHistory {
19
- private readonly client: AzureMLCommitmentPlansManagementClientContext;
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing UsageHistory operations. */
25
+ export class UsageHistoryImpl implements UsageHistory {
26
+ private readonly client: AzureMLCommitmentPlansManagementClient;
20
27
 
21
28
  /**
22
- * Create a UsageHistory.
23
- * @param {AzureMLCommitmentPlansManagementClientContext} client Reference to the service client.
29
+ * Initialize a new instance of the class UsageHistory class.
30
+ * @param client Reference to the service client
24
31
  */
25
- constructor(client: AzureMLCommitmentPlansManagementClientContext) {
32
+ constructor(client: AzureMLCommitmentPlansManagementClient) {
26
33
  this.client = client;
27
34
  }
28
35
 
@@ -30,108 +37,147 @@ export class UsageHistory {
30
37
  * Retrieve the usage history for an Azure ML commitment plan.
31
38
  * @param resourceGroupName The resource group name.
32
39
  * @param commitmentPlanName The Azure ML commitment plan name.
33
- * @param [options] The optional parameters
34
- * @returns Promise<Models.UsageHistoryListResponse>
40
+ * @param options The options parameters.
35
41
  */
36
- list(resourceGroupName: string, commitmentPlanName: string, options?: Models.UsageHistoryListOptionalParams): Promise<Models.UsageHistoryListResponse>;
37
- /**
38
- * @param resourceGroupName The resource group name.
39
- * @param commitmentPlanName The Azure ML commitment plan name.
40
- * @param callback The callback
41
- */
42
- list(resourceGroupName: string, commitmentPlanName: string, callback: msRest.ServiceCallback<Models.PlanUsageHistoryListResult>): void;
43
- /**
44
- * @param resourceGroupName The resource group name.
45
- * @param commitmentPlanName The Azure ML commitment plan name.
46
- * @param options The optional parameters
47
- * @param callback The callback
48
- */
49
- list(resourceGroupName: string, commitmentPlanName: string, options: Models.UsageHistoryListOptionalParams, callback: msRest.ServiceCallback<Models.PlanUsageHistoryListResult>): void;
50
- list(resourceGroupName: string, commitmentPlanName: string, options?: Models.UsageHistoryListOptionalParams | msRest.ServiceCallback<Models.PlanUsageHistoryListResult>, callback?: msRest.ServiceCallback<Models.PlanUsageHistoryListResult>): Promise<Models.UsageHistoryListResponse> {
51
- return this.client.sendOperationRequest(
52
- {
42
+ public list(
43
+ resourceGroupName: string,
44
+ commitmentPlanName: string,
45
+ options?: UsageHistoryListOptionalParams
46
+ ): PagedAsyncIterableIterator<PlanUsageHistory> {
47
+ const iter = this.listPagingAll(
48
+ resourceGroupName,
49
+ commitmentPlanName,
50
+ options
51
+ );
52
+ return {
53
+ next() {
54
+ return iter.next();
55
+ },
56
+ [Symbol.asyncIterator]() {
57
+ return this;
58
+ },
59
+ byPage: () => {
60
+ return this.listPagingPage(
61
+ resourceGroupName,
62
+ commitmentPlanName,
63
+ options
64
+ );
65
+ }
66
+ };
67
+ }
68
+
69
+ private async *listPagingPage(
70
+ resourceGroupName: string,
71
+ commitmentPlanName: string,
72
+ options?: UsageHistoryListOptionalParams
73
+ ): AsyncIterableIterator<PlanUsageHistory[]> {
74
+ let result = await this._list(
75
+ resourceGroupName,
76
+ commitmentPlanName,
77
+ options
78
+ );
79
+ yield result.value || [];
80
+ let continuationToken = result.nextLink;
81
+ while (continuationToken) {
82
+ result = await this._listNext(
53
83
  resourceGroupName,
54
84
  commitmentPlanName,
85
+ continuationToken,
55
86
  options
56
- },
57
- listOperationSpec,
58
- callback) as Promise<Models.UsageHistoryListResponse>;
87
+ );
88
+ continuationToken = result.nextLink;
89
+ yield result.value || [];
90
+ }
91
+ }
92
+
93
+ private async *listPagingAll(
94
+ resourceGroupName: string,
95
+ commitmentPlanName: string,
96
+ options?: UsageHistoryListOptionalParams
97
+ ): AsyncIterableIterator<PlanUsageHistory> {
98
+ for await (const page of this.listPagingPage(
99
+ resourceGroupName,
100
+ commitmentPlanName,
101
+ options
102
+ )) {
103
+ yield* page;
104
+ }
59
105
  }
60
106
 
61
107
  /**
62
108
  * Retrieve the usage history for an Azure ML commitment plan.
63
- * @param nextPageLink The NextLink from the previous successful call to List operation.
64
- * @param [options] The optional parameters
65
- * @returns Promise<Models.UsageHistoryListNextResponse>
66
- */
67
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.UsageHistoryListNextResponse>;
68
- /**
69
- * @param nextPageLink The NextLink from the previous successful call to List operation.
70
- * @param callback The callback
109
+ * @param resourceGroupName The resource group name.
110
+ * @param commitmentPlanName The Azure ML commitment plan name.
111
+ * @param options The options parameters.
71
112
  */
72
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.PlanUsageHistoryListResult>): void;
113
+ private _list(
114
+ resourceGroupName: string,
115
+ commitmentPlanName: string,
116
+ options?: UsageHistoryListOptionalParams
117
+ ): Promise<UsageHistoryListResponse> {
118
+ return this.client.sendOperationRequest(
119
+ { resourceGroupName, commitmentPlanName, options },
120
+ listOperationSpec
121
+ );
122
+ }
123
+
73
124
  /**
74
- * @param nextPageLink The NextLink from the previous successful call to List operation.
75
- * @param options The optional parameters
76
- * @param callback The callback
125
+ * ListNext
126
+ * @param resourceGroupName The resource group name.
127
+ * @param commitmentPlanName The Azure ML commitment plan name.
128
+ * @param nextLink The nextLink from the previous successful call to the List method.
129
+ * @param options The options parameters.
77
130
  */
78
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PlanUsageHistoryListResult>): void;
79
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PlanUsageHistoryListResult>, callback?: msRest.ServiceCallback<Models.PlanUsageHistoryListResult>): Promise<Models.UsageHistoryListNextResponse> {
131
+ private _listNext(
132
+ resourceGroupName: string,
133
+ commitmentPlanName: string,
134
+ nextLink: string,
135
+ options?: UsageHistoryListNextOptionalParams
136
+ ): Promise<UsageHistoryListNextResponse> {
80
137
  return this.client.sendOperationRequest(
81
- {
82
- nextPageLink,
83
- options
84
- },
85
- listNextOperationSpec,
86
- callback) as Promise<Models.UsageHistoryListNextResponse>;
138
+ { resourceGroupName, commitmentPlanName, nextLink, options },
139
+ listNextOperationSpec
140
+ );
87
141
  }
88
142
  }
89
-
90
143
  // Operation Specifications
91
- const serializer = new msRest.Serializer(Mappers);
92
- const listOperationSpec: msRest.OperationSpec = {
144
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
145
+
146
+ const listOperationSpec: coreClient.OperationSpec = {
147
+ path:
148
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/usageHistory",
93
149
  httpMethod: "GET",
94
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/usageHistory",
95
- urlParameters: [
96
- Parameters.subscriptionId,
97
- Parameters.resourceGroupName,
98
- Parameters.commitmentPlanName
99
- ],
100
- queryParameters: [
101
- Parameters.skipToken,
102
- Parameters.apiVersion
103
- ],
104
- headerParameters: [
105
- Parameters.acceptLanguage
106
- ],
107
150
  responses: {
108
151
  200: {
109
152
  bodyMapper: Mappers.PlanUsageHistoryListResult
110
- },
111
- default: {
112
- bodyMapper: Mappers.CloudError
113
153
  }
114
154
  },
155
+ queryParameters: [Parameters.apiVersion, Parameters.skipToken],
156
+ urlParameters: [
157
+ Parameters.$host,
158
+ Parameters.subscriptionId,
159
+ Parameters.resourceGroupName,
160
+ Parameters.commitmentPlanName
161
+ ],
162
+ headerParameters: [Parameters.accept],
115
163
  serializer
116
164
  };
117
-
118
- const listNextOperationSpec: msRest.OperationSpec = {
119
- httpMethod: "GET",
120
- baseUrl: "https://management.azure.com",
165
+ const listNextOperationSpec: coreClient.OperationSpec = {
121
166
  path: "{nextLink}",
122
- urlParameters: [
123
- Parameters.nextPageLink
124
- ],
125
- headerParameters: [
126
- Parameters.acceptLanguage
127
- ],
167
+ httpMethod: "GET",
128
168
  responses: {
129
169
  200: {
130
170
  bodyMapper: Mappers.PlanUsageHistoryListResult
131
- },
132
- default: {
133
- bodyMapper: Mappers.CloudError
134
171
  }
135
172
  },
173
+ queryParameters: [Parameters.apiVersion, Parameters.skipToken],
174
+ urlParameters: [
175
+ Parameters.$host,
176
+ Parameters.subscriptionId,
177
+ Parameters.resourceGroupName,
178
+ Parameters.commitmentPlanName,
179
+ Parameters.nextLink
180
+ ],
181
+ headerParameters: [Parameters.accept],
136
182
  serializer
137
183
  };
@@ -0,0 +1,62 @@
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 {
11
+ CommitmentAssociation,
12
+ CommitmentAssociationsListOptionalParams,
13
+ CommitmentAssociationsGetOptionalParams,
14
+ CommitmentAssociationsGetResponse,
15
+ MoveCommitmentAssociationRequest,
16
+ CommitmentAssociationsMoveOptionalParams,
17
+ CommitmentAssociationsMoveResponse
18
+ } from "../models";
19
+
20
+ /// <reference lib="esnext.asynciterable" />
21
+ /** Interface representing a CommitmentAssociations. */
22
+ export interface CommitmentAssociations {
23
+ /**
24
+ * Get all commitment associations for a parent commitment plan.
25
+ * @param resourceGroupName The resource group name.
26
+ * @param commitmentPlanName The Azure ML commitment plan name.
27
+ * @param options The options parameters.
28
+ */
29
+ list(
30
+ resourceGroupName: string,
31
+ commitmentPlanName: string,
32
+ options?: CommitmentAssociationsListOptionalParams
33
+ ): PagedAsyncIterableIterator<CommitmentAssociation>;
34
+ /**
35
+ * Get a commitment association.
36
+ * @param resourceGroupName The resource group name.
37
+ * @param commitmentPlanName The Azure ML commitment plan name.
38
+ * @param commitmentAssociationName The commitment association name.
39
+ * @param options The options parameters.
40
+ */
41
+ get(
42
+ resourceGroupName: string,
43
+ commitmentPlanName: string,
44
+ commitmentAssociationName: string,
45
+ options?: CommitmentAssociationsGetOptionalParams
46
+ ): Promise<CommitmentAssociationsGetResponse>;
47
+ /**
48
+ * Re-parent a commitment association from one commitment plan to another.
49
+ * @param resourceGroupName The resource group name.
50
+ * @param commitmentPlanName The Azure ML commitment plan name.
51
+ * @param commitmentAssociationName The commitment association name.
52
+ * @param movePayload The move request payload.
53
+ * @param options The options parameters.
54
+ */
55
+ move(
56
+ resourceGroupName: string,
57
+ commitmentPlanName: string,
58
+ commitmentAssociationName: string,
59
+ movePayload: MoveCommitmentAssociationRequest,
60
+ options?: CommitmentAssociationsMoveOptionalParams
61
+ ): Promise<CommitmentAssociationsMoveResponse>;
62
+ }
@@ -0,0 +1,92 @@
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 {
11
+ CommitmentPlan,
12
+ CommitmentPlansListOptionalParams,
13
+ CommitmentPlansListInResourceGroupOptionalParams,
14
+ CommitmentPlansGetOptionalParams,
15
+ CommitmentPlansGetResponse,
16
+ CommitmentPlansCreateOrUpdateOptionalParams,
17
+ CommitmentPlansCreateOrUpdateResponse,
18
+ CommitmentPlansRemoveOptionalParams,
19
+ CommitmentPlanPatchPayload,
20
+ CommitmentPlansPatchOptionalParams,
21
+ CommitmentPlansPatchResponse
22
+ } from "../models";
23
+
24
+ /// <reference lib="esnext.asynciterable" />
25
+ /** Interface representing a CommitmentPlans. */
26
+ export interface CommitmentPlans {
27
+ /**
28
+ * Retrieve all Azure ML commitment plans in a subscription.
29
+ * @param options The options parameters.
30
+ */
31
+ list(
32
+ options?: CommitmentPlansListOptionalParams
33
+ ): PagedAsyncIterableIterator<CommitmentPlan>;
34
+ /**
35
+ * Retrieve all Azure ML commitment plans in a resource group.
36
+ * @param resourceGroupName The resource group name.
37
+ * @param options The options parameters.
38
+ */
39
+ listInResourceGroup(
40
+ resourceGroupName: string,
41
+ options?: CommitmentPlansListInResourceGroupOptionalParams
42
+ ): PagedAsyncIterableIterator<CommitmentPlan>;
43
+ /**
44
+ * Retrieve an Azure ML commitment plan by its subscription, resource group and name.
45
+ * @param resourceGroupName The resource group name.
46
+ * @param commitmentPlanName The Azure ML commitment plan name.
47
+ * @param options The options parameters.
48
+ */
49
+ get(
50
+ resourceGroupName: string,
51
+ commitmentPlanName: string,
52
+ options?: CommitmentPlansGetOptionalParams
53
+ ): Promise<CommitmentPlansGetResponse>;
54
+ /**
55
+ * Create a new Azure ML commitment plan resource or updates an existing one.
56
+ * @param resourceGroupName The resource group name.
57
+ * @param commitmentPlanName The Azure ML commitment plan name.
58
+ * @param createOrUpdatePayload The payload to create or update the Azure ML commitment plan.
59
+ * @param options The options parameters.
60
+ */
61
+ createOrUpdate(
62
+ resourceGroupName: string,
63
+ commitmentPlanName: string,
64
+ createOrUpdatePayload: CommitmentPlan,
65
+ options?: CommitmentPlansCreateOrUpdateOptionalParams
66
+ ): Promise<CommitmentPlansCreateOrUpdateResponse>;
67
+ /**
68
+ * Remove an existing Azure ML commitment plan.
69
+ * @param resourceGroupName The resource group name.
70
+ * @param commitmentPlanName The Azure ML commitment plan name.
71
+ * @param options The options parameters.
72
+ */
73
+ remove(
74
+ resourceGroupName: string,
75
+ commitmentPlanName: string,
76
+ options?: CommitmentPlansRemoveOptionalParams
77
+ ): Promise<void>;
78
+ /**
79
+ * Patch an existing Azure ML commitment plan resource.
80
+ * @param resourceGroupName The resource group name.
81
+ * @param commitmentPlanName The Azure ML commitment plan name.
82
+ * @param patchPayload The payload to use to patch the Azure ML commitment plan. Only tags and SKU may
83
+ * be modified on an existing commitment plan.
84
+ * @param options The options parameters.
85
+ */
86
+ patch(
87
+ resourceGroupName: string,
88
+ commitmentPlanName: string,
89
+ patchPayload: CommitmentPlanPatchPayload,
90
+ options?: CommitmentPlansPatchOptionalParams
91
+ ): Promise<CommitmentPlansPatchResponse>;
92
+ }