@azure/arm-extendedlocation 1.0.0-beta.1 → 1.0.0-beta.3

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 (134) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/LICENSE +1 -1
  3. package/README.md +24 -9
  4. package/dist/index.js +921 -113
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.js +50 -0
  11. package/dist-esm/samples-dev/customLocationsCreateOrUpdateSample.js.map +1 -0
  12. package/dist-esm/samples-dev/customLocationsDeleteSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/customLocationsDeleteSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/customLocationsDeleteSample.js +39 -0
  15. package/dist-esm/samples-dev/customLocationsDeleteSample.js.map +1 -0
  16. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.js +42 -0
  19. package/dist-esm/samples-dev/customLocationsFindTargetResourceGroupSample.js.map +1 -0
  20. package/dist-esm/samples-dev/customLocationsGetSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/customLocationsGetSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/customLocationsGetSample.js +39 -0
  23. package/dist-esm/samples-dev/customLocationsGetSample.js.map +1 -0
  24. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.js +52 -0
  27. package/dist-esm/samples-dev/customLocationsListByResourceGroupSample.js.map +1 -0
  28. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.js +51 -0
  31. package/dist-esm/samples-dev/customLocationsListBySubscriptionSample.js.map +1 -0
  32. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.js +53 -0
  35. package/dist-esm/samples-dev/customLocationsListEnabledResourceTypesSample.js.map +1 -0
  36. package/dist-esm/samples-dev/customLocationsListOperationsSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/customLocationsListOperationsSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/customLocationsListOperationsSample.js +51 -0
  39. package/dist-esm/samples-dev/customLocationsListOperationsSample.js.map +1 -0
  40. package/dist-esm/samples-dev/customLocationsUpdateSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/customLocationsUpdateSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/customLocationsUpdateSample.js +42 -0
  43. package/dist-esm/samples-dev/customLocationsUpdateSample.js.map +1 -0
  44. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.d.ts +2 -0
  45. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.d.ts.map +1 -0
  46. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.js +49 -0
  47. package/dist-esm/samples-dev/resourceSyncRulesCreateOrUpdateSample.js.map +1 -0
  48. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.d.ts +2 -0
  49. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.d.ts.map +1 -0
  50. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.js +40 -0
  51. package/dist-esm/samples-dev/resourceSyncRulesDeleteSample.js.map +1 -0
  52. package/dist-esm/samples-dev/resourceSyncRulesGetSample.d.ts +2 -0
  53. package/dist-esm/samples-dev/resourceSyncRulesGetSample.d.ts.map +1 -0
  54. package/dist-esm/samples-dev/resourceSyncRulesGetSample.js +40 -0
  55. package/dist-esm/samples-dev/resourceSyncRulesGetSample.js.map +1 -0
  56. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.d.ts +2 -0
  57. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.d.ts.map +1 -0
  58. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.js +53 -0
  59. package/dist-esm/samples-dev/resourceSyncRulesListByCustomLocationIdSample.js.map +1 -0
  60. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.d.ts +2 -0
  61. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.d.ts.map +1 -0
  62. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.js +42 -0
  63. package/dist-esm/samples-dev/resourceSyncRulesUpdateSample.js.map +1 -0
  64. package/dist-esm/src/customLocationsManagementClient.d.ts +9 -3
  65. package/dist-esm/src/customLocationsManagementClient.d.ts.map +1 -1
  66. package/dist-esm/src/customLocationsManagementClient.js +83 -4
  67. package/dist-esm/src/customLocationsManagementClient.js.map +1 -1
  68. package/dist-esm/src/index.d.ts +1 -1
  69. package/dist-esm/src/index.d.ts.map +1 -1
  70. package/dist-esm/src/index.js +1 -1
  71. package/dist-esm/src/index.js.map +1 -1
  72. package/dist-esm/src/models/index.d.ts +172 -25
  73. package/dist-esm/src/models/index.d.ts.map +1 -1
  74. package/dist-esm/src/models/index.js +7 -0
  75. package/dist-esm/src/models/index.js.map +1 -1
  76. package/dist-esm/src/models/mappers.d.ts +8 -1
  77. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  78. package/dist-esm/src/models/mappers.js +228 -29
  79. package/dist-esm/src/models/mappers.js.map +1 -1
  80. package/dist-esm/src/models/parameters.d.ts +7 -0
  81. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  82. package/dist-esm/src/models/parameters.js +41 -2
  83. package/dist-esm/src/models/parameters.js.map +1 -1
  84. package/dist-esm/src/operations/customLocations.d.ts +12 -3
  85. package/dist-esm/src/operations/customLocations.d.ts.map +1 -1
  86. package/dist-esm/src/operations/customLocations.js +114 -34
  87. package/dist-esm/src/operations/customLocations.js.map +1 -1
  88. package/dist-esm/src/operations/index.d.ts +1 -0
  89. package/dist-esm/src/operations/index.d.ts.map +1 -1
  90. package/dist-esm/src/operations/index.js +1 -0
  91. package/dist-esm/src/operations/index.js.map +1 -1
  92. package/dist-esm/src/operations/resourceSyncRules.d.ts +97 -0
  93. package/dist-esm/src/operations/resourceSyncRules.d.ts.map +1 -0
  94. package/dist-esm/src/operations/resourceSyncRules.js +411 -0
  95. package/dist-esm/src/operations/resourceSyncRules.js.map +1 -0
  96. package/dist-esm/src/operationsInterfaces/customLocations.d.ts +10 -1
  97. package/dist-esm/src/operationsInterfaces/customLocations.d.ts.map +1 -1
  98. package/dist-esm/src/operationsInterfaces/index.d.ts +1 -0
  99. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -1
  100. package/dist-esm/src/operationsInterfaces/index.js +1 -0
  101. package/dist-esm/src/operationsInterfaces/index.js.map +1 -1
  102. package/dist-esm/src/operationsInterfaces/resourceSyncRules.d.ts +71 -0
  103. package/dist-esm/src/operationsInterfaces/resourceSyncRules.d.ts.map +1 -0
  104. package/dist-esm/src/operationsInterfaces/resourceSyncRules.js +9 -0
  105. package/dist-esm/src/operationsInterfaces/resourceSyncRules.js.map +1 -0
  106. package/dist-esm/src/pagingHelper.d.ts +13 -0
  107. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  108. package/dist-esm/src/pagingHelper.js +32 -0
  109. package/dist-esm/src/pagingHelper.js.map +1 -0
  110. package/dist-esm/test/sampleTest.js +11 -13
  111. package/dist-esm/test/sampleTest.js.map +1 -1
  112. package/package.json +58 -27
  113. package/review/arm-extendedlocation.api.md +142 -27
  114. package/rollup.config.js +6 -72
  115. package/src/customLocationsManagementClient.ts +115 -5
  116. package/src/index.ts +1 -1
  117. package/src/models/index.ts +186 -26
  118. package/src/models/mappers.ts +243 -30
  119. package/src/models/parameters.ts +53 -2
  120. package/src/operations/customLocations.ts +148 -46
  121. package/src/operations/index.ts +1 -0
  122. package/src/operations/resourceSyncRules.ts +575 -0
  123. package/src/operationsInterfaces/customLocations.ts +18 -1
  124. package/src/operationsInterfaces/index.ts +1 -0
  125. package/src/operationsInterfaces/resourceSyncRules.ts +136 -0
  126. package/src/pagingHelper.ts +39 -0
  127. package/tsconfig.json +19 -5
  128. package/types/arm-extendedlocation.d.ts +266 -20
  129. package/types/tsdoc-metadata.json +1 -1
  130. package/dist-esm/src/customLocationsManagementClientContext.d.ts +0 -16
  131. package/dist-esm/src/customLocationsManagementClientContext.d.ts.map +0 -1
  132. package/dist-esm/src/customLocationsManagementClientContext.js +0 -49
  133. package/dist-esm/src/customLocationsManagementClientContext.js.map +0 -1
  134. package/src/customLocationsManagementClientContext.ts +0 -70
