@azure/arm-cognitiveservices 5.2.0 → 7.0.0-alpha.20211202.3

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 (218) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +72 -77
  4. package/dist/index.js +4800 -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/cognitiveServicesManagementClient.d.ts +42 -0
  9. package/dist-esm/src/cognitiveServicesManagementClient.d.ts.map +1 -0
  10. package/dist-esm/src/cognitiveServicesManagementClient.js +133 -0
  11. package/dist-esm/src/cognitiveServicesManagementClient.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/lroImpl.d.ts +16 -0
  17. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  18. package/dist-esm/src/lroImpl.js +29 -0
  19. package/dist-esm/src/lroImpl.js.map +1 -0
  20. package/dist-esm/src/models/index.d.ts +1310 -0
  21. package/dist-esm/src/models/index.d.ts.map +1 -0
  22. package/dist-esm/src/models/index.js +128 -0
  23. package/dist-esm/src/models/index.js.map +1 -0
  24. package/dist-esm/src/models/mappers.d.ts +68 -0
  25. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  26. package/{esm → dist-esm/src}/models/mappers.js +1474 -738
  27. package/dist-esm/src/models/mappers.js.map +1 -0
  28. package/dist-esm/src/models/parameters.d.ts +26 -0
  29. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  30. package/dist-esm/src/models/parameters.js +199 -0
  31. package/dist-esm/src/models/parameters.js.map +1 -0
  32. package/dist-esm/src/operations/accounts.d.ts +138 -0
  33. package/dist-esm/src/operations/accounts.d.ts.map +1 -0
  34. package/dist-esm/src/operations/accounts.js +628 -0
  35. package/dist-esm/src/operations/accounts.js.map +1 -0
  36. package/dist-esm/src/operations/commitmentPlans.d.ts +76 -0
  37. package/dist-esm/src/operations/commitmentPlans.d.ts.map +1 -0
  38. package/dist-esm/src/operations/commitmentPlans.js +293 -0
  39. package/dist-esm/src/operations/commitmentPlans.js.map +1 -0
  40. package/dist-esm/src/operations/commitmentTiers.d.ts +35 -0
  41. package/dist-esm/src/operations/commitmentTiers.d.ts.map +1 -0
  42. package/dist-esm/src/operations/commitmentTiers.js +132 -0
  43. package/dist-esm/src/operations/commitmentTiers.js.map +1 -0
  44. package/dist-esm/src/operations/deletedAccounts.d.ts +57 -0
  45. package/dist-esm/src/operations/deletedAccounts.d.ts.map +1 -0
  46. package/dist-esm/src/operations/deletedAccounts.js +232 -0
  47. package/dist-esm/src/operations/deletedAccounts.js.map +1 -0
  48. package/dist-esm/src/operations/deployments.d.ts +81 -0
  49. package/dist-esm/src/operations/deployments.d.ts.map +1 -0
  50. package/dist-esm/src/operations/deployments.js +331 -0
  51. package/dist-esm/src/operations/deployments.js.map +1 -0
  52. package/{esm → dist-esm/src}/operations/index.d.ts +4 -0
  53. package/dist-esm/src/operations/index.d.ts.map +1 -0
  54. package/dist-esm/src/operations/index.js +17 -0
  55. package/dist-esm/src/operations/index.js.map +1 -0
  56. package/dist-esm/src/operations/operations.d.ts +32 -0
  57. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  58. package/dist-esm/src/operations/operations.js +120 -0
  59. package/dist-esm/src/operations/operations.js.map +1 -0
  60. package/dist-esm/src/operations/privateEndpointConnections.d.ts +70 -0
  61. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -0
  62. package/dist-esm/src/operations/privateEndpointConnections.js +271 -0
  63. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -0
  64. package/dist-esm/src/operations/privateLinkResources.d.ts +20 -0
  65. package/dist-esm/src/operations/privateLinkResources.d.ts.map +1 -0
  66. package/dist-esm/src/operations/privateLinkResources.js +53 -0
  67. package/dist-esm/src/operations/privateLinkResources.js.map +1 -0
  68. package/dist-esm/src/operations/resourceSkus.d.ts +32 -0
  69. package/dist-esm/src/operations/resourceSkus.d.ts.map +1 -0
  70. package/dist-esm/src/operations/resourceSkus.js +124 -0
  71. package/dist-esm/src/operations/resourceSkus.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/accounts.d.ts +102 -0
  73. package/dist-esm/src/operationsInterfaces/accounts.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/accounts.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/accounts.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts +51 -0
  77. package/dist-esm/src/operationsInterfaces/commitmentPlans.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/commitmentPlans.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/commitmentPlans.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/commitmentTiers.d.ts +12 -0
  81. package/dist-esm/src/operationsInterfaces/commitmentTiers.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/commitmentTiers.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/commitmentTiers.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/deletedAccounts.d.ts +36 -0
  85. package/dist-esm/src/operationsInterfaces/deletedAccounts.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/deletedAccounts.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/deletedAccounts.js.map +1 -0
  88. package/dist-esm/src/operationsInterfaces/deployments.d.ts +56 -0
  89. package/dist-esm/src/operationsInterfaces/deployments.d.ts.map +1 -0
  90. package/dist-esm/src/operationsInterfaces/deployments.js +9 -0
  91. package/dist-esm/src/operationsInterfaces/deployments.js.map +1 -0
  92. package/dist-esm/src/operationsInterfaces/index.d.ts +10 -0
  93. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  94. package/dist-esm/src/operationsInterfaces/index.js +17 -0
  95. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  96. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  97. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  98. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  99. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  100. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +62 -0
  101. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts.map +1 -0
  102. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js +9 -0
  103. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.js.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts +12 -0
  105. package/dist-esm/src/operationsInterfaces/privateLinkResources.d.ts.map +1 -0
  106. package/dist-esm/src/operationsInterfaces/privateLinkResources.js +9 -0
  107. package/dist-esm/src/operationsInterfaces/privateLinkResources.js.map +1 -0
  108. package/dist-esm/src/operationsInterfaces/resourceSkus.d.ts +11 -0
  109. package/dist-esm/src/operationsInterfaces/resourceSkus.d.ts.map +1 -0
  110. package/dist-esm/src/operationsInterfaces/resourceSkus.js +9 -0
  111. package/dist-esm/src/operationsInterfaces/resourceSkus.js.map +1 -0
  112. package/dist-esm/test/cognitiveservices_examples.d.ts +4 -0
  113. package/dist-esm/test/cognitiveservices_examples.d.ts.map +1 -0
  114. package/dist-esm/test/cognitiveservices_examples.js +127 -0
  115. package/dist-esm/test/cognitiveservices_examples.js.map +1 -0
  116. package/package.json +65 -21
  117. package/review/arm-cognitiveservices.api.md +1150 -0
  118. package/rollup.config.js +181 -30
  119. package/src/cognitiveServicesManagementClient.ts +163 -142
  120. package/src/index.ts +12 -0
  121. package/src/lroImpl.ts +34 -0
  122. package/src/models/index.ts +1223 -1103
  123. package/src/models/mappers.ts +1513 -736
  124. package/src/models/parameters.ts +162 -47
  125. package/src/operations/accounts.ts +610 -495
  126. package/src/operations/commitmentPlans.ts +394 -0
  127. package/src/operations/commitmentTiers.ts +158 -0
  128. package/src/operations/deletedAccounts.ts +298 -0
  129. package/src/operations/deployments.ts +464 -0
  130. package/src/operations/index.ts +7 -5
  131. package/src/operations/operations.ts +91 -77
  132. package/src/operations/privateEndpointConnections.ts +281 -134
  133. package/src/operations/privateLinkResources.ts +40 -55
  134. package/src/operations/resourceSkus.ts +96 -80
  135. package/src/operationsInterfaces/accounts.ts +195 -0
  136. package/src/operationsInterfaces/commitmentPlans.ts +93 -0
  137. package/src/operationsInterfaces/commitmentTiers.ts +24 -0
  138. package/src/operationsInterfaces/deletedAccounts.ts +68 -0
  139. package/src/operationsInterfaces/deployments.ts +109 -0
  140. package/{esm/operations/index.js → src/operationsInterfaces/index.ts} +8 -6
  141. package/src/operationsInterfaces/operations.ts +22 -0
  142. package/src/operationsInterfaces/privateEndpointConnections.ts +115 -0
  143. package/src/operationsInterfaces/privateLinkResources.ts +27 -0
  144. package/src/operationsInterfaces/resourceSkus.ts +22 -0
  145. package/tsconfig.json +3 -3
  146. package/types/arm-cognitiveservices.d.ts +1860 -0
  147. package/types/tsdoc-metadata.json +11 -0
  148. package/dist/arm-cognitiveservices.js +0 -2719
  149. package/dist/arm-cognitiveservices.js.map +0 -1
  150. package/dist/arm-cognitiveservices.min.js +0 -1
  151. package/dist/arm-cognitiveservices.min.js.map +0 -1
  152. package/esm/cognitiveServicesManagementClient.d.ts +0 -70
  153. package/esm/cognitiveServicesManagementClient.d.ts.map +0 -1
  154. package/esm/cognitiveServicesManagementClient.js +0 -116
  155. package/esm/cognitiveServicesManagementClient.js.map +0 -1
  156. package/esm/cognitiveServicesManagementClientContext.d.ts +0 -16
  157. package/esm/cognitiveServicesManagementClientContext.d.ts.map +0 -1
  158. package/esm/cognitiveServicesManagementClientContext.js +0 -56
  159. package/esm/cognitiveServicesManagementClientContext.js.map +0 -1
  160. package/esm/models/accountsMappers.d.ts +0 -2
  161. package/esm/models/accountsMappers.d.ts.map +0 -1
  162. package/esm/models/accountsMappers.js +0 -9
  163. package/esm/models/accountsMappers.js.map +0 -1
  164. package/esm/models/index.d.ts +0 -1277
  165. package/esm/models/index.d.ts.map +0 -1
  166. package/esm/models/index.js +0 -8
  167. package/esm/models/index.js.map +0 -1
  168. package/esm/models/mappers.d.ts +0 -50
  169. package/esm/models/mappers.d.ts.map +0 -1
  170. package/esm/models/mappers.js.map +0 -1
  171. package/esm/models/operationsMappers.d.ts +0 -2
  172. package/esm/models/operationsMappers.d.ts.map +0 -1
  173. package/esm/models/operationsMappers.js +0 -9
  174. package/esm/models/operationsMappers.js.map +0 -1
  175. package/esm/models/parameters.d.ts +0 -11
  176. package/esm/models/parameters.d.ts.map +0 -1
  177. package/esm/models/parameters.js +0 -119
  178. package/esm/models/parameters.js.map +0 -1
  179. package/esm/models/privateEndpointConnectionsMappers.d.ts +0 -2
  180. package/esm/models/privateEndpointConnectionsMappers.d.ts.map +0 -1
  181. package/esm/models/privateEndpointConnectionsMappers.js +0 -9
  182. package/esm/models/privateEndpointConnectionsMappers.js.map +0 -1
  183. package/esm/models/privateLinkResourcesMappers.d.ts +0 -2
  184. package/esm/models/privateLinkResourcesMappers.d.ts.map +0 -1
  185. package/esm/models/privateLinkResourcesMappers.js +0 -9
  186. package/esm/models/privateLinkResourcesMappers.js.map +0 -1
  187. package/esm/models/resourceSkusMappers.d.ts +0 -2
  188. package/esm/models/resourceSkusMappers.d.ts.map +0 -1
  189. package/esm/models/resourceSkusMappers.js +0 -9
  190. package/esm/models/resourceSkusMappers.js.map +0 -1
  191. package/esm/operations/accounts.d.ts +0 -260
  192. package/esm/operations/accounts.d.ts.map +0 -1
  193. package/esm/operations/accounts.js +0 -411
  194. package/esm/operations/accounts.js.map +0 -1
  195. package/esm/operations/index.d.ts.map +0 -1
  196. package/esm/operations/index.js.map +0 -1
  197. package/esm/operations/operations.d.ts +0 -46
  198. package/esm/operations/operations.d.ts.map +0 -1
  199. package/esm/operations/operations.js +0 -77
  200. package/esm/operations/operations.js.map +0 -1
  201. package/esm/operations/privateEndpointConnections.d.ts +0 -99
  202. package/esm/operations/privateEndpointConnections.d.ts.map +0 -1
  203. package/esm/operations/privateEndpointConnections.js +0 -131
  204. package/esm/operations/privateEndpointConnections.js.map +0 -1
  205. package/esm/operations/privateLinkResources.d.ts +0 -34
  206. package/esm/operations/privateLinkResources.d.ts.map +0 -1
  207. package/esm/operations/privateLinkResources.js +0 -58
  208. package/esm/operations/privateLinkResources.js.map +0 -1
  209. package/esm/operations/resourceSkus.d.ts +0 -46
  210. package/esm/operations/resourceSkus.d.ts.map +0 -1
  211. package/esm/operations/resourceSkus.js +0 -80
  212. package/esm/operations/resourceSkus.js.map +0 -1
  213. package/src/cognitiveServicesManagementClientContext.ts +0 -62
  214. package/src/models/accountsMappers.ts +0 -44
  215. package/src/models/operationsMappers.ts +0 -14
  216. package/src/models/privateEndpointConnectionsMappers.ts +0 -35
  217. package/src/models/privateLinkResourcesMappers.ts +0 -36
  218. package/src/models/resourceSkusMappers.ts +0 -15
