@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,59 +1,73 @@
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/privateEndpointConnectionsMappers";
9
+ import { PrivateEndpointConnections } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
14
12
  import * as Parameters from "../models/parameters";
15
- import { CognitiveServicesManagementClientContext } from "../cognitiveServicesManagementClientContext";
13
+ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient";
14
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
15
+ import { LroImpl } from "../lroImpl";
16
+ import {
17
+ PrivateEndpointConnectionsListOptionalParams,
18
+ PrivateEndpointConnectionsListResponse,
19
+ PrivateEndpointConnectionsGetOptionalParams,
20
+ PrivateEndpointConnectionsGetResponse,
21
+ PrivateEndpointConnection,
22
+ PrivateEndpointConnectionsCreateOrUpdateOptionalParams,
23
+ PrivateEndpointConnectionsCreateOrUpdateResponse,
24
+ PrivateEndpointConnectionsDeleteOptionalParams
25
+ } from "../models";
16
26
 
17
- /** Class representing a PrivateEndpointConnections. */
18
- export class PrivateEndpointConnections {
19
- private readonly client: CognitiveServicesManagementClientContext;
27
+ /** Class containing PrivateEndpointConnections operations. */
28
+ export class PrivateEndpointConnectionsImpl
29
+ implements PrivateEndpointConnections {
30
+ private readonly client: CognitiveServicesManagementClient;
20
31
 
21
32
  /**
22
- * Create a PrivateEndpointConnections.
23
- * @param {CognitiveServicesManagementClientContext} client Reference to the service client.
33
+ * Initialize a new instance of the class PrivateEndpointConnections class.
34
+ * @param client Reference to the service client
24
35
  */
25
- constructor(client: CognitiveServicesManagementClientContext) {
36
+ constructor(client: CognitiveServicesManagementClient) {
26
37
  this.client = client;
27
38
  }
28
39
 
29
40
  /**
30
- * Gets the specified private endpoint connection associated with the Cognitive Services account.
31
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
32
- * @param accountName The name of Cognitive Services account.
33
- * @param privateEndpointConnectionName The name of the private endpoint connection associated with
34
- * the Cognitive Services Account
35
- * @param [options] The optional parameters
36
- * @returns Promise<Models.PrivateEndpointConnectionsGetResponse>
37
- */
38
- get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise<Models.PrivateEndpointConnectionsGetResponse>;
39
- /**
41
+ * Gets the private endpoint connections associated with the Cognitive Services account.
40
42
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
41
43
  * @param accountName The name of Cognitive Services account.
42
- * @param privateEndpointConnectionName The name of the private endpoint connection associated with
43
- * the Cognitive Services Account
44
- * @param callback The callback
44
+ * @param options The options parameters.
45
45
  */
46
- get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback<Models.PrivateEndpointConnection>): void;
46
+ list(
47
+ resourceGroupName: string,
48
+ accountName: string,
49
+ options?: PrivateEndpointConnectionsListOptionalParams
50
+ ): Promise<PrivateEndpointConnectionsListResponse> {
51
+ return this.client.sendOperationRequest(
52
+ { resourceGroupName, accountName, options },
53
+ listOperationSpec
54
+ );
55
+ }
56
+
47
57
  /**
58
+ * Gets the specified private endpoint connection associated with the Cognitive Services account.
48
59
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
49
60
  * @param accountName The name of Cognitive Services account.
50
- * @param privateEndpointConnectionName The name of the private endpoint connection associated with
51
- * the Cognitive Services Account
52
- * @param options The optional parameters
53
- * @param callback The callback
61
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
62
+ * Cognitive Services Account
63
+ * @param options The options parameters.
54
64
  */
55
- get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PrivateEndpointConnection>): void;
56
- get(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PrivateEndpointConnection>, callback?: msRest.ServiceCallback<Models.PrivateEndpointConnection>): Promise<Models.PrivateEndpointConnectionsGetResponse> {
65
+ get(
66
+ resourceGroupName: string,
67
+ accountName: string,
68
+ privateEndpointConnectionName: string,
69
+ options?: PrivateEndpointConnectionsGetOptionalParams
70
+ ): Promise<PrivateEndpointConnectionsGetResponse> {
57
71
  return this.client.sendOperationRequest(
58
72
  {
59
73
  resourceGroupName,
@@ -61,8 +75,8 @@ export class PrivateEndpointConnections {
61
75
  privateEndpointConnectionName,
62
76
  options
63
77
  },
64
- getOperationSpec,
65
- callback) as Promise<Models.PrivateEndpointConnectionsGetResponse>;
78
+ getOperationSpec
79
+ );
66
80
  }
67
81
 
68
82
  /**
@@ -70,34 +84,64 @@ export class PrivateEndpointConnections {
70
84
  * account.
71
85
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
72
86
  * @param accountName The name of Cognitive Services account.
73
- * @param privateEndpointConnectionName The name of the private endpoint connection associated with
74
- * the Cognitive Services Account
87
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
88
+ * Cognitive Services Account
75
89
  * @param properties The private endpoint connection properties.
76
- * @param [options] The optional parameters
77
- * @returns Promise<Models.PrivateEndpointConnectionsCreateOrUpdateResponse>
90
+ * @param options The options parameters.
78
91
  */
79
- createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase): Promise<Models.PrivateEndpointConnectionsCreateOrUpdateResponse>;
80
- /**
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 privateEndpointConnectionName The name of the private endpoint connection associated with
84
- * the Cognitive Services Account
85
- * @param properties The private endpoint connection properties.
86
- * @param callback The callback
87
- */
88
- createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, callback: msRest.ServiceCallback<Models.PrivateEndpointConnection>): void;
89
- /**
90
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
91
- * @param accountName The name of Cognitive Services account.
92
- * @param privateEndpointConnectionName The name of the private endpoint connection associated with
93
- * the Cognitive Services Account
94
- * @param properties The private endpoint connection properties.
95
- * @param options The optional parameters
96
- * @param callback The callback
97
- */
98
- createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PrivateEndpointConnection>): void;
99
- createOrUpdate(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, properties: Models.PrivateEndpointConnection, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PrivateEndpointConnection>, callback?: msRest.ServiceCallback<Models.PrivateEndpointConnection>): Promise<Models.PrivateEndpointConnectionsCreateOrUpdateResponse> {
100
- return this.client.sendOperationRequest(
92
+ async beginCreateOrUpdate(
93
+ resourceGroupName: string,
94
+ accountName: string,
95
+ privateEndpointConnectionName: string,
96
+ properties: PrivateEndpointConnection,
97
+ options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams
98
+ ): Promise<
99
+ PollerLike<
100
+ PollOperationState<PrivateEndpointConnectionsCreateOrUpdateResponse>,
101
+ PrivateEndpointConnectionsCreateOrUpdateResponse
102
+ >
103
+ > {
104
+ const directSendOperation = async (
105
+ args: coreClient.OperationArguments,
106
+ spec: coreClient.OperationSpec
107
+ ): Promise<PrivateEndpointConnectionsCreateOrUpdateResponse> => {
108
+ return this.client.sendOperationRequest(args, spec);
109
+ };
110
+ const sendOperation = async (
111
+ args: coreClient.OperationArguments,
112
+ spec: coreClient.OperationSpec
113
+ ) => {
114
+ let currentRawResponse:
115
+ | coreClient.FullOperationResponse
116
+ | undefined = undefined;
117
+ const providedCallback = args.options?.onResponse;
118
+ const callback: coreClient.RawResponseCallback = (
119
+ rawResponse: coreClient.FullOperationResponse,
120
+ flatResponse: unknown
121
+ ) => {
122
+ currentRawResponse = rawResponse;
123
+ providedCallback?.(rawResponse, flatResponse);
124
+ };
125
+ const updatedArgs = {
126
+ ...args,
127
+ options: {
128
+ ...args.options,
129
+ onResponse: callback
130
+ }
131
+ };
132
+ const flatResponse = await directSendOperation(updatedArgs, spec);
133
+ return {
134
+ flatResponse,
135
+ rawResponse: {
136
+ statusCode: currentRawResponse!.status,
137
+ body: currentRawResponse!.parsedBody,
138
+ headers: currentRawResponse!.headers.toJSON()
139
+ }
140
+ };
141
+ };
142
+
143
+ const lro = new LroImpl(
144
+ sendOperation,
101
145
  {
102
146
  resourceGroupName,
103
147
  accountName,
@@ -105,133 +149,236 @@ export class PrivateEndpointConnections {
105
149
  properties,
106
150
  options
107
151
  },
108
- createOrUpdateOperationSpec,
109
- callback) as Promise<Models.PrivateEndpointConnectionsCreateOrUpdateResponse>;
152
+ createOrUpdateOperationSpec
153
+ );
154
+ return new LroEngine(lro, {
155
+ resumeFrom: options?.resumeFrom,
156
+ intervalInMs: options?.updateIntervalInMs
157
+ });
110
158
  }
111
159
 
112
160
  /**
113
- * Deletes the specified private endpoint connection associated with the Cognitive Services
161
+ * Update the state of specified private endpoint connection associated with the Cognitive Services
114
162
  * account.
115
163
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
116
164
  * @param accountName The name of Cognitive Services account.
117
- * @param privateEndpointConnectionName The name of the private endpoint connection associated with
118
- * the Cognitive Services Account
119
- * @param [options] The optional parameters
120
- * @returns Promise<msRest.RestResponse>
121
- */
122
- deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase): Promise<msRest.RestResponse>;
123
- /**
124
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
125
- * @param accountName The name of Cognitive Services account.
126
- * @param privateEndpointConnectionName The name of the private endpoint connection associated with
127
- * the Cognitive Services Account
128
- * @param callback The callback
165
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
166
+ * Cognitive Services Account
167
+ * @param properties The private endpoint connection properties.
168
+ * @param options The options parameters.
129
169
  */
130
- deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, callback: msRest.ServiceCallback<void>): void;
170
+ async beginCreateOrUpdateAndWait(
171
+ resourceGroupName: string,
172
+ accountName: string,
173
+ privateEndpointConnectionName: string,
174
+ properties: PrivateEndpointConnection,
175
+ options?: PrivateEndpointConnectionsCreateOrUpdateOptionalParams
176
+ ): Promise<PrivateEndpointConnectionsCreateOrUpdateResponse> {
177
+ const poller = await this.beginCreateOrUpdate(
178
+ resourceGroupName,
179
+ accountName,
180
+ privateEndpointConnectionName,
181
+ properties,
182
+ options
183
+ );
184
+ return poller.pollUntilDone();
185
+ }
186
+
131
187
  /**
188
+ * Deletes the specified private endpoint connection associated with the Cognitive Services account.
132
189
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
133
190
  * @param accountName The name of Cognitive Services account.
134
- * @param privateEndpointConnectionName The name of the private endpoint connection associated with
135
- * the Cognitive Services Account
136
- * @param options The optional parameters
137
- * @param callback The callback
191
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
192
+ * Cognitive Services Account
193
+ * @param options The options parameters.
138
194
  */
