@azure/arm-cognitiveservices 6.0.0 → 7.0.0-alpha.20211220.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 (223) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/{LICENSE.txt → LICENSE} +1 -1
  3. package/README.md +70 -95
  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 +1017 -713
  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 +3 -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/{esm/models/index.js → dist-esm/src/operationsInterfaces/accounts.js} +2 -1
  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/{src/models/operationsMappers.ts → dist-esm/src/operationsInterfaces/commitmentPlans.js} +2 -9
  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/{esm/models/operationsMappers.js → dist-esm/src/operationsInterfaces/commitmentTiers.js} +2 -2
  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/{src/models/resourceSkusMappers.ts → dist-esm/src/operationsInterfaces/deletedAccounts.js} +2 -10
  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 -22
  117. package/review/arm-cognitiveservices.api.md +1150 -0
  118. package/rollup.config.js +181 -24
  119. package/src/cognitiveServicesManagementClient.ts +148 -172
  120. package/src/index.ts +12 -0
  121. package/src/lroImpl.ts +34 -0
  122. package/src/models/index.ts +1122 -1415
  123. package/src/models/mappers.ts +1161 -835
  124. package/src/models/parameters.ts +159 -40
  125. package/src/operations/accounts.ts +587 -574
  126. package/src/operations/commitmentPlans.ts +394 -0
  127. package/src/operations/commitmentTiers.ts +158 -0
  128. package/src/operations/deletedAccounts.ts +197 -185
  129. package/src/operations/deployments.ts +464 -0
  130. package/src/operations/index.ts +4 -2
  131. package/src/operations/operations.ts +85 -85
  132. package/src/operations/privateEndpointConnections.ts +232 -202
  133. package/src/operations/privateLinkResources.ts +34 -62
  134. package/src/operations/resourceSkus.ts +90 -86
  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} +5 -3
  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 -3385
  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 -77
  153. package/esm/cognitiveServicesManagementClient.d.ts.map +0 -1
  154. package/esm/cognitiveServicesManagementClient.js +0 -108
  155. package/esm/cognitiveServicesManagementClient.js.map +0 -1
  156. package/esm/cognitiveServicesManagementClientContext.d.ts +0 -22
  157. package/esm/cognitiveServicesManagementClientContext.d.ts.map +0 -1
  158. package/esm/cognitiveServicesManagementClientContext.js +0 -61
  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/deletedAccountsMappers.d.ts +0 -2
  165. package/esm/models/deletedAccountsMappers.d.ts.map +0 -1
  166. package/esm/models/deletedAccountsMappers.js +0 -9
  167. package/esm/models/deletedAccountsMappers.js.map +0 -1
  168. package/esm/models/index.d.ts +0 -1645
  169. package/esm/models/index.d.ts.map +0 -1
  170. package/esm/models/index.js.map +0 -1
  171. package/esm/models/mappers.d.ts +0 -58
  172. package/esm/models/mappers.d.ts.map +0 -1
  173. package/esm/models/mappers.js.map +0 -1
  174. package/esm/models/operationsMappers.d.ts +0 -2
  175. package/esm/models/operationsMappers.d.ts.map +0 -1
  176. package/esm/models/operationsMappers.js.map +0 -1
  177. package/esm/models/parameters.d.ts +0 -11
  178. package/esm/models/parameters.d.ts.map +0 -1
  179. package/esm/models/parameters.js +0 -115
  180. package/esm/models/parameters.js.map +0 -1
  181. package/esm/models/privateEndpointConnectionsMappers.d.ts +0 -2
  182. package/esm/models/privateEndpointConnectionsMappers.d.ts.map +0 -1
  183. package/esm/models/privateEndpointConnectionsMappers.js +0 -9
  184. package/esm/models/privateEndpointConnectionsMappers.js.map +0 -1
  185. package/esm/models/privateLinkResourcesMappers.d.ts +0 -2
  186. package/esm/models/privateLinkResourcesMappers.d.ts.map +0 -1
  187. package/esm/models/privateLinkResourcesMappers.js +0 -9
  188. package/esm/models/privateLinkResourcesMappers.js.map +0 -1
  189. package/esm/models/resourceSkusMappers.d.ts +0 -2
  190. package/esm/models/resourceSkusMappers.d.ts.map +0 -1
  191. package/esm/models/resourceSkusMappers.js +0 -9
  192. package/esm/models/resourceSkusMappers.js.map +0 -1
  193. package/esm/operations/accounts.d.ts +0 -245
  194. package/esm/operations/accounts.d.ts.map +0 -1
  195. package/esm/operations/accounts.js +0 -389
  196. package/esm/operations/accounts.js.map +0 -1
  197. package/esm/operations/deletedAccounts.d.ts +0 -89
  198. package/esm/operations/deletedAccounts.d.ts.map +0 -1
  199. package/esm/operations/deletedAccounts.js +0 -149
  200. package/esm/operations/deletedAccounts.js.map +0 -1
  201. package/esm/operations/index.d.ts.map +0 -1
  202. package/esm/operations/index.js.map +0 -1
  203. package/esm/operations/operations.d.ts +0 -46
  204. package/esm/operations/operations.d.ts.map +0 -1
  205. package/esm/operations/operations.js +0 -69
  206. package/esm/operations/operations.js.map +0 -1
  207. package/esm/operations/privateEndpointConnections.d.ts +0 -108
  208. package/esm/operations/privateEndpointConnections.d.ts.map +0 -1
  209. package/esm/operations/privateEndpointConnections.js +0 -193
  210. package/esm/operations/privateEndpointConnections.js.map +0 -1
  211. package/esm/operations/privateLinkResources.d.ts +0 -34
  212. package/esm/operations/privateLinkResources.d.ts.map +0 -1
  213. package/esm/operations/privateLinkResources.js +0 -49
  214. package/esm/operations/privateLinkResources.js.map +0 -1
  215. package/esm/operations/resourceSkus.d.ts +0 -46
  216. package/esm/operations/resourceSkus.d.ts.map +0 -1
  217. package/esm/operations/resourceSkus.js +0 -70
  218. package/esm/operations/resourceSkus.js.map +0 -1
  219. package/src/cognitiveServicesManagementClientContext.ts +0 -74
  220. package/src/models/accountsMappers.ts +0 -51
  221. package/src/models/deletedAccountsMappers.ts +0 -44
  222. package/src/models/privateEndpointConnectionsMappers.ts +0 -44
  223. package/src/models/privateLinkResourcesMappers.ts +0 -44
