@azure/arm-signalr 5.2.1-alpha.20230918.1 → 6.0.0-beta.1

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 (159) hide show
  1. package/CHANGELOG.md +74 -52
  2. package/README.md +1 -1
  3. package/dist/index.js +1064 -436
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.min.js +1 -1
  6. package/dist/index.min.js.map +1 -1
  7. package/dist-esm/samples-dev/operationsListSample.js +1 -1
  8. package/dist-esm/samples-dev/signalRCheckNameAvailabilitySample.js +1 -1
  9. package/dist-esm/samples-dev/signalRCreateOrUpdateSample.js +1 -1
  10. package/dist-esm/samples-dev/signalRCustomCertificatesCreateOrUpdateSample.js +1 -1
  11. package/dist-esm/samples-dev/signalRCustomCertificatesDeleteSample.js +1 -1
  12. package/dist-esm/samples-dev/signalRCustomCertificatesGetSample.js +1 -1
  13. package/dist-esm/samples-dev/signalRCustomCertificatesListSample.js +1 -1
  14. package/dist-esm/samples-dev/signalRCustomDomainsCreateOrUpdateSample.js +1 -1
  15. package/dist-esm/samples-dev/signalRCustomDomainsDeleteSample.js +1 -1
  16. package/dist-esm/samples-dev/signalRCustomDomainsGetSample.js +1 -1
  17. package/dist-esm/samples-dev/signalRCustomDomainsListSample.js +1 -1
  18. package/dist-esm/samples-dev/signalRDeleteSample.js +1 -1
  19. package/dist-esm/samples-dev/signalRGetSample.js +1 -1
  20. package/dist-esm/samples-dev/signalRListByResourceGroupSample.js +1 -1
  21. package/dist-esm/samples-dev/signalRListBySubscriptionSample.js +1 -1
  22. package/dist-esm/samples-dev/signalRListKeysSample.js +1 -1
  23. package/dist-esm/samples-dev/signalRListReplicaSkusSample.d.ts +2 -0
  24. package/dist-esm/samples-dev/signalRListReplicaSkusSample.d.ts.map +1 -0
  25. package/dist-esm/samples-dev/signalRListReplicaSkusSample.js +40 -0
  26. package/dist-esm/samples-dev/signalRListReplicaSkusSample.js.map +1 -0
  27. package/dist-esm/samples-dev/signalRListSkusSample.js +1 -1
  28. package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsDeleteSample.js +1 -1
  29. package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsGetSample.js +1 -1
  30. package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsListSample.js +1 -1
  31. package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsUpdateSample.js +2 -4
  32. package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsUpdateSample.js.map +1 -1
  33. package/dist-esm/samples-dev/signalRPrivateLinkResourcesListSample.js +1 -1
  34. package/dist-esm/samples-dev/signalRRegenerateKeySample.js +1 -1
  35. package/dist-esm/samples-dev/signalRReplicasCreateOrUpdateSample.d.ts +2 -0
  36. package/dist-esm/samples-dev/signalRReplicasCreateOrUpdateSample.d.ts.map +1 -0
  37. package/dist-esm/samples-dev/signalRReplicasCreateOrUpdateSample.js +45 -0
  38. package/dist-esm/samples-dev/signalRReplicasCreateOrUpdateSample.js.map +1 -0
  39. package/dist-esm/samples-dev/signalRReplicasDeleteSample.d.ts +2 -0
  40. package/dist-esm/samples-dev/signalRReplicasDeleteSample.d.ts.map +1 -0
  41. package/dist-esm/samples-dev/signalRReplicasDeleteSample.js +40 -0
  42. package/dist-esm/samples-dev/signalRReplicasDeleteSample.js.map +1 -0
  43. package/dist-esm/samples-dev/signalRReplicasGetSample.d.ts +2 -0
  44. package/dist-esm/samples-dev/signalRReplicasGetSample.d.ts.map +1 -0
  45. package/dist-esm/samples-dev/signalRReplicasGetSample.js +40 -0
  46. package/dist-esm/samples-dev/signalRReplicasGetSample.js.map +1 -0
  47. package/dist-esm/samples-dev/signalRReplicasListSample.d.ts +2 -0
  48. package/dist-esm/samples-dev/signalRReplicasListSample.d.ts.map +1 -0
  49. package/dist-esm/samples-dev/signalRReplicasListSample.js +60 -0
  50. package/dist-esm/samples-dev/signalRReplicasListSample.js.map +1 -0
  51. package/dist-esm/samples-dev/signalRReplicasRestartSample.d.ts +2 -0
  52. package/dist-esm/samples-dev/signalRReplicasRestartSample.d.ts.map +1 -0
  53. package/dist-esm/samples-dev/signalRReplicasRestartSample.js +40 -0
  54. package/dist-esm/samples-dev/signalRReplicasRestartSample.js.map +1 -0
  55. package/dist-esm/samples-dev/signalRReplicasUpdateSample.d.ts +2 -0
  56. package/dist-esm/samples-dev/signalRReplicasUpdateSample.d.ts.map +1 -0
  57. package/dist-esm/samples-dev/signalRReplicasUpdateSample.js +45 -0
  58. package/dist-esm/samples-dev/signalRReplicasUpdateSample.js.map +1 -0
  59. package/dist-esm/samples-dev/signalRRestartSample.js +1 -1
  60. package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.js +1 -1
  61. package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesDeleteSample.js +1 -1
  62. package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesGetSample.js +1 -1
  63. package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesListSample.js +1 -1
  64. package/dist-esm/samples-dev/signalRUpdateSample.js +1 -1
  65. package/dist-esm/samples-dev/usagesListSample.js +1 -1
  66. package/dist-esm/src/models/index.d.ts +150 -79
  67. package/dist-esm/src/models/index.d.ts.map +1 -1
  68. package/dist-esm/src/models/index.js +12 -12
  69. package/dist-esm/src/models/index.js.map +1 -1
  70. package/dist-esm/src/models/mappers.d.ts +9 -2
  71. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  72. package/dist-esm/src/models/mappers.js +181 -88
  73. package/dist-esm/src/models/mappers.js.map +1 -1
  74. package/dist-esm/src/models/parameters.d.ts +3 -1
  75. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  76. package/dist-esm/src/models/parameters.js +32 -4
  77. package/dist-esm/src/models/parameters.js.map +1 -1
  78. package/dist-esm/src/operations/index.d.ts +1 -0
  79. package/dist-esm/src/operations/index.d.ts.map +1 -1
  80. package/dist-esm/src/operations/index.js +1 -0
  81. package/dist-esm/src/operations/index.js.map +1 -1
  82. package/dist-esm/src/operations/signalR.d.ts +27 -35
  83. package/dist-esm/src/operations/signalR.d.ts.map +1 -1
  84. package/dist-esm/src/operations/signalR.js +66 -40
  85. package/dist-esm/src/operations/signalR.js.map +1 -1
  86. package/dist-esm/src/operations/signalRCustomCertificates.d.ts +7 -14
  87. package/dist-esm/src/operations/signalRCustomCertificates.d.ts.map +1 -1
  88. package/dist-esm/src/operations/signalRCustomCertificates.js +9 -15
  89. package/dist-esm/src/operations/signalRCustomCertificates.js.map +1 -1
  90. package/dist-esm/src/operations/signalRCustomDomains.d.ts +8 -16
  91. package/dist-esm/src/operations/signalRCustomDomains.d.ts.map +1 -1
  92. package/dist-esm/src/operations/signalRCustomDomains.js +10 -17
  93. package/dist-esm/src/operations/signalRCustomDomains.js.map +1 -1
  94. package/dist-esm/src/operations/signalRPrivateEndpointConnections.d.ts +15 -18
  95. package/dist-esm/src/operations/signalRPrivateEndpointConnections.d.ts.map +1 -1
  96. package/dist-esm/src/operations/signalRPrivateEndpointConnections.js +15 -18
  97. package/dist-esm/src/operations/signalRPrivateEndpointConnections.js.map +1 -1
  98. package/dist-esm/src/operations/signalRPrivateLinkResources.d.ts +3 -6
  99. package/dist-esm/src/operations/signalRPrivateLinkResources.d.ts.map +1 -1
  100. package/dist-esm/src/operations/signalRPrivateLinkResources.js +3 -6
  101. package/dist-esm/src/operations/signalRPrivateLinkResources.js.map +1 -1
  102. package/dist-esm/src/operations/signalRReplicas.d.ts +107 -0
  103. package/dist-esm/src/operations/signalRReplicas.d.ts.map +1 -0
  104. package/dist-esm/src/operations/signalRReplicas.js +507 -0
  105. package/dist-esm/src/operations/signalRReplicas.js.map +1 -0
  106. package/dist-esm/src/operations/signalRSharedPrivateLinkResources.d.ts +8 -16
  107. package/dist-esm/src/operations/signalRSharedPrivateLinkResources.d.ts.map +1 -1
  108. package/dist-esm/src/operations/signalRSharedPrivateLinkResources.js +11 -18
  109. package/dist-esm/src/operations/signalRSharedPrivateLinkResources.js.map +1 -1
  110. package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
  111. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  112. package/dist-esm/src/operationsInterfaces/index.js +1 -0
  113. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  114. package/dist-esm/src/operationsInterfaces/signalR.d.ts +25 -31
  115. package/dist-esm/src/operationsInterfaces/signalR.d.ts.map +1 -1
  116. package/dist-esm/src/operationsInterfaces/signalRCustomCertificates.d.ts +5 -10
  117. package/dist-esm/src/operationsInterfaces/signalRCustomCertificates.d.ts.map +1 -1
  118. package/dist-esm/src/operationsInterfaces/signalRCustomDomains.d.ts +6 -12
  119. package/dist-esm/src/operationsInterfaces/signalRCustomDomains.d.ts.map +1 -1
  120. package/dist-esm/src/operationsInterfaces/signalRPrivateEndpointConnections.d.ts +13 -14
  121. package/dist-esm/src/operationsInterfaces/signalRPrivateEndpointConnections.d.ts.map +1 -1
  122. package/dist-esm/src/operationsInterfaces/signalRPrivateLinkResources.d.ts +1 -2
  123. package/dist-esm/src/operationsInterfaces/signalRPrivateLinkResources.d.ts.map +1 -1
  124. package/dist-esm/src/operationsInterfaces/signalRReplicas.d.ts +82 -0
  125. package/dist-esm/src/operationsInterfaces/signalRReplicas.d.ts.map +1 -0
  126. package/dist-esm/src/operationsInterfaces/signalRReplicas.js +9 -0
  127. package/dist-esm/src/operationsInterfaces/signalRReplicas.js.map +1 -0
  128. package/dist-esm/src/operationsInterfaces/signalRSharedPrivateLinkResources.d.ts +6 -12
  129. package/dist-esm/src/operationsInterfaces/signalRSharedPrivateLinkResources.d.ts.map +1 -1
  130. package/dist-esm/src/signalRManagementClient.d.ts +3 -3
  131. package/dist-esm/src/signalRManagementClient.d.ts.map +1 -1
  132. package/dist-esm/src/signalRManagementClient.js +5 -5
  133. package/dist-esm/src/signalRManagementClient.js.map +1 -1
  134. package/dist-esm/test/signalr_examples.spec.js +1 -1
  135. package/dist-esm/test/signalr_examples.spec.js.map +1 -1
  136. package/package.json +6 -6
  137. package/review/arm-signalr.api.md +124 -8
  138. package/src/models/index.ts +179 -82
  139. package/src/models/mappers.ts +189 -90
  140. package/src/models/parameters.ts +34 -3
  141. package/src/operations/index.ts +1 -0
  142. package/src/operations/signalR.ts +91 -44
  143. package/src/operations/signalRCustomCertificates.ts +9 -15
  144. package/src/operations/signalRCustomDomains.ts +10 -17
  145. package/src/operations/signalRPrivateEndpointConnections.ts +15 -18
  146. package/src/operations/signalRPrivateLinkResources.ts +3 -6
  147. package/src/operations/signalRReplicas.ts +702 -0
  148. package/src/operations/signalRSharedPrivateLinkResources.ts +11 -18
  149. package/src/operationsInterfaces/index.ts +1 -0
  150. package/src/operationsInterfaces/signalR.ts +37 -30
  151. package/src/operationsInterfaces/signalRCustomCertificates.ts +5 -10
  152. package/src/operationsInterfaces/signalRCustomDomains.ts +6 -12
  153. package/src/operationsInterfaces/signalRPrivateEndpointConnections.ts +13 -14
  154. package/src/operationsInterfaces/signalRPrivateLinkResources.ts +1 -2
  155. package/src/operationsInterfaces/signalRReplicas.ts +166 -0
  156. package/src/operationsInterfaces/signalRSharedPrivateLinkResources.ts +6 -12
  157. package/src/signalRManagementClient.ts +7 -4
  158. package/types/arm-signalr.d.ts +267 -119
  159. package/types/tsdoc-metadata.json +1 -1
