@azure/arm-cognitiveservices 7.3.1 → 7.4.0-alpha.20230217.2

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 (163) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/LICENSE +1 -1
  3. package/dist/index.js +1232 -42
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/accountsCreateSample.js +17 -8
  8. package/dist-esm/samples-dev/accountsCreateSample.js.map +1 -1
  9. package/dist-esm/samples-dev/accountsDeleteSample.js +12 -4
  10. package/dist-esm/samples-dev/accountsDeleteSample.js.map +1 -1
  11. package/dist-esm/samples-dev/accountsGetSample.js +12 -4
  12. package/dist-esm/samples-dev/accountsGetSample.js.map +1 -1
  13. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js +12 -4
  14. package/dist-esm/samples-dev/accountsListByResourceGroupSample.js.map +1 -1
  15. package/dist-esm/samples-dev/accountsListKeysSample.js +12 -4
  16. package/dist-esm/samples-dev/accountsListKeysSample.js.map +1 -1
  17. package/dist-esm/samples-dev/accountsListModelsSample.js +11 -4
  18. package/dist-esm/samples-dev/accountsListModelsSample.js.map +1 -1
  19. package/dist-esm/samples-dev/accountsListSample.js +11 -3
  20. package/dist-esm/samples-dev/accountsListSample.js.map +1 -1
  21. package/dist-esm/samples-dev/accountsListSkusSample.js +12 -4
  22. package/dist-esm/samples-dev/accountsListSkusSample.js.map +1 -1
  23. package/dist-esm/samples-dev/accountsListUsagesSample.js +12 -4
  24. package/dist-esm/samples-dev/accountsListUsagesSample.js.map +1 -1
  25. package/dist-esm/samples-dev/accountsRegenerateKeySample.js +12 -4
  26. package/dist-esm/samples-dev/accountsRegenerateKeySample.js.map +1 -1
  27. package/dist-esm/samples-dev/accountsUpdateSample.js +12 -4
  28. package/dist-esm/samples-dev/accountsUpdateSample.js.map +1 -1
  29. package/dist-esm/samples-dev/checkDomainAvailabilitySample.js +11 -3
  30. package/dist-esm/samples-dev/checkDomainAvailabilitySample.js.map +1 -1
  31. package/dist-esm/samples-dev/checkSkuAvailabilitySample.js +11 -3
  32. package/dist-esm/samples-dev/checkSkuAvailabilitySample.js.map +1 -1
  33. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdateAssociationSample.d.ts +2 -0
  34. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdateAssociationSample.d.ts.map +1 -0
  35. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdateAssociationSample.js +43 -0
  36. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdateAssociationSample.js.map +1 -0
  37. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdatePlanSample.d.ts +2 -0
  38. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdatePlanSample.d.ts.map +1 -0
  39. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdatePlanSample.js +50 -0
  40. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdatePlanSample.js.map +1 -0
  41. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdateSample.js +11 -4
  42. package/dist-esm/samples-dev/commitmentPlansCreateOrUpdateSample.js.map +1 -1
  43. package/dist-esm/samples-dev/commitmentPlansDeleteAssociationSample.d.ts +2 -0
  44. package/dist-esm/samples-dev/commitmentPlansDeleteAssociationSample.d.ts.map +1 -0
  45. package/dist-esm/samples-dev/commitmentPlansDeleteAssociationSample.js +40 -0
  46. package/dist-esm/samples-dev/commitmentPlansDeleteAssociationSample.js.map +1 -0
  47. package/dist-esm/samples-dev/commitmentPlansDeletePlanSample.d.ts +2 -0
  48. package/dist-esm/samples-dev/commitmentPlansDeletePlanSample.d.ts.map +1 -0
  49. package/dist-esm/samples-dev/commitmentPlansDeletePlanSample.js +39 -0
  50. package/dist-esm/samples-dev/commitmentPlansDeletePlanSample.js.map +1 -0
  51. package/dist-esm/samples-dev/commitmentPlansDeleteSample.js +11 -4
  52. package/dist-esm/samples-dev/commitmentPlansDeleteSample.js.map +1 -1
  53. package/dist-esm/samples-dev/commitmentPlansGetAssociationSample.d.ts +2 -0
  54. package/dist-esm/samples-dev/commitmentPlansGetAssociationSample.d.ts.map +1 -0
  55. package/dist-esm/samples-dev/commitmentPlansGetAssociationSample.js +40 -0
  56. package/dist-esm/samples-dev/commitmentPlansGetAssociationSample.js.map +1 -0
  57. package/dist-esm/samples-dev/commitmentPlansGetPlanSample.d.ts +2 -0
  58. package/dist-esm/samples-dev/commitmentPlansGetPlanSample.d.ts.map +1 -0
  59. package/dist-esm/samples-dev/commitmentPlansGetPlanSample.js +39 -0
  60. package/dist-esm/samples-dev/commitmentPlansGetPlanSample.js.map +1 -0
  61. package/dist-esm/samples-dev/commitmentPlansGetSample.js +11 -4
  62. package/dist-esm/samples-dev/commitmentPlansGetSample.js.map +1 -1
  63. package/dist-esm/samples-dev/commitmentPlansListAssociationsSample.d.ts +2 -0
  64. package/dist-esm/samples-dev/commitmentPlansListAssociationsSample.d.ts.map +1 -0
  65. package/dist-esm/samples-dev/commitmentPlansListAssociationsSample.js +53 -0
  66. package/dist-esm/samples-dev/commitmentPlansListAssociationsSample.js.map +1 -0
  67. package/dist-esm/samples-dev/commitmentPlansListPlansByResourceGroupSample.d.ts +2 -0
  68. package/dist-esm/samples-dev/commitmentPlansListPlansByResourceGroupSample.d.ts.map +1 -0
  69. package/dist-esm/samples-dev/commitmentPlansListPlansByResourceGroupSample.js +52 -0
  70. package/dist-esm/samples-dev/commitmentPlansListPlansByResourceGroupSample.js.map +1 -0
  71. package/dist-esm/samples-dev/commitmentPlansListPlansBySubscriptionSample.d.ts +2 -0
  72. package/dist-esm/samples-dev/commitmentPlansListPlansBySubscriptionSample.d.ts.map +1 -0
  73. package/dist-esm/samples-dev/commitmentPlansListPlansBySubscriptionSample.js +51 -0
  74. package/dist-esm/samples-dev/commitmentPlansListPlansBySubscriptionSample.js.map +1 -0
  75. package/dist-esm/samples-dev/commitmentPlansListSample.js +11 -4
  76. package/dist-esm/samples-dev/commitmentPlansListSample.js.map +1 -1
  77. package/dist-esm/samples-dev/commitmentPlansUpdatePlanSample.d.ts +2 -0
  78. package/dist-esm/samples-dev/commitmentPlansUpdatePlanSample.d.ts.map +1 -0
  79. package/dist-esm/samples-dev/commitmentPlansUpdatePlanSample.js +40 -0
  80. package/dist-esm/samples-dev/commitmentPlansUpdatePlanSample.js.map +1 -0
  81. package/dist-esm/samples-dev/commitmentTiersListSample.js +10 -3
  82. package/dist-esm/samples-dev/commitmentTiersListSample.js.map +1 -1
  83. package/dist-esm/samples-dev/deletedAccountsGetSample.js +12 -4
  84. package/dist-esm/samples-dev/deletedAccountsGetSample.js.map +1 -1
  85. package/dist-esm/samples-dev/deletedAccountsListSample.js +11 -3
  86. package/dist-esm/samples-dev/deletedAccountsListSample.js.map +1 -1
  87. package/dist-esm/samples-dev/deletedAccountsPurgeSample.js +12 -4
  88. package/dist-esm/samples-dev/deletedAccountsPurgeSample.js.map +1 -1
  89. package/dist-esm/samples-dev/deploymentsCreateOrUpdateSample.js +11 -4
  90. package/dist-esm/samples-dev/deploymentsCreateOrUpdateSample.js.map +1 -1
  91. package/dist-esm/samples-dev/deploymentsDeleteSample.js +11 -4
  92. package/dist-esm/samples-dev/deploymentsDeleteSample.js.map +1 -1
  93. package/dist-esm/samples-dev/deploymentsGetSample.js +11 -4
  94. package/dist-esm/samples-dev/deploymentsGetSample.js.map +1 -1
  95. package/dist-esm/samples-dev/deploymentsListSample.js +11 -4
  96. package/dist-esm/samples-dev/deploymentsListSample.js.map +1 -1
  97. package/dist-esm/samples-dev/operationsListSample.js +11 -3
  98. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  99. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js +11 -4
  100. package/dist-esm/samples-dev/privateEndpointConnectionsCreateOrUpdateSample.js.map +1 -1
  101. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js +11 -4
  102. package/dist-esm/samples-dev/privateEndpointConnectionsDeleteSample.js.map +1 -1
  103. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js +11 -4
  104. package/dist-esm/samples-dev/privateEndpointConnectionsGetSample.js.map +1 -1
  105. package/dist-esm/samples-dev/privateEndpointConnectionsListSample.js +11 -4
  106. package/dist-esm/samples-dev/privateEndpointConnectionsListSample.js.map +1 -1
  107. package/dist-esm/samples-dev/privateLinkResourcesListSample.js +11 -4
  108. package/dist-esm/samples-dev/privateLinkResourcesListSample.js.map +1 -1
  109. package/dist-esm/samples-dev/resourceSkusListSample.js +11 -3
  110. package/dist-esm/samples-dev/resourceSkusListSample.js.map +1 -1
  111. package/dist-esm/src/cognitiveServicesManagementClient.js +2 -2
  112. package/dist-esm/src/models/index.d.ts +248 -0
  113. package/dist-esm/src/models/index.d.ts.map +1 -1
  114. package/dist-esm/src/models/index.js +36 -0
  115. package/dist-esm/src/models/index.js.map +1 -1
  116. package/dist-esm/src/models/mappers.d.ts +10 -0
  117. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  118. package/dist-esm/src/models/mappers.js +259 -0
  119. package/dist-esm/src/models/mappers.js.map +1 -1
  120. package/dist-esm/src/models/parameters.d.ts +4 -0
  121. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  122. package/dist-esm/src/models/parameters.js +36 -2
  123. package/dist-esm/src/models/parameters.js.map +1 -1
  124. package/dist-esm/src/operations/accounts.js +0 -3
  125. package/dist-esm/src/operations/accounts.js.map +1 -1
  126. package/dist-esm/src/operations/commitmentPlans.d.ts +181 -1
  127. package/dist-esm/src/operations/commitmentPlans.d.ts.map +1 -1
  128. package/dist-esm/src/operations/commitmentPlans.js +864 -5
  129. package/dist-esm/src/operations/commitmentPlans.js.map +1 -1
  130. package/dist-esm/src/operations/commitmentTiers.js +0 -1
  131. package/dist-esm/src/operations/commitmentTiers.js.map +1 -1
  132. package/dist-esm/src/operations/deletedAccounts.js +0 -1
  133. package/dist-esm/src/operations/deletedAccounts.js.map +1 -1
  134. package/dist-esm/src/operations/deployments.js +0 -1
  135. package/dist-esm/src/operations/deployments.js.map +1 -1
  136. package/dist-esm/src/operations/operations.js +0 -1
  137. package/dist-esm/src/operations/operations.js.map +1 -1
  138. package/dist-esm/src/operations/resourceSkus.js +0 -1
  139. package/dist-esm/src/operations/resourceSkus.js.map +1 -1
  140. package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts +132 -1
  141. package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts.map +1 -1
  142. package/dist-esm/src/pagingHelper.d.ts +4 -4
  143. package/dist-esm/src/pagingHelper.js +4 -4
  144. package/dist-esm/test/cognitiveservices_examples.d.ts.map +1 -1
  145. package/dist-esm/test/cognitiveservices_examples.js +19 -0
  146. package/dist-esm/test/cognitiveservices_examples.js.map +1 -1
  147. package/package.json +8 -7
  148. package/review/arm-cognitiveservices.api.md +220 -0
  149. package/src/cognitiveServicesManagementClient.ts +2 -2
  150. package/src/models/index.ts +287 -0
  151. package/src/models/mappers.ts +283 -0
  152. package/src/models/parameters.ts +42 -2
  153. package/src/operations/accounts.ts +0 -3
  154. package/src/operations/commitmentPlans.ts +1222 -47
  155. package/src/operations/commitmentTiers.ts +0 -1
  156. package/src/operations/deletedAccounts.ts +0 -1
  157. package/src/operations/deployments.ts +0 -1
  158. package/src/operations/operations.ts +0 -1
  159. package/src/operations/resourceSkus.ts +0 -1
  160. package/src/operationsInterfaces/commitmentPlans.ts +232 -1
  161. package/src/pagingHelper.ts +4 -4
  162. package/types/arm-cognitiveservices.d.ts +423 -4
  163. package/types/tsdoc-metadata.json +1 -1