@@ -1,729 +1,844 @@
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/accountsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Accounts } 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 { CognitiveServicesManagementClientContext } from "../cognitiveServicesManagementClientContext";
14
+ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient";
15
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
16
+ import { LroImpl } from "../lroImpl";
17
+ import {
18
+ Account,
19
+ AccountsListByResourceGroupNextOptionalParams,
20
+ AccountsListByResourceGroupOptionalParams,
21
+ AccountsListNextOptionalParams,
22
+ AccountsListOptionalParams,
23
+ AccountsCreateOptionalParams,
24
+ AccountsCreateResponse,
25
+ AccountsUpdateOptionalParams,
26
+ AccountsUpdateResponse,
27
+ AccountsDeleteOptionalParams,
28
+ AccountsGetOptionalParams,
29
+ AccountsGetResponse,
30
+ AccountsListByResourceGroupResponse,
31
+ AccountsListResponse,
32
+ AccountsListKeysOptionalParams,
33
+ AccountsListKeysResponse,
34
+ KeyName,
35
+ AccountsRegenerateKeyOptionalParams,
36
+ AccountsRegenerateKeyResponse,
37
+ AccountsListSkusOptionalParams,
38
+ AccountsListSkusResponse,
39
+ AccountsListUsagesOptionalParams,
40
+ AccountsListUsagesResponse,
41
+ AccountsListByResourceGroupNextResponse,
42
+ AccountsListNextResponse
43
+ } from "../models";
16
44
 
