@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,81 +1,104 @@
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";
9
+ import {
10
+ OperationParameter,
11
+ OperationURLParameter,
12
+ OperationQueryParameter
13
+ } from "@azure/core-client";
14
+ import {
15
+ MoveCommitmentAssociationRequest as MoveCommitmentAssociationRequestMapper,
16
+ CommitmentPlan as CommitmentPlanMapper,
17
+ CommitmentPlanPatchPayload as CommitmentPlanPatchPayloadMapper
18
+ } from "../models/mappers";
12
19
 
13
- export const acceptLanguage: msRest.OperationParameter = {
14
- parameterPath: "acceptLanguage",
20
+ export const accept: OperationParameter = {
21
+ parameterPath: "accept",
15
22
  mapper: {
16
- serializedName: "accept-language",
17
- defaultValue: 'en-US',
23
+ defaultValue: "application/json",
24
+ isConstant: true,
25
+ serializedName: "Accept",
18
26
  type: {
19
27
  name: "String"
20
28
  }
21
29
  }
22
30
  };
23
- export const apiVersion: msRest.OperationQueryParameter = {
24
- parameterPath: "apiVersion",
31
+
32
+ export const $host: OperationURLParameter = {
33
+ parameterPath: "$host",
25
34
  mapper: {
35
+ serializedName: "$host",
26
36
  required: true,
37
+ type: {
38
+ name: "String"
39
+ }
40
+ },
41
+ skipEncoding: true
42
+ };
43
+
44
+ export const apiVersion: OperationQueryParameter = {
45
+ parameterPath: "apiVersion",
46
+ mapper: {
47
+ defaultValue: "2016-05-01-preview",
48
+ isConstant: true,
27
49
  serializedName: "api-version",
28
50
  type: {
29
51
  name: "String"
30
52
  }
31
53
  }
32
54
  };
33
- export const commitmentAssociationName: msRest.OperationURLParameter = {
34
- parameterPath: "commitmentAssociationName",
55
+
56
+ export const subscriptionId: OperationURLParameter = {
57
+ parameterPath: "subscriptionId",
35
58
  mapper: {
59
+ serializedName: "subscriptionId",
36
60
  required: true,
37
- serializedName: "commitmentAssociationName",
38
61
  type: {
39
62
  name: "String"
40
63
  }
41
64
  }
42
65
  };
43
- export const commitmentPlanName: msRest.OperationURLParameter = {
44
- parameterPath: "commitmentPlanName",
66
+
67
+ export const resourceGroupName: OperationURLParameter = {
68
+ parameterPath: "resourceGroupName",
45
69
  mapper: {
70
+ serializedName: "resourceGroupName",
46
71
  required: true,
47
- serializedName: "commitmentPlanName",
48
72
  type: {
49
73
  name: "String"
50
74
  }
51
75
  }
52
76
  };
53
- export const nextPageLink: msRest.OperationURLParameter = {
54
- parameterPath: "nextPageLink",
77
+
78
+ export const commitmentPlanName: OperationURLParameter = {
79
+ parameterPath: "commitmentPlanName",
55
80
  mapper: {
81
+ serializedName: "commitmentPlanName",
56
82
  required: true,
57
- serializedName: "nextLink",
58
83
  type: {
59
84
  name: "String"
60
85
  }
61
- },
62
- skipEncoding: true
86
+ }
63
87
  };
64
- export const resourceGroupName: msRest.OperationURLParameter = {
65
- parameterPath: "resourceGroupName",
88
+
89
+ export const commitmentAssociationName: OperationURLParameter = {
90
+ parameterPath: "commitmentAssociationName",
66
91
  mapper: {
92
+ serializedName: "commitmentAssociationName",
67
93
  required: true,
68
- serializedName: "resourceGroupName",
69
94
  type: {
70
95
  name: "String"
71
96
  }
72
97
  }
73
98
  };
74
- export const skipToken: msRest.OperationQueryParameter = {
75
- parameterPath: [
76
- "options",
77
- "skipToken"
78
- ],
99
+
100
+ export const skipToken: OperationQueryParameter = {
101
+ parameterPath: ["options", "skipToken"],
79
102
  mapper: {
80
103
  serializedName: "$skipToken",
81
104
  type: {
@@ -83,13 +106,42 @@ export const skipToken: msRest.OperationQueryParameter = {
83
106
  }
84
107
  }
85
108
  };
86
- export const subscriptionId: msRest.OperationURLParameter = {
87
- parameterPath: "subscriptionId",
109
+
110
+ export const contentType: OperationParameter = {
111
+ parameterPath: ["options", "contentType"],
88
112
  mapper: {
89
- required: true,
90
- serializedName: "subscriptionId",
113
+ defaultValue: "application/json",
114
+ isConstant: true,
115
+ serializedName: "Content-Type",
91
116
  type: {
92
117
  name: "String"
93
118
  }
94
119
  }
95
120
  };
121
+
122
+ export const movePayload: OperationParameter = {
123
+ parameterPath: "movePayload",
124
+ mapper: MoveCommitmentAssociationRequestMapper
125
+ };
126
+
127
+ export const nextLink: OperationURLParameter = {
128
+ parameterPath: "nextLink",
129
+ mapper: {
130
+ serializedName: "nextLink",
131
+ required: true,
132
+ type: {
133
+ name: "String"
134
+ }
135
+ },
136
+ skipEncoding: true
137
+ };
138
+
139
+ export const createOrUpdatePayload: OperationParameter = {
140
+ parameterPath: "createOrUpdatePayload",
141
+ mapper: CommitmentPlanMapper
142
+ };
143
+
144
+ export const patchPayload: OperationParameter = {
145
+ parameterPath: "patchPayload",
146
+ mapper: CommitmentPlanPatchPayloadMapper
147
+ };
@@ -1,56 +1,127 @@
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/commitmentAssociationsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { CommitmentAssociations } 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
+ CommitmentAssociation,
17
+ CommitmentAssociationsListNextOptionalParams,
18
+ CommitmentAssociationsListOptionalParams,
19
+ CommitmentAssociationsGetOptionalParams,
20
+ CommitmentAssociationsGetResponse,
21
+ CommitmentAssociationsListResponse,
22
+ MoveCommitmentAssociationRequest,
23
+ CommitmentAssociationsMoveOptionalParams,
24
+ CommitmentAssociationsMoveResponse,
25
+ CommitmentAssociationsListNextResponse
26
+ } from "../models";
16
27
 
17
- /** Class representing a CommitmentAssociations. */
18
- export class CommitmentAssociations {
19
- private readonly client: AzureMLCommitmentPlansManagementClientContext;
28
+ /// <reference lib="esnext.asynciterable" />
29
+ /** Class containing CommitmentAssociations operations. */
30
+ export class CommitmentAssociationsImpl implements CommitmentAssociations {
31
+ private readonly client: AzureMLCommitmentPlansManagementClient;
20
32
 
21
33
  /**
22
- * Create a CommitmentAssociations.
23
- * @param {AzureMLCommitmentPlansManagementClientContext} client Reference to the service client.
34
+ * Initialize a new instance of the class CommitmentAssociations class.
35
+ * @param client Reference to the service client
24
36
  */
25
- constructor(client: AzureMLCommitmentPlansManagementClientContext) {
37
+ constructor(client: AzureMLCommitmentPlansManagementClient) {
26
38
  this.client = client;
27
39
  }
28
40
 
29
41
  /**
30
- * Get a commitment association.
31
- * @param resourceGroupName The resource group name.
32
- * @param commitmentPlanName The Azure ML commitment plan name.
33
- * @param commitmentAssociationName The commitment association name.
34
- * @param [options] The optional parameters
35
- * @returns Promise<Models.CommitmentAssociationsGetResponse>
36
- */
37
- get(resourceGroupName: string, commitmentPlanName: string, commitmentAssociationName: string, options?: msRest.RequestOptionsBase): Promise<Models.CommitmentAssociationsGetResponse>;
38
- /**
42
+ * Get all commitment associations for a parent commitment plan.
39
43
  * @param resourceGroupName The resource group name.
40
44
  * @param commitmentPlanName The Azure ML commitment plan name.
41
- * @param commitmentAssociationName The commitment association name.
42
- * @param callback The callback
45
+ * @param options The options parameters.
43
46
  */
44
- get(resourceGroupName: string, commitmentPlanName: string, commitmentAssociationName: string, callback: msRest.ServiceCallback<Models.CommitmentAssociation>): void;
47
+ public list(
48
+ resourceGroupName: string,
49
+ commitmentPlanName: string,
50
+ options?: CommitmentAssociationsListOptionalParams
51
+ ): PagedAsyncIterableIterator<CommitmentAssociation> {
52
+ const iter = this.listPagingAll(
53
+ resourceGroupName,
54
+ commitmentPlanName,
55
+ options
56
+ );
57
+ return {
58
+ next() {
59
+ return iter.next();
60
+ },
61
+ [Symbol.asyncIterator]() {
62
+ return this;
63
+ },
64
+ byPage: () => {
65
+ return this.listPagingPage(
66
+ resourceGroupName,
67
+ commitmentPlanName,
68
+ options
69
+ );
70
+ }
71
+ };
72
+ }
73
+
74
+ private async *listPagingPage(
75
+ resourceGroupName: string,
76
+ commitmentPlanName: string,
77
+ options?: CommitmentAssociationsListOptionalParams
78
+ ): AsyncIterableIterator<CommitmentAssociation[]> {
79
+ let result = await this._list(
80
+ resourceGroupName,
81
+ commitmentPlanName,
82
+ options
83
+ );
84
+ yield result.value || [];
85
+ let continuationToken = result.nextLink;
86
+ while (continuationToken) {
87
+ result = await this._listNext(
88
+ resourceGroupName,
89
+ commitmentPlanName,
90
+ continuationToken,
91
+ options
92
+ );
93
+ continuationToken = result.nextLink;
94
+ yield result.value || [];
95
+ }
96
+ }
97
+
98
+ private async *listPagingAll(
99
+ resourceGroupName: string,
100
+ commitmentPlanName: string,
101
+ options?: CommitmentAssociationsListOptionalParams
102
+ ): AsyncIterableIterator<CommitmentAssociation> {
103
+ for await (const page of this.listPagingPage(
104
+ resourceGroupName,
105
+ commitmentPlanName,
106
+ options
107
+ )) {
108
+ yield* page;
109
+ }
110
+ }
111
+
45
112
  /**
113
+ * Get a commitment association.
46
114
  * @param resourceGroupName The resource group name.
47
115
  * @param commitmentPlanName The Azure ML commitment plan name.
48
116
  * @param commitmentAssociationName The commitment association name.
49
- * @param options The optional parameters
50
- * @param callback The callback
117
+ * @param options The options parameters.
51
118
  */
52
- get(resourceGroupName: string, commitmentPlanName: string, commitmentAssociationName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CommitmentAssociation>): void;
53
- get(resourceGroupName: string, commitmentPlanName: string, commitmentAssociationName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CommitmentAssociation>, callback?: msRest.ServiceCallback<Models.CommitmentAssociation>): Promise<Models.CommitmentAssociationsGetResponse> {
119
+ get(
120
+ resourceGroupName: string,
121
+ commitmentPlanName: string,
122
+ commitmentAssociationName: string,
123
+ options?: CommitmentAssociationsGetOptionalParams
124
+ ): Promise<CommitmentAssociationsGetResponse> {
54
125
  return this.client.sendOperationRequest(
55
126
  {
56
127
  resourceGroupName,
@@ -58,40 +129,25 @@ export class CommitmentAssociations {
58
129
  commitmentAssociationName,
59
130
  options
60
131
  },
61
- getOperationSpec,
62
- callback) as Promise<Models.CommitmentAssociationsGetResponse>;
132
+ getOperationSpec
133
+ );
63
134
  }
64
135
 
65
136
  /**
66
137
  * Get all commitment associations for a parent commitment plan.
67
138
  * @param resourceGroupName The resource group name.
68
139
  * @param commitmentPlanName The Azure ML commitment plan name.
69
- * @param [options] The optional parameters
70
- * @returns Promise<Models.CommitmentAssociationsListResponse>
71
- */
72
- list(resourceGroupName: string, commitmentPlanName: string, options?: Models.CommitmentAssociationsListOptionalParams): Promise<Models.CommitmentAssociationsListResponse>;
73
- /**
74
- * @param resourceGroupName The resource group name.
75
- * @param commitmentPlanName The Azure ML commitment plan name.
76
- * @param callback The callback
140
+ * @param options The options parameters.
77
141
  */
78
- list(resourceGroupName: string, commitmentPlanName: string, callback: msRest.ServiceCallback<Models.CommitmentAssociationListResult>): void;
79
- /**
80
- * @param resourceGroupName The resource group name.
81
- * @param commitmentPlanName The Azure ML commitment plan name.
82
- * @param options The optional parameters
83
- * @param callback The callback
84
- */
85
- list(resourceGroupName: string, commitmentPlanName: string, options: Models.CommitmentAssociationsListOptionalParams, callback: msRest.ServiceCallback<Models.CommitmentAssociationListResult>): void;
86
- list(resourceGroupName: string, commitmentPlanName: string, options?: Models.CommitmentAssociationsListOptionalParams | msRest.ServiceCallback<Models.CommitmentAssociationListResult>, callback?: msRest.ServiceCallback<Models.CommitmentAssociationListResult>): Promise<Models.CommitmentAssociationsListResponse> {
142
+ private _list(
143
+ resourceGroupName: string,
144
+ commitmentPlanName: string,
145
+ options?: CommitmentAssociationsListOptionalParams
146
+ ): Promise<CommitmentAssociationsListResponse> {
87
147
  return this.client.sendOperationRequest(
88
- {
89
- resourceGroupName,
90
- commitmentPlanName,
91
- options
92
- },
93
- listOperationSpec,
94
- callback) as Promise<Models.CommitmentAssociationsListResponse>;
148
+ { resourceGroupName, commitmentPlanName, options },
149
+ listOperationSpec
150
+ );
95
151
  }
96
152
 
97
153
  /**
@@ -100,28 +156,15 @@ export class CommitmentAssociations {
100
156
  * @param commitmentPlanName The Azure ML commitment plan name.
101
157
  * @param commitmentAssociationName The commitment association name.
102
158
  * @param movePayload The move request payload.
103
- * @param [options] The optional parameters
104
- * @returns Promise<Models.CommitmentAssociationsMoveResponse>
105
- */
106
- move(resourceGroupName: string, commitmentPlanName: string, commitmentAssociationName: string, movePayload: Models.MoveCommitmentAssociationRequest, options?: msRest.RequestOptionsBase): Promise<Models.CommitmentAssociationsMoveResponse>;
107
- /**
108
- * @param resourceGroupName The resource group name.
109
- * @param commitmentPlanName The Azure ML commitment plan name.
110
- * @param commitmentAssociationName The commitment association name.
111
- * @param movePayload The move request payload.
112
- * @param callback The callback
113
- */
114
- move(resourceGroupName: string, commitmentPlanName: string, commitmentAssociationName: string, movePayload: Models.MoveCommitmentAssociationRequest, callback: msRest.ServiceCallback<Models.CommitmentAssociation>): void;
115
- /**
116
- * @param resourceGroupName The resource group name.
117
- * @param commitmentPlanName The Azure ML commitment plan name.
118
- * @param commitmentAssociationName The commitment association name.
119
- * @param movePayload The move request payload.
120
- * @param options The optional parameters
121
- * @param callback The callback
159
+ * @param options The options parameters.
122
160
  */
123
- move(resourceGroupName: string, commitmentPlanName: string, commitmentAssociationName: string, movePayload: Models.MoveCommitmentAssociationRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CommitmentAssociation>): void;
124
- move(resourceGroupName: string, commitmentPlanName: string, commitmentAssociationName: string, movePayload: Models.MoveCommitmentAssociationRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CommitmentAssociation>, callback?: msRest.ServiceCallback<Models.CommitmentAssociation>): Promise<Models.CommitmentAssociationsMoveResponse> {
161
+ move(
162
+ resourceGroupName: string,
163
+ commitmentPlanName: string,
164
+ commitmentAssociationName: string,
165
+ movePayload: MoveCommitmentAssociationRequest,
166
+ options?: CommitmentAssociationsMoveOptionalParams
167
+ ): Promise<CommitmentAssociationsMoveResponse> {
125
168
  return this.client.sendOperationRequest(
126
169
  {
127
170
  resourceGroupName,
@@ -130,143 +173,109 @@ export class CommitmentAssociations {
130
173
  movePayload,
131
174
  options
132
175
  },
133
- moveOperationSpec,
134
- callback) as Promise<Models.CommitmentAssociationsMoveResponse>;
176
+ moveOperationSpec
177
+ );
135
178
  }
136
179
 
137
180
  /**
138
- * Get all commitment associations for a parent commitment plan.
139
- * @param nextPageLink The NextLink from the previous successful call to List operation.
140
- * @param [options] The optional parameters
141
- * @returns Promise<Models.CommitmentAssociationsListNextResponse>
142
- */
143
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.CommitmentAssociationsListNextResponse>;
144
- /**
145
- * @param nextPageLink The NextLink from the previous successful call to List operation.
146
- * @param callback The callback
147
- */
148
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.CommitmentAssociationListResult>): void;
149
- /**
150
- * @param nextPageLink The NextLink from the previous successful call to List operation.
151
- * @param options The optional parameters
152
- * @param callback The callback
181
+ * ListNext
182
+ * @param resourceGroupName The resource group name.
183
+ * @param commitmentPlanName The Azure ML commitment plan name.
184
+ * @param nextLink The nextLink from the previous successful call to the List method.
185
+ * @param options The options parameters.
153
186
  */
154
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CommitmentAssociationListResult>): void;
155
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CommitmentAssociationListResult>, callback?: msRest.ServiceCallback<Models.CommitmentAssociationListResult>): Promise<Models.CommitmentAssociationsListNextResponse> {
187
+ private _listNext(
188
+ resourceGroupName: string,
189
+ commitmentPlanName: string,
190
+ nextLink: string,
191
+ options?: CommitmentAssociationsListNextOptionalParams
192
+ ): Promise<CommitmentAssociationsListNextResponse> {
156
193
  return this.client.sendOperationRequest(
157
- {
158
- nextPageLink,
159
- options
160
- },
161
- listNextOperationSpec,
162
- callback) as Promise<Models.CommitmentAssociationsListNextResponse>;
194
+ { resourceGroupName, commitmentPlanName, nextLink, options },
195
+ listNextOperationSpec
196
+ );
163
197
  }
164
198
  }
165
-
166
199
  // Operation Specifications
167
- const serializer = new msRest.Serializer(Mappers);
168
- const getOperationSpec: msRest.OperationSpec = {
200
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
201
+
202
+ const getOperationSpec: coreClient.OperationSpec = {
203
+ path:
204
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}",
169
205
  httpMethod: "GET",
170
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}",
206
+ responses: {
207
+ 200: {
208
+ bodyMapper: Mappers.CommitmentAssociation
209
+ }
210
+ },
211
+ queryParameters: [Parameters.apiVersion],
171
212
  urlParameters: [
213
+ Parameters.$host,
172
214
  Parameters.subscriptionId,
173
215
  Parameters.resourceGroupName,
174
216
  Parameters.commitmentPlanName,
175
217
  Parameters.commitmentAssociationName
176
218
  ],
177
- queryParameters: [
178
- Parameters.apiVersion
179
- ],
180
- headerParameters: [
181
- Parameters.acceptLanguage
182
- ],
219
+ headerParameters: [Parameters.accept],
220
+ serializer
221
+ };
222
+ const listOperationSpec: coreClient.OperationSpec = {
223
+ path:
224
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations",
225
+ httpMethod: "GET",
183
226
  responses: {
184
227
  200: {
185
- bodyMapper: Mappers.CommitmentAssociation
186
- },
187
- default: {
188
- bodyMapper: Mappers.CloudError
228
+ bodyMapper: Mappers.CommitmentAssociationListResult
189
229
  }
190
230
  },
191
- serializer
192
- };
193
-
194
- const listOperationSpec: msRest.OperationSpec = {
195
- httpMethod: "GET",
196
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations",
231
+ queryParameters: [Parameters.apiVersion, Parameters.skipToken],
197
232
  urlParameters: [
233
+ Parameters.$host,
198
234
  Parameters.subscriptionId,
199
235
  Parameters.resourceGroupName,
200
236
  Parameters.commitmentPlanName
201
237
  ],
202
- queryParameters: [
203
- Parameters.skipToken,
204
- Parameters.apiVersion
205
- ],
206
- headerParameters: [
207
- Parameters.acceptLanguage
208
- ],
238
+ headerParameters: [Parameters.accept],
239
+ serializer
240
+ };
241
+ const moveOperationSpec: coreClient.OperationSpec = {
242
+ path:
243
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}/move",
244
+ httpMethod: "POST",
209
245
  responses: {
210
246
  200: {
211
- bodyMapper: Mappers.CommitmentAssociationListResult
212
- },
213
- default: {
214
- bodyMapper: Mappers.CloudError
247
+ bodyMapper: Mappers.CommitmentAssociation
215
248
  }
216
249
  },
217
- serializer
218
- };
219
-
220
- const moveOperationSpec: msRest.OperationSpec = {
221
- httpMethod: "POST",
222
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearning/commitmentPlans/{commitmentPlanName}/commitmentAssociations/{commitmentAssociationName}/move",
250
+ requestBody: Parameters.movePayload,
251
+ queryParameters: [Parameters.apiVersion],
223
252
  urlParameters: [
253
+ Parameters.$host,
224
254
  Parameters.subscriptionId,
225
255
  Parameters.resourceGroupName,
226
256
  Parameters.commitmentPlanName,
227
257
  Parameters.commitmentAssociationName
228
258
  ],
229
- queryParameters: [
230
- Parameters.apiVersion
231
- ],
232
- headerParameters: [
233
- Parameters.acceptLanguage
234
- ],
235
- requestBody: {
236
- parameterPath: "movePayload",
237
- mapper: {
238
- ...Mappers.MoveCommitmentAssociationRequest,
239
- required: true
240
- }
241
- },
242
- responses: {
243
- 200: {
244
- bodyMapper: Mappers.CommitmentAssociation
245
- },
246
- default: {
247
- bodyMapper: Mappers.CloudError
248
- }
249
- },
259
+ headerParameters: [Parameters.accept, Parameters.contentType],
260
+ mediaType: "json",
250
261
  serializer
251
262
  };
252
-
253
- const listNextOperationSpec: msRest.OperationSpec = {
254
- httpMethod: "GET",
255
- baseUrl: "https://management.azure.com",
263
+ const listNextOperationSpec: coreClient.OperationSpec = {
256
264
  path: "{nextLink}",
257
- urlParameters: [
258
- Parameters.nextPageLink
259
- ],
260
- headerParameters: [
261
- Parameters.acceptLanguage
262
- ],
265
+ httpMethod: "GET",
263
266
  responses: {
264
267
  200: {
265
268
  bodyMapper: Mappers.CommitmentAssociationListResult
266
- },
267
- default: {
268
- bodyMapper: Mappers.CloudError
269
269
  }
270
270
  },
271
+ queryParameters: [Parameters.apiVersion, Parameters.skipToken],
272
+ urlParameters: [
273
+ Parameters.$host,
274
+ Parameters.subscriptionId,
275
+ Parameters.resourceGroupName,
276
+ Parameters.commitmentPlanName,
277
+ Parameters.nextLink
278
+ ],
279
+ headerParameters: [Parameters.accept],
271
280
  serializer
272
281
  };