@azure/arm-hardwaresecuritymodules 1.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 (109) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +1542 -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/samples-dev/dedicatedHsmCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/dedicatedHsmCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/dedicatedHsmCreateOrUpdateSample.js +109 -0
  11. package/dist-esm/samples-dev/dedicatedHsmCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.js +31 -0
  15. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/dedicatedHsmGetSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/dedicatedHsmGetSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/dedicatedHsmGetSample.js +67 -0
  19. package/dist-esm/samples-dev/dedicatedHsmGetSample.js.map +1 -0
  20. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.js +75 -0
  23. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.js.map +1 -0
  24. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.js +73 -0
  27. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.js.map +1 -0
  28. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js +45 -0
  31. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js.map +1 -0
  32. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.js +53 -0
  35. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.js.map +1 -0
  36. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/operationsListSample.js +73 -0
  39. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  40. package/dist-esm/src/azureDedicatedHSMResourceProvider.d.ts +20 -0
  41. package/dist-esm/src/azureDedicatedHSMResourceProvider.d.ts.map +1 -0
  42. package/dist-esm/src/azureDedicatedHSMResourceProvider.js +54 -0
  43. package/dist-esm/src/azureDedicatedHSMResourceProvider.js.map +1 -0
  44. package/dist-esm/src/index.d.ts +5 -0
  45. package/dist-esm/src/index.d.ts.map +1 -0
  46. package/dist-esm/src/index.js +12 -0
  47. package/dist-esm/src/index.js.map +1 -0
  48. package/dist-esm/src/lroImpl.d.ts +16 -0
  49. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  50. package/dist-esm/src/lroImpl.js +29 -0
  51. package/dist-esm/src/lroImpl.js.map +1 -0
  52. package/dist-esm/src/models/index.d.ts +372 -0
  53. package/dist-esm/src/models/index.d.ts.map +1 -0
  54. package/dist-esm/src/models/index.js +52 -0
  55. package/dist-esm/src/models/index.js.map +1 -0
  56. package/dist-esm/src/models/mappers.d.ts +21 -0
  57. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  58. package/dist-esm/src/models/mappers.js +534 -0
  59. package/dist-esm/src/models/mappers.js.map +1 -0
  60. package/dist-esm/src/models/parameters.d.ts +14 -0
  61. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  62. package/dist-esm/src/models/parameters.js +124 -0
  63. package/dist-esm/src/models/parameters.js.map +1 -0
  64. package/dist-esm/src/operations/dedicatedHsmOperations.d.ts +134 -0
  65. package/dist-esm/src/operations/dedicatedHsmOperations.d.ts.map +1 -0
  66. package/dist-esm/src/operations/dedicatedHsmOperations.js +624 -0
  67. package/dist-esm/src/operations/dedicatedHsmOperations.js.map +1 -0
  68. package/dist-esm/src/operations/index.d.ts +3 -0
  69. package/dist-esm/src/operations/index.d.ts.map +1 -0
  70. package/dist-esm/src/operations/index.js +10 -0
  71. package/dist-esm/src/operations/index.js.map +1 -0
  72. package/dist-esm/src/operations/operations.d.ts +26 -0
  73. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  74. package/dist-esm/src/operations/operations.js +90 -0
  75. package/dist-esm/src/operations/operations.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.d.ts +78 -0
  77. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/index.d.ts +3 -0
  81. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/index.js +10 -0
  83. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  84. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  85. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  86. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  87. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  88. package/dist-esm/test/sampleTest.d.ts +2 -0
  89. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  90. package/dist-esm/test/sampleTest.js +41 -0
  91. package/dist-esm/test/sampleTest.js.map +1 -0
  92. package/package.json +118 -0
  93. package/review/arm-hardwaresecuritymodules.api.md +318 -0
  94. package/rollup.config.js +122 -0
  95. package/src/azureDedicatedHSMResourceProvider.ts +79 -0
  96. package/src/index.ts +12 -0
  97. package/src/lroImpl.ts +34 -0
  98. package/src/models/index.ts +428 -0
  99. package/src/models/mappers.ts +562 -0
  100. package/src/models/parameters.ts +144 -0
  101. package/src/operations/dedicatedHsmOperations.ts +830 -0
  102. package/src/operations/index.ts +10 -0
  103. package/src/operations/operations.ts +98 -0
  104. package/src/operationsInterfaces/dedicatedHsmOperations.ts +149 -0
  105. package/src/operationsInterfaces/index.ts +10 -0
  106. package/src/operationsInterfaces/operations.ts +22 -0
  107. package/tsconfig.json +33 -0
  108. package/types/arm-hardwaresecuritymodules.d.ts +524 -0
  109. package/types/tsdoc-metadata.json +11 -0