17
- /** Class representing a Accounts. */
18
- export class Accounts {
19
- private readonly client: CognitiveServicesManagementClientContext;
45
+ /// <reference lib="esnext.asynciterable" />
46
+ /** Class containing Accounts operations. */
47
+ export class AccountsImpl implements Accounts {
48
+ private readonly client: CognitiveServicesManagementClient;
20
49
 
21
50
  /**
22
- * Create a Accounts.
23
- * @param {CognitiveServicesManagementClientContext} client Reference to the service client.
51
+ * Initialize a new instance of the class Accounts class.
52
+ * @param client Reference to the service client
24
53
  */
25
- constructor(client: CognitiveServicesManagementClientContext) {
54
+ constructor(client: CognitiveServicesManagementClient) {
26
55
  this.client = client;
27
56
  }
28
57
 
29
58
  /**
30
- * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the
31
- * keys for developer to access intelligent APIs. It's also the resource type for billing.
32
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
33
- * @param accountName The name of Cognitive Services account.
34
- * @param account The parameters to provide for the created account.
35
- * @param [options] The optional parameters
36
- * @returns Promise<Models.AccountsCreateResponse>
37
- */
38
- create(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, options?: msRest.RequestOptionsBase): Promise<Models.AccountsCreateResponse>;
39
- /**
40
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
41
- * @param accountName The name of Cognitive Services account.
42
- * @param account The parameters to provide for the created account.
43
- * @param callback The callback
44
- */
45
- create(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, callback: msRest.ServiceCallback<Models.CognitiveServicesAccount>): void;
46
- /**
59
+ * Returns all the resources of a particular type belonging to a resource group
47
60
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
48
- * @param accountName The name of Cognitive Services account.
49
- * @param account The parameters to provide for the created account.
50
- * @param options The optional parameters
51
- * @param callback The callback
52
- */
53
- create(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccount>): void;
54
- create(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccount>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccount>): Promise<Models.AccountsCreateResponse> {
55
- return this.client.sendOperationRequest(
56
- {
61
+ * @param options The options parameters.
62
+ */
63
+ public listByResourceGroup(
64
+ resourceGroupName: string,
65
+ options?: AccountsListByResourceGroupOptionalParams
66
+ ): PagedAsyncIterableIterator<Account> {
67
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
68
+ return {
69
+ next() {
70
+ return iter.next();
71
+ },
72
+ [Symbol.asyncIterator]() {
73
+ return this;
74
+ },
75
+ byPage: () => {
76
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
77
+ }
78
+ };
79
+ }
80
+
81
+ private async *listByResourceGroupPagingPage(
82
+ resourceGroupName: string,
83
+ options?: AccountsListByResourceGroupOptionalParams
84
+ ): AsyncIterableIterator<Account[]> {
85
+ let result = await this._listByResourceGroup(resourceGroupName, options);
86
+ yield result.value || [];
87
+ let continuationToken = result.nextLink;
88
+ while (continuationToken) {
89
+ result = await this._listByResourceGroupNext(
57
90
  resourceGroupName,
58
- accountName,
59
- account,
91
+ continuationToken,
60
92
  options
93
+ );
94
+ continuationToken = result.nextLink;
95
+ yield result.value || [];
96
+ }
97
+ }
98
+
99
+ private async *listByResourceGroupPagingAll(
100
+ resourceGroupName: string,
101
+ options?: AccountsListByResourceGroupOptionalParams
102
+ ): AsyncIterableIterator<Account> {
103
+ for await (const page of this.listByResourceGroupPagingPage(
104
+ resourceGroupName,
105
+ options
106
+ )) {
107
+ yield* page;
108
+ }
109
+ }
110
+
111
+ /**
112
+ * Returns all the resources of a particular type belonging to a subscription.
113
+ * @param options The options parameters.
114
+ */
115
+ public list(
116
+ options?: AccountsListOptionalParams
117
+ ): PagedAsyncIterableIterator<Account> {
118
+ const iter = this.listPagingAll(options);
119
+ return {
120
+ next() {
121
+ return iter.next();
122
+ },
123
+ [Symbol.asyncIterator]() {
124
+ return this;
61
125
  },
62
- createOperationSpec,
63
- callback) as Promise<Models.AccountsCreateResponse>;
126
+ byPage: () => {
127
+ return this.listPagingPage(options);
128
+ }
129
+ };
130
+ }
131
+
132
+ private async *listPagingPage(
133
+ options?: AccountsListOptionalParams
134
+ ): AsyncIterableIterator<Account[]> {
135
+ let result = await this._list(options);
136
+ yield result.value || [];
137
+ let continuationToken = result.nextLink;
138
+ while (continuationToken) {
139
+ result = await this._listNext(continuationToken, options);
140
+ continuationToken = result.nextLink;
141
+ yield result.value || [];
142
+ }
143
+ }
144
+
145
+ private async *listPagingAll(
146
+ options?: AccountsListOptionalParams
147
+ ): AsyncIterableIterator<Account> {
148
+ for await (const page of this.listPagingPage(options)) {
149
+ yield* page;
150
+ }
64
151
  }
65
152
 
66
153
  /**
67
- * Updates a Cognitive Services account
154
+ * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the
155
+ * keys for developer to access intelligent APIs. It's also the resource type for billing.
68
156
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
69
157
  * @param accountName The name of Cognitive Services account.
70
158
  * @param account The parameters to provide for the created account.
71
- * @param [options] The optional parameters
72
- * @returns Promise<Models.AccountsUpdateResponse>
73
- */
74
- update(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, options?: msRest.RequestOptionsBase): Promise<Models.AccountsUpdateResponse>;
159
+ * @param options The options parameters.
160
+ */
161
+ async beginCreate(
162
+ resourceGroupName: string,
163
+ accountName: string,
164
+ account: Account,
165
+ options?: AccountsCreateOptionalParams
166
+ ): Promise<
167
+ PollerLike<
168
+ PollOperationState<AccountsCreateResponse>,
169
+ AccountsCreateResponse
170
+ >
171
+ > {
172
+ const directSendOperation = async (
173
+ args: coreClient.OperationArguments,
174
+ spec: coreClient.OperationSpec
175
+ ): Promise<AccountsCreateResponse> => {
176
+ return this.client.sendOperationRequest(args, spec);
177
+ };
178
+ const sendOperation = async (
179
+ args: coreClient.OperationArguments,
180
+ spec: coreClient.OperationSpec
181
+ ) => {
182
+ let currentRawResponse:
183
+ | coreClient.FullOperationResponse
184
+ | undefined = undefined;
185
+ const providedCallback = args.options?.onResponse;
186
+ const callback: coreClient.RawResponseCallback = (
187
+ rawResponse: coreClient.FullOperationResponse,
188
+ flatResponse: unknown
189
+ ) => {
190
+ currentRawResponse = rawResponse;
191
+ providedCallback?.(rawResponse, flatResponse);
192
+ };
193
+ const updatedArgs = {
194
+ ...args,
195
+ options: {
196
+ ...args.options,
197
+ onResponse: callback
198
+ }
199
+ };
200
+ const flatResponse = await directSendOperation(updatedArgs, spec);
201
+ return {
202
+ flatResponse,
203
+ rawResponse: {
204
+ statusCode: currentRawResponse!.status,
205
+ body: currentRawResponse!.parsedBody,
206
+ headers: currentRawResponse!.headers.toJSON()
207
+ }
208
+ };
209
+ };
210
+
211
+ const lro = new LroImpl(
212
+ sendOperation,
213
+ { resourceGroupName, accountName, account, options },
214
+ createOperationSpec
215
+ );
216
+ return new LroEngine(lro, {
217
+ resumeFrom: options?.resumeFrom,
218
+ intervalInMs: options?.updateIntervalInMs
219
+ });
220
+ }
221
+
75
222
  /**
223
+ * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the
224
+ * keys for developer to access intelligent APIs. It's also the resource type for billing.
76
225
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
77
226
  * @param accountName The name of Cognitive Services account.
78
227
  * @param account The parameters to provide for the created account.
79
- * @param callback The callback
80
- */
81
- update(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, callback: msRest.ServiceCallback<Models.CognitiveServicesAccount>): void;
228
+ * @param options The options parameters.
229
+ */
230
+ async beginCreateAndWait(
231
+ resourceGroupName: string,
232
+ accountName: string,
233
+ account: Account,
234
+ options?: AccountsCreateOptionalParams
235
+ ): Promise<AccountsCreateResponse> {
236
+ const poller = await this.beginCreate(
237
+ resourceGroupName,
238
+ accountName,
239
+ account,
240
+ options
241
+ );
242
+ return poller.pollUntilDone();
243
+ }
244
+
82
245
  /**
246
+ * Updates a Cognitive Services account
83
247
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
84
248
  * @param accountName The name of Cognitive Services account.
85
249
  * @param account The parameters to provide for the created account.
86
- * @param options The optional parameters
87
- * @param callback The callback
88
- */
89
- update(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccount>): void;
90
- update(resourceGroupName: string, accountName: string, account: Models.CognitiveServicesAccount, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccount>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccount>): Promise<Models.AccountsUpdateResponse> {
91
- return this.client.sendOperationRequest(
92
- {
93
- resourceGroupName,
94
- accountName,
95
- account,
96
- options
97
- },
98
- updateOperationSpec,
99
- callback) as Promise<Models.AccountsUpdateResponse>;
250
+ * @param options The options parameters.
251
+ */
252
+ async beginUpdate(
253
+ resourceGroupName: string,
254
+ accountName: string,
255
+ account: Account,
256
+ options?: AccountsUpdateOptionalParams
257
+ ): Promise<
258
+ PollerLike<
259
+ PollOperationState<AccountsUpdateResponse>,
260
+ AccountsUpdateResponse
261
+ >
262
+ > {
263
+ const directSendOperation = async (
264
+ args: coreClient.OperationArguments,
265
+ spec: coreClient.OperationSpec
266
+ ): Promise<AccountsUpdateResponse> => {
267
+ return this.client.sendOperationRequest(args, spec);
268
+ };
269
+ const sendOperation = async (
270
+ args: coreClient.OperationArguments,
271
+ spec: coreClient.OperationSpec
272
+ ) => {
273
+ let currentRawResponse:
274
+ | coreClient.FullOperationResponse
275
+ | undefined = undefined;
276
+ const providedCallback = args.options?.onResponse;
277
+ const callback: coreClient.RawResponseCallback = (
278
+ rawResponse: coreClient.FullOperationResponse,
279
+ flatResponse: unknown
280
+ ) => {
281
+ currentRawResponse = rawResponse;
282
+ providedCallback?.(rawResponse, flatResponse);
283
+ };
284
+ const updatedArgs = {
285
+ ...args,
286
+ options: {
287
+ ...args.options,
288
+ onResponse: callback
289
+ }
290
+ };
291
+ const flatResponse = await directSendOperation(updatedArgs, spec);
292
+ return {
293
+ flatResponse,
294
+ rawResponse: {
295
+ statusCode: currentRawResponse!.status,
296
+ body: currentRawResponse!.parsedBody,
297
+ headers: currentRawResponse!.headers.toJSON()
298
+ }
299
+ };
300
+ };
301
+
302
+ const lro = new LroImpl(
303
+ sendOperation,
304
+ { resourceGroupName, accountName, account, options },
305
+ updateOperationSpec
306
+ );
307
+ return new LroEngine(lro, {
308
+ resumeFrom: options?.resumeFrom,
309
+ intervalInMs: options?.updateIntervalInMs
310
+ });
100
311
  }
101
312
 
102
313
  /**
103
- * Deletes a Cognitive Services account from the resource group.
314
+ * Updates a Cognitive Services account
104
315
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
105
316
  * @param accountName The name of Cognitive Services account.
106
- * @param [options] The optional parameters
107
- * @returns Promise<msRest.RestResponse>
108
- */
109
- deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
317
+ * @param account The parameters to provide for the created account.
318
+ * @param options The options parameters.
319
+ */
320
+ async beginUpdateAndWait(
321
+ resourceGroupName: string,
322
+ accountName: string,
323
+ account: Account,
324
+ options?: AccountsUpdateOptionalParams
325
+ ): Promise<AccountsUpdateResponse> {
326
+ const poller = await this.beginUpdate(
327
+ resourceGroupName,
328
+ accountName,
329
+ account,
330
+ options
331
+ );
332
+ return poller.pollUntilDone();
333
+ }
334
+
110
335
  /**
336
+ * Deletes a Cognitive Services account from the resource group.
111
337
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
112
338
  * @param accountName The name of Cognitive Services account.
113
- * @param callback The callback
114
- */
115
- deleteMethod(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback<void>): void;
339
+ * @param options The options parameters.
340
+ */
341
+ async beginDelete(
342
+ resourceGroupName: string,
343
+ accountName: string,
344
+ options?: AccountsDeleteOptionalParams
345
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
346
+ const directSendOperation = async (
347
+ args: coreClient.OperationArguments,
348
+ spec: coreClient.OperationSpec
349
+ ): Promise<void> => {
350
+ return this.client.sendOperationRequest(args, spec);
351
+ };
352
+ const sendOperation = async (
353
+ args: coreClient.OperationArguments,
354
+ spec: coreClient.OperationSpec
355
+ ) => {
356
+ let currentRawResponse:
357
+ | coreClient.FullOperationResponse
358
+ | undefined = undefined;
359
+ const providedCallback = args.options?.onResponse;
360
+ const callback: coreClient.RawResponseCallback = (
361
+ rawResponse: coreClient.FullOperationResponse,
362
+ flatResponse: unknown
363
+ ) => {
364
+ currentRawResponse = rawResponse;
365
+ providedCallback?.(rawResponse, flatResponse);
366
+ };
367
+ const updatedArgs = {
368
+ ...args,
369
+ options: {
370
+ ...args.options,
371
+ onResponse: callback
372
+ }
373
+ };
374
+ const flatResponse = await directSendOperation(updatedArgs, spec);
375
+ return {
376
+ flatResponse,
377
+ rawResponse: {
378
+ statusCode: currentRawResponse!.status,
379
+ body: currentRawResponse!.parsedBody,
380
+ headers: currentRawResponse!.headers.toJSON()
381
+ }
382
+ };
383
+ };
384
+
385
+ const lro = new LroImpl(
386
+ sendOperation,
387
+ { resourceGroupName, accountName, options },
388
+ deleteOperationSpec
389
+ );
390
+ return new LroEngine(lro, {
391
+ resumeFrom: options?.resumeFrom,
392
+ intervalInMs: options?.updateIntervalInMs
393
+ });
394
+ }
395
+
116
396
  /**
397
+ * Deletes a Cognitive Services account from the resource group.
117
398
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
118
399
  * @param accountName The name of Cognitive Services account.
119
- * @param options The optional parameters
120
- * @param callback The callback
121
- */
122
- deleteMethod(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
123
- deleteMethod(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
124
- return this.client.sendOperationRequest(
125
- {
126
- resourceGroupName,
127
- accountName,
128
- options
129
- },
130
- deleteMethodOperationSpec,
131
- callback);
400
+ * @param options The options parameters.
401
+ */
402
+ async beginDeleteAndWait(
403
+ resourceGroupName: string,
404
+ accountName: string,
405
+ options?: AccountsDeleteOptionalParams
406
+ ): Promise<void> {
407
+ const poller = await this.beginDelete(
408
+ resourceGroupName,
409
+ accountName,
410
+ options
411
+ );
412
+ return poller.pollUntilDone();
132
413
  }
133
414
 
134
415
  /**
135
416
  * Returns a Cognitive Services account specified by the parameters.
136
417
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
137
418
  * @param accountName The name of Cognitive Services account.
138
- * @param [options] The optional parameters
139
- * @returns Promise<Models.AccountsGetPropertiesResponse>
419
+ * @param options The options parameters.
140
420
  */
141
- getProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<Models.AccountsGetPropertiesResponse>;
142
- /**
143
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
144
- * @param accountName The name of Cognitive Services account.
145
- * @param callback The callback
146
- */
147
- getProperties(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback<Models.CognitiveServicesAccount>): void;
148
- /**
149
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
150
- * @param accountName The name of Cognitive Services account.
151
- * @param options The optional parameters
152
- * @param callback The callback
153
- */
154
- getProperties(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccount>): void;
155
- getProperties(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccount>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccount>): Promise<Models.AccountsGetPropertiesResponse> {
421
+ get(
422
+ resourceGroupName: string,
423
+ accountName: string,
424
+ options?: AccountsGetOptionalParams
425
+ ): Promise<AccountsGetResponse> {
156
426
  return this.client.sendOperationRequest(
157
- {
158
- resourceGroupName,
159
- accountName,
160
- options
161
- },
162
- getPropertiesOperationSpec,
163
- callback) as Promise<Models.AccountsGetPropertiesResponse>;
427
+ { resourceGroupName, accountName, options },
428
+ getOperationSpec
429
+ );
164
430
  }
165
431
 
166
432
  /**
167
433
  * Returns all the resources of a particular type belonging to a resource group
168
434
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
169
- * @param [options] The optional parameters
170
- * @returns Promise<Models.AccountsListByResourceGroupResponse>
435
+ * @param options The options parameters.
171
436
  */
172
- listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase): Promise<Models.AccountsListByResourceGroupResponse>;
173
- /**
174
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
175
- * @param callback The callback
176
- */
177
- listByResourceGroup(resourceGroupName: string, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): void;
178
- /**
179
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
180
- * @param options The optional parameters
181
- * @param callback The callback
182
- */
183
- listByResourceGroup(resourceGroupName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): void;
184
- listByResourceGroup(resourceGroupName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): Promise<Models.AccountsListByResourceGroupResponse> {
437
+ private _listByResourceGroup(
438
+ resourceGroupName: string,
439
+ options?: AccountsListByResourceGroupOptionalParams
440
+ ): Promise<AccountsListByResourceGroupResponse> {
185
441
  return this.client.sendOperationRequest(
186
- {
187
- resourceGroupName,
188
- options
189
- },
190
- listByResourceGroupOperationSpec,
191
- callback) as Promise<Models.AccountsListByResourceGroupResponse>;
442
+ { resourceGroupName, options },
443
+ listByResourceGroupOperationSpec
444
+ );
192
445
  }
193
446
 
194
447
  /**
195
448
  * Returns all the resources of a particular type belonging to a subscription.
196
- * @param [options] The optional parameters
197
- * @returns Promise<Models.AccountsListResponse>
198
- */
199
- list(options?: msRest.RequestOptionsBase): Promise<Models.AccountsListResponse>;
200
- /**
201
- * @param callback The callback
202
- */
203
- list(callback: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): void;
204
- /**
205
- * @param options The optional parameters
206
- * @param callback The callback
449
+ * @param options The options parameters.
207
450
  */
208
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): void;
209
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): Promise<Models.AccountsListResponse> {
210
- return this.client.sendOperationRequest(
211
- {
212
- options
213
- },
214
- listOperationSpec,
215
- callback) as Promise<Models.AccountsListResponse>;
451
+ private _list(
452
+ options?: AccountsListOptionalParams
453
+ ): Promise<AccountsListResponse> {
454
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
216
455
  }
217
456
 
218
457
  /**
219
458
  * Lists the account keys for the specified Cognitive Services account.
220
459
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
221
460
  * @param accountName The name of Cognitive Services account.
222
- * @param [options] The optional parameters
223
- * @returns Promise<Models.AccountsListKeysResponse>
224
- */
225
- listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<Models.AccountsListKeysResponse>;
226
- /**
227
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
228
- * @param accountName The name of Cognitive Services account.
229
- * @param callback The callback
461
+ * @param options The options parameters.
230
462
  */
231
- listKeys(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountKeys>): void;
232
- /**
233
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
234
- * @param accountName The name of Cognitive Services account.
235
- * @param options The optional parameters
236
- * @param callback The callback
237
- */
238
- listKeys(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountKeys>): void;
239
- listKeys(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccountKeys>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccountKeys>): Promise<Models.AccountsListKeysResponse> {
463
+ listKeys(
464
+ resourceGroupName: string,
465
+ accountName: string,
466
+ options?: AccountsListKeysOptionalParams
467
+ ): Promise<AccountsListKeysResponse> {
240
468
  return this.client.sendOperationRequest(
241
- {
242
- resourceGroupName,
243
- accountName,
244
- options
245
- },
246
- listKeysOperationSpec,
247
- callback) as Promise<Models.AccountsListKeysResponse>;
469
+ { resourceGroupName, accountName, options },
470
+ listKeysOperationSpec
471
+ );
248
472
  }
249
473
 
250
474
  /**
251
475
  * Regenerates the specified account key for the specified Cognitive Services account.
252
476
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
253
477
  * @param accountName The name of Cognitive Services account.
254
- * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2'
255
- * @param [options] The optional parameters
256
- * @returns Promise<Models.AccountsRegenerateKeyResponse>
257
- */
258
- regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, options?: msRest.RequestOptionsBase): Promise<Models.AccountsRegenerateKeyResponse>;
259
- /**
260
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
261
- * @param accountName The name of Cognitive Services account.
262
- * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2'
263
- * @param callback The callback
264
- */
265
- regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountKeys>): void;
266
- /**
267
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
268
- * @param accountName The name of Cognitive Services account.
269
- * @param keyName key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2'
270
- * @param options The optional parameters
271
- * @param callback The callback
272
- */
273
- regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountKeys>): void;
274
- regenerateKey(resourceGroupName: string, accountName: string, keyName: Models.KeyName, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccountKeys>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccountKeys>): Promise<Models.AccountsRegenerateKeyResponse> {
478
+ * @param keyName key name to generate (Key1|Key2)
479
+ * @param options The options parameters.
480
+ */
481
+ regenerateKey(
482
+ resourceGroupName: string,
483
+ accountName: string,
484
+ keyName: KeyName,
485
+ options?: AccountsRegenerateKeyOptionalParams
486
+ ): Promise<AccountsRegenerateKeyResponse> {
275
487
  return this.client.sendOperationRequest(
276
- {
277
- resourceGroupName,
278
- accountName,
279
- keyName,
280
- options
281
- },
282
- regenerateKeyOperationSpec,
283
- callback) as Promise<Models.AccountsRegenerateKeyResponse>;
488
+ { resourceGroupName, accountName, keyName, options },
489
+ regenerateKeyOperationSpec
490
+ );
284
491
  }
285
492
 
286
493
  /**
287
494
  * List available SKUs for the requested Cognitive Services account
288
495
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
289
496
  * @param accountName The name of Cognitive Services account.
290
- * @param [options] The optional parameters
291
- * @returns Promise<Models.AccountsListSkusResponse>
292
- */
293
- listSkus(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<Models.AccountsListSkusResponse>;
294
- /**
295
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
296
- * @param accountName The name of Cognitive Services account.
297
- * @param callback The callback
298
- */
299
- listSkus(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountEnumerateSkusResult>): void;
300
- /**
301
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
302
- * @param accountName The name of Cognitive Services account.
303
- * @param options The optional parameters
304
- * @param callback The callback
497
+ * @param options The options parameters.
305
498
  */
306
- listSkus(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountEnumerateSkusResult>): void;
307
- listSkus(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccountEnumerateSkusResult>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccountEnumerateSkusResult>): Promise<Models.AccountsListSkusResponse> {
499
+ listSkus(
500
+ resourceGroupName: string,
501
+ accountName: string,
502
+ options?: AccountsListSkusOptionalParams
503
+ ): Promise<AccountsListSkusResponse> {
308
504
  return this.client.sendOperationRequest(
309
- {
310
- resourceGroupName,
311
- accountName,
312
- options
313
- },
314
- listSkusOperationSpec,
315
- callback) as Promise<Models.AccountsListSkusResponse>;
505
+ { resourceGroupName, accountName, options },
506
+ listSkusOperationSpec
507
+ );
316
508
  }
317
509
 
318
510
  /**
319
511
  * Get usages for the requested Cognitive Services account
320
512
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
321
513
  * @param accountName The name of Cognitive Services account.
322
- * @param [options] The optional parameters
323
- * @returns Promise<Models.AccountsGetUsagesResponse>
324
- */
325
- getUsages(resourceGroupName: string, accountName: string, options?: Models.AccountsGetUsagesOptionalParams): Promise<Models.AccountsGetUsagesResponse>;
326
- /**
327
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
328
- * @param accountName The name of Cognitive Services account.
329
- * @param callback The callback
330
- */
331
- getUsages(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback<Models.UsagesResult>): void;
332
- /**
333
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
334
- * @param accountName The name of Cognitive Services account.
335
- * @param options The optional parameters
336
- * @param callback The callback
514
+ * @param options The options parameters.
337
515
  */
338
- getUsages(resourceGroupName: string, accountName: string, options: Models.AccountsGetUsagesOptionalParams, callback: msRest.ServiceCallback<Models.UsagesResult>): void;
339
- getUsages(resourceGroupName: string, accountName: string, options?: Models.AccountsGetUsagesOptionalParams | msRest.ServiceCallback<Models.UsagesResult>, callback?: msRest.ServiceCallback<Models.UsagesResult>): Promise<Models.AccountsGetUsagesResponse> {
516
+ listUsages(
517
+ resourceGroupName: string,
518
+ accountName: string,
519
+ options?: AccountsListUsagesOptionalParams
520
+ ): Promise<AccountsListUsagesResponse> {
340
521
  return this.client.sendOperationRequest(
341
- {
342
- resourceGroupName,
343
- accountName,
344
- options
345
- },
346
- getUsagesOperationSpec,
347
- callback) as Promise<Models.AccountsGetUsagesResponse>;
522
+ { resourceGroupName, accountName, options },
523
+ listUsagesOperationSpec
524
+ );
348
525
  }
349
526
 
350
527
  /**
351
- * Returns all the resources of a particular type belonging to a resource group
352
- * @param nextPageLink The NextLink from the previous successful call to List operation.
353
- * @param [options] The optional parameters
354
- * @returns Promise<Models.AccountsListByResourceGroupNextResponse>
355
- */
356
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.AccountsListByResourceGroupNextResponse>;
357
- /**
358
- * @param nextPageLink The NextLink from the previous successful call to List operation.
359
- * @param callback The callback
360
- */
361
- listByResourceGroupNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): void;
362
- /**
363
- * @param nextPageLink The NextLink from the previous successful call to List operation.
364
- * @param options The optional parameters
365
- * @param callback The callback
366
- */
367
- listByResourceGroupNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): void;
368
- listByResourceGroupNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): Promise<Models.AccountsListByResourceGroupNextResponse> {
528
+ * ListByResourceGroupNext
529
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
530
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
531
+ * @param options The options parameters.
532
+ */
533
+ private _listByResourceGroupNext(
534
+ resourceGroupName: string,
535
+ nextLink: string,
536
+ options?: AccountsListByResourceGroupNextOptionalParams
537
+ ): Promise<AccountsListByResourceGroupNextResponse> {
369
538
  return this.client.sendOperationRequest(
370
- {
371
- nextPageLink,
372
- options
373
- },
374
- listByResourceGroupNextOperationSpec,
375
- callback) as Promise<Models.AccountsListByResourceGroupNextResponse>;
539
+ { resourceGroupName, nextLink, options },
540
+ listByResourceGroupNextOperationSpec
541
+ );
376
542
  }
377
543
 
378
544
  /**
379
- * Returns all the resources of a particular type belonging to a subscription.
380
- * @param nextPageLink The NextLink from the previous successful call to List operation.
381
- * @param [options] The optional parameters
382
- * @returns Promise<Models.AccountsListNextResponse>
383
- */
384
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.AccountsListNextResponse>;
385
- /**
386
- * @param nextPageLink The NextLink from the previous successful call to List operation.
387
- * @param callback The callback
545
+ * ListNext
546
+ * @param nextLink The nextLink from the previous successful call to the List method.
547
+ * @param options The options parameters.
388
548
  */
389
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): void;
390
- /**
391
- * @param nextPageLink The NextLink from the previous successful call to List operation.
392
- * @param options The optional parameters
393
- * @param callback The callback
394
- */
395
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): void;
396
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>, callback?: msRest.ServiceCallback<Models.CognitiveServicesAccountListResult>): Promise<Models.AccountsListNextResponse> {
549
+ private _listNext(
550
+ nextLink: string,
551
+ options?: AccountsListNextOptionalParams
552
+ ): Promise<AccountsListNextResponse> {
397
553
  return this.client.sendOperationRequest(
398
- {
399
- nextPageLink,
400
- options
401
- },
402
- listNextOperationSpec,
403
- callback) as Promise<Models.AccountsListNextResponse>;
554
+ { nextLink, options },
555
+ listNextOperationSpec
556
+ );
404
557
  }