@@ -20,12 +20,38 @@ import {
20
20
  CommitmentPlansListNextOptionalParams,
21
21
  CommitmentPlansListOptionalParams,
22
22
  CommitmentPlansListResponse,
23
+ CommitmentPlansListPlansByResourceGroupNextOptionalParams,
24
+ CommitmentPlansListPlansByResourceGroupOptionalParams,
25
+ CommitmentPlansListPlansByResourceGroupResponse,
26
+ CommitmentPlansListPlansBySubscriptionNextOptionalParams,
27
+ CommitmentPlansListPlansBySubscriptionOptionalParams,
28
+ CommitmentPlansListPlansBySubscriptionResponse,
29
+ CommitmentPlanAccountAssociation,
30
+ CommitmentPlansListAssociationsNextOptionalParams,
31
+ CommitmentPlansListAssociationsOptionalParams,
32
+ CommitmentPlansListAssociationsResponse,
23
33
  CommitmentPlansGetOptionalParams,
24
34
  CommitmentPlansGetResponse,
25
35
  CommitmentPlansCreateOrUpdateOptionalParams,
26
36
  CommitmentPlansCreateOrUpdateResponse,
27
37
  CommitmentPlansDeleteOptionalParams,
28
- CommitmentPlansListNextResponse
38
+ CommitmentPlansCreateOrUpdatePlanOptionalParams,
39
+ CommitmentPlansCreateOrUpdatePlanResponse,
40
+ PatchResourceTagsAndSku,
41
+ CommitmentPlansUpdatePlanOptionalParams,
42
+ CommitmentPlansUpdatePlanResponse,
43
+ CommitmentPlansDeletePlanOptionalParams,
44
+ CommitmentPlansGetPlanOptionalParams,
45
+ CommitmentPlansGetPlanResponse,
46
+ CommitmentPlansGetAssociationOptionalParams,
47
+ CommitmentPlansGetAssociationResponse,
48
+ CommitmentPlansCreateOrUpdateAssociationOptionalParams,
49
+ CommitmentPlansCreateOrUpdateAssociationResponse,
50
+ CommitmentPlansDeleteAssociationOptionalParams,
51
+ CommitmentPlansListNextResponse,
52
+ CommitmentPlansListPlansByResourceGroupNextResponse,
53
+ CommitmentPlansListPlansBySubscriptionNextResponse,
54
+ CommitmentPlansListAssociationsNextResponse
29
55
  } from "../models";
30
56
 
31
57
  /// <reference lib="esnext.asynciterable" />
@@ -117,6 +143,220 @@ export class CommitmentPlansImpl implements CommitmentPlans {
117
143
  }
118
144
  }
119
145
 
