@azure/arm-privatedns 3.1.1-alpha.20230502.1 → 3.2.0-alpha.20230522.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 (84) hide show
  1. package/CHANGELOG.md +14 -11
  2. package/LICENSE +1 -1
  3. package/dist/index.js +81 -73
  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/privateZonesCreateOrUpdateSample.js +10 -3
  8. package/dist-esm/samples-dev/privateZonesCreateOrUpdateSample.js.map +1 -1
  9. package/dist-esm/samples-dev/privateZonesDeleteSample.js +10 -3
  10. package/dist-esm/samples-dev/privateZonesDeleteSample.js.map +1 -1
  11. package/dist-esm/samples-dev/privateZonesGetSample.js +10 -3
  12. package/dist-esm/samples-dev/privateZonesGetSample.js.map +1 -1
  13. package/dist-esm/samples-dev/privateZonesListByResourceGroupSample.js +10 -3
  14. package/dist-esm/samples-dev/privateZonesListByResourceGroupSample.js.map +1 -1
  15. package/dist-esm/samples-dev/privateZonesListSample.js +9 -2
  16. package/dist-esm/samples-dev/privateZonesListSample.js.map +1 -1
  17. package/dist-esm/samples-dev/privateZonesUpdateSample.js +10 -3
  18. package/dist-esm/samples-dev/privateZonesUpdateSample.js.map +1 -1
  19. package/dist-esm/samples-dev/recordSetsCreateOrUpdateSample.js +31 -24
  20. package/dist-esm/samples-dev/recordSetsCreateOrUpdateSample.js.map +1 -1
  21. package/dist-esm/samples-dev/recordSetsDeleteSample.js +28 -21
  22. package/dist-esm/samples-dev/recordSetsDeleteSample.js.map +1 -1
  23. package/dist-esm/samples-dev/recordSetsGetSample.js +31 -24
  24. package/dist-esm/samples-dev/recordSetsGetSample.js.map +1 -1
  25. package/dist-esm/samples-dev/recordSetsListByTypeSample.js +31 -24
  26. package/dist-esm/samples-dev/recordSetsListByTypeSample.js.map +1 -1
  27. package/dist-esm/samples-dev/recordSetsListSample.js +10 -3
  28. package/dist-esm/samples-dev/recordSetsListSample.js.map +1 -1
  29. package/dist-esm/samples-dev/recordSetsUpdateSample.js +31 -24
  30. package/dist-esm/samples-dev/recordSetsUpdateSample.js.map +1 -1
  31. package/dist-esm/samples-dev/virtualNetworkLinksCreateOrUpdateSample.js +10 -3
  32. package/dist-esm/samples-dev/virtualNetworkLinksCreateOrUpdateSample.js.map +1 -1
  33. package/dist-esm/samples-dev/virtualNetworkLinksDeleteSample.js +10 -3
  34. package/dist-esm/samples-dev/virtualNetworkLinksDeleteSample.js.map +1 -1
  35. package/dist-esm/samples-dev/virtualNetworkLinksGetSample.js +10 -3
  36. package/dist-esm/samples-dev/virtualNetworkLinksGetSample.js.map +1 -1
  37. package/dist-esm/samples-dev/virtualNetworkLinksListSample.js +10 -3
  38. package/dist-esm/samples-dev/virtualNetworkLinksListSample.js.map +1 -1
  39. package/dist-esm/samples-dev/virtualNetworkLinksUpdateSample.js +10 -3
  40. package/dist-esm/samples-dev/virtualNetworkLinksUpdateSample.js.map +1 -1
  41. package/dist-esm/src/lroImpl.d.ts +6 -11
  42. package/dist-esm/src/lroImpl.d.ts.map +1 -1
  43. package/dist-esm/src/lroImpl.js +12 -20
  44. package/dist-esm/src/lroImpl.js.map +1 -1
  45. package/dist-esm/src/models/index.d.ts +0 -14
  46. package/dist-esm/src/models/index.d.ts.map +1 -1
  47. package/dist-esm/src/operations/privateZones.d.ts +4 -4
  48. package/dist-esm/src/operations/privateZones.d.ts.map +1 -1
  49. package/dist-esm/src/operations/privateZones.js +26 -16
  50. package/dist-esm/src/operations/privateZones.js.map +1 -1
  51. package/dist-esm/src/operations/recordSets.js +0 -10
  52. package/dist-esm/src/operations/recordSets.js.map +1 -1
  53. package/dist-esm/src/operations/virtualNetworkLinks.d.ts +4 -4
  54. package/dist-esm/src/operations/virtualNetworkLinks.d.ts.map +1 -1
  55. package/dist-esm/src/operations/virtualNetworkLinks.js +43 -27
  56. package/dist-esm/src/operations/virtualNetworkLinks.js.map +1 -1
  57. package/dist-esm/src/operationsInterfaces/privateZones.d.ts +4 -4
  58. package/dist-esm/src/operationsInterfaces/privateZones.d.ts.map +1 -1
  59. package/dist-esm/src/operationsInterfaces/virtualNetworkLinks.d.ts +4 -4
  60. package/dist-esm/src/operationsInterfaces/virtualNetworkLinks.d.ts.map +1 -1
  61. package/dist-esm/src/pagingHelper.d.ts +4 -4
  62. package/dist-esm/src/pagingHelper.js +4 -4
  63. package/dist-esm/src/privateDnsManagementClient.js +1 -1
  64. package/dist-esm/test/privatedns_operations_test.spec.d.ts +4 -0
  65. package/dist-esm/test/privatedns_operations_test.spec.d.ts.map +1 -0
  66. package/dist-esm/test/privatedns_operations_test.spec.js +121 -0
  67. package/dist-esm/test/privatedns_operations_test.spec.js.map +1 -0
  68. package/package.json +6 -5
  69. package/review/arm-privatedns.api.md +8 -15
  70. package/src/lroImpl.ts +31 -23
  71. package/src/models/index.ts +5 -24
  72. package/src/operations/privateZones.ts +41 -33
  73. package/src/operations/recordSets.ts +0 -10
  74. package/src/operations/virtualNetworkLinks.ts +46 -32
  75. package/src/operationsInterfaces/privateZones.ts +6 -6
  76. package/src/operationsInterfaces/virtualNetworkLinks.ts +6 -6
  77. package/src/pagingHelper.ts +4 -4
  78. package/src/privateDnsManagementClient.ts +1 -1
  79. package/types/arm-privatedns.d.ts +12 -26
  80. package/types/tsdoc-metadata.json +1 -1
  81. package/dist-esm/test/sampleTest.d.ts +0 -2
  82. package/dist-esm/test/sampleTest.d.ts.map +0 -1
  83. package/dist-esm/test/sampleTest.js +0 -38
  84. package/dist-esm/test/sampleTest.js.map +0 -1