@@ -0,0 +1,702 @@
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 { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
11
+ import { SignalRReplicas } from "../operationsInterfaces";
12
+ import * as coreClient from "@azure/core-client";
13
+ import * as Mappers from "../models/mappers";
14
+ import * as Parameters from "../models/parameters";
15
+ import { SignalRManagementClient } from "../signalRManagementClient";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
22
+ import {
23
+ Replica,
24
+ SignalRReplicasListNextOptionalParams,
25
+ SignalRReplicasListOptionalParams,
26
+ SignalRReplicasListResponse,
27
+ SignalRReplicasGetOptionalParams,
28
+ SignalRReplicasGetResponse,
29
+ SignalRReplicasCreateOrUpdateOptionalParams,
30
+ SignalRReplicasCreateOrUpdateResponse,
31
+ SignalRReplicasDeleteOptionalParams,
32
+ SignalRReplicasUpdateOptionalParams,
33
+ SignalRReplicasUpdateResponse,
34
+ SignalRReplicasRestartOptionalParams,
35
+ SignalRReplicasRestartResponse,
36
+ SignalRReplicasListNextResponse
37
+ } from "../models";
38
+
39
+ /// <reference lib="esnext.asynciterable" />
40
+ /** Class containing SignalRReplicas operations. */
41
+ export class SignalRReplicasImpl implements SignalRReplicas {
42
+ private readonly client: SignalRManagementClient;
43
+
44
+ /**
45
+ * Initialize a new instance of the class SignalRReplicas class.
46
+ * @param client Reference to the service client
47
+ */
48
+ constructor(client: SignalRManagementClient) {
49
+ this.client = client;
50
+ }
51
+
52
+ /**
53
+ * List all replicas belong to this resource
54
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
55
+ * @param resourceName The name of the resource.
56
+ * @param options The options parameters.
57
+ */
58
+ public list(
59
+ resourceGroupName: string,
60
+ resourceName: string,
61
+ options?: SignalRReplicasListOptionalParams
62
+ ): PagedAsyncIterableIterator<Replica> {
63
+ const iter = this.listPagingAll(resourceGroupName, resourceName, options);
64
+ return {
65
+ next() {
66
+ return iter.next();
67
+ },
68
+ [Symbol.asyncIterator]() {
69
+ return this;
70
+ },
71
+ byPage: (settings?: PageSettings) => {
72
+ if (settings?.maxPageSize) {
73
+ throw new Error("maxPageSize is not supported by this operation.");
74
+ }
75
+ return this.listPagingPage(
76
+ resourceGroupName,
77
+ resourceName,
78
+ options,
79
+ settings
80
+ );
81
+ }
82
+ };
83
+ }
84
+
85
+ private async *listPagingPage(
86
+ resourceGroupName: string,
87
+ resourceName: string,
88
+ options?: SignalRReplicasListOptionalParams,
89
+ settings?: PageSettings
90
+ ): AsyncIterableIterator<Replica[]> {
91
+ let result: SignalRReplicasListResponse;
92
+ let continuationToken = settings?.continuationToken;
93
+ if (!continuationToken) {
94
+ result = await this._list(resourceGroupName, resourceName, options);
95
+ let page = result.value || [];
96
+ continuationToken = result.nextLink;
97
+ setContinuationToken(page, continuationToken);
98
+ yield page;
99
+ }
100
+ while (continuationToken) {
101
+ result = await this._listNext(
102
+ resourceGroupName,
103
+ resourceName,
104
+ continuationToken,
105
+ options
106
+ );
107
+ continuationToken = result.nextLink;
108
+ let page = result.value || [];
109
+ setContinuationToken(page, continuationToken);
110
+ yield page;
111
+ }
112
+ }
113
+
114
+ private async *listPagingAll(
115
+ resourceGroupName: string,
116
+ resourceName: string,
117
+ options?: SignalRReplicasListOptionalParams
118
+ ): AsyncIterableIterator<Replica> {
119
+ for await (const page of this.listPagingPage(
120
+ resourceGroupName,
121
+ resourceName,
122
+ options
123
+ )) {
124
+ yield* page;
125
+ }
126
+ }
127
+
128
+ /**
129
+ * List all replicas belong to this resource
130
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
131
+ * @param resourceName The name of the resource.
132
+ * @param options The options parameters.
133
+ */
134
+ private _list(
135
+ resourceGroupName: string,
136
+ resourceName: string,
137
+ options?: SignalRReplicasListOptionalParams
138
+ ): Promise<SignalRReplicasListResponse> {
139
+ return this.client.sendOperationRequest(
140
+ { resourceGroupName, resourceName, options },
141
+ listOperationSpec
142
+ );
143
+ }
144
+
145
+ /**
146
+ * Get the replica and its properties.
147
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
148
+ * @param resourceName The name of the resource.
149
+ * @param replicaName The name of the replica.
150
+ * @param options The options parameters.
151
+ */
152
+ get(
153
+ resourceGroupName: string,
154
+ resourceName: string,
155
+ replicaName: string,
156
+ options?: SignalRReplicasGetOptionalParams
157
+ ): Promise<SignalRReplicasGetResponse> {
158
+ return this.client.sendOperationRequest(
159
+ { resourceGroupName, resourceName, replicaName, options },
160
+ getOperationSpec
161
+ );
162
+ }
163
+
164
+ /**
165
+ * Create or update a replica.
166
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
167
+ * @param resourceName The name of the resource.
168
+ * @param replicaName The name of the replica.
169
+ * @param parameters Parameters for the create or update operation
170
+ * @param options The options parameters.
171
+ */
172
+ async beginCreateOrUpdate(
173
+ resourceGroupName: string,
174
+ resourceName: string,
175
+ replicaName: string,
176
+ parameters: Replica,
177
+ options?: SignalRReplicasCreateOrUpdateOptionalParams
178
+ ): Promise<
179
+ SimplePollerLike<
180
+ OperationState<SignalRReplicasCreateOrUpdateResponse>,
181
+ SignalRReplicasCreateOrUpdateResponse
182
+ >
183
+ > {
184
+ const directSendOperation = async (
185
+ args: coreClient.OperationArguments,
186
+ spec: coreClient.OperationSpec
187
+ ): Promise<SignalRReplicasCreateOrUpdateResponse> => {
188
+ return this.client.sendOperationRequest(args, spec);
189
+ };
190
+ const sendOperationFn = async (
191
+ args: coreClient.OperationArguments,
192
+ spec: coreClient.OperationSpec
193
+ ) => {
194
+ let currentRawResponse:
195
+ | coreClient.FullOperationResponse
196
+ | undefined = undefined;
197
+ const providedCallback = args.options?.onResponse;
198
+ const callback: coreClient.RawResponseCallback = (
199
+ rawResponse: coreClient.FullOperationResponse,
200
+ flatResponse: unknown
201
+ ) => {
202
+ currentRawResponse = rawResponse;
203
+ providedCallback?.(rawResponse, flatResponse);
204
+ };
205
+ const updatedArgs = {
206
+ ...args,
207
+ options: {
208
+ ...args.options,
209
+ onResponse: callback
210
+ }
211
+ };
212
+ const flatResponse = await directSendOperation(updatedArgs, spec);
213
+ return {
214
+ flatResponse,
215
+ rawResponse: {
216
+ statusCode: currentRawResponse!.status,
217
+ body: currentRawResponse!.parsedBody,
218
+ headers: currentRawResponse!.headers.toJSON()
219
+ }
220
+ };
221
+ };
222
+
223
+ const lro = createLroSpec({
224
+ sendOperationFn,
225
+ args: {
226
+ resourceGroupName,
227
+ resourceName,
228
+ replicaName,
229
+ parameters,
230
+ options
231
+ },
232
+ spec: createOrUpdateOperationSpec
233
+ });
234
+ const poller = await createHttpPoller<
235
+ SignalRReplicasCreateOrUpdateResponse,
236
+ OperationState<SignalRReplicasCreateOrUpdateResponse>
237
+ >(lro, {
238
+ restoreFrom: options?.resumeFrom,
239
+ intervalInMs: options?.updateIntervalInMs,
240
+ resourceLocationConfig: "azure-async-operation"
241
+ });
242
+ await poller.poll();
243
+ return poller;
244
+ }
245
+
246
+ /**
247
+ * Create or update a replica.
248
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
249
+ * @param resourceName The name of the resource.
250
+ * @param replicaName The name of the replica.
251
+ * @param parameters Parameters for the create or update operation
252
+ * @param options The options parameters.
253
+ */
254
+ async beginCreateOrUpdateAndWait(
255
+ resourceGroupName: string,
256
+ resourceName: string,
257
+ replicaName: string,
258
+ parameters: Replica,
259
+ options?: SignalRReplicasCreateOrUpdateOptionalParams
260
+ ): Promise<SignalRReplicasCreateOrUpdateResponse> {
261
+ const poller = await this.beginCreateOrUpdate(
262
+ resourceGroupName,
263
+ resourceName,
264
+ replicaName,
265
+ parameters,
266
+ options
267
+ );
268
+ return poller.pollUntilDone();
269
+ }
270
+
271
+ /**
272
+ * Operation to delete a replica.
273
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
274
+ * @param resourceName The name of the resource.
275
+ * @param replicaName The name of the replica.
276
+ * @param options The options parameters.
277
+ */
278
+ delete(
279
+ resourceGroupName: string,
280
+ resourceName: string,
281
+ replicaName: string,
282
+ options?: SignalRReplicasDeleteOptionalParams
283
+ ): Promise<void> {
284
+ return this.client.sendOperationRequest(
285
+ { resourceGroupName, resourceName, replicaName, options },
286
+ deleteOperationSpec
287
+ );
288
+ }
289
+
290
+ /**
291
+ * Operation to update an exiting replica.
292
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
293
+ * @param resourceName The name of the resource.
294
+ * @param replicaName The name of the replica.
295
+ * @param parameters Parameters for the update operation
296
+ * @param options The options parameters.
297
+ */
298
+ async beginUpdate(
299
+ resourceGroupName: string,
300
+ resourceName: string,
301
+ replicaName: string,
302
+ parameters: Replica,
303
+ options?: SignalRReplicasUpdateOptionalParams
304
+ ): Promise<
305
+ SimplePollerLike<
306
+ OperationState<SignalRReplicasUpdateResponse>,
307
+ SignalRReplicasUpdateResponse
308
+ >
309
+ > {
310
+ const directSendOperation = async (
311
+ args: coreClient.OperationArguments,
312
+ spec: coreClient.OperationSpec
313
+ ): Promise<SignalRReplicasUpdateResponse> => {
314
+ return this.client.sendOperationRequest(args, spec);
315
+ };
316
+ const sendOperationFn = async (
317
+ args: coreClient.OperationArguments,
318
+ spec: coreClient.OperationSpec
319
+ ) => {
320
+ let currentRawResponse:
321
+ | coreClient.FullOperationResponse
322
+ | undefined = undefined;
323
+ const providedCallback = args.options?.onResponse;
324
+ const callback: coreClient.RawResponseCallback = (
325
+ rawResponse: coreClient.FullOperationResponse,
326
+ flatResponse: unknown
327
+ ) => {
328
+ currentRawResponse = rawResponse;
329
+ providedCallback?.(rawResponse, flatResponse);
330
+ };
331
+ const updatedArgs = {
332
+ ...args,
333
+ options: {
334
+ ...args.options,
335
+ onResponse: callback
336
+ }
337
+ };
338
+ const flatResponse = await directSendOperation(updatedArgs, spec);
339
+ return {
340
+ flatResponse,
341
+ rawResponse: {
342
+ statusCode: currentRawResponse!.status,
343
+ body: currentRawResponse!.parsedBody,
344
+ headers: currentRawResponse!.headers.toJSON()
345
+ }
346
+ };
347
+ };
348
+
349
+ const lro = createLroSpec({
350
+ sendOperationFn,
351
+ args: {
352
+ resourceGroupName,
353
+ resourceName,
354
+ replicaName,
355
+ parameters,
356
+ options
357
+ },
358
+ spec: updateOperationSpec
359
+ });
360
+ const poller = await createHttpPoller<
361
+ SignalRReplicasUpdateResponse,
362
+ OperationState<SignalRReplicasUpdateResponse>
363
+ >(lro, {
364
+ restoreFrom: options?.resumeFrom,
365
+ intervalInMs: options?.updateIntervalInMs,
366
+ resourceLocationConfig: "location"
367
+ });
368
+ await poller.poll();
369
+ return poller;
370
+ }
371
+
372
+ /**
373
+ * Operation to update an exiting replica.
374
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
375
+ * @param resourceName The name of the resource.
376
+ * @param replicaName The name of the replica.
377
+ * @param parameters Parameters for the update operation
378
+ * @param options The options parameters.
379
+ */
380
+ async beginUpdateAndWait(
381
+ resourceGroupName: string,
382
+ resourceName: string,
383
+ replicaName: string,
384
+ parameters: Replica,
385
+ options?: SignalRReplicasUpdateOptionalParams
386
+ ): Promise<SignalRReplicasUpdateResponse> {
387
+ const poller = await this.beginUpdate(
388
+ resourceGroupName,
389
+ resourceName,
390
+ replicaName,
391
+ parameters,
392
+ options
393
+ );
394
+ return poller.pollUntilDone();
395
+ }
396
+
397
+ /**
398
+ * Operation to restart a replica.
399
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
400
+ * @param resourceName The name of the resource.
401
+ * @param replicaName The name of the replica.
402
+ * @param options The options parameters.
403
+ */
404
+ async beginRestart(
405
+ resourceGroupName: string,
406
+ resourceName: string,
407
+ replicaName: string,
408
+ options?: SignalRReplicasRestartOptionalParams
409
+ ): Promise<
410
+ SimplePollerLike<
411
+ OperationState<SignalRReplicasRestartResponse>,
412
+ SignalRReplicasRestartResponse
413
+ >
414
+ > {
415
+ const directSendOperation = async (
416
+ args: coreClient.OperationArguments,
417
+ spec: coreClient.OperationSpec
418
+ ): Promise<SignalRReplicasRestartResponse> => {
419
+ return this.client.sendOperationRequest(args, spec);
420
+ };
421
+ const sendOperationFn = async (
422
+ args: coreClient.OperationArguments,
423
+ spec: coreClient.OperationSpec
424
+ ) => {
425
+ let currentRawResponse:
426
+ | coreClient.FullOperationResponse
427
+ | undefined = undefined;
428
+ const providedCallback = args.options?.onResponse;
429
+ const callback: coreClient.RawResponseCallback = (
430
+ rawResponse: coreClient.FullOperationResponse,
431
+ flatResponse: unknown
432
+ ) => {
433
+ currentRawResponse = rawResponse;
434
+ providedCallback?.(rawResponse, flatResponse);
435
+ };
436
+ const updatedArgs = {
437
+ ...args,
438
+ options: {
439
+ ...args.options,
440
+ onResponse: callback
441
+ }
442
+ };
443
+ const flatResponse = await directSendOperation(updatedArgs, spec);
444
+ return {
445
+ flatResponse,
446
+ rawResponse: {
447
+ statusCode: currentRawResponse!.status,
448
+ body: currentRawResponse!.parsedBody,
449
+ headers: currentRawResponse!.headers.toJSON()
450
+ }
451
+ };
452
+ };
453
+
454
+ const lro = createLroSpec({
455
+ sendOperationFn,
456
+ args: { resourceGroupName, resourceName, replicaName, options },
457
+ spec: restartOperationSpec
458
+ });
459
+ const poller = await createHttpPoller<
460
+ SignalRReplicasRestartResponse,
461
+ OperationState<SignalRReplicasRestartResponse>
462
+ >(lro, {
463
+ restoreFrom: options?.resumeFrom,
464
+ intervalInMs: options?.updateIntervalInMs,
465
+ resourceLocationConfig: "location"
466
+ });
467
+ await poller.poll();
468
+ return poller;
469
+ }
470
+
471
+ /**
472
+ * Operation to restart a replica.
473
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
474
+ * @param resourceName The name of the resource.
475
+ * @param replicaName The name of the replica.
476
+ * @param options The options parameters.
477
+ */
478
+ async beginRestartAndWait(
479
+ resourceGroupName: string,
480
+ resourceName: string,
481
+ replicaName: string,
482
+ options?: SignalRReplicasRestartOptionalParams
483
+ ): Promise<SignalRReplicasRestartResponse> {
484
+ const poller = await this.beginRestart(
485
+ resourceGroupName,
486
+ resourceName,
487
+ replicaName,
488
+ options
489
+ );
490
+ return poller.pollUntilDone();
491
+ }
492
+
493
+ /**
494
+ * ListNext
495
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
496
+ * @param resourceName The name of the resource.
497
+ * @param nextLink The nextLink from the previous successful call to the List method.
498
+ * @param options The options parameters.
499
+ */
500
+ private _listNext(
501
+ resourceGroupName: string,
502
+ resourceName: string,
503
+ nextLink: string,
504
+ options?: SignalRReplicasListNextOptionalParams
505
+ ): Promise<SignalRReplicasListNextResponse> {
506
+ return this.client.sendOperationRequest(
507
+ { resourceGroupName, resourceName, nextLink, options },
508
+ listNextOperationSpec
509
+ );
510
+ }
511
+ }
512
+ // Operation Specifications
513
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
514
+
515
+ const listOperationSpec: coreClient.OperationSpec = {
516
+ path:
517
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas",
518
+ httpMethod: "GET",
519
+ responses: {
520
+ 200: {
521
+ bodyMapper: Mappers.ReplicaList
522
+ },
523
+ default: {
524
+ bodyMapper: Mappers.ErrorResponse
525
+ }
526
+ },
527
+ queryParameters: [Parameters.apiVersion],
528
+ urlParameters: [
529
+ Parameters.$host,
530
+ Parameters.subscriptionId,
531
+ Parameters.resourceGroupName,
532
+ Parameters.resourceName
533
+ ],
534
+ headerParameters: [Parameters.accept],
535
+ serializer
536
+ };
537
+ const getOperationSpec: coreClient.OperationSpec = {
538
+ path:
539
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}",
540
+ httpMethod: "GET",
541
+ responses: {
542
+ 200: {
543
+ bodyMapper: Mappers.Replica
544
+ },
545
+ default: {
546
+ bodyMapper: Mappers.ErrorResponse
547
+ }
548
+ },
549
+ queryParameters: [Parameters.apiVersion],
550
+ urlParameters: [
551
+ Parameters.$host,
552
+ Parameters.subscriptionId,
553
+ Parameters.resourceGroupName,
554
+ Parameters.resourceName,
555
+ Parameters.replicaName
556
+ ],
557
+ headerParameters: [Parameters.accept],
558
+ serializer
559
+ };
560
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
561
+ path:
562
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}",
563
+ httpMethod: "PUT",
564
+ responses: {
565
+ 200: {
566
+ bodyMapper: Mappers.Replica
567
+ },
568
+ 201: {
569
+ bodyMapper: Mappers.Replica
570
+ },
571
+ 202: {
572
+ bodyMapper: Mappers.Replica
573
+ },
574
+ 204: {
575
+ bodyMapper: Mappers.Replica
576
+ },
577
+ default: {
578
+ bodyMapper: Mappers.ErrorResponse
579
+ }
580
+ },
581
+ requestBody: Parameters.parameters6,
582
+ queryParameters: [Parameters.apiVersion],
583
+ urlParameters: [
584
+ Parameters.$host,
585
+ Parameters.subscriptionId,
586
+ Parameters.resourceGroupName,
587
+ Parameters.resourceName,
588
+ Parameters.replicaName
589
+ ],
590
+ headerParameters: [Parameters.accept, Parameters.contentType],
591
+ mediaType: "json",
592
+ serializer
593
+ };
594
+ const deleteOperationSpec: coreClient.OperationSpec = {
595
+ path:
596
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}",
597
+ httpMethod: "DELETE",
598
+ responses: {
599
+ 200: {},
600
+ 204: {},
601
+ default: {
602
+ bodyMapper: Mappers.ErrorResponse
603
+ }
604
+ },
605
+ queryParameters: [Parameters.apiVersion],
606
+ urlParameters: [
607
+ Parameters.$host,
608
+ Parameters.subscriptionId,
609
+ Parameters.resourceGroupName,
610
+ Parameters.resourceName,
611
+ Parameters.replicaName
612
+ ],
613
+ headerParameters: [Parameters.accept],
614
+ serializer
615
+ };
616
+ const updateOperationSpec: coreClient.OperationSpec = {
617
+ path:
618
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}",
619
+ httpMethod: "PATCH",
620
+ responses: {
621
+ 200: {
622
+ bodyMapper: Mappers.Replica
623
+ },
624
+ 201: {
625
+ bodyMapper: Mappers.Replica
626
+ },
627
+ 202: {
628
+ bodyMapper: Mappers.Replica
629
+ },
630
+ 204: {
631
+ bodyMapper: Mappers.Replica
632
+ },
633
+ default: {
634
+ bodyMapper: Mappers.ErrorResponse
635
+ }
636
+ },
637
+ requestBody: Parameters.parameters6,
638
+ queryParameters: [Parameters.apiVersion],
639
+ urlParameters: [
640
+ Parameters.$host,
641
+ Parameters.subscriptionId,
642
+ Parameters.resourceGroupName,
643
+ Parameters.resourceName,
644
+ Parameters.replicaName
645
+ ],
646
+ headerParameters: [Parameters.accept, Parameters.contentType],
647
+ mediaType: "json",
648
+ serializer
649
+ };
650
+ const restartOperationSpec: coreClient.OperationSpec = {
651
+ path:
652
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/replicas/{replicaName}/restart",
653
+ httpMethod: "POST",
654
+ responses: {
655
+ 200: {
656
+ headersMapper: Mappers.SignalRReplicasRestartHeaders
657
+ },
658
+ 201: {
659
+ headersMapper: Mappers.SignalRReplicasRestartHeaders
660
+ },
661
+ 202: {
662
+ headersMapper: Mappers.SignalRReplicasRestartHeaders
663
+ },
664
+ 204: {
665
+ headersMapper: Mappers.SignalRReplicasRestartHeaders
666
+ },
667
+ default: {
668
+ bodyMapper: Mappers.ErrorResponse
669
+ }
670
+ },
671
+ queryParameters: [Parameters.apiVersion],
672
+ urlParameters: [
673
+ Parameters.$host,
674
+ Parameters.subscriptionId,
675
+ Parameters.resourceGroupName,
676
+ Parameters.resourceName,
677
+ Parameters.replicaName
678
+ ],
679
+ headerParameters: [Parameters.accept],
680
+ serializer
681
+ };
682
+ const listNextOperationSpec: coreClient.OperationSpec = {
683
+ path: "{nextLink}",
684
+ httpMethod: "GET",
685
+ responses: {
686
+ 200: {
687
+ bodyMapper: Mappers.ReplicaList
688
+ },
689
+ default: {
690
+ bodyMapper: Mappers.ErrorResponse
691
+ }
692
+ },
693
+ urlParameters: [
694
+ Parameters.$host,
695
+ Parameters.nextLink,
696
+ Parameters.subscriptionId,
697
+ Parameters.resourceGroupName,
698
+ Parameters.resourceName
699
+ ],
700
+ headerParameters: [Parameters.accept],
701
+ serializer
702
+ };