@azure/arm-digitaltwins 2.1.1 → 3.0.0

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