@azure/arm-containerregistry 10.1.0-beta.3 → 10.1.0-beta.4

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 (92) hide show
  1. package/CHANGELOG.md +26 -8
  2. package/README.md +1 -1
  3. package/dist/index.js +512 -144
  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/containerRegistryManagementClient.d.ts.map +1 -1
  8. package/dist-esm/src/containerRegistryManagementClient.js +20 -18
  9. package/dist-esm/src/containerRegistryManagementClient.js.map +1 -1
  10. package/dist-esm/src/index.d.ts +1 -0
  11. package/dist-esm/src/index.d.ts.map +1 -1
  12. package/dist-esm/src/index.js +1 -0
  13. package/dist-esm/src/index.js.map +1 -1
  14. package/dist-esm/src/models/index.d.ts +185 -50
  15. package/dist-esm/src/models/index.d.ts.map +1 -1
  16. package/dist-esm/src/models/index.js +135 -0
  17. package/dist-esm/src/models/index.js.map +1 -1
  18. package/dist-esm/src/operations/agentPools.d.ts.map +1 -1
  19. package/dist-esm/src/operations/agentPools.js +19 -7
  20. package/dist-esm/src/operations/agentPools.js.map +1 -1
  21. package/dist-esm/src/operations/connectedRegistries.d.ts.map +1 -1
  22. package/dist-esm/src/operations/connectedRegistries.js +19 -7
  23. package/dist-esm/src/operations/connectedRegistries.js.map +1 -1
  24. package/dist-esm/src/operations/exportPipelines.d.ts.map +1 -1
  25. package/dist-esm/src/operations/exportPipelines.js +19 -7
  26. package/dist-esm/src/operations/exportPipelines.js.map +1 -1
  27. package/dist-esm/src/operations/importPipelines.d.ts.map +1 -1
  28. package/dist-esm/src/operations/importPipelines.js +19 -7
  29. package/dist-esm/src/operations/importPipelines.js.map +1 -1
  30. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  31. package/dist-esm/src/operations/operations.js +19 -7
  32. package/dist-esm/src/operations/operations.js.map +1 -1
  33. package/dist-esm/src/operations/pipelineRuns.d.ts.map +1 -1
  34. package/dist-esm/src/operations/pipelineRuns.js +19 -7
  35. package/dist-esm/src/operations/pipelineRuns.js.map +1 -1
  36. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  37. package/dist-esm/src/operations/privateEndpointConnections.js +19 -7
  38. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  39. package/dist-esm/src/operations/registries.d.ts.map +1 -1
  40. package/dist-esm/src/operations/registries.js +55 -21
  41. package/dist-esm/src/operations/registries.js.map +1 -1
  42. package/dist-esm/src/operations/replications.d.ts.map +1 -1
  43. package/dist-esm/src/operations/replications.js +19 -7
  44. package/dist-esm/src/operations/replications.js.map +1 -1
  45. package/dist-esm/src/operations/runs.d.ts.map +1 -1
  46. package/dist-esm/src/operations/runs.js +19 -7
  47. package/dist-esm/src/operations/runs.js.map +1 -1
  48. package/dist-esm/src/operations/scopeMaps.d.ts.map +1 -1
  49. package/dist-esm/src/operations/scopeMaps.js +19 -7
  50. package/dist-esm/src/operations/scopeMaps.js.map +1 -1
  51. package/dist-esm/src/operations/taskRuns.d.ts.map +1 -1
  52. package/dist-esm/src/operations/taskRuns.js +19 -7
  53. package/dist-esm/src/operations/taskRuns.js.map +1 -1
  54. package/dist-esm/src/operations/tasks.d.ts.map +1 -1
  55. package/dist-esm/src/operations/tasks.js +19 -7
  56. package/dist-esm/src/operations/tasks.js.map +1 -1
  57. package/dist-esm/src/operations/tokens.d.ts.map +1 -1
  58. package/dist-esm/src/operations/tokens.js +19 -7
  59. package/dist-esm/src/operations/tokens.js.map +1 -1
  60. package/dist-esm/src/operations/webhooks.d.ts.map +1 -1
  61. package/dist-esm/src/operations/webhooks.js +37 -14
  62. package/dist-esm/src/operations/webhooks.js.map +1 -1
  63. package/dist-esm/src/pagingHelper.d.ts +13 -0
  64. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  65. package/dist-esm/src/pagingHelper.js +32 -0
  66. package/dist-esm/src/pagingHelper.js.map +1 -0
  67. package/dist-esm/test/containerregistry_examples.d.ts.map +1 -1
  68. package/dist-esm/test/containerregistry_examples.js +16 -18
  69. package/dist-esm/test/containerregistry_examples.js.map +1 -1
  70. package/package.json +15 -11
  71. package/review/arm-containerregistry.api.md +143 -275
  72. package/src/containerRegistryManagementClient.ts +26 -20
  73. package/src/index.ts +1 -0
  74. package/src/models/index.ts +187 -50
  75. package/src/operations/agentPools.ts +27 -9
  76. package/src/operations/connectedRegistries.ts +26 -8
  77. package/src/operations/exportPipelines.ts +26 -8
  78. package/src/operations/importPipelines.ts +26 -8
  79. package/src/operations/operations.ts +21 -8
  80. package/src/operations/pipelineRuns.ts +26 -8
  81. package/src/operations/privateEndpointConnections.ts +26 -8
  82. package/src/operations/registries.ts +71 -29
  83. package/src/operations/replications.ts +26 -8
  84. package/src/operations/runs.ts +26 -8
  85. package/src/operations/scopeMaps.ts +26 -8
  86. package/src/operations/taskRuns.ts +27 -9
  87. package/src/operations/tasks.ts +26 -8
  88. package/src/operations/tokens.ts +26 -8
  89. package/src/operations/webhooks.ts +53 -22
  90. package/src/pagingHelper.ts +39 -0
  91. package/types/arm-containerregistry.d.ts +194 -50
  92. 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 { Replications } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -62,8 +63,16 @@ export class ReplicationsImpl implements Replications {
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
- return this.listPagingPage(resourceGroupName, registryName, options);
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
70
+ return this.listPagingPage(
71
+ resourceGroupName,
72
+ registryName,
73
+ options,
74
+ settings
75
+ );
67
76
  }