@@ -0,0 +1,575 @@
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 { ResourceSyncRules } 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 { CustomLocationsManagementClient } from "../customLocationsManagementClient";
16
+ import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
17
+ import { LroImpl } from "../lroImpl";
18
+ import {
19
+ ResourceSyncRule,
20
+ ResourceSyncRulesListByCustomLocationIDNextOptionalParams,
21
+ ResourceSyncRulesListByCustomLocationIDOptionalParams,
22
+ ResourceSyncRulesListByCustomLocationIDResponse,
23
+ ResourceSyncRulesGetOptionalParams,
24
+ ResourceSyncRulesGetResponse,
25
+ ResourceSyncRulesCreateOrUpdateOptionalParams,
26
+ ResourceSyncRulesCreateOrUpdateResponse,
27
+ ResourceSyncRulesDeleteOptionalParams,
28
+ ResourceSyncRulesUpdateOptionalParams,
29
+ ResourceSyncRulesUpdateResponse,
30
+ ResourceSyncRulesListByCustomLocationIDNextResponse
31
+ } from "../models";
32
+
33
+ /// <reference lib="esnext.asynciterable" />
34
+ /** Class containing ResourceSyncRules operations. */
35
+ export class ResourceSyncRulesImpl implements ResourceSyncRules {
36
+ private readonly client: CustomLocationsManagementClient;
37
+
38
+ /**
39
+ * Initialize a new instance of the class ResourceSyncRules class.
40
+ * @param client Reference to the service client
41
+ */
42
+ constructor(client: CustomLocationsManagementClient) {
43
+ this.client = client;
44
+ }
45
+
46
+ /**
47
+ * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
48
+ * of each Resource Sync Rule
49
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
50
+ * @param resourceName Custom Locations name.
51
+ * @param options The options parameters.
52
+ */
53
+ public listByCustomLocationID(
54
+ resourceGroupName: string,
55
+ resourceName: string,
56
+ options?: ResourceSyncRulesListByCustomLocationIDOptionalParams
57
+ ): PagedAsyncIterableIterator<ResourceSyncRule> {
58
+ const iter = this.listByCustomLocationIDPagingAll(
59
+ resourceGroupName,
60
+ resourceName,
61
+ options
62
+ );
63
+ return {
64
+ next() {
65
+ return iter.next();
66
+ },
67
+ [Symbol.asyncIterator]() {
68
+ return this;
69
+ },
70
+ byPage: (settings?: PageSettings) => {
71
+ if (settings?.maxPageSize) {
72
+ throw new Error("maxPageSize is not supported by this operation.");
73
+ }
74
+ return this.listByCustomLocationIDPagingPage(
75
+ resourceGroupName,
76
+ resourceName,
77
+ options,
78
+ settings
79
+ );
80
+ }
81
+ };
82
+ }
83
+
84
+ private async *listByCustomLocationIDPagingPage(
85
+ resourceGroupName: string,
86
+ resourceName: string,
87
+ options?: ResourceSyncRulesListByCustomLocationIDOptionalParams,
88
+ settings?: PageSettings
89
+ ): AsyncIterableIterator<ResourceSyncRule[]> {
90
+ let result: ResourceSyncRulesListByCustomLocationIDResponse;
91
+ let continuationToken = settings?.continuationToken;
92
+ if (!continuationToken) {
93
+ result = await this._listByCustomLocationID(
94
+ resourceGroupName,
95
+ resourceName,
96
+ options
97
+ );
98
+ let page = result.value || [];
99
+ continuationToken = result.nextLink;
100
+ setContinuationToken(page, continuationToken);
101
+ yield page;
102
+ }
103
+ while (continuationToken) {
104
+ result = await this._listByCustomLocationIDNext(
105
+ resourceGroupName,
106
+ resourceName,
107
+ continuationToken,
108
+ options
109
+ );
110
+ continuationToken = result.nextLink;
111
+ let page = result.value || [];
112
+ setContinuationToken(page, continuationToken);
113
+ yield page;
114
+ }
115
+ }
116
+
117
+ private async *listByCustomLocationIDPagingAll(
118
+ resourceGroupName: string,
119
+ resourceName: string,
120
+ options?: ResourceSyncRulesListByCustomLocationIDOptionalParams
121
+ ): AsyncIterableIterator<ResourceSyncRule> {
122
+ for await (const page of this.listByCustomLocationIDPagingPage(
123
+ resourceGroupName,
124
+ resourceName,
125
+ options
126
+ )) {
127
+ yield* page;
128
+ }
129
+ }
130
+
131
+ /**
132
+ * Gets a list of Resource Sync Rules in the specified subscription. The operation returns properties
133
+ * of each Resource Sync Rule
134
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
135
+ * @param resourceName Custom Locations name.
136
+ * @param options The options parameters.
137
+ */
138
+ private _listByCustomLocationID(
139
+ resourceGroupName: string,
140
+ resourceName: string,
141
+ options?: ResourceSyncRulesListByCustomLocationIDOptionalParams
142
+ ): Promise<ResourceSyncRulesListByCustomLocationIDResponse> {
143
+ return this.client.sendOperationRequest(
144
+ { resourceGroupName, resourceName, options },
145
+ listByCustomLocationIDOperationSpec
146
+ );
147
+ }
148
+
149
+ /**
150
+ * Gets the details of the resourceSyncRule with a specified resource group, subscription id Custom
151
+ * Location resource name and Resource Sync Rule name.
152
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
153
+ * @param resourceName Custom Locations name.
154
+ * @param childResourceName Resource Sync Rule name.
155
+ * @param options The options parameters.
156
+ */
157
+ get(
158
+ resourceGroupName: string,
159
+ resourceName: string,
160
+ childResourceName: string,
161
+ options?: ResourceSyncRulesGetOptionalParams
162
+ ): Promise<ResourceSyncRulesGetResponse> {
163
+ return this.client.sendOperationRequest(
164
+ { resourceGroupName, resourceName, childResourceName, options },
165
+ getOperationSpec
166
+ );
167
+ }
168
+
169
+ /**
170
+ * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
171
+ * Group
172
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
173
+ * @param resourceName Custom Locations name.
174
+ * @param childResourceName Resource Sync Rule name.
175
+ * @param parameters Parameters supplied to create or update a Resource Sync Rule.
176
+ * @param options The options parameters.
177
+ */
178
+ async beginCreateOrUpdate(
179
+ resourceGroupName: string,
180
+ resourceName: string,
181
+ childResourceName: string,
182
+ parameters: ResourceSyncRule,
183
+ options?: ResourceSyncRulesCreateOrUpdateOptionalParams
184
+ ): Promise<
185
+ PollerLike<
186
+ PollOperationState<ResourceSyncRulesCreateOrUpdateResponse>,
187
+ ResourceSyncRulesCreateOrUpdateResponse
188
+ >
189
+ > {
190
+ const directSendOperation = async (
191
+ args: coreClient.OperationArguments,
192
+ spec: coreClient.OperationSpec
193
+ ): Promise<ResourceSyncRulesCreateOrUpdateResponse> => {
194
+ return this.client.sendOperationRequest(args, spec);
195
+ };
196
+ const sendOperation = async (
197
+ args: coreClient.OperationArguments,
198
+ spec: coreClient.OperationSpec
199
+ ) => {
200
+ let currentRawResponse:
201
+ | coreClient.FullOperationResponse
202
+ | undefined = undefined;
203
+ const providedCallback = args.options?.onResponse;
204
+ const callback: coreClient.RawResponseCallback = (
205
+ rawResponse: coreClient.FullOperationResponse,
206
+ flatResponse: unknown
207
+ ) => {
208
+ currentRawResponse = rawResponse;
209
+ providedCallback?.(rawResponse, flatResponse);
210
+ };
211
+ const updatedArgs = {
212
+ ...args,
213
+ options: {
214
+ ...args.options,
215
+ onResponse: callback
216
+ }
217
+ };
218
+ const flatResponse = await directSendOperation(updatedArgs, spec);
219
+ return {
220
+ flatResponse,
221
+ rawResponse: {
222
+ statusCode: currentRawResponse!.status,
223
+ body: currentRawResponse!.parsedBody,
224
+ headers: currentRawResponse!.headers.toJSON()
225
+ }
226
+ };
227
+ };
228
+
229
+ const lro = new LroImpl(
230
+ sendOperation,
231
+ {
232
+ resourceGroupName,
233
+ resourceName,
234
+ childResourceName,
235
+ parameters,
236
+ options
237
+ },
238
+ createOrUpdateOperationSpec
239
+ );
240
+ const poller = new LroEngine(lro, {
241
+ resumeFrom: options?.resumeFrom,
242
+ intervalInMs: options?.updateIntervalInMs,
243
+ lroResourceLocationConfig: "azure-async-operation"
244
+ });
245
+ await poller.poll();
246
+ return poller;
247
+ }
248
+
249
+ /**
250
+ * Creates or updates a Resource Sync Rule in the parent Custom Location, Subscription Id and Resource
251
+ * Group
252
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
253
+ * @param resourceName Custom Locations name.
254
+ * @param childResourceName Resource Sync Rule name.
255
+ * @param parameters Parameters supplied to create or update a Resource Sync Rule.
256
+ * @param options The options parameters.
257
+ */
258
+ async beginCreateOrUpdateAndWait(
259
+ resourceGroupName: string,
260
+ resourceName: string,
261
+ childResourceName: string,
262
+ parameters: ResourceSyncRule,
263
+ options?: ResourceSyncRulesCreateOrUpdateOptionalParams
264
+ ): Promise<ResourceSyncRulesCreateOrUpdateResponse> {
265
+ const poller = await this.beginCreateOrUpdate(
266
+ resourceGroupName,
267
+ resourceName,
268
+ childResourceName,
269
+ parameters,
270
+ options
271
+ );
272
+ return poller.pollUntilDone();
273
+ }
274
+
275
+ /**
276
+ * Deletes the Resource Sync Rule with the specified Resource Sync Rule Name, Custom Location Resource
277
+ * Name, Resource Group, and Subscription Id.
278
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
279
+ * @param resourceName Custom Locations name.
280
+ * @param childResourceName Resource Sync Rule name.
281
+ * @param options The options parameters.
282
+ */
283
+ delete(
284
+ resourceGroupName: string,
285
+ resourceName: string,
286
+ childResourceName: string,
287
+ options?: ResourceSyncRulesDeleteOptionalParams
288
+ ): Promise<void> {
289
+ return this.client.sendOperationRequest(
290
+ { resourceGroupName, resourceName, childResourceName, options },
291
+ deleteOperationSpec
292
+ );
293
+ }
294
+
295
+ /**
296
+ * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
297
+ * Group, Subscription and Custom Location name.
298
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
299
+ * @param resourceName Custom Locations name.
300
+ * @param childResourceName Resource Sync Rule name.
301
+ * @param options The options parameters.
302
+ */
303
+ async beginUpdate(
304
+ resourceGroupName: string,
305
+ resourceName: string,
306
+ childResourceName: string,
307
+ options?: ResourceSyncRulesUpdateOptionalParams
308
+ ): Promise<
309
+ PollerLike<
310
+ PollOperationState<ResourceSyncRulesUpdateResponse>,
311
+ ResourceSyncRulesUpdateResponse
312
+ >
313
+ > {
314
+ const directSendOperation = async (
315
+ args: coreClient.OperationArguments,
316
+ spec: coreClient.OperationSpec
317
+ ): Promise<ResourceSyncRulesUpdateResponse> => {
318
+ return this.client.sendOperationRequest(args, spec);
319
+ };
320
+ const sendOperation = async (
321
+ args: coreClient.OperationArguments,
322
+ spec: coreClient.OperationSpec
323
+ ) => {
324
+ let currentRawResponse:
325
+ | coreClient.FullOperationResponse
326
+ | undefined = undefined;
327
+ const providedCallback = args.options?.onResponse;
328
+ const callback: coreClient.RawResponseCallback = (
329
+ rawResponse: coreClient.FullOperationResponse,
330
+ flatResponse: unknown
331
+ ) => {
332
+ currentRawResponse = rawResponse;
333
+ providedCallback?.(rawResponse, flatResponse);
334
+ };
335
+ const updatedArgs = {
336
+ ...args,
337
+ options: {
338
+ ...args.options,
339
+ onResponse: callback
340
+ }
341
+ };
342
+ const flatResponse = await directSendOperation(updatedArgs, spec);
343
+ return {
344
+ flatResponse,
345
+ rawResponse: {
346
+ statusCode: currentRawResponse!.status,
347
+ body: currentRawResponse!.parsedBody,
348
+ headers: currentRawResponse!.headers.toJSON()
349
+ }
350
+ };
351
+ };
352
+
353
+ const lro = new LroImpl(
354
+ sendOperation,
355
+ { resourceGroupName, resourceName, childResourceName, options },
356
+ updateOperationSpec
357
+ );
358
+ const poller = new LroEngine(lro, {
359
+ resumeFrom: options?.resumeFrom,
360
+ intervalInMs: options?.updateIntervalInMs,
361
+ lroResourceLocationConfig: "azure-async-operation"
362
+ });
363
+ await poller.poll();
364
+ return poller;
365
+ }
366
+
367
+ /**
368
+ * Updates a Resource Sync Rule with the specified Resource Sync Rule name in the specified Resource
369
+ * Group, Subscription and Custom Location name.
370
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
371
+ * @param resourceName Custom Locations name.
372
+ * @param childResourceName Resource Sync Rule name.
373
+ * @param options The options parameters.
374
+ */
375
+ async beginUpdateAndWait(
376
+ resourceGroupName: string,
377
+ resourceName: string,
378
+ childResourceName: string,
379
+ options?: ResourceSyncRulesUpdateOptionalParams
380
+ ): Promise<ResourceSyncRulesUpdateResponse> {
381
+ const poller = await this.beginUpdate(
382
+ resourceGroupName,
383
+ resourceName,
384
+ childResourceName,
385
+ options
386
+ );
387
+ return poller.pollUntilDone();
388
+ }
389
+
390
+ /**
391
+ * ListByCustomLocationIDNext
392
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
393
+ * @param resourceName Custom Locations name.
394
+ * @param nextLink The nextLink from the previous successful call to the ListByCustomLocationID method.
395
+ * @param options The options parameters.
396
+ */
397
+ private _listByCustomLocationIDNext(
398
+ resourceGroupName: string,
399
+ resourceName: string,
400
+ nextLink: string,
401
+ options?: ResourceSyncRulesListByCustomLocationIDNextOptionalParams
402
+ ): Promise<ResourceSyncRulesListByCustomLocationIDNextResponse> {
403
+ return this.client.sendOperationRequest(
404
+ { resourceGroupName, resourceName, nextLink, options },
405
+ listByCustomLocationIDNextOperationSpec
406
+ );
407
+ }
408
+ }
409
+ // Operation Specifications
410
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
411
+
412
+ const listByCustomLocationIDOperationSpec: coreClient.OperationSpec = {
413
+ path:
414
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules",
415
+ httpMethod: "GET",
416
+ responses: {
417
+ 200: {
418
+ bodyMapper: Mappers.ResourceSyncRuleListResult
419
+ },
420
+ default: {
421
+ bodyMapper: Mappers.ErrorResponse
422
+ }
423
+ },
424
+ queryParameters: [Parameters.apiVersion],
425
+ urlParameters: [
426
+ Parameters.$host,
427
+ Parameters.subscriptionId,
428
+ Parameters.resourceGroupName,
429
+ Parameters.resourceName
430
+ ],
431
+ headerParameters: [Parameters.accept],
432
+ serializer
433
+ };
434
+ const getOperationSpec: coreClient.OperationSpec = {
435
+ path:
436
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
437
+ httpMethod: "GET",
438
+ responses: {
439
+ 200: {
440
+ bodyMapper: Mappers.ResourceSyncRule
441
+ },
442
+ default: {
443
+ bodyMapper: Mappers.ErrorResponse
444
+ }
445
+ },
446
+ queryParameters: [Parameters.apiVersion],
447
+ urlParameters: [
448
+ Parameters.$host,
449
+ Parameters.subscriptionId,
450
+ Parameters.resourceGroupName,
451
+ Parameters.resourceName,
452
+ Parameters.childResourceName
453
+ ],
454
+ headerParameters: [Parameters.accept],
455
+ serializer
456
+ };
457
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
458
+ path:
459
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
460
+ httpMethod: "PUT",
461
+ responses: {
462
+ 200: {
463
+ bodyMapper: Mappers.ResourceSyncRule
464
+ },
465
+ 201: {
466
+ bodyMapper: Mappers.ResourceSyncRule
467
+ },
468
+ 202: {
469
+ bodyMapper: Mappers.ResourceSyncRule
470
+ },
471
+ 204: {
472
+ bodyMapper: Mappers.ResourceSyncRule
473
+ },
474
+ default: {
475
+ bodyMapper: Mappers.ErrorResponse
476
+ }
477
+ },
478
+ requestBody: Parameters.parameters3,
479
+ queryParameters: [Parameters.apiVersion],
480
+ urlParameters: [
481
+ Parameters.$host,
482
+ Parameters.subscriptionId,
483
+ Parameters.resourceGroupName,
484
+ Parameters.resourceName,
485
+ Parameters.childResourceName
486
+ ],
487
+ headerParameters: [Parameters.accept, Parameters.contentType],
488
+ mediaType: "json",
489
+ serializer
490
+ };
491
+ const deleteOperationSpec: coreClient.OperationSpec = {
492
+ path:
493
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
494
+ httpMethod: "DELETE",
495
+ responses: {
496
+ 200: {},
497
+ 204: {},
498
+ default: {
499
+ bodyMapper: Mappers.ErrorResponse
500
+ }
501
+ },
502
+ queryParameters: [Parameters.apiVersion],
503
+ urlParameters: [
504
+ Parameters.$host,
505
+ Parameters.subscriptionId,
506
+ Parameters.resourceGroupName,
507
+ Parameters.resourceName,
508
+ Parameters.childResourceName
509
+ ],
510
+ headerParameters: [Parameters.accept],
511
+ serializer
512
+ };
513
+ const updateOperationSpec: coreClient.OperationSpec = {
514
+ path:
515
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ExtendedLocation/customLocations/{resourceName}/resourceSyncRules/{childResourceName}",
516
+ httpMethod: "PATCH",
517
+ responses: {
518
+ 200: {
519
+ bodyMapper: Mappers.ResourceSyncRule
520
+ },
521
+ 201: {
522
+ bodyMapper: Mappers.ResourceSyncRule
523
+ },
524
+ 202: {
525
+ bodyMapper: Mappers.ResourceSyncRule
526
+ },
527
+ 204: {
528
+ bodyMapper: Mappers.ResourceSyncRule
529
+ },
530
+ default: {
531
+ bodyMapper: Mappers.ErrorResponse
532
+ }
533
+ },
534
+ requestBody: {
535
+ parameterPath: {
536
+ tags: ["options", "tags"],
537
+ priority: ["options", "priority"],
538
+ selector: ["options", "selector"],
539
+ targetResourceGroup: ["options", "targetResourceGroup"]
540
+ },
541
+ mapper: { ...Mappers.PatchableResourceSyncRule, required: true }
542
+ },
543
+ queryParameters: [Parameters.apiVersion],
544
+ urlParameters: [
545
+ Parameters.$host,
546
+ Parameters.subscriptionId,
547
+ Parameters.resourceGroupName,
548
+ Parameters.resourceName,
549
+ Parameters.childResourceName
550
+ ],
551
+ headerParameters: [Parameters.accept, Parameters.contentType],
552
+ mediaType: "json",
553
+ serializer
554
+ };
555
+ const listByCustomLocationIDNextOperationSpec: coreClient.OperationSpec = {
556
+ path: "{nextLink}",
557
+ httpMethod: "GET",
558
+ responses: {
559
+ 200: {
560
+ bodyMapper: Mappers.ResourceSyncRuleListResult
561
+ },
562
+ default: {
563
+ bodyMapper: Mappers.ErrorResponse
564
+ }
565
+ },
566
+ urlParameters: [
567
+ Parameters.$host,
568
+ Parameters.subscriptionId,
569
+ Parameters.resourceGroupName,
570
+ Parameters.resourceName,
571
+ Parameters.nextLink
572
+ ],
573
+ headerParameters: [Parameters.accept],
574
+ serializer
575
+ };
@@ -22,7 +22,10 @@ import {
22
22
  CustomLocationsCreateOrUpdateResponse,
23
23
  CustomLocationsDeleteOptionalParams,
24
24
  CustomLocationsUpdateOptionalParams,
25
- CustomLocationsUpdateResponse
25
+ CustomLocationsUpdateResponse,
26
+ CustomLocationFindTargetResourceGroupProperties,
27
+ CustomLocationsFindTargetResourceGroupOptionalParams,
28
+ CustomLocationsFindTargetResourceGroupResponse
26
29
  } from "../models";
27
30
 
28
31
  /// <reference lib="esnext.asynciterable" />
@@ -140,4 +143,18 @@ export interface CustomLocations {
140
143
  resourceName: string,
141
144
  options?: CustomLocationsUpdateOptionalParams
142
145
  ): Promise<CustomLocationsUpdateResponse>;
146
+ /**
147
+ * Returns the target resource group associated with the resource sync rules of the Custom Location
148
+ * that match the rules passed in with the Find Target Resource Group Request.
149
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
150
+ * @param resourceName Custom Locations name.
151
+ * @param parameters Parameters of the find target resource group request.
152
+ * @param options The options parameters.
153
+ */
154
+ findTargetResourceGroup(
155
+ resourceGroupName: string,
156
+ resourceName: string,
157
+ parameters: CustomLocationFindTargetResourceGroupProperties,
158
+ options?: CustomLocationsFindTargetResourceGroupOptionalParams
159
+ ): Promise<CustomLocationsFindTargetResourceGroupResponse>;
143
160
  }
@@ -7,3 +7,4 @@
7
7
  */
8
8
 
9
9
  export * from "./customLocations";
10
+ export * from "./resourceSyncRules";