146
+ /**
147
+ * Returns all the resources of a particular type belonging to a resource group
148
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
149
+ * @param options The options parameters.
150
+ */
151
+ public listPlansByResourceGroup(
152
+ resourceGroupName: string,
153
+ options?: CommitmentPlansListPlansByResourceGroupOptionalParams
154
+ ): PagedAsyncIterableIterator<CommitmentPlan> {
155
+ const iter = this.listPlansByResourceGroupPagingAll(
156
+ resourceGroupName,
157
+ options
158
+ );
159
+ return {
160
+ next() {
161
+ return iter.next();
162
+ },
163
+ [Symbol.asyncIterator]() {
164
+ return this;
165
+ },
166
+ byPage: (settings?: PageSettings) => {
167
+ if (settings?.maxPageSize) {
168
+ throw new Error("maxPageSize is not supported by this operation.");
169
+ }
170
+ return this.listPlansByResourceGroupPagingPage(
171
+ resourceGroupName,
172
+ options,
173
+ settings
174
+ );
175
+ }
176
+ };
177
+ }
178
+
179
+ private async *listPlansByResourceGroupPagingPage(
180
+ resourceGroupName: string,
181
+ options?: CommitmentPlansListPlansByResourceGroupOptionalParams,
182
+ settings?: PageSettings
183
+ ): AsyncIterableIterator<CommitmentPlan[]> {
184
+ let result: CommitmentPlansListPlansByResourceGroupResponse;
185
+ let continuationToken = settings?.continuationToken;
186
+ if (!continuationToken) {
187
+ result = await this._listPlansByResourceGroup(resourceGroupName, options);
188
+ let page = result.value || [];
189
+ continuationToken = result.nextLink;
190
+ setContinuationToken(page, continuationToken);
191
+ yield page;
192
+ }
193
+ while (continuationToken) {
194
+ result = await this._listPlansByResourceGroupNext(
195
+ resourceGroupName,
196
+ continuationToken,
197
+ options
198
+ );
199
+ continuationToken = result.nextLink;
200
+ let page = result.value || [];
201
+ setContinuationToken(page, continuationToken);
202
+ yield page;
203
+ }
204
+ }
205
+
206
+ private async *listPlansByResourceGroupPagingAll(
207
+ resourceGroupName: string,
208
+ options?: CommitmentPlansListPlansByResourceGroupOptionalParams
209
+ ): AsyncIterableIterator<CommitmentPlan> {
210
+ for await (const page of this.listPlansByResourceGroupPagingPage(
211
+ resourceGroupName,
212
+ options
213
+ )) {
214
+ yield* page;
215
+ }
216
+ }
217
+
218
+ /**
219
+ * Returns all the resources of a particular type belonging to a subscription.
220
+ * @param options The options parameters.
221
+ */
222
+ public listPlansBySubscription(
223
+ options?: CommitmentPlansListPlansBySubscriptionOptionalParams
224
+ ): PagedAsyncIterableIterator<CommitmentPlan> {
225
+ const iter = this.listPlansBySubscriptionPagingAll(options);
226
+ return {
227
+ next() {
228
+ return iter.next();
229
+ },
230
+ [Symbol.asyncIterator]() {
231
+ return this;
232
+ },
233
+ byPage: (settings?: PageSettings) => {
234
+ if (settings?.maxPageSize) {
235
+ throw new Error("maxPageSize is not supported by this operation.");
236
+ }
237
+ return this.listPlansBySubscriptionPagingPage(options, settings);
238
+ }
239
+ };
240
+ }
241
+
242
+ private async *listPlansBySubscriptionPagingPage(
243
+ options?: CommitmentPlansListPlansBySubscriptionOptionalParams,
244
+ settings?: PageSettings
245
+ ): AsyncIterableIterator<CommitmentPlan[]> {
246
+ let result: CommitmentPlansListPlansBySubscriptionResponse;
247
+ let continuationToken = settings?.continuationToken;
248
+ if (!continuationToken) {
249
+ result = await this._listPlansBySubscription(options);
250
+ let page = result.value || [];
251
+ continuationToken = result.nextLink;
252
+ setContinuationToken(page, continuationToken);
253
+ yield page;
254
+ }
255
+ while (continuationToken) {
256
+ result = await this._listPlansBySubscriptionNext(
257
+ continuationToken,
258
+ options
259
+ );
260
+ continuationToken = result.nextLink;
261
+ let page = result.value || [];
262
+ setContinuationToken(page, continuationToken);
263
+ yield page;
264
+ }
265
+ }
266
+
267
+ private async *listPlansBySubscriptionPagingAll(
268
+ options?: CommitmentPlansListPlansBySubscriptionOptionalParams
269
+ ): AsyncIterableIterator<CommitmentPlan> {
270
+ for await (const page of this.listPlansBySubscriptionPagingPage(options)) {
271
+ yield* page;
272
+ }
273
+ }
274
+
275
+ /**
276
+ * Gets the associations of the Cognitive Services commitment plan.
277
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
278
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
279
+ * Account
280
+ * @param options The options parameters.
281
+ */
282
+ public listAssociations(
283
+ resourceGroupName: string,
284
+ commitmentPlanName: string,
285
+ options?: CommitmentPlansListAssociationsOptionalParams
286
+ ): PagedAsyncIterableIterator<CommitmentPlanAccountAssociation> {
287
+ const iter = this.listAssociationsPagingAll(
288
+ resourceGroupName,
289
+ commitmentPlanName,
290
+ options
291
+ );
292
+ return {
293
+ next() {
294
+ return iter.next();
295
+ },
296
+ [Symbol.asyncIterator]() {
297
+ return this;
298
+ },
299
+ byPage: (settings?: PageSettings) => {
300
+ if (settings?.maxPageSize) {
301
+ throw new Error("maxPageSize is not supported by this operation.");
302
+ }
303
+ return this.listAssociationsPagingPage(
304
+ resourceGroupName,
305
+ commitmentPlanName,
306
+ options,
307
+ settings
308
+ );
309
+ }
310
+ };
311
+ }
312
+
313
+ private async *listAssociationsPagingPage(
314
+ resourceGroupName: string,
315
+ commitmentPlanName: string,
316
+ options?: CommitmentPlansListAssociationsOptionalParams,
317
+ settings?: PageSettings
318
+ ): AsyncIterableIterator<CommitmentPlanAccountAssociation[]> {
319
+ let result: CommitmentPlansListAssociationsResponse;
320
+ let continuationToken = settings?.continuationToken;
321
+ if (!continuationToken) {
322
+ result = await this._listAssociations(
323
+ resourceGroupName,
324
+ commitmentPlanName,
325
+ options
326
+ );
327
+ let page = result.value || [];
328
+ continuationToken = result.nextLink;
329
+ setContinuationToken(page, continuationToken);
330
+ yield page;
331
+ }
332
+ while (continuationToken) {
333
+ result = await this._listAssociationsNext(
334
+ resourceGroupName,
335
+ commitmentPlanName,
336
+ continuationToken,
337
+ options
338
+ );
339
+ continuationToken = result.nextLink;
340
+ let page = result.value || [];
341
+ setContinuationToken(page, continuationToken);
342
+ yield page;
343
+ }
344
+ }
345
+
346
+ private async *listAssociationsPagingAll(
347
+ resourceGroupName: string,
348
+ commitmentPlanName: string,
349
+ options?: CommitmentPlansListAssociationsOptionalParams
350
+ ): AsyncIterableIterator<CommitmentPlanAccountAssociation> {
351
+ for await (const page of this.listAssociationsPagingPage(
352
+ resourceGroupName,
353
+ commitmentPlanName,
354
+ options
355
+ )) {
356
+ yield* page;
357
+ }
358
+ }
359
+
120
360
  /**
121
361
  * Gets the commitmentPlans associated with the Cognitive Services account.
122
362
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
@@ -272,61 +512,712 @@ export class CommitmentPlansImpl implements CommitmentPlans {
272
512
  }
273
513
 
274
514
  /**
275
- * ListNext
515
+ * Create Cognitive Services commitment plan.
276
516
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
277
- * @param accountName The name of Cognitive Services account.
278
- * @param nextLink The nextLink from the previous successful call to the List method.
517
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
518
+ * Account
519
+ * @param commitmentPlan The parameters to provide for the created commitment plan.
279
520
  * @param options The options parameters.
280
521
  */