68
77
  };
69
78
  }
@@ -71,11 +80,18 @@ export class ReplicationsImpl implements Replications {
71
80
  private async *listPagingPage(
72
81
  resourceGroupName: string,
73
82
  registryName: string,
74
- options?: ReplicationsListOptionalParams
83
+ options?: ReplicationsListOptionalParams,
84
+ settings?: PageSettings
75
85
  ): AsyncIterableIterator<Replication[]> {
76
- let result = await this._list(resourceGroupName, registryName, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
86
+ let result: ReplicationsListResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._list(resourceGroupName, registryName, options);
90
+ let page = result.value || [];
91
+ continuationToken = result.nextLink;
92
+ setContinuationToken(page, continuationToken);
93
+ yield page;
94
+ }
79
95
  while (continuationToken) {
80
96
  result = await this._listNext(
81
97
  resourceGroupName,
@@ -84,7 +100,9 @@ export class ReplicationsImpl implements Replications {
84
100
  options
85
101
  );
86
102
  continuationToken = result.nextLink;
87
- yield result.value || [];
103
+ let page = result.value || [];
104
+ setContinuationToken(page, continuationToken);
105
+ yield page;
88
106
  }
89
107
  }
90
108
 
@@ -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 { Runs } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -62,8 +63,16 @@ export class RunsImpl implements Runs {
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
- return this.listPagingPage(resourceGroupName, registryName, options);
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
70
+ return this.listPagingPage(
71
+ resourceGroupName,
72
+ registryName,
73
+ options,
74
+ settings
75
+ );
67
76
  }
68
77
  };
69
78
  }
@@ -71,11 +80,18 @@ export class RunsImpl implements Runs {
71
80
  private async *listPagingPage(
72
81
  resourceGroupName: string,
73
82
  registryName: string,
74
- options?: RunsListOptionalParams
83
+ options?: RunsListOptionalParams,
84
+ settings?: PageSettings
75
85
  ): AsyncIterableIterator<Run[]> {
76
- let result = await this._list(resourceGroupName, registryName, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
86
+ let result: RunsListResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._list(resourceGroupName, registryName, options);
90
+ let page = result.value || [];
91
+ continuationToken = result.nextLink;
92
+ setContinuationToken(page, continuationToken);
93
+ yield page;
94
+ }
79
95
  while (continuationToken) {
80
96
  result = await this._listNext(
81
97
  resourceGroupName,
@@ -84,7 +100,9 @@ export class RunsImpl implements Runs {
84
100
  options
85
101
  );
86
102
  continuationToken = result.nextLink;
87
- yield result.value || [];
103
+ let page = result.value || [];
104
+ setContinuationToken(page, continuationToken);
105
+ yield page;
88
106
  }
89
107
  }
90
108
 
@@ -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 { ScopeMaps } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -62,8 +63,16 @@ export class ScopeMapsImpl implements ScopeMaps {
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
- return this.listPagingPage(resourceGroupName, registryName, options);
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
70
+ return this.listPagingPage(
71
+ resourceGroupName,
72
+ registryName,
73
+ options,
74
+ settings
75
+ );
67
76
  }
68
77
  };
69
78
  }
