@azure/arm-keyvault 2.1.0-alpha.20221128.1 → 2.1.0-beta.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 (64) hide show
  1. package/CHANGELOG.md +12 -3
  2. package/dist/index.js +450 -110
  3. package/dist/index.js.map +1 -1
  4. package/dist/index.min.js +1 -1
  5. package/dist/index.min.js.map +1 -1
  6. package/dist-esm/src/index.d.ts +1 -0
  7. package/dist-esm/src/index.d.ts.map +1 -1
  8. package/dist-esm/src/index.js +1 -0
  9. package/dist-esm/src/index.js.map +1 -1
  10. package/dist-esm/src/keyVaultManagementClient.d.ts +2 -0
  11. package/dist-esm/src/keyVaultManagementClient.d.ts.map +1 -1
  12. package/dist-esm/src/keyVaultManagementClient.js +49 -18
  13. package/dist-esm/src/keyVaultManagementClient.js.map +1 -1
  14. package/dist-esm/src/models/index.d.ts +132 -15
  15. package/dist-esm/src/models/index.d.ts.map +1 -1
  16. package/dist-esm/src/models/index.js +107 -0
  17. package/dist-esm/src/models/index.js.map +1 -1
  18. package/dist-esm/src/models/mappers.d.ts +1 -0
  19. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  20. package/dist-esm/src/models/mappers.js +26 -0
  21. package/dist-esm/src/models/mappers.js.map +1 -1
  22. package/dist-esm/src/operations/keys.d.ts.map +1 -1
  23. package/dist-esm/src/operations/keys.js +37 -14
  24. package/dist-esm/src/operations/keys.js.map +1 -1
  25. package/dist-esm/src/operations/managedHsms.d.ts.map +1 -1
  26. package/dist-esm/src/operations/managedHsms.js +55 -21
  27. package/dist-esm/src/operations/managedHsms.js.map +1 -1
  28. package/dist-esm/src/operations/mhsmPrivateEndpointConnections.d.ts.map +1 -1
  29. package/dist-esm/src/operations/mhsmPrivateEndpointConnections.js +19 -7
  30. package/dist-esm/src/operations/mhsmPrivateEndpointConnections.js.map +1 -1
  31. package/dist-esm/src/operations/operations.d.ts.map +1 -1
  32. package/dist-esm/src/operations/operations.js +19 -7
  33. package/dist-esm/src/operations/operations.js.map +1 -1
  34. package/dist-esm/src/operations/privateEndpointConnections.d.ts.map +1 -1
  35. package/dist-esm/src/operations/privateEndpointConnections.js +19 -7
  36. package/dist-esm/src/operations/privateEndpointConnections.js.map +1 -1
  37. package/dist-esm/src/operations/secrets.d.ts.map +1 -1
  38. package/dist-esm/src/operations/secrets.js +19 -7
  39. package/dist-esm/src/operations/secrets.js.map +1 -1
  40. package/dist-esm/src/operations/vaults.d.ts.map +1 -1
  41. package/dist-esm/src/operations/vaults.js +73 -28
  42. package/dist-esm/src/operations/vaults.js.map +1 -1
  43. package/dist-esm/src/pagingHelper.d.ts +13 -0
  44. package/dist-esm/src/pagingHelper.d.ts.map +1 -0
  45. package/dist-esm/src/pagingHelper.js +32 -0
  46. package/dist-esm/src/pagingHelper.js.map +1 -0
  47. package/dist-esm/test/keyvault_examples.d.ts.map +1 -1
  48. package/dist-esm/test/keyvault_examples.js +17 -19
  49. package/dist-esm/test/keyvault_examples.js.map +1 -1
  50. package/package.json +13 -9
  51. package/review/arm-keyvault.api.md +30 -123
  52. package/src/index.ts +1 -0
  53. package/src/keyVaultManagementClient.ts +60 -20
  54. package/src/models/index.ts +132 -15
  55. package/src/models/mappers.ts +27 -0
  56. package/src/operations/keys.ts +53 -22
  57. package/src/operations/managedHsms.ts +66 -25
  58. package/src/operations/mhsmPrivateEndpointConnections.ts +26 -8
  59. package/src/operations/operations.ts +21 -8
  60. package/src/operations/privateEndpointConnections.ts +27 -13
  61. package/src/operations/secrets.ts +27 -9
  62. package/src/operations/vaults.ts +86 -33
  63. package/src/pagingHelper.ts +39 -0
  64. package/types/arm-keyvault.d.ts +144 -15