@@ -3,25 +3,28 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import * as Models from "../models";
12
- import * as Mappers from "../models/privateLinkResourcesMappers";
9
+ import { PrivateLinkResources } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
13
12
  import * as Parameters from "../models/parameters";
14
- import { CognitiveServicesManagementClientContext } from "../cognitiveServicesManagementClientContext";
13
+ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient";
14
+ import {
15
+ PrivateLinkResourcesListOptionalParams,
16
+ PrivateLinkResourcesListResponse
17
+ } from "../models";
15
18
 
16
- /** Class representing a PrivateLinkResources. */
17
- export class PrivateLinkResources {
18
- private readonly client: CognitiveServicesManagementClientContext;
19
+ /** Class containing PrivateLinkResources operations. */
20
+ export class PrivateLinkResourcesImpl implements PrivateLinkResources {
21
+ private readonly client: CognitiveServicesManagementClient;
19
22
 
20
23
  /**
21
- * Create a PrivateLinkResources.
22
- * @param {CognitiveServicesManagementClientContext} client Reference to the service client.
24
+ * Initialize a new instance of the class PrivateLinkResources class.
25
+ * @param client Reference to the service client
23
26
  */
24
- constructor(client: CognitiveServicesManagementClientContext) {
27
+ constructor(client: CognitiveServicesManagementClient) {
25
28
  this.client = client;
26
29
  }
27
30
 
@@ -29,65 +32,26 @@ export class PrivateLinkResources {
29
32
  * Gets the private link resources that need to be created for a Cognitive Services account.
30
33
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
31
34
  * @param accountName The name of Cognitive Services account.
32
- * @param [options] The optional parameters
33
- * @returns Promise<Models.PrivateLinkResourcesListResponse>
35
+ * @param options The options parameters.
34
36
  */
35
37
  list(
36
38
  resourceGroupName: string,
37
39
  accountName: string,
38
- options?: msRest.RequestOptionsBase
39
- ): Promise<Models.PrivateLinkResourcesListResponse>;
40
- /**
41
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
42
- * @param accountName The name of Cognitive Services account.
43
- * @param callback The callback
44
- */
45
- list(
46
- resourceGroupName: string,
47
- accountName: string,
48
- callback: msRest.ServiceCallback<Models.PrivateLinkResourceListResult>
49
- ): void;
50
- /**
51
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
52
- * @param accountName The name of Cognitive Services account.
53
- * @param options The optional parameters
54
- * @param callback The callback
55
- */
56
- list(
57
- resourceGroupName: string,
58
- accountName: string,
59
- options: msRest.RequestOptionsBase,
60
- callback: msRest.ServiceCallback<Models.PrivateLinkResourceListResult>
61
- ): void;
62
- list(
63
- resourceGroupName: string,
64
- accountName: string,
65
- options?:
66
- | msRest.RequestOptionsBase
67
- | msRest.ServiceCallback<Models.PrivateLinkResourceListResult>,
68
- callback?: msRest.ServiceCallback<Models.PrivateLinkResourceListResult>
69
- ): Promise<Models.PrivateLinkResourcesListResponse> {
40
+ options?: PrivateLinkResourcesListOptionalParams
41
+ ): Promise<PrivateLinkResourcesListResponse> {
70
42
  return this.client.sendOperationRequest(
71
- {
72
- resourceGroupName,
73
- accountName,
74
- options
75
- },
76
- listOperationSpec,
77
- callback
78
- ) as Promise<Models.PrivateLinkResourcesListResponse>;
43
+ { resourceGroupName, accountName, options },
44
+ listOperationSpec
45
+ );
79
46
  }
80
47
  }
81
-
82
48
  // Operation Specifications
83
- const serializer = new msRest.Serializer(Mappers);
84
- const listOperationSpec: msRest.OperationSpec = {
85
- httpMethod: "GET",
49
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
50
+
51
+ const listOperationSpec: coreClient.OperationSpec = {
86
52
  path:
87
- "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources",
88
- urlParameters: [Parameters.resourceGroupName, Parameters.accountName, Parameters.subscriptionId],
89
- queryParameters: [Parameters.apiVersion],
90
- headerParameters: [Parameters.acceptLanguage],
53
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources",
54
+ httpMethod: "GET",
91
55
  responses: {
92
56
  200: {
93
57
  bodyMapper: Mappers.PrivateLinkResourceListResult
@@ -96,5 +60,13 @@ const listOperationSpec: msRest.OperationSpec = {
96
60
  bodyMapper: Mappers.ErrorResponse
97
61
  }
98
62
  },
63
+ queryParameters: [Parameters.apiVersion],
64
+ urlParameters: [
65
+ Parameters.$host,
66
+ Parameters.resourceGroupName,
67
+ Parameters.accountName,
68
+ Parameters.subscriptionId
69
+ ],
70
+ headerParameters: [Parameters.accept],
99
71
  serializer
100
72
  };
@@ -3,111 +3,110 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import * as Models from "../models";
12
- import * as Mappers from "../models/resourceSkusMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { ResourceSkus } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
13
13
  import * as Parameters from "../models/parameters";
14
- import { CognitiveServicesManagementClientContext } from "../cognitiveServicesManagementClientContext";
14
+ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient";
15
+ import {
16
+ ResourceSku,
17
+ ResourceSkusListNextOptionalParams,
18
+ ResourceSkusListOptionalParams,
19
+ ResourceSkusListResponse,
20
+ ResourceSkusListNextResponse
21
+ } from "../models";
15
22
 
16
- /** Class representing a ResourceSkus. */
17
- export class ResourceSkus {
18
- private readonly client: CognitiveServicesManagementClientContext;
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing ResourceSkus operations. */
25
+ export class ResourceSkusImpl implements ResourceSkus {
26
+ private readonly client: CognitiveServicesManagementClient;
19
27
 
20
28
  /**
21
- * Create a ResourceSkus.
22
- * @param {CognitiveServicesManagementClientContext} client Reference to the service client.
29
+ * Initialize a new instance of the class ResourceSkus class.
30
+ * @param client Reference to the service client
23
31
  */
24
- constructor(client: CognitiveServicesManagementClientContext) {
32
+ constructor(client: CognitiveServicesManagementClient) {
25
33
  this.client = client;
26
34
  }
27
35
 
28
36
  /**
29
37
  * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription.
30
- * @param [options] The optional parameters
31
- * @returns Promise<Models.ResourceSkusListResponse>
38
+ * @param options The options parameters.
32
39
  */
33
- list(options?: msRest.RequestOptionsBase): Promise<Models.ResourceSkusListResponse>;
34
- /**
35
- * @param callback The callback
36
- */
37
- list(callback: msRest.ServiceCallback<Models.ResourceSkuListResult>): void;
38
- /**
39
- * @param options The optional parameters
40
- * @param callback The callback
41
- */
42
- list(
43
- options: msRest.RequestOptionsBase,
44
- callback: msRest.ServiceCallback<Models.ResourceSkuListResult>
45
- ): void;
46
- list(
47
- options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ResourceSkuListResult>,
48
- callback?: msRest.ServiceCallback<Models.ResourceSkuListResult>
49
- ): Promise<Models.ResourceSkusListResponse> {
50
- return this.client.sendOperationRequest(
51
- {
52
- options
40
+ public list(
41
+ options?: ResourceSkusListOptionalParams
42
+ ): PagedAsyncIterableIterator<ResourceSku> {
43
+ const iter = this.listPagingAll(options);
44
+ return {
45
+ next() {
46
+ return iter.next();
47
+ },
48
+ [Symbol.asyncIterator]() {
49
+ return this;
53
50
  },
54
- listOperationSpec,
55
- callback
56
- ) as Promise<Models.ResourceSkusListResponse>;
51
+ byPage: () => {
52
+ return this.listPagingPage(options);
53
+ }
54
+ };
55
+ }
56
+
57
+ private async *listPagingPage(
58
+ options?: ResourceSkusListOptionalParams
59
+ ): AsyncIterableIterator<ResourceSku[]> {
60
+ let result = await this._list(options);
61
+ yield result.value || [];
62
+ let continuationToken = result.nextLink;
63
+ while (continuationToken) {
64
+ result = await this._listNext(continuationToken, options);
65
+ continuationToken = result.nextLink;
66
+ yield result.value || [];
67
+ }
68
+ }
69
+
70
+ private async *listPagingAll(
71
+ options?: ResourceSkusListOptionalParams
72
+ ): AsyncIterableIterator<ResourceSku> {
73
+ for await (const page of this.listPagingPage(options)) {
74
+ yield* page;
75
+ }
57
76
  }
58
77
 
59
78
  /**
60
79
  * Gets the list of Microsoft.CognitiveServices SKUs available for your Subscription.
61
- * @param nextPageLink The NextLink from the previous successful call to List operation.
62
- * @param [options] The optional parameters
63
- * @returns Promise<Models.ResourceSkusListNextResponse>
64
- */
65
- listNext(
66
- nextPageLink: string,
67
- options?: msRest.RequestOptionsBase
68
- ): Promise<Models.ResourceSkusListNextResponse>;
69
- /**
70
- * @param nextPageLink The NextLink from the previous successful call to List operation.
71
- * @param callback The callback
80
+ * @param options The options parameters.
72
81
  */
73
- listNext(
74
- nextPageLink: string,
75
- callback: msRest.ServiceCallback<Models.ResourceSkuListResult>
76
- ): void;
82
+ private _list(
83
+ options?: ResourceSkusListOptionalParams
84
+ ): Promise<ResourceSkusListResponse> {
85
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
86
+ }
87
+
77
88
  /**
78
- * @param nextPageLink The NextLink from the previous successful call to List operation.
79
- * @param options The optional parameters
80
- * @param callback The callback
89
+ * ListNext
90
+ * @param nextLink The nextLink from the previous successful call to the List method.
91
+ * @param options The options parameters.
81
92
  */
82
- listNext(
83
- nextPageLink: string,
84
- options: msRest.RequestOptionsBase,
85
- callback: msRest.ServiceCallback<Models.ResourceSkuListResult>
86
- ): void;
87
- listNext(
88
- nextPageLink: string,
89
- options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ResourceSkuListResult>,
90
- callback?: msRest.ServiceCallback<Models.ResourceSkuListResult>
91
- ): Promise<Models.ResourceSkusListNextResponse> {
93
+ private _listNext(
94
+ nextLink: string,
95
+ options?: ResourceSkusListNextOptionalParams
96
+ ): Promise<ResourceSkusListNextResponse> {
92
97
  return this.client.sendOperationRequest(
93
- {
94
- nextPageLink,
95
- options
96
- },
97
- listNextOperationSpec,
98
- callback
99
- ) as Promise<Models.ResourceSkusListNextResponse>;
98
+ { nextLink, options },
99
+ listNextOperationSpec
100
+ );
100
101
  }
101
102
  }
102
-
103
103
  // Operation Specifications
104
- const serializer = new msRest.Serializer(Mappers);
105
- const listOperationSpec: msRest.OperationSpec = {
104
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
105
+
106
+ const listOperationSpec: coreClient.OperationSpec = {
107
+ path:
108
+ "/subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus",
106
109
  httpMethod: "GET",
107
- path: "subscriptions/{subscriptionId}/providers/Microsoft.CognitiveServices/skus",
108
- urlParameters: [Parameters.subscriptionId],
109
- queryParameters: [Parameters.apiVersion],
110
- headerParameters: [Parameters.acceptLanguage],
111
110
  responses: {
112
111
  200: {
113
112
  bodyMapper: Mappers.ResourceSkuListResult
@@ -116,16 +115,14 @@ const listOperationSpec: msRest.OperationSpec = {
116
115
  bodyMapper: Mappers.ErrorResponse
117
116
  }
118
117
  },
118
+ queryParameters: [Parameters.apiVersion],
119
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
120
+ headerParameters: [Parameters.accept],
119
121
  serializer
120
122
  };
121
-
122
- const listNextOperationSpec: msRest.OperationSpec = {
123
- httpMethod: "GET",
124
- baseUrl: "https://management.azure.com",
123
+ const listNextOperationSpec: coreClient.OperationSpec = {
125
124
  path: "{nextLink}",
126
- urlParameters: [Parameters.nextPageLink],
127
- queryParameters: [Parameters.apiVersion],
128
- headerParameters: [Parameters.acceptLanguage],
125
+ httpMethod: "GET",
129
126
  responses: {
130
127
  200: {
131
128
  bodyMapper: Mappers.ResourceSkuListResult
@@ -134,5 +131,12 @@ const listNextOperationSpec: msRest.OperationSpec = {
134
131
  bodyMapper: Mappers.ErrorResponse
135
132
  }
136
133
  },
134
+ queryParameters: [Parameters.apiVersion],
135
+ urlParameters: [
136
+ Parameters.$host,
137
+ Parameters.subscriptionId,
138
+ Parameters.nextLink
139
+ ],
140
+ headerParameters: [Parameters.accept],
137
141
  serializer
138
142
  };
@@ -0,0 +1,195 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { PollerLike, PollOperationState } from "@azure/core-lro";
11
+ import {
12
+ Account,
13
+ AccountsListByResourceGroupOptionalParams,
14
+ AccountsListOptionalParams,
15
+ AccountsCreateOptionalParams,
16
+ AccountsCreateResponse,
17
+ AccountsUpdateOptionalParams,
18
+ AccountsUpdateResponse,
19
+ AccountsDeleteOptionalParams,
20
+ AccountsGetOptionalParams,
21
+ AccountsGetResponse,
22
+ AccountsListKeysOptionalParams,
23
+ AccountsListKeysResponse,
24
+ KeyName,
25
+ AccountsRegenerateKeyOptionalParams,
26
+ AccountsRegenerateKeyResponse,
27
+ AccountsListSkusOptionalParams,
28
+ AccountsListSkusResponse,
29
+ AccountsListUsagesOptionalParams,
30
+ AccountsListUsagesResponse
31
+ } from "../models";
32
+
33
+ /// <reference lib="esnext.asynciterable" />
34
+ /** Interface representing a Accounts. */
35
+ export interface Accounts {
36
+ /**
37
+ * Returns all the resources of a particular type belonging to a resource group
38
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
39
+ * @param options The options parameters.
40
+ */
41
+ listByResourceGroup(
42
+ resourceGroupName: string,
43
+ options?: AccountsListByResourceGroupOptionalParams
44
+ ): PagedAsyncIterableIterator<Account>;
45
+ /**
46
+ * Returns all the resources of a particular type belonging to a subscription.
47
+ * @param options The options parameters.
48
+ */
49
+ list(
50
+ options?: AccountsListOptionalParams
51
+ ): PagedAsyncIterableIterator<Account>;
52
+ /**
53
+ * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the
54
+ * keys for developer to access intelligent APIs. It's also the resource type for billing.
55
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
56
+ * @param accountName The name of Cognitive Services account.
57
+ * @param account The parameters to provide for the created account.
58
+ * @param options The options parameters.
59
+ */
60
+ beginCreate(
61
+ resourceGroupName: string,
62
+ accountName: string,
63
+ account: Account,
64
+ options?: AccountsCreateOptionalParams
65
+ ): Promise<
66
+ PollerLike<
67
+ PollOperationState<AccountsCreateResponse>,
68
+ AccountsCreateResponse
69
+ >
70
+ >;
71
+ /**
72
+ * Create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the
73
+ * keys for developer to access intelligent APIs. It's also the resource type for billing.
74
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
75
+ * @param accountName The name of Cognitive Services account.
76
+ * @param account The parameters to provide for the created account.
77
+ * @param options The options parameters.
78
+ */
79
+ beginCreateAndWait(
80
+ resourceGroupName: string,
81
+ accountName: string,
82
+ account: Account,
83
+ options?: AccountsCreateOptionalParams
84
+ ): Promise<AccountsCreateResponse>;
85
+ /**
86
+ * Updates a Cognitive Services account
87
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
88
+ * @param accountName The name of Cognitive Services account.
89
+ * @param account The parameters to provide for the created account.
90
+ * @param options The options parameters.
91
+ */
92
+ beginUpdate(
93
+ resourceGroupName: string,
94
+ accountName: string,
95
+ account: Account,
96
+ options?: AccountsUpdateOptionalParams
97
+ ): Promise<
98
+ PollerLike<
99
+ PollOperationState<AccountsUpdateResponse>,
100
+ AccountsUpdateResponse
101
+ >
102
+ >;
103
+ /**
104
+ * Updates a Cognitive Services account
105
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
106
+ * @param accountName The name of Cognitive Services account.
107
+ * @param account The parameters to provide for the created account.
108
+ * @param options The options parameters.
109
+ */
110
+ beginUpdateAndWait(
111
+ resourceGroupName: string,
112
+ accountName: string,
113
+ account: Account,
114
+ options?: AccountsUpdateOptionalParams
115
+ ): Promise<AccountsUpdateResponse>;
116
+ /**
117
+ * Deletes a Cognitive Services account from the resource group.
118
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
119
+ * @param accountName The name of Cognitive Services account.
120
+ * @param options The options parameters.
121
+ */
122
+ beginDelete(
123
+ resourceGroupName: string,
124
+ accountName: string,
125
+ options?: AccountsDeleteOptionalParams
126
+ ): Promise<PollerLike<PollOperationState<void>, void>>;
127
+ /**
128
+ * Deletes a Cognitive Services account from the resource group.
129
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
130
+ * @param accountName The name of Cognitive Services account.
131
+ * @param options The options parameters.
132
+ */
133
+ beginDeleteAndWait(
134
+ resourceGroupName: string,
135
+ accountName: string,
136
+ options?: AccountsDeleteOptionalParams
137
+ ): Promise<void>;
138
+ /**
139
+ * Returns a Cognitive Services account specified by the parameters.
140
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
141
+ * @param accountName The name of Cognitive Services account.
142
+ * @param options The options parameters.
143
+ */
144
+ get(
145
+ resourceGroupName: string,
146
+ accountName: string,
147
+ options?: AccountsGetOptionalParams
148
+ ): Promise<AccountsGetResponse>;
149
+ /**
150
+ * Lists the account keys for the specified Cognitive Services account.
151
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
152
+ * @param accountName The name of Cognitive Services account.
153
+ * @param options The options parameters.
154
+ */
155
+ listKeys(
156
+ resourceGroupName: string,
157
+ accountName: string,
158
+ options?: AccountsListKeysOptionalParams
159
+ ): Promise<AccountsListKeysResponse>;
160
+ /**
161
+ * Regenerates the specified account key for the specified Cognitive Services account.
162
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
163
+ * @param accountName The name of Cognitive Services account.
164
+ * @param keyName key name to generate (Key1|Key2)
165
+ * @param options The options parameters.
166
+ */
167
+ regenerateKey(
168
+ resourceGroupName: string,
169
+ accountName: string,
170
+ keyName: KeyName,
171
+ options?: AccountsRegenerateKeyOptionalParams
172
+ ): Promise<AccountsRegenerateKeyResponse>;
173
+ /**
174
+ * List available SKUs for the requested Cognitive Services account
175
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
176
+ * @param accountName The name of Cognitive Services account.
177
+ * @param options The options parameters.
178
+ */
179
+ listSkus(
180
+ resourceGroupName: string,
181
+ accountName: string,
182
+ options?: AccountsListSkusOptionalParams
183
+ ): Promise<AccountsListSkusResponse>;
184
+ /**
185
+ * Get usages for the requested Cognitive Services account
186
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
187
+ * @param accountName The name of Cognitive Services account.
188
+ * @param options The options parameters.
189
+ */
190
+ listUsages(
191
+ resourceGroupName: string,
192
+ accountName: string,
193
+ options?: AccountsListUsagesOptionalParams
194
+ ): Promise<AccountsListUsagesResponse>;
195
+ }
@@ -0,0 +1,93 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { PollerLike, PollOperationState } from "@azure/core-lro";
11
+ import {
12
+ CommitmentPlan,
13
+ CommitmentPlansListOptionalParams,
14
+ CommitmentPlansGetOptionalParams,
15
+ CommitmentPlansGetResponse,
16
+ CommitmentPlansCreateOrUpdateOptionalParams,
17
+ CommitmentPlansCreateOrUpdateResponse,
18
+ CommitmentPlansDeleteOptionalParams
19
+ } from "../models";
20
+
21
+ /// <reference lib="esnext.asynciterable" />
22
+ /** Interface representing a CommitmentPlans. */
23
+ export interface CommitmentPlans {
24
+ /**
25
+ * Gets the commitmentPlans associated with the Cognitive Services account.
26
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
27
+ * @param accountName The name of Cognitive Services account.
28
+ * @param options The options parameters.
29
+ */
30
+ list(
31
+ resourceGroupName: string,
32
+ accountName: string,
33
+ options?: CommitmentPlansListOptionalParams
34
+ ): PagedAsyncIterableIterator<CommitmentPlan>;
35
+ /**
36
+ * Gets the specified commitmentPlans associated with the Cognitive Services account.
37
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
38
+ * @param accountName The name of Cognitive Services account.
39
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
40
+ * Account
41
+ * @param options The options parameters.
42
+ */
43
+ get(
44
+ resourceGroupName: string,
45
+ accountName: string,
46
+ commitmentPlanName: string,
47
+ options?: CommitmentPlansGetOptionalParams
48
+ ): Promise<CommitmentPlansGetResponse>;
49
+ /**
50
+ * Update the state of specified commitmentPlans associated with the Cognitive Services account.
51
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
52
+ * @param accountName The name of Cognitive Services account.
53
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
54
+ * Account
55
+ * @param commitmentPlan The commitmentPlan properties.
56
+ * @param options The options parameters.
57
+ */
58
+ createOrUpdate(
59
+ resourceGroupName: string,
60
+ accountName: string,
61
+ commitmentPlanName: string,
62
+ commitmentPlan: CommitmentPlan,
63
+ options?: CommitmentPlansCreateOrUpdateOptionalParams
64
+ ): Promise<CommitmentPlansCreateOrUpdateResponse>;
65
+ /**
66
+ * Deletes the specified commitmentPlan associated with the Cognitive Services account.
67
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
68
+ * @param accountName The name of Cognitive Services account.
69
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
70
+ * Account
71
+ * @param options The options parameters.
72
+ */
73
+ beginDelete(
74
+ resourceGroupName: string,
75
+ accountName: string,
76
+ commitmentPlanName: string,
77
+ options?: CommitmentPlansDeleteOptionalParams
78
+ ): Promise<PollerLike<PollOperationState<void>, void>>;
79
+ /**
80
+ * Deletes the specified commitmentPlan associated with the Cognitive Services account.
81
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
82
+ * @param accountName The name of Cognitive Services account.
83
+ * @param commitmentPlanName The name of the commitmentPlan associated with the Cognitive Services
84
+ * Account
85
+ * @param options The options parameters.
86
+ */
87
+ beginDeleteAndWait(
88
+ resourceGroupName: string,
89
+ accountName: string,
90
+ commitmentPlanName: string,
91
+ options?: CommitmentPlansDeleteOptionalParams
92
+ ): Promise<void>;
93
+ }
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { CommitmentTier, CommitmentTiersListOptionalParams } from "../models";
11
+
12
+ /// <reference lib="esnext.asynciterable" />
13
+ /** Interface representing a CommitmentTiers. */
14
+ export interface CommitmentTiers {
15
+ /**
16
+ * List Commitment Tiers.
17
+ * @param location Resource location.
18
+ * @param options The options parameters.
19
+ */
20
+ list(
21
+ location: string,
22
+ options?: CommitmentTiersListOptionalParams
23
+ ): PagedAsyncIterableIterator<CommitmentTier>;
24
+ }