@azure/arm-msi 2.1.0-alpha.20230126.1 → 2.1.0-alpha.20230202.1
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.
- package/CHANGELOG.md +3 -13
- package/LICENSE +1 -1
- package/dist/index.js +142 -65
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/federatedIdentityCredentialsCreateOrUpdateSample.js +10 -3
- package/dist-esm/samples-dev/federatedIdentityCredentialsCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/federatedIdentityCredentialsDeleteSample.js +10 -3
- package/dist-esm/samples-dev/federatedIdentityCredentialsDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/federatedIdentityCredentialsGetSample.js +10 -3
- package/dist-esm/samples-dev/federatedIdentityCredentialsGetSample.js.map +1 -1
- package/dist-esm/samples-dev/federatedIdentityCredentialsListSample.js +10 -3
- package/dist-esm/samples-dev/federatedIdentityCredentialsListSample.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +10 -2
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/systemAssignedIdentitiesGetByScopeSample.js +10 -2
- package/dist-esm/samples-dev/systemAssignedIdentitiesGetByScopeSample.js.map +1 -1
- package/dist-esm/samples-dev/userAssignedIdentitiesCreateOrUpdateSample.js +10 -3
- package/dist-esm/samples-dev/userAssignedIdentitiesCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/userAssignedIdentitiesDeleteSample.js +10 -3
- package/dist-esm/samples-dev/userAssignedIdentitiesDeleteSample.js.map +1 -1
- package/dist-esm/samples-dev/userAssignedIdentitiesGetSample.js +10 -3
- package/dist-esm/samples-dev/userAssignedIdentitiesGetSample.js.map +1 -1
- package/dist-esm/samples-dev/userAssignedIdentitiesListAssociatedResourcesSample.js +11 -3
- package/dist-esm/samples-dev/userAssignedIdentitiesListAssociatedResourcesSample.js.map +1 -1
- package/dist-esm/samples-dev/userAssignedIdentitiesListByResourceGroupSample.js +10 -3
- package/dist-esm/samples-dev/userAssignedIdentitiesListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/userAssignedIdentitiesListBySubscriptionSample.js +9 -2
- package/dist-esm/samples-dev/userAssignedIdentitiesListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/userAssignedIdentitiesUpdateSample.js +10 -3
- package/dist-esm/samples-dev/userAssignedIdentitiesUpdateSample.js.map +1 -1
- package/dist-esm/src/index.d.ts +1 -0
- package/dist-esm/src/index.d.ts.map +1 -1
- package/dist-esm/src/index.js +1 -0
- package/dist-esm/src/index.js.map +1 -1
- package/dist-esm/src/managedServiceIdentityClient.d.ts.map +1 -1
- package/dist-esm/src/managedServiceIdentityClient.js +19 -14
- package/dist-esm/src/managedServiceIdentityClient.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +0 -14
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/operations/federatedIdentityCredentials.d.ts.map +1 -1
- package/dist-esm/src/operations/federatedIdentityCredentials.js +19 -12
- package/dist-esm/src/operations/federatedIdentityCredentials.js.map +1 -1
- package/dist-esm/src/operations/operations.d.ts.map +1 -1
- package/dist-esm/src/operations/operations.js +19 -8
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/userAssignedIdentities.d.ts.map +1 -1
- package/dist-esm/src/operations/userAssignedIdentities.js +55 -31
- package/dist-esm/src/operations/userAssignedIdentities.js.map +1 -1
- package/dist-esm/src/pagingHelper.d.ts +13 -0
- package/dist-esm/src/pagingHelper.d.ts.map +1 -0
- package/dist-esm/src/pagingHelper.js +32 -0
- package/dist-esm/src/pagingHelper.js.map +1 -0
- package/package.json +6 -4
- package/review/arm-msi.api.md +3 -7
- package/src/index.ts +1 -0
- package/src/managedServiceIdentityClient.ts +25 -16
- package/src/models/index.ts +2 -18
- package/src/operations/federatedIdentityCredentials.ts +26 -13
- package/src/operations/operations.ts +21 -9
- package/src/operations/userAssignedIdentities.ts +70 -38
- package/src/pagingHelper.ts +39 -0
- package/types/arm-msi.d.ts +9 -14
- 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 { UserAssignedIdentities } from "../operationsInterfaces";
|
11
12
|
import * as coreClient from "@azure/core-client";
|
12
13
|
import * as Mappers from "../models/mappers";
|
@@ -16,13 +17,13 @@ import {
|
|
16
17
|
Identity,
|
17
18
|
UserAssignedIdentitiesListBySubscriptionNextOptionalParams,
|
18
19
|
UserAssignedIdentitiesListBySubscriptionOptionalParams,
|
20
|
+
UserAssignedIdentitiesListBySubscriptionResponse,
|
19
21
|
UserAssignedIdentitiesListByResourceGroupNextOptionalParams,
|
20
22
|
UserAssignedIdentitiesListByResourceGroupOptionalParams,
|
23
|
+
UserAssignedIdentitiesListByResourceGroupResponse,
|
21
24
|
AzureResource,
|
22
25
|
UserAssignedIdentitiesListAssociatedResourcesNextOptionalParams,
|
23
26
|
UserAssignedIdentitiesListAssociatedResourcesOptionalParams,
|
24
|
-
UserAssignedIdentitiesListBySubscriptionResponse,
|
25
|
-
UserAssignedIdentitiesListByResourceGroupResponse,
|
26
27
|
UserAssignedIdentitiesListAssociatedResourcesResponse,
|
27
28
|
UserAssignedIdentitiesCreateOrUpdateOptionalParams,
|
28
29
|
UserAssignedIdentitiesCreateOrUpdateResponse,
|
@@ -65,22 +66,34 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
|
|
65
66
|
[Symbol.asyncIterator]() {
|
66
67
|
return this;
|
67
68
|
},
|
68
|
-
byPage: () => {
|
69
|
-
|
69
|
+
byPage: (settings?: PageSettings) => {
|
70
|
+
if (settings?.maxPageSize) {
|
71
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
72
|
+
}
|
73
|
+
return this.listBySubscriptionPagingPage(options, settings);
|
70
74
|
}
|
71
75
|
};
|
72
76
|
}
|
73
77
|
|
74
78
|
private async *listBySubscriptionPagingPage(
|
75
|
-
options?: UserAssignedIdentitiesListBySubscriptionOptionalParams
|
79
|
+
options?: UserAssignedIdentitiesListBySubscriptionOptionalParams,
|
80
|
+
settings?: PageSettings
|
76
81
|
): AsyncIterableIterator<Identity[]> {
|
77
|
-
let result
|
78
|
-
|
79
|
-
|
82
|
+
let result: UserAssignedIdentitiesListBySubscriptionResponse;
|
83
|
+
let continuationToken = settings?.continuationToken;
|
84
|
+
if (!continuationToken) {
|
85
|
+
result = await this._listBySubscription(options);
|
86
|
+
let page = result.value || [];
|
87
|
+
continuationToken = result.nextLink;
|
88
|
+
setContinuationToken(page, continuationToken);
|
89
|
+
yield page;
|
90
|
+
}
|
80
91
|
while (continuationToken) {
|
81
92
|
result = await this._listBySubscriptionNext(continuationToken, options);
|
82
93
|
continuationToken = result.nextLink;
|
83
|
-
|
94
|
+
let page = result.value || [];
|
95
|
+
setContinuationToken(page, continuationToken);
|
96
|
+
yield page;
|
84
97
|
}
|
85
98
|
}
|
86
99
|
|
@@ -109,19 +122,33 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
|
|
109
122
|
[Symbol.asyncIterator]() {
|
110
123
|
return this;
|
111
124
|
},
|
112
|
-
byPage: () => {
|
113
|
-
|
125
|
+
byPage: (settings?: PageSettings) => {
|
126
|
+
if (settings?.maxPageSize) {
|
127
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
128
|
+
}
|
129
|
+
return this.listByResourceGroupPagingPage(
|
130
|
+
resourceGroupName,
|
131
|
+
options,
|
132
|
+
settings
|
133
|
+
);
|
114
134
|
}
|
115
135
|
};
|
116
136
|
}
|
117
137
|
|
118
138
|
private async *listByResourceGroupPagingPage(
|
119
139
|
resourceGroupName: string,
|
120
|
-
options?: UserAssignedIdentitiesListByResourceGroupOptionalParams
|
140
|
+
options?: UserAssignedIdentitiesListByResourceGroupOptionalParams,
|
141
|
+
settings?: PageSettings
|
121
142
|
): AsyncIterableIterator<Identity[]> {
|
122
|
-
let result
|
123
|
-
|
124
|
-
|
143
|
+
let result: UserAssignedIdentitiesListByResourceGroupResponse;
|
144
|
+
let continuationToken = settings?.continuationToken;
|
145
|
+
if (!continuationToken) {
|
146
|
+
result = await this._listByResourceGroup(resourceGroupName, options);
|
147
|
+
let page = result.value || [];
|
148
|
+
continuationToken = result.nextLink;
|
149
|
+
setContinuationToken(page, continuationToken);
|
150
|
+
yield page;
|
151
|
+
}
|
125
152
|
while (continuationToken) {
|
126
153
|
result = await this._listByResourceGroupNext(
|
127
154
|
resourceGroupName,
|
@@ -129,7 +156,9 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
|
|
129
156
|
options
|
130
157
|
);
|
131
158
|
continuationToken = result.nextLink;
|
132
|
-
|
159
|
+
let page = result.value || [];
|
160
|
+
setContinuationToken(page, continuationToken);
|
161
|
+
yield page;
|
133
162
|
}
|
134
163
|
}
|
135
164
|
|
@@ -168,11 +197,15 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
|
|
168
197
|
[Symbol.asyncIterator]() {
|
169
198
|
return this;
|
170
199
|
},
|
171
|
-
byPage: () => {
|
200
|
+
byPage: (settings?: PageSettings) => {
|
201
|
+
if (settings?.maxPageSize) {
|
202
|
+
throw new Error("maxPageSize is not supported by this operation.");
|
203
|
+
}
|
172
204
|
return this.listAssociatedResourcesPagingPage(
|
173
205
|
resourceGroupName,
|
174
206
|
resourceName,
|
175
|
-
options
|
207
|
+
options,
|
208
|
+
settings
|
176
209
|
);
|
177
210
|
}
|
178
211
|
};
|
@@ -181,15 +214,22 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
|
|
181
214
|
private async *listAssociatedResourcesPagingPage(
|
182
215
|
resourceGroupName: string,
|
183
216
|
resourceName: string,
|
184
|
-
options?: UserAssignedIdentitiesListAssociatedResourcesOptionalParams
|
217
|
+
options?: UserAssignedIdentitiesListAssociatedResourcesOptionalParams,
|
218
|
+
settings?: PageSettings
|
185
219
|
): AsyncIterableIterator<AzureResource[]> {
|
186
|
-
let result
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
220
|
+
let result: UserAssignedIdentitiesListAssociatedResourcesResponse;
|
221
|
+
let continuationToken = settings?.continuationToken;
|
222
|
+
if (!continuationToken) {
|
223
|
+
result = await this._listAssociatedResources(
|
224
|
+
resourceGroupName,
|
225
|
+
resourceName,
|
226
|
+
options
|
227
|
+
);
|
228
|
+
let page = result.value || [];
|
229
|
+
continuationToken = result.nextLink;
|
230
|
+
setContinuationToken(page, continuationToken);
|
231
|
+
yield page;
|
232
|
+
}
|
193
233
|
while (continuationToken) {
|
194
234
|
result = await this._listAssociatedResourcesNext(
|
195
235
|
resourceGroupName,
|
@@ -198,7 +238,9 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
|
|
198
238
|
options
|
199
239
|
);
|
200
240
|
continuationToken = result.nextLink;
|
201
|
-
|
241
|
+
let page = result.value || [];
|
242
|
+
setContinuationToken(page, continuationToken);
|
243
|
+
yield page;
|
202
244
|
}
|
203
245
|
}
|
204
246
|
|
@@ -560,7 +602,6 @@ const listBySubscriptionNextOperationSpec: coreClient.OperationSpec = {
|
|
560
602
|
bodyMapper: Mappers.CloudError
|
561
603
|
}
|
562
604
|
},
|
563
|
-
queryParameters: [Parameters.apiVersion],
|
564
605
|
urlParameters: [
|
565
606
|
Parameters.$host,
|
566
607
|
Parameters.nextLink,
|
@@ -580,7 +621,6 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
|
|
580
621
|
bodyMapper: Mappers.CloudError
|
581
622
|
}
|
582
623
|
},
|
583
|
-
queryParameters: [Parameters.apiVersion],
|
584
624
|
urlParameters: [
|
585
625
|
Parameters.$host,
|
586
626
|
Parameters.nextLink,
|
@@ -601,14 +641,6 @@ const listAssociatedResourcesNextOperationSpec: coreClient.OperationSpec = {
|
|
601
641
|
bodyMapper: Mappers.CloudError
|
602
642
|
}
|
603
643
|
},
|
604
|
-
queryParameters: [
|
605
|
-
Parameters.apiVersion,
|
606
|
-
Parameters.filter,
|
607
|
-
Parameters.orderby,
|
608
|
-
Parameters.top,
|
609
|
-
Parameters.skip,
|
610
|
-
Parameters.skiptoken
|
611
|
-
],
|
612
644
|
urlParameters: [
|
613
645
|
Parameters.$host,
|
614
646
|
Parameters.nextLink,
|
@@ -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 the last `.value` produced by the `byPage` iterator,
|
17
|
+
* returns a continuation token that can be used to begin paging from
|
18
|
+
* that point later.
|
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
|
+
*/
|
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
|
+
}
|
package/types/arm-msi.d.ts
CHANGED
@@ -142,10 +142,6 @@ export declare type FederatedIdentityCredentialsGetResponse = FederatedIdentityC
|
|
142
142
|
|
143
143
|
/** Optional parameters. */
|
144
144
|
export declare interface FederatedIdentityCredentialsListNextOptionalParams extends coreClient.OperationOptions {
|
145
|
-
/** Number of records to return. */
|
146
|
-
top?: number;
|
147
|
-
/** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */
|
148
|
-
skiptoken?: string;
|
149
145
|
}
|
150
146
|
|
151
147
|
/** Contains response data for the listNext operation. */
|
@@ -170,6 +166,15 @@ export declare interface FederatedIdentityCredentialsListResult {
|
|
170
166
|
nextLink?: string;
|
171
167
|
}
|
172
168
|
|
169
|
+
/**
|
170
|
+
* Given the last `.value` produced by the `byPage` iterator,
|
171
|
+
* returns a continuation token that can be used to begin paging from
|
172
|
+
* that point later.
|
173
|
+
* @param page An object from accessing `value` on the IteratorResult from a `byPage` iterator.
|
174
|
+
* @returns The continuation token that can be passed into byPage() during future calls.
|
175
|
+
*/
|
176
|
+
export declare function getContinuationToken(page: unknown): string | undefined;
|
177
|
+
|
173
178
|
/** Describes an identity resource. */
|
174
179
|
export declare interface Identity extends TrackedResource {
|
175
180
|
/**
|
@@ -447,16 +452,6 @@ export declare type UserAssignedIdentitiesGetResponse = Identity;
|
|
447
452
|
|
448
453
|
/** Optional parameters. */
|
449
454
|
export declare interface UserAssignedIdentitiesListAssociatedResourcesNextOptionalParams extends coreClient.OperationOptions {
|
450
|
-
/** OData filter expression to apply to the query. */
|
451
|
-
filter?: string;
|
452
|
-
/** OData orderBy expression to apply to the query. */
|
453
|
-
orderby?: string;
|
454
|
-
/** Number of records to return. */
|
455
|
-
top?: number;
|
456
|
-
/** Number of records to skip. */
|
457
|
-
skip?: number;
|
458
|
-
/** A skip token is used to continue retrieving items after an operation returns a partial result. If a previous response contains a nextLink element, the value of the nextLink element will include a skipToken parameter that specifies a starting point to use for subsequent calls. */
|
459
|
-
skiptoken?: string;
|
460
455
|
}
|
461
456
|
|
462
457
|
/** Contains response data for the listAssociatedResourcesNext operation. */
|