@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
package/dist/index.js ADDED
@@ -0,0 +1,2613 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var coreClient = require('@azure/core-client');
6
+ var tslib = require('tslib');
7
+ var coreLro = require('@azure/core-lro');
8
+
9
+ /*
10
+ * Copyright (c) Microsoft Corporation.
11
+ * Licensed under the MIT License.
12
+ *
13
+ * Code generated by Microsoft (R) AutoRest Code Generator.
14
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
15
+ */
16
+ (function (KnownProvisioningState) {
17
+ KnownProvisioningState["Provisioning"] = "Provisioning";
18
+ KnownProvisioningState["Deleting"] = "Deleting";
19
+ KnownProvisioningState["Updating"] = "Updating";
20
+ KnownProvisioningState["Succeeded"] = "Succeeded";
21
+ KnownProvisioningState["Failed"] = "Failed";
22
+ KnownProvisioningState["Canceled"] = "Canceled";
23
+ KnownProvisioningState["Deleted"] = "Deleted";
24
+ KnownProvisioningState["Warning"] = "Warning";
25
+ KnownProvisioningState["Suspending"] = "Suspending";
26
+ KnownProvisioningState["Restoring"] = "Restoring";
27
+ KnownProvisioningState["Moving"] = "Moving";
28
+ })(exports.KnownProvisioningState || (exports.KnownProvisioningState = {}));
29
+ (function (KnownConnectionPropertiesProvisioningState) {
30
+ KnownConnectionPropertiesProvisioningState["Pending"] = "Pending";
31
+ KnownConnectionPropertiesProvisioningState["Approved"] = "Approved";
32
+ KnownConnectionPropertiesProvisioningState["Rejected"] = "Rejected";
33
+ KnownConnectionPropertiesProvisioningState["Disconnected"] = "Disconnected";
34
+ })(exports.KnownConnectionPropertiesProvisioningState || (exports.KnownConnectionPropertiesProvisioningState = {}));
35
+ (function (KnownPrivateLinkServiceConnectionStatus) {
36
+ KnownPrivateLinkServiceConnectionStatus["Pending"] = "Pending";
37
+ KnownPrivateLinkServiceConnectionStatus["Approved"] = "Approved";
38
+ KnownPrivateLinkServiceConnectionStatus["Rejected"] = "Rejected";
39
+ KnownPrivateLinkServiceConnectionStatus["Disconnected"] = "Disconnected";
40
+ })(exports.KnownPrivateLinkServiceConnectionStatus || (exports.KnownPrivateLinkServiceConnectionStatus = {}));
41
+ (function (KnownPublicNetworkAccess) {
42
+ KnownPublicNetworkAccess["Enabled"] = "Enabled";
43
+ KnownPublicNetworkAccess["Disabled"] = "Disabled";
44
+ })(exports.KnownPublicNetworkAccess || (exports.KnownPublicNetworkAccess = {}));
45
+ (function (KnownDigitalTwinsIdentityType) {
46
+ KnownDigitalTwinsIdentityType["None"] = "None";
47
+ KnownDigitalTwinsIdentityType["SystemAssigned"] = "SystemAssigned";
48
+ })(exports.KnownDigitalTwinsIdentityType || (exports.KnownDigitalTwinsIdentityType = {}));
49
+ (function (KnownEndpointType) {
50
+ KnownEndpointType["EventHub"] = "EventHub";
51
+ KnownEndpointType["EventGrid"] = "EventGrid";
52
+ KnownEndpointType["ServiceBus"] = "ServiceBus";
53
+ })(exports.KnownEndpointType || (exports.KnownEndpointType = {}));
54
+ (function (KnownEndpointProvisioningState) {
55
+ KnownEndpointProvisioningState["Provisioning"] = "Provisioning";
56
+ KnownEndpointProvisioningState["Deleting"] = "Deleting";
57
+ KnownEndpointProvisioningState["Succeeded"] = "Succeeded";
58
+ KnownEndpointProvisioningState["Failed"] = "Failed";
59
+ KnownEndpointProvisioningState["Canceled"] = "Canceled";
60
+ KnownEndpointProvisioningState["Deleted"] = "Deleted";
61
+ KnownEndpointProvisioningState["Warning"] = "Warning";
62
+ KnownEndpointProvisioningState["Suspending"] = "Suspending";
63
+ KnownEndpointProvisioningState["Restoring"] = "Restoring";
64
+ KnownEndpointProvisioningState["Moving"] = "Moving";
65
+ KnownEndpointProvisioningState["Disabled"] = "Disabled";
66
+ })(exports.KnownEndpointProvisioningState || (exports.KnownEndpointProvisioningState = {}));
67
+ (function (KnownAuthenticationType) {
68
+ KnownAuthenticationType["KeyBased"] = "KeyBased";
69
+ KnownAuthenticationType["IdentityBased"] = "IdentityBased";
70
+ })(exports.KnownAuthenticationType || (exports.KnownAuthenticationType = {}));
71
+ (function (KnownReason) {
72
+ KnownReason["Invalid"] = "Invalid";
73
+ KnownReason["AlreadyExists"] = "AlreadyExists";
74
+ })(exports.KnownReason || (exports.KnownReason = {}));
75
+
76
+ /*
77
+ * Copyright (c) Microsoft Corporation.
78
+ * Licensed under the MIT License.
79
+ *
80
+ * Code generated by Microsoft (R) AutoRest Code Generator.
81
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
82
+ */
83
+ const PrivateEndpointConnection = {
84
+ type: {
85
+ name: "Composite",
86
+ className: "PrivateEndpointConnection",
87
+ modelProperties: {
88
+ id: {
89
+ serializedName: "id",
90
+ readOnly: true,
91
+ type: {
92
+ name: "String"
93
+ }
94
+ },
95
+ name: {
96
+ constraints: {
97
+ Pattern: new RegExp("^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$")
98
+ },
99
+ serializedName: "name",
100
+ readOnly: true,
101
+ type: {
102
+ name: "String"
103
+ }
104
+ },
105
+ type: {
106
+ serializedName: "type",
107
+ readOnly: true,
108
+ type: {
109
+ name: "String"
110
+ }
111
+ },
112
+ properties: {
113
+ serializedName: "properties",
114
+ type: {
115
+ name: "Composite",
116
+ className: "PrivateEndpointConnectionProperties"
117
+ }
118
+ }
119
+ }
120
+ }
121
+ };
122
+ const ConnectionProperties = {
123
+ type: {
124
+ name: "Composite",
125
+ className: "ConnectionProperties",
126
+ modelProperties: {
127
+ provisioningState: {
128
+ serializedName: "provisioningState",
129
+ readOnly: true,
130
+ nullable: true,
131
+ type: {
132
+ name: "String"
133
+ }
134
+ },
135
+ privateEndpoint: {
136
+ serializedName: "privateEndpoint",
137
+ type: {
138
+ name: "Composite",
139
+ className: "ConnectionPropertiesPrivateEndpoint"
140
+ }
141
+ },
142
+ groupIds: {
143
+ serializedName: "groupIds",
144
+ type: {
145
+ name: "Sequence",
146
+ element: {
147
+ type: {
148
+ name: "String"
149
+ }
150
+ }
151
+ }
152
+ },
153
+ privateLinkServiceConnectionState: {
154
+ serializedName: "privateLinkServiceConnectionState",
155
+ type: {
156
+ name: "Composite",
157
+ className: "ConnectionPropertiesPrivateLinkServiceConnectionState"
158
+ }
159
+ }
160
+ }
161
+ }
162
+ };
163
+ const PrivateEndpoint = {
164
+ type: {
165
+ name: "Composite",
166
+ className: "PrivateEndpoint",
167
+ modelProperties: {
168
+ id: {
169
+ serializedName: "id",
170
+ readOnly: true,
171
+ type: {
172
+ name: "String"
173
+ }
174
+ }
175
+ }
176
+ }
177
+ };
178
+ const ConnectionState = {
179
+ type: {
180
+ name: "Composite",
181
+ className: "ConnectionState",
182
+ modelProperties: {
183
+ status: {
184
+ serializedName: "status",
185
+ required: true,
186
+ type: {
187
+ name: "String"
188
+ }
189
+ },
190
+ description: {
191
+ serializedName: "description",
192
+ required: true,
193
+ type: {
194
+ name: "String"
195
+ }
196
+ },
197
+ actionsRequired: {
198
+ serializedName: "actionsRequired",
199
+ type: {
200
+ name: "String"
201
+ }
202
+ }
203
+ }
204
+ }
205
+ };
206
+ const DigitalTwinsResource = {
207
+ type: {
208
+ name: "Composite",
209
+ className: "DigitalTwinsResource",
210
+ modelProperties: {
211
+ id: {
212
+ serializedName: "id",
213
+ readOnly: true,
214
+ type: {
215
+ name: "String"
216
+ }
217
+ },
218
+ name: {
219
+ constraints: {
220
+ Pattern: new RegExp("^(?!-)[A-Za-z0-9-]{3,63}(?<!-)$")
221
+ },
222
+ serializedName: "name",
223
+ readOnly: true,
224
+ type: {
225
+ name: "String"
226
+ }
227
+ },
228
+ type: {
229
+ serializedName: "type",
230
+ readOnly: true,
231
+ type: {
232
+ name: "String"
233
+ }
234
+ },
235
+ location: {
236
+ serializedName: "location",
237
+ required: true,
238
+ type: {
239
+ name: "String"
240
+ }
241
+ },
242
+ tags: {
243
+ serializedName: "tags",
244
+ nullable: true,
245
+ type: {
246
+ name: "Dictionary",
247
+ value: { type: { name: "String" } }
248
+ }
249
+ },
250
+ identity: {
251
+ serializedName: "identity",
252
+ type: {
253
+ name: "Composite",
254
+ className: "DigitalTwinsIdentity"
255
+ }
256
+ }
257
+ }
258
+ }
259
+ };
260
+ const DigitalTwinsIdentity = {
261
+ type: {
262
+ name: "Composite",
263
+ className: "DigitalTwinsIdentity",
264
+ modelProperties: {
265
+ type: {
266
+ serializedName: "type",
267
+ type: {
268
+ name: "String"
269
+ }
270
+ },
271
+ principalId: {
272
+ serializedName: "principalId",
273
+ readOnly: true,
274
+ nullable: true,
275
+ type: {
276
+ name: "String"
277
+ }
278
+ },
279
+ tenantId: {
280
+ serializedName: "tenantId",
281
+ readOnly: true,
282
+ nullable: true,
283
+ type: {
284
+ name: "String"
285
+ }
286
+ }
287
+ }
288
+ }
289
+ };
290
+ const ErrorResponse = {
291
+ type: {
292
+ name: "Composite",
293
+ className: "ErrorResponse",
294
+ modelProperties: {
295
+ error: {
296
+ serializedName: "error",
297
+ type: {
298
+ name: "Composite",
299
+ className: "ErrorDefinition"
300
+ }
301
+ }
302
+ }
303
+ }
304
+ };
305
+ const ErrorDefinition = {
306
+ type: {
307
+ name: "Composite",
308
+ className: "ErrorDefinition",
309
+ modelProperties: {
310
+ code: {
311
+ serializedName: "code",
312
+ readOnly: true,
313
+ type: {
314
+ name: "String"
315
+ }
316
+ },
317
+ message: {
318
+ serializedName: "message",
319
+ readOnly: true,
320
+ type: {
321
+ name: "String"
322
+ }
323
+ },
324
+ details: {
325
+ serializedName: "details",
326
+ readOnly: true,
327
+ nullable: true,
328
+ type: {
329
+ name: "Sequence",
330
+ element: {
331
+ type: {
332
+ name: "Composite",
333
+ className: "ErrorDefinition"
334
+ }
335
+ }
336
+ }
337
+ }
338
+ }
339
+ }
340
+ };
341
+ const DigitalTwinsPatchDescription = {
342
+ type: {
343
+ name: "Composite",
344
+ className: "DigitalTwinsPatchDescription",
345
+ modelProperties: {
346
+ tags: {
347
+ serializedName: "tags",
348
+ nullable: true,
349
+ type: {
350
+ name: "Dictionary",
351
+ value: { type: { name: "String" } }
352
+ }
353
+ },
354
+ identity: {
355
+ serializedName: "identity",
356
+ type: {
357
+ name: "Composite",
358
+ className: "DigitalTwinsIdentity"
359
+ }
360
+ },
361
+ properties: {
362
+ serializedName: "properties",
363
+ type: {
364
+ name: "Composite",
365
+ className: "DigitalTwinsPatchProperties"
366
+ }
367
+ }
368
+ }
369
+ }
370
+ };
371
+ const DigitalTwinsPatchProperties = {
372
+ type: {
373
+ name: "Composite",
374
+ className: "DigitalTwinsPatchProperties",
375
+ modelProperties: {
376
+ publicNetworkAccess: {
377
+ serializedName: "publicNetworkAccess",
378
+ type: {
379
+ name: "String"
380
+ }
381
+ }
382
+ }
383
+ }
384
+ };
385
+ const DigitalTwinsEndpointResourceListResult = {
386
+ type: {
387
+ name: "Composite",
388
+ className: "DigitalTwinsEndpointResourceListResult",
389
+ modelProperties: {
390
+ nextLink: {
391
+ serializedName: "nextLink",
392
+ nullable: true,
393
+ type: {
394
+ name: "String"
395
+ }
396
+ },
397
+ value: {
398
+ serializedName: "value",
399
+ type: {
400
+ name: "Sequence",
401
+ element: {
402
+ type: {
403
+ name: "Composite",
404
+ className: "DigitalTwinsEndpointResource"
405
+ }
406
+ }
407
+ }
408
+ }
409
+ }
410
+ }
411
+ };
412
+ const DigitalTwinsEndpointResourceProperties = {
413
+ type: {
414
+ name: "Composite",
415
+ className: "DigitalTwinsEndpointResourceProperties",
416
+ uberParent: "DigitalTwinsEndpointResourceProperties",
417
+ polymorphicDiscriminator: {
418
+ serializedName: "endpointType",
419
+ clientName: "endpointType"
420
+ },
421
+ modelProperties: {
422
+ endpointType: {
423
+ serializedName: "endpointType",
424
+ required: true,
425
+ type: {
426
+ name: "String"
427
+ }
428
+ },
429
+ provisioningState: {
430
+ serializedName: "provisioningState",
431
+ readOnly: true,
432
+ nullable: true,
433
+ type: {
434
+ name: "String"
435
+ }
436
+ },
437
+ createdTime: {
438
+ serializedName: "createdTime",
439
+ readOnly: true,
440
+ nullable: true,
441
+ type: {
442
+ name: "DateTime"
443
+ }
444
+ },
445
+ authenticationType: {
446
+ serializedName: "authenticationType",
447
+ type: {
448
+ name: "String"
449
+ }
450
+ },
451
+ deadLetterSecret: {
452
+ serializedName: "deadLetterSecret",
453
+ nullable: true,
454
+ type: {
455
+ name: "String"
456
+ }
457
+ },
458
+ deadLetterUri: {
459
+ serializedName: "deadLetterUri",
460
+ nullable: true,
461
+ type: {
462
+ name: "String"
463
+ }
464
+ }
465
+ }
466
+ }
467
+ };
468
+ const ExternalResource = {
469
+ type: {
470
+ name: "Composite",
471
+ className: "ExternalResource",
472
+ modelProperties: {
473
+ id: {
474
+ serializedName: "id",
475
+ readOnly: true,
476
+ type: {
477
+ name: "String"
478
+ }
479
+ },
480
+ name: {
481
+ constraints: {
482
+ Pattern: new RegExp("^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$")
483
+ },
484
+ serializedName: "name",
485
+ readOnly: true,
486
+ type: {
487
+ name: "String"
488
+ }
489
+ },
490
+ type: {
491
+ serializedName: "type",
492
+ readOnly: true,
493
+ type: {
494
+ name: "String"
495
+ }
496
+ }
497
+ }
498
+ }
499
+ };
500
+ const DigitalTwinsDescriptionListResult = {
501
+ type: {
502
+ name: "Composite",
503
+ className: "DigitalTwinsDescriptionListResult",
504
+ modelProperties: {
505
+ nextLink: {
506
+ serializedName: "nextLink",
507
+ nullable: true,
508
+ type: {
509
+ name: "String"
510
+ }
511
+ },
512
+ value: {
513
+ serializedName: "value",
514
+ type: {
515
+ name: "Sequence",
516
+ element: {
517
+ type: {
518
+ name: "Composite",
519
+ className: "DigitalTwinsDescription"
520
+ }
521
+ }
522
+ }
523
+ }
524
+ }
525
+ }
526
+ };
527
+ const OperationListResult = {
528
+ type: {
529
+ name: "Composite",
530
+ className: "OperationListResult",
531
+ modelProperties: {
532
+ nextLink: {
533
+ serializedName: "nextLink",
534
+ nullable: true,
535
+ type: {
536
+ name: "String"
537
+ }
538
+ },
539
+ value: {
540
+ serializedName: "value",
541
+ readOnly: true,
542
+ type: {
543
+ name: "Sequence",
544
+ element: {
545
+ type: {
546
+ name: "Composite",
547
+ className: "Operation"
548
+ }
549
+ }
550
+ }
551
+ }
552
+ }
553
+ }
554
+ };
555
+ const Operation = {
556
+ type: {
557
+ name: "Composite",
558
+ className: "Operation",
559
+ modelProperties: {
560
+ name: {
561
+ serializedName: "name",
562
+ readOnly: true,
563
+ type: {
564
+ name: "String"
565
+ }
566
+ },
567
+ display: {
568
+ serializedName: "display",
569
+ type: {
570
+ name: "Composite",
571
+ className: "OperationDisplay"
572
+ }
573
+ },
574
+ origin: {
575
+ serializedName: "origin",
576
+ readOnly: true,
577
+ nullable: true,
578
+ type: {
579
+ name: "String"
580
+ }
581
+ },
582
+ isDataAction: {
583
+ serializedName: "isDataAction",
584
+ readOnly: true,
585
+ type: {
586
+ name: "Boolean"
587
+ }
588
+ }
589
+ }
590
+ }
591
+ };
592
+ const OperationDisplay = {
593
+ type: {
594
+ name: "Composite",
595
+ className: "OperationDisplay",
596
+ modelProperties: {
597
+ provider: {
598
+ serializedName: "provider",
599
+ readOnly: true,
600
+ type: {
601
+ name: "String"
602
+ }
603
+ },
604
+ resource: {
605
+ serializedName: "resource",
606
+ readOnly: true,
607
+ type: {
608
+ name: "String"
609
+ }
610
+ },
611
+ operation: {
612
+ serializedName: "operation",
613
+ readOnly: true,
614
+ type: {
615
+ name: "String"
616
+ }
617
+ },
618
+ description: {
619
+ serializedName: "description",
620
+ readOnly: true,
621
+ type: {
622
+ name: "String"
623
+ }
624
+ }
625
+ }
626
+ }
627
+ };
628
+ const CheckNameRequest = {
629
+ type: {
630
+ name: "Composite",
631
+ className: "CheckNameRequest",
632
+ modelProperties: {
633
+ name: {
634
+ serializedName: "name",
635
+ required: true,
636
+ type: {
637
+ name: "String"
638
+ }
639
+ },
640
+ type: {
641
+ defaultValue: "Microsoft.DigitalTwins/digitalTwinsInstances",
642
+ isConstant: true,
643
+ serializedName: "type",
644
+ type: {
645
+ name: "String"
646
+ }
647
+ }
648
+ }
649
+ }
650
+ };
651
+ const CheckNameResult = {
652
+ type: {
653
+ name: "Composite",
654
+ className: "CheckNameResult",
655
+ modelProperties: {
656
+ nameAvailable: {
657
+ serializedName: "nameAvailable",
658
+ type: {
659
+ name: "Boolean"
660
+ }
661
+ },
662
+ message: {
663
+ serializedName: "message",
664
+ nullable: true,
665
+ type: {
666
+ name: "String"
667
+ }
668
+ },
669
+ reason: {
670
+ serializedName: "reason",
671
+ nullable: true,
672
+ type: {
673
+ name: "String"
674
+ }
675
+ }
676
+ }
677
+ }
678
+ };
679
+ const GroupIdInformationResponse = {
680
+ type: {
681
+ name: "Composite",
682
+ className: "GroupIdInformationResponse",
683
+ modelProperties: {
684
+ value: {
685
+ serializedName: "value",
686
+ type: {
687
+ name: "Sequence",
688
+ element: {
689
+ type: {
690
+ name: "Composite",
691
+ className: "GroupIdInformation"
692
+ }
693
+ }
694
+ }
695
+ }
696
+ }
697
+ }
698
+ };
699
+ const GroupIdInformation = {
700
+ type: {
701
+ name: "Composite",
702
+ className: "GroupIdInformation",
703
+ modelProperties: {
704
+ properties: {
705
+ serializedName: "properties",
706
+ type: {
707
+ name: "Composite",
708
+ className: "GroupIdInformationProperties"
709
+ }
710
+ },
711
+ id: {
712
+ serializedName: "id",
713
+ type: {
714
+ name: "String"
715
+ }
716
+ },
717
+ name: {
718
+ constraints: {
719
+ Pattern: new RegExp("^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$")
720
+ },
721
+ serializedName: "name",
722
+ readOnly: true,
723
+ type: {
724
+ name: "String"
725
+ }
726
+ },
727
+ type: {
728
+ serializedName: "type",
729
+ readOnly: true,
730
+ type: {
731
+ name: "String"
732
+ }
733
+ }
734
+ }
735
+ }
736
+ };
737
+ const GroupIdInformationPropertiesAutoGenerated = {
738
+ type: {
739
+ name: "Composite",
740
+ className: "GroupIdInformationPropertiesAutoGenerated",
741
+ modelProperties: {
742
+ groupId: {
743
+ serializedName: "groupId",
744
+ type: {
745
+ name: "String"
746
+ }
747
+ },
748
+ requiredMembers: {
749
+ serializedName: "requiredMembers",
750
+ type: {
751
+ name: "Sequence",
752
+ element: {
753
+ type: {
754
+ name: "String"
755
+ }
756
+ }
757
+ }
758
+ },
759
+ requiredZoneNames: {
760
+ serializedName: "requiredZoneNames",
761
+ type: {
762
+ name: "Sequence",
763
+ element: {
764
+ type: {
765
+ name: "String"
766
+ }
767
+ }
768
+ }
769
+ }
770
+ }
771
+ }
772
+ };
773
+ const PrivateEndpointConnectionsResponse = {
774
+ type: {
775
+ name: "Composite",
776
+ className: "PrivateEndpointConnectionsResponse",
777
+ modelProperties: {
778
+ value: {
779
+ serializedName: "value",
780
+ type: {
781
+ name: "Sequence",
782
+ element: {
783
+ type: {
784
+ name: "Composite",
785
+ className: "PrivateEndpointConnection"
786
+ }
787
+ }
788
+ }
789
+ }
790
+ }
791
+ }
792
+ };
793
+ const PrivateEndpointConnectionProperties = {
794
+ type: {
795
+ name: "Composite",
796
+ className: "PrivateEndpointConnectionProperties",
797
+ modelProperties: Object.assign({}, ConnectionProperties.type.modelProperties)
798
+ }
799
+ };
800
+ const ConnectionPropertiesPrivateEndpoint = {
801
+ type: {
802
+ name: "Composite",
803
+ className: "ConnectionPropertiesPrivateEndpoint",
804
+ modelProperties: Object.assign({}, PrivateEndpoint.type.modelProperties)
805
+ }
806
+ };
807
+ const ConnectionPropertiesPrivateLinkServiceConnectionState = {
808
+ type: {
809
+ name: "Composite",
810
+ className: "ConnectionPropertiesPrivateLinkServiceConnectionState",
811
+ modelProperties: Object.assign({}, ConnectionState.type.modelProperties)
812
+ }
813
+ };
814
+ const DigitalTwinsDescription = {
815
+ type: {
816
+ name: "Composite",
817
+ className: "DigitalTwinsDescription",
818
+ modelProperties: Object.assign(Object.assign({}, DigitalTwinsResource.type.modelProperties), { createdTime: {
819
+ serializedName: "properties.createdTime",
820
+ readOnly: true,
821
+ type: {
822
+ name: "DateTime"
823
+ }
824
+ }, lastUpdatedTime: {
825
+ serializedName: "properties.lastUpdatedTime",
826
+ readOnly: true,
827
+ type: {
828
+ name: "DateTime"
829
+ }
830
+ }, provisioningState: {
831
+ serializedName: "properties.provisioningState",
832
+ readOnly: true,
833
+ type: {
834
+ name: "String"
835
+ }
836
+ }, hostName: {
837
+ serializedName: "properties.hostName",
838
+ readOnly: true,
839
+ nullable: true,
840
+ type: {
841
+ name: "String"
842
+ }
843
+ }, privateEndpointConnections: {
844
+ serializedName: "properties.privateEndpointConnections",
845
+ type: {
846
+ name: "Sequence",
847
+ element: {
848
+ type: {
849
+ name: "Composite",
850
+ className: "PrivateEndpointConnection"
851
+ }
852
+ }
853
+ }
854
+ }, publicNetworkAccess: {
855
+ serializedName: "properties.publicNetworkAccess",
856
+ type: {
857
+ name: "String"
858
+ }
859
+ } })
860
+ }
861
+ };
862
+ const ServiceBus = {
863
+ serializedName: "ServiceBus",
864
+ type: {
865
+ name: "Composite",
866
+ className: "ServiceBus",
867
+ uberParent: "DigitalTwinsEndpointResourceProperties",
868
+ polymorphicDiscriminator: DigitalTwinsEndpointResourceProperties.type.polymorphicDiscriminator,
869
+ modelProperties: Object.assign(Object.assign({}, DigitalTwinsEndpointResourceProperties.type.modelProperties), { primaryConnectionString: {
870
+ serializedName: "primaryConnectionString",
871
+ nullable: true,
872
+ type: {
873
+ name: "String"
874
+ }
875
+ }, secondaryConnectionString: {
876
+ serializedName: "secondaryConnectionString",
877
+ nullable: true,
878
+ type: {
879
+ name: "String"
880
+ }
881
+ }, endpointUri: {
882
+ serializedName: "endpointUri",
883
+ nullable: true,
884
+ type: {
885
+ name: "String"
886
+ }
887
+ }, entityPath: {
888
+ serializedName: "entityPath",
889
+ nullable: true,
890
+ type: {
891
+ name: "String"
892
+ }
893
+ } })
894
+ }
895
+ };
896
+ const EventHub = {
897
+ serializedName: "EventHub",
898
+ type: {
899
+ name: "Composite",
900
+ className: "EventHub",
901
+ uberParent: "DigitalTwinsEndpointResourceProperties",
902
+ polymorphicDiscriminator: DigitalTwinsEndpointResourceProperties.type.polymorphicDiscriminator,
903
+ modelProperties: Object.assign(Object.assign({}, DigitalTwinsEndpointResourceProperties.type.modelProperties), { connectionStringPrimaryKey: {
904
+ serializedName: "connectionStringPrimaryKey",
905
+ nullable: true,
906
+ type: {
907
+ name: "String"
908
+ }
909
+ }, connectionStringSecondaryKey: {
910
+ serializedName: "connectionStringSecondaryKey",
911
+ nullable: true,
912
+ type: {
913
+ name: "String"
914
+ }
915
+ }, endpointUri: {
916
+ serializedName: "endpointUri",
917
+ nullable: true,
918
+ type: {
919
+ name: "String"
920
+ }
921
+ }, entityPath: {
922
+ serializedName: "entityPath",
923
+ nullable: true,
924
+ type: {
925
+ name: "String"
926
+ }
927
+ } })
928
+ }
929
+ };
930
+ const EventGrid = {
931
+ serializedName: "EventGrid",
932
+ type: {
933
+ name: "Composite",
934
+ className: "EventGrid",
935
+ uberParent: "DigitalTwinsEndpointResourceProperties",
936
+ polymorphicDiscriminator: DigitalTwinsEndpointResourceProperties.type.polymorphicDiscriminator,
937
+ modelProperties: Object.assign(Object.assign({}, DigitalTwinsEndpointResourceProperties.type.modelProperties), { topicEndpoint: {
938
+ serializedName: "TopicEndpoint",
939
+ required: true,
940
+ type: {
941
+ name: "String"
942
+ }
943
+ }, accessKey1: {
944
+ serializedName: "accessKey1",
945
+ required: true,
946
+ nullable: true,
947
+ type: {
948
+ name: "String"
949
+ }
950
+ }, accessKey2: {
951
+ serializedName: "accessKey2",
952
+ nullable: true,
953
+ type: {
954
+ name: "String"
955
+ }
956
+ } })
957
+ }
958
+ };
959
+ const DigitalTwinsEndpointResource = {
960
+ type: {
961
+ name: "Composite",
962
+ className: "DigitalTwinsEndpointResource",
963
+ modelProperties: Object.assign(Object.assign({}, ExternalResource.type.modelProperties), { properties: {
964
+ serializedName: "properties",
965
+ type: {
966
+ name: "Composite",
967
+ className: "DigitalTwinsEndpointResourceProperties"
968
+ }
969
+ } })
970
+ }
971
+ };
972
+ const GroupIdInformationProperties = {
973
+ type: {
974
+ name: "Composite",
975
+ className: "GroupIdInformationProperties",
976
+ modelProperties: Object.assign({}, GroupIdInformationPropertiesAutoGenerated.type.modelProperties)
977
+ }
978
+ };
979
+ let discriminators = {
980
+ DigitalTwinsEndpointResourceProperties: DigitalTwinsEndpointResourceProperties,
981
+ "DigitalTwinsEndpointResourceProperties.ServiceBus": ServiceBus,
982
+ "DigitalTwinsEndpointResourceProperties.EventHub": EventHub,
983
+ "DigitalTwinsEndpointResourceProperties.EventGrid": EventGrid
984
+ };
985
+
986
+ var Mappers = /*#__PURE__*/Object.freeze({
987
+ __proto__: null,
988
+ PrivateEndpointConnection: PrivateEndpointConnection,
989
+ ConnectionProperties: ConnectionProperties,
990
+ PrivateEndpoint: PrivateEndpoint,
991
+ ConnectionState: ConnectionState,
992
+ DigitalTwinsResource: DigitalTwinsResource,
993
+ DigitalTwinsIdentity: DigitalTwinsIdentity,
994
+ ErrorResponse: ErrorResponse,
995
+ ErrorDefinition: ErrorDefinition,
996
+ DigitalTwinsPatchDescription: DigitalTwinsPatchDescription,
997
+ DigitalTwinsPatchProperties: DigitalTwinsPatchProperties,
998
+ DigitalTwinsEndpointResourceListResult: DigitalTwinsEndpointResourceListResult,
999
+ DigitalTwinsEndpointResourceProperties: DigitalTwinsEndpointResourceProperties,
1000
+ ExternalResource: ExternalResource,
1001
+ DigitalTwinsDescriptionListResult: DigitalTwinsDescriptionListResult,
1002
+ OperationListResult: OperationListResult,
1003
+ Operation: Operation,
1004
+ OperationDisplay: OperationDisplay,
1005
+ CheckNameRequest: CheckNameRequest,
1006
+ CheckNameResult: CheckNameResult,
1007
+ GroupIdInformationResponse: GroupIdInformationResponse,
1008
+ GroupIdInformation: GroupIdInformation,
1009
+ GroupIdInformationPropertiesAutoGenerated: GroupIdInformationPropertiesAutoGenerated,
1010
+ PrivateEndpointConnectionsResponse: PrivateEndpointConnectionsResponse,
1011
+ PrivateEndpointConnectionProperties: PrivateEndpointConnectionProperties,
1012
+ ConnectionPropertiesPrivateEndpoint: ConnectionPropertiesPrivateEndpoint,
1013
+ ConnectionPropertiesPrivateLinkServiceConnectionState: ConnectionPropertiesPrivateLinkServiceConnectionState,
1014
+ DigitalTwinsDescription: DigitalTwinsDescription,
1015
+ ServiceBus: ServiceBus,
1016
+ EventHub: EventHub,
1017
+ EventGrid: EventGrid,
1018
+ DigitalTwinsEndpointResource: DigitalTwinsEndpointResource,
1019
+ GroupIdInformationProperties: GroupIdInformationProperties,
1020
+ discriminators: discriminators
1021
+ });
1022
+
1023
+ /*
1024
+ * Copyright (c) Microsoft Corporation.
1025
+ * Licensed under the MIT License.
1026
+ *
1027
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1028
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1029
+ */
1030
+ const accept = {
1031
+ parameterPath: "accept",
1032
+ mapper: {
1033
+ defaultValue: "application/json",
1034
+ isConstant: true,
1035
+ serializedName: "Accept",
1036
+ type: {
1037
+ name: "String"
1038
+ }
1039
+ }
1040
+ };
1041
+ const $host = {
1042
+ parameterPath: "$host",
1043
+ mapper: {
1044
+ serializedName: "$host",
1045
+ required: true,
1046
+ type: {
1047
+ name: "String"
1048
+ }
1049
+ },
1050
+ skipEncoding: true
1051
+ };
1052
+ const apiVersion = {
1053
+ parameterPath: "apiVersion",
1054
+ mapper: {
1055
+ defaultValue: "2020-12-01",
1056
+ isConstant: true,
1057
+ serializedName: "api-version",
1058
+ type: {
1059
+ name: "String"
1060
+ }
1061
+ }
1062
+ };
1063
+ const subscriptionId = {
1064
+ parameterPath: "subscriptionId",
1065
+ mapper: {
1066
+ serializedName: "subscriptionId",
1067
+ required: true,
1068
+ type: {
1069
+ name: "String"
1070
+ }
1071
+ }
1072
+ };
1073
+ const resourceGroupName = {
1074
+ parameterPath: "resourceGroupName",
1075
+ mapper: {
1076
+ constraints: {
1077
+ MaxLength: 90,
1078
+ MinLength: 1
1079
+ },
1080
+ serializedName: "resourceGroupName",
1081
+ required: true,
1082
+ type: {
1083
+ name: "String"
1084
+ }
1085
+ }
1086
+ };
1087
+ const resourceName = {
1088
+ parameterPath: "resourceName",
1089
+ mapper: {
1090
+ constraints: {
1091
+ Pattern: new RegExp("^(?!-)[A-Za-z0-9-]{3,63}(?<!-)$"),
1092
+ MaxLength: 63,
1093
+ MinLength: 3
1094
+ },
1095
+ serializedName: "resourceName",
1096
+ required: true,
1097
+ type: {
1098
+ name: "String"
1099
+ }
1100
+ }
1101
+ };
1102
+ const contentType = {
1103
+ parameterPath: ["options", "contentType"],
1104
+ mapper: {
1105
+ defaultValue: "application/json",
1106
+ isConstant: true,
1107
+ serializedName: "Content-Type",
1108
+ type: {
1109
+ name: "String"
1110
+ }
1111
+ }
1112
+ };
1113
+ const digitalTwinsCreate = {
1114
+ parameterPath: "digitalTwinsCreate",
1115
+ mapper: DigitalTwinsDescription
1116
+ };
1117
+ const digitalTwinsPatchDescription = {
1118
+ parameterPath: "digitalTwinsPatchDescription",
1119
+ mapper: DigitalTwinsPatchDescription
1120
+ };
1121
+ const digitalTwinsInstanceCheckName = {
1122
+ parameterPath: "digitalTwinsInstanceCheckName",
1123
+ mapper: CheckNameRequest
1124
+ };
1125
+ const location = {
1126
+ parameterPath: "location",
1127
+ mapper: {
1128
+ constraints: {
1129
+ MinLength: 3
1130
+ },
1131
+ serializedName: "location",
1132
+ required: true,
1133
+ type: {
1134
+ name: "String"
1135
+ }
1136
+ }
1137
+ };
1138
+ const nextLink = {
1139
+ parameterPath: "nextLink",
1140
+ mapper: {
1141
+ serializedName: "nextLink",
1142
+ required: true,
1143
+ type: {
1144
+ name: "String"
1145
+ }
1146
+ },
1147
+ skipEncoding: true
1148
+ };
1149
+ const endpointName = {
1150
+ parameterPath: "endpointName",
1151
+ mapper: {
1152
+ constraints: {
1153
+ Pattern: new RegExp("^(?![0-9]+$)(?!-)[a-zA-Z0-9-]{2,49}[a-zA-Z0-9]$"),
1154
+ MaxLength: 49,
1155
+ MinLength: 2
1156
+ },
1157
+ serializedName: "endpointName",
1158
+ required: true,
1159
+ type: {
1160
+ name: "String"
1161
+ }
1162
+ }
1163
+ };
1164
+ const endpointDescription = {
1165
+ parameterPath: "endpointDescription",
1166
+ mapper: DigitalTwinsEndpointResource
1167
+ };
1168
+ const resourceId = {
1169
+ parameterPath: "resourceId",
1170
+ mapper: {
1171
+ serializedName: "resourceId",
1172
+ required: true,
1173
+ type: {
1174
+ name: "String"
1175
+ }
1176
+ }
1177
+ };
1178
+ const privateEndpointConnectionName = {
1179
+ parameterPath: "privateEndpointConnectionName",
1180
+ mapper: {
1181
+ serializedName: "privateEndpointConnectionName",
1182
+ required: true,
1183
+ type: {
1184
+ name: "String"
1185
+ }
1186
+ }
1187
+ };
1188
+ const privateEndpointConnection = {
1189
+ parameterPath: "privateEndpointConnection",
1190
+ mapper: PrivateEndpointConnection
1191
+ };
1192
+
1193
+ /*
1194
+ * Copyright (c) Microsoft Corporation.
1195
+ * Licensed under the MIT License.
1196
+ *
1197
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1198
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1199
+ */
1200
+ class LroImpl {
1201
+ constructor(sendOperationFn, args, spec, requestPath = spec.path, requestMethod = spec.httpMethod) {
1202
+ this.sendOperationFn = sendOperationFn;
1203
+ this.args = args;
1204
+ this.spec = spec;
1205
+ this.requestPath = requestPath;
1206
+ this.requestMethod = requestMethod;
1207
+ }
1208
+ sendInitialRequest() {
1209
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1210
+ return this.sendOperationFn(this.args, this.spec);
1211
+ });
1212
+ }
1213
+ sendPollRequest(path) {
1214
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1215
+ const _a = this.spec, restSpec = tslib.__rest(_a, ["requestBody"]);
1216
+ return this.sendOperationFn(this.args, Object.assign(Object.assign({}, restSpec), { path, httpMethod: "GET" }));
1217
+ });
1218
+ }
1219
+ }
1220
+
1221
+ /*
1222
+ * Copyright (c) Microsoft Corporation.
1223
+ * Licensed under the MIT License.
1224
+ *
1225
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1226
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1227
+ */
1228
+ /// <reference lib="esnext.asynciterable" />
1229
+ /** Class containing DigitalTwins operations. */
1230
+ class DigitalTwinsImpl {
1231
+ /**
1232
+ * Initialize a new instance of the class DigitalTwins class.
1233
+ * @param client Reference to the service client
1234
+ */
1235
+ constructor(client) {
1236
+ this.client = client;
1237
+ }
1238
+ /**
1239
+ * Get all the DigitalTwinsInstances in a subscription.
1240
+ * @param options The options parameters.
1241
+ */
1242
+ list(options) {
1243
+ const iter = this.listPagingAll(options);
1244
+ return {
1245
+ next() {
1246
+ return iter.next();
1247
+ },
1248
+ [Symbol.asyncIterator]() {
1249
+ return this;
1250
+ },
1251
+ byPage: () => {
1252
+ return this.listPagingPage(options);
1253
+ }
1254
+ };
1255
+ }
1256
+ listPagingPage(options) {
1257
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1258
+ let result = yield tslib.__await(this._list(options));
1259
+ yield yield tslib.__await(result.value || []);
1260
+ let continuationToken = result.nextLink;
1261
+ while (continuationToken) {
1262
+ result = yield tslib.__await(this._listNext(continuationToken, options));
1263
+ continuationToken = result.nextLink;
1264
+ yield yield tslib.__await(result.value || []);
1265
+ }
1266
+ });
1267
+ }
1268
+ listPagingAll(options) {
1269
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1270
+ var e_1, _a;
1271
+ try {
1272
+ for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1273
+ const page = _c.value;
1274
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1275
+ }
1276
+ }
1277
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1278
+ finally {
1279
+ try {
1280
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1281
+ }
1282
+ finally { if (e_1) throw e_1.error; }
1283
+ }
1284
+ });
1285
+ }
1286
+ /**
1287
+ * Get all the DigitalTwinsInstances in a resource group.
1288
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1289
+ * @param options The options parameters.
1290
+ */
1291
+ listByResourceGroup(resourceGroupName, options) {
1292
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
1293
+ return {
1294
+ next() {
1295
+ return iter.next();
1296
+ },
1297
+ [Symbol.asyncIterator]() {
1298
+ return this;
1299
+ },
1300
+ byPage: () => {
1301
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
1302
+ }
1303
+ };
1304
+ }
1305
+ listByResourceGroupPagingPage(resourceGroupName, options) {
1306
+ return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
1307
+ let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
1308
+ yield yield tslib.__await(result.value || []);
1309
+ let continuationToken = result.nextLink;
1310
+ while (continuationToken) {
1311
+ result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
1312
+ continuationToken = result.nextLink;
1313
+ yield yield tslib.__await(result.value || []);
1314
+ }
1315
+ });
1316
+ }
1317
+ listByResourceGroupPagingAll(resourceGroupName, options) {
1318
+ return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
1319
+ var e_2, _a;
1320
+ try {
1321
+ for (var _b = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1322
+ const page = _c.value;
1323
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1324
+ }
1325
+ }
1326
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
1327
+ finally {
1328
+ try {
1329
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1330
+ }
1331
+ finally { if (e_2) throw e_2.error; }
1332
+ }
1333
+ });
1334
+ }
1335
+ /**
1336
+ * Get DigitalTwinsInstances resource.
1337
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1338
+ * @param resourceName The name of the DigitalTwinsInstance.
1339
+ * @param options The options parameters.
1340
+ */
1341
+ get(resourceGroupName, resourceName, options) {
1342
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, getOperationSpec);
1343
+ }
1344
+ /**
1345
+ * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is
1346
+ * to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified
1347
+ * values in a new body to update the DigitalTwinsInstance.
1348
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1349
+ * @param resourceName The name of the DigitalTwinsInstance.
1350
+ * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata.
1351
+ * @param options The options parameters.
1352
+ */
1353
+ beginCreateOrUpdate(resourceGroupName, resourceName, digitalTwinsCreate, options) {
1354
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1355
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1356
+ return this.client.sendOperationRequest(args, spec);
1357
+ });
1358
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1359
+ var _a;
1360
+ let currentRawResponse = undefined;
1361
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1362
+ const callback = (rawResponse, flatResponse) => {
1363
+ currentRawResponse = rawResponse;
1364
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1365
+ };
1366
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1367
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1368
+ return {
1369
+ flatResponse,
1370
+ rawResponse: {
1371
+ statusCode: currentRawResponse.status,
1372
+ body: currentRawResponse.parsedBody,
1373
+ headers: currentRawResponse.headers.toJSON()
1374
+ }
1375
+ };
1376
+ });
1377
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, digitalTwinsCreate, options }, createOrUpdateOperationSpec);
1378
+ return new coreLro.LroEngine(lro, {
1379
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1380
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1381
+ });
1382
+ });
1383
+ }
1384
+ /**
1385
+ * Create or update the metadata of a DigitalTwinsInstance. The usual pattern to modify a property is
1386
+ * to retrieve the DigitalTwinsInstance and security metadata, and then combine them with the modified
1387
+ * values in a new body to update the DigitalTwinsInstance.
1388
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1389
+ * @param resourceName The name of the DigitalTwinsInstance.
1390
+ * @param digitalTwinsCreate The DigitalTwinsInstance and security metadata.
1391
+ * @param options The options parameters.
1392
+ */
1393
+ beginCreateOrUpdateAndWait(resourceGroupName, resourceName, digitalTwinsCreate, options) {
1394
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1395
+ const poller = yield this.beginCreateOrUpdate(resourceGroupName, resourceName, digitalTwinsCreate, options);
1396
+ return poller.pollUntilDone();
1397
+ });
1398
+ }
1399
+ /**
1400
+ * Update metadata of DigitalTwinsInstance.
1401
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1402
+ * @param resourceName The name of the DigitalTwinsInstance.
1403
+ * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata.
1404
+ * @param options The options parameters.
1405
+ */
1406
+ beginUpdate(resourceGroupName, resourceName, digitalTwinsPatchDescription, options) {
1407
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1408
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1409
+ return this.client.sendOperationRequest(args, spec);
1410
+ });
1411
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1412
+ var _a;
1413
+ let currentRawResponse = undefined;
1414
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1415
+ const callback = (rawResponse, flatResponse) => {
1416
+ currentRawResponse = rawResponse;
1417
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1418
+ };
1419
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1420
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1421
+ return {
1422
+ flatResponse,
1423
+ rawResponse: {
1424
+ statusCode: currentRawResponse.status,
1425
+ body: currentRawResponse.parsedBody,
1426
+ headers: currentRawResponse.headers.toJSON()
1427
+ }
1428
+ };
1429
+ });
1430
+ const lro = new LroImpl(sendOperation, {
1431
+ resourceGroupName,
1432
+ resourceName,
1433
+ digitalTwinsPatchDescription,
1434
+ options
1435
+ }, updateOperationSpec);
1436
+ return new coreLro.LroEngine(lro, {
1437
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1438
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1439
+ });
1440
+ });
1441
+ }
1442
+ /**
1443
+ * Update metadata of DigitalTwinsInstance.
1444
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1445
+ * @param resourceName The name of the DigitalTwinsInstance.
1446
+ * @param digitalTwinsPatchDescription The DigitalTwinsInstance and security metadata.
1447
+ * @param options The options parameters.
1448
+ */
1449
+ beginUpdateAndWait(resourceGroupName, resourceName, digitalTwinsPatchDescription, options) {
1450
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1451
+ const poller = yield this.beginUpdate(resourceGroupName, resourceName, digitalTwinsPatchDescription, options);
1452
+ return poller.pollUntilDone();
1453
+ });
1454
+ }
1455
+ /**
1456
+ * Delete a DigitalTwinsInstance.
1457
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1458
+ * @param resourceName The name of the DigitalTwinsInstance.
1459
+ * @param options The options parameters.
1460
+ */
1461
+ beginDelete(resourceGroupName, resourceName, options) {
1462
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1463
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1464
+ return this.client.sendOperationRequest(args, spec);
1465
+ });
1466
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1467
+ var _a;
1468
+ let currentRawResponse = undefined;
1469
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1470
+ const callback = (rawResponse, flatResponse) => {
1471
+ currentRawResponse = rawResponse;
1472
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1473
+ };
1474
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1475
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1476
+ return {
1477
+ flatResponse,
1478
+ rawResponse: {
1479
+ statusCode: currentRawResponse.status,
1480
+ body: currentRawResponse.parsedBody,
1481
+ headers: currentRawResponse.headers.toJSON()
1482
+ }
1483
+ };
1484
+ });
1485
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, options }, deleteOperationSpec);
1486
+ return new coreLro.LroEngine(lro, {
1487
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1488
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1489
+ });
1490
+ });
1491
+ }
1492
+ /**
1493
+ * Delete a DigitalTwinsInstance.
1494
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1495
+ * @param resourceName The name of the DigitalTwinsInstance.
1496
+ * @param options The options parameters.
1497
+ */
1498
+ beginDeleteAndWait(resourceGroupName, resourceName, options) {
1499
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1500
+ const poller = yield this.beginDelete(resourceGroupName, resourceName, options);
1501
+ return poller.pollUntilDone();
1502
+ });
1503
+ }
1504
+ /**
1505
+ * Get all the DigitalTwinsInstances in a subscription.
1506
+ * @param options The options parameters.
1507
+ */
1508
+ _list(options) {
1509
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
1510
+ }
1511
+ /**
1512
+ * Get all the DigitalTwinsInstances in a resource group.
1513
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1514
+ * @param options The options parameters.
1515
+ */
1516
+ _listByResourceGroup(resourceGroupName, options) {
1517
+ return this.client.sendOperationRequest({ resourceGroupName, options }, listByResourceGroupOperationSpec);
1518
+ }
1519
+ /**
1520
+ * Check if a DigitalTwinsInstance name is available.
1521
+ * @param location Location of DigitalTwinsInstance.
1522
+ * @param digitalTwinsInstanceCheckName Set the name parameter in the DigitalTwinsInstanceCheckName
1523
+ * structure to the name of the DigitalTwinsInstance to check.
1524
+ * @param options The options parameters.
1525
+ */
1526
+ checkNameAvailability(location, digitalTwinsInstanceCheckName, options) {
1527
+ return this.client.sendOperationRequest({ location, digitalTwinsInstanceCheckName, options }, checkNameAvailabilityOperationSpec);
1528
+ }
1529
+ /**
1530
+ * ListNext
1531
+ * @param nextLink The nextLink from the previous successful call to the List method.
1532
+ * @param options The options parameters.
1533
+ */
1534
+ _listNext(nextLink, options) {
1535
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec);
1536
+ }
1537
+ /**
1538
+ * ListByResourceGroupNext
1539
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1540
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
1541
+ * @param options The options parameters.
1542
+ */
1543
+ _listByResourceGroupNext(resourceGroupName, nextLink, options) {
1544
+ return this.client.sendOperationRequest({ resourceGroupName, nextLink, options }, listByResourceGroupNextOperationSpec);
1545
+ }
1546
+ }
1547
+ // Operation Specifications
1548
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
1549
+ const getOperationSpec = {
1550
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}",
1551
+ httpMethod: "GET",
1552
+ responses: {
1553
+ 200: {
1554
+ bodyMapper: DigitalTwinsDescription
1555
+ },
1556
+ default: {
1557
+ bodyMapper: ErrorResponse
1558
+ }
1559
+ },
1560
+ queryParameters: [apiVersion],
1561
+ urlParameters: [
1562
+ $host,
1563
+ subscriptionId,
1564
+ resourceGroupName,
1565
+ resourceName
1566
+ ],
1567
+ headerParameters: [accept],
1568
+ serializer
1569
+ };
1570
+ const createOrUpdateOperationSpec = {
1571
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}",
1572
+ httpMethod: "PUT",
1573
+ responses: {
1574
+ 200: {
1575
+ bodyMapper: DigitalTwinsDescription
1576
+ },
1577
+ 201: {
1578
+ bodyMapper: DigitalTwinsDescription
1579
+ },
1580
+ 202: {
1581
+ bodyMapper: DigitalTwinsDescription
1582
+ },
1583
+ 204: {
1584
+ bodyMapper: DigitalTwinsDescription
1585
+ },
1586
+ default: {
1587
+ bodyMapper: ErrorResponse
1588
+ }
1589
+ },
1590
+ requestBody: digitalTwinsCreate,
1591
+ queryParameters: [apiVersion],
1592
+ urlParameters: [
1593
+ $host,
1594
+ subscriptionId,
1595
+ resourceGroupName,
1596
+ resourceName
1597
+ ],
1598
+ headerParameters: [accept, contentType],
1599
+ mediaType: "json",
1600
+ serializer
1601
+ };
1602
+ const updateOperationSpec = {
1603
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}",
1604
+ httpMethod: "PATCH",
1605
+ responses: {
1606
+ 200: {
1607
+ bodyMapper: DigitalTwinsDescription
1608
+ },
1609
+ 201: {
1610
+ bodyMapper: DigitalTwinsDescription
1611
+ },
1612
+ 202: {
1613
+ bodyMapper: DigitalTwinsDescription
1614
+ },
1615
+ 204: {
1616
+ bodyMapper: DigitalTwinsDescription
1617
+ },
1618
+ default: {
1619
+ bodyMapper: ErrorResponse
1620
+ }
1621
+ },
1622
+ requestBody: digitalTwinsPatchDescription,
1623
+ queryParameters: [apiVersion],
1624
+ urlParameters: [
1625
+ $host,
1626
+ subscriptionId,
1627
+ resourceGroupName,
1628
+ resourceName
1629
+ ],
1630
+ headerParameters: [accept, contentType],
1631
+ mediaType: "json",
1632
+ serializer
1633
+ };
1634
+ const deleteOperationSpec = {
1635
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}",
1636
+ httpMethod: "DELETE",
1637
+ responses: {
1638
+ 200: {
1639
+ bodyMapper: DigitalTwinsDescription
1640
+ },
1641
+ 201: {
1642
+ bodyMapper: DigitalTwinsDescription
1643
+ },
1644
+ 202: {
1645
+ bodyMapper: DigitalTwinsDescription
1646
+ },
1647
+ 204: {
1648
+ bodyMapper: DigitalTwinsDescription
1649
+ },
1650
+ default: {
1651
+ bodyMapper: ErrorResponse
1652
+ }
1653
+ },
1654
+ queryParameters: [apiVersion],
1655
+ urlParameters: [
1656
+ $host,
1657
+ subscriptionId,
1658
+ resourceGroupName,
1659
+ resourceName
1660
+ ],
1661
+ headerParameters: [accept],
1662
+ serializer
1663
+ };
1664
+ const listOperationSpec = {
1665
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.DigitalTwins/digitalTwinsInstances",
1666
+ httpMethod: "GET",
1667
+ responses: {
1668
+ 200: {
1669
+ bodyMapper: DigitalTwinsDescriptionListResult
1670
+ },
1671
+ default: {
1672
+ bodyMapper: ErrorResponse
1673
+ }
1674
+ },
1675
+ queryParameters: [apiVersion],
1676
+ urlParameters: [$host, subscriptionId],
1677
+ headerParameters: [accept],
1678
+ serializer
1679
+ };
1680
+ const listByResourceGroupOperationSpec = {
1681
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances",
1682
+ httpMethod: "GET",
1683
+ responses: {
1684
+ 200: {
1685
+ bodyMapper: DigitalTwinsDescriptionListResult
1686
+ },
1687
+ default: {
1688
+ bodyMapper: ErrorResponse
1689
+ }
1690
+ },
1691
+ queryParameters: [apiVersion],
1692
+ urlParameters: [
1693
+ $host,
1694
+ subscriptionId,
1695
+ resourceGroupName
1696
+ ],
1697
+ headerParameters: [accept],
1698
+ serializer
1699
+ };
1700
+ const checkNameAvailabilityOperationSpec = {
1701
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.DigitalTwins/locations/{location}/checkNameAvailability",
1702
+ httpMethod: "POST",
1703
+ responses: {
1704
+ 200: {
1705
+ bodyMapper: CheckNameResult
1706
+ },
1707
+ default: {
1708
+ bodyMapper: ErrorResponse
1709
+ }
1710
+ },
1711
+ requestBody: digitalTwinsInstanceCheckName,
1712
+ queryParameters: [apiVersion],
1713
+ urlParameters: [
1714
+ $host,
1715
+ subscriptionId,
1716
+ location
1717
+ ],
1718
+ headerParameters: [accept, contentType],
1719
+ mediaType: "json",
1720
+ serializer
1721
+ };
1722
+ const listNextOperationSpec = {
1723
+ path: "{nextLink}",
1724
+ httpMethod: "GET",
1725
+ responses: {
1726
+ 200: {
1727
+ bodyMapper: DigitalTwinsDescriptionListResult
1728
+ },
1729
+ default: {
1730
+ bodyMapper: ErrorResponse
1731
+ }
1732
+ },
1733
+ queryParameters: [apiVersion],
1734
+ urlParameters: [
1735
+ $host,
1736
+ subscriptionId,
1737
+ nextLink
1738
+ ],
1739
+ headerParameters: [accept],
1740
+ serializer
1741
+ };
1742
+ const listByResourceGroupNextOperationSpec = {
1743
+ path: "{nextLink}",
1744
+ httpMethod: "GET",
1745
+ responses: {
1746
+ 200: {
1747
+ bodyMapper: DigitalTwinsDescriptionListResult
1748
+ },
1749
+ default: {
1750
+ bodyMapper: ErrorResponse
1751
+ }
1752
+ },
1753
+ queryParameters: [apiVersion],
1754
+ urlParameters: [
1755
+ $host,
1756
+ subscriptionId,
1757
+ resourceGroupName,
1758
+ nextLink
1759
+ ],
1760
+ headerParameters: [accept],
1761
+ serializer
1762
+ };
1763
+
1764
+ /*
1765
+ * Copyright (c) Microsoft Corporation.
1766
+ * Licensed under the MIT License.
1767
+ *
1768
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1769
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1770
+ */
1771
+ /// <reference lib="esnext.asynciterable" />
1772
+ /** Class containing DigitalTwinsEndpoint operations. */
1773
+ class DigitalTwinsEndpointImpl {
1774
+ /**
1775
+ * Initialize a new instance of the class DigitalTwinsEndpoint class.
1776
+ * @param client Reference to the service client
1777
+ */
1778
+ constructor(client) {
1779
+ this.client = client;
1780
+ }
1781
+ /**
1782
+ * Get DigitalTwinsInstance Endpoints.
1783
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1784
+ * @param resourceName The name of the DigitalTwinsInstance.
1785
+ * @param options The options parameters.
1786
+ */
1787
+ list(resourceGroupName, resourceName, options) {
1788
+ const iter = this.listPagingAll(resourceGroupName, resourceName, options);
1789
+ return {
1790
+ next() {
1791
+ return iter.next();
1792
+ },
1793
+ [Symbol.asyncIterator]() {
1794
+ return this;
1795
+ },
1796
+ byPage: () => {
1797
+ return this.listPagingPage(resourceGroupName, resourceName, options);
1798
+ }
1799
+ };
1800
+ }
1801
+ listPagingPage(resourceGroupName, resourceName, options) {
1802
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
1803
+ let result = yield tslib.__await(this._list(resourceGroupName, resourceName, options));
1804
+ yield yield tslib.__await(result.value || []);
1805
+ let continuationToken = result.nextLink;
1806
+ while (continuationToken) {
1807
+ result = yield tslib.__await(this._listNext(resourceGroupName, resourceName, continuationToken, options));
1808
+ continuationToken = result.nextLink;
1809
+ yield yield tslib.__await(result.value || []);
1810
+ }
1811
+ });
1812
+ }
1813
+ listPagingAll(resourceGroupName, resourceName, options) {
1814
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
1815
+ var e_1, _a;
1816
+ try {
1817
+ for (var _b = tslib.__asyncValues(this.listPagingPage(resourceGroupName, resourceName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1818
+ const page = _c.value;
1819
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1820
+ }
1821
+ }
1822
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
1823
+ finally {
1824
+ try {
1825
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1826
+ }
1827
+ finally { if (e_1) throw e_1.error; }
1828
+ }
1829
+ });
1830
+ }
1831
+ /**
1832
+ * Get DigitalTwinsInstance Endpoints.
1833
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1834
+ * @param resourceName The name of the DigitalTwinsInstance.
1835
+ * @param options The options parameters.
1836
+ */
1837
+ _list(resourceGroupName, resourceName, options) {
1838
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, listOperationSpec$1);
1839
+ }
1840
+ /**
1841
+ * Get DigitalTwinsInstances Endpoint.
1842
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1843
+ * @param resourceName The name of the DigitalTwinsInstance.
1844
+ * @param endpointName Name of Endpoint Resource.
1845
+ * @param options The options parameters.
1846
+ */
1847
+ get(resourceGroupName, resourceName, endpointName, options) {
1848
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, endpointName, options }, getOperationSpec$1);
1849
+ }
1850
+ /**
1851
+ * Create or update DigitalTwinsInstance endpoint.
1852
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1853
+ * @param resourceName The name of the DigitalTwinsInstance.
1854
+ * @param endpointName Name of Endpoint Resource.
1855
+ * @param endpointDescription The DigitalTwinsInstance endpoint metadata and security metadata.
1856
+ * @param options The options parameters.
1857
+ */
1858
+ beginCreateOrUpdate(resourceGroupName, resourceName, endpointName, endpointDescription, options) {
1859
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1860
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1861
+ return this.client.sendOperationRequest(args, spec);
1862
+ });
1863
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1864
+ var _a;
1865
+ let currentRawResponse = undefined;
1866
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1867
+ const callback = (rawResponse, flatResponse) => {
1868
+ currentRawResponse = rawResponse;
1869
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1870
+ };
1871
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1872
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1873
+ return {
1874
+ flatResponse,
1875
+ rawResponse: {
1876
+ statusCode: currentRawResponse.status,
1877
+ body: currentRawResponse.parsedBody,
1878
+ headers: currentRawResponse.headers.toJSON()
1879
+ }
1880
+ };
1881
+ });
1882
+ const lro = new LroImpl(sendOperation, {
1883
+ resourceGroupName,
1884
+ resourceName,
1885
+ endpointName,
1886
+ endpointDescription,
1887
+ options
1888
+ }, createOrUpdateOperationSpec$1);
1889
+ return new coreLro.LroEngine(lro, {
1890
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1891
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1892
+ });
1893
+ });
1894
+ }
1895
+ /**
1896
+ * Create or update DigitalTwinsInstance endpoint.
1897
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1898
+ * @param resourceName The name of the DigitalTwinsInstance.
1899
+ * @param endpointName Name of Endpoint Resource.
1900
+ * @param endpointDescription The DigitalTwinsInstance endpoint metadata and security metadata.
1901
+ * @param options The options parameters.
1902
+ */
1903
+ beginCreateOrUpdateAndWait(resourceGroupName, resourceName, endpointName, endpointDescription, options) {
1904
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1905
+ const poller = yield this.beginCreateOrUpdate(resourceGroupName, resourceName, endpointName, endpointDescription, options);
1906
+ return poller.pollUntilDone();
1907
+ });
1908
+ }
1909
+ /**
1910
+ * Delete a DigitalTwinsInstance endpoint.
1911
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1912
+ * @param resourceName The name of the DigitalTwinsInstance.
1913
+ * @param endpointName Name of Endpoint Resource.
1914
+ * @param options The options parameters.
1915
+ */
1916
+ beginDelete(resourceGroupName, resourceName, endpointName, options) {
1917
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1918
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1919
+ return this.client.sendOperationRequest(args, spec);
1920
+ });
1921
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1922
+ var _a;
1923
+ let currentRawResponse = undefined;
1924
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1925
+ const callback = (rawResponse, flatResponse) => {
1926
+ currentRawResponse = rawResponse;
1927
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1928
+ };
1929
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1930
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1931
+ return {
1932
+ flatResponse,
1933
+ rawResponse: {
1934
+ statusCode: currentRawResponse.status,
1935
+ body: currentRawResponse.parsedBody,
1936
+ headers: currentRawResponse.headers.toJSON()
1937
+ }
1938
+ };
1939
+ });
1940
+ const lro = new LroImpl(sendOperation, { resourceGroupName, resourceName, endpointName, options }, deleteOperationSpec$1);
1941
+ return new coreLro.LroEngine(lro, {
1942
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1943
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1944
+ });
1945
+ });
1946
+ }
1947
+ /**
1948
+ * Delete a DigitalTwinsInstance endpoint.
1949
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1950
+ * @param resourceName The name of the DigitalTwinsInstance.
1951
+ * @param endpointName Name of Endpoint Resource.
1952
+ * @param options The options parameters.
1953
+ */
1954
+ beginDeleteAndWait(resourceGroupName, resourceName, endpointName, options) {
1955
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1956
+ const poller = yield this.beginDelete(resourceGroupName, resourceName, endpointName, options);
1957
+ return poller.pollUntilDone();
1958
+ });
1959
+ }
1960
+ /**
1961
+ * ListNext
1962
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
1963
+ * @param resourceName The name of the DigitalTwinsInstance.
1964
+ * @param nextLink The nextLink from the previous successful call to the List method.
1965
+ * @param options The options parameters.
1966
+ */
1967
+ _listNext(resourceGroupName, resourceName, nextLink, options) {
1968
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, nextLink, options }, listNextOperationSpec$1);
1969
+ }
1970
+ }
1971
+ // Operation Specifications
1972
+ const serializer$1 = coreClient.createSerializer(Mappers, /* isXml */ false);
1973
+ const listOperationSpec$1 = {
1974
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints",
1975
+ httpMethod: "GET",
1976
+ responses: {
1977
+ 200: {
1978
+ bodyMapper: DigitalTwinsEndpointResourceListResult
1979
+ },
1980
+ default: {
1981
+ bodyMapper: ErrorResponse
1982
+ }
1983
+ },
1984
+ queryParameters: [apiVersion],
1985
+ urlParameters: [
1986
+ $host,
1987
+ subscriptionId,
1988
+ resourceGroupName,
1989
+ resourceName
1990
+ ],
1991
+ headerParameters: [accept],
1992
+ serializer: serializer$1
1993
+ };
1994
+ const getOperationSpec$1 = {
1995
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}",
1996
+ httpMethod: "GET",
1997
+ responses: {
1998
+ 200: {
1999
+ bodyMapper: DigitalTwinsEndpointResource
2000
+ },
2001
+ default: {
2002
+ bodyMapper: ErrorResponse
2003
+ }
2004
+ },
2005
+ queryParameters: [apiVersion],
2006
+ urlParameters: [
2007
+ $host,
2008
+ subscriptionId,
2009
+ resourceGroupName,
2010
+ resourceName,
2011
+ endpointName
2012
+ ],
2013
+ headerParameters: [accept],
2014
+ serializer: serializer$1
2015
+ };
2016
+ const createOrUpdateOperationSpec$1 = {
2017
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}",
2018
+ httpMethod: "PUT",
2019
+ responses: {
2020
+ 200: {
2021
+ bodyMapper: DigitalTwinsEndpointResource
2022
+ },
2023
+ 201: {
2024
+ bodyMapper: DigitalTwinsEndpointResource
2025
+ },
2026
+ 202: {
2027
+ bodyMapper: DigitalTwinsEndpointResource
2028
+ },
2029
+ 204: {
2030
+ bodyMapper: DigitalTwinsEndpointResource
2031
+ },
2032
+ default: {
2033
+ bodyMapper: ErrorResponse
2034
+ }
2035
+ },
2036
+ requestBody: endpointDescription,
2037
+ queryParameters: [apiVersion],
2038
+ urlParameters: [
2039
+ $host,
2040
+ subscriptionId,
2041
+ resourceGroupName,
2042
+ resourceName,
2043
+ endpointName
2044
+ ],
2045
+ headerParameters: [accept, contentType],
2046
+ mediaType: "json",
2047
+ serializer: serializer$1
2048
+ };
2049
+ const deleteOperationSpec$1 = {
2050
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/endpoints/{endpointName}",
2051
+ httpMethod: "DELETE",
2052
+ responses: {
2053
+ 200: {
2054
+ bodyMapper: DigitalTwinsEndpointResource
2055
+ },
2056
+ 201: {
2057
+ bodyMapper: DigitalTwinsEndpointResource
2058
+ },
2059
+ 202: {
2060
+ bodyMapper: DigitalTwinsEndpointResource
2061
+ },
2062
+ 204: {
2063
+ bodyMapper: DigitalTwinsEndpointResource
2064
+ },
2065
+ default: {
2066
+ bodyMapper: ErrorResponse
2067
+ }
2068
+ },
2069
+ queryParameters: [apiVersion],
2070
+ urlParameters: [
2071
+ $host,
2072
+ subscriptionId,
2073
+ resourceGroupName,
2074
+ resourceName,
2075
+ endpointName
2076
+ ],
2077
+ headerParameters: [accept],
2078
+ serializer: serializer$1
2079
+ };
2080
+ const listNextOperationSpec$1 = {
2081
+ path: "{nextLink}",
2082
+ httpMethod: "GET",
2083
+ responses: {
2084
+ 200: {
2085
+ bodyMapper: DigitalTwinsEndpointResourceListResult
2086
+ },
2087
+ default: {
2088
+ bodyMapper: ErrorResponse
2089
+ }
2090
+ },
2091
+ queryParameters: [apiVersion],
2092
+ urlParameters: [
2093
+ $host,
2094
+ subscriptionId,
2095
+ resourceGroupName,
2096
+ resourceName,
2097
+ nextLink
2098
+ ],
2099
+ headerParameters: [accept],
2100
+ serializer: serializer$1
2101
+ };
2102
+
2103
+ /*
2104
+ * Copyright (c) Microsoft Corporation.
2105
+ * Licensed under the MIT License.
2106
+ *
2107
+ * Code generated by Microsoft (R) AutoRest Code Generator.
2108
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2109
+ */
2110
+ /// <reference lib="esnext.asynciterable" />
2111
+ /** Class containing Operations operations. */
2112
+ class OperationsImpl {
2113
+ /**
2114
+ * Initialize a new instance of the class Operations class.
2115
+ * @param client Reference to the service client
2116
+ */
2117
+ constructor(client) {
2118
+ this.client = client;
2119
+ }
2120
+ /**
2121
+ * Lists all of the available DigitalTwins service REST API operations.
2122
+ * @param options The options parameters.
2123
+ */
2124
+ list(options) {
2125
+ const iter = this.listPagingAll(options);
2126
+ return {
2127
+ next() {
2128
+ return iter.next();
2129
+ },
2130
+ [Symbol.asyncIterator]() {
2131
+ return this;
2132
+ },
2133
+ byPage: () => {
2134
+ return this.listPagingPage(options);
2135
+ }
2136
+ };
2137
+ }
2138
+ listPagingPage(options) {
2139
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
2140
+ let result = yield tslib.__await(this._list(options));
2141
+ yield yield tslib.__await(result.value || []);
2142
+ let continuationToken = result.nextLink;
2143
+ while (continuationToken) {
2144
+ result = yield tslib.__await(this._listNext(continuationToken, options));
2145
+ continuationToken = result.nextLink;
2146
+ yield yield tslib.__await(result.value || []);
2147
+ }
2148
+ });
2149
+ }
2150
+ listPagingAll(options) {
2151
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
2152
+ var e_1, _a;
2153
+ try {
2154
+ for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
2155
+ const page = _c.value;
2156
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
2157
+ }
2158
+ }
2159
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
2160
+ finally {
2161
+ try {
2162
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
2163
+ }
2164
+ finally { if (e_1) throw e_1.error; }
2165
+ }
2166
+ });
2167
+ }
2168
+ /**
2169
+ * Lists all of the available DigitalTwins service REST API operations.
2170
+ * @param options The options parameters.
2171
+ */
2172
+ _list(options) {
2173
+ return this.client.sendOperationRequest({ options }, listOperationSpec$2);
2174
+ }
2175
+ /**
2176
+ * ListNext
2177
+ * @param nextLink The nextLink from the previous successful call to the List method.
2178
+ * @param options The options parameters.
2179
+ */
2180
+ _listNext(nextLink, options) {
2181
+ return this.client.sendOperationRequest({ nextLink, options }, listNextOperationSpec$2);
2182
+ }
2183
+ }
2184
+ // Operation Specifications
2185
+ const serializer$2 = coreClient.createSerializer(Mappers, /* isXml */ false);
2186
+ const listOperationSpec$2 = {
2187
+ path: "/providers/Microsoft.DigitalTwins/operations",
2188
+ httpMethod: "GET",
2189
+ responses: {
2190
+ 200: {
2191
+ bodyMapper: OperationListResult
2192
+ },
2193
+ default: {
2194
+ bodyMapper: ErrorResponse
2195
+ }
2196
+ },
2197
+ queryParameters: [apiVersion],
2198
+ urlParameters: [$host],
2199
+ headerParameters: [accept],
2200
+ serializer: serializer$2
2201
+ };
2202
+ const listNextOperationSpec$2 = {
2203
+ path: "{nextLink}",
2204
+ httpMethod: "GET",
2205
+ responses: {
2206
+ 200: {
2207
+ bodyMapper: OperationListResult
2208
+ },
2209
+ default: {
2210
+ bodyMapper: ErrorResponse
2211
+ }
2212
+ },
2213
+ queryParameters: [apiVersion],
2214
+ urlParameters: [$host, nextLink],
2215
+ headerParameters: [accept],
2216
+ serializer: serializer$2
2217
+ };
2218
+
2219
+ /*
2220
+ * Copyright (c) Microsoft Corporation.
2221
+ * Licensed under the MIT License.
2222
+ *
2223
+ * Code generated by Microsoft (R) AutoRest Code Generator.
2224
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2225
+ */
2226
+ /** Class containing PrivateLinkResources operations. */
2227
+ class PrivateLinkResourcesImpl {
2228
+ /**
2229
+ * Initialize a new instance of the class PrivateLinkResources class.
2230
+ * @param client Reference to the service client
2231
+ */
2232
+ constructor(client) {
2233
+ this.client = client;
2234
+ }
2235
+ /**
2236
+ * List private link resources for given Digital Twin.
2237
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
2238
+ * @param resourceName The name of the DigitalTwinsInstance.
2239
+ * @param options The options parameters.
2240
+ */
2241
+ list(resourceGroupName, resourceName, options) {
2242
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, listOperationSpec$3);
2243
+ }
2244
+ /**
2245
+ * Get the specified private link resource for the given Digital Twin.
2246
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
2247
+ * @param resourceName The name of the DigitalTwinsInstance.
2248
+ * @param resourceId The name of the private link resource.
2249
+ * @param options The options parameters.
2250
+ */
2251
+ get(resourceGroupName, resourceName, resourceId, options) {
2252
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, resourceId, options }, getOperationSpec$2);
2253
+ }
2254
+ }
2255
+ // Operation Specifications
2256
+ const serializer$3 = coreClient.createSerializer(Mappers, /* isXml */ false);
2257
+ const listOperationSpec$3 = {
2258
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateLinkResources",
2259
+ httpMethod: "GET",
2260
+ responses: {
2261
+ 200: {
2262
+ bodyMapper: GroupIdInformationResponse
2263
+ },
2264
+ default: {
2265
+ bodyMapper: ErrorResponse
2266
+ }
2267
+ },
2268
+ queryParameters: [apiVersion],
2269
+ urlParameters: [
2270
+ $host,
2271
+ subscriptionId,
2272
+ resourceGroupName,
2273
+ resourceName
2274
+ ],
2275
+ headerParameters: [accept],
2276
+ serializer: serializer$3
2277
+ };
2278
+ const getOperationSpec$2 = {
2279
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateLinkResources/{resourceId}",
2280
+ httpMethod: "GET",
2281
+ responses: {
2282
+ 200: {
2283
+ bodyMapper: GroupIdInformation
2284
+ },
2285
+ default: {
2286
+ bodyMapper: ErrorResponse
2287
+ }
2288
+ },
2289
+ queryParameters: [apiVersion],
2290
+ urlParameters: [
2291
+ $host,
2292
+ subscriptionId,
2293
+ resourceGroupName,
2294
+ resourceName,
2295
+ resourceId
2296
+ ],
2297
+ headerParameters: [accept],
2298
+ serializer: serializer$3
2299
+ };
2300
+
2301
+ /*
2302
+ * Copyright (c) Microsoft Corporation.
2303
+ * Licensed under the MIT License.
2304
+ *
2305
+ * Code generated by Microsoft (R) AutoRest Code Generator.
2306
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2307
+ */
2308
+ /** Class containing PrivateEndpointConnections operations. */
2309
+ class PrivateEndpointConnectionsImpl {
2310
+ /**
2311
+ * Initialize a new instance of the class PrivateEndpointConnections class.
2312
+ * @param client Reference to the service client
2313
+ */
2314
+ constructor(client) {
2315
+ this.client = client;
2316
+ }
2317
+ /**
2318
+ * List private endpoint connection properties.
2319
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
2320
+ * @param resourceName The name of the DigitalTwinsInstance.
2321
+ * @param options The options parameters.
2322
+ */
2323
+ list(resourceGroupName, resourceName, options) {
2324
+ return this.client.sendOperationRequest({ resourceGroupName, resourceName, options }, listOperationSpec$4);
2325
+ }
2326
+ /**
2327
+ * Get private endpoint connection properties for the given private endpoint.
2328
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
2329
+ * @param resourceName The name of the DigitalTwinsInstance.
2330
+ * @param privateEndpointConnectionName The name of the private endpoint connection.
2331
+ * @param options The options parameters.
2332
+ */
2333
+ get(resourceGroupName, resourceName, privateEndpointConnectionName, options) {
2334
+ return this.client.sendOperationRequest({
2335
+ resourceGroupName,
2336
+ resourceName,
2337
+ privateEndpointConnectionName,
2338
+ options
2339
+ }, getOperationSpec$3);
2340
+ }
2341
+ /**
2342
+ * Delete private endpoint connection with the specified name.
2343
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
2344
+ * @param resourceName The name of the DigitalTwinsInstance.
2345
+ * @param privateEndpointConnectionName The name of the private endpoint connection.
2346
+ * @param options The options parameters.
2347
+ */
2348
+ beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName, options) {
2349
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2350
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2351
+ return this.client.sendOperationRequest(args, spec);
2352
+ });
2353
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2354
+ var _a;
2355
+ let currentRawResponse = undefined;
2356
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
2357
+ const callback = (rawResponse, flatResponse) => {
2358
+ currentRawResponse = rawResponse;
2359
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
2360
+ };
2361
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
2362
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
2363
+ return {
2364
+ flatResponse,
2365
+ rawResponse: {
2366
+ statusCode: currentRawResponse.status,
2367
+ body: currentRawResponse.parsedBody,
2368
+ headers: currentRawResponse.headers.toJSON()
2369
+ }
2370
+ };
2371
+ });
2372
+ const lro = new LroImpl(sendOperation, {
2373
+ resourceGroupName,
2374
+ resourceName,
2375
+ privateEndpointConnectionName,
2376
+ options
2377
+ }, deleteOperationSpec$2);
2378
+ return new coreLro.LroEngine(lro, {
2379
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2380
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2381
+ });
2382
+ });
2383
+ }
2384
+ /**
2385
+ * Delete private endpoint connection with the specified name.
2386
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
2387
+ * @param resourceName The name of the DigitalTwinsInstance.
2388
+ * @param privateEndpointConnectionName The name of the private endpoint connection.
2389
+ * @param options The options parameters.
2390
+ */
2391
+ beginDeleteAndWait(resourceGroupName, resourceName, privateEndpointConnectionName, options) {
2392
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2393
+ const poller = yield this.beginDelete(resourceGroupName, resourceName, privateEndpointConnectionName, options);
2394
+ return poller.pollUntilDone();
2395
+ });
2396
+ }
2397
+ /**
2398
+ * Update the status of a private endpoint connection with the given name.
2399
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
2400
+ * @param resourceName The name of the DigitalTwinsInstance.
2401
+ * @param privateEndpointConnectionName The name of the private endpoint connection.
2402
+ * @param privateEndpointConnection The private endpoint connection with updated properties.
2403
+ * @param options The options parameters.
2404
+ */
2405
+ beginCreateOrUpdate(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) {
2406
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2407
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2408
+ return this.client.sendOperationRequest(args, spec);
2409
+ });
2410
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
2411
+ var _a;
2412
+ let currentRawResponse = undefined;
2413
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
2414
+ const callback = (rawResponse, flatResponse) => {
2415
+ currentRawResponse = rawResponse;
2416
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
2417
+ };
2418
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
2419
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
2420
+ return {
2421
+ flatResponse,
2422
+ rawResponse: {
2423
+ statusCode: currentRawResponse.status,
2424
+ body: currentRawResponse.parsedBody,
2425
+ headers: currentRawResponse.headers.toJSON()
2426
+ }
2427
+ };
2428
+ });
2429
+ const lro = new LroImpl(sendOperation, {
2430
+ resourceGroupName,
2431
+ resourceName,
2432
+ privateEndpointConnectionName,
2433
+ privateEndpointConnection,
2434
+ options
2435
+ }, createOrUpdateOperationSpec$2);
2436
+ return new coreLro.LroEngine(lro, {
2437
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
2438
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
2439
+ });
2440
+ });
2441
+ }
2442
+ /**
2443
+ * Update the status of a private endpoint connection with the given name.
2444
+ * @param resourceGroupName The name of the resource group that contains the DigitalTwinsInstance.
2445
+ * @param resourceName The name of the DigitalTwinsInstance.
2446
+ * @param privateEndpointConnectionName The name of the private endpoint connection.
2447
+ * @param privateEndpointConnection The private endpoint connection with updated properties.
2448
+ * @param options The options parameters.
2449
+ */
2450
+ beginCreateOrUpdateAndWait(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options) {
2451
+ return tslib.__awaiter(this, void 0, void 0, function* () {
2452
+ const poller = yield this.beginCreateOrUpdate(resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection, options);
2453
+ return poller.pollUntilDone();
2454
+ });
2455
+ }
2456
+ }
2457
+ // Operation Specifications
2458
+ const serializer$4 = coreClient.createSerializer(Mappers, /* isXml */ false);
2459
+ const listOperationSpec$4 = {
2460
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections",
2461
+ httpMethod: "GET",
2462
+ responses: {
2463
+ 200: {
2464
+ bodyMapper: PrivateEndpointConnectionsResponse
2465
+ },
2466
+ default: {
2467
+ bodyMapper: ErrorResponse
2468
+ }
2469
+ },
2470
+ queryParameters: [apiVersion],
2471
+ urlParameters: [
2472
+ $host,
2473
+ subscriptionId,
2474
+ resourceGroupName,
2475
+ resourceName
2476
+ ],
2477
+ headerParameters: [accept],
2478
+ serializer: serializer$4
2479
+ };
2480
+ const getOperationSpec$3 = {
2481
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}",
2482
+ httpMethod: "GET",
2483
+ responses: {
2484
+ 200: {
2485
+ bodyMapper: PrivateEndpointConnection
2486
+ },
2487
+ default: {
2488
+ bodyMapper: ErrorResponse
2489
+ }
2490
+ },
2491
+ queryParameters: [apiVersion],
2492
+ urlParameters: [
2493
+ $host,
2494
+ subscriptionId,
2495
+ resourceGroupName,
2496
+ resourceName,
2497
+ privateEndpointConnectionName
2498
+ ],
2499
+ headerParameters: [accept],
2500
+ serializer: serializer$4
2501
+ };
2502
+ const deleteOperationSpec$2 = {
2503
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}",
2504
+ httpMethod: "DELETE",
2505
+ responses: {
2506
+ 200: {},
2507
+ 201: {},
2508
+ 202: {},
2509
+ 204: {},
2510
+ default: {
2511
+ bodyMapper: ErrorResponse
2512
+ }
2513
+ },
2514
+ queryParameters: [apiVersion],
2515
+ urlParameters: [
2516
+ $host,
2517
+ subscriptionId,
2518
+ resourceGroupName,
2519
+ resourceName,
2520
+ privateEndpointConnectionName
2521
+ ],
2522
+ headerParameters: [accept],
2523
+ serializer: serializer$4
2524
+ };
2525
+ const createOrUpdateOperationSpec$2 = {
2526
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DigitalTwins/digitalTwinsInstances/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}",
2527
+ httpMethod: "PUT",
2528
+ responses: {
2529
+ 200: {
2530
+ bodyMapper: PrivateEndpointConnection
2531
+ },
2532
+ 201: {
2533
+ bodyMapper: PrivateEndpointConnection
2534
+ },
2535
+ 202: {
2536
+ bodyMapper: PrivateEndpointConnection
2537
+ },
2538
+ 204: {
2539
+ bodyMapper: PrivateEndpointConnection
2540
+ },
2541
+ default: {
2542
+ bodyMapper: ErrorResponse
2543
+ }
2544
+ },
2545
+ requestBody: privateEndpointConnection,
2546
+ queryParameters: [apiVersion],
2547
+ urlParameters: [
2548
+ $host,
2549
+ subscriptionId,
2550
+ resourceGroupName,
2551
+ resourceName,
2552
+ privateEndpointConnectionName
2553
+ ],
2554
+ headerParameters: [accept, contentType],
2555
+ mediaType: "json",
2556
+ serializer: serializer$4
2557
+ };
2558
+
2559
+ /*
2560
+ * Copyright (c) Microsoft Corporation.
2561
+ * Licensed under the MIT License.
2562
+ *
2563
+ * Code generated by Microsoft (R) AutoRest Code Generator.
2564
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
2565
+ */
2566
+ class AzureDigitalTwinsManagementClient extends coreClient.ServiceClient {
2567
+ /**
2568
+ * Initializes a new instance of the AzureDigitalTwinsManagementClient class.
2569
+ * @param credentials Subscription credentials which uniquely identify client subscription.
2570
+ * @param subscriptionId The subscription identifier.
2571
+ * @param options The parameter options
2572
+ */
2573
+ constructor(credentials, subscriptionId, options) {
2574
+ if (credentials === undefined) {
2575
+ throw new Error("'credentials' cannot be null");
2576
+ }
2577
+ if (subscriptionId === undefined) {
2578
+ throw new Error("'subscriptionId' cannot be null");
2579
+ }
2580
+ // Initializing default values for options
2581
+ if (!options) {
2582
+ options = {};
2583
+ }
2584
+ const defaults = {
2585
+ requestContentType: "application/json; charset=utf-8",
2586
+ credential: credentials
2587
+ };
2588
+ const packageDetails = `azsdk-js-arm-digitaltwins/3.0.0`;
2589
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
2590
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
2591
+ : `${packageDetails}`;
2592
+ if (!options.credentialScopes) {
2593
+ options.credentialScopes = ["https://management.azure.com/.default"];
2594
+ }
2595
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
2596
+ userAgentPrefix
2597
+ }, baseUri: options.endpoint || "https://management.azure.com" });
2598
+ super(optionsWithDefaults);
2599
+ // Parameter assignments
2600
+ this.subscriptionId = subscriptionId;
2601
+ // Assigning values to Constant parameters
2602
+ this.$host = options.$host || "https://management.azure.com";
2603
+ this.apiVersion = options.apiVersion || "2020-12-01";
2604
+ this.digitalTwins = new DigitalTwinsImpl(this);
2605
+ this.digitalTwinsEndpoint = new DigitalTwinsEndpointImpl(this);
2606
+ this.operations = new OperationsImpl(this);
2607
+ this.privateLinkResources = new PrivateLinkResourcesImpl(this);
2608
+ this.privateEndpointConnections = new PrivateEndpointConnectionsImpl(this);
2609
+ }
2610
+ }
2611
+
2612
+ exports.AzureDigitalTwinsManagementClient = AzureDigitalTwinsManagementClient;
2613
+ //# sourceMappingURL=index.js.map