@@ -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 { ManagedHsms } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,11 +19,14 @@ import {
18
19
  ManagedHsm,
19
20
  ManagedHsmsListByResourceGroupNextOptionalParams,
20
21
  ManagedHsmsListByResourceGroupOptionalParams,
22
+ ManagedHsmsListByResourceGroupResponse,
21
23
  ManagedHsmsListBySubscriptionNextOptionalParams,
22
24
  ManagedHsmsListBySubscriptionOptionalParams,
25
+ ManagedHsmsListBySubscriptionResponse,
23
26
  DeletedManagedHsm,
24
27
  ManagedHsmsListDeletedNextOptionalParams,
25
28
  ManagedHsmsListDeletedOptionalParams,
29
+ ManagedHsmsListDeletedResponse,
26
30
  ManagedHsmsCreateOrUpdateOptionalParams,
27
31
  ManagedHsmsCreateOrUpdateResponse,
28
32
  ManagedHsmsUpdateOptionalParams,
@@ -30,9 +34,6 @@ import {
30
34
  ManagedHsmsDeleteOptionalParams,
31
35
  ManagedHsmsGetOptionalParams,
32
36
  ManagedHsmsGetResponse,
33
- ManagedHsmsListByResourceGroupResponse,
34
- ManagedHsmsListBySubscriptionResponse,
35
- ManagedHsmsListDeletedResponse,
36
37
  ManagedHsmsGetDeletedOptionalParams,
37
38
  ManagedHsmsGetDeletedResponse,
38
39
  ManagedHsmsPurgeDeletedOptionalParams,
@@ -72,19 +73,33 @@ export class ManagedHsmsImpl implements ManagedHsms {
72
73
  [Symbol.asyncIterator]() {
73
74
  return this;
74
75
  },
75
- byPage: () => {
76
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
76
+ byPage: (settings?: PageSettings) => {
77
+ if (settings?.maxPageSize) {
78
+ throw new Error("maxPageSize is not supported by this operation.");
79
+ }
80
+ return this.listByResourceGroupPagingPage(
81
+ resourceGroupName,
82
+ options,
83
+ settings
84
+ );
77
85
  }
78
86
  };
79
87
  }
80
88
 
81
89
  private async *listByResourceGroupPagingPage(
82
90
  resourceGroupName: string,
83
- options?: ManagedHsmsListByResourceGroupOptionalParams
91
+ options?: ManagedHsmsListByResourceGroupOptionalParams,
92
+ settings?: PageSettings
84
93
  ): AsyncIterableIterator<ManagedHsm[]> {
85
- let result = await this._listByResourceGroup(resourceGroupName, options);
86
- yield result.value || [];
87
- let continuationToken = result.nextLink;
94
+ let result: ManagedHsmsListByResourceGroupResponse;
95
+ let continuationToken = settings?.continuationToken;
96
+ if (!continuationToken) {
97
+ result = await this._listByResourceGroup(resourceGroupName, options);
98
+ let page = result.value || [];
99
+ continuationToken = result.nextLink;
100
+ setContinuationToken(page, continuationToken);
101
+ yield page;
102
+ }
88
103
  while (continuationToken) {
89
104
  result = await this._listByResourceGroupNext(
90
105
  resourceGroupName,
@@ -92,7 +107,9 @@ export class ManagedHsmsImpl implements ManagedHsms {
92
107
  options
93
108
  );
94
109
  continuationToken = result.nextLink;
95
- yield result.value || [];
110
+ let page = result.value || [];
111
+ setContinuationToken(page, continuationToken);
112
+ yield page;
96
113
  }
97
114
  }
98
115
 
@@ -123,22 +140,34 @@ export class ManagedHsmsImpl implements ManagedHsms {
123
140
  [Symbol.asyncIterator]() {
124
141
  return this;
125
142
  },
126
- byPage: () => {
127
- return this.listBySubscriptionPagingPage(options);
143
+ byPage: (settings?: PageSettings) => {
144
+ if (settings?.maxPageSize) {
145
+ throw new Error("maxPageSize is not supported by this operation.");
146
+ }
147
+ return this.listBySubscriptionPagingPage(options, settings);
128
148
  }
129
149
  };
130
150
  }
131
151
 
132
152
  private async *listBySubscriptionPagingPage(
133
- options?: ManagedHsmsListBySubscriptionOptionalParams
153
+ options?: ManagedHsmsListBySubscriptionOptionalParams,
154
+ settings?: PageSettings
134
155
  ): AsyncIterableIterator<ManagedHsm[]> {
135
- let result = await this._listBySubscription(options);
136
- yield result.value || [];
137
- let continuationToken = result.nextLink;
156
+ let result: ManagedHsmsListBySubscriptionResponse;
157
+ let continuationToken = settings?.continuationToken;
158
+ if (!continuationToken) {
159
+ result = await this._listBySubscription(options);
160
+ let page = result.value || [];
161
+ continuationToken = result.nextLink;
162
+ setContinuationToken(page, continuationToken);
163
+ yield page;
164
+ }
138
165
  while (continuationToken) {
139
166
  result = await this._listBySubscriptionNext(continuationToken, options);
140
167
  continuationToken = result.nextLink;
141
- yield result.value || [];
168
+ let page = result.value || [];
169
+ setContinuationToken(page, continuationToken);
170
+ yield page;
142
171
  }
143
172
  }
144
173
 
@@ -165,22 +194,34 @@ export class ManagedHsmsImpl implements ManagedHsms {
165
194
  [Symbol.asyncIterator]() {
166
195
  return this;
167
196
  },
168
- byPage: () => {
169
- return this.listDeletedPagingPage(options);
197
+ byPage: (settings?: PageSettings) => {
198
+ if (settings?.maxPageSize) {
199
+ throw new Error("maxPageSize is not supported by this operation.");
200
+ }
201
+ return this.listDeletedPagingPage(options, settings);
170
202
  }
171
203
  };
172
204
  }
173
205
 
174
206
  private async *listDeletedPagingPage(
175
- options?: ManagedHsmsListDeletedOptionalParams
207
+ options?: ManagedHsmsListDeletedOptionalParams,
208
+ settings?: PageSettings
176
209
  ): AsyncIterableIterator<DeletedManagedHsm[]> {
177
- let result = await this._listDeleted(options);
178
- yield result.value || [];
179
- let continuationToken = result.nextLink;
210
+ let result: ManagedHsmsListDeletedResponse;
211
+ let continuationToken = settings?.continuationToken;
212
+ if (!continuationToken) {
213
+ result = await this._listDeleted(options);
214
+ let page = result.value || [];
215
+ continuationToken = result.nextLink;
216
+ setContinuationToken(page, continuationToken);
217
+ yield page;
218
+ }
180
219
  while (continuationToken) {
181
220
  result = await this._listDeletedNext(continuationToken, options);
182
221
  continuationToken = result.nextLink;
183
- yield result.value || [];
222
+ let page = result.value || [];
223
+ setContinuationToken(page, continuationToken);
224
+ yield page;
184
225
  }
185
226
  }
186
227
 
@@ -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 { MhsmPrivateEndpointConnections } 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 MhsmPrivateEndpointConnectionsImpl
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
- return this.listByResourcePagingPage(resourceGroupName, name, options);
66
+ byPage: (settings?: PageSettings) => {
67
+ if (settings?.maxPageSize) {
68
+ throw new Error("maxPageSize is not supported by this operation.");
69
+ }
70
+ return this.listByResourcePagingPage(
71
+ resourceGroupName,
72
+ name,
73
+ options,
74
+ settings
75
+ );
67
76
  }
68
77
  };
69
78
  }
@@ -71,11 +80,18 @@ export class MhsmPrivateEndpointConnectionsImpl
71
80
  private async *listByResourcePagingPage(
72
81
  resourceGroupName: string,
73
82
  name: string,
74
- options?: MhsmPrivateEndpointConnectionsListByResourceOptionalParams
83
+ options?: MhsmPrivateEndpointConnectionsListByResourceOptionalParams,
84
+ settings?: PageSettings
75
85
  ): AsyncIterableIterator<MhsmPrivateEndpointConnection[]> {
76
- let result = await this._listByResource(resourceGroupName, name, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
86
+ let result: MhsmPrivateEndpointConnectionsListByResourceResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._listByResource(resourceGroupName, name, 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._listByResourceNext(
81
97
  resourceGroupName,
@@ -84,7 +100,9 @@ export class MhsmPrivateEndpointConnectionsImpl
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 { 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<Operation[]> {
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 { PrivateEndpointConnections } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,13 +19,13 @@ import {
18
19
  PrivateEndpointConnection,
19
20
  PrivateEndpointConnectionsListByResourceNextOptionalParams,
20
21
  PrivateEndpointConnectionsListByResourceOptionalParams,
22
+ PrivateEndpointConnectionsListByResourceResponse,
21
23
  PrivateEndpointConnectionsGetOptionalParams,
22
24
  PrivateEndpointConnectionsGetResponse,
23
25
  PrivateEndpointConnectionsPutOptionalParams,
24
26
  PrivateEndpointConnectionsPutResponse,
25
27
  PrivateEndpointConnectionsDeleteOptionalParams,
26
28
  PrivateEndpointConnectionsDeleteResponse,
27
- PrivateEndpointConnectionsListByResourceResponse,
28
29
  PrivateEndpointConnectionsListByResourceNextResponse
29
30
  } from "../models";
30
31
 
@@ -66,11 +67,15 @@ export class PrivateEndpointConnectionsImpl
66
67
  [Symbol.asyncIterator]() {
67
68
  return this;
68
69
  },
69
- byPage: () => {
70
+ byPage: (settings?: PageSettings) => {
71
+ if (settings?.maxPageSize) {
72
+ throw new Error("maxPageSize is not supported by this operation.");
73
+ }
70
74
  return this.listByResourcePagingPage(
71
75
  resourceGroupName,
72
76
  vaultName,
73
- options
77
+ options,
78
+ settings
74
79
  );
75
80
  }
76
81
  };
@@ -79,15 +84,22 @@ export class PrivateEndpointConnectionsImpl
79
84
  private async *listByResourcePagingPage(
80
85
  resourceGroupName: string,
81
86
  vaultName: string,
82
- options?: PrivateEndpointConnectionsListByResourceOptionalParams
87
+ options?: PrivateEndpointConnectionsListByResourceOptionalParams,
88
+ settings?: PageSettings
83
89
  ): AsyncIterableIterator<PrivateEndpointConnection[]> {
84
- let result = await this._listByResource(
85
- resourceGroupName,
86
- vaultName,
87
- options
88
- );
89
- yield result.value || [];
90
- let continuationToken = result.nextLink;
90
+ let result: PrivateEndpointConnectionsListByResourceResponse;
91
+ let continuationToken = settings?.continuationToken;
92
+ if (!continuationToken) {
93
+ result = await this._listByResource(
94
+ resourceGroupName,
95
+ vaultName,
96
+ options
97
+ );
98
+ let page = result.value || [];
99
+ continuationToken = result.nextLink;
100
+ setContinuationToken(page, continuationToken);
101
+ yield page;
102
+ }
91
103
  while (continuationToken) {
92
104
  result = await this._listByResourceNext(
93
105
  resourceGroupName,
@@ -96,7 +108,9 @@ export class PrivateEndpointConnectionsImpl
96
108
  options
97
109
  );
98
110
  continuationToken = result.nextLink;
99
- yield result.value || [];
111
+ let page = result.value || [];
112
+ setContinuationToken(page, continuationToken);
113
+ yield page;
100
114
  }
101
115
  }
102
116
 
@@ -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 { Secrets } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -16,6 +17,7 @@ import {
16
17
  Secret,
17
18
  SecretsListNextOptionalParams,
18
19
  SecretsListOptionalParams,
20
+ SecretsListResponse,
19
21
  SecretCreateOrUpdateParameters,
20
22
  SecretsCreateOrUpdateOptionalParams,
21
23
  SecretsCreateOrUpdateResponse,
@@ -24,7 +26,6 @@ import {
24
26
  SecretsUpdateResponse,
25
27
  SecretsGetOptionalParams,
26
28
  SecretsGetResponse,
27
- SecretsListResponse,
28
29
  SecretsListNextResponse
29
30
  } from "../models";
30
31
 
@@ -62,8 +63,16 @@ export class SecretsImpl implements Secrets {
62
63
  [Symbol.asyncIterator]() {
63
64
  return this;
64
65
  },
65
- byPage: () => {
66
- return this.listPagingPage(resourceGroupName, vaultName, 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
+ vaultName,
73
+ options,
74
+ settings
75
+ );
67
76
  }
68
77
  };
69
78
  }
@@ -71,11 +80,18 @@ export class SecretsImpl implements Secrets {
71
80
  private async *listPagingPage(
72
81
  resourceGroupName: string,
73
82
  vaultName: string,
74
- options?: SecretsListOptionalParams
83
+ options?: SecretsListOptionalParams,
84
+ settings?: PageSettings
75
85
  ): AsyncIterableIterator<Secret[]> {
76
- let result = await this._list(resourceGroupName, vaultName, options);
77
- yield result.value || [];
78
- let continuationToken = result.nextLink;
86
+ let result: SecretsListResponse;
87
+ let continuationToken = settings?.continuationToken;
88
+ if (!continuationToken) {
89
+ result = await this._list(resourceGroupName, vaultName, 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 SecretsImpl implements Secrets {
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 { Vaults } from "../operationsInterfaces";
11
12
  import * as coreClient from "@azure/core-client";
12
13
  import * as Mappers from "../models/mappers";
@@ -18,14 +19,18 @@ import {
18
19
  Vault,
19
20
  VaultsListByResourceGroupNextOptionalParams,
20
21
  VaultsListByResourceGroupOptionalParams,
22
+ VaultsListByResourceGroupResponse,
21
23
  VaultsListBySubscriptionNextOptionalParams,
22
24
  VaultsListBySubscriptionOptionalParams,
25
+ VaultsListBySubscriptionResponse,
23
26
  DeletedVault,
24
27
  VaultsListDeletedNextOptionalParams,
25
28
  VaultsListDeletedOptionalParams,
29
+ VaultsListDeletedResponse,
26
30
  Resource,
27
31
  VaultsListNextOptionalParams,
28
32
  VaultsListOptionalParams,
33
+ VaultsListResponse,
29
34
  VaultCreateOrUpdateParameters,
30
35
  VaultsCreateOrUpdateOptionalParams,
31
36
  VaultsCreateOrUpdateResponse,
@@ -39,13 +44,9 @@ import {
39
44
  AccessPolicyUpdateKind,
40
45
  VaultsUpdateAccessPolicyOptionalParams,
41
46
  VaultsUpdateAccessPolicyResponse,
42
- VaultsListByResourceGroupResponse,
43
- VaultsListBySubscriptionResponse,
44
- VaultsListDeletedResponse,
45
47
  VaultsGetDeletedOptionalParams,
46
48
  VaultsGetDeletedResponse,
47
49
  VaultsPurgeDeletedOptionalParams,
48
- VaultsListResponse,
49
50
  VaultCheckNameAvailabilityParameters,
50
51
  VaultsCheckNameAvailabilityOptionalParams,
51
52
  VaultsCheckNameAvailabilityResponse,
@@ -86,19 +87,33 @@ export class VaultsImpl implements Vaults {
86
87
  [Symbol.asyncIterator]() {
87
88
  return this;
88
89
  },
89
- byPage: () => {
90
- return this.listByResourceGroupPagingPage(resourceGroupName, options);
90
+ byPage: (settings?: PageSettings) => {
91
+ if (settings?.maxPageSize) {
92
+ throw new Error("maxPageSize is not supported by this operation.");
93
+ }
94
+ return this.listByResourceGroupPagingPage(
95
+ resourceGroupName,
96
+ options,
97
+ settings
98
+ );
91
99
  }
92
100
  };
93
101
  }
94
102
 
95
103
  private async *listByResourceGroupPagingPage(
96
104
  resourceGroupName: string,
97
- options?: VaultsListByResourceGroupOptionalParams
105
+ options?: VaultsListByResourceGroupOptionalParams,
106
+ settings?: PageSettings
98
107
  ): AsyncIterableIterator<Vault[]> {
99
- let result = await this._listByResourceGroup(resourceGroupName, options);
100
- yield result.value || [];
101
- let continuationToken = result.nextLink;
108
+ let result: VaultsListByResourceGroupResponse;
109
+ let continuationToken = settings?.continuationToken;
110
+ if (!continuationToken) {
111
+ result = await this._listByResourceGroup(resourceGroupName, options);
112
+ let page = result.value || [];
113
+ continuationToken = result.nextLink;
114
+ setContinuationToken(page, continuationToken);
115
+ yield page;
116
+ }
102
117
  while (continuationToken) {
103
118
  result = await this._listByResourceGroupNext(
104
119
  resourceGroupName,
@@ -106,7 +121,9 @@ export class VaultsImpl implements Vaults {
106
121
  options
107
122
  );
108
123
  continuationToken = result.nextLink;
109
- yield result.value || [];
124
+ let page = result.value || [];
125
+ setContinuationToken(page, continuationToken);
126
+ yield page;
110
127
  }
111
128
  }
112
129
 
@@ -137,22 +154,34 @@ export class VaultsImpl implements Vaults {
137
154
  [Symbol.asyncIterator]() {
138
155
  return this;
139
156
  },
140
- byPage: () => {
141
- return this.listBySubscriptionPagingPage(options);
157
+ byPage: (settings?: PageSettings) => {
158
+ if (settings?.maxPageSize) {
159
+ throw new Error("maxPageSize is not supported by this operation.");
160
+ }
161
+ return this.listBySubscriptionPagingPage(options, settings);
142
162
  }
143
163
  };
144
164
  }
145
165
 
146
166
  private async *listBySubscriptionPagingPage(
147
- options?: VaultsListBySubscriptionOptionalParams
167
+ options?: VaultsListBySubscriptionOptionalParams,
168
+ settings?: PageSettings
148
169
  ): AsyncIterableIterator<Vault[]> {
149
- let result = await this._listBySubscription(options);
150
- yield result.value || [];
151
- let continuationToken = result.nextLink;
170
+ let result: VaultsListBySubscriptionResponse;
171
+ let continuationToken = settings?.continuationToken;
172
+ if (!continuationToken) {
173
+ result = await this._listBySubscription(options);
174
+ let page = result.value || [];
175
+ continuationToken = result.nextLink;
176
+ setContinuationToken(page, continuationToken);
177
+ yield page;
178
+ }
152
179
  while (continuationToken) {
153
180
  result = await this._listBySubscriptionNext(continuationToken, options);
154
181
  continuationToken = result.nextLink;
155
- yield result.value || [];
182
+ let page = result.value || [];
183
+ setContinuationToken(page, continuationToken);
184
+ yield page;
156
185
  }
157
186
  }
158
187
 
@@ -179,22 +208,34 @@ export class VaultsImpl implements Vaults {
179
208
  [Symbol.asyncIterator]() {
180
209
  return this;
181
210
  },
182
- byPage: () => {
183
- return this.listDeletedPagingPage(options);
211
+ byPage: (settings?: PageSettings) => {
212
+ if (settings?.maxPageSize) {
213
+ throw new Error("maxPageSize is not supported by this operation.");
214
+ }
215
+ return this.listDeletedPagingPage(options, settings);
184
216
  }
185
217
  };
186
218
  }
187
219
 
188
220
  private async *listDeletedPagingPage(
189
- options?: VaultsListDeletedOptionalParams
221
+ options?: VaultsListDeletedOptionalParams,
222
+ settings?: PageSettings
190
223
  ): AsyncIterableIterator<DeletedVault[]> {
191
- let result = await this._listDeleted(options);
192
- yield result.value || [];
193
- let continuationToken = result.nextLink;
224
+ let result: VaultsListDeletedResponse;
225
+ let continuationToken = settings?.continuationToken;
226
+ if (!continuationToken) {
227
+ result = await this._listDeleted(options);
228
+ let page = result.value || [];
229
+ continuationToken = result.nextLink;
230
+ setContinuationToken(page, continuationToken);
231
+ yield page;
232
+ }
194
233
  while (continuationToken) {
195
234
  result = await this._listDeletedNext(continuationToken, options);
196
235
  continuationToken = result.nextLink;
197
- yield result.value || [];
236
+ let page = result.value || [];
237
+ setContinuationToken(page, continuationToken);
238
+ yield page;
198
239
  }
199
240
  }
200
241
 
@@ -221,22 +262,34 @@ export class VaultsImpl implements Vaults {
221
262
  [Symbol.asyncIterator]() {
222
263
  return this;
223
264
  },
224
- byPage: () => {
225
- return this.listPagingPage(options);
265
+ byPage: (settings?: PageSettings) => {
266
+ if (settings?.maxPageSize) {
267
+ throw new Error("maxPageSize is not supported by this operation.");
268
+ }
269
+ return this.listPagingPage(options, settings);
226
270
  }
227
271
  };
228
272
  }
229
273
 
230
274
  private async *listPagingPage(
231
- options?: VaultsListOptionalParams
275
+ options?: VaultsListOptionalParams,
276
+ settings?: PageSettings
232
277
  ): AsyncIterableIterator<Resource[]> {
233
- let result = await this._list(options);
234
- yield result.value || [];
235
- let continuationToken = result.nextLink;
278
+ let result: VaultsListResponse;
279
+ let continuationToken = settings?.continuationToken;
280
+ if (!continuationToken) {
281
+ result = await this._list(options);
282
+ let page = result.value || [];
283
+ continuationToken = result.nextLink;
284
+ setContinuationToken(page, continuationToken);
285
+ yield page;
286
+ }
236
287
  while (continuationToken) {
237
288
  result = await this._listNext(continuationToken, options);
238
289
  continuationToken = result.nextLink;
239
- yield result.value || [];
290
+ let page = result.value || [];
291
+ setContinuationToken(page, continuationToken);
292
+ yield page;
240
293
  }
241
294
  }
242
295