@azure/arm-standbypool 1.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 (161) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/LICENSE +21 -0
  3. package/README.md +109 -0
  4. package/dist/index.js +2605 -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/operationsListSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/operationsListSample.js +53 -0
  11. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  12. package/dist-esm/samples-dev/standbyContainerGroupPoolsCreateOrUpdateSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/standbyContainerGroupPoolsCreateOrUpdateSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/standbyContainerGroupPoolsCreateOrUpdateSample.js +57 -0
  15. package/dist-esm/samples-dev/standbyContainerGroupPoolsCreateOrUpdateSample.js.map +1 -0
  16. package/dist-esm/samples-dev/standbyContainerGroupPoolsDeleteSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/standbyContainerGroupPoolsDeleteSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/standbyContainerGroupPoolsDeleteSample.js +39 -0
  19. package/dist-esm/samples-dev/standbyContainerGroupPoolsDeleteSample.js.map +1 -0
  20. package/dist-esm/samples-dev/standbyContainerGroupPoolsGetSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/standbyContainerGroupPoolsGetSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/standbyContainerGroupPoolsGetSample.js +39 -0
  23. package/dist-esm/samples-dev/standbyContainerGroupPoolsGetSample.js.map +1 -0
  24. package/dist-esm/samples-dev/standbyContainerGroupPoolsListByResourceGroupSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/standbyContainerGroupPoolsListByResourceGroupSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/standbyContainerGroupPoolsListByResourceGroupSample.js +54 -0
  27. package/dist-esm/samples-dev/standbyContainerGroupPoolsListByResourceGroupSample.js.map +1 -0
  28. package/dist-esm/samples-dev/standbyContainerGroupPoolsListBySubscriptionSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/standbyContainerGroupPoolsListBySubscriptionSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/standbyContainerGroupPoolsListBySubscriptionSample.js +53 -0
  31. package/dist-esm/samples-dev/standbyContainerGroupPoolsListBySubscriptionSample.js.map +1 -0
  32. package/dist-esm/samples-dev/standbyContainerGroupPoolsUpdateSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/standbyContainerGroupPoolsUpdateSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/standbyContainerGroupPoolsUpdateSample.js +56 -0
  35. package/dist-esm/samples-dev/standbyContainerGroupPoolsUpdateSample.js.map +1 -0
  36. package/dist-esm/samples-dev/standbyVirtualMachinePoolsCreateOrUpdateSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/standbyVirtualMachinePoolsCreateOrUpdateSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/standbyVirtualMachinePoolsCreateOrUpdateSample.js +48 -0
  39. package/dist-esm/samples-dev/standbyVirtualMachinePoolsCreateOrUpdateSample.js.map +1 -0
  40. package/dist-esm/samples-dev/standbyVirtualMachinePoolsDeleteSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/standbyVirtualMachinePoolsDeleteSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/standbyVirtualMachinePoolsDeleteSample.js +39 -0
  43. package/dist-esm/samples-dev/standbyVirtualMachinePoolsDeleteSample.js.map +1 -0
  44. package/dist-esm/samples-dev/standbyVirtualMachinePoolsGetSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/standbyVirtualMachinePoolsGetSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/standbyVirtualMachinePoolsGetSample.js +39 -0
  47. package/dist-esm/samples-dev/standbyVirtualMachinePoolsGetSample.js.map +1 -0
  48. package/dist-esm/samples-dev/standbyVirtualMachinePoolsListByResourceGroupSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/standbyVirtualMachinePoolsListByResourceGroupSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/standbyVirtualMachinePoolsListByResourceGroupSample.js +54 -0
  51. package/dist-esm/samples-dev/standbyVirtualMachinePoolsListByResourceGroupSample.js.map +1 -0
  52. package/dist-esm/samples-dev/standbyVirtualMachinePoolsListBySubscriptionSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/standbyVirtualMachinePoolsListBySubscriptionSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/standbyVirtualMachinePoolsListBySubscriptionSample.js +53 -0
  55. package/dist-esm/samples-dev/standbyVirtualMachinePoolsListBySubscriptionSample.js.map +1 -0
  56. package/dist-esm/samples-dev/standbyVirtualMachinePoolsUpdateSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/standbyVirtualMachinePoolsUpdateSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/standbyVirtualMachinePoolsUpdateSample.js +47 -0
  59. package/dist-esm/samples-dev/standbyVirtualMachinePoolsUpdateSample.js.map +1 -0
  60. package/dist-esm/samples-dev/standbyVirtualMachinesGetSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/standbyVirtualMachinesGetSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/standbyVirtualMachinesGetSample.js +40 -0
  63. package/dist-esm/samples-dev/standbyVirtualMachinesGetSample.js.map +1 -0
  64. package/dist-esm/samples-dev/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.d.ts +2 -0
  65. package/dist-esm/samples-dev/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.d.ts.map +1 -0
  66. package/dist-esm/samples-dev/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.js +55 -0
  67. package/dist-esm/samples-dev/standbyVirtualMachinesListByStandbyVirtualMachinePoolResourceSample.js.map +1 -0
  68. package/dist-esm/src/index.d.ts +6 -0
  69. package/dist-esm/src/index.d.ts.map +1 -0
  70. package/dist-esm/src/index.js +13 -0
  71. package/dist-esm/src/index.js.map +1 -0
  72. package/dist-esm/src/lroImpl.d.ts +11 -0
  73. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  74. package/dist-esm/src/lroImpl.js +21 -0
  75. package/dist-esm/src/lroImpl.js.map +1 -0
  76. package/dist-esm/src/models/index.d.ts +581 -0
  77. package/dist-esm/src/models/index.d.ts.map +1 -0
  78. package/dist-esm/src/models/index.js +62 -0
  79. package/dist-esm/src/models/index.js.map +1 -0
  80. package/dist-esm/src/models/mappers.d.ts +38 -0
  81. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  82. package/dist-esm/src/models/mappers.js +877 -0
  83. package/dist-esm/src/models/mappers.js.map +1 -0
  84. package/dist-esm/src/models/parameters.d.ts +16 -0
  85. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  86. package/dist-esm/src/models/parameters.js +143 -0
  87. package/dist-esm/src/models/parameters.js.map +1 -0
  88. package/dist-esm/src/operations/index.d.ts +5 -0
  89. package/dist-esm/src/operations/index.d.ts.map +1 -0
  90. package/dist-esm/src/operations/index.js +12 -0
  91. package/dist-esm/src/operations/index.js.map +1 -0
  92. package/dist-esm/src/operations/operations.d.ts +32 -0
  93. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  94. package/dist-esm/src/operations/operations.js +133 -0
  95. package/dist-esm/src/operations/operations.js.map +1 -0
  96. package/dist-esm/src/operations/standbyContainerGroupPools.d.ts +99 -0
  97. package/dist-esm/src/operations/standbyContainerGroupPools.d.ts.map +1 -0
  98. package/dist-esm/src/operations/standbyContainerGroupPools.js +502 -0
  99. package/dist-esm/src/operations/standbyContainerGroupPools.js.map +1 -0
  100. package/dist-esm/src/operations/standbyVirtualMachinePools.d.ts +99 -0
  101. package/dist-esm/src/operations/standbyVirtualMachinePools.d.ts.map +1 -0
  102. package/dist-esm/src/operations/standbyVirtualMachinePools.js +502 -0
  103. package/dist-esm/src/operations/standbyVirtualMachinePools.js.map +1 -0
  104. package/dist-esm/src/operations/standbyVirtualMachines.d.ts +47 -0
  105. package/dist-esm/src/operations/standbyVirtualMachines.d.ts.map +1 -0
  106. package/dist-esm/src/operations/standbyVirtualMachines.js +188 -0
  107. package/dist-esm/src/operations/standbyVirtualMachines.js.map +1 -0
  108. package/dist-esm/src/operationsInterfaces/index.d.ts +5 -0
  109. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  110. package/dist-esm/src/operationsInterfaces/index.js +12 -0
  111. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  112. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  113. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  114. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  115. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  116. package/dist-esm/src/operationsInterfaces/standbyContainerGroupPools.d.ts +63 -0
  117. package/dist-esm/src/operationsInterfaces/standbyContainerGroupPools.d.ts.map +1 -0
  118. package/dist-esm/src/operationsInterfaces/standbyContainerGroupPools.js +9 -0
  119. package/dist-esm/src/operationsInterfaces/standbyContainerGroupPools.js.map +1 -0
  120. package/dist-esm/src/operationsInterfaces/standbyVirtualMachinePools.d.ts +63 -0
  121. package/dist-esm/src/operationsInterfaces/standbyVirtualMachinePools.d.ts.map +1 -0
  122. package/dist-esm/src/operationsInterfaces/standbyVirtualMachinePools.js +9 -0
  123. package/dist-esm/src/operationsInterfaces/standbyVirtualMachinePools.js.map +1 -0
  124. package/dist-esm/src/operationsInterfaces/standbyVirtualMachines.d.ts +21 -0
  125. package/dist-esm/src/operationsInterfaces/standbyVirtualMachines.d.ts.map +1 -0
  126. package/dist-esm/src/operationsInterfaces/standbyVirtualMachines.js +9 -0
  127. package/dist-esm/src/operationsInterfaces/standbyVirtualMachines.js.map +1 -0
  128. package/dist-esm/src/pagingHelper.d.ts +13 -0
  129. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  130. package/dist-esm/src/pagingHelper.js +32 -0
  131. package/dist-esm/src/pagingHelper.js.map +1 -0
  132. package/dist-esm/src/standbyPoolManagementClient.d.ts +23 -0
  133. package/dist-esm/src/standbyPoolManagementClient.d.ts.map +1 -0
  134. package/dist-esm/src/standbyPoolManagementClient.js +103 -0
  135. package/dist-esm/src/standbyPoolManagementClient.js.map +1 -0
  136. package/dist-esm/test/standbypool_operations_test.spec.d.ts +4 -0
  137. package/dist-esm/test/standbypool_operations_test.spec.d.ts.map +1 -0
  138. package/dist-esm/test/standbypool_operations_test.spec.js +73 -0
  139. package/dist-esm/test/standbypool_operations_test.spec.js.map +1 -0
  140. package/package.json +118 -0
  141. package/review/arm-standbypool.api.md +520 -0
  142. package/src/index.ts +13 -0
  143. package/src/lroImpl.ts +42 -0
  144. package/src/models/index.ts +695 -0
  145. package/src/models/mappers.ts +947 -0
  146. package/src/models/parameters.ts +167 -0
  147. package/src/operations/index.ts +12 -0
  148. package/src/operations/operations.ts +149 -0
  149. package/src/operations/standbyContainerGroupPools.ts +650 -0
  150. package/src/operations/standbyVirtualMachinePools.ts +650 -0
  151. package/src/operations/standbyVirtualMachines.ts +252 -0
  152. package/src/operationsInterfaces/index.ts +12 -0
  153. package/src/operationsInterfaces/operations.ts +22 -0
  154. package/src/operationsInterfaces/standbyContainerGroupPools.ts +127 -0
  155. package/src/operationsInterfaces/standbyVirtualMachinePools.ts +127 -0
  156. package/src/operationsInterfaces/standbyVirtualMachines.ts +44 -0
  157. package/src/pagingHelper.ts +39 -0
  158. package/src/standbyPoolManagementClient.ts +157 -0
  159. package/tsconfig.json +33 -0
  160. package/types/arm-standbypool.d.ts +853 -0
  161. package/types/tsdoc-metadata.json +11 -0