405
558
  }
406
-
407
559
  // Operation Specifications
408
- const serializer = new msRest.Serializer(Mappers);
409
- const createOperationSpec: msRest.OperationSpec = {
560
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
561
+
562
+ const createOperationSpec: coreClient.OperationSpec = {
563
+ path:
564
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}",
410
565
  httpMethod: "PUT",
411
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}",
412
- urlParameters: [
413
- Parameters.resourceGroupName,
414
- Parameters.accountName,
415
- Parameters.subscriptionId
416
- ],
417
- queryParameters: [
418
- Parameters.apiVersion
419
- ],
420
- headerParameters: [
421
- Parameters.acceptLanguage
422
- ],
423
- requestBody: {
424
- parameterPath: "account",
425
- mapper: {
426
- ...Mappers.CognitiveServicesAccount,
427
- required: true
428
- }
429
- },
430
566
  responses: {
431
567
  200: {
432
- bodyMapper: Mappers.CognitiveServicesAccount
568
+ bodyMapper: Mappers.Account
433
569
  },
434
570
  201: {
435
- bodyMapper: Mappers.CognitiveServicesAccount
571
+ bodyMapper: Mappers.Account
436
572
  },
437
573
  202: {
438
- bodyMapper: Mappers.CognitiveServicesAccount
574
+ bodyMapper: Mappers.Account
575
+ },
576
+ 204: {
577
+ bodyMapper: Mappers.Account
439
578
  },
440
579
  default: {
441
- bodyMapper: Mappers.ErrorModel
580
+ bodyMapper: Mappers.ErrorResponse
442
581
  }
443
582
  },