package/dist/index.js ADDED
@@ -0,0 +1,1542 @@
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
+ function _interopNamespace(e) {
10
+ if (e && e.__esModule) return e;
11
+ var n = Object.create(null);
12
+ if (e) {
13
+ Object.keys(e).forEach(function (k) {
14
+ if (k !== 'default') {
15
+ var d = Object.getOwnPropertyDescriptor(e, k);
16
+ Object.defineProperty(n, k, d.get ? d : {
17
+ enumerable: true,
18
+ get: function () { return e[k]; }
19
+ });
20
+ }
21
+ });
22
+ }
23
+ n["default"] = e;
24
+ return Object.freeze(n);
25
+ }
26
+
27
+ var coreClient__namespace = /*#__PURE__*/_interopNamespace(coreClient);
28
+
29
+ /*
30
+ * Copyright (c) Microsoft Corporation.
31
+ * Licensed under the MIT License.
32
+ *
33
+ * Code generated by Microsoft (R) AutoRest Code Generator.
34
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
35
+ */
36
+ /** Known values of {@link IdentityType} that the service accepts. */
37
+ exports.KnownIdentityType = void 0;
38
+ (function (KnownIdentityType) {
39
+ KnownIdentityType["User"] = "User";
40
+ KnownIdentityType["Application"] = "Application";
41
+ KnownIdentityType["ManagedIdentity"] = "ManagedIdentity";
42
+ KnownIdentityType["Key"] = "Key";
43
+ })(exports.KnownIdentityType || (exports.KnownIdentityType = {}));
44
+ /** Known values of {@link JsonWebKeyType} that the service accepts. */
45
+ exports.KnownJsonWebKeyType = void 0;
46
+ (function (KnownJsonWebKeyType) {
47
+ /** The dedicated HSM has been full provisioned. */
48
+ KnownJsonWebKeyType["Succeeded"] = "Succeeded";
49
+ /** The dedicated HSM is currently being provisioned. */
50
+ KnownJsonWebKeyType["Provisioning"] = "Provisioning";
51
+ /** A device is currently being allocated for the dedicated HSM resource. */
52
+ KnownJsonWebKeyType["Allocating"] = "Allocating";
53
+ /** The dedicated HSM is being connected to the virtual network. */
54
+ KnownJsonWebKeyType["Connecting"] = "Connecting";
55
+ /** Provisioning of the dedicated HSM has failed. */
56
+ KnownJsonWebKeyType["Failed"] = "Failed";
57
+ /** Validating the subscription has sufficient quota to allocate a dedicated HSM device. */
58
+ KnownJsonWebKeyType["CheckingQuota"] = "CheckingQuota";
59
+ /** The dedicated HSM is currently being deleted. */
60
+ KnownJsonWebKeyType["Deleting"] = "Deleting";
61
+ })(exports.KnownJsonWebKeyType || (exports.KnownJsonWebKeyType = {}));
62
+ /** Known values of {@link SkuName} that the service accepts. */
63
+ exports.KnownSkuName = void 0;
64
+ (function (KnownSkuName) {
65
+ /** The dedicated HSM is a Safenet Luna Network HSM A790 device. */
66
+ KnownSkuName["SafeNetLunaNetworkHSMA790"] = "SafeNet Luna Network HSM A790";
67
+ /** The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 60 calls per second. */
68
+ KnownSkuName["PayShield10KLMK1CPS60"] = "payShield10K_LMK1_CPS60";
69
+ /** The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 250 calls per second. */
70
+ KnownSkuName["PayShield10KLMK1CPS250"] = "payShield10K_LMK1_CPS250";
71
+ /** The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 1 local master key which supports up to 2500 calls per second. */
72
+ KnownSkuName["PayShield10KLMK1CPS2500"] = "payShield10K_LMK1_CPS2500";
73
+ /** The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 60 calls per second. */
74
+ KnownSkuName["PayShield10KLMK2CPS60"] = "payShield10K_LMK2_CPS60";
75
+ /** The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 250 calls per second. */
76
+ KnownSkuName["PayShield10KLMK2CPS250"] = "payShield10K_LMK2_CPS250";
77
+ /** The dedicated HSM is a payShield 10K, model PS10-D, 10Gb Ethernet Hardware Platform device with 2 local master keys which supports up to 2500 calls per second. */
78
+ KnownSkuName["PayShield10KLMK2CPS2500"] = "payShield10K_LMK2_CPS2500";
79
+ })(exports.KnownSkuName || (exports.KnownSkuName = {}));
80
+
81
+ /*
82
+ * Copyright (c) Microsoft Corporation.
83
+ * Licensed under the MIT License.
84
+ *
85
+ * Code generated by Microsoft (R) AutoRest Code Generator.
86
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
87
+ */
88
+ const DedicatedHsmOperationListResult = {
89
+ type: {
90
+ name: "Composite",
91
+ className: "DedicatedHsmOperationListResult",
92
+ modelProperties: {
93
+ value: {
94
+ serializedName: "value",
95
+ type: {
96
+ name: "Sequence",
97
+ element: {
98
+ type: {
99
+ name: "Composite",
100
+ className: "DedicatedHsmOperation"
101
+ }
102
+ }
103
+ }
104
+ }
105
+ }
106
+ }
107
+ };
108
+ const DedicatedHsmOperation = {
109
+ type: {
110
+ name: "Composite",
111
+ className: "DedicatedHsmOperation",
112
+ modelProperties: {
113
+ name: {
114
+ serializedName: "name",
115
+ type: {
116
+ name: "String"
117
+ }
118
+ },
119
+ isDataAction: {
120
+ serializedName: "isDataAction",
121
+ readOnly: true,
122
+ type: {
123
+ name: "String"
124
+ }
125
+ },
126
+ display: {
127
+ serializedName: "display",
128
+ type: {
129
+ name: "Composite",
130
+ className: "DedicatedHsmOperationDisplay"
131
+ }
132
+ }
133
+ }
134
+ }
135
+ };
136
+ const DedicatedHsmOperationDisplay = {
137
+ type: {
138
+ name: "Composite",
139
+ className: "DedicatedHsmOperationDisplay",
140
+ modelProperties: {
141
+ provider: {
142
+ serializedName: "provider",
143
+ type: {
144
+ name: "String"
145
+ }
146
+ },
147
+ resource: {
148
+ serializedName: "resource",
149
+ type: {
150
+ name: "String"
151
+ }
152
+ },
153
+ operation: {
154
+ serializedName: "operation",
155
+ type: {
156
+ name: "String"
157
+ }
158
+ },
159
+ description: {
160
+ serializedName: "description",
161
+ type: {
162
+ name: "String"
163
+ }
164
+ }
165
+ }
166
+ }
167
+ };
168
+ const DedicatedHsmError = {
169
+ type: {
170
+ name: "Composite",
171
+ className: "DedicatedHsmError",
172
+ modelProperties: {
173
+ error: {
174
+ serializedName: "error",
175
+ type: {
176
+ name: "Composite",
177
+ className: "ErrorModel"
178
+ }
179
+ }
180
+ }
181
+ }
182
+ };
183
+ const ErrorModel = {
184
+ type: {
185
+ name: "Composite",
186
+ className: "ErrorModel",
187
+ modelProperties: {
188
+ code: {
189
+ serializedName: "code",
190
+ readOnly: true,
191
+ type: {
192
+ name: "String"
193
+ }
194
+ },
195
+ message: {
196
+ serializedName: "message",
197
+ readOnly: true,
198
+ type: {
199
+ name: "String"
200
+ }
201
+ },
202
+ innerError: {
203
+ serializedName: "innererror",
204
+ type: {
205
+ name: "Composite",
206
+ className: "ErrorModel"
207
+ }
208
+ }
209
+ }
210
+ }
211
+ };
212
+ const SystemData = {
213
+ type: {
214
+ name: "Composite",
215
+ className: "SystemData",
216
+ modelProperties: {
217
+ createdBy: {
218
+ serializedName: "createdBy",
219
+ type: {
220
+ name: "String"
221
+ }
222
+ },
223
+ createdByType: {
224
+ serializedName: "createdByType",
225
+ type: {
226
+ name: "String"
227
+ }
228
+ },
229
+ createdAt: {
230
+ serializedName: "createdAt",
231
+ type: {
232
+ name: "DateTime"
233
+ }
234
+ },
235
+ lastModifiedBy: {
236
+ serializedName: "lastModifiedBy",
237
+ type: {
238
+ name: "String"
239
+ }
240
+ },
241
+ lastModifiedByType: {
242
+ serializedName: "lastModifiedByType",
243
+ type: {
244
+ name: "String"
245
+ }
246
+ },
247
+ lastModifiedAt: {
248
+ serializedName: "lastModifiedAt",
249
+ type: {
250
+ name: "DateTime"
251
+ }
252
+ }
253
+ }
254
+ }
255
+ };
256
+ const NetworkProfile = {
257
+ type: {
258
+ name: "Composite",
259
+ className: "NetworkProfile",
260
+ modelProperties: {
261
+ subnet: {
262
+ serializedName: "subnet",
263
+ type: {
264
+ name: "Composite",
265
+ className: "ApiEntityReference"
266
+ }
267
+ },
268
+ networkInterfaces: {
269
+ serializedName: "networkInterfaces",
270
+ type: {
271
+ name: "Sequence",
272
+ element: {
273
+ type: {
274
+ name: "Composite",
275
+ className: "NetworkInterface"
276
+ }
277
+ }
278
+ }
279
+ }
280
+ }
281
+ }
282
+ };
283
+ const ApiEntityReference = {
284
+ type: {
285
+ name: "Composite",
286
+ className: "ApiEntityReference",
287
+ modelProperties: {
288
+ id: {
289
+ serializedName: "id",
290
+ type: {
291
+ name: "String"
292
+ }
293
+ }
294
+ }
295
+ }
296
+ };
297
+ const NetworkInterface = {
298
+ type: {
299
+ name: "Composite",
300
+ className: "NetworkInterface",
301
+ modelProperties: {
302
+ id: {
303
+ serializedName: "id",
304
+ readOnly: true,
305
+ type: {
306
+ name: "String"
307
+ }
308
+ },
309
+ privateIpAddress: {
310
+ serializedName: "privateIpAddress",
311
+ type: {
312
+ name: "String"
313
+ }
314
+ }
315
+ }
316
+ }
317
+ };
318
+ const Resource = {
319
+ type: {
320
+ name: "Composite",
321
+ className: "Resource",
322
+ modelProperties: {
323
+ id: {
324
+ serializedName: "id",
325
+ readOnly: true,
326
+ type: {
327
+ name: "String"
328
+ }
329
+ },
330
+ name: {
331
+ serializedName: "name",
332
+ readOnly: true,
333
+ type: {
334
+ name: "String"
335
+ }
336
+ },
337
+ type: {
338
+ serializedName: "type",
339
+ readOnly: true,
340
+ type: {
341
+ name: "String"
342
+ }
343
+ },
344
+ location: {
345
+ serializedName: "location",
346
+ required: true,
347
+ type: {
348
+ name: "String"
349
+ }
350
+ },
351
+ sku: {
352
+ serializedName: "sku",
353
+ type: {
354
+ name: "Composite",
355
+ className: "Sku"
356
+ }
357
+ },
358
+ zones: {
359
+ serializedName: "zones",
360
+ type: {
361
+ name: "Sequence",
362
+ element: {
363
+ type: {
364
+ name: "String"
365
+ }
366
+ }
367
+ }
368
+ },
369
+ tags: {
370
+ serializedName: "tags",
371
+ type: {
372
+ name: "Dictionary",
373
+ value: { type: { name: "String" } }
374
+ }
375
+ }
376
+ }
377
+ }
378
+ };
379
+ const Sku = {
380
+ type: {
381
+ name: "Composite",
382
+ className: "Sku",
383
+ modelProperties: {
384
+ name: {
385
+ serializedName: "name",
386
+ type: {
387
+ name: "String"
388
+ }
389
+ }
390
+ }
391
+ }
392
+ };
393
+ const DedicatedHsmPatchParameters = {
394
+ type: {
395
+ name: "Composite",
396
+ className: "DedicatedHsmPatchParameters",
397
+ modelProperties: {
398
+ tags: {
399
+ serializedName: "tags",
400
+ type: {
401
+ name: "Dictionary",
402
+ value: { type: { name: "String" } }
403
+ }
404
+ }
405
+ }
406
+ }
407
+ };
408
+ const DedicatedHsmListResult = {
409
+ type: {
410
+ name: "Composite",
411
+ className: "DedicatedHsmListResult",
412
+ modelProperties: {
413
+ value: {
414
+ serializedName: "value",
415
+ type: {
416
+ name: "Sequence",
417
+ element: {
418
+ type: {
419
+ name: "Composite",
420
+ className: "DedicatedHsm"
421
+ }
422
+ }
423
+ }
424
+ },
425
+ nextLink: {
426
+ serializedName: "nextLink",
427
+ type: {
428
+ name: "String"
429
+ }
430
+ }
431
+ }
432
+ }
433
+ };
434
+ const OutboundEnvironmentEndpointCollection = {
435
+ type: {
436
+ name: "Composite",
437
+ className: "OutboundEnvironmentEndpointCollection",
438
+ modelProperties: {
439
+ value: {
440
+ serializedName: "value",
441
+ required: true,
442
+ type: {
443
+ name: "Sequence",
444
+ element: {
445
+ type: {
446
+ name: "Composite",
447
+ className: "OutboundEnvironmentEndpoint"
448
+ }
449
+ }
450
+ }
451
+ },
452
+ nextLink: {
453
+ serializedName: "nextLink",
454
+ readOnly: true,
455
+ type: {
456
+ name: "String"
457
+ }
458
+ }
459
+ }
460
+ }
461
+ };
462
+ const OutboundEnvironmentEndpoint = {
463
+ type: {
464
+ name: "Composite",
465
+ className: "OutboundEnvironmentEndpoint",
466
+ modelProperties: {
467
+ category: {
468
+ serializedName: "category",
469
+ type: {
470
+ name: "String"
471
+ }
472
+ },
473
+ endpoints: {
474
+ serializedName: "endpoints",
475
+ type: {
476
+ name: "Sequence",
477
+ element: {
478
+ type: {
479
+ name: "Composite",
480
+ className: "EndpointDependency"
481
+ }
482
+ }
483
+ }
484
+ }
485
+ }
486
+ }
487
+ };
488
+ const EndpointDependency = {
489
+ type: {
490
+ name: "Composite",
491
+ className: "EndpointDependency",
492
+ modelProperties: {
493
+ domainName: {
494
+ serializedName: "domainName",
495
+ type: {
496
+ name: "String"
497
+ }
498
+ },
499
+ endpointDetails: {
500
+ serializedName: "endpointDetails",
501
+ type: {
502
+ name: "Sequence",
503
+ element: {
504
+ type: {
505
+ name: "Composite",
506
+ className: "EndpointDetail"
507
+ }
508
+ }
509
+ }
510
+ }
511
+ }
512
+ }
513
+ };
514
+ const EndpointDetail = {
515
+ type: {
516
+ name: "Composite",
517
+ className: "EndpointDetail",
518
+ modelProperties: {
519
+ ipAddress: {
520
+ serializedName: "ipAddress",
521
+ type: {
522
+ name: "String"
523
+ }
524
+ },
525
+ port: {
526
+ serializedName: "port",
527
+ type: {
528
+ name: "Number"
529
+ }
530
+ },
531
+ protocol: {
532
+ serializedName: "protocol",
533
+ type: {
534
+ name: "String"
535
+ }
536
+ },
537
+ description: {
538
+ serializedName: "description",
539
+ type: {
540
+ name: "String"
541
+ }
542
+ }
543
+ }
544
+ }
545
+ };
546
+ const ResourceListResult = {
547
+ type: {
548
+ name: "Composite",
549
+ className: "ResourceListResult",
550
+ modelProperties: {
551
+ value: {
552
+ serializedName: "value",
553
+ type: {
554
+ name: "Sequence",
555
+ element: {
556
+ type: {
557
+ name: "Composite",
558
+ className: "Resource"
559
+ }
560
+ }
561
+ }
562
+ },
563
+ nextLink: {
564
+ serializedName: "nextLink",
565
+ type: {
566
+ name: "String"
567
+ }
568
+ }
569
+ }
570
+ }
571
+ };
572
+ const DedicatedHsm = {
573
+ type: {
574
+ name: "Composite",
575
+ className: "DedicatedHsm",
576
+ modelProperties: Object.assign(Object.assign({}, Resource.type.modelProperties), { systemData: {
577
+ serializedName: "systemData",
578
+ type: {
579
+ name: "Composite",
580
+ className: "SystemData"
581
+ }
582
+ }, networkProfile: {
583
+ serializedName: "properties.networkProfile",
584
+ type: {
585
+ name: "Composite",
586
+ className: "NetworkProfile"
587
+ }
588
+ }, managementNetworkProfile: {
589
+ serializedName: "properties.managementNetworkProfile",
590
+ type: {
591
+ name: "Composite",
592
+ className: "NetworkProfile"
593
+ }
594
+ }, stampId: {
595
+ serializedName: "properties.stampId",
596
+ type: {
597
+ name: "String"
598
+ }
599
+ }, statusMessage: {
600
+ serializedName: "properties.statusMessage",
601
+ readOnly: true,
602
+ type: {
603
+ name: "String"
604
+ }
605
+ }, provisioningState: {
606
+ serializedName: "properties.provisioningState",
607
+ readOnly: true,
608
+ type: {
609
+ name: "String"
610
+ }
611
+ } })
612
+ }
613
+ };
614
+
615
+ var Mappers = /*#__PURE__*/Object.freeze({
616
+ __proto__: null,
617
+ DedicatedHsmOperationListResult: DedicatedHsmOperationListResult,
618
+ DedicatedHsmOperation: DedicatedHsmOperation,
619
+ DedicatedHsmOperationDisplay: DedicatedHsmOperationDisplay,
620
+ DedicatedHsmError: DedicatedHsmError,
621
+ ErrorModel: ErrorModel,
622
+ SystemData: SystemData,
623
+ NetworkProfile: NetworkProfile,
624
+ ApiEntityReference: ApiEntityReference,
625
+ NetworkInterface: NetworkInterface,
626
+ Resource: Resource,
627
+ Sku: Sku,
628
+ DedicatedHsmPatchParameters: DedicatedHsmPatchParameters,
629
+ DedicatedHsmListResult: DedicatedHsmListResult,
630
+ OutboundEnvironmentEndpointCollection: OutboundEnvironmentEndpointCollection,
631
+ OutboundEnvironmentEndpoint: OutboundEnvironmentEndpoint,
632
+ EndpointDependency: EndpointDependency,
633
+ EndpointDetail: EndpointDetail,
634
+ ResourceListResult: ResourceListResult,
635
+ DedicatedHsm: DedicatedHsm
636
+ });
637
+
638
+ /*
639
+ * Copyright (c) Microsoft Corporation.
640
+ * Licensed under the MIT License.
641
+ *
642
+ * Code generated by Microsoft (R) AutoRest Code Generator.
643
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
644
+ */
645
+ const accept = {
646
+ parameterPath: "accept",
647
+ mapper: {
648
+ defaultValue: "application/json",
649
+ isConstant: true,
650
+ serializedName: "Accept",
651
+ type: {
652
+ name: "String"
653
+ }
654
+ }
655
+ };
656
+ const $host = {
657
+ parameterPath: "$host",
658
+ mapper: {
659
+ serializedName: "$host",
660
+ required: true,
661
+ type: {
662
+ name: "String"
663
+ }
664
+ },
665
+ skipEncoding: true
666
+ };
667
+ const apiVersion = {
668
+ parameterPath: "apiVersion",
669
+ mapper: {
670
+ defaultValue: "2021-11-30",
671
+ isConstant: true,
672
+ serializedName: "api-version",
673
+ type: {
674
+ name: "String"
675
+ }
676
+ }
677
+ };
678
+ const contentType = {
679
+ parameterPath: ["options", "contentType"],
680
+ mapper: {
681
+ defaultValue: "application/json",
682
+ isConstant: true,
683
+ serializedName: "Content-Type",
684
+ type: {
685
+ name: "String"
686
+ }
687
+ }
688
+ };
689
+ const parameters = {
690
+ parameterPath: "parameters",
691
+ mapper: DedicatedHsm
692
+ };
693
+ const resourceGroupName = {
694
+ parameterPath: "resourceGroupName",
695
+ mapper: {
696
+ serializedName: "resourceGroupName",
697
+ required: true,
698
+ type: {
699
+ name: "String"
700
+ }
701
+ }
702
+ };
703
+ const name = {
704
+ parameterPath: "name",
705
+ mapper: {
706
+ constraints: {
707
+ Pattern: new RegExp("^[a-zA-Z0-9-]{3,24}$")
708
+ },
709
+ serializedName: "name",
710
+ required: true,
711
+ type: {
712
+ name: "String"
713
+ }
714
+ }
715
+ };
716
+ const subscriptionId = {
717
+ parameterPath: "subscriptionId",
718
+ mapper: {
719
+ serializedName: "subscriptionId",
720
+ required: true,
721
+ type: {
722
+ name: "String"
723
+ }
724
+ }
725
+ };
726
+ const name1 = {
727
+ parameterPath: "name",
728
+ mapper: {
729
+ serializedName: "name",
730
+ required: true,
731
+ type: {
732
+ name: "String"
733
+ }
734
+ }
735
+ };
736
+ const top = {
737
+ parameterPath: ["options", "top"],
738
+ mapper: {
739
+ serializedName: "$top",
740
+ type: {
741
+ name: "Number"
742
+ }
743
+ }
744
+ };
745
+ const nextLink = {
746
+ parameterPath: "nextLink",
747
+ mapper: {
748
+ serializedName: "nextLink",
749
+ required: true,
750
+ type: {
751
+ name: "String"
752
+ }
753
+ },
754
+ skipEncoding: true
755
+ };
756
+
757
+ /*
758
+ * Copyright (c) Microsoft Corporation.
759
+ * Licensed under the MIT License.
760
+ *
761
+ * Code generated by Microsoft (R) AutoRest Code Generator.
762
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
763
+ */
764
+ /// <reference lib="esnext.asynciterable" />
765
+ /** Class containing Operations operations. */
766
+ class OperationsImpl {
767
+ /**
768
+ * Initialize a new instance of the class Operations class.
769
+ * @param client Reference to the service client
770
+ */
771
+ constructor(client) {
772
+ this.client = client;
773
+ }
774
+ /**
775
+ * Get a list of Dedicated HSM operations.
776
+ * @param options The options parameters.
777
+ */
778
+ list(options) {
779
+ const iter = this.listPagingAll(options);
780
+ return {
781
+ next() {
782
+ return iter.next();
783
+ },
784
+ [Symbol.asyncIterator]() {
785
+ return this;
786
+ },
787
+ byPage: () => {
788
+ return this.listPagingPage(options);
789
+ }
790
+ };
791
+ }
792
+ listPagingPage(options) {
793
+ return tslib.__asyncGenerator(this, arguments, function* listPagingPage_1() {
794
+ let result = yield tslib.__await(this._list(options));
795
+ yield yield tslib.__await(result.value || []);
796
+ });
797
+ }
798
+ listPagingAll(options) {
799
+ return tslib.__asyncGenerator(this, arguments, function* listPagingAll_1() {
800
+ var e_1, _a;
801
+ try {
802
+ for (var _b = tslib.__asyncValues(this.listPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
803
+ const page = _c.value;
804
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
805
+ }
806
+ }
807
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
808
+ finally {
809
+ try {
810
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
811
+ }
812
+ finally { if (e_1) throw e_1.error; }
813
+ }
814
+ });
815
+ }
816
+ /**
817
+ * Get a list of Dedicated HSM operations.
818
+ * @param options The options parameters.
819
+ */
820
+ _list(options) {
821
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
822
+ }
823
+ }
824
+ // Operation Specifications
825
+ const serializer$1 = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
826
+ const listOperationSpec = {
827
+ path: "/providers/Microsoft.HardwareSecurityModules/operations",
828
+ httpMethod: "GET",
829
+ responses: {
830
+ 200: {
831
+ bodyMapper: DedicatedHsmOperationListResult
832
+ },
833
+ default: {
834
+ bodyMapper: DedicatedHsmError
835
+ }
836
+ },
837
+ queryParameters: [apiVersion],
838
+ urlParameters: [$host],
839
+ headerParameters: [accept],
840
+ serializer: serializer$1
841
+ };
842
+
843
+ /*
844
+ * Copyright (c) Microsoft Corporation.
845
+ * Licensed under the MIT License.
846
+ *
847
+ * Code generated by Microsoft (R) AutoRest Code Generator.
848
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
849
+ */
850
+ class LroImpl {
851
+ constructor(sendOperationFn, args, spec, requestPath = spec.path, requestMethod = spec.httpMethod) {
852
+ this.sendOperationFn = sendOperationFn;
853
+ this.args = args;
854
+ this.spec = spec;
855
+ this.requestPath = requestPath;
856
+ this.requestMethod = requestMethod;
857
+ }
858
+ sendInitialRequest() {
859
+ return tslib.__awaiter(this, void 0, void 0, function* () {
860
+ return this.sendOperationFn(this.args, this.spec);
861
+ });
862
+ }
863
+ sendPollRequest(path) {
864
+ return tslib.__awaiter(this, void 0, void 0, function* () {
865
+ const _a = this.spec, restSpec = tslib.__rest(_a, ["requestBody"]);
866
+ return this.sendOperationFn(this.args, Object.assign(Object.assign({}, restSpec), { path, httpMethod: "GET" }));
867
+ });
868
+ }
869
+ }
870
+
871
+ /*
872
+ * Copyright (c) Microsoft Corporation.
873
+ * Licensed under the MIT License.
874
+ *
875
+ * Code generated by Microsoft (R) AutoRest Code Generator.
876
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
877
+ */
878
+ /// <reference lib="esnext.asynciterable" />
879
+ /** Class containing DedicatedHsmOperations operations. */
880
+ class DedicatedHsmOperationsImpl {
881
+ /**
882
+ * Initialize a new instance of the class DedicatedHsmOperations class.
883
+ * @param client Reference to the service client
884
+ */
885
+ constructor(client) {
886
+ this.client = client;
887
+ }
888
+ /**
889
+ * The List operation gets information about the dedicated hsms associated with the subscription and
890
+ * within the specified resource group.
891
+ * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs.
892
+ * @param options The options parameters.
893
+ */
894
+ listByResourceGroup(resourceGroupName, options) {
895
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
896
+ return {
897
+ next() {
898
+ return iter.next();
899
+ },
900
+ [Symbol.asyncIterator]() {
901
+ return this;
902
+ },
903
+ byPage: () => {
904
+ return this.listByResourceGroupPagingPage(resourceGroupName, options);
905
+ }
906
+ };
907
+ }
908
+ listByResourceGroupPagingPage(resourceGroupName, options) {
909
+ return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingPage_1() {
910
+ let result = yield tslib.__await(this._listByResourceGroup(resourceGroupName, options));
911
+ yield yield tslib.__await(result.value || []);
912
+ let continuationToken = result.nextLink;
913
+ while (continuationToken) {
914
+ result = yield tslib.__await(this._listByResourceGroupNext(resourceGroupName, continuationToken, options));
915
+ continuationToken = result.nextLink;
916
+ yield yield tslib.__await(result.value || []);
917
+ }
918
+ });
919
+ }
920
+ listByResourceGroupPagingAll(resourceGroupName, options) {
921
+ return tslib.__asyncGenerator(this, arguments, function* listByResourceGroupPagingAll_1() {
922
+ var e_1, _a;
923
+ try {
924
+ for (var _b = tslib.__asyncValues(this.listByResourceGroupPagingPage(resourceGroupName, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
925
+ const page = _c.value;
926
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
927
+ }
928
+ }
929
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
930
+ finally {
931
+ try {
932
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
933
+ }
934
+ finally { if (e_1) throw e_1.error; }
935
+ }
936
+ });
937
+ }
938
+ /**
939
+ * The List operation gets information about the dedicated HSMs associated with the subscription.
940
+ * @param options The options parameters.
941
+ */
942
+ listBySubscription(options) {
943
+ const iter = this.listBySubscriptionPagingAll(options);
944
+ return {
945
+ next() {
946
+ return iter.next();
947
+ },
948
+ [Symbol.asyncIterator]() {
949
+ return this;
950
+ },
951
+ byPage: () => {
952
+ return this.listBySubscriptionPagingPage(options);
953
+ }
954
+ };
955
+ }
956
+ listBySubscriptionPagingPage(options) {
957
+ return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingPage_1() {
958
+ let result = yield tslib.__await(this._listBySubscription(options));
959
+ yield yield tslib.__await(result.value || []);
960
+ let continuationToken = result.nextLink;
961
+ while (continuationToken) {
962
+ result = yield tslib.__await(this._listBySubscriptionNext(continuationToken, options));
963
+ continuationToken = result.nextLink;
964
+ yield yield tslib.__await(result.value || []);
965
+ }
966
+ });
967
+ }
968
+ listBySubscriptionPagingAll(options) {
969
+ return tslib.__asyncGenerator(this, arguments, function* listBySubscriptionPagingAll_1() {
970
+ var e_2, _a;
971
+ try {
972
+ for (var _b = tslib.__asyncValues(this.listBySubscriptionPagingPage(options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
973
+ const page = _c.value;
974
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
975
+ }
976
+ }
977
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
978
+ finally {
979
+ try {
980
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
981
+ }
982
+ finally { if (e_2) throw e_2.error; }
983
+ }
984
+ });
985
+ }
986
+ /**
987
+ * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified
988
+ * dedicated hsm resource. The operation returns properties of each egress endpoint.
989
+ * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs.
990
+ * @param name The name of the dedicated HSM.
991
+ * @param options The options parameters.
992
+ */
993
+ listOutboundNetworkDependenciesEndpoints(resourceGroupName, name, options) {
994
+ const iter = this.listOutboundNetworkDependenciesEndpointsPagingAll(resourceGroupName, name, options);
995
+ return {
996
+ next() {
997
+ return iter.next();
998
+ },
999
+ [Symbol.asyncIterator]() {
1000
+ return this;
1001
+ },
1002
+ byPage: () => {
1003
+ return this.listOutboundNetworkDependenciesEndpointsPagingPage(resourceGroupName, name, options);
1004
+ }
1005
+ };
1006
+ }
1007
+ listOutboundNetworkDependenciesEndpointsPagingPage(resourceGroupName, name, options) {
1008
+ return tslib.__asyncGenerator(this, arguments, function* listOutboundNetworkDependenciesEndpointsPagingPage_1() {
1009
+ let result = yield tslib.__await(this._listOutboundNetworkDependenciesEndpoints(resourceGroupName, name, options));
1010
+ yield yield tslib.__await(result.value || []);
1011
+ let continuationToken = result.nextLink;
1012
+ while (continuationToken) {
1013
+ result = yield tslib.__await(this._listOutboundNetworkDependenciesEndpointsNext(resourceGroupName, name, continuationToken, options));
1014
+ continuationToken = result.nextLink;
1015
+ yield yield tslib.__await(result.value || []);
1016
+ }
1017
+ });
1018
+ }
1019
+ listOutboundNetworkDependenciesEndpointsPagingAll(resourceGroupName, name, options) {
1020
+ return tslib.__asyncGenerator(this, arguments, function* listOutboundNetworkDependenciesEndpointsPagingAll_1() {
1021
+ var e_3, _a;
1022
+ try {
1023
+ for (var _b = tslib.__asyncValues(this.listOutboundNetworkDependenciesEndpointsPagingPage(resourceGroupName, name, options)), _c; _c = yield tslib.__await(_b.next()), !_c.done;) {
1024
+ const page = _c.value;
1025
+ yield tslib.__await(yield* tslib.__asyncDelegator(tslib.__asyncValues(page)));
1026
+ }
1027
+ }
1028
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
1029
+ finally {
1030
+ try {
1031
+ if (_c && !_c.done && (_a = _b.return)) yield tslib.__await(_a.call(_b));
1032
+ }
1033
+ finally { if (e_3) throw e_3.error; }
1034
+ }
1035
+ });
1036
+ }
1037
+ /**
1038
+ * Create or Update a dedicated HSM in the specified subscription.
1039
+ * @param resourceGroupName The name of the Resource Group to which the resource belongs.
1040
+ * @param name Name of the dedicated Hsm
1041
+ * @param parameters Parameters to create or update the dedicated hsm
1042
+ * @param options The options parameters.
1043
+ */
1044
+ beginCreateOrUpdate(resourceGroupName, name, parameters, options) {
1045
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1046
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1047
+ return this.client.sendOperationRequest(args, spec);
1048
+ });
1049
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1050
+ var _a;
1051
+ let currentRawResponse = undefined;
1052
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1053
+ const callback = (rawResponse, flatResponse) => {
1054
+ currentRawResponse = rawResponse;
1055
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1056
+ };
1057
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1058
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1059
+ return {
1060
+ flatResponse,
1061
+ rawResponse: {
1062
+ statusCode: currentRawResponse.status,
1063
+ body: currentRawResponse.parsedBody,
1064
+ headers: currentRawResponse.headers.toJSON()
1065
+ }
1066
+ };
1067
+ });
1068
+ const lro = new LroImpl(sendOperation, { resourceGroupName, name, parameters, options }, createOrUpdateOperationSpec);
1069
+ const poller = new coreLro.LroEngine(lro, {
1070
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1071
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1072
+ });
1073
+ yield poller.poll();
1074
+ return poller;
1075
+ });
1076
+ }
1077
+ /**
1078
+ * Create or Update a dedicated HSM in the specified subscription.
1079
+ * @param resourceGroupName The name of the Resource Group to which the resource belongs.
1080
+ * @param name Name of the dedicated Hsm
1081
+ * @param parameters Parameters to create or update the dedicated hsm
1082
+ * @param options The options parameters.
1083
+ */
1084
+ beginCreateOrUpdateAndWait(resourceGroupName, name, parameters, options) {
1085
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1086
+ const poller = yield this.beginCreateOrUpdate(resourceGroupName, name, parameters, options);
1087
+ return poller.pollUntilDone();
1088
+ });
1089
+ }
1090
+ /**
1091
+ * Update a dedicated HSM in the specified subscription.
1092
+ * @param resourceGroupName The name of the Resource Group to which the server belongs.
1093
+ * @param name Name of the dedicated HSM
1094
+ * @param options The options parameters.
1095
+ */
1096
+ beginUpdate(resourceGroupName, name, options) {
1097
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1098
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1099
+ return this.client.sendOperationRequest(args, spec);
1100
+ });
1101
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1102
+ var _a;
1103
+ let currentRawResponse = undefined;
1104
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1105
+ const callback = (rawResponse, flatResponse) => {
1106
+ currentRawResponse = rawResponse;
1107
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1108
+ };
1109
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1110
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1111
+ return {
1112
+ flatResponse,
1113
+ rawResponse: {
1114
+ statusCode: currentRawResponse.status,
1115
+ body: currentRawResponse.parsedBody,
1116
+ headers: currentRawResponse.headers.toJSON()
1117
+ }
1118
+ };
1119
+ });
1120
+ const lro = new LroImpl(sendOperation, { resourceGroupName, name, options }, updateOperationSpec);
1121
+ const poller = new coreLro.LroEngine(lro, {
1122
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1123
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1124
+ });
1125
+ yield poller.poll();
1126
+ return poller;
1127
+ });
1128
+ }
1129
+ /**
1130
+ * Update a dedicated HSM in the specified subscription.
1131
+ * @param resourceGroupName The name of the Resource Group to which the server belongs.
1132
+ * @param name Name of the dedicated HSM
1133
+ * @param options The options parameters.
1134
+ */
1135
+ beginUpdateAndWait(resourceGroupName, name, options) {
1136
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1137
+ const poller = yield this.beginUpdate(resourceGroupName, name, options);
1138
+ return poller.pollUntilDone();
1139
+ });
1140
+ }
1141
+ /**
1142
+ * Deletes the specified Azure Dedicated HSM.
1143
+ * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs.
1144
+ * @param name The name of the dedicated HSM to delete
1145
+ * @param options The options parameters.
1146
+ */
1147
+ beginDelete(resourceGroupName, name, options) {
1148
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1149
+ const directSendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1150
+ return this.client.sendOperationRequest(args, spec);
1151
+ });
1152
+ const sendOperation = (args, spec) => tslib.__awaiter(this, void 0, void 0, function* () {
1153
+ var _a;
1154
+ let currentRawResponse = undefined;
1155
+ const providedCallback = (_a = args.options) === null || _a === void 0 ? void 0 : _a.onResponse;
1156
+ const callback = (rawResponse, flatResponse) => {
1157
+ currentRawResponse = rawResponse;
1158
+ providedCallback === null || providedCallback === void 0 ? void 0 : providedCallback(rawResponse, flatResponse);
1159
+ };
1160
+ const updatedArgs = Object.assign(Object.assign({}, args), { options: Object.assign(Object.assign({}, args.options), { onResponse: callback }) });
1161
+ const flatResponse = yield directSendOperation(updatedArgs, spec);
1162
+ return {
1163
+ flatResponse,
1164
+ rawResponse: {
1165
+ statusCode: currentRawResponse.status,
1166
+ body: currentRawResponse.parsedBody,
1167
+ headers: currentRawResponse.headers.toJSON()
1168
+ }
1169
+ };
1170
+ });
1171
+ const lro = new LroImpl(sendOperation, { resourceGroupName, name, options }, deleteOperationSpec);
1172
+ const poller = new coreLro.LroEngine(lro, {
1173
+ resumeFrom: options === null || options === void 0 ? void 0 : options.resumeFrom,
1174
+ intervalInMs: options === null || options === void 0 ? void 0 : options.updateIntervalInMs
1175
+ });
1176
+ yield poller.poll();
1177
+ return poller;
1178
+ });
1179
+ }
1180
+ /**
1181
+ * Deletes the specified Azure Dedicated HSM.
1182
+ * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs.
1183
+ * @param name The name of the dedicated HSM to delete
1184
+ * @param options The options parameters.
1185
+ */
1186
+ beginDeleteAndWait(resourceGroupName, name, options) {
1187
+ return tslib.__awaiter(this, void 0, void 0, function* () {
1188
+ const poller = yield this.beginDelete(resourceGroupName, name, options);
1189
+ return poller.pollUntilDone();
1190
+ });
1191
+ }
1192
+ /**
1193
+ * Gets the specified Azure dedicated HSM.
1194
+ * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs.
1195
+ * @param name The name of the dedicated HSM.
1196
+ * @param options The options parameters.
1197
+ */
1198
+ get(resourceGroupName, name, options) {
1199
+ return this.client.sendOperationRequest({ resourceGroupName, name, options }, getOperationSpec);
1200
+ }
1201
+ /**
1202
+ * The List operation gets information about the dedicated hsms associated with the subscription and
1203
+ * within the specified resource group.
1204
+ * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs.
1205
+ * @param options The options parameters.
1206
+ */
1207
+ _listByResourceGroup(resourceGroupName, options) {
1208
+ return this.client.sendOperationRequest({ resourceGroupName, options }, listByResourceGroupOperationSpec);
1209
+ }
1210
+ /**
1211
+ * The List operation gets information about the dedicated HSMs associated with the subscription.
1212
+ * @param options The options parameters.
1213
+ */
1214
+ _listBySubscription(options) {
1215
+ return this.client.sendOperationRequest({ options }, listBySubscriptionOperationSpec);
1216
+ }
1217
+ /**
1218
+ * Gets a list of egress endpoints (network endpoints of all outbound dependencies) in the specified
1219
+ * dedicated hsm resource. The operation returns properties of each egress endpoint.
1220
+ * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs.
1221
+ * @param name The name of the dedicated HSM.
1222
+ * @param options The options parameters.
1223
+ */
1224
+ _listOutboundNetworkDependenciesEndpoints(resourceGroupName, name, options) {
1225
+ return this.client.sendOperationRequest({ resourceGroupName, name, options }, listOutboundNetworkDependenciesEndpointsOperationSpec);
1226
+ }
1227
+ /**
1228
+ * ListByResourceGroupNext
1229
+ * @param resourceGroupName The name of the Resource Group to which the dedicated HSM belongs.
1230
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
1231
+ * @param options The options parameters.
1232
+ */
1233
+ _listByResourceGroupNext(resourceGroupName, nextLink, options) {
1234
+ return this.client.sendOperationRequest({ resourceGroupName, nextLink, options }, listByResourceGroupNextOperationSpec);
1235
+ }
1236
+ /**
1237
+ * ListBySubscriptionNext
1238
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
1239
+ * @param options The options parameters.
1240
+ */
1241
+ _listBySubscriptionNext(nextLink, options) {
1242
+ return this.client.sendOperationRequest({ nextLink, options }, listBySubscriptionNextOperationSpec);
1243
+ }
1244
+ /**
1245
+ * ListOutboundNetworkDependenciesEndpointsNext
1246
+ * @param resourceGroupName The name of the Resource Group to which the dedicated hsm belongs.
1247
+ * @param name The name of the dedicated HSM.
1248
+ * @param nextLink The nextLink from the previous successful call to the
1249
+ * ListOutboundNetworkDependenciesEndpoints method.
1250
+ * @param options The options parameters.
1251
+ */
1252
+ _listOutboundNetworkDependenciesEndpointsNext(resourceGroupName, name, nextLink, options) {
1253
+ return this.client.sendOperationRequest({ resourceGroupName, name, nextLink, options }, listOutboundNetworkDependenciesEndpointsNextOperationSpec);
1254
+ }
1255
+ }
1256
+ // Operation Specifications
1257
+ const serializer = coreClient__namespace.createSerializer(Mappers, /* isXml */ false);
1258
+ const createOrUpdateOperationSpec = {
1259
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}",
1260
+ httpMethod: "PUT",
1261
+ responses: {
1262
+ 200: {
1263
+ bodyMapper: DedicatedHsm
1264
+ },
1265
+ 201: {
1266
+ bodyMapper: DedicatedHsm
1267
+ },
1268
+ 202: {
1269
+ bodyMapper: DedicatedHsm
1270
+ },
1271
+ 204: {
1272
+ bodyMapper: DedicatedHsm
1273
+ },
1274
+ default: {
1275
+ bodyMapper: DedicatedHsmError
1276
+ }
1277
+ },
1278
+ requestBody: parameters,
1279
+ queryParameters: [apiVersion],
1280
+ urlParameters: [
1281
+ $host,
1282
+ resourceGroupName,
1283
+ name,
1284
+ subscriptionId
1285
+ ],
1286
+ headerParameters: [accept, contentType],
1287
+ mediaType: "json",
1288
+ serializer
1289
+ };
1290
+ const updateOperationSpec = {
1291
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}",
1292
+ httpMethod: "PATCH",
1293
+ responses: {
1294
+ 200: {
1295
+ bodyMapper: DedicatedHsm
1296
+ },
1297
+ 201: {
1298
+ bodyMapper: DedicatedHsm
1299
+ },
1300
+ 202: {
1301
+ bodyMapper: DedicatedHsm
1302
+ },
1303
+ 204: {
1304
+ bodyMapper: DedicatedHsm
1305
+ },
1306
+ default: {
1307
+ bodyMapper: DedicatedHsmError
1308
+ }
1309
+ },
1310
+ requestBody: {
1311
+ parameterPath: { tags: ["options", "tags"] },
1312
+ mapper: Object.assign(Object.assign({}, DedicatedHsmPatchParameters), { required: true })
1313
+ },
1314
+ queryParameters: [apiVersion],
1315
+ urlParameters: [
1316
+ $host,
1317
+ resourceGroupName,
1318
+ name,
1319
+ subscriptionId
1320
+ ],
1321
+ headerParameters: [accept, contentType],
1322
+ mediaType: "json",
1323
+ serializer
1324
+ };
1325
+ const deleteOperationSpec = {
1326
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}",
1327
+ httpMethod: "DELETE",
1328
+ responses: {
1329
+ 200: {},
1330
+ 201: {},
1331
+ 202: {},
1332
+ 204: {},
1333
+ default: {
1334
+ bodyMapper: DedicatedHsmError
1335
+ }
1336
+ },
1337
+ queryParameters: [apiVersion],
1338
+ urlParameters: [
1339
+ $host,
1340
+ resourceGroupName,
1341
+ subscriptionId,
1342
+ name1
1343
+ ],
1344
+ headerParameters: [accept],
1345
+ serializer
1346
+ };
1347
+ const getOperationSpec = {
1348
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}",
1349
+ httpMethod: "GET",
1350
+ responses: {
1351
+ 200: {
1352
+ bodyMapper: DedicatedHsm
1353
+ },
1354
+ default: {
1355
+ bodyMapper: DedicatedHsmError
1356
+ }
1357
+ },
1358
+ queryParameters: [apiVersion],
1359
+ urlParameters: [
1360
+ $host,
1361
+ resourceGroupName,
1362
+ subscriptionId,
1363
+ name1
1364
+ ],
1365
+ headerParameters: [accept],
1366
+ serializer
1367
+ };
1368
+ const listByResourceGroupOperationSpec = {
1369
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs",
1370
+ httpMethod: "GET",
1371
+ responses: {
1372
+ 200: {
1373
+ bodyMapper: DedicatedHsmListResult
1374
+ },
1375
+ default: {
1376
+ bodyMapper: DedicatedHsmError
1377
+ }
1378
+ },
1379
+ queryParameters: [apiVersion, top],
1380
+ urlParameters: [
1381
+ $host,
1382
+ resourceGroupName,
1383
+ subscriptionId
1384
+ ],
1385
+ headerParameters: [accept],
1386
+ serializer
1387
+ };
1388
+ const listBySubscriptionOperationSpec = {
1389
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs",
1390
+ httpMethod: "GET",
1391
+ responses: {
1392
+ 200: {
1393
+ bodyMapper: DedicatedHsmListResult
1394
+ },
1395
+ default: {
1396
+ bodyMapper: DedicatedHsmError
1397
+ }
1398
+ },
1399
+ queryParameters: [apiVersion, top],
1400
+ urlParameters: [$host, subscriptionId],
1401
+ headerParameters: [accept],
1402
+ serializer
1403
+ };
1404
+ const listOutboundNetworkDependenciesEndpointsOperationSpec = {
1405
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/dedicatedHSMs/{name}/outboundNetworkDependenciesEndpoints",
1406
+ httpMethod: "GET",
1407
+ responses: {
1408
+ 200: {
1409
+ bodyMapper: OutboundEnvironmentEndpointCollection
1410
+ },
1411
+ default: {
1412
+ bodyMapper: DedicatedHsmError
1413
+ }
1414
+ },
1415
+ queryParameters: [apiVersion],
1416
+ urlParameters: [
1417
+ $host,
1418
+ resourceGroupName,
1419
+ subscriptionId,
1420
+ name1
1421
+ ],
1422
+ headerParameters: [accept],
1423
+ serializer
1424
+ };
1425
+ const listByResourceGroupNextOperationSpec = {
1426
+ path: "{nextLink}",
1427
+ httpMethod: "GET",
1428
+ responses: {
1429
+ 200: {
1430
+ bodyMapper: DedicatedHsmListResult
1431
+ },
1432
+ default: {
1433
+ bodyMapper: DedicatedHsmError
1434
+ }
1435
+ },
1436
+ queryParameters: [apiVersion, top],
1437
+ urlParameters: [
1438
+ $host,
1439
+ resourceGroupName,
1440
+ subscriptionId,
1441
+ nextLink
1442
+ ],
1443
+ headerParameters: [accept],
1444
+ serializer
1445
+ };
1446
+ const listBySubscriptionNextOperationSpec = {
1447
+ path: "{nextLink}",
1448
+ httpMethod: "GET",
1449
+ responses: {
1450
+ 200: {
1451
+ bodyMapper: DedicatedHsmListResult
1452
+ },
1453
+ default: {
1454
+ bodyMapper: DedicatedHsmError
1455
+ }
1456
+ },
1457
+ queryParameters: [apiVersion, top],
1458
+ urlParameters: [
1459
+ $host,
1460
+ subscriptionId,
1461
+ nextLink
1462
+ ],
1463
+ headerParameters: [accept],
1464
+ serializer
1465
+ };
1466
+ const listOutboundNetworkDependenciesEndpointsNextOperationSpec = {
1467
+ path: "{nextLink}",
1468
+ httpMethod: "GET",
1469
+ responses: {
1470
+ 200: {
1471
+ bodyMapper: OutboundEnvironmentEndpointCollection
1472
+ },
1473
+ default: {
1474
+ bodyMapper: DedicatedHsmError
1475
+ }
1476
+ },
1477
+ queryParameters: [apiVersion],
1478
+ urlParameters: [
1479
+ $host,
1480
+ resourceGroupName,
1481
+ subscriptionId,
1482
+ name1,
1483
+ nextLink
1484
+ ],
1485
+ headerParameters: [accept],
1486
+ serializer
1487
+ };
1488
+
1489
+ /*
1490
+ * Copyright (c) Microsoft Corporation.
1491
+ * Licensed under the MIT License.
1492
+ *
1493
+ * Code generated by Microsoft (R) AutoRest Code Generator.
1494
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
1495
+ */
1496
+ class AzureDedicatedHSMResourceProvider extends coreClient__namespace.ServiceClient {
1497
+ /**
1498
+ * Initializes a new instance of the AzureDedicatedHSMResourceProvider class.
1499
+ * @param credentials Subscription credentials which uniquely identify client subscription.
1500
+ * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription.
1501
+ * The subscription ID forms part of the URI for every service call.
1502
+ * @param options The parameter options
1503
+ */
1504
+ constructor(credentials, subscriptionId, options) {
1505
+ var _a, _b;
1506
+ if (credentials === undefined) {
1507
+ throw new Error("'credentials' cannot be null");
1508
+ }
1509
+ if (subscriptionId === undefined) {
1510
+ throw new Error("'subscriptionId' cannot be null");
1511
+ }
1512
+ // Initializing default values for options
1513
+ if (!options) {
1514
+ options = {};
1515
+ }
1516
+ const defaults = {
1517
+ requestContentType: "application/json; charset=utf-8",
1518
+ credential: credentials
1519
+ };
1520
+ const packageDetails = `azsdk-js-arm-hardwaresecuritymodules/1.0.0`;
1521
+ const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
1522
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
1523
+ : `${packageDetails}`;
1524
+ if (!options.credentialScopes) {
1525
+ options.credentialScopes = ["https://management.azure.com/.default"];
1526
+ }
1527
+ const optionsWithDefaults = Object.assign(Object.assign(Object.assign({}, defaults), options), { userAgentOptions: {
1528
+ userAgentPrefix
1529
+ }, baseUri: (_b = (_a = options.endpoint) !== null && _a !== void 0 ? _a : options.baseUri) !== null && _b !== void 0 ? _b : "https://management.azure.com" });
1530
+ super(optionsWithDefaults);
1531
+ // Parameter assignments
1532
+ this.subscriptionId = subscriptionId;
1533
+ // Assigning values to Constant parameters
1534
+ this.$host = options.$host || "https://management.azure.com";
1535
+ this.apiVersion = options.apiVersion || "2021-11-30";
1536
+ this.operations = new OperationsImpl(this);
1537
+ this.dedicatedHsmOperations = new DedicatedHsmOperationsImpl(this);
1538
+ }
1539
+ }
1540
+
1541
+ exports.AzureDedicatedHSMResourceProvider = AzureDedicatedHSMResourceProvider;
1542
+ //# sourceMappingURL=index.js.map