281
- private _listNext(
522
+ async beginCreateOrUpdatePlan(
282
523
  resourceGroupName: string,
283
- accountName: string,
284
- nextLink: string,
285
- options?: CommitmentPlansListNextOptionalParams
286
- ): Promise<CommitmentPlansListNextResponse> {
287
- return this.client.sendOperationRequest(
288
- { resourceGroupName, accountName, nextLink, options },
289
- listNextOperationSpec
524
+ commitmentPlanName: string,
525
+ commitmentPlan: CommitmentPlan,
526
+ options?: CommitmentPlansCreateOrUpdatePlanOptionalParams
527
+ ): Promise<
528
+ PollerLike<
529
+ PollOperationState<CommitmentPlansCreateOrUpdatePlanResponse>,
530
+ CommitmentPlansCreateOrUpdatePlanResponse
531
+ >
532
+ > {
533
+ const directSendOperation = async (
534
+ args: coreClient.OperationArguments,
535
+ spec: coreClient.OperationSpec
536
+ ): Promise<CommitmentPlansCreateOrUpdatePlanResponse> => {
537
+ return this.client.sendOperationRequest(args, spec);
538
+ };
539
+ const sendOperation = async (
540
+ args: coreClient.OperationArguments,
541
+ spec: coreClient.OperationSpec
542
+ ) => {
543
+ let currentRawResponse:
544
+ | coreClient.FullOperationResponse
545
+ | undefined = undefined;
546
+ const providedCallback = args.options?.onResponse;
547
+ const callback: coreClient.RawResponseCallback = (
548
+ rawResponse: coreClient.FullOperationResponse,
549
+ flatResponse: unknown
550
+ ) => {
551
+ currentRawResponse = rawResponse;
552
+ providedCallback?.(rawResponse, flatResponse);
553
+ };
554
+ const updatedArgs = {
555
+ ...args,
556
+ options: {
557
+ ...args.options,
558
+ onResponse: callback
559
+ }
560
+ };
561
+ const flatResponse = await directSendOperation(updatedArgs, spec);
562
+ return {
563
+ flatResponse,
564
+ rawResponse: {
565
+ statusCode: currentRawResponse!.status,
566
+ body: currentRawResponse!.parsedBody,
567
+ headers: currentRawResponse!.headers.toJSON()
568
+ }
569
+ };
570
+ };
571
+
572
+ const lro = new LroImpl(
573
+ sendOperation,
574
+ { resourceGroupName, commitmentPlanName, commitmentPlan, options },
575
+ createOrUpdatePlanOperationSpec
290
576
  );
577
+ const poller = new LroEngine(lro, {
578
+ resumeFrom: options?.resumeFrom,
579
+ intervalInMs: options?.updateIntervalInMs,
580
+ lroResourceLocationConfig: "azure-async-operation"
581
+ });
582
+ await poller.poll();
583
+ return poller;
291
584
  }
292
- }
293
- // Operation Specifications
294
- const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
295
585
 
296
- const listOperationSpec: coreClient.OperationSpec = {
297
- path:
298
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans",
299
- httpMethod: "GET",
300
- responses: {
301
- 200: {
302
- bodyMapper: Mappers.CommitmentPlanListResult
303
- },
304
- default: {
305
- bodyMapper: Mappers.ErrorResponse
306
- }
307
- },
308
- queryParameters: [Parameters.apiVersion],
309
- urlParameters: [
310
- Parameters.$host,
311
- Parameters.resourceGroupName,
312
- Parameters.accountName,
313
- Parameters.subscriptionId
314
- ],
315
- headerParameters: [Parameters.accept],
316
- serializer
317
- };
586
+ /**
587
+ * Create Cognitive Services commitment plan.
588
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
589
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
590
+ * Account
591
+ * @param commitmentPlan The parameters to provide for the created commitment plan.
592
+ * @param options The options parameters.
593
+ */
594
+ async beginCreateOrUpdatePlanAndWait(
595
+ resourceGroupName: string,
596
+ commitmentPlanName: string,
597
+ commitmentPlan: CommitmentPlan,
598
+ options?: CommitmentPlansCreateOrUpdatePlanOptionalParams
599
+ ): Promise<CommitmentPlansCreateOrUpdatePlanResponse> {
600
+ const poller = await this.beginCreateOrUpdatePlan(
601
+ resourceGroupName,
602
+ commitmentPlanName,
603
+ commitmentPlan,
604
+ options
605
+ );
606
+ return poller.pollUntilDone();
607
+ }
608
+
609
+ /**
610
+ * Create Cognitive Services commitment plan.
611
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
612
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
613
+ * Account
614
+ * @param commitmentPlan The parameters to provide for the created commitment plan.
615
+ * @param options The options parameters.
616
+ */
617
+ async beginUpdatePlan(
618
+ resourceGroupName: string,
619
+ commitmentPlanName: string,
620
+ commitmentPlan: PatchResourceTagsAndSku,
621
+ options?: CommitmentPlansUpdatePlanOptionalParams
622
+ ): Promise<
623
+ PollerLike<
624
+ PollOperationState<CommitmentPlansUpdatePlanResponse>,
625
+ CommitmentPlansUpdatePlanResponse
626
+ >
627
+ > {
628
+ const directSendOperation = async (
629
+ args: coreClient.OperationArguments,
630
+ spec: coreClient.OperationSpec
631
+ ): Promise<CommitmentPlansUpdatePlanResponse> => {
632
+ return this.client.sendOperationRequest(args, spec);
633
+ };
634
+ const sendOperation = async (
635
+ args: coreClient.OperationArguments,
636
+ spec: coreClient.OperationSpec
637
+ ) => {
638
+ let currentRawResponse:
639
+ | coreClient.FullOperationResponse
640
+ | undefined = undefined;
641
+ const providedCallback = args.options?.onResponse;
642
+ const callback: coreClient.RawResponseCallback = (
643
+ rawResponse: coreClient.FullOperationResponse,
644
+ flatResponse: unknown
645
+ ) => {
646
+ currentRawResponse = rawResponse;
647
+ providedCallback?.(rawResponse, flatResponse);
648
+ };
649
+ const updatedArgs = {
650
+ ...args,
651
+ options: {
652
+ ...args.options,
653
+ onResponse: callback
654
+ }
655
+ };
656
+ const flatResponse = await directSendOperation(updatedArgs, spec);
657
+ return {
658
+ flatResponse,
659
+ rawResponse: {
660
+ statusCode: currentRawResponse!.status,
661
+ body: currentRawResponse!.parsedBody,
662
+ headers: currentRawResponse!.headers.toJSON()
663
+ }
664
+ };
665
+ };
666
+
667
+ const lro = new LroImpl(
668
+ sendOperation,
669
+ { resourceGroupName, commitmentPlanName, commitmentPlan, options },
670
+ updatePlanOperationSpec
671
+ );
672
+ const poller = new LroEngine(lro, {
673
+ resumeFrom: options?.resumeFrom,
674
+ intervalInMs: options?.updateIntervalInMs,
675
+ lroResourceLocationConfig: "location"
676
+ });
677
+ await poller.poll();
678
+ return poller;
679
+ }
680
+
681
+ /**
682
+ * Create Cognitive Services commitment plan.
683
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
684
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
685
+ * Account
686
+ * @param commitmentPlan The parameters to provide for the created commitment plan.
687
+ * @param options The options parameters.
688
+ */
689
+ async beginUpdatePlanAndWait(
690
+ resourceGroupName: string,
691
+ commitmentPlanName: string,
692
+ commitmentPlan: PatchResourceTagsAndSku,
693
+ options?: CommitmentPlansUpdatePlanOptionalParams
694
+ ): Promise<CommitmentPlansUpdatePlanResponse> {
695
+ const poller = await this.beginUpdatePlan(
696
+ resourceGroupName,
697
+ commitmentPlanName,
698
+ commitmentPlan,
699
+ options
700
+ );
701
+ return poller.pollUntilDone();
702
+ }
703
+
704
+ /**
705
+ * Deletes a Cognitive Services commitment plan from the resource group.
706
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
707
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
708
+ * Account
709
+ * @param options The options parameters.
710
+ */
711
+ async beginDeletePlan(
712
+ resourceGroupName: string,
713
+ commitmentPlanName: string,
714
+ options?: CommitmentPlansDeletePlanOptionalParams
715
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
716
+ const directSendOperation = async (
717
+ args: coreClient.OperationArguments,
718
+ spec: coreClient.OperationSpec
719
+ ): Promise<void> => {
720
+ return this.client.sendOperationRequest(args, spec);
721
+ };
722
+ const sendOperation = async (
723
+ args: coreClient.OperationArguments,
724
+ spec: coreClient.OperationSpec
725
+ ) => {
726
+ let currentRawResponse:
727
+ | coreClient.FullOperationResponse
728
+ | undefined = undefined;
729
+ const providedCallback = args.options?.onResponse;
730
+ const callback: coreClient.RawResponseCallback = (
731
+ rawResponse: coreClient.FullOperationResponse,
732
+ flatResponse: unknown
733
+ ) => {
734
+ currentRawResponse = rawResponse;
735
+ providedCallback?.(rawResponse, flatResponse);
736
+ };
737
+ const updatedArgs = {
738
+ ...args,
739
+ options: {
740
+ ...args.options,
741
+ onResponse: callback
742
+ }
743
+ };
744
+ const flatResponse = await directSendOperation(updatedArgs, spec);
745
+ return {
746
+ flatResponse,
747
+ rawResponse: {
748
+ statusCode: currentRawResponse!.status,
749
+ body: currentRawResponse!.parsedBody,
750
+ headers: currentRawResponse!.headers.toJSON()
751
+ }
752
+ };
753
+ };
754
+
755
+ const lro = new LroImpl(
756
+ sendOperation,
757
+ { resourceGroupName, commitmentPlanName, options },
758
+ deletePlanOperationSpec
759
+ );
760
+ const poller = new LroEngine(lro, {
761
+ resumeFrom: options?.resumeFrom,
762
+ intervalInMs: options?.updateIntervalInMs,
763
+ lroResourceLocationConfig: "location"
764
+ });
765
+ await poller.poll();
766
+ return poller;
767
+ }
768
+
769
+ /**
770
+ * Deletes a Cognitive Services commitment plan from the resource group.
771
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
772
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
773
+ * Account
774
+ * @param options The options parameters.
775
+ */
776
+ async beginDeletePlanAndWait(
777
+ resourceGroupName: string,
778
+ commitmentPlanName: string,
779
+ options?: CommitmentPlansDeletePlanOptionalParams
780
+ ): Promise<void> {
781
+ const poller = await this.beginDeletePlan(
782
+ resourceGroupName,
783
+ commitmentPlanName,
784
+ options
785
+ );
786
+ return poller.pollUntilDone();
787
+ }
788
+
789
+ /**
790
+ * Returns a Cognitive Services commitment plan specified by the parameters.
791
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
792
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
793
+ * Account
794
+ * @param options The options parameters.
795
+ */
796
+ getPlan(
797
+ resourceGroupName: string,
798
+ commitmentPlanName: string,
799
+ options?: CommitmentPlansGetPlanOptionalParams
800
+ ): Promise<CommitmentPlansGetPlanResponse> {
801
+ return this.client.sendOperationRequest(
802
+ { resourceGroupName, commitmentPlanName, options },
803
+ getPlanOperationSpec
804
+ );
805
+ }
806
+
807
+ /**
808
+ * Returns all the resources of a particular type belonging to a resource group
809
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
810
+ * @param options The options parameters.
811
+ */
812
+ private _listPlansByResourceGroup(
813
+ resourceGroupName: string,
814
+ options?: CommitmentPlansListPlansByResourceGroupOptionalParams
815
+ ): Promise<CommitmentPlansListPlansByResourceGroupResponse> {
816
+ return this.client.sendOperationRequest(
817
+ { resourceGroupName, options },
818
+ listPlansByResourceGroupOperationSpec
819
+ );
820
+ }
821
+
822
+ /**
823
+ * Returns all the resources of a particular type belonging to a subscription.
824
+ * @param options The options parameters.
825
+ */
826
+ private _listPlansBySubscription(
827
+ options?: CommitmentPlansListPlansBySubscriptionOptionalParams
828
+ ): Promise<CommitmentPlansListPlansBySubscriptionResponse> {
829
+ return this.client.sendOperationRequest(
830
+ { options },
831
+ listPlansBySubscriptionOperationSpec
832
+ );
833
+ }
834
+
835
+ /**
836
+ * Gets the associations of the Cognitive Services commitment plan.
837
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
838
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
839
+ * Account
840
+ * @param options The options parameters.
841
+ */
842
+ private _listAssociations(
843
+ resourceGroupName: string,
844
+ commitmentPlanName: string,
845
+ options?: CommitmentPlansListAssociationsOptionalParams
846
+ ): Promise<CommitmentPlansListAssociationsResponse> {
847
+ return this.client.sendOperationRequest(
848
+ { resourceGroupName, commitmentPlanName, options },
849
+ listAssociationsOperationSpec
850
+ );
851
+ }
852
+
853
+ /**
854
+ * Gets the association of the Cognitive Services commitment plan.
855
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
856
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
857
+ * Account
858
+ * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive
859
+ * Services Account
860
+ * @param options The options parameters.
861
+ */
862
+ getAssociation(
863
+ resourceGroupName: string,
864
+ commitmentPlanName: string,
865
+ commitmentPlanAssociationName: string,
866
+ options?: CommitmentPlansGetAssociationOptionalParams
867
+ ): Promise<CommitmentPlansGetAssociationResponse> {
868
+ return this.client.sendOperationRequest(
869
+ {
870
+ resourceGroupName,
871
+ commitmentPlanName,
872
+ commitmentPlanAssociationName,
873
+ options
874
+ },
875
+ getAssociationOperationSpec
876
+ );
877
+ }
878
+
879
+ /**
880
+ * Create or update the association of the Cognitive Services commitment plan.
881
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
882
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
883
+ * Account
884
+ * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive
885
+ * Services Account
886
+ * @param association The commitmentPlan properties.
887
+ * @param options The options parameters.
888
+ */
889
+ async beginCreateOrUpdateAssociation(
890
+ resourceGroupName: string,
891
+ commitmentPlanName: string,
892
+ commitmentPlanAssociationName: string,
893
+ association: CommitmentPlanAccountAssociation,
894
+ options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams
895
+ ): Promise<
896
+ PollerLike<
897
+ PollOperationState<CommitmentPlansCreateOrUpdateAssociationResponse>,
898
+ CommitmentPlansCreateOrUpdateAssociationResponse
899
+ >
900
+ > {
901
+ const directSendOperation = async (
902
+ args: coreClient.OperationArguments,
903
+ spec: coreClient.OperationSpec
904
+ ): Promise<CommitmentPlansCreateOrUpdateAssociationResponse> => {
905
+ return this.client.sendOperationRequest(args, spec);
906
+ };
907
+ const sendOperation = async (
908
+ args: coreClient.OperationArguments,
909
+ spec: coreClient.OperationSpec
910
+ ) => {
911
+ let currentRawResponse:
912
+ | coreClient.FullOperationResponse
913
+ | undefined = undefined;
914
+ const providedCallback = args.options?.onResponse;
915
+ const callback: coreClient.RawResponseCallback = (
916
+ rawResponse: coreClient.FullOperationResponse,
917
+ flatResponse: unknown
918
+ ) => {
919
+ currentRawResponse = rawResponse;
920
+ providedCallback?.(rawResponse, flatResponse);
921
+ };
922
+ const updatedArgs = {
923
+ ...args,
924
+ options: {
925
+ ...args.options,
926
+ onResponse: callback
927
+ }
928
+ };
929
+ const flatResponse = await directSendOperation(updatedArgs, spec);
930
+ return {
931
+ flatResponse,
932
+ rawResponse: {
933
+ statusCode: currentRawResponse!.status,
934
+ body: currentRawResponse!.parsedBody,
935
+ headers: currentRawResponse!.headers.toJSON()
936
+ }
937
+ };
938
+ };
939
+
940
+ const lro = new LroImpl(
941
+ sendOperation,
942
+ {
943
+ resourceGroupName,
944
+ commitmentPlanName,
945
+ commitmentPlanAssociationName,
946
+ association,
947
+ options
948
+ },
949
+ createOrUpdateAssociationOperationSpec
950
+ );
951
+ const poller = new LroEngine(lro, {
952
+ resumeFrom: options?.resumeFrom,
953
+ intervalInMs: options?.updateIntervalInMs,
954
+ lroResourceLocationConfig: "azure-async-operation"
955
+ });
956
+ await poller.poll();
957
+ return poller;
958
+ }
959
+
960
+ /**
961
+ * Create or update the association of the Cognitive Services commitment plan.
962
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
963
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
964
+ * Account
965
+ * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive
966
+ * Services Account
967
+ * @param association The commitmentPlan properties.
968
+ * @param options The options parameters.
969
+ */
970
+ async beginCreateOrUpdateAssociationAndWait(
971
+ resourceGroupName: string,
972
+ commitmentPlanName: string,
973
+ commitmentPlanAssociationName: string,
974
+ association: CommitmentPlanAccountAssociation,
975
+ options?: CommitmentPlansCreateOrUpdateAssociationOptionalParams
976
+ ): Promise<CommitmentPlansCreateOrUpdateAssociationResponse> {
977
+ const poller = await this.beginCreateOrUpdateAssociation(
978
+ resourceGroupName,
979
+ commitmentPlanName,
980
+ commitmentPlanAssociationName,
981
+ association,
982
+ options
983
+ );
984
+ return poller.pollUntilDone();
985
+ }
986
+
987
+ /**
988
+ * Deletes the association of the Cognitive Services commitment plan.
989
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
990
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
991
+ * Account
992
+ * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive
993
+ * Services Account
994
+ * @param options The options parameters.
995
+ */
996
+ async beginDeleteAssociation(
997
+ resourceGroupName: string,
998
+ commitmentPlanName: string,
999
+ commitmentPlanAssociationName: string,
1000
+ options?: CommitmentPlansDeleteAssociationOptionalParams
1001
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
1002
+ const directSendOperation = async (
1003
+ args: coreClient.OperationArguments,
1004
+ spec: coreClient.OperationSpec
1005
+ ): Promise<void> => {
1006
+ return this.client.sendOperationRequest(args, spec);
1007
+ };
1008
+ const sendOperation = async (
1009
+ args: coreClient.OperationArguments,
1010
+ spec: coreClient.OperationSpec
1011
+ ) => {
1012
+ let currentRawResponse:
1013
+ | coreClient.FullOperationResponse
1014
+ | undefined = undefined;
1015
+ const providedCallback = args.options?.onResponse;
1016
+ const callback: coreClient.RawResponseCallback = (
1017
+ rawResponse: coreClient.FullOperationResponse,
1018
+ flatResponse: unknown
1019
+ ) => {
1020
+ currentRawResponse = rawResponse;
1021
+ providedCallback?.(rawResponse, flatResponse);
1022
+ };
1023
+ const updatedArgs = {
1024
+ ...args,
1025
+ options: {
1026
+ ...args.options,
1027
+ onResponse: callback
1028
+ }
1029
+ };
1030
+ const flatResponse = await directSendOperation(updatedArgs, spec);
1031
+ return {
1032
+ flatResponse,
1033
+ rawResponse: {
1034
+ statusCode: currentRawResponse!.status,
1035
+ body: currentRawResponse!.parsedBody,
1036
+ headers: currentRawResponse!.headers.toJSON()
1037
+ }
1038
+ };
1039
+ };
1040
+
1041
+ const lro = new LroImpl(
1042
+ sendOperation,
1043
+ {
1044
+ resourceGroupName,
1045
+ commitmentPlanName,
1046
+ commitmentPlanAssociationName,
1047
+ options
1048
+ },
1049
+ deleteAssociationOperationSpec
1050
+ );
1051
+ const poller = new LroEngine(lro, {
1052
+ resumeFrom: options?.resumeFrom,
1053
+ intervalInMs: options?.updateIntervalInMs,
1054
+ lroResourceLocationConfig: "location"
1055
+ });
1056
+ await poller.poll();
1057
+ return poller;
1058
+ }
1059
+
1060
+ /**
1061
+ * Deletes the association of the Cognitive Services commitment plan.
1062
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1063
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
1064
+ * Account
1065
+ * @param commitmentPlanAssociationName The name of the commitment plan association with the Cognitive
1066
+ * Services Account
1067
+ * @param options The options parameters.
1068
+ */
1069
+ async beginDeleteAssociationAndWait(
1070
+ resourceGroupName: string,
1071
+ commitmentPlanName: string,
1072
+ commitmentPlanAssociationName: string,
1073
+ options?: CommitmentPlansDeleteAssociationOptionalParams
1074
+ ): Promise<void> {
1075
+ const poller = await this.beginDeleteAssociation(
1076
+ resourceGroupName,
1077
+ commitmentPlanName,
1078
+ commitmentPlanAssociationName,
1079
+ options
1080
+ );
1081
+ return poller.pollUntilDone();
1082
+ }
1083
+
1084
+ /**
1085
+ * ListNext
1086
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1087
+ * @param accountName The name of Cognitive Services account.
1088
+ * @param nextLink The nextLink from the previous successful call to the List method.
1089
+ * @param options The options parameters.
1090
+ */
1091
+ private _listNext(
1092
+ resourceGroupName: string,
1093
+ accountName: string,
1094
+ nextLink: string,
1095
+ options?: CommitmentPlansListNextOptionalParams
1096
+ ): Promise<CommitmentPlansListNextResponse> {
1097
+ return this.client.sendOperationRequest(
1098
+ { resourceGroupName, accountName, nextLink, options },
1099
+ listNextOperationSpec
1100
+ );
1101
+ }
1102
+
1103
+ /**
1104
+ * ListPlansByResourceGroupNext
1105
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1106
+ * @param nextLink The nextLink from the previous successful call to the ListPlansByResourceGroup
1107
+ * method.
1108
+ * @param options The options parameters.
1109
+ */
1110
+ private _listPlansByResourceGroupNext(
1111
+ resourceGroupName: string,
1112
+ nextLink: string,
1113
+ options?: CommitmentPlansListPlansByResourceGroupNextOptionalParams
1114
+ ): Promise<CommitmentPlansListPlansByResourceGroupNextResponse> {
1115
+ return this.client.sendOperationRequest(
1116
+ { resourceGroupName, nextLink, options },
1117
+ listPlansByResourceGroupNextOperationSpec
1118
+ );
1119
+ }
1120
+
1121
+ /**
1122
+ * ListPlansBySubscriptionNext
1123
+ * @param nextLink The nextLink from the previous successful call to the ListPlansBySubscription
1124
+ * method.
1125
+ * @param options The options parameters.
1126
+ */
1127
+ private _listPlansBySubscriptionNext(
1128
+ nextLink: string,
1129
+ options?: CommitmentPlansListPlansBySubscriptionNextOptionalParams
1130
+ ): Promise<CommitmentPlansListPlansBySubscriptionNextResponse> {
1131
+ return this.client.sendOperationRequest(
1132
+ { nextLink, options },
1133
+ listPlansBySubscriptionNextOperationSpec
1134
+ );
1135
+ }
1136
+
1137
+ /**
1138
+ * ListAssociationsNext
1139
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
1140
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
1141
+ * Account
1142
+ * @param nextLink The nextLink from the previous successful call to the ListAssociations method.
1143
+ * @param options The options parameters.
1144
+ */
1145
+ private _listAssociationsNext(
1146
+ resourceGroupName: string,
1147
+ commitmentPlanName: string,
1148
+ nextLink: string,
1149
+ options?: CommitmentPlansListAssociationsNextOptionalParams
1150
+ ): Promise<CommitmentPlansListAssociationsNextResponse> {
1151
+ return this.client.sendOperationRequest(
1152
+ { resourceGroupName, commitmentPlanName, nextLink, options },
1153
+ listAssociationsNextOperationSpec
1154
+ );
1155
+ }
1156
+ }
1157
+ // Operation Specifications
1158
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
1159
+
1160
+ const listOperationSpec: coreClient.OperationSpec = {
1161
+ path:
1162
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans",
1163
+ httpMethod: "GET",
1164
+ responses: {
1165
+ 200: {
1166
+ bodyMapper: Mappers.CommitmentPlanListResult
1167
+ },
1168
+ default: {
1169
+ bodyMapper: Mappers.ErrorResponse
1170
+ }
1171
+ },
1172
+ queryParameters: [Parameters.apiVersion],
1173
+ urlParameters: [
1174
+ Parameters.$host,
1175
+ Parameters.resourceGroupName,
1176
+ Parameters.accountName,
1177
+ Parameters.subscriptionId
1178
+ ],
1179
+ headerParameters: [Parameters.accept],
1180
+ serializer
1181
+ };
318
1182
  const getOperationSpec: coreClient.OperationSpec = {
319
1183
  path:
320
1184
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}",
321
- httpMethod: "GET",
1185
+ httpMethod: "GET",
1186
+ responses: {
1187
+ 200: {
1188
+ bodyMapper: Mappers.CommitmentPlan
1189
+ },
1190
+ default: {
1191
+ bodyMapper: Mappers.ErrorResponse
1192
+ }
1193
+ },
1194
+ queryParameters: [Parameters.apiVersion],
1195
+ urlParameters: [
1196
+ Parameters.$host,
1197
+ Parameters.resourceGroupName,
1198
+ Parameters.accountName,
1199
+ Parameters.subscriptionId,
1200
+ Parameters.commitmentPlanName
1201
+ ],
1202
+ headerParameters: [Parameters.accept],
1203
+ serializer
1204
+ };
1205
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
1206
+ path:
1207
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}",
1208
+ httpMethod: "PUT",
322
1209
  responses: {
323
1210
  200: {
324
1211
  bodyMapper: Mappers.CommitmentPlan
325
1212
  },
1213
+ 201: {
1214
+ bodyMapper: Mappers.CommitmentPlan
1215
+ },
326
1216
  default: {
327
1217
  bodyMapper: Mappers.ErrorResponse
328
1218
  }
329
1219
  },