139
- deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
140
- deleteMethod(resourceGroupName: string, accountName: string, privateEndpointConnectionName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
141
- return this.client.sendOperationRequest(
195
+ async beginDelete(
196
+ resourceGroupName: string,
197
+ accountName: string,
198
+ privateEndpointConnectionName: string,
199
+ options?: PrivateEndpointConnectionsDeleteOptionalParams
200
+ ): Promise<PollerLike<PollOperationState<void>, void>> {
201
+ const directSendOperation = async (
202
+ args: coreClient.OperationArguments,
203
+ spec: coreClient.OperationSpec
204
+ ): Promise<void> => {
205
+ return this.client.sendOperationRequest(args, spec);
206
+ };
207
+ const sendOperation = async (
208
+ args: coreClient.OperationArguments,
209
+ spec: coreClient.OperationSpec
210
+ ) => {
211
+ let currentRawResponse:
212
+ | coreClient.FullOperationResponse
213
+ | undefined = undefined;
214
+ const providedCallback = args.options?.onResponse;
215
+ const callback: coreClient.RawResponseCallback = (
216
+ rawResponse: coreClient.FullOperationResponse,
217
+ flatResponse: unknown
218
+ ) => {
219
+ currentRawResponse = rawResponse;
220
+ providedCallback?.(rawResponse, flatResponse);
221
+ };
222
+ const updatedArgs = {
223
+ ...args,
224
+ options: {
225
+ ...args.options,
226
+ onResponse: callback
227
+ }
228
+ };
229
+ const flatResponse = await directSendOperation(updatedArgs, spec);
230
+ return {
231
+ flatResponse,
232
+ rawResponse: {
233
+ statusCode: currentRawResponse!.status,
234
+ body: currentRawResponse!.parsedBody,
235
+ headers: currentRawResponse!.headers.toJSON()
236
+ }
237
+ };
238
+ };
239
+
240
+ const lro = new LroImpl(
241
+ sendOperation,
142
242
  {
143
243
  resourceGroupName,
144
244
  accountName,
145
245
  privateEndpointConnectionName,
146
246
  options
147
247
  },
148
- deleteMethodOperationSpec,
149
- callback);
248
+ deleteOperationSpec
249
+ );
250
+ return new LroEngine(lro, {
251
+ resumeFrom: options?.resumeFrom,
252
+ intervalInMs: options?.updateIntervalInMs
253
+ });
150
254
  }
151
- }
152
255
 