package/src/lroImpl.ts CHANGED
@@ -6,29 +6,37 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
+ // Copyright (c) Microsoft Corporation.
10
+ // Licensed under the MIT license.
11
+
12
+ import { AbortSignalLike } from "@azure/abort-controller";
9
13
  import { LongRunningOperation, LroResponse } from "@azure/core-lro";
10
14
 
11
- export class LroImpl<T> implements LongRunningOperation<T> {
12
- constructor(
13
- private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
14
- private args: Record<string, unknown>,
15
- private spec: {
16
- readonly requestBody?: unknown;
17
- readonly path?: string;
18
- readonly httpMethod: string;
19
- } & Record<string, any>,
20
- public requestPath: string = spec.path!,
21
- public requestMethod: string = spec.httpMethod
22
- ) {}
23
- public async sendInitialRequest(): Promise<LroResponse<T>> {
24
- return this.sendOperationFn(this.args, this.spec);
25
- }
26
- public async sendPollRequest(path: string): Promise<LroResponse<T>> {
27
- const { requestBody, ...restSpec } = this.spec;
28
- return this.sendOperationFn(this.args, {
29
- ...restSpec,
30
- path,
31
- httpMethod: "GET"
32
- });
33
- }
15
+ export function createLroSpec<T>(inputs: {
16
+ sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>;
17
+ args: Record<string, unknown>;
18
+ spec: {
19
+ readonly requestBody?: unknown;
20
+ readonly path?: string;
21
+ readonly httpMethod: string;
22
+ } & Record<string, any>;
23
+ }): LongRunningOperation<T> {
24
+ const { args, spec, sendOperationFn } = inputs;
25
+ return {
26
+ requestMethod: spec.httpMethod,
27
+ requestPath: spec.path!,
28
+ sendInitialRequest: () => sendOperationFn(args, spec),
29
+ sendPollRequest: (
30
+ path: string,
31
+ options?: { abortSignal?: AbortSignalLike }
32
+ ) => {
33
+ const { requestBody, ...restSpec } = spec;
34
+ return sendOperationFn(args, {
35
+ ...restSpec,
36
+ httpMethod: "GET",
37
+ path,
38
+ abortSignal: options?.abortSignal
39
+ });
40
+ }
41
+ };
34
42
  }
@@ -393,20 +393,14 @@ export type PrivateZonesListByResourceGroupResponse = PrivateZoneListResult;
393
393
 
394
394
  /** Optional parameters. */
395
395
  export interface PrivateZonesListNextOptionalParams
396
- extends coreClient.OperationOptions {
397
- /** The maximum number of Private DNS zones to return. If not specified, returns up to 100 zones. */
398
- top?: number;
399
- }
396
+ extends coreClient.OperationOptions {}
400
397
 
401
398
  /** Contains response data for the listNext operation. */
402
399
  export type PrivateZonesListNextResponse = PrivateZoneListResult;
403
400
 
404
401
  /** Optional parameters. */
405
402
  export interface PrivateZonesListByResourceGroupNextOptionalParams
406
- extends coreClient.OperationOptions {
407
- /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */
408
- top?: number;
409
- }
403
+ extends coreClient.OperationOptions {}
410
404
 
411
405
  /** Contains response data for the listByResourceGroupNext operation. */
412
406
  export type PrivateZonesListByResourceGroupNextResponse = PrivateZoneListResult;
@@ -471,10 +465,7 @@ export type VirtualNetworkLinksListResponse = VirtualNetworkLinkListResult;
471
465
 
472
466
  /** Optional parameters. */
473
467
  export interface VirtualNetworkLinksListNextOptionalParams
474
- extends coreClient.OperationOptions {
475
- /** The maximum number of virtual network links to return. If not specified, returns up to 100 virtual network links. */
476
- top?: number;
477
- }
468
+ extends coreClient.OperationOptions {}
478
469
 
479
470
  /** Contains response data for the listNext operation. */
480
471
  export type VirtualNetworkLinksListNextResponse = VirtualNetworkLinkListResult;
@@ -541,24 +532,14 @@ export type RecordSetsListResponse = RecordSetListResult;
541
532
 
542
533
  /** Optional parameters. */
543
534
  export interface RecordSetsListByTypeNextOptionalParams
544
- extends coreClient.OperationOptions {
545
- /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */
546
- top?: number;
547
- /** The suffix label of the record set name to be used to filter the record set enumeration. If this parameter is specified, the returned enumeration will only contain records that end with ".<recordsetnamesuffix>". */
548
- recordsetnamesuffix?: string;
549
- }
535
+ extends coreClient.OperationOptions {}
550
536
 
551
537
  /** Contains response data for the listByTypeNext operation. */
552
538
  export type RecordSetsListByTypeNextResponse = RecordSetListResult;
553
539
 
554
540
  /** Optional parameters. */
555
541
  export interface RecordSetsListNextOptionalParams
556
- extends coreClient.OperationOptions {
557
- /** The maximum number of record sets to return. If not specified, returns up to 100 record sets. */
558
- top?: number;
559
- /** The suffix label of the record set name to be used to filter the record set enumeration. If this parameter is specified, the returned enumeration will only contain records that end with ".<recordsetnamesuffix>". */
560
- recordsetnamesuffix?: string;
561
- }
542
+ extends coreClient.OperationOptions {}
562
543
 
563
544
  /** Contains response data for the listNext operation. */
564
545
  export type RecordSetsListNextResponse = RecordSetListResult;
@@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
13
13
  import * as Mappers from "../models/mappers";
14
14
  import * as Parameters from "../models/parameters";
15
15
  import { PrivateDnsManagementClient } from "../privateDnsManagementClient";
16
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
17
- import { LroImpl } from "../lroImpl";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
18
22
  import {
19
23
  PrivateZone,
20
24
  PrivateZonesListNextOptionalParams,
@@ -184,8 +188,8 @@ export class PrivateZonesImpl implements PrivateZones {
184
188
  parameters: PrivateZone,
185
189
  options?: PrivateZonesCreateOrUpdateOptionalParams
186
190
  ): Promise<
187
- PollerLike<
188
- PollOperationState<PrivateZonesCreateOrUpdateResponse>,
191
+ SimplePollerLike<
192
+ OperationState<PrivateZonesCreateOrUpdateResponse>,
189
193
  PrivateZonesCreateOrUpdateResponse
190
194
  >
191
195
  > {
@@ -195,7 +199,7 @@ export class PrivateZonesImpl implements PrivateZones {
195
199
  ): Promise<PrivateZonesCreateOrUpdateResponse> => {
196
200
  return this.client.sendOperationRequest(args, spec);
197
201
  };
198
- const sendOperation = async (
202
+ const sendOperationFn = async (
199
203
  args: coreClient.OperationArguments,
200
204
  spec: coreClient.OperationSpec
201
205
  ) => {
@@ -228,13 +232,16 @@ export class PrivateZonesImpl implements PrivateZones {
228
232
  };
229
233
  };
230
234
 
231
- const lro = new LroImpl(
232
- sendOperation,
233
- { resourceGroupName, privateZoneName, parameters, options },
234
- createOrUpdateOperationSpec
235
- );
236
- const poller = new LroEngine(lro, {
237
- resumeFrom: options?.resumeFrom,
235
+ const lro = createLroSpec({
236
+ sendOperationFn,
237
+ args: { resourceGroupName, privateZoneName, parameters, options },
238
+ spec: createOrUpdateOperationSpec
239
+ });
240
+ const poller = await createHttpPoller<
241
+ PrivateZonesCreateOrUpdateResponse,
242
+ OperationState<PrivateZonesCreateOrUpdateResponse>
243
+ >(lro, {
244
+ restoreFrom: options?.resumeFrom,
238
245
  intervalInMs: options?.updateIntervalInMs
239
246
  });
240
247
  await poller.poll();
@@ -277,8 +284,8 @@ export class PrivateZonesImpl implements PrivateZones {
277
284
  parameters: PrivateZone,
278
285
  options?: PrivateZonesUpdateOptionalParams
279
286
  ): Promise<
280
- PollerLike<
281
- PollOperationState<PrivateZonesUpdateResponse>,
287
+ SimplePollerLike<
288
+ OperationState<PrivateZonesUpdateResponse>,
282
289
  PrivateZonesUpdateResponse
283
290
  >
284
291
  > {
@@ -288,7 +295,7 @@ export class PrivateZonesImpl implements PrivateZones {
288
295
  ): Promise<PrivateZonesUpdateResponse> => {
289
296
  return this.client.sendOperationRequest(args, spec);
290
297
  };
291
- const sendOperation = async (
298
+ const sendOperationFn = async (
292
299
  args: coreClient.OperationArguments,
293
300
  spec: coreClient.OperationSpec
294
301
  ) => {
@@ -321,13 +328,16 @@ export class PrivateZonesImpl implements PrivateZones {
321
328
  };
322
329
  };
323
330
 
324
- const lro = new LroImpl(
325
- sendOperation,
326
- { resourceGroupName, privateZoneName, parameters, options },
327
- updateOperationSpec
328
- );
329
- const poller = new LroEngine(lro, {
330
- resumeFrom: options?.resumeFrom,
331
+ const lro = createLroSpec({
332
+ sendOperationFn,
333
+ args: { resourceGroupName, privateZoneName, parameters, options },
334
+ spec: updateOperationSpec
335
+ });
336
+ const poller = await createHttpPoller<
337
+ PrivateZonesUpdateResponse,
338
+ OperationState<PrivateZonesUpdateResponse>
339
+ >(lro, {
340
+ restoreFrom: options?.resumeFrom,
331
341
  intervalInMs: options?.updateIntervalInMs
332
342
  });
333
343
  await poller.poll();
@@ -368,14 +378,14 @@ export class PrivateZonesImpl implements PrivateZones {
368
378
  resourceGroupName: string,
369
379
  privateZoneName: string,
370
380
  options?: PrivateZonesDeleteOptionalParams
371
- ): Promise<PollerLike<PollOperationState<void>, void>> {
381
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
372
382
  const directSendOperation = async (
373
383
  args: coreClient.OperationArguments,
374
384
  spec: coreClient.OperationSpec
375
385
  ): Promise<void> => {
376
386
  return this.client.sendOperationRequest(args, spec);
377
387
  };
378
- const sendOperation = async (
388
+ const sendOperationFn = async (
379
389
  args: coreClient.OperationArguments,
380
390
  spec: coreClient.OperationSpec
381
391
  ) => {
@@ -408,13 +418,13 @@ export class PrivateZonesImpl implements PrivateZones {
408
418
  };
409
419
  };
410
420
 
411
- const lro = new LroImpl(
412
- sendOperation,
413
- { resourceGroupName, privateZoneName, options },
414
- deleteOperationSpec
415
- );
416
- const poller = new LroEngine(lro, {
417
- resumeFrom: options?.resumeFrom,
421
+ const lro = createLroSpec({
422
+ sendOperationFn,
423
+ args: { resourceGroupName, privateZoneName, options },
424
+ spec: deleteOperationSpec
425
+ });
426
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
427
+ restoreFrom: options?.resumeFrom,
418
428
  intervalInMs: options?.updateIntervalInMs
419
429
  });
420
430
  await poller.poll();
@@ -689,7 +699,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
689
699
  bodyMapper: Mappers.CloudError
690
700
  }
691
701
  },
692
- queryParameters: [Parameters.apiVersion, Parameters.top],
693
702
  urlParameters: [
694
703
  Parameters.$host,
695
704
  Parameters.subscriptionId,
@@ -709,7 +718,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
709
718
  bodyMapper: Mappers.CloudError
710
719
  }
711
720
  },
712
- queryParameters: [Parameters.apiVersion, Parameters.top],
713
721
  urlParameters: [
714
722
  Parameters.$host,
715
723
  Parameters.resourceGroupName,
@@ -589,11 +589,6 @@ const listByTypeNextOperationSpec: coreClient.OperationSpec = {
589
589
  bodyMapper: Mappers.CloudError
590
590
  }
591
591
  },
592
- queryParameters: [
593
- Parameters.apiVersion,
594
- Parameters.top,
595
- Parameters.recordsetnamesuffix
596
- ],
597
592
  urlParameters: [
598
593
  Parameters.$host,
599
594
  Parameters.resourceGroupName,
@@ -616,11 +611,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
616
611
  bodyMapper: Mappers.CloudError
617
612
  }
618
613
  },
619
- queryParameters: [
620
- Parameters.apiVersion,
621
- Parameters.top,
622
- Parameters.recordsetnamesuffix
623
- ],
624
614
  urlParameters: [
625
615
  Parameters.$host,
626
616
  Parameters.resourceGroupName,
@@ -13,8 +13,12 @@ import * as coreClient from "@azure/core-client";
13
13
  import * as Mappers from "../models/mappers";
14
14
  import * as Parameters from "../models/parameters";
15
15
  import { PrivateDnsManagementClient } from "../privateDnsManagementClient";
16
- import { PollerLike, PollOperationState, LroEngine } from "@azure/core-lro";
17
- import { LroImpl } from "../lroImpl";
16
+ import {
17
+ SimplePollerLike,
18
+ OperationState,
19
+ createHttpPoller
20
+ } from "@azure/core-lro";
21
+ import { createLroSpec } from "../lroImpl";
18
22
  import {
19
23
  VirtualNetworkLink,
20
24
  VirtualNetworkLinksListNextOptionalParams,
@@ -138,8 +142,8 @@ export class VirtualNetworkLinksImpl implements VirtualNetworkLinks {
138
142
  parameters: VirtualNetworkLink,
139
143
  options?: VirtualNetworkLinksCreateOrUpdateOptionalParams
140
144
  ): Promise<
141
- PollerLike<
142
- PollOperationState<VirtualNetworkLinksCreateOrUpdateResponse>,
145
+ SimplePollerLike<
146
+ OperationState<VirtualNetworkLinksCreateOrUpdateResponse>,
143
147
  VirtualNetworkLinksCreateOrUpdateResponse
144
148
  >
145
149
  > {
@@ -149,7 +153,7 @@ export class VirtualNetworkLinksImpl implements VirtualNetworkLinks {
149
153
  ): Promise<VirtualNetworkLinksCreateOrUpdateResponse> => {
150
154
  return this.client.sendOperationRequest(args, spec);
151
155
  };
152
- const sendOperation = async (
156
+ const sendOperationFn = async (
153
157
  args: coreClient.OperationArguments,
154
158
  spec: coreClient.OperationSpec
155
159
  ) => {
@@ -182,19 +186,22 @@ export class VirtualNetworkLinksImpl implements VirtualNetworkLinks {
182
186
  };
183
187
  };
184
188
 
185
- const lro = new LroImpl(
186
- sendOperation,
187
- {
189
+ const lro = createLroSpec({
190
+ sendOperationFn,
191
+ args: {
188
192
  resourceGroupName,
189
193
  privateZoneName,
190
194
  virtualNetworkLinkName,
191
195
  parameters,
192
196
  options
193
197
  },
194
- createOrUpdateOperationSpec
195
- );
196
- const poller = new LroEngine(lro, {
197
- resumeFrom: options?.resumeFrom,
198
+ spec: createOrUpdateOperationSpec
199
+ });
200
+ const poller = await createHttpPoller<
201
+ VirtualNetworkLinksCreateOrUpdateResponse,
202
+ OperationState<VirtualNetworkLinksCreateOrUpdateResponse>
203
+ >(lro, {
204
+ restoreFrom: options?.resumeFrom,
198
205
  intervalInMs: options?.updateIntervalInMs
199
206
  });
200
207
  await poller.poll();
@@ -241,8 +248,8 @@ export class VirtualNetworkLinksImpl implements VirtualNetworkLinks {
241
248
  parameters: VirtualNetworkLink,
242
249
  options?: VirtualNetworkLinksUpdateOptionalParams
243
250
  ): Promise<
244
- PollerLike<
245
- PollOperationState<VirtualNetworkLinksUpdateResponse>,
251
+ SimplePollerLike<
252
+ OperationState<VirtualNetworkLinksUpdateResponse>,
246
253
  VirtualNetworkLinksUpdateResponse
247
254
  >
248
255
  > {
@@ -252,7 +259,7 @@ export class VirtualNetworkLinksImpl implements VirtualNetworkLinks {
252
259
  ): Promise<VirtualNetworkLinksUpdateResponse> => {
253
260
  return this.client.sendOperationRequest(args, spec);
254
261
  };
255
- const sendOperation = async (
262
+ const sendOperationFn = async (
256
263
  args: coreClient.OperationArguments,
257
264
  spec: coreClient.OperationSpec
258
265
  ) => {
@@ -285,19 +292,22 @@ export class VirtualNetworkLinksImpl implements VirtualNetworkLinks {
285
292
  };
286
293
  };
287
294
 
288
- const lro = new LroImpl(
289
- sendOperation,
290
- {
295
+ const lro = createLroSpec({
296
+ sendOperationFn,
297
+ args: {
291
298
  resourceGroupName,
292
299
  privateZoneName,
293
300
  virtualNetworkLinkName,
294
301
  parameters,
295
302
  options
296
303
  },
297
- updateOperationSpec
298
- );
299
- const poller = new LroEngine(lro, {
300
- resumeFrom: options?.resumeFrom,
304
+ spec: updateOperationSpec
305
+ });
306
+ const poller = await createHttpPoller<
307
+ VirtualNetworkLinksUpdateResponse,
308
+ OperationState<VirtualNetworkLinksUpdateResponse>
309
+ >(lro, {
310
+ restoreFrom: options?.resumeFrom,
301
311
  intervalInMs: options?.updateIntervalInMs
302
312
  });
303
313
  await poller.poll();
@@ -343,14 +353,14 @@ export class VirtualNetworkLinksImpl implements VirtualNetworkLinks {
343
353
  privateZoneName: string,
344
354
  virtualNetworkLinkName: string,
345
355
  options?: VirtualNetworkLinksDeleteOptionalParams
346
- ): Promise<PollerLike<PollOperationState<void>, void>> {
356
+ ): Promise<SimplePollerLike<OperationState<void>, void>> {
347
357
  const directSendOperation = async (
348
358
  args: coreClient.OperationArguments,
349
359
  spec: coreClient.OperationSpec
350
360
  ): Promise<void> => {
351
361
  return this.client.sendOperationRequest(args, spec);
352
362
  };
353
- const sendOperation = async (
363
+ const sendOperationFn = async (
354
364
  args: coreClient.OperationArguments,
355
365
  spec: coreClient.OperationSpec
356
366
  ) => {
@@ -383,13 +393,18 @@ export class VirtualNetworkLinksImpl implements VirtualNetworkLinks {
383
393
  };
384
394
  };
385
395
 
386
- const lro = new LroImpl(
387
- sendOperation,
388
- { resourceGroupName, privateZoneName, virtualNetworkLinkName, options },
389
- deleteOperationSpec
390
- );
391
- const poller = new LroEngine(lro, {
392
- resumeFrom: options?.resumeFrom,
396
+ const lro = createLroSpec({
397
+ sendOperationFn,
398
+ args: {
399
+ resourceGroupName,
400
+ privateZoneName,
401
+ virtualNetworkLinkName,
402
+ options
403
+ },
404
+ spec: deleteOperationSpec
405
+ });
406
+ const poller = await createHttpPoller<void, OperationState<void>>(lro, {
407
+ restoreFrom: options?.resumeFrom,
393
408
  intervalInMs: options?.updateIntervalInMs
394
409
  });
395
410
  await poller.poll();
@@ -635,7 +650,6 @@ const listNextOperationSpec: coreClient.OperationSpec = {
635
650
  bodyMapper: Mappers.CloudError
636
651
  }
637
652
  },
638
- queryParameters: [Parameters.apiVersion, Parameters.top],
639
653
  urlParameters: [
640
654
  Parameters.$host,
641
655
  Parameters.resourceGroupName,
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
- import { PollerLike, PollOperationState } from "@azure/core-lro";
10
+ import { SimplePollerLike, OperationState } from "@azure/core-lro";
11
11
  import {
12
12
  PrivateZone,
13
13
  PrivateZonesListOptionalParams,
@@ -54,8 +54,8 @@ export interface PrivateZones {
54
54
  parameters: PrivateZone,
55
55
  options?: PrivateZonesCreateOrUpdateOptionalParams
56
56
  ): Promise<
57
- PollerLike<
58
- PollOperationState<PrivateZonesCreateOrUpdateResponse>,
57
+ SimplePollerLike<
58
+ OperationState<PrivateZonesCreateOrUpdateResponse>,
59
59
  PrivateZonesCreateOrUpdateResponse
60
60
  >
61
61
  >;
@@ -86,8 +86,8 @@ export interface PrivateZones {
86
86
  parameters: PrivateZone,
87
87
  options?: PrivateZonesUpdateOptionalParams
88
88
  ): Promise<
89
- PollerLike<
90
- PollOperationState<PrivateZonesUpdateResponse>,
89
+ SimplePollerLike<
90
+ OperationState<PrivateZonesUpdateResponse>,
91
91
  PrivateZonesUpdateResponse
92
92
  >
93
93
  >;
@@ -116,7 +116,7 @@ export interface PrivateZones {
116
116
  resourceGroupName: string,
117
117
  privateZoneName: string,
118
118
  options?: PrivateZonesDeleteOptionalParams
119
- ): Promise<PollerLike<PollOperationState<void>, void>>;
119
+ ): Promise<SimplePollerLike<OperationState<void>, void>>;
120
120
  /**
121
121
  * Deletes a Private DNS zone. WARNING: All DNS records in the zone will also be deleted. This
122
122
  * operation cannot be undone. Private DNS zone cannot be deleted unless all virtual network links to
@@ -7,7 +7,7 @@
7
7
  */
8
8
 
9
9
  import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
- import { PollerLike, PollOperationState } from "@azure/core-lro";
10
+ import { SimplePollerLike, OperationState } from "@azure/core-lro";
11
11
  import {
12
12
  VirtualNetworkLink,
13
13
  VirtualNetworkLinksListOptionalParams,
@@ -49,8 +49,8 @@ export interface VirtualNetworkLinks {
49
49
  parameters: VirtualNetworkLink,
50
50
  options?: VirtualNetworkLinksCreateOrUpdateOptionalParams
51
51
  ): Promise<
52
- PollerLike<
53
- PollOperationState<VirtualNetworkLinksCreateOrUpdateResponse>,
52
+ SimplePollerLike<
53
+ OperationState<VirtualNetworkLinksCreateOrUpdateResponse>,
54
54
  VirtualNetworkLinksCreateOrUpdateResponse
55
55
  >
56
56
  >;
@@ -84,8 +84,8 @@ export interface VirtualNetworkLinks {
84
84
  parameters: VirtualNetworkLink,
85
85
  options?: VirtualNetworkLinksUpdateOptionalParams
86
86
  ): Promise<
87
- PollerLike<
88
- PollOperationState<VirtualNetworkLinksUpdateResponse>,
87
+ SimplePollerLike<
88
+ OperationState<VirtualNetworkLinksUpdateResponse>,
89
89
  VirtualNetworkLinksUpdateResponse
90
90
  >
91
91
  >;
@@ -118,7 +118,7 @@ export interface VirtualNetworkLinks {
118
118
  privateZoneName: string,
119
119
  virtualNetworkLinkName: string,
120
120
  options?: VirtualNetworkLinksDeleteOptionalParams
121
- ): Promise<PollerLike<PollOperationState<void>, void>>;
121
+ ): Promise<SimplePollerLike<OperationState<void>, void>>;
122
122
  /**
123
123
  * Deletes a virtual network link to the specified Private DNS zone. WARNING: In case of a registration
124
124
  * virtual network, all auto-registered DNS records in the zone for the virtual network will also be
@@ -13,11 +13,11 @@ export interface PageInfo {
13
13
  const pageMap = new WeakMap<object, PageInfo>();
14
14
 
15
15
  /**
16
- * Given a result page from a pageable operation, returns a
17
- * continuation token that can be used to begin paging from
16
+ * Given the last `.value` produced by the `byPage` iterator,
17
+ * returns a continuation token that can be used to begin paging from
18
18
  * that point later.
19
- * @param page A result object from calling .byPage() on a paged operation.
20
- * @returns The continuation token that can be passed into byPage().
19
+ * @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
20
+ * @returns The continuation token that can be passed into byPage() during future calls.
21
21
  */
22
22
  export function getContinuationToken(page: unknown): string | undefined {
23
23
  if (typeof page !== "object" || page === null) {
@@ -59,7 +59,7 @@ export class PrivateDnsManagementClient extends coreClient.ServiceClient {
59
59
  credential: credentials
60
60
  };
61
61
 
62
- const packageDetails = `azsdk-js-arm-privatedns/3.1.1`;
62
+ const packageDetails = `azsdk-js-arm-privatedns/3.2.0`;
63
63
  const userAgentPrefix =
64
64
  options.userAgentOptions && options.userAgentOptions.userAgentPrefix
65
65
  ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`