1220
+ requestBody: Parameters.commitmentPlan,
330
1221
  queryParameters: [Parameters.apiVersion],
331
1222
  urlParameters: [
332
1223
  Parameters.$host,
@@ -335,12 +1226,37 @@ const getOperationSpec: coreClient.OperationSpec = {
335
1226
  Parameters.subscriptionId,
336
1227
  Parameters.commitmentPlanName
337
1228
  ],
338
- headerParameters: [Parameters.accept],
1229
+ headerParameters: [Parameters.contentType, Parameters.accept],
1230
+ mediaType: "json",
339
1231
  serializer
340
1232
  };
341
- const createOrUpdateOperationSpec: coreClient.OperationSpec = {
1233
+ const deleteOperationSpec: coreClient.OperationSpec = {
342
1234
  path:
343
1235
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}",
1236
+ httpMethod: "DELETE",
1237
+ responses: {
1238
+ 200: {},
1239
+ 201: {},
1240
+ 202: {},
1241
+ 204: {},
1242
+ default: {
1243
+ bodyMapper: Mappers.ErrorResponse
1244
+ }
1245
+ },
1246
+ queryParameters: [Parameters.apiVersion],
1247
+ urlParameters: [
1248
+ Parameters.$host,
1249
+ Parameters.resourceGroupName,
1250
+ Parameters.accountName,
1251
+ Parameters.subscriptionId,
1252
+ Parameters.commitmentPlanName
1253
+ ],
1254
+ headerParameters: [Parameters.accept],
1255
+ serializer
1256
+ };
1257
+ const createOrUpdatePlanOperationSpec: coreClient.OperationSpec = {
1258
+ path:
1259
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}",
344
1260
  httpMethod: "PUT",