@@ -71,11 +80,18 @@ export class ScopeMapsImpl implements ScopeMaps {
71
80
  private async *listPagingPage(
72
81
  resourceGroupName: string,
73
82
  registryName: string,
74
- options?: ScopeMapsListOptionalParams
83
+ options?: ScopeMapsListOptionalParams,
84
+ settings?: PageSettings
75
85
  ): AsyncIterableIterator<ScopeMap[]> {
76
- let result = await this._list(resourceGroupName, registryName, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
86
+ let result: ScopeMapsListResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._list(resourceGroupName, registryName, options);
90
+ let page = result.value || [];
91
+ continuationToken = result.nextLink;
92
+ setContinuationToken(page, continuationToken);
93
+ yield page;
94
+ }
79
95
  while (continuationToken) {
80
96
  result = await this._listNext(
81
97
  resourceGroupName,
@@ -84,7 +100,9 @@ export class ScopeMapsImpl implements ScopeMaps {
84
100
  options
85
101
  );
86
102
  continuationToken = result.nextLink;
87
- yield result.value || [];
103
+ let page = result.value || [];
104
+ setContinuationToken(page, continuationToken);
105
+ yield page;
88
106
  }
89
107
  }
90
108
 
@@ -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 { TaskRuns } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,6 +19,7 @@ import {
18
19
  TaskRun,
19
20
  TaskRunsListNextOptionalParams,
20
21
  TaskRunsListOptionalParams,
22
+ TaskRunsListResponse,
21
23
  TaskRunsGetOptionalParams,
22
24
  TaskRunsGetResponse,
23
25
  TaskRunsCreateOptionalParams,
@@ -28,7 +30,6 @@ import {
28
30
  TaskRunsUpdateResponse,
29
31
  TaskRunsGetDetailsOptionalParams,
30
32
  TaskRunsGetDetailsResponse,
31
- TaskRunsListResponse,
32
33
  TaskRunsListNextResponse
33
34
  } from "../models";
34
35
 
@@ -64,8 +65,16 @@ export class TaskRunsImpl implements TaskRuns {
64
65
  [Symbol.asyncIterator]() {
65
66
  return this;
66
67
  },
67
- byPage: () => {
68
- return this.listPagingPage(resourceGroupName, registryName, options);
68
+ byPage: (settings?: PageSettings) => {
69
+ if (settings?.maxPageSize) {
70
+ throw new Error("maxPageSize is not supported by this operation.");
71
+ }
72
+ return this.listPagingPage(
73
+ resourceGroupName,
74
+ registryName,
75
+ options,
76
+ settings
77
+ );
69
78
  }
70
79
  };
71
80
  }
@@ -73,11 +82,18 @@ export class TaskRunsImpl implements TaskRuns {
73
82
  private async *listPagingPage(
74
83
  resourceGroupName: string,
75
84
  registryName: string,
76
- options?: TaskRunsListOptionalParams
85
+ options?: TaskRunsListOptionalParams,
86
+ settings?: PageSettings
77
87
  ): AsyncIterableIterator<TaskRun[]> {
78
- let result = await this._list(resourceGroupName, registryName, options);
79
- yield result.value || [];
80
- let continuationToken = result.nextLink;
88
+ let result: TaskRunsListResponse;
89
+ let continuationToken = settings?.continuationToken;
90
+ if (!continuationToken) {
91
+ result = await this._list(resourceGroupName, registryName, options);
92
+ let page = result.value || [];
93
+ continuationToken = result.nextLink;
94
+ setContinuationToken(page, continuationToken);
95
+ yield page;
96
+ }
81
97
  while (continuationToken) {
82
98
  result = await this._listNext(
83
99
  resourceGroupName,
@@ -86,7 +102,9 @@ export class TaskRunsImpl implements TaskRuns {
86
102
  options
87
103
  );
88
104
  continuationToken = result.nextLink;
89
- yield result.value || [];
105
+ let page = result.value || [];
106
+ setContinuationToken(page, continuationToken);
107
+ yield page;
90
108
  }
91
109
  }
92
110
 
@@ -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 { Tasks } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -64,8 +65,16 @@ export class TasksImpl implements Tasks {
64
65
  [Symbol.asyncIterator]() {
65
66
  return this;
66
67
  },
67
- byPage: () => {
68
- return this.listPagingPage(resourceGroupName, registryName, options);
68
+ byPage: (settings?: PageSettings) => {
69
+ if (settings?.maxPageSize) {
70
+ throw new Error("maxPageSize is not supported by this operation.");
71
+ }
72
+ return this.listPagingPage(
73
+ resourceGroupName,
74
+ registryName,
75
+ options,
76
+ settings
77
+ );
69
78
  }
70
79
  };
71
80
  }
@@ -73,11 +82,18 @@ export class TasksImpl implements Tasks {
73
82
  private async *listPagingPage(
74
83
  resourceGroupName: string,
75
84
  registryName: string,
76
- options?: TasksListOptionalParams
85
+ options?: TasksListOptionalParams,
86
+ settings?: PageSettings
77
87
  ): AsyncIterableIterator<Task[]> {
78
- let result = await this._list(resourceGroupName, registryName, options);
79
- yield result.value || [];
80
- let continuationToken = result.nextLink;
88
+ let result: TasksListResponse;
89
+ let continuationToken = settings?.continuationToken;
90
+ if (!continuationToken) {
91
+ result = await this._list(resourceGroupName, registryName, options);
92
+ let page = result.value || [];
93
+ continuationToken = result.nextLink;
94
+ setContinuationToken(page, continuationToken);
95
+ yield page;
96
+ }
81
97
  while (continuationToken) {
82
98
  result = await this._listNext(
83
99
  resourceGroupName,
@@ -86,7 +102,9 @@ export class TasksImpl implements Tasks {
86
102
  options
87
103
  );
88
104
  continuationToken = result.nextLink;
89
- yield result.value || [];
105
+ let page = result.value || [];
106
+ setContinuationToken(page, continuationToken);
107
+ yield page;
90
108
  }
91
109
  }
92
110
 
@@ -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 { Tokens } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -62,8 +63,16 @@ export class TokensImpl implements Tokens {
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
- return this.listPagingPage(resourceGroupName, registryName, options);
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
70
+ return this.listPagingPage(
71
+ resourceGroupName,
72
+ registryName,
73
+ options,
74
+ settings
75
+ );
67
76
  }
68
77
  };
69
78
  }
@@ -71,11 +80,18 @@ export class TokensImpl implements Tokens {
71
80
  private async *listPagingPage(
72
81
  resourceGroupName: string,
73
82
  registryName: string,
74
- options?: TokensListOptionalParams
83
+ options?: TokensListOptionalParams,
84
+ settings?: PageSettings
75
85
  ): AsyncIterableIterator<Token[]> {
76
- let result = await this._list(resourceGroupName, registryName, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
86
+ let result: TokensListResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._list(resourceGroupName, registryName, options);
90
+ let page = result.value || [];
91
+ continuationToken = result.nextLink;
92
+ setContinuationToken(page, continuationToken);
93
+ yield page;
94
+ }
79
95
  while (continuationToken) {
80
96
  result = await this._listNext(
81
97
  resourceGroupName,
@@ -84,7 +100,9 @@ export class TokensImpl implements Tokens {
84
100
  options
85
101
  );
86
102
  continuationToken = result.nextLink;
87
- yield result.value || [];
103
+ let page = result.value || [];
104
+ setContinuationToken(page, continuationToken);
105
+ yield page;
88
106
  }
89
107
  }
90
108
 
@@ -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 { Webhooks } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,10 +19,11 @@ import {
18
19
  Webhook,
19
20
  WebhooksListNextOptionalParams,
20
21
  WebhooksListOptionalParams,
22
+ WebhooksListResponse,
21
23
  Event,
22
24
  WebhooksListEventsNextOptionalParams,
23
25
  WebhooksListEventsOptionalParams,
24
- WebhooksListResponse,
26
+ WebhooksListEventsResponse,
25
27
  WebhooksGetOptionalParams,
26
28
  WebhooksGetResponse,
27
29
  WebhookCreateParameters,
@@ -33,7 +35,6 @@ import {
33
35
  WebhooksUpdateResponse,
34
36
  WebhooksPingOptionalParams,
35
37
  WebhooksPingResponse,
36
- WebhooksListEventsResponse,
37
38
  WebhooksGetCallbackConfigOptionalParams,
38
39
  WebhooksGetCallbackConfigResponse,
39
40
  WebhooksListNextResponse,
@@ -72,8 +73,16 @@ export class WebhooksImpl implements Webhooks {
72
73
  [Symbol.asyncIterator]() {
73
74
  return this;
74
75
  },
75
- byPage: () => {
76
- return this.listPagingPage(resourceGroupName, registryName, options);
76
+ byPage: (settings?: PageSettings) => {
77
+ if (settings?.maxPageSize) {
78
+ throw new Error("maxPageSize is not supported by this operation.");
79
+ }
80
+ return this.listPagingPage(
81
+ resourceGroupName,
82
+ registryName,
83
+ options,
84
+ settings
85
+ );
77
86
  }
78
87
  };
79
88
  }
@@ -81,11 +90,18 @@ export class WebhooksImpl implements Webhooks {
81
90
  private async *listPagingPage(
82
91
  resourceGroupName: string,
83
92
  registryName: string,
84
- options?: WebhooksListOptionalParams
93
+ options?: WebhooksListOptionalParams,
94
+ settings?: PageSettings
85
95
  ): AsyncIterableIterator<Webhook[]> {
86
- let result = await this._list(resourceGroupName, registryName, options);
87
- yield result.value || [];
88
- let continuationToken = result.nextLink;
96
+ let result: WebhooksListResponse;
97
+ let continuationToken = settings?.continuationToken;
98
+ if (!continuationToken) {
99
+ result = await this._list(resourceGroupName, registryName, options);
100
+ let page = result.value || [];
101
+ continuationToken = result.nextLink;
102
+ setContinuationToken(page, continuationToken);
103
+ yield page;
104
+ }
89
105
  while (continuationToken) {
90
106
  result = await this._listNext(
91
107
  resourceGroupName,
@@ -94,7 +110,9 @@ export class WebhooksImpl implements Webhooks {
94
110
  options
95
111
  );
96
112
  continuationToken = result.nextLink;
97
- yield result.value || [];
113
+ let page = result.value || [];
114
+ setContinuationToken(page, continuationToken);
115
+ yield page;
98
116
  }
99
117
  }
100
118
 
@@ -138,12 +156,16 @@ export class WebhooksImpl implements Webhooks {
138
156
  [Symbol.asyncIterator]() {
139
157
  return this;
140
158
  },
141
- byPage: () => {
159
+ byPage: (settings?: PageSettings) => {
160
+ if (settings?.maxPageSize) {
161
+ throw new Error("maxPageSize is not supported by this operation.");
162
+ }
142
163
  return this.listEventsPagingPage(
143
164
  resourceGroupName,
144
165
  registryName,
145
166
  webhookName,
146
- options
167
+ options,
168
+ settings
147
169
  );
148
170
  }
149
171
  };
@@ -153,16 +175,23 @@ export class WebhooksImpl implements Webhooks {
153
175
  resourceGroupName: string,
154
176
  registryName: string,
155
177
  webhookName: string,
156
- options?: WebhooksListEventsOptionalParams
178
+ options?: WebhooksListEventsOptionalParams,
179
+ settings?: PageSettings
157
180
  ): AsyncIterableIterator<Event[]> {
158
- let result = await this._listEvents(
159
- resourceGroupName,
160
- registryName,
161
- webhookName,
162
- options
163
- );
164
- yield result.value || [];
165
- let continuationToken = result.nextLink;
181
+ let result: WebhooksListEventsResponse;
182
+ let continuationToken = settings?.continuationToken;
183
+ if (!continuationToken) {
184
+ result = await this._listEvents(
185
+ resourceGroupName,
186
+ registryName,
187
+ webhookName,
188
+ options
189
+ );
190
+ let page = result.value || [];
191
+ continuationToken = result.nextLink;
192
+ setContinuationToken(page, continuationToken);
193
+ yield page;
194
+ }
166
195
  while (continuationToken) {
167
196
  result = await this._listEventsNext(
168
197
  resourceGroupName,
@@ -172,7 +201,9 @@ export class WebhooksImpl implements Webhooks {
172
201
  options
173
202
  );
174
203
  continuationToken = result.nextLink;
175
- yield result.value || [];
204
+ let page = result.value || [];
205
+ setContinuationToken(page, continuationToken);
206
+ yield page;
176
207
  }
177
208
  }
178
209
 
@@ -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
+ }