@@ -0,0 +1,650 @@
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 { StandbyContainerGroupPools } 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 { StandbyPoolManagementClient } from "../standbyPoolManagementClient";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller,
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
22
+ import {
23
+ StandbyContainerGroupPoolResource,
24
+ StandbyContainerGroupPoolsListBySubscriptionNextOptionalParams,
25
+ StandbyContainerGroupPoolsListBySubscriptionOptionalParams,
26
+ StandbyContainerGroupPoolsListBySubscriptionResponse,
27
+ StandbyContainerGroupPoolsListByResourceGroupNextOptionalParams,
28
+ StandbyContainerGroupPoolsListByResourceGroupOptionalParams,
29
+ StandbyContainerGroupPoolsListByResourceGroupResponse,
30
+ StandbyContainerGroupPoolsGetOptionalParams,
31
+ StandbyContainerGroupPoolsGetResponse,
32
+ StandbyContainerGroupPoolsCreateOrUpdateOptionalParams,
33
+ StandbyContainerGroupPoolsCreateOrUpdateResponse,
34
+ StandbyContainerGroupPoolResourceUpdate,
35
+ StandbyContainerGroupPoolsUpdateOptionalParams,
36
+ StandbyContainerGroupPoolsUpdateResponse,
37
+ StandbyContainerGroupPoolsDeleteOptionalParams,
38
+ StandbyContainerGroupPoolsDeleteResponse,
39
+ StandbyContainerGroupPoolsListBySubscriptionNextResponse,
40
+ StandbyContainerGroupPoolsListByResourceGroupNextResponse,
41
+ } from "../models";
42
+
43
+ /// <reference lib="esnext.asynciterable" />
44
+ /** Class containing StandbyContainerGroupPools operations. */
45
+ export class StandbyContainerGroupPoolsImpl
46
+ implements StandbyContainerGroupPools
47
+ {
48
+ private readonly client: StandbyPoolManagementClient;
49
+
50
+ /**
51
+ * Initialize a new instance of the class StandbyContainerGroupPools class.
52
+ * @param client Reference to the service client
53
+ */
54
+ constructor(client: StandbyPoolManagementClient) {
55
+ this.client = client;
56
+ }
57
+
58
+ /**
59
+ * List StandbyContainerGroupPoolResource resources by subscription ID
60
+ * @param options The options parameters.
61
+ */
62
+ public listBySubscription(
63
+ options?: StandbyContainerGroupPoolsListBySubscriptionOptionalParams,
64
+ ): PagedAsyncIterableIterator<StandbyContainerGroupPoolResource> {
65
+ const iter = this.listBySubscriptionPagingAll(options);
66
+ return {
67
+ next() {
68
+ return iter.next();
69
+ },
70
+ [Symbol.asyncIterator]() {
71
+ return this;
72
+ },
73
+ byPage: (settings?: PageSettings) => {
74
+ if (settings?.maxPageSize) {
75
+ throw new Error("maxPageSize is not supported by this operation.");
76
+ }
77
+ return this.listBySubscriptionPagingPage(options, settings);
78
+ },
79
+ };
80
+ }
81
+
82
+ private async *listBySubscriptionPagingPage(
83
+ options?: StandbyContainerGroupPoolsListBySubscriptionOptionalParams,
84
+ settings?: PageSettings,
85
+ ): AsyncIterableIterator<StandbyContainerGroupPoolResource[]> {
86
+ let result: StandbyContainerGroupPoolsListBySubscriptionResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._listBySubscription(options);
90
+ let page = result.value || [];
91
+ continuationToken = result.nextLink;
92
+ setContinuationToken(page, continuationToken);
93
+ yield page;
94
+ }
95
+ while (continuationToken) {
96
+ result = await this._listBySubscriptionNext(continuationToken, options);
97
+ continuationToken = result.nextLink;
98
+ let page = result.value || [];
99
+ setContinuationToken(page, continuationToken);
100
+ yield page;
101
+ }
102
+ }
103
+
104
+ private async *listBySubscriptionPagingAll(
105
+ options?: StandbyContainerGroupPoolsListBySubscriptionOptionalParams,
106
+ ): AsyncIterableIterator<StandbyContainerGroupPoolResource> {
107
+ for await (const page of this.listBySubscriptionPagingPage(options)) {
108
+ yield* page;
109
+ }
110
+ }
111
+
112
+ /**
113
+ * List StandbyContainerGroupPoolResource resources by resource group
114
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
115
+ * @param options The options parameters.
116
+ */
117
+ public listByResourceGroup(
118
+ resourceGroupName: string,
119
+ options?: StandbyContainerGroupPoolsListByResourceGroupOptionalParams,
120
+ ): PagedAsyncIterableIterator<StandbyContainerGroupPoolResource> {
121
+ const iter = this.listByResourceGroupPagingAll(resourceGroupName, options);
122
+ return {
123
+ next() {
124
+ return iter.next();
125
+ },
126
+ [Symbol.asyncIterator]() {
127
+ return this;
128
+ },
129
+ byPage: (settings?: PageSettings) => {
130
+ if (settings?.maxPageSize) {
131
+ throw new Error("maxPageSize is not supported by this operation.");
132
+ }
133
+ return this.listByResourceGroupPagingPage(
134
+ resourceGroupName,
135
+ options,
136
+ settings,
137
+ );
138
+ },
139
+ };
140
+ }
141
+
142
+ private async *listByResourceGroupPagingPage(
143
+ resourceGroupName: string,
144
+ options?: StandbyContainerGroupPoolsListByResourceGroupOptionalParams,
145
+ settings?: PageSettings,
146
+ ): AsyncIterableIterator<StandbyContainerGroupPoolResource[]> {
147
+ let result: StandbyContainerGroupPoolsListByResourceGroupResponse;
148
+ let continuationToken = settings?.continuationToken;
149
+ if (!continuationToken) {
150
+ result = await this._listByResourceGroup(resourceGroupName, options);
151
+ let page = result.value || [];
152
+ continuationToken = result.nextLink;
153
+ setContinuationToken(page, continuationToken);
154
+ yield page;
155
+ }
156
+ while (continuationToken) {
157
+ result = await this._listByResourceGroupNext(
158
+ resourceGroupName,
159
+ continuationToken,
160
+ options,
161
+ );
162
+ continuationToken = result.nextLink;
163
+ let page = result.value || [];
164
+ setContinuationToken(page, continuationToken);
165
+ yield page;
166
+ }
167
+ }
168
+
169
+ private async *listByResourceGroupPagingAll(
170
+ resourceGroupName: string,
171
+ options?: StandbyContainerGroupPoolsListByResourceGroupOptionalParams,
172
+ ): AsyncIterableIterator<StandbyContainerGroupPoolResource> {
173
+ for await (const page of this.listByResourceGroupPagingPage(
174
+ resourceGroupName,
175
+ options,
176
+ )) {
177
+ yield* page;
178
+ }
179
+ }
180
+
181
+ /**
182
+ * List StandbyContainerGroupPoolResource resources by subscription ID
183
+ * @param options The options parameters.
184
+ */
185
+ private _listBySubscription(
186
+ options?: StandbyContainerGroupPoolsListBySubscriptionOptionalParams,
187
+ ): Promise<StandbyContainerGroupPoolsListBySubscriptionResponse> {
188
+ return this.client.sendOperationRequest(
189
+ { options },
190
+ listBySubscriptionOperationSpec,
191
+ );
192
+ }
193
+
194
+ /**
195
+ * List StandbyContainerGroupPoolResource resources by resource group
196
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
197
+ * @param options The options parameters.
198
+ */
199
+ private _listByResourceGroup(
200
+ resourceGroupName: string,
201
+ options?: StandbyContainerGroupPoolsListByResourceGroupOptionalParams,
202
+ ): Promise<StandbyContainerGroupPoolsListByResourceGroupResponse> {
203
+ return this.client.sendOperationRequest(
204
+ { resourceGroupName, options },
205
+ listByResourceGroupOperationSpec,
206
+ );
207
+ }
208
+
209
+ /**
210
+ * Get a StandbyContainerGroupPoolResource
211
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
212
+ * @param standbyContainerGroupPoolName Name of the standby container group pool
213
+ * @param options The options parameters.
214
+ */
215
+ get(
216
+ resourceGroupName: string,
217
+ standbyContainerGroupPoolName: string,
218
+ options?: StandbyContainerGroupPoolsGetOptionalParams,
219
+ ): Promise<StandbyContainerGroupPoolsGetResponse> {
220
+ return this.client.sendOperationRequest(
221
+ { resourceGroupName, standbyContainerGroupPoolName, options },
222
+ getOperationSpec,
223
+ );
224
+ }
225
+
226
+ /**
227
+ * Create a StandbyContainerGroupPoolResource
228
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
229
+ * @param standbyContainerGroupPoolName Name of the standby container group pool
230
+ * @param resource Resource create parameters.
231
+ * @param options The options parameters.
232
+ */
233
+ async beginCreateOrUpdate(
234
+ resourceGroupName: string,
235
+ standbyContainerGroupPoolName: string,
236
+ resource: StandbyContainerGroupPoolResource,
237
+ options?: StandbyContainerGroupPoolsCreateOrUpdateOptionalParams,
238
+ ): Promise<
239
+ SimplePollerLike<
240
+ OperationState<StandbyContainerGroupPoolsCreateOrUpdateResponse>,
241
+ StandbyContainerGroupPoolsCreateOrUpdateResponse
242
+ >
243
+ > {
244
+ const directSendOperation = async (
245
+ args: coreClient.OperationArguments,
246
+ spec: coreClient.OperationSpec,
247
+ ): Promise<StandbyContainerGroupPoolsCreateOrUpdateResponse> => {
248
+ return this.client.sendOperationRequest(args, spec);
249
+ };
250
+ const sendOperationFn = async (
251
+ args: coreClient.OperationArguments,
252
+ spec: coreClient.OperationSpec,
253
+ ) => {
254
+ let currentRawResponse: coreClient.FullOperationResponse | undefined =
255
+ undefined;
256
+ const providedCallback = args.options?.onResponse;
257
+ const callback: coreClient.RawResponseCallback = (
258
+ rawResponse: coreClient.FullOperationResponse,
259
+ flatResponse: unknown,
260
+ ) => {
261
+ currentRawResponse = rawResponse;
262
+ providedCallback?.(rawResponse, flatResponse);
263
+ };
264
+ const updatedArgs = {
265
+ ...args,
266
+ options: {
267
+ ...args.options,
268
+ onResponse: callback,
269
+ },
270
+ };
271
+ const flatResponse = await directSendOperation(updatedArgs, spec);
272
+ return {
273
+ flatResponse,
274
+ rawResponse: {
275
+ statusCode: currentRawResponse!.status,
276
+ body: currentRawResponse!.parsedBody,
277
+ headers: currentRawResponse!.headers.toJSON(),
278
+ },
279
+ };
280
+ };
281
+
282
+ const lro = createLroSpec({
283
+ sendOperationFn,
284
+ args: {
285
+ resourceGroupName,
286
+ standbyContainerGroupPoolName,
287
+ resource,
288
+ options,
289
+ },
290
+ spec: createOrUpdateOperationSpec,
291
+ });
292
+ const poller = await createHttpPoller<
293
+ StandbyContainerGroupPoolsCreateOrUpdateResponse,
294
+ OperationState<StandbyContainerGroupPoolsCreateOrUpdateResponse>
295
+ >(lro, {
296
+ restoreFrom: options?.resumeFrom,
297
+ intervalInMs: options?.updateIntervalInMs,
298
+ resourceLocationConfig: "azure-async-operation",
299
+ });
300
+ await poller.poll();
301
+ return poller;
302
+ }
303
+
304
+ /**
305
+ * Create a StandbyContainerGroupPoolResource
306
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
307
+ * @param standbyContainerGroupPoolName Name of the standby container group pool
308
+ * @param resource Resource create parameters.
309
+ * @param options The options parameters.
310
+ */
311
+ async beginCreateOrUpdateAndWait(
312
+ resourceGroupName: string,
313
+ standbyContainerGroupPoolName: string,
314
+ resource: StandbyContainerGroupPoolResource,
315
+ options?: StandbyContainerGroupPoolsCreateOrUpdateOptionalParams,
316
+ ): Promise<StandbyContainerGroupPoolsCreateOrUpdateResponse> {
317
+ const poller = await this.beginCreateOrUpdate(
318
+ resourceGroupName,
319
+ standbyContainerGroupPoolName,
320
+ resource,
321
+ options,
322
+ );
323
+ return poller.pollUntilDone();
324
+ }
325
+
326
+ /**
327
+ * Update a StandbyContainerGroupPoolResource
328
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
329
+ * @param standbyContainerGroupPoolName Name of the standby container group pool
330
+ * @param properties The resource properties to be updated.
331
+ * @param options The options parameters.
332
+ */
333
+ update(
334
+ resourceGroupName: string,
335
+ standbyContainerGroupPoolName: string,
336
+ properties: StandbyContainerGroupPoolResourceUpdate,
337
+ options?: StandbyContainerGroupPoolsUpdateOptionalParams,
338
+ ): Promise<StandbyContainerGroupPoolsUpdateResponse> {
339
+ return this.client.sendOperationRequest(
340
+ { resourceGroupName, standbyContainerGroupPoolName, properties, options },
341
+ updateOperationSpec,
342
+ );
343
+ }
344
+
345
+ /**
346
+ * Delete a StandbyContainerGroupPoolResource
347
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
348
+ * @param standbyContainerGroupPoolName Name of the standby container group pool
349
+ * @param options The options parameters.
350
+ */
351
+ async beginDelete(
352
+ resourceGroupName: string,
353
+ standbyContainerGroupPoolName: string,
354
+ options?: StandbyContainerGroupPoolsDeleteOptionalParams,
355
+ ): Promise<
356
+ SimplePollerLike<
357
+ OperationState<StandbyContainerGroupPoolsDeleteResponse>,
358
+ StandbyContainerGroupPoolsDeleteResponse
359
+ >
360
+ > {
361
+ const directSendOperation = async (
362
+ args: coreClient.OperationArguments,
363
+ spec: coreClient.OperationSpec,
364
+ ): Promise<StandbyContainerGroupPoolsDeleteResponse> => {
365
+ return this.client.sendOperationRequest(args, spec);
366
+ };
367
+ const sendOperationFn = async (
368
+ args: coreClient.OperationArguments,
369
+ spec: coreClient.OperationSpec,
370
+ ) => {
371
+ let currentRawResponse: coreClient.FullOperationResponse | undefined =
372
+ undefined;
373
+ const providedCallback = args.options?.onResponse;
374
+ const callback: coreClient.RawResponseCallback = (
375
+ rawResponse: coreClient.FullOperationResponse,
376
+ flatResponse: unknown,
377
+ ) => {
378
+ currentRawResponse = rawResponse;
379
+ providedCallback?.(rawResponse, flatResponse);
380
+ };
381
+ const updatedArgs = {
382
+ ...args,
383
+ options: {
384
+ ...args.options,
385
+ onResponse: callback,
386
+ },
387
+ };
388
+ const flatResponse = await directSendOperation(updatedArgs, spec);
389
+ return {
390
+ flatResponse,
391
+ rawResponse: {
392
+ statusCode: currentRawResponse!.status,
393
+ body: currentRawResponse!.parsedBody,
394
+ headers: currentRawResponse!.headers.toJSON(),
395
+ },
396
+ };
397
+ };
398
+
399
+ const lro = createLroSpec({
400
+ sendOperationFn,
401
+ args: { resourceGroupName, standbyContainerGroupPoolName, options },
402
+ spec: deleteOperationSpec,
403
+ });
404
+ const poller = await createHttpPoller<
405
+ StandbyContainerGroupPoolsDeleteResponse,
406
+ OperationState<StandbyContainerGroupPoolsDeleteResponse>
407
+ >(lro, {
408
+ restoreFrom: options?.resumeFrom,
409
+ intervalInMs: options?.updateIntervalInMs,
410
+ resourceLocationConfig: "location",
411
+ });
412
+ await poller.poll();
413
+ return poller;
414
+ }
415
+
416
+ /**
417
+ * Delete a StandbyContainerGroupPoolResource
418
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
419
+ * @param standbyContainerGroupPoolName Name of the standby container group pool
420
+ * @param options The options parameters.
421
+ */
422
+ async beginDeleteAndWait(
423
+ resourceGroupName: string,
424
+ standbyContainerGroupPoolName: string,
425
+ options?: StandbyContainerGroupPoolsDeleteOptionalParams,
426
+ ): Promise<StandbyContainerGroupPoolsDeleteResponse> {
427
+ const poller = await this.beginDelete(
428
+ resourceGroupName,
429
+ standbyContainerGroupPoolName,
430
+ options,
431
+ );
432
+ return poller.pollUntilDone();
433
+ }
434
+
435
+ /**
436
+ * ListBySubscriptionNext
437
+ * @param nextLink The nextLink from the previous successful call to the ListBySubscription method.
438
+ * @param options The options parameters.
439
+ */
440
+ private _listBySubscriptionNext(
441
+ nextLink: string,
442
+ options?: StandbyContainerGroupPoolsListBySubscriptionNextOptionalParams,
443
+ ): Promise<StandbyContainerGroupPoolsListBySubscriptionNextResponse> {
444
+ return this.client.sendOperationRequest(
445
+ { nextLink, options },
446
+ listBySubscriptionNextOperationSpec,
447
+ );
448
+ }
449
+
450
+ /**
451
+ * ListByResourceGroupNext
452
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
453
+ * @param nextLink The nextLink from the previous successful call to the ListByResourceGroup method.
454
+ * @param options The options parameters.
455
+ */
456
+ private _listByResourceGroupNext(
457
+ resourceGroupName: string,
458
+ nextLink: string,
459
+ options?: StandbyContainerGroupPoolsListByResourceGroupNextOptionalParams,
460
+ ): Promise<StandbyContainerGroupPoolsListByResourceGroupNextResponse> {
461
+ return this.client.sendOperationRequest(
462
+ { resourceGroupName, nextLink, options },
463
+ listByResourceGroupNextOperationSpec,
464
+ );
465
+ }
466
+ }
467
+ // Operation Specifications
468
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
469
+
470
+ const listBySubscriptionOperationSpec: coreClient.OperationSpec = {
471
+ path: "/subscriptions/{subscriptionId}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
472
+ httpMethod: "GET",
473
+ responses: {
474
+ 200: {
475
+ bodyMapper: Mappers.StandbyContainerGroupPoolResourceListResult,
476
+ },
477
+ default: {
478
+ bodyMapper: Mappers.ErrorResponse,
479
+ },
480
+ },
481
+ queryParameters: [Parameters.apiVersion],
482
+ urlParameters: [Parameters.$host, Parameters.subscriptionId],
483
+ headerParameters: [Parameters.accept],
484
+ serializer,
485
+ };
486
+ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
487
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools",
488
+ httpMethod: "GET",
489
+ responses: {
490
+ 200: {
491
+ bodyMapper: Mappers.StandbyContainerGroupPoolResourceListResult,
492
+ },
493
+ default: {
494
+ bodyMapper: Mappers.ErrorResponse,
495
+ },
496
+ },
497
+ queryParameters: [Parameters.apiVersion],
498
+ urlParameters: [
499
+ Parameters.$host,
500
+ Parameters.subscriptionId,
501
+ Parameters.resourceGroupName,
502
+ ],
503
+ headerParameters: [Parameters.accept],
504
+ serializer,
505
+ };
506
+ const getOperationSpec: coreClient.OperationSpec = {
507
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}",
508
+ httpMethod: "GET",
509
+ responses: {
510
+ 200: {
511
+ bodyMapper: Mappers.StandbyContainerGroupPoolResource,
512
+ },
513
+ default: {
514
+ bodyMapper: Mappers.ErrorResponse,
515
+ },
516
+ },
517
+ queryParameters: [Parameters.apiVersion],
518
+ urlParameters: [
519
+ Parameters.$host,
520
+ Parameters.subscriptionId,
521
+ Parameters.resourceGroupName,
522
+ Parameters.standbyContainerGroupPoolName,
523
+ ],
524
+ headerParameters: [Parameters.accept],
525
+ serializer,
526
+ };
527
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
528
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}",
529
+ httpMethod: "PUT",
530
+ responses: {
531
+ 200: {
532
+ bodyMapper: Mappers.StandbyContainerGroupPoolResource,
533
+ },
534
+ 201: {
535
+ bodyMapper: Mappers.StandbyContainerGroupPoolResource,
536
+ },
537
+ 202: {
538
+ bodyMapper: Mappers.StandbyContainerGroupPoolResource,
539
+ },
540
+ 204: {
541
+ bodyMapper: Mappers.StandbyContainerGroupPoolResource,
542
+ },
543
+ default: {
544
+ bodyMapper: Mappers.ErrorResponse,
545
+ },
546
+ },
547
+ requestBody: Parameters.resource,
548
+ queryParameters: [Parameters.apiVersion],
549
+ urlParameters: [
550
+ Parameters.$host,
551
+ Parameters.subscriptionId,
552
+ Parameters.resourceGroupName,
553
+ Parameters.standbyContainerGroupPoolName,
554
+ ],
555
+ headerParameters: [Parameters.accept, Parameters.contentType],
556
+ mediaType: "json",
557
+ serializer,
558
+ };
559
+ const updateOperationSpec: coreClient.OperationSpec = {
560
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}",
561
+ httpMethod: "PATCH",
562
+ responses: {
563
+ 200: {
564
+ bodyMapper: Mappers.StandbyContainerGroupPoolResource,
565
+ },
566
+ default: {
567
+ bodyMapper: Mappers.ErrorResponse,
568
+ },
569
+ },
570
+ requestBody: Parameters.properties,
571
+ queryParameters: [Parameters.apiVersion],
572
+ urlParameters: [
573
+ Parameters.$host,
574
+ Parameters.subscriptionId,
575
+ Parameters.resourceGroupName,
576
+ Parameters.standbyContainerGroupPoolName,
577
+ ],
578
+ headerParameters: [Parameters.accept, Parameters.contentType],
579
+ mediaType: "json",
580
+ serializer,
581
+ };
582
+ const deleteOperationSpec: coreClient.OperationSpec = {
583
+ path: "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StandbyPool/standbyContainerGroupPools/{standbyContainerGroupPoolName}",
584
+ httpMethod: "DELETE",
585
+ responses: {
586
+ 200: {
587
+ headersMapper: Mappers.StandbyContainerGroupPoolsDeleteHeaders,
588
+ },
589
+ 201: {
590
+ headersMapper: Mappers.StandbyContainerGroupPoolsDeleteHeaders,
591
+ },
592
+ 202: {
593
+ headersMapper: Mappers.StandbyContainerGroupPoolsDeleteHeaders,
594
+ },
595
+ 204: {
596
+ headersMapper: Mappers.StandbyContainerGroupPoolsDeleteHeaders,
597
+ },
598
+ default: {
599
+ bodyMapper: Mappers.ErrorResponse,
600
+ },
601
+ },
602
+ queryParameters: [Parameters.apiVersion],
603
+ urlParameters: [
604
+ Parameters.$host,
605
+ Parameters.subscriptionId,
606
+ Parameters.resourceGroupName,
607
+ Parameters.standbyContainerGroupPoolName,
608
+ ],
609
+ headerParameters: [Parameters.accept],
610
+ serializer,
611
+ };
612
+ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
613
+ path: "{nextLink}",
614
+ httpMethod: "GET",
615
+ responses: {
616
+ 200: {
617
+ bodyMapper: Mappers.StandbyContainerGroupPoolResourceListResult,
618
+ },
619
+ default: {
620
+ bodyMapper: Mappers.ErrorResponse,
621
+ },
622
+ },
623
+ urlParameters: [
624
+ Parameters.$host,
625
+ Parameters.nextLink,
626
+ Parameters.subscriptionId,
627
+ ],
628
+ headerParameters: [Parameters.accept],
629
+ serializer,
630
+ };
631
+ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
632
+ path: "{nextLink}",
633
+ httpMethod: "GET",
634
+ responses: {
635
+ 200: {
636
+ bodyMapper: Mappers.StandbyContainerGroupPoolResourceListResult,
637
+ },
638
+ default: {
639
+ bodyMapper: Mappers.ErrorResponse,
640
+ },
641
+ },
642
+ urlParameters: [
643
+ Parameters.$host,
644
+ Parameters.nextLink,
645
+ Parameters.subscriptionId,
646
+ Parameters.resourceGroupName,
647
+ ],
648
+ headerParameters: [Parameters.accept],
649
+ serializer,
650
+ };