256
+ /**
257
+ * Deletes the specified private endpoint connection associated with the Cognitive Services account.
258
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
259
+ * @param accountName The name of Cognitive Services account.
260
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the
261
+ * Cognitive Services Account
262
+ * @param options The options parameters.
263
+ */
264
+ async beginDeleteAndWait(
265
+ resourceGroupName: string,
266
+ accountName: string,
267
+ privateEndpointConnectionName: string,
268
+ options?: PrivateEndpointConnectionsDeleteOptionalParams
269
+ ): Promise<void> {
270
+ const poller = await this.beginDelete(
271
+ resourceGroupName,
272
+ accountName,
273
+ privateEndpointConnectionName,
274
+ options
275
+ );
276
+ return poller.pollUntilDone();
277
+ }
278
+ }
153
279
  // Operation Specifications
154
- const serializer = new msRest.Serializer(Mappers);
155
- const getOperationSpec: msRest.OperationSpec = {
280
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
281
+
282
+ const listOperationSpec: coreClient.OperationSpec = {
283
+ path:
284
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections",
156
285
  httpMethod: "GET",
157
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
286
+ responses: {
287
+ 200: {
288
+ bodyMapper: Mappers.PrivateEndpointConnectionListResult
289
+ },
290
+ default: {
291
+ bodyMapper: Mappers.ErrorResponse
292
+ }
293
+ },
294
+ queryParameters: [Parameters.apiVersion],
158
295
  urlParameters: [
296
+ Parameters.$host,
159
297
  Parameters.resourceGroupName,
160
298
  Parameters.accountName,
161
- Parameters.subscriptionId,
162
- Parameters.privateEndpointConnectionName
163
- ],
164
- queryParameters: [
165
- Parameters.apiVersion
166
- ],
167
- headerParameters: [
168
- Parameters.acceptLanguage
299
+ Parameters.subscriptionId
169
300
  ],
301
+ headerParameters: [Parameters.accept],
302
+ serializer
303
+ };
304
+ const getOperationSpec: coreClient.OperationSpec = {
305
+ path:
306
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
307
+ httpMethod: "GET",
170
308
  responses: {
171
309
  200: {
172
310
  bodyMapper: Mappers.PrivateEndpointConnection
173
311
  },
174
312
  default: {
175
- bodyMapper: Mappers.CloudError
313
+ bodyMapper: Mappers.ErrorResponse
176
314
  }
177
315
  },
178
- serializer
179
- };
180
-
181
- const createOrUpdateOperationSpec: msRest.OperationSpec = {
182
- httpMethod: "PUT",
183
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
316
+ queryParameters: [Parameters.apiVersion],
184
317
  urlParameters: [
318
+ Parameters.$host,
185
319
  Parameters.resourceGroupName,
186
320
  Parameters.accountName,
187
321
  Parameters.subscriptionId,
188
322
  Parameters.privateEndpointConnectionName
189
323
  ],
190
- queryParameters: [
191
- Parameters.apiVersion
192
- ],
193
- headerParameters: [
194
- Parameters.acceptLanguage
195
- ],
196
- requestBody: {
197
- parameterPath: "properties",
198
- mapper: {
199
- ...Mappers.PrivateEndpointConnection,
200
- required: true
201
- }
202
- },
324
+ headerParameters: [Parameters.accept],
325
+ serializer
326
+ };
327
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
328
+ path:
329
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
330
+ httpMethod: "PUT",
203
331
  responses: {
204
332
  200: {
205
333
  bodyMapper: Mappers.PrivateEndpointConnection
206
334
  },
335
+ 201: {
336
+ bodyMapper: Mappers.PrivateEndpointConnection
337
+ },
338
+ 202: {
339
+ bodyMapper: Mappers.PrivateEndpointConnection
340
+ },
341
+ 204: {
342
+ bodyMapper: Mappers.PrivateEndpointConnection
343
+ },
207
344
  default: {
208
- bodyMapper: Mappers.CloudError
345
+ bodyMapper: Mappers.ErrorResponse
209
346
  }
210
347
  },
211
- serializer
212
- };
213
-
214
- const deleteMethodOperationSpec: msRest.OperationSpec = {
215
- httpMethod: "DELETE",
216
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
348
+ requestBody: Parameters.properties,
349
+ queryParameters: [Parameters.apiVersion],
217
350
  urlParameters: [
351
+ Parameters.$host,
218
352
  Parameters.resourceGroupName,
219
353
  Parameters.accountName,
220
354
  Parameters.subscriptionId,
221
355
  Parameters.privateEndpointConnectionName
222
356
  ],
223
- queryParameters: [
224
- Parameters.apiVersion
225
- ],
226
- headerParameters: [
227
- Parameters.acceptLanguage
228
- ],
357
+ headerParameters: [Parameters.contentType, Parameters.accept],
358
+ mediaType: "json",
359
+ serializer
360
+ };
361
+ const deleteOperationSpec: coreClient.OperationSpec = {
362
+ path:
363
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}",
364
+ httpMethod: "DELETE",
229
365
  responses: {
230
366
  200: {},
367
+ 201: {},
368
+ 202: {},
231
369
  204: {},
232
370
  default: {
233
- bodyMapper: Mappers.CloudError
371
+ bodyMapper: Mappers.ErrorResponse
234
372
  }
235
373
  },