444
- serializer
445
- };
446
-
447
- const updateOperationSpec: msRest.OperationSpec = {
448
- httpMethod: "PATCH",
449
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}",
583
+ requestBody: Parameters.account,
584
+ queryParameters: [Parameters.apiVersion],
450
585
  urlParameters: [
586
+ Parameters.$host,
451
587
  Parameters.resourceGroupName,
452
588
  Parameters.accountName,
453
589
  Parameters.subscriptionId
454
590
  ],
455
- queryParameters: [
456
- Parameters.apiVersion
457
- ],
458
- headerParameters: [
459
- Parameters.acceptLanguage
460
- ],
461
- requestBody: {
462
- parameterPath: "account",
463
- mapper: {
464
- ...Mappers.CognitiveServicesAccount,
465
- required: true
466
- }
467
- },
591
+ headerParameters: [Parameters.contentType, Parameters.accept],
592
+ mediaType: "json",
593
+ serializer
594
+ };
595
+ const updateOperationSpec: coreClient.OperationSpec = {
596
+ path:
597
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}",
598
+ httpMethod: "PATCH",
468
599
  responses: {
469
600
  200: {
470
- bodyMapper: Mappers.CognitiveServicesAccount
601
+ bodyMapper: Mappers.Account
602
+ },
603
+ 201: {
604
+ bodyMapper: Mappers.Account
471
605
  },
472
606
  202: {
473
- bodyMapper: Mappers.CognitiveServicesAccount
607
+ bodyMapper: Mappers.Account
608
+ },
609
+ 204: {
610
+ bodyMapper: Mappers.Account
474
611
  },
475
612
  default: {
476
- bodyMapper: Mappers.ErrorModel
613
+ bodyMapper: Mappers.ErrorResponse
477
614
  }
478
615
  },
