@azure/arm-hardwaresecuritymodules 2.0.0-beta.1 → 2.0.0-beta.2

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 (172) hide show
  1. package/CHANGELOG.md +146 -2
  2. package/dist/index.js +2121 -1216
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/samples-dev/cloudHsmClusterBackupStatusGetSample.d.ts +2 -0
  7. package/dist-esm/samples-dev/cloudHsmClusterBackupStatusGetSample.d.ts.map +1 -0
  8. package/dist-esm/samples-dev/cloudHsmClusterBackupStatusGetSample.js +40 -0
  9. package/dist-esm/samples-dev/cloudHsmClusterBackupStatusGetSample.js.map +1 -0
  10. package/dist-esm/samples-dev/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js +4 -4
  11. package/dist-esm/samples-dev/cloudHsmClusterPrivateEndpointConnectionsCreateSample.js.map +1 -1
  12. package/dist-esm/samples-dev/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js +1 -1
  13. package/dist-esm/samples-dev/cloudHsmClusterPrivateEndpointConnectionsDeleteSample.js.map +1 -1
  14. package/dist-esm/samples-dev/cloudHsmClusterPrivateEndpointConnectionsGetSample.js +1 -1
  15. package/dist-esm/samples-dev/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js +20 -4
  16. package/dist-esm/samples-dev/cloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterSample.js.map +1 -1
  17. package/dist-esm/samples-dev/cloudHsmClusterRestoreStatusGetSample.d.ts +2 -0
  18. package/dist-esm/samples-dev/cloudHsmClusterRestoreStatusGetSample.d.ts.map +1 -0
  19. package/dist-esm/samples-dev/cloudHsmClusterRestoreStatusGetSample.js +40 -0
  20. package/dist-esm/samples-dev/cloudHsmClusterRestoreStatusGetSample.js.map +1 -0
  21. package/dist-esm/samples-dev/cloudHsmClustersBackupSample.d.ts +2 -0
  22. package/dist-esm/samples-dev/cloudHsmClustersBackupSample.d.ts.map +1 -0
  23. package/dist-esm/samples-dev/cloudHsmClustersBackupSample.js +39 -0
  24. package/dist-esm/samples-dev/cloudHsmClustersBackupSample.js.map +1 -0
  25. package/dist-esm/samples-dev/cloudHsmClustersCreateOrUpdateSample.js +6 -6
  26. package/dist-esm/samples-dev/cloudHsmClustersCreateOrUpdateSample.js.map +1 -1
  27. package/dist-esm/samples-dev/cloudHsmClustersDeleteSample.js +1 -1
  28. package/dist-esm/samples-dev/cloudHsmClustersGetSample.js +1 -1
  29. package/dist-esm/samples-dev/cloudHsmClustersListByResourceGroupSample.js +2 -2
  30. package/dist-esm/samples-dev/cloudHsmClustersListByResourceGroupSample.js.map +1 -1
  31. package/dist-esm/samples-dev/cloudHsmClustersListBySubscriptionSample.js +2 -2
  32. package/dist-esm/samples-dev/cloudHsmClustersListBySubscriptionSample.js.map +1 -1
  33. package/dist-esm/samples-dev/cloudHsmClustersRestoreSample.d.ts +2 -0
  34. package/dist-esm/samples-dev/cloudHsmClustersRestoreSample.d.ts.map +1 -0
  35. package/dist-esm/samples-dev/cloudHsmClustersRestoreSample.js +43 -0
  36. package/dist-esm/samples-dev/cloudHsmClustersRestoreSample.js.map +1 -0
  37. package/dist-esm/samples-dev/cloudHsmClustersUpdateSample.js +4 -4
  38. package/dist-esm/samples-dev/cloudHsmClustersUpdateSample.js.map +1 -1
  39. package/dist-esm/samples-dev/cloudHsmClustersValidateBackupPropertiesSample.d.ts +2 -0
  40. package/dist-esm/samples-dev/cloudHsmClustersValidateBackupPropertiesSample.d.ts.map +1 -0
  41. package/dist-esm/samples-dev/cloudHsmClustersValidateBackupPropertiesSample.js +39 -0
  42. package/dist-esm/samples-dev/cloudHsmClustersValidateBackupPropertiesSample.js.map +1 -0
  43. package/dist-esm/samples-dev/cloudHsmClustersValidateRestorePropertiesSample.d.ts +2 -0
  44. package/dist-esm/samples-dev/cloudHsmClustersValidateRestorePropertiesSample.d.ts.map +1 -0
  45. package/dist-esm/samples-dev/cloudHsmClustersValidateRestorePropertiesSample.js +46 -0
  46. package/dist-esm/samples-dev/cloudHsmClustersValidateRestorePropertiesSample.js.map +1 -0
  47. package/dist-esm/samples-dev/dedicatedHsmCreateOrUpdateSample.js +15 -15
  48. package/dist-esm/samples-dev/dedicatedHsmCreateOrUpdateSample.js.map +1 -1
  49. package/dist-esm/samples-dev/dedicatedHsmDeleteSample.js +1 -1
  50. package/dist-esm/samples-dev/dedicatedHsmGetSample.js +3 -3
  51. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.js +4 -4
  52. package/dist-esm/samples-dev/dedicatedHsmListByResourceGroupSample.js.map +1 -1
  53. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.js +4 -4
  54. package/dist-esm/samples-dev/dedicatedHsmListBySubscriptionSample.js.map +1 -1
  55. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js +2 -2
  56. package/dist-esm/samples-dev/dedicatedHsmListOutboundNetworkDependenciesEndpointsSample.js.map +1 -1
  57. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.js +3 -3
  58. package/dist-esm/samples-dev/dedicatedHsmUpdateSample.js.map +1 -1
  59. package/dist-esm/samples-dev/operationsListSample.js +8 -8
  60. package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
  61. package/dist-esm/samples-dev/privateEndpointConnectionsListByCloudHsmClusterSample.js +2 -2
  62. package/dist-esm/samples-dev/privateEndpointConnectionsListByCloudHsmClusterSample.js.map +1 -1
  63. package/dist-esm/src/azureHSMResourceProvider.d.ts +7 -2
  64. package/dist-esm/src/azureHSMResourceProvider.d.ts.map +1 -1
  65. package/dist-esm/src/azureHSMResourceProvider.js +44 -10
  66. package/dist-esm/src/azureHSMResourceProvider.js.map +1 -1
  67. package/dist-esm/src/index.d.ts +0 -1
  68. package/dist-esm/src/index.d.ts.map +1 -1
  69. package/dist-esm/src/lroImpl.js +1 -1
  70. package/dist-esm/src/models/index.d.ts +543 -263
  71. package/dist-esm/src/models/index.d.ts.map +1 -1
  72. package/dist-esm/src/models/index.js +109 -49
  73. package/dist-esm/src/models/index.js.map +1 -1
  74. package/dist-esm/src/models/mappers.d.ts +28 -16
  75. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  76. package/dist-esm/src/models/mappers.js +832 -637
  77. package/dist-esm/src/models/mappers.js.map +1 -1
  78. package/dist-esm/src/models/parameters.d.ts +5 -12
  79. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  80. package/dist-esm/src/models/parameters.js +76 -117
  81. package/dist-esm/src/models/parameters.js.map +1 -1
  82. package/dist-esm/src/operations/cloudHsmClusterBackupStatus.d.ts +22 -0
  83. package/dist-esm/src/operations/cloudHsmClusterBackupStatus.d.ts.map +1 -0
  84. package/dist-esm/src/operations/cloudHsmClusterBackupStatus.js +61 -0
  85. package/dist-esm/src/operations/cloudHsmClusterBackupStatus.js.map +1 -0
  86. package/dist-esm/src/operations/cloudHsmClusterPrivateEndpointConnections.d.ts +7 -7
  87. package/dist-esm/src/operations/cloudHsmClusterPrivateEndpointConnections.d.ts.map +1 -1
  88. package/dist-esm/src/operations/cloudHsmClusterPrivateEndpointConnections.js +37 -29
  89. package/dist-esm/src/operations/cloudHsmClusterPrivateEndpointConnections.js.map +1 -1
  90. package/dist-esm/src/operations/cloudHsmClusterPrivateLinkResources.d.ts +23 -3
  91. package/dist-esm/src/operations/cloudHsmClusterPrivateLinkResources.d.ts.map +1 -1
  92. package/dist-esm/src/operations/cloudHsmClusterPrivateLinkResources.js +105 -6
  93. package/dist-esm/src/operations/cloudHsmClusterPrivateLinkResources.js.map +1 -1
  94. package/dist-esm/src/operations/cloudHsmClusterRestoreStatus.d.ts +22 -0
  95. package/dist-esm/src/operations/cloudHsmClusterRestoreStatus.d.ts.map +1 -0
  96. package/dist-esm/src/operations/cloudHsmClusterRestoreStatus.js +61 -0
  97. package/dist-esm/src/operations/cloudHsmClusterRestoreStatus.js.map +1 -0
  98. package/dist-esm/src/operations/cloudHsmClusters.d.ts +78 -10
  99. package/dist-esm/src/operations/cloudHsmClusters.d.ts.map +1 -1
  100. package/dist-esm/src/operations/cloudHsmClusters.js +467 -82
  101. package/dist-esm/src/operations/cloudHsmClusters.js.map +1 -1
  102. package/dist-esm/src/operations/dedicatedHsmOperations.d.ts +24 -24
  103. package/dist-esm/src/operations/dedicatedHsmOperations.d.ts.map +1 -1
  104. package/dist-esm/src/operations/dedicatedHsmOperations.js +117 -109
  105. package/dist-esm/src/operations/dedicatedHsmOperations.js.map +1 -1
  106. package/dist-esm/src/operations/index.d.ts +3 -1
  107. package/dist-esm/src/operations/index.d.ts.map +1 -1
  108. package/dist-esm/src/operations/index.js +3 -1
  109. package/dist-esm/src/operations/index.js.map +1 -1
  110. package/dist-esm/src/operations/operations.d.ts +4 -4
  111. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  112. package/dist-esm/src/operations/operations.js +8 -8
  113. package/dist-esm/src/operations/operations.js.map +1 -1
  114. package/dist-esm/src/operations/privateEndpointConnections.d.ts +3 -3
  115. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  116. package/dist-esm/src/operations/privateEndpointConnections.js +14 -14
  117. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  118. package/dist-esm/src/operationsInterfaces/cloudHsmClusterBackupStatus.d.ts +14 -0
  119. package/dist-esm/src/operationsInterfaces/cloudHsmClusterBackupStatus.d.ts.map +1 -0
  120. package/dist-esm/src/operationsInterfaces/cloudHsmClusterBackupStatus.js +9 -0
  121. package/dist-esm/src/operationsInterfaces/cloudHsmClusterBackupStatus.js.map +1 -0
  122. package/dist-esm/src/operationsInterfaces/cloudHsmClusterPrivateEndpointConnections.d.ts +7 -7
  123. package/dist-esm/src/operationsInterfaces/cloudHsmClusterPrivateEndpointConnections.d.ts.map +1 -1
  124. package/dist-esm/src/operationsInterfaces/cloudHsmClusterPrivateLinkResources.d.ts +4 -3
  125. package/dist-esm/src/operationsInterfaces/cloudHsmClusterPrivateLinkResources.d.ts.map +1 -1
  126. package/dist-esm/src/operationsInterfaces/cloudHsmClusterRestoreStatus.d.ts +14 -0
  127. package/dist-esm/src/operationsInterfaces/cloudHsmClusterRestoreStatus.d.ts.map +1 -0
  128. package/dist-esm/src/operationsInterfaces/cloudHsmClusterRestoreStatus.js +9 -0
  129. package/dist-esm/src/operationsInterfaces/cloudHsmClusterRestoreStatus.js.map +1 -0
  130. package/dist-esm/src/operationsInterfaces/cloudHsmClusters.d.ts +78 -10
  131. package/dist-esm/src/operationsInterfaces/cloudHsmClusters.d.ts.map +1 -1
  132. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.d.ts +18 -18
  133. package/dist-esm/src/operationsInterfaces/dedicatedHsmOperations.d.ts.map +1 -1
  134. package/dist-esm/src/operationsInterfaces/index.d.ts +3 -1
  135. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  136. package/dist-esm/src/operationsInterfaces/index.js +3 -1
  137. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  138. package/dist-esm/src/operationsInterfaces/operations.d.ts +3 -3
  139. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -1
  140. package/dist-esm/src/operationsInterfaces/privateEndpointConnections.d.ts +1 -1
  141. package/dist-esm/src/pagingHelper.js.map +1 -1
  142. package/dist-esm/test/hardwaresecuritymodules_operations_test.spec.d.ts.map +1 -1
  143. package/dist-esm/test/hardwaresecuritymodules_operations_test.spec.js +6 -2
  144. package/dist-esm/test/hardwaresecuritymodules_operations_test.spec.js.map +1 -1
  145. package/package.json +14 -15
  146. package/review/arm-hardwaresecuritymodules.api.md +298 -93
  147. package/src/azureHSMResourceProvider.ts +67 -20
  148. package/src/lroImpl.ts +4 -4
  149. package/src/models/index.ts +633 -284
  150. package/src/models/mappers.ts +898 -675
  151. package/src/models/parameters.ts +82 -128
  152. package/src/operations/cloudHsmClusterBackupStatus.ts +82 -0
  153. package/src/operations/cloudHsmClusterPrivateEndpointConnections.ts +74 -56
  154. package/src/operations/cloudHsmClusterPrivateLinkResources.ts +145 -13
  155. package/src/operations/cloudHsmClusterRestoreStatus.ts +82 -0
  156. package/src/operations/cloudHsmClusters.ts +684 -151
  157. package/src/operations/dedicatedHsmOperations.ts +224 -215
  158. package/src/operations/index.ts +3 -1
  159. package/src/operations/operations.ts +17 -17
  160. package/src/operations/privateEndpointConnections.ts +30 -30
  161. package/src/operationsInterfaces/cloudHsmClusterBackupStatus.ts +30 -0
  162. package/src/operationsInterfaces/cloudHsmClusterPrivateEndpointConnections.ts +17 -11
  163. package/src/operationsInterfaces/cloudHsmClusterPrivateLinkResources.ts +6 -4
  164. package/src/operationsInterfaces/cloudHsmClusterRestoreStatus.ts +30 -0
  165. package/src/operationsInterfaces/cloudHsmClusters.ts +156 -19
  166. package/src/operationsInterfaces/dedicatedHsmOperations.ts +34 -28
  167. package/src/operationsInterfaces/index.ts +3 -1
  168. package/src/operationsInterfaces/operations.ts +4 -4
  169. package/src/operationsInterfaces/privateEndpointConnections.ts +3 -3
  170. package/src/pagingHelper.ts +1 -1
  171. package/types/arm-hardwaresecuritymodules.d.ts +625 -205
  172. package/types/tsdoc-metadata.json +1 -1