345
1261
  responses: {
346
1262
  200: {
@@ -349,6 +1265,12 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
349
1265
  201: {
350
1266
  bodyMapper: Mappers.CommitmentPlan
351
1267
  },
1268
+ 202: {
1269
+ bodyMapper: Mappers.CommitmentPlan
1270
+ },
1271
+ 204: {
1272
+ bodyMapper: Mappers.CommitmentPlan
1273
+ },
352
1274
  default: {
353
1275
  bodyMapper: Mappers.ErrorResponse
354
1276
  }
@@ -358,17 +1280,49 @@ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
358
1280
  urlParameters: [
359
1281
  Parameters.$host,
360
1282
  Parameters.resourceGroupName,
361
- Parameters.accountName,
362
1283
  Parameters.subscriptionId,
363
- Parameters.commitmentPlanName
1284
+ Parameters.commitmentPlanName1
364
1285
  ],
365
1286
  headerParameters: [Parameters.contentType, Parameters.accept],
366
1287
  mediaType: "json",
367
1288
  serializer
368
1289
  };
369
- const deleteOperationSpec: coreClient.OperationSpec = {
1290
+ const updatePlanOperationSpec: coreClient.OperationSpec = {
370
1291
  path:
371
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/commitmentPlans/{commitmentPlanName}",
1292
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}",
1293
+ httpMethod: "PATCH",
1294
+ responses: {
1295
+ 200: {
1296
+ bodyMapper: Mappers.CommitmentPlan
1297
+ },
1298
+ 201: {
1299
+ bodyMapper: Mappers.CommitmentPlan
1300
+ },
1301
+ 202: {
1302
+ bodyMapper: Mappers.CommitmentPlan
1303
+ },
1304
+ 204: {
1305
+ bodyMapper: Mappers.CommitmentPlan
1306
+ },
1307
+ default: {
1308
+ bodyMapper: Mappers.ErrorResponse
1309
+ }
1310
+ },
1311
+ requestBody: Parameters.commitmentPlan1,
1312
+ queryParameters: [Parameters.apiVersion],
1313
+ urlParameters: [
1314
+ Parameters.$host,
1315
+ Parameters.resourceGroupName,
1316
+ Parameters.subscriptionId,
1317
+ Parameters.commitmentPlanName1
1318
+ ],
1319
+ headerParameters: [Parameters.contentType, Parameters.accept],
1320
+ mediaType: "json",
1321
+ serializer
1322
+ };
1323
+ const deletePlanOperationSpec: coreClient.OperationSpec = {
1324
+ path:
1325
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}",
372
1326
  httpMethod: "DELETE",
373
1327
  responses: {
374
1328
  200: {},
@@ -383,9 +1337,171 @@ const deleteOperationSpec: coreClient.OperationSpec = {
383
1337
  urlParameters: [
384
1338
  Parameters.$host,
385
1339
  Parameters.resourceGroupName,
386
- Parameters.accountName,
387
1340
  Parameters.subscriptionId,
388
- Parameters.commitmentPlanName
1341
+ Parameters.commitmentPlanName1
1342
+ ],
1343
+ headerParameters: [Parameters.accept],
1344
+ serializer
1345
+ };
1346
+ const getPlanOperationSpec: coreClient.OperationSpec = {
1347
+ path:
1348
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}",
1349
+ httpMethod: "GET",
1350
+ responses: {
1351
+ 200: {
1352
+ bodyMapper: Mappers.CommitmentPlan
1353
+ },
1354
+ default: {
1355
+ bodyMapper: Mappers.ErrorResponse
1356
+ }
1357
+ },
1358
+ queryParameters: [Parameters.apiVersion],
1359
+ urlParameters: [
1360
+ Parameters.$host,
1361
+ Parameters.resourceGroupName,
1362
+ Parameters.subscriptionId,
1363
+ Parameters.commitmentPlanName1
1364
+ ],
1365
+ headerParameters: [Parameters.accept],
1366
+ serializer
1367
+ };
1368
+ const listPlansByResourceGroupOperationSpec: coreClient.OperationSpec = {
1369
+ path:
1370
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans",
1371
+ httpMethod: "GET",
1372
+ responses: {
1373
+ 200: {
1374
+ bodyMapper: Mappers.CommitmentPlanListResult
1375
+ },
1376
+ default: {
1377
+ bodyMapper: Mappers.ErrorResponse
1378
+ }
1379
+ },
1380
+ queryParameters: [Parameters.apiVersion],
1381
+ urlParameters: [
1382
+ Parameters.$host,
1383
+ Parameters.resourceGroupName,
1384
+ Parameters.subscriptionId
1385
+ ],
1386
+ headerParameters: [Parameters.accept],
1387
+ serializer
1388
+ };
1389
+ const listPlansBySubscriptionOperationSpec: coreClient.OperationSpec = {
1390
+ path:
1391
+ "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/commitmentPlans",
1392
+ httpMethod: "GET",
1393
+ responses: {
1394
+ 200: {
1395
+ bodyMapper: Mappers.CommitmentPlanListResult
1396
+ },
1397
+ default: {
1398
+ bodyMapper: Mappers.ErrorResponse
1399
+ }
1400
+ },
1401
+ queryParameters: [Parameters.apiVersion],
1402
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
1403
+ headerParameters: [Parameters.accept],
1404
+ serializer
1405
+ };
1406
+ const listAssociationsOperationSpec: coreClient.OperationSpec = {
1407
+ path:
1408
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations",
1409
+ httpMethod: "GET",
1410
+ responses: {
1411
+ 200: {
1412
+ bodyMapper: Mappers.CommitmentPlanAccountAssociationListResult
1413
+ },
1414
+ default: {
1415
+ bodyMapper: Mappers.ErrorResponse
1416
+ }
1417
+ },
1418
+ queryParameters: [Parameters.apiVersion],
1419
+ urlParameters: [
1420
+ Parameters.$host,
1421
+ Parameters.resourceGroupName,
1422
+ Parameters.subscriptionId,
1423
+ Parameters.commitmentPlanName1
1424
+ ],
1425
+ headerParameters: [Parameters.accept],
1426
+ serializer
1427
+ };
1428
+ const getAssociationOperationSpec: coreClient.OperationSpec = {
1429
+ path:
1430
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}",
1431
+ httpMethod: "GET",
1432
+ responses: {
1433
+ 200: {
1434
+ bodyMapper: Mappers.CommitmentPlanAccountAssociation
1435
+ },
1436
+ default: {
1437
+ bodyMapper: Mappers.ErrorResponse
1438
+ }
1439
+ },
1440
+ queryParameters: [Parameters.apiVersion],
1441
+ urlParameters: [
1442
+ Parameters.$host,
1443
+ Parameters.resourceGroupName,
1444
+ Parameters.subscriptionId,
1445
+ Parameters.commitmentPlanName1,
1446
+ Parameters.commitmentPlanAssociationName
1447
+ ],
1448
+ headerParameters: [Parameters.accept],
1449
+ serializer
1450
+ };
1451
+ const createOrUpdateAssociationOperationSpec: coreClient.OperationSpec = {
1452
+ path:
1453
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}",
1454
+ httpMethod: "PUT",
1455
+ responses: {
1456
+ 200: {
1457
+ bodyMapper: Mappers.CommitmentPlanAccountAssociation
1458
+ },
1459
+ 201: {
1460
+ bodyMapper: Mappers.CommitmentPlanAccountAssociation
1461
+ },
1462
+ 202: {
1463
+ bodyMapper: Mappers.CommitmentPlanAccountAssociation
1464
+ },
1465
+ 204: {
1466
+ bodyMapper: Mappers.CommitmentPlanAccountAssociation
1467
+ },
1468
+ default: {
1469
+ bodyMapper: Mappers.ErrorResponse
1470
+ }
1471
+ },
1472
+ requestBody: Parameters.association,
1473
+ queryParameters: [Parameters.apiVersion],
1474
+ urlParameters: [
1475
+ Parameters.$host,
1476
+ Parameters.resourceGroupName,
1477
+ Parameters.subscriptionId,
1478
+ Parameters.commitmentPlanName1,
1479
+ Parameters.commitmentPlanAssociationName
1480
+ ],
1481
+ headerParameters: [Parameters.contentType, Parameters.accept],
1482
+ mediaType: "json",
1483
+ serializer
1484
+ };
1485
+ const deleteAssociationOperationSpec: coreClient.OperationSpec = {
1486
+ path:
1487
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/commitmentPlans/{commitmentPlanName}/accountAssociations/{commitmentPlanAssociationName}",
1488
+ httpMethod: "DELETE",
1489
+ responses: {
1490
+ 200: {},
1491
+ 201: {},
1492
+ 202: {},
1493
+ 204: {},
1494
+ default: {
1495
+ bodyMapper: Mappers.ErrorResponse
1496
+ }
1497
+ },
1498
+ queryParameters: [Parameters.apiVersion],
1499
+ urlParameters: [
1500
+ Parameters.$host,
1501
+ Parameters.resourceGroupName,
1502
+ Parameters.subscriptionId,
1503
+ Parameters.commitmentPlanName1,
1504
+ Parameters.commitmentPlanAssociationName
389
1505
  ],
390
1506
  headerParameters: [Parameters.accept],
391
1507
  serializer
@@ -401,7 +1517,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
401
1517
  bodyMapper: Mappers.ErrorResponse
402
1518
  }