374
+ queryParameters: [Parameters.apiVersion],
375
+ urlParameters: [
376
+ Parameters.$host,
377
+ Parameters.resourceGroupName,
378
+ Parameters.accountName,
379
+ Parameters.subscriptionId,
380
+ Parameters.privateEndpointConnectionName
381
+ ],
382
+ headerParameters: [Parameters.accept],
236
383
  serializer
237
384
  };
@@ -1,28 +1,30 @@
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/privateLinkResourcesMappers";
9
+ import { PrivateLinkResources } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
14
12
  import * as Parameters from "../models/parameters";
15
- import { CognitiveServicesManagementClientContext } from "../cognitiveServicesManagementClientContext";
13
+ import { CognitiveServicesManagementClient } from "../cognitiveServicesManagementClient";
14
+ import {
15
+ PrivateLinkResourcesListOptionalParams,
16
+ PrivateLinkResourcesListResponse
17
+ } from "../models";
16
18
 
17
- /** Class representing a PrivateLinkResources. */
18
- export class PrivateLinkResources {
19
- private readonly client: CognitiveServicesManagementClientContext;
19
+ /** Class containing PrivateLinkResources operations. */
20
+ export class PrivateLinkResourcesImpl implements PrivateLinkResources {
21
+ private readonly client: CognitiveServicesManagementClient;
20
22
 
21
23
  /**
22
- * Create a PrivateLinkResources.
23
- * @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
24
26
  */
25
- constructor(client: CognitiveServicesManagementClientContext) {
27
+ constructor(client: CognitiveServicesManagementClient) {
26
28
  this.client = client;
27
29
  }
28
30
 
@@ -30,58 +32,41 @@ export class PrivateLinkResources {
30
32
  * Gets the private link resources that need to be created for a Cognitive Services account.
31
33
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
32
34
  * @param accountName The name of Cognitive Services account.
33
- * @param [options] The optional parameters
34
- * @returns Promise<Models.PrivateLinkResourcesListResponse>
35
+ * @param options The options parameters.
35
36
  */
36
- list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase): Promise<Models.PrivateLinkResourcesListResponse>;
37
- /**
38
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
39
- * @param accountName The name of Cognitive Services account.
40
- * @param callback The callback
41
- */
42
- list(resourceGroupName: string, accountName: string, callback: msRest.ServiceCallback<Models.PrivateLinkResourceListResult>): void;
43
- /**
44
- * @param resourceGroupName The name of the resource group. The name is case insensitive.
45
- * @param accountName The name of Cognitive Services account.
46
- * @param options The optional parameters
47
- * @param callback The callback
48
- */
49
- list(resourceGroupName: string, accountName: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.PrivateLinkResourceListResult>): void;
50
- list(resourceGroupName: string, accountName: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.PrivateLinkResourceListResult>, callback?: msRest.ServiceCallback<Models.PrivateLinkResourceListResult>): Promise<Models.PrivateLinkResourcesListResponse> {
37
+ list(
38
+ resourceGroupName: string,
39
+ accountName: string,
40
+ options?: PrivateLinkResourcesListOptionalParams
41
+ ): Promise<PrivateLinkResourcesListResponse> {
51
42
  return this.client.sendOperationRequest(
52
- {
53
- resourceGroupName,
54
- accountName,
55
- options
56
- },
57
- listOperationSpec,
58
- callback) as Promise<Models.PrivateLinkResourcesListResponse>;
43
+ { resourceGroupName, accountName, options },
44
+ listOperationSpec
45
+ );
59
46
  }
60
47
  }
61
-
62
48
  // Operation Specifications
63
- const serializer = new msRest.Serializer(Mappers);
64
- const listOperationSpec: msRest.OperationSpec = {
49
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
50
+
51
+ const listOperationSpec: coreClient.OperationSpec = {
52
+ path:
53
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources",
65
54
  httpMethod: "GET",
66
- path: "subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/privateLinkResources",
67
- urlParameters: [
68
- Parameters.resourceGroupName,
69
- Parameters.accountName,
70
- Parameters.subscriptionId
71
- ],
72
- queryParameters: [
73
- Parameters.apiVersion
74
- ],
75
- headerParameters: [
76
- Parameters.acceptLanguage
77
- ],
78
55
  responses: {
79
56
  200: {
80
57
  bodyMapper: Mappers.PrivateLinkResourceListResult
81
58
  },
82
59
  default: {
83
- bodyMapper: Mappers.CloudError
60
+ bodyMapper: Mappers.ErrorResponse
84
61
  }
85
62
  },
63
+ queryParameters: [Parameters.apiVersion],
64
+ urlParameters: [
65
+ Parameters.$host,
66
+ Parameters.resourceGroupName,
67
+ Parameters.accountName,
68
+ Parameters.subscriptionId
69
+ ],
70
+ headerParameters: [Parameters.accept],
86
71
  serializer
87
72
  };