@azure/arm-datadog 3.0.1 → 3.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +1 -1
  3. package/dist/index.js +291 -89
  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/src/index.d.ts +1 -0
  8. package/dist-esm/src/index.d.ts.map +1 -1
  9. package/dist-esm/src/index.js +1 -0
  10. package/dist-esm/src/index.js.map +1 -1
  11. package/dist-esm/src/microsoftDatadogClient.d.ts +2 -0
  12. package/dist-esm/src/microsoftDatadogClient.d.ts.map +1 -1
  13. package/dist-esm/src/microsoftDatadogClient.js +49 -18
  14. package/dist-esm/src/microsoftDatadogClient.js.map +1 -1
  15. package/dist-esm/src/models/index.d.ts +29 -0
  16. package/dist-esm/src/models/index.d.ts.map +1 -1
  17. package/dist-esm/src/models/index.js +29 -0
  18. package/dist-esm/src/models/index.js.map +1 -1
  19. package/dist-esm/src/operations/marketplaceAgreements.d.ts.map +1 -1
  20. package/dist-esm/src/operations/marketplaceAgreements.js +19 -7
  21. package/dist-esm/src/operations/marketplaceAgreements.js.map +1 -1
  22. package/dist-esm/src/operations/monitors.d.ts.map +1 -1
  23. package/dist-esm/src/operations/monitors.js +109 -42
  24. package/dist-esm/src/operations/monitors.js.map +1 -1
  25. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  26. package/dist-esm/src/operations/operations.js +19 -7
  27. package/dist-esm/src/operations/operations.js.map +1 -1
  28. package/dist-esm/src/operations/singleSignOnConfigurations.d.ts.map +1 -1
  29. package/dist-esm/src/operations/singleSignOnConfigurations.js +19 -7
  30. package/dist-esm/src/operations/singleSignOnConfigurations.js.map +1 -1
  31. package/dist-esm/src/operations/tagRules.d.ts.map +1 -1
  32. package/dist-esm/src/operations/tagRules.js +19 -7
  33. package/dist-esm/src/operations/tagRules.js.map +1 -1
  34. package/dist-esm/src/pagingHelper.d.ts +13 -0
  35. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  36. package/dist-esm/src/pagingHelper.js +32 -0
  37. package/dist-esm/src/pagingHelper.js.map +1 -0
  38. package/dist-esm/test/sampleTest.js +11 -13
  39. package/dist-esm/test/sampleTest.js.map +1 -1
  40. package/package.json +15 -11
  41. package/review/arm-datadog.api.md +3 -29
  42. package/src/index.ts +1 -0
  43. package/src/microsoftDatadogClient.ts +60 -20
  44. package/src/models/index.ts +29 -0
  45. package/src/operations/marketplaceAgreements.ts +21 -8
  46. package/src/operations/monitors.ts +138 -61
  47. package/src/operations/operations.ts +21 -8
  48. package/src/operations/singleSignOnConfigurations.ts +26 -8
  49. package/src/operations/tagRules.ts +26 -8
  50. package/src/pagingHelper.ts +39 -0
  51. package/types/arm-datadog.d.ts +40 -0
  52. package/types/tsdoc-metadata.json +1 -1
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Monitors } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,29 +19,29 @@ import {
18
19
  DatadogApiKey,
19
20
  MonitorsListApiKeysNextOptionalParams,
20
21
  MonitorsListApiKeysOptionalParams,
22
+ MonitorsListApiKeysResponse,
21
23
  DatadogHost,
22
24
  MonitorsListHostsNextOptionalParams,
23
25
  MonitorsListHostsOptionalParams,
26
+ MonitorsListHostsResponse,
24
27
  LinkedResource,
25
28
  MonitorsListLinkedResourcesNextOptionalParams,
26
29
  MonitorsListLinkedResourcesOptionalParams,
30
+ MonitorsListLinkedResourcesResponse,
27
31
  MonitoredResource,
28
32
  MonitorsListMonitoredResourcesNextOptionalParams,
29
33
  MonitorsListMonitoredResourcesOptionalParams,
34
+ MonitorsListMonitoredResourcesResponse,
30
35
  DatadogMonitorResource,
31
36
  MonitorsListNextOptionalParams,
32
37
  MonitorsListOptionalParams,
38
+ MonitorsListResponse,
33
39
  MonitorsListByResourceGroupNextOptionalParams,
34
40
  MonitorsListByResourceGroupOptionalParams,
35
- MonitorsListApiKeysResponse,
41
+ MonitorsListByResourceGroupResponse,
36
42
  MonitorsGetDefaultKeyOptionalParams,
37
43
  MonitorsGetDefaultKeyResponse,
38
44
  MonitorsSetDefaultKeyOptionalParams,
39
- MonitorsListHostsResponse,
40
- MonitorsListLinkedResourcesResponse,
41
- MonitorsListMonitoredResourcesResponse,
42
- MonitorsListResponse,
43
- MonitorsListByResourceGroupResponse,
44
45
  MonitorsGetOptionalParams,
45
46
  MonitorsGetResponse,
46
47
  MonitorsCreateOptionalParams,
@@ -94,11 +95,15 @@ export class MonitorsImpl implements Monitors {
94
95
  [Symbol.asyncIterator]() {
95
96
  return this;
96
97
  },
97
- byPage: () => {
98
+ byPage: (settings?: PageSettings) => {
99
+ if (settings?.maxPageSize) {
100
+ throw new Error("maxPageSize is not supported by this operation.");
101
+ }
98
102
  return this.listApiKeysPagingPage(
99
103
  resourceGroupName,
100
104
  monitorName,
101
- options
105
+ options,
106
+ settings
102
107
  );
103
108
  }
104
109
  };
@@ -107,15 +112,18 @@ export class MonitorsImpl implements Monitors {
107
112
  private async *listApiKeysPagingPage(
108
113
  resourceGroupName: string,
109
114
  monitorName: string,
110
- options?: MonitorsListApiKeysOptionalParams
115
+ options?: MonitorsListApiKeysOptionalParams,
116
+ settings?: PageSettings
111
117
  ): AsyncIterableIterator<DatadogApiKey[]> {
112
- let result = await this._listApiKeys(
113
- resourceGroupName,
114
- monitorName,
115
- options
116
- );
117
- yield result.value || [];
118
- let continuationToken = result.nextLink;
118
+ let result: MonitorsListApiKeysResponse;
119
+ let continuationToken = settings?.continuationToken;
120
+ if (!continuationToken) {
121
+ result = await this._listApiKeys(resourceGroupName, monitorName, options);
122
+ let page = result.value || [];
123
+ continuationToken = result.nextLink;
124
+ setContinuationToken(page, continuationToken);
125
+ yield page;
126
+ }
119
127
  while (continuationToken) {
120
128
  result = await this._listApiKeysNext(
121
129
  resourceGroupName,
@@ -124,7 +132,9 @@ export class MonitorsImpl implements Monitors {
124
132
  options
125
133
  );
126
134
  continuationToken = result.nextLink;
127
- yield result.value || [];
135
+ let page = result.value || [];
136
+ setContinuationToken(page, continuationToken);
137
+ yield page;
128
138
  }
129
139
  }
130
140
 
@@ -165,11 +175,15 @@ export class MonitorsImpl implements Monitors {
165
175
  [Symbol.asyncIterator]() {
166
176
  return this;
167
177
  },
168
- byPage: () => {
178
+ byPage: (settings?: PageSettings) => {
179
+ if (settings?.maxPageSize) {
180
+ throw new Error("maxPageSize is not supported by this operation.");
181
+ }
169
182
  return this.listHostsPagingPage(
170
183
  resourceGroupName,
171
184
  monitorName,
172
- options
185
+ options,
186
+ settings
173
187
  );
174
188
  }
175
189
  };
@@ -178,11 +192,18 @@ export class MonitorsImpl implements Monitors {
178
192
  private async *listHostsPagingPage(
179
193
  resourceGroupName: string,
180
194
  monitorName: string,
181
- options?: MonitorsListHostsOptionalParams
195
+ options?: MonitorsListHostsOptionalParams,
196
+ settings?: PageSettings
182
197
  ): AsyncIterableIterator<DatadogHost[]> {
183
- let result = await this._listHosts(resourceGroupName, monitorName, options);
184
- yield result.value || [];
185
- let continuationToken = result.nextLink;
198
+ let result: MonitorsListHostsResponse;
199
+ let continuationToken = settings?.continuationToken;
200
+ if (!continuationToken) {
201
+ result = await this._listHosts(resourceGroupName, monitorName, options);
202
+ let page = result.value || [];
203
+ continuationToken = result.nextLink;
204
+ setContinuationToken(page, continuationToken);
205
+ yield page;
206
+ }
186
207
  while (continuationToken) {
187
208
  result = await this._listHostsNext(
188
209
  resourceGroupName,
@@ -191,7 +212,9 @@ export class MonitorsImpl implements Monitors {
191
212
  options
192
213
  );
193
214
  continuationToken = result.nextLink;
194
- yield result.value || [];
215
+ let page = result.value || [];
216
+ setContinuationToken(page, continuationToken);
217
+ yield page;
195
218
  }
196
219
  }
197
220
 
@@ -232,11 +255,15 @@ export class MonitorsImpl implements Monitors {
232
255
  [Symbol.asyncIterator]() {
233
256
  return this;
234
257
  },
235
- byPage: () => {
258
+ byPage: (settings?: PageSettings) => {
259
+ if (settings?.maxPageSize) {
260
+ throw new Error("maxPageSize is not supported by this operation.");
261
+ }
236
262
  return this.listLinkedResourcesPagingPage(
237
263
  resourceGroupName,
238
264
  monitorName,
239
- options
265
+ options,
266
+ settings
240
267
  );
241
268
  }
242
269
  };
@@ -245,15 +272,22 @@ export class MonitorsImpl implements Monitors {
245
272
  private async *listLinkedResourcesPagingPage(
246
273
  resourceGroupName: string,
247
274
  monitorName: string,
248
- options?: MonitorsListLinkedResourcesOptionalParams
275
+ options?: MonitorsListLinkedResourcesOptionalParams,
276
+ settings?: PageSettings
249
277
  ): AsyncIterableIterator<LinkedResource[]> {
250
- let result = await this._listLinkedResources(
251
- resourceGroupName,
252
- monitorName,
253
- options
254
- );
255
- yield result.value || [];
256
- let continuationToken = result.nextLink;
278
+ let result: MonitorsListLinkedResourcesResponse;
279
+ let continuationToken = settings?.continuationToken;
280
+ if (!continuationToken) {
281
+ result = await this._listLinkedResources(
282
+ resourceGroupName,
283
+ monitorName,
284
+ options
285
+ );
286
+ let page = result.value || [];
287
+ continuationToken = result.nextLink;
288
+ setContinuationToken(page, continuationToken);
289
+ yield page;
290
+ }
257
291
  while (continuationToken) {
258
292
  result = await this._listLinkedResourcesNext(
259
293
  resourceGroupName,
@@ -262,7 +296,9 @@ export class MonitorsImpl implements Monitors {
262
296
  options
263
297
  );
264
298
  continuationToken = result.nextLink;
265
- yield result.value || [];
299
+ let page = result.value || [];
300
+ setContinuationToken(page, continuationToken);
301
+ yield page;
266
302
  }
267
303
  }
268
304
 
@@ -303,11 +339,15 @@ export class MonitorsImpl implements Monitors {
303
339
  [Symbol.asyncIterator]() {
304
340
  return this;
305
341
  },
306
- byPage: () => {
342
+ byPage: (settings?: PageSettings) => {
343
+ if (settings?.maxPageSize) {
344
+ throw new Error("maxPageSize is not supported by this operation.");
345
+ }
307
346
  return this.listMonitoredResourcesPagingPage(
308
347
  resourceGroupName,
309
348
  monitorName,
310
- options
349
+ options,
350
+ settings
311
351
  );
312
352
  }
313
353
  };
@@ -316,15 +356,22 @@ export class MonitorsImpl implements Monitors {
316
356
  private async *listMonitoredResourcesPagingPage(
317
357
  resourceGroupName: string,
318
358
  monitorName: string,
319
- options?: MonitorsListMonitoredResourcesOptionalParams
359
+ options?: MonitorsListMonitoredResourcesOptionalParams,
360
+ settings?: PageSettings
320
361
  ): AsyncIterableIterator<MonitoredResource[]> {
321
- let result = await this._listMonitoredResources(
322
- resourceGroupName,
323
- monitorName,
324
- options
325
- );
326
- yield result.value || [];
327
- let continuationToken = result.nextLink;
362
+ let result: MonitorsListMonitoredResourcesResponse;
363
+ let continuationToken = settings?.continuationToken;
364
+ if (!continuationToken) {
365
+ result = await this._listMonitoredResources(
366
+ resourceGroupName,
367
+ monitorName,
368
+ options
369
+ );
370
+ let page = result.value || [];
371
+ continuationToken = result.nextLink;
372
+ setContinuationToken(page, continuationToken);
373
+ yield page;
374
+ }
328
375
  while (continuationToken) {
329
376
  result = await this._listMonitoredResourcesNext(
330
377
  resourceGroupName,
@@ -333,7 +380,9 @@ export class MonitorsImpl implements Monitors {
333
380
  options
334
381
  );
335
382
  continuationToken = result.nextLink;
336
- yield result.value || [];
383
+ let page = result.value || [];
384
+ setContinuationToken(page, continuationToken);
385
+ yield page;
337
386
  }
338
387
  }
339
388
 
@@ -366,22 +415,34 @@ export class MonitorsImpl implements Monitors {
366
415
  [Symbol.asyncIterator]() {
367
416
  return this;
368
417
  },
369
- byPage: () => {
370
- return this.listPagingPage(options);
418
+ byPage: (settings?: PageSettings) => {
419
+ if (settings?.maxPageSize) {
420
+ throw new Error("maxPageSize is not supported by this operation.");
421
+ }
422
+ return this.listPagingPage(options, settings);
371
423
  }
372
424
  };
373
425
  }
374
426
 
375
427
  private async *listPagingPage(
376
- options?: MonitorsListOptionalParams
428
+ options?: MonitorsListOptionalParams,
429
+ settings?: PageSettings
377
430
  ): AsyncIterableIterator<DatadogMonitorResource[]> {
378
- let result = await this._list(options);
379
- yield result.value || [];
380
- let continuationToken = result.nextLink;
431
+ let result: MonitorsListResponse;
432
+ let continuationToken = settings?.continuationToken;
433
+ if (!continuationToken) {
434
+ result = await this._list(options);
435
+ let page = result.value || [];
436
+ continuationToken = result.nextLink;
437
+ setContinuationToken(page, continuationToken);
438
+ yield page;
439
+ }
381
440
  while (continuationToken) {
382
441
  result = await this._listNext(continuationToken, options);
383
442
  continuationToken = result.nextLink;
384
- yield result.value || [];
443
+ let page = result.value || [];
444
+ setContinuationToken(page, continuationToken);
445
+ yield page;
385
446
  }
386
447
  }
387
448
 
@@ -410,19 +471,33 @@ export class MonitorsImpl implements Monitors {
410
471
  [Symbol.asyncIterator]() {
411
472
  return this;
412
473
  },
413
- byPage: () => {
414
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
474
+ byPage: (settings?: PageSettings) => {
475
+ if (settings?.maxPageSize) {
476
+ throw new Error("maxPageSize is not supported by this operation.");
477
+ }
478
+ return this.listByResourceGroupPagingPage(
479
+ resourceGroupName,
480
+ options,
481
+ settings
482
+ );
415
483
  }
416
484
  };
417
485
  }
418
486
 
419
487
  private async *listByResourceGroupPagingPage(
420
488
  resourceGroupName: string,
421
- options?: MonitorsListByResourceGroupOptionalParams
489
+ options?: MonitorsListByResourceGroupOptionalParams,
490
+ settings?: PageSettings
422
491
  ): AsyncIterableIterator<DatadogMonitorResource[]> {
423
- let result = await this._listByResourceGroup(resourceGroupName, options);
424
- yield result.value || [];
425
- let continuationToken = result.nextLink;
492
+ let result: MonitorsListByResourceGroupResponse;
493
+ let continuationToken = settings?.continuationToken;
494
+ if (!continuationToken) {
495
+ result = await this._listByResourceGroup(resourceGroupName, options);
496
+ let page = result.value || [];
497
+ continuationToken = result.nextLink;
498
+ setContinuationToken(page, continuationToken);
499
+ yield page;
500
+ }
426
501
  while (continuationToken) {
427
502
  result = await this._listByResourceGroupNext(
428
503
  resourceGroupName,
@@ -430,7 +505,9 @@ export class MonitorsImpl implements Monitors {
430
505
  options
431
506
  );
432
507
  continuationToken = result.nextLink;
433
- yield result.value || [];
508
+ let page = result.value || [];
509
+ setContinuationToken(page, continuationToken);
510
+ yield page;
434
511
  }
435
512
  }
436
513
 
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { Operations } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -48,22 +49,34 @@ export class OperationsImpl implements Operations {
48
49
  [Symbol.asyncIterator]() {
49
50
  return this;
50
51
  },
51
- byPage: () => {
52
- return this.listPagingPage(options);
52
+ byPage: (settings?: PageSettings) => {
53
+ if (settings?.maxPageSize) {
54
+ throw new Error("maxPageSize is not supported by this operation.");
55
+ }
56
+ return this.listPagingPage(options, settings);
53
57
  }
54
58
  };
55
59
  }
56
60
 
57
61
  private async *listPagingPage(
58
- options?: OperationsListOptionalParams
62
+ options?: OperationsListOptionalParams,
63
+ settings?: PageSettings
59
64
  ): AsyncIterableIterator<OperationResult[]> {
60
- let result = await this._list(options);
61
- yield result.value || [];
62
- let continuationToken = result.nextLink;
65
+ let result: OperationsListResponse;
66
+ let continuationToken = settings?.continuationToken;
67
+ if (!continuationToken) {
68
+ result = await this._list(options);
69
+ let page = result.value || [];
70
+ continuationToken = result.nextLink;
71
+ setContinuationToken(page, continuationToken);
72
+ yield page;
73
+ }
63
74
  while (continuationToken) {
64
75
  result = await this._listNext(continuationToken, options);
65
76
  continuationToken = result.nextLink;
66
- yield result.value || [];
77
+ let page = result.value || [];
78
+ setContinuationToken(page, continuationToken);
79
+ yield page;
67
80
  }
68
81
  }
69
82
 
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { SingleSignOnConfigurations } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -59,8 +60,16 @@ export class SingleSignOnConfigurationsImpl
59
60
  [Symbol.asyncIterator]() {
60
61
  return this;
61
62
  },
62
- byPage: () => {
63
- return this.listPagingPage(resourceGroupName, monitorName, options);
63
+ byPage: (settings?: PageSettings) => {
64
+ if (settings?.maxPageSize) {
65
+ throw new Error("maxPageSize is not supported by this operation.");
66
+ }
67
+ return this.listPagingPage(
68
+ resourceGroupName,
69
+ monitorName,
70
+ options,
71
+ settings
72
+ );
64
73
  }
65
74
  };
66
75
  }
@@ -68,11 +77,18 @@ export class SingleSignOnConfigurationsImpl
68
77
  private async *listPagingPage(
69
78
  resourceGroupName: string,
70
79
  monitorName: string,
71
- options?: SingleSignOnConfigurationsListOptionalParams
80
+ options?: SingleSignOnConfigurationsListOptionalParams,
81
+ settings?: PageSettings
72
82
  ): AsyncIterableIterator<DatadogSingleSignOnResource[]> {
73
- let result = await this._list(resourceGroupName, monitorName, options);
74
- yield result.value || [];
75
- let continuationToken = result.nextLink;
83
+ let result: SingleSignOnConfigurationsListResponse;
84
+ let continuationToken = settings?.continuationToken;
85
+ if (!continuationToken) {
86
+ result = await this._list(resourceGroupName, monitorName, options);
87
+ let page = result.value || [];
88
+ continuationToken = result.nextLink;
89
+ setContinuationToken(page, continuationToken);
90
+ yield page;
91
+ }
76
92
  while (continuationToken) {
77
93
  result = await this._listNext(
78
94
  resourceGroupName,
@@ -81,7 +97,9 @@ export class SingleSignOnConfigurationsImpl
81
97
  options
82
98
  );
83
99
  continuationToken = result.nextLink;
84
- yield result.value || [];
100
+ let page = result.value || [];
101
+ setContinuationToken(page, continuationToken);
102
+ yield page;
85
103
  }
86
104
  }
87
105
 
@@ -6,7 +6,8 @@
6
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
7
7
  */
8
8
 
9
- import { PagedAsyncIterableIterator } from "@azure/core-paging";
9
+ import { PagedAsyncIterableIterator, PageSettings } from "@azure/core-paging";
10
+ import { setContinuationToken } from "../pagingHelper";
10
11
  import { TagRules } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -56,8 +57,16 @@ export class TagRulesImpl implements TagRules {
56
57
  [Symbol.asyncIterator]() {
57
58
  return this;
58
59
  },
59
- byPage: () => {
60
- return this.listPagingPage(resourceGroupName, monitorName, options);
60
+ byPage: (settings?: PageSettings) => {
61
+ if (settings?.maxPageSize) {
62
+ throw new Error("maxPageSize is not supported by this operation.");
63
+ }
64
+ return this.listPagingPage(
65
+ resourceGroupName,
66
+ monitorName,
67
+ options,
68
+ settings
69
+ );
61
70
  }
62
71
  };
63
72
  }
@@ -65,11 +74,18 @@ export class TagRulesImpl implements TagRules {
65
74
  private async *listPagingPage(
66
75
  resourceGroupName: string,
67
76
  monitorName: string,
68
- options?: TagRulesListOptionalParams
77
+ options?: TagRulesListOptionalParams,
78
+ settings?: PageSettings
69
79
  ): AsyncIterableIterator<MonitoringTagRules[]> {
70
- let result = await this._list(resourceGroupName, monitorName, options);
71
- yield result.value || [];
72
- let continuationToken = result.nextLink;
80
+ let result: TagRulesListResponse;
81
+ let continuationToken = settings?.continuationToken;
82
+ if (!continuationToken) {
83
+ result = await this._list(resourceGroupName, monitorName, options);
84
+ let page = result.value || [];
85
+ continuationToken = result.nextLink;
86
+ setContinuationToken(page, continuationToken);
87
+ yield page;
88
+ }
73
89
  while (continuationToken) {
74
90
  result = await this._listNext(
75
91
  resourceGroupName,
@@ -78,7 +94,9 @@ export class TagRulesImpl implements TagRules {
78
94
  options
79
95
  );
80
96
  continuationToken = result.nextLink;
81
- yield result.value || [];
97
+ let page = result.value || [];
98
+ setContinuationToken(page, continuationToken);
99
+ yield page;
82
100
  }
83
101
  }
84
102
 
@@ -0,0 +1,39 @@
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
+ export interface PageInfo {
10
+ continuationToken?: string;
11
+ }
12
+
13
+ const pageMap = new WeakMap<object, PageInfo>();
14
+
15
+ /**
16
+ * Given a result page from a pageable operation, returns a
17
+ * continuation token that can be used to begin paging from
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().
21
+ */
22
+ export function getContinuationToken(page: unknown): string | undefined {
23
+ if (typeof page !== "object" || page === null) {
24
+ return undefined;
25
+ }
26
+ return pageMap.get(page)?.continuationToken;
27
+ }
28
+
29
+ export function setContinuationToken(
30
+ page: unknown,
31
+ continuationToken: string | undefined
32
+ ): void {
33
+ if (typeof page !== "object" || page === null || !continuationToken) {
34
+ return;
35
+ }
36
+ const pageInfo = pageMap.get(page) ?? {};
37
+ pageInfo.continuationToken = continuationToken;
38
+ pageMap.set(page, pageInfo);
39
+ }