403
1519
  },
404
- queryParameters: [Parameters.apiVersion],
405
1520
  urlParameters: [
406
1521
  Parameters.$host,
407
1522
  Parameters.resourceGroupName,
@@ -412,3 +1527,63 @@ const listNextOperationSpec: coreClient.OperationSpec = {
412
1527
  headerParameters: [Parameters.accept],
413
1528
  serializer
414
1529
  };
1530
+ const listPlansByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
1531
+ path: "{nextLink}",
1532
+ httpMethod: "GET",
1533
+ responses: {
1534
+ 200: {
1535
+ bodyMapper: Mappers.CommitmentPlanListResult
1536
+ },
1537
+ default: {
1538
+ bodyMapper: Mappers.ErrorResponse
1539
+ }
1540
+ },
1541
+ urlParameters: [
1542
+ Parameters.$host,
1543
+ Parameters.resourceGroupName,
1544
+ Parameters.subscriptionId,
1545
+ Parameters.nextLink
1546
+ ],
1547
+ headerParameters: [Parameters.accept],
1548
+ serializer
1549
+ };
1550
+ const listPlansBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
1551
+ path: "{nextLink}",
1552
+ httpMethod: "GET",
1553
+ responses: {
1554
+ 200: {
1555
+ bodyMapper: Mappers.CommitmentPlanListResult
1556
+ },
1557
+ default: {
1558
+ bodyMapper: Mappers.ErrorResponse
1559
+ }
1560
+ },
1561
+ urlParameters: [
1562
+ Parameters.$host,
1563
+ Parameters.subscriptionId,
1564
+ Parameters.nextLink
1565
+ ],
1566
+ headerParameters: [Parameters.accept],
1567
+ serializer
1568
+ };
1569
+ const listAssociationsNextOperationSpec: coreClient.OperationSpec = {
1570
+ path: "{nextLink}",
1571
+ httpMethod: "GET",
1572
+ responses: {
1573
+ 200: {
1574
+ bodyMapper: Mappers.CommitmentPlanAccountAssociationListResult
1575
+ },
1576
+ default: {
1577
+ bodyMapper: Mappers.ErrorResponse
1578
+ }
1579
+ },
1580
+ urlParameters: [
1581
+ Parameters.$host,
1582
+ Parameters.resourceGroupName,
1583
+ Parameters.subscriptionId,
1584
+ Parameters.nextLink,
1585
+ Parameters.commitmentPlanName1
1586
+ ],
1587
+ headerParameters: [Parameters.accept],
1588
+ serializer
1589
+ };