@@ -14,7 +14,7 @@ import { AzureHSMResourceProvider } from "../azureHSMResourceProvider";
14
14
  import {
15
15
  SimplePollerLike,
16
16
  OperationState,
17
- createHttpPoller
17
+ createHttpPoller,
18
18
  } from "@azure/core-lro";
19
19
  import { createLroSpec } from "../lroImpl";
20
20
  import {
@@ -22,13 +22,15 @@ import {
22
22
  CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams,
23
23
  CloudHsmClusterPrivateEndpointConnectionsCreateResponse,
24
24
  CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams,
25
+ CloudHsmClusterPrivateEndpointConnectionsDeleteResponse,
25
26
  CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams,
26
- CloudHsmClusterPrivateEndpointConnectionsGetResponse
27
+ CloudHsmClusterPrivateEndpointConnectionsGetResponse,
27
28
  } from "../models";
28
29
 
29
30
  /** Class containing CloudHsmClusterPrivateEndpointConnections operations. */
30
31
  export class CloudHsmClusterPrivateEndpointConnectionsImpl
31
- implements CloudHsmClusterPrivateEndpointConnections {
32
+ implements CloudHsmClusterPrivateEndpointConnections
33
+ {
32
34
  private readonly client: AzureHSMResourceProvider;
33
35
 
34
36
  /**
@@ -43,7 +45,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
43
45
  * Creates or updates the private endpoint connection for the Cloud Hsm Cluster.
44
46
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
45
47
  * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group.
46
- * Cloud HSM Cluster names must be between 3 and 24 characters in length.
48
+ * Cloud HSM Cluster names must be between 3 and 23 characters in length.
47
49
  * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM
48
50
  * Cluster.
49
51
  * @param properties Parameters of the PrivateEndpointConnection
@@ -54,7 +56,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
54
56
  cloudHsmClusterName: string,
55
57
  peConnectionName: string,
56
58
  properties: PrivateEndpointConnection,
57
- options?: CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams
59
+ options?: CloudHsmClusterPrivateEndpointConnectionsCreateOptionalParams,
58
60
  ): Promise<CloudHsmClusterPrivateEndpointConnectionsCreateResponse> {
59
61
  return this.client.sendOperationRequest(
60
62
  {
@@ -62,9 +64,9 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
62
64
  cloudHsmClusterName,
63
65
  peConnectionName,
64
66
  properties,
65
- options
67
+ options,
66
68
  },
67
- createOperationSpec
69
+ createOperationSpec,
68
70
  );
69
71
  }
70
72
 
@@ -72,7 +74,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
72
74
  * Deletes the private endpoint connection for the Cloud Hsm Cluster.
73
75
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
74
76
  * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group.
75
- * Cloud HSM Cluster names must be between 3 and 24 characters in length.
77
+ * Cloud HSM Cluster names must be between 3 and 23 characters in length.
76
78
  * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM
77
79
  * Cluster.
78
80
  * @param options The options parameters.
@@ -81,25 +83,29 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
81
83
  resourceGroupName: string,
82
84
  cloudHsmClusterName: string,
83
85
  peConnectionName: string,
84
- options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams
85
- ): Promise<SimplePollerLike<OperationState<void>, void>> {
86
+ options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams,
87
+ ): Promise<
88
+ SimplePollerLike<
89
+ OperationState<CloudHsmClusterPrivateEndpointConnectionsDeleteResponse>,
90
+ CloudHsmClusterPrivateEndpointConnectionsDeleteResponse
91
+ >
92
+ > {
86
93
  const directSendOperation = async (
87
94
  args: coreClient.OperationArguments,
88
- spec: coreClient.OperationSpec
89
- ): Promise<void> => {
95
+ spec: coreClient.OperationSpec,
96
+ ): Promise<CloudHsmClusterPrivateEndpointConnectionsDeleteResponse> => {
90
97
  return this.client.sendOperationRequest(args, spec);
91
98
  };
92
99
  const sendOperationFn = async (
93
100
  args: coreClient.OperationArguments,
94
- spec: coreClient.OperationSpec
101
+ spec: coreClient.OperationSpec,
95
102
  ) => {
96
- let currentRawResponse:
97
- | coreClient.FullOperationResponse
98
- | undefined = undefined;
103
+ let currentRawResponse: coreClient.FullOperationResponse | undefined =
104
+ undefined;
99
105
  const providedCallback = args.options?.onResponse;
100
106
  const callback: coreClient.RawResponseCallback = (
101
107
  rawResponse: coreClient.FullOperationResponse,
102
- flatResponse: unknown
108
+ flatResponse: unknown,
103
109
  ) => {
104
110
  currentRawResponse = rawResponse;
105
111
  providedCallback?.(rawResponse, flatResponse);
@@ -108,8 +114,8 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
108
114
  ...args,
109
115
  options: {
110
116
  ...args.options,
111
- onResponse: callback
112
- }
117
+ onResponse: callback,
118
+ },
113
119
  };
114
120
  const flatResponse = await directSendOperation(updatedArgs, spec);
115
121
  return {
@@ -117,8 +123,8 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
117
123
  rawResponse: {
118
124
  statusCode: currentRawResponse!.status,
119
125
  body: currentRawResponse!.parsedBody,
120
- headers: currentRawResponse!.headers.toJSON()
121
- }
126
+ headers: currentRawResponse!.headers.toJSON(),
127
+ },
122
128
  };
123
129
  };
124
130
 
@@ -128,14 +134,17 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
128
134
  resourceGroupName,
129
135
  cloudHsmClusterName,
130
136
  peConnectionName,
131
- options
137
+ options,
132
138
  },
133
- spec: deleteOperationSpec
139
+ spec: deleteOperationSpec,
134
140
  });
135
- const poller = await createHttpPoller<void, OperationState<void>>(lro, {
141
+ const poller = await createHttpPoller<
142
+ CloudHsmClusterPrivateEndpointConnectionsDeleteResponse,
143
+ OperationState<CloudHsmClusterPrivateEndpointConnectionsDeleteResponse>
144
+ >(lro, {
136
145
  restoreFrom: options?.resumeFrom,
137
146
  intervalInMs: options?.updateIntervalInMs,
138
- resourceLocationConfig: "location"
147
+ resourceLocationConfig: "location",
139
148
  });
140
149
  await poller.poll();
141
150
  return poller;
@@ -145,7 +154,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
145
154
  * Deletes the private endpoint connection for the Cloud Hsm Cluster.
146
155
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
147
156
  * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group.
148
- * Cloud HSM Cluster names must be between 3 and 24 characters in length.
157
+ * Cloud HSM Cluster names must be between 3 and 23 characters in length.
149
158
  * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM
150
159
  * Cluster.
151
160
  * @param options The options parameters.
@@ -154,13 +163,13 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
154
163
  resourceGroupName: string,
155
164
  cloudHsmClusterName: string,
156
165
  peConnectionName: string,
157
- options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams
158
- ): Promise<void> {
166
+ options?: CloudHsmClusterPrivateEndpointConnectionsDeleteOptionalParams,
167
+ ): Promise<CloudHsmClusterPrivateEndpointConnectionsDeleteResponse> {
159
168
  const poller = await this.beginDelete(
160
169
  resourceGroupName,
161
170
  cloudHsmClusterName,
162
171
  peConnectionName,
163
- options
172
+ options,
164
173
  );
165
174
  return poller.pollUntilDone();
166
175
  }
@@ -169,7 +178,7 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
169
178
  * Gets the private endpoint connection for the Cloud Hsm Cluster.
170
179
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
171
180
  * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group.
172
- * Cloud HSM Cluster names must be between 3 and 24 characters in length.
181
+ * Cloud HSM Cluster names must be between 3 and 23 characters in length.
173
182
  * @param peConnectionName Name of the private endpoint connection associated with the Cloud HSM
174
183
  * Cluster.
175
184
  * @param options The options parameters.
@@ -178,11 +187,11 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
178
187
  resourceGroupName: string,
179
188
  cloudHsmClusterName: string,
180
189
  peConnectionName: string,
181
- options?: CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams
190
+ options?: CloudHsmClusterPrivateEndpointConnectionsGetOptionalParams,
182
191
  ): Promise<CloudHsmClusterPrivateEndpointConnectionsGetResponse> {
183
192
  return this.client.sendOperationRequest(
184
193
  { resourceGroupName, cloudHsmClusterName, peConnectionName, options },
185
- getOperationSpec
194
+ getOperationSpec,
186
195
  );
187
196
  }
188
197
  }
@@ -190,16 +199,15 @@ export class CloudHsmClusterPrivateEndpointConnectionsImpl
190
199
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
191
200
 
192
201
  const createOperationSpec: coreClient.OperationSpec = {
193
- path:
194
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}",
202
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}",
195
203
  httpMethod: "PUT",
196
204
  responses: {
197
205
  200: {
198
- bodyMapper: Mappers.PrivateEndpointConnection
206
+ bodyMapper: Mappers.PrivateEndpointConnection,
199
207
  },
200
208
  default: {
201
- bodyMapper: Mappers.CloudHsmClusterError
202
- }
209
+ bodyMapper: Mappers.ErrorResponse,
210
+ },
203
211
  },
204
212
  requestBody: Parameters.properties,
205
213
  queryParameters: [Parameters.apiVersion],
@@ -208,24 +216,35 @@ const createOperationSpec: coreClient.OperationSpec = {
208
216
  Parameters.subscriptionId,
209
217
  Parameters.resourceGroupName,
210
218
  Parameters.cloudHsmClusterName,
211
- Parameters.peConnectionName
219
+ Parameters.peConnectionName,
212
220
  ],
213
221
  headerParameters: [Parameters.contentType, Parameters.accept],
214
222
  mediaType: "json",
215
- serializer
223
+ serializer,
216
224
  };
217
225
  const deleteOperationSpec: coreClient.OperationSpec = {
218
- path:
219
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}",
226
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}",
220
227
  httpMethod: "DELETE",
221
228
  responses: {
222
- 200: {},
223
- 201: {},
224
- 202: {},
225
- 204: {},
229
+ 200: {
230
+ headersMapper:
231
+ Mappers.CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders,
232
+ },
233
+ 201: {
234
+ headersMapper:
235
+ Mappers.CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders,
236
+ },
237
+ 202: {
238
+ headersMapper:
239
+ Mappers.CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders,
240
+ },
241
+ 204: {
242
+ headersMapper:
243
+ Mappers.CloudHsmClusterPrivateEndpointConnectionsDeleteHeaders,
244
+ },
226
245
  default: {
227
- bodyMapper: Mappers.CloudHsmClusterError
228
- }
246
+ bodyMapper: Mappers.ErrorResponse,
247
+ },
229
248
  },
230
249
  queryParameters: [Parameters.apiVersion],
231
250
  urlParameters: [
@@ -233,22 +252,21 @@ const deleteOperationSpec: coreClient.OperationSpec = {
233
252
  Parameters.subscriptionId,
234
253
  Parameters.resourceGroupName,
235
254
  Parameters.cloudHsmClusterName,
236
- Parameters.peConnectionName
255
+ Parameters.peConnectionName,
237
256
  ],
238
257
  headerParameters: [Parameters.accept],
239
- serializer
258
+ serializer,
240
259
  };
241
260
  const getOperationSpec: coreClient.OperationSpec = {
242
- path:
243
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}",
261
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateEndpointConnections/{peConnectionName}",
244
262
  httpMethod: "GET",
245
263
  responses: {
246
264
  200: {
247
- bodyMapper: Mappers.PrivateEndpointConnection
265
+ bodyMapper: Mappers.PrivateEndpointConnection,
248
266
  },
249
267
  default: {
250
- bodyMapper: Mappers.CloudHsmClusterError
251
- }
268
+ bodyMapper: Mappers.ErrorResponse,
269
+ },
252
270
  },
253
271
  queryParameters: [Parameters.apiVersion],
254
272
  urlParameters: [
@@ -256,8 +274,8 @@ const getOperationSpec: coreClient.OperationSpec = {
256
274
  Parameters.subscriptionId,
257
275
  Parameters.resourceGroupName,
258
276
  Parameters.cloudHsmClusterName,
259
- Parameters.peConnectionName
277
+ Parameters.peConnectionName,
260
278
  ],
261
279
  headerParameters: [Parameters.accept],
262
- serializer
280
+ serializer,
263
281
  };
@@ -6,19 +6,26 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
9
11
  import { CloudHsmClusterPrivateLinkResources } from "../operationsInterfaces";
10
12
  import * as coreClient from "@azure/core-client";
11
13
  import * as Mappers from "../models/mappers";
12
14
  import * as Parameters from "../models/parameters";
13
15
  import { AzureHSMResourceProvider } from "../azureHSMResourceProvider";
14
16
  import {
17
+ PrivateLinkResource,
18
+ CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextOptionalParams,
15
19
  CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams,
16
- CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse
20
+ CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse,
21
+ CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextResponse,
17
22
  } from "../models";
18
23
 
24
+ /// <reference lib="esnext.asynciterable" />
19
25
  /** Class containing CloudHsmClusterPrivateLinkResources operations. */
20
26
  export class CloudHsmClusterPrivateLinkResourcesImpl
21
- implements CloudHsmClusterPrivateLinkResources {
27
+ implements CloudHsmClusterPrivateLinkResources
28
+ {
22
29
  private readonly client: AzureHSMResourceProvider;
23
30
 
24
31
  /**
@@ -33,17 +40,122 @@ export class CloudHsmClusterPrivateLinkResourcesImpl
33
40
  * Gets the private link resources supported for the Cloud Hsm Cluster.
34
41
  * @param resourceGroupName The name of the resource group. The name is case insensitive.
35
42
  * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group.
36
- * Cloud HSM Cluster names must be between 3 and 24 characters in length.
43
+ * Cloud HSM Cluster names must be between 3 and 23 characters in length.
37
44
  * @param options The options parameters.
38
45
  */
39
- listByCloudHsmCluster(
46
+ public listByCloudHsmCluster(
40
47
  resourceGroupName: string,
41
48
  cloudHsmClusterName: string,
42
- options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams
49
+ options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams,
50
+ ): PagedAsyncIterableIterator<PrivateLinkResource> {
51
+ const iter = this.listByCloudHsmClusterPagingAll(
52
+ resourceGroupName,
53
+ cloudHsmClusterName,
54
+ options,
55
+ );
56
+ return {
57
+ next() {
58
+ return iter.next();
59
+ },
60
+ [Symbol.asyncIterator]() {
61
+ return this;
62
+ },
63
+ byPage: (settings?: PageSettings) => {
64
+ if (settings?.maxPageSize) {
65
+ throw new Error("maxPageSize is not supported by this operation.");
66
+ }
67
+ return this.listByCloudHsmClusterPagingPage(
68
+ resourceGroupName,
69
+ cloudHsmClusterName,
70
+ options,
71
+ settings,
72
+ );
73
+ },
74
+ };
75
+ }
76
+
77
+ private async *listByCloudHsmClusterPagingPage(
78
+ resourceGroupName: string,
79
+ cloudHsmClusterName: string,
80
+ options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams,
81
+ settings?: PageSettings,
82
+ ): AsyncIterableIterator<PrivateLinkResource[]> {
83
+ let result: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse;
84
+ let continuationToken = settings?.continuationToken;
85
+ if (!continuationToken) {
86
+ result = await this._listByCloudHsmCluster(
87
+ resourceGroupName,
88
+ cloudHsmClusterName,
89
+ options,
90
+ );
91
+ let page = result.value || [];
92
+ continuationToken = result.nextLink;
93
+ setContinuationToken(page, continuationToken);
94
+ yield page;
95
+ }
96
+ while (continuationToken) {
97
+ result = await this._listByCloudHsmClusterNext(
98
+ resourceGroupName,
99
+ cloudHsmClusterName,
100
+ continuationToken,
101
+ options,
102
+ );
103
+ continuationToken = result.nextLink;
104
+ let page = result.value || [];
105
+ setContinuationToken(page, continuationToken);
106
+ yield page;
107
+ }
108
+ }
109
+
110
+ private async *listByCloudHsmClusterPagingAll(
111
+ resourceGroupName: string,
112
+ cloudHsmClusterName: string,
113
+ options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams,
114
+ ): AsyncIterableIterator<PrivateLinkResource> {
115
+ for await (const page of this.listByCloudHsmClusterPagingPage(
116
+ resourceGroupName,
117
+ cloudHsmClusterName,
118
+ options,
119
+ )) {
120
+ yield* page;
121
+ }
122
+ }
123
+
124
+ /**
125
+ * Gets the private link resources supported for the Cloud Hsm Cluster.
126
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
127
+ * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group.
128
+ * Cloud HSM Cluster names must be between 3 and 23 characters in length.
129
+ * @param options The options parameters.
130
+ */
131
+ private _listByCloudHsmCluster(
132
+ resourceGroupName: string,
133
+ cloudHsmClusterName: string,
134
+ options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterOptionalParams,
43
135
  ): Promise<CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterResponse> {
44
136
  return this.client.sendOperationRequest(
45
137
  { resourceGroupName, cloudHsmClusterName, options },
46
- listByCloudHsmClusterOperationSpec
138
+ listByCloudHsmClusterOperationSpec,
139
+ );
140
+ }
141
+
142
+ /**
143
+ * ListByCloudHsmClusterNext
144
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
145
+ * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group.
146
+ * Cloud HSM Cluster names must be between 3 and 23 characters in length.
147
+ * @param nextLink The nextLink from the previous successful call to the ListByCloudHsmCluster method.
148
+ * @param options The options parameters.
149
+ */
150
+ private _listByCloudHsmClusterNext(
151
+ resourceGroupName: string,
152
+ cloudHsmClusterName: string,
153
+ nextLink: string,
154
+ options?: CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextOptionalParams,
155
+ ): Promise<CloudHsmClusterPrivateLinkResourcesListByCloudHsmClusterNextResponse> {
156
+ return this.client.sendOperationRequest(
157
+ { resourceGroupName, cloudHsmClusterName, nextLink, options },
158
+ listByCloudHsmClusterNextOperationSpec,
47
159
  );
48
160
  }
49
161
  }
@@ -51,24 +163,44 @@ export class CloudHsmClusterPrivateLinkResourcesImpl
51
163
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
52
164
 
53
165
  const listByCloudHsmClusterOperationSpec: coreClient.OperationSpec = {
54
- path:
55
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources",
166
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/privateLinkResources",
56
167
  httpMethod: "GET",
57
168
  responses: {
58
169
  200: {
59
- bodyMapper: Mappers.PrivateLinkResourceListResult
170
+ bodyMapper: Mappers.PrivateLinkResourceListResult,
60
171
  },
61
172
  default: {
62
- bodyMapper: Mappers.CloudHsmClusterError
63
- }
173
+ bodyMapper: Mappers.ErrorResponse,
174
+ },
64
175
  },
65
176
  queryParameters: [Parameters.apiVersion],
66
177
  urlParameters: [
67
178
  Parameters.$host,
68
179
  Parameters.subscriptionId,
69
180
  Parameters.resourceGroupName,
70
- Parameters.cloudHsmClusterName
181
+ Parameters.cloudHsmClusterName,
182
+ ],
183
+ headerParameters: [Parameters.accept],
184
+ serializer,
185
+ };
186
+ const listByCloudHsmClusterNextOperationSpec: coreClient.OperationSpec = {
187
+ path: "{nextLink}",
188
+ httpMethod: "GET",
189
+ responses: {
190
+ 200: {
191
+ bodyMapper: Mappers.PrivateLinkResourceListResult,
192
+ },
193
+ default: {
194
+ bodyMapper: Mappers.ErrorResponse,
195
+ },
196
+ },
197
+ urlParameters: [
198
+ Parameters.$host,
199
+ Parameters.subscriptionId,
200
+ Parameters.resourceGroupName,
201
+ Parameters.cloudHsmClusterName,
202
+ Parameters.nextLink,
71
203
  ],
72
204
  headerParameters: [Parameters.accept],
73
- serializer
205
+ serializer,
74
206
  };
@@ -0,0 +1,82 @@
1
+ /*
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
4
+ *
5
+ * Code generated by Microsoft (R) AutoRest Code Generator.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
+ */
8
+
9
+ import { CloudHsmClusterRestoreStatus } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
12
+ import * as Parameters from "../models/parameters";
13
+ import { AzureHSMResourceProvider } from "../azureHSMResourceProvider";
14
+ import {
15
+ CloudHsmClusterRestoreStatusGetOptionalParams,
16
+ CloudHsmClusterRestoreStatusGetResponse,
17
+ } from "../models";
18
+
19
+ /** Class containing CloudHsmClusterRestoreStatus operations. */
20
+ export class CloudHsmClusterRestoreStatusImpl
21
+ implements CloudHsmClusterRestoreStatus
22
+ {
23
+ private readonly client: AzureHSMResourceProvider;
24
+
25
+ /**
26
+ * Initialize a new instance of the class CloudHsmClusterRestoreStatus class.
27
+ * @param client Reference to the service client
28
+ */
29
+ constructor(client: AzureHSMResourceProvider) {
30
+ this.client = client;
31
+ }
32
+
33
+ /**
34
+ * Gets the restore operation status of the specified Cloud HSM Cluster
35
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
36
+ * @param cloudHsmClusterName The name of the Cloud HSM Cluster within the specified resource group.
37
+ * Cloud HSM Cluster names must be between 3 and 23 characters in length.
38
+ * @param jobId The id returned as part of the backup request
39
+ * @param options The options parameters.
40
+ */
41
+ get(
42
+ resourceGroupName: string,
43
+ cloudHsmClusterName: string,
44
+ jobId: string,
45
+ options?: CloudHsmClusterRestoreStatusGetOptionalParams,
46
+ ): Promise<CloudHsmClusterRestoreStatusGetResponse> {
47
+ return this.client.sendOperationRequest(
48
+ { resourceGroupName, cloudHsmClusterName, jobId, options },
49
+ getOperationSpec,
50
+ );
51
+ }
52
+ }
53
+ // Operation Specifications
54
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
55
+
56
+ const getOperationSpec: coreClient.OperationSpec = {
57
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HardwareSecurityModules/cloudHsmClusters/{cloudHsmClusterName}/restoreOperationStatus/{jobId}",
58
+ httpMethod: "GET",
59
+ responses: {
60
+ 200: {
61
+ bodyMapper: Mappers.RestoreResult,
62
+ headersMapper: Mappers.CloudHsmClusterRestoreStatusGetHeaders,
63
+ },
64
+ 202: {
65
+ headersMapper: Mappers.CloudHsmClusterRestoreStatusGetHeaders,
66
+ },
67
+ default: {
68
+ bodyMapper: Mappers.ErrorResponse,
69
+ headersMapper: Mappers.CloudHsmClusterRestoreStatusGetExceptionHeaders,
70
+ },
71
+ },
72
+ queryParameters: [Parameters.apiVersion],
73
+ urlParameters: [
74
+ Parameters.$host,
75
+ Parameters.subscriptionId,
76
+ Parameters.resourceGroupName,
77
+ Parameters.cloudHsmClusterName,
78
+ Parameters.jobId,
79
+ ],
80
+ headerParameters: [Parameters.accept],
81
+ serializer,
82
+ };