479
- serializer
480
- };
481
-
482
- const deleteMethodOperationSpec: msRest.OperationSpec = {
483
- httpMethod: "DELETE",
484
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}",
616
+ requestBody: Parameters.account,
617
+ queryParameters: [Parameters.apiVersion],
485
618
  urlParameters: [
619
+ Parameters.$host,
486
620
  Parameters.resourceGroupName,
487
621
  Parameters.accountName,
488
622
  Parameters.subscriptionId
489
623
  ],
490
- queryParameters: [
491
- Parameters.apiVersion
492
- ],
493
- headerParameters: [
494
- Parameters.acceptLanguage
495
- ],
624
+ headerParameters: [Parameters.contentType, Parameters.accept],
625
+ mediaType: "json",
626
+ serializer
627
+ };
628
+ const deleteOperationSpec: coreClient.OperationSpec = {
629
+ path:
630
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}",
631
+ httpMethod: "DELETE",
496
632
  responses: {
497
633
  200: {},
634
+ 201: {},
498
635
  202: {},
499
636
  204: {},
500
637
  default: {
501
- bodyMapper: Mappers.ErrorModel
638
+ bodyMapper: Mappers.ErrorResponse
502
639
  }
503
640
  },
504
- serializer
505
- };
506
-
507
- const getPropertiesOperationSpec: msRest.OperationSpec = {
508
- httpMethod: "GET",
509
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}",
641
+ queryParameters: [Parameters.apiVersion],
510
642
  urlParameters: [
643
+ Parameters.$host,
511
644
  Parameters.resourceGroupName,
512
645
  Parameters.accountName,
513
646
  Parameters.subscriptionId
514
647
  ],
515
- queryParameters: [
516
- Parameters.apiVersion
517
- ],
518
- headerParameters: [
519
- Parameters.acceptLanguage
520
- ],
648
+ headerParameters: [Parameters.accept],
649
+ serializer
650
+ };
651
+ const getOperationSpec: coreClient.OperationSpec = {
652
+ path:
653
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}",
654
+ httpMethod: "GET",
521
655
  responses: {
522
656
  200: {
523
- bodyMapper: Mappers.CognitiveServicesAccount
657
+ bodyMapper: Mappers.Account
524
658
  },
525
659
  default: {
526
- bodyMapper: Mappers.ErrorModel
660
+ bodyMapper: Mappers.ErrorResponse
527
661
  }
528
662
  },
529
- serializer
530
- };
531
-
532
- const listByResourceGroupOperationSpec: msRest.OperationSpec = {
533
- httpMethod: "GET",
534
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts",
663
+ queryParameters: [Parameters.apiVersion],
535
664
  urlParameters: [
665
+ Parameters.$host,
536
666
  Parameters.resourceGroupName,
667
+ Parameters.accountName,
537
668
  Parameters.subscriptionId
538
669
  ],
539
- queryParameters: [
540
- Parameters.apiVersion
541
- ],
542
- headerParameters: [
543
- Parameters.acceptLanguage
544
- ],
670
+ headerParameters: [Parameters.accept],
671
+ serializer
672
+ };
673
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
674
+ path:
675
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts",
676
+ httpMethod: "GET",
545
677
  responses: {
546
678
  200: {
547
- bodyMapper: Mappers.CognitiveServicesAccountListResult
679
+ bodyMapper: Mappers.AccountListResult
548
680
  },
549
681
  default: {
550
- bodyMapper: Mappers.ErrorModel
682
+ bodyMapper: Mappers.ErrorResponse
551
683
  }
552
684
  },
553
- serializer
554
- };
555
-
556
- const listOperationSpec: msRest.OperationSpec = {
557
- httpMethod: "GET",
558
- path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts",
685
+ queryParameters: [Parameters.apiVersion],
559
686
  urlParameters: [
687
+ Parameters.$host,
688
+ Parameters.resourceGroupName,
560
689
  Parameters.subscriptionId
561
690
  ],
562
- queryParameters: [
563
- Parameters.apiVersion
564
- ],
565
- headerParameters: [
566
- Parameters.acceptLanguage
567
- ],
691
+ headerParameters: [Parameters.accept],
692
+ serializer
693
+ };
694
+ const listOperationSpec: coreClient.OperationSpec = {
695
+ path:
696
+ "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/accounts",
697
+ httpMethod: "GET",
568
698
  responses: {
569
699
  200: {
570
- bodyMapper: Mappers.CognitiveServicesAccountListResult
700
+ bodyMapper: Mappers.AccountListResult
571
701
  },
572
702
  default: {
573
- bodyMapper: Mappers.ErrorModel
703
+ bodyMapper: Mappers.ErrorResponse
574
704
  }
575
705
  },
706
+ queryParameters: [Parameters.apiVersion],
707
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
708
+ headerParameters: [Parameters.accept],
576
709
  serializer
577
710
  };
578
-
579
- const listKeysOperationSpec: msRest.OperationSpec = {
711
+ const listKeysOperationSpec: coreClient.OperationSpec = {
712
+ path:
713
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys",
580
714
  httpMethod: "POST",
581
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys",
582
- urlParameters: [
583
- Parameters.resourceGroupName,
584
- Parameters.accountName,
585
- Parameters.subscriptionId
586
- ],
587
- queryParameters: [
588
- Parameters.apiVersion
589
- ],
590
- headerParameters: [
591
- Parameters.acceptLanguage
592
- ],
593
715
  responses: {
594
716
  200: {
595
- bodyMapper: Mappers.CognitiveServicesAccountKeys
717
+ bodyMapper: Mappers.ApiKeys
596
718
  },
597
719
  default: {
598
- bodyMapper: Mappers.ErrorModel
720
+ bodyMapper: Mappers.ErrorResponse
599
721
  }
600
722
  },
601
- serializer
602
- };
603
-
604
- const regenerateKeyOperationSpec: msRest.OperationSpec = {
605
- httpMethod: "POST",
606
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey",
723
+ queryParameters: [Parameters.apiVersion],
607
724
  urlParameters: [
725
+ Parameters.$host,
608
726
  Parameters.resourceGroupName,
609
727
  Parameters.accountName,
610
728
  Parameters.subscriptionId
611
729
  ],
612
- queryParameters: [
613
- Parameters.apiVersion
614
- ],
615
- headerParameters: [
616
- Parameters.acceptLanguage
617
- ],
618
- requestBody: {
619
- parameterPath: {
620
- keyName: "keyName"
621
- },
622
- mapper: {
623
- ...Mappers.RegenerateKeyParameters,
624
- required: true
625
- }
626
- },
730
+ headerParameters: [Parameters.accept],
731
+ serializer
732
+ };
733
+ const regenerateKeyOperationSpec: coreClient.OperationSpec = {
734
+ path:
735
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/regenerateKey",
736
+ httpMethod: "POST",
627
737
  responses: {
628
738
  200: {
629
- bodyMapper: Mappers.CognitiveServicesAccountKeys
739
+ bodyMapper: Mappers.ApiKeys
630
740
  },
631
741
  default: {
632
- bodyMapper: Mappers.ErrorModel
742
+ bodyMapper: Mappers.ErrorResponse
633
743
  }
634
744
  },
635
- serializer
636
- };
637
-
638
- const listSkusOperationSpec: msRest.OperationSpec = {
639
- httpMethod: "GET",
640
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus",
745
+ requestBody: {
746
+ parameterPath: { keyName: ["keyName"] },
747
+ mapper: { ...Mappers.RegenerateKeyParameters, required: true }
748
+ },
749
+ queryParameters: [Parameters.apiVersion],
641
750
  urlParameters: [
751
+ Parameters.$host,
642
752
  Parameters.resourceGroupName,
643
753
  Parameters.accountName,
644
754
  Parameters.subscriptionId
645
755
  ],
646
- queryParameters: [
647
- Parameters.apiVersion
648
- ],
649
- headerParameters: [
650
- Parameters.acceptLanguage
651
- ],
756
+ headerParameters: [Parameters.contentType, Parameters.accept],
757
+ mediaType: "json",
758
+ serializer
759
+ };
760
+ const listSkusOperationSpec: coreClient.OperationSpec = {
761
+ path:
762
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/skus",
763
+ httpMethod: "GET",
652
764
  responses: {
653
765
  200: {
654
- bodyMapper: Mappers.CognitiveServicesAccountEnumerateSkusResult
766
+ bodyMapper: Mappers.AccountSkuListResult
655
767
  },
656
768
  default: {
657
- bodyMapper: Mappers.ErrorModel
769
+ bodyMapper: Mappers.ErrorResponse
658
770
  }
659
771
  },
660
- serializer
661
- };
662
-
663
- const getUsagesOperationSpec: msRest.OperationSpec = {
664
- httpMethod: "GET",
665
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages",
772
+ queryParameters: [Parameters.apiVersion],
666
773
  urlParameters: [
774
+ Parameters.$host,
667
775
  Parameters.resourceGroupName,
668
776
  Parameters.accountName,
669
777
  Parameters.subscriptionId
670
778
  ],
671
- queryParameters: [
672
- Parameters.apiVersion,
673
- Parameters.filter
674
- ],
675
- headerParameters: [
676
- Parameters.acceptLanguage
677
- ],
779
+ headerParameters: [Parameters.accept],
780
+ serializer
781
+ };
782
+ const listUsagesOperationSpec: coreClient.OperationSpec = {
783
+ path:
784
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/usages",
785
+ httpMethod: "GET",
678
786
  responses: {
679
787
  200: {
680
- bodyMapper: Mappers.UsagesResult
788
+ bodyMapper: Mappers.UsageListResult
681
789
  },
682
790
  default: {
683
- bodyMapper: Mappers.ErrorModel
791
+ bodyMapper: Mappers.ErrorResponse
684
792
  }
685
793
  },
794
+ queryParameters: [Parameters.apiVersion, Parameters.filter],
795
+ urlParameters: [
796
+ Parameters.$host,
797
+ Parameters.resourceGroupName,
798
+ Parameters.accountName,
799
+ Parameters.subscriptionId
800
+ ],
801
+ headerParameters: [Parameters.accept],
686
802
  serializer
687
803
  };
688
-
689
- const listByResourceGroupNextOperationSpec: msRest.OperationSpec = {
690
- httpMethod: "GET",
691
- baseUrl: "https://management.azure.com",
804
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
692
805
  path: "{nextLink}",
693
- urlParameters: [
694
- Parameters.nextPageLink
695
- ],
696
- headerParameters: [
697
- Parameters.acceptLanguage
698
- ],
806
+ httpMethod: "GET",
699
807
  responses: {
700
808
  200: {
701
- bodyMapper: Mappers.CognitiveServicesAccountListResult
809
+ bodyMapper: Mappers.AccountListResult
702
810
  },
703
811
  default: {
704
- bodyMapper: Mappers.ErrorModel
812
+ bodyMapper: Mappers.ErrorResponse
705
813
  }
706
814
  },
815
+ queryParameters: [Parameters.apiVersion],
816
+ urlParameters: [
817
+ Parameters.$host,
818
+ Parameters.resourceGroupName,
819
+ Parameters.subscriptionId,
820
+ Parameters.nextLink
821
+ ],
822
+ headerParameters: [Parameters.accept],
707
823
  serializer
708
824
  };
709
-
710
- const listNextOperationSpec: msRest.OperationSpec = {
711
- httpMethod: "GET",
712
- baseUrl: "https://management.azure.com",
825
+ const listNextOperationSpec: coreClient.OperationSpec = {
713
826
  path: "{nextLink}",
714
- urlParameters: [
715
- Parameters.nextPageLink
716
- ],
717
- headerParameters: [
718
- Parameters.acceptLanguage
719
- ],
827
+ httpMethod: "GET",
720
828
  responses: {
721
829
  200: {
722
- bodyMapper: Mappers.CognitiveServicesAccountListResult
830
+ bodyMapper: Mappers.AccountListResult
723
831
  },
724
832
  default: {
725
- bodyMapper: Mappers.ErrorModel
833
+ bodyMapper: Mappers.ErrorResponse
726
834
  }
727
835
  },
836
+ queryParameters: [Parameters.apiVersion],
837
+ urlParameters: [
838
+ Parameters.$host,
839
+ Parameters.subscriptionId,
840
+ Parameters.nextLink
841
+ ],
842
+ headerParameters: [Parameters.accept],
728
843
  serializer
729
844
  };