@azure/arm-msi 2.0.1-alpha.20220208.1 → 2.1.0-beta.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.
Files changed (73) hide show
  1. package/CHANGELOG.md +14 -11
  2. package/LICENSE +1 -1
  3. package/README.md +12 -1
  4. package/dist/index.js +313 -27
  5. package/dist/index.js.map +1 -1
  6. package/dist/index.min.js +1 -1
  7. package/dist/index.min.js.map +1 -1
  8. package/dist-esm/samples-dev/operationsListSample.d.ts +2 -0
  9. package/dist-esm/samples-dev/operationsListSample.d.ts.map +1 -0
  10. package/dist-esm/samples-dev/operationsListSample.js +43 -0
  11. package/dist-esm/samples-dev/operationsListSample.js.map +1 -0
  12. package/dist-esm/samples-dev/systemAssignedIdentitiesGetByScopeSample.d.ts +2 -0
  13. package/dist-esm/samples-dev/systemAssignedIdentitiesGetByScopeSample.d.ts.map +1 -0
  14. package/dist-esm/samples-dev/systemAssignedIdentitiesGetByScopeSample.js +30 -0
  15. package/dist-esm/samples-dev/systemAssignedIdentitiesGetByScopeSample.js.map +1 -0
  16. package/dist-esm/samples-dev/userAssignedIdentitiesCreateOrUpdateSample.d.ts +2 -0
  17. package/dist-esm/samples-dev/userAssignedIdentitiesCreateOrUpdateSample.d.ts.map +1 -0
  18. package/dist-esm/samples-dev/userAssignedIdentitiesCreateOrUpdateSample.js +35 -0
  19. package/dist-esm/samples-dev/userAssignedIdentitiesCreateOrUpdateSample.js.map +1 -0
  20. package/dist-esm/samples-dev/userAssignedIdentitiesDeleteSample.d.ts +2 -0
  21. package/dist-esm/samples-dev/userAssignedIdentitiesDeleteSample.d.ts.map +1 -0
  22. package/dist-esm/samples-dev/userAssignedIdentitiesDeleteSample.js +31 -0
  23. package/dist-esm/samples-dev/userAssignedIdentitiesDeleteSample.js.map +1 -0
  24. package/dist-esm/samples-dev/userAssignedIdentitiesGetSample.d.ts +2 -0
  25. package/dist-esm/samples-dev/userAssignedIdentitiesGetSample.d.ts.map +1 -0
  26. package/dist-esm/samples-dev/userAssignedIdentitiesGetSample.js +31 -0
  27. package/dist-esm/samples-dev/userAssignedIdentitiesGetSample.js.map +1 -0
  28. package/dist-esm/samples-dev/userAssignedIdentitiesListAssociatedResourcesSample.d.ts +2 -0
  29. package/dist-esm/samples-dev/userAssignedIdentitiesListAssociatedResourcesSample.d.ts.map +1 -0
  30. package/dist-esm/samples-dev/userAssignedIdentitiesListAssociatedResourcesSample.js +55 -0
  31. package/dist-esm/samples-dev/userAssignedIdentitiesListAssociatedResourcesSample.js.map +1 -0
  32. package/dist-esm/samples-dev/userAssignedIdentitiesListByResourceGroupSample.d.ts +2 -0
  33. package/dist-esm/samples-dev/userAssignedIdentitiesListByResourceGroupSample.d.ts.map +1 -0
  34. package/dist-esm/samples-dev/userAssignedIdentitiesListByResourceGroupSample.js +44 -0
  35. package/dist-esm/samples-dev/userAssignedIdentitiesListByResourceGroupSample.js.map +1 -0
  36. package/dist-esm/samples-dev/userAssignedIdentitiesListBySubscriptionSample.d.ts +2 -0
  37. package/dist-esm/samples-dev/userAssignedIdentitiesListBySubscriptionSample.d.ts.map +1 -0
  38. package/dist-esm/samples-dev/userAssignedIdentitiesListBySubscriptionSample.js +43 -0
  39. package/dist-esm/samples-dev/userAssignedIdentitiesListBySubscriptionSample.js.map +1 -0
  40. package/dist-esm/samples-dev/userAssignedIdentitiesUpdateSample.d.ts +2 -0
  41. package/dist-esm/samples-dev/userAssignedIdentitiesUpdateSample.d.ts.map +1 -0
  42. package/dist-esm/samples-dev/userAssignedIdentitiesUpdateSample.js +35 -0
  43. package/dist-esm/samples-dev/userAssignedIdentitiesUpdateSample.js.map +1 -0
  44. package/dist-esm/src/managedServiceIdentityClient.d.ts.map +1 -1
  45. package/dist-esm/src/managedServiceIdentityClient.js +4 -3
  46. package/dist-esm/src/managedServiceIdentityClient.js.map +1 -1
  47. package/dist-esm/src/models/index.d.ts +81 -0
  48. package/dist-esm/src/models/index.d.ts.map +1 -1
  49. package/dist-esm/src/models/mappers.d.ts +2 -0
  50. package/dist-esm/src/models/mappers.d.ts.map +1 -1
  51. package/dist-esm/src/models/mappers.js +85 -0
  52. package/dist-esm/src/models/mappers.js.map +1 -1
  53. package/dist-esm/src/models/parameters.d.ts +6 -1
  54. package/dist-esm/src/models/parameters.d.ts.map +1 -1
  55. package/dist-esm/src/models/parameters.js +62 -11
  56. package/dist-esm/src/models/parameters.js.map +1 -1
  57. package/dist-esm/src/operations/userAssignedIdentities.d.ts +26 -1
  58. package/dist-esm/src/operations/userAssignedIdentities.d.ts.map +1 -1
  59. package/dist-esm/src/operations/userAssignedIdentities.js +127 -0
  60. package/dist-esm/src/operations/userAssignedIdentities.js.map +1 -1
  61. package/dist-esm/src/operationsInterfaces/userAssignedIdentities.d.ts +8 -1
  62. package/dist-esm/src/operationsInterfaces/userAssignedIdentities.d.ts.map +1 -1
  63. package/package.json +25 -9
  64. package/review/arm-msi.api.md +42 -0
  65. package/rollup.config.js +6 -72
  66. package/src/managedServiceIdentityClient.ts +4 -3
  67. package/src/models/index.ts +89 -0
  68. package/src/models/mappers.ts +87 -0
  69. package/src/models/parameters.ts +68 -12
  70. package/src/operations/userAssignedIdentities.ts +172 -1
  71. package/src/operationsInterfaces/userAssignedIdentities.ts +13 -0
  72. package/tsconfig.json +19 -5
  73. package/types/arm-msi.d.ts +94 -0
@@ -18,8 +18,12 @@ import {
18
18
  UserAssignedIdentitiesListBySubscriptionOptionalParams,
19
19
  UserAssignedIdentitiesListByResourceGroupNextOptionalParams,
20
20
  UserAssignedIdentitiesListByResourceGroupOptionalParams,
21
+ AzureResource,
22
+ UserAssignedIdentitiesListAssociatedResourcesNextOptionalParams,
23
+ UserAssignedIdentitiesListAssociatedResourcesOptionalParams,
21
24
  UserAssignedIdentitiesListBySubscriptionResponse,
22
25
  UserAssignedIdentitiesListByResourceGroupResponse,
26
+ UserAssignedIdentitiesListAssociatedResourcesResponse,
23
27
  UserAssignedIdentitiesCreateOrUpdateOptionalParams,
24
28
  UserAssignedIdentitiesCreateOrUpdateResponse,
25
29
  IdentityUpdate,
@@ -29,7 +33,8 @@ import {
29
33
  UserAssignedIdentitiesGetResponse,
30
34
  UserAssignedIdentitiesDeleteOptionalParams,
31
35
  UserAssignedIdentitiesListBySubscriptionNextResponse,
32
- UserAssignedIdentitiesListByResourceGroupNextResponse
36
+ UserAssignedIdentitiesListByResourceGroupNextResponse,
37
+ UserAssignedIdentitiesListAssociatedResourcesNextResponse
33
38
  } from "../models";
34
39
 
35
40
  /// <reference lib="esnext.asynciterable" />
@@ -140,6 +145,77 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
140
145
  }
141
146
  }
142
147
 
148
+ /**
149
+ * Lists the associated resources for this identity.
150
+ * @param resourceGroupName The name of the Resource Group to which the identity belongs.
151
+ * @param resourceName The name of the identity resource.
152
+ * @param options The options parameters.
153
+ */
154
+ public listAssociatedResources(
155
+ resourceGroupName: string,
156
+ resourceName: string,
157
+ options?: UserAssignedIdentitiesListAssociatedResourcesOptionalParams
158
+ ): PagedAsyncIterableIterator<AzureResource> {
159
+ const iter = this.listAssociatedResourcesPagingAll(
160
+ resourceGroupName,
161
+ resourceName,
162
+ options
163
+ );
164
+ return {
165
+ next() {
166
+ return iter.next();
167
+ },
168
+ [Symbol.asyncIterator]() {
169
+ return this;
170
+ },
171
+ byPage: () => {
172
+ return this.listAssociatedResourcesPagingPage(
173
+ resourceGroupName,
174
+ resourceName,
175
+ options
176
+ );
177
+ }
178
+ };
179
+ }
180
+
181
+ private async *listAssociatedResourcesPagingPage(
182
+ resourceGroupName: string,
183
+ resourceName: string,
184
+ options?: UserAssignedIdentitiesListAssociatedResourcesOptionalParams
185
+ ): AsyncIterableIterator<AzureResource[]> {
186
+ let result = await this._listAssociatedResources(
187
+ resourceGroupName,
188
+ resourceName,
189
+ options
190
+ );
191
+ yield result.value || [];
192
+ let continuationToken = result.nextLink;
193
+ while (continuationToken) {
194
+ result = await this._listAssociatedResourcesNext(
195
+ resourceGroupName,
196
+ resourceName,
197
+ continuationToken,
198
+ options
199
+ );
200
+ continuationToken = result.nextLink;
201
+ yield result.value || [];
202
+ }
203
+ }
204
+
205
+ private async *listAssociatedResourcesPagingAll(
206
+ resourceGroupName: string,
207
+ resourceName: string,
208
+ options?: UserAssignedIdentitiesListAssociatedResourcesOptionalParams
209
+ ): AsyncIterableIterator<AzureResource> {
210
+ for await (const page of this.listAssociatedResourcesPagingPage(
211
+ resourceGroupName,
212
+ resourceName,
213
+ options
214
+ )) {
215
+ yield* page;
216
+ }
217
+ }
218
+
143
219
  /**
144
220
  * Lists all the userAssignedIdentities available under the specified subscription.
145
221
  * @param options The options parameters.
@@ -168,6 +244,23 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
168
244
  );
169
245
  }
170
246
 
247
+ /**
248
+ * Lists the associated resources for this identity.
249
+ * @param resourceGroupName The name of the Resource Group to which the identity belongs.
250
+ * @param resourceName The name of the identity resource.
251
+ * @param options The options parameters.
252
+ */
253
+ private _listAssociatedResources(
254
+ resourceGroupName: string,
255
+ resourceName: string,
256
+ options?: UserAssignedIdentitiesListAssociatedResourcesOptionalParams
257
+ ): Promise<UserAssignedIdentitiesListAssociatedResourcesResponse> {
258
+ return this.client.sendOperationRequest(
259
+ { resourceGroupName, resourceName, options },
260
+ listAssociatedResourcesOperationSpec
261
+ );
262
+ }
263
+
171
264
  /**
172
265
  * Create or update an identity in the specified subscription and resource group.
173
266
  * @param resourceGroupName The name of the Resource Group to which the identity belongs.
@@ -271,6 +364,26 @@ export class UserAssignedIdentitiesImpl implements UserAssignedIdentities {
271
364
  listByResourceGroupNextOperationSpec
272
365
  );
273
366
  }
367
+
368
+ /**
369
+ * ListAssociatedResourcesNext
370
+ * @param resourceGroupName The name of the Resource Group to which the identity belongs.
371
+ * @param resourceName The name of the identity resource.
372
+ * @param nextLink The nextLink from the previous successful call to the ListAssociatedResources
373
+ * method.
374
+ * @param options The options parameters.
375
+ */
376
+ private _listAssociatedResourcesNext(
377
+ resourceGroupName: string,
378
+ resourceName: string,
379
+ nextLink: string,
380
+ options?: UserAssignedIdentitiesListAssociatedResourcesNextOptionalParams
381
+ ): Promise<UserAssignedIdentitiesListAssociatedResourcesNextResponse> {
382
+ return this.client.sendOperationRequest(
383
+ { resourceGroupName, resourceName, nextLink, options },
384
+ listAssociatedResourcesNextOperationSpec
385
+ );
386
+ }
274
387
  }
275
388
  // Operation Specifications
276
389
  const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
@@ -313,6 +426,35 @@ const listByResourceGroupOperationSpec: coreClient.OperationSpec = {
313
426
  headerParameters: [Parameters.accept],
314
427
  serializer
315
428
  };
429
+ const listAssociatedResourcesOperationSpec: coreClient.OperationSpec = {
430
+ path:
431
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}/listAssociatedResources",
432
+ httpMethod: "POST",
433
+ responses: {
434
+ 200: {
435
+ bodyMapper: Mappers.AssociatedResourcesListResult
436
+ },
437
+ default: {
438
+ bodyMapper: Mappers.CloudError
439
+ }
440
+ },
441
+ queryParameters: [
442
+ Parameters.apiVersion,
443
+ Parameters.filter,
444
+ Parameters.orderby,
445
+ Parameters.top,
446
+ Parameters.skip,
447
+ Parameters.skiptoken
448
+ ],
449
+ urlParameters: [
450
+ Parameters.$host,
451
+ Parameters.subscriptionId,
452
+ Parameters.resourceGroupName,
453
+ Parameters.resourceName
454
+ ],
455
+ headerParameters: [Parameters.accept],
456
+ serializer
457
+ };
316
458
  const createOrUpdateOperationSpec: coreClient.OperationSpec = {
317
459
  path:
318
460
  "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{resourceName}",
@@ -448,3 +590,32 @@ const listByResourceGroupNextOperationSpec: coreClient.OperationSpec = {
448
590
  headerParameters: [Parameters.accept],
449
591
  serializer
450
592
  };
593
+ const listAssociatedResourcesNextOperationSpec: coreClient.OperationSpec = {
594
+ path: "{nextLink}",
595
+ httpMethod: "GET",
596
+ responses: {
597
+ 200: {
598
+ bodyMapper: Mappers.AssociatedResourcesListResult
599
+ },
600
+ default: {
601
+ bodyMapper: Mappers.CloudError
602
+ }
603
+ },
604
+ queryParameters: [
605
+ Parameters.apiVersion,
606
+ Parameters.filter,
607
+ Parameters.orderby,
608
+ Parameters.top,
609
+ Parameters.skip,
610
+ Parameters.skiptoken
611
+ ],
612
+ urlParameters: [
613
+ Parameters.$host,
614
+ Parameters.nextLink,
615
+ Parameters.subscriptionId,
616
+ Parameters.resourceGroupName,
617
+ Parameters.resourceName
618
+ ],
619
+ headerParameters: [Parameters.accept],
620
+ serializer
621
+ };
@@ -11,6 +11,8 @@ import {
11
11
  Identity,
12
12
  UserAssignedIdentitiesListBySubscriptionOptionalParams,
13
13
  UserAssignedIdentitiesListByResourceGroupOptionalParams,
14
+ AzureResource,
15
+ UserAssignedIdentitiesListAssociatedResourcesOptionalParams,
14
16
  UserAssignedIdentitiesCreateOrUpdateOptionalParams,
15
17
  UserAssignedIdentitiesCreateOrUpdateResponse,
16
18
  IdentityUpdate,
@@ -40,6 +42,17 @@ export interface UserAssignedIdentities {
40
42
  resourceGroupName: string,
41
43
  options?: UserAssignedIdentitiesListByResourceGroupOptionalParams
42
44
  ): PagedAsyncIterableIterator<Identity>;
45
+ /**
46
+ * Lists the associated resources for this identity.
47
+ * @param resourceGroupName The name of the Resource Group to which the identity belongs.
48
+ * @param resourceName The name of the identity resource.
49
+ * @param options The options parameters.
50
+ */
51
+ listAssociatedResources(
52
+ resourceGroupName: string,
53
+ resourceName: string,
54
+ options?: UserAssignedIdentitiesListAssociatedResourcesOptionalParams
55
+ ): PagedAsyncIterableIterator<AzureResource>;
43
56
  /**
44
57
  * Create or update an identity in the specified subscription and resource group.
45
58
  * @param resourceGroupName The name of the Resource Group to which the identity belongs.
package/tsconfig.json CHANGED
@@ -9,11 +9,25 @@
9
9
  "esModuleInterop": true,
10
10
  "allowSyntheticDefaultImports": true,
11
11
  "forceConsistentCasingInFileNames": true,
12
- "lib": ["es6", "dom"],
12
+ "lib": [
13
+ "es6",
14
+ "dom"
15
+ ],
13
16
  "declaration": true,
14
17
  "outDir": "./dist-esm",
15
- "importHelpers": true
18
+ "importHelpers": true,
19
+ "paths": {
20
+ "@azure/arm-msi": [
21
+ "./src/index"
22
+ ]
23
+ }
16
24
  },
17
- "include": ["./src/**/*.ts", "./test/**/*.ts"],
18
- "exclude": ["node_modules"]
19
- }
25
+ "include": [
26
+ "./src/**/*.ts",
27
+ "./test/**/*.ts",
28
+ "samples-dev/**/*.ts"
29
+ ],
30
+ "exclude": [
31
+ "node_modules"
32
+ ]
33
+ }
@@ -2,6 +2,59 @@ import * as coreAuth from '@azure/core-auth';
2
2
  import * as coreClient from '@azure/core-client';
3
3
  import { PagedAsyncIterableIterator } from '@azure/core-paging';
4
4
 
5
+ /** Azure resources returned by the resource action to get a list of assigned resources. */
6
+ export declare interface AssociatedResourcesListResult {
7
+ /**
8
+ * Total number of Azure resources assigned to the identity.
9
+ * NOTE: This property will not be serialized. It can only be populated by the server.
10
+ */
11
+ readonly totalCount?: number;
12
+ /**
13
+ * The collection of Azure resources returned by the resource action to get a list of assigned resources.
14
+ * NOTE: This property will not be serialized. It can only be populated by the server.
15
+ */
16
+ readonly value?: AzureResource[];
17
+ /**
18
+ * The url to get the next page of results, if any.
19
+ * NOTE: This property will not be serialized. It can only be populated by the server.
20
+ */
21
+ readonly nextLink?: string;
22
+ }
23
+
24
+ /** Describes an Azure resource that is attached to an identity. */
25
+ export declare interface AzureResource {
26
+ /**
27
+ * The ID of this resource.
28
+ * NOTE: This property will not be serialized. It can only be populated by the server.
29
+ */
30
+ readonly id?: string;
31
+ /**
32
+ * The name of this resource.
33
+ * NOTE: This property will not be serialized. It can only be populated by the server.
34
+ */
35
+ readonly name?: string;
36
+ /**
37
+ * The type of this resource.
38
+ * NOTE: This property will not be serialized. It can only be populated by the server.
39
+ */
40
+ readonly type?: string;
41
+ /**
42
+ * The name of the resource group this resource belongs to.
43
+ * NOTE: This property will not be serialized. It can only be populated by the server.
44
+ */
45
+ readonly resourceGroup?: string;
46
+ /**
47
+ * The ID of the subscription this resource belongs to.
48
+ * NOTE: This property will not be serialized. It can only be populated by the server.
49
+ */
50
+ readonly subscriptionId?: string;
51
+ /**
52
+ * The name of the subscription this resource belongs to.
53
+ * NOTE: This property will not be serialized. It can only be populated by the server.
54
+ */
55
+ readonly subscriptionDisplayName?: string;
56
+ }
57
+
5
58
  /** An error response from the ManagedServiceIdentity service. */
6
59
  export declare interface CloudError {
7
60
  /** A list of additional details about the error. */
@@ -234,6 +287,13 @@ export declare interface UserAssignedIdentities {
234
287
  * @param options The options parameters.
235
288
  */
236
289
  listByResourceGroup(resourceGroupName: string, options?: UserAssignedIdentitiesListByResourceGroupOptionalParams): PagedAsyncIterableIterator<Identity>;
290
+ /**
291
+ * Lists the associated resources for this identity.
292
+ * @param resourceGroupName The name of the Resource Group to which the identity belongs.
293
+ * @param resourceName The name of the identity resource.
294
+ * @param options The options parameters.
295
+ */
296
+ listAssociatedResources(resourceGroupName: string, resourceName: string, options?: UserAssignedIdentitiesListAssociatedResourcesOptionalParams): PagedAsyncIterableIterator<AzureResource>;
237
297
  /**
238
298
  * Create or update an identity in the specified subscription and resource group.
239
299
  * @param resourceGroupName The name of the Resource Group to which the identity belongs.
@@ -284,6 +344,40 @@ export declare interface UserAssignedIdentitiesGetOptionalParams extends coreCli
284
344
  /** Contains response data for the get operation. */
285
345
  export declare type UserAssignedIdentitiesGetResponse = Identity;
286
346
 
347
+ /** Optional parameters. */
348
+ export declare interface UserAssignedIdentitiesListAssociatedResourcesNextOptionalParams extends coreClient.OperationOptions {
349
+ /** OData filter expression to apply to the query. */
350
+ filter?: string;
351
+ /** OData orderBy expression to apply to the query. */
352
+ orderby?: string;
353
+ /** Number of records to return. */
354
+ top?: number;
355
+ /** Number of records to skip. */
356
+ skip?: number;
357
+ /** 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. */
358
+ skiptoken?: string;
359
+ }
360
+
361
+ /** Contains response data for the listAssociatedResourcesNext operation. */
362
+ export declare type UserAssignedIdentitiesListAssociatedResourcesNextResponse = AssociatedResourcesListResult;
363
+
364
+ /** Optional parameters. */
365
+ export declare interface UserAssignedIdentitiesListAssociatedResourcesOptionalParams extends coreClient.OperationOptions {
366
+ /** OData filter expression to apply to the query. */
367
+ filter?: string;
368
+ /** OData orderBy expression to apply to the query. */
369
+ orderby?: string;
370
+ /** Number of records to return. */
371
+ top?: number;
372
+ /** Number of records to skip. */
373
+ skip?: number;
374
+ /** 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. */
375
+ skiptoken?: string;
376
+ }
377
+
378
+ /** Contains response data for the listAssociatedResources operation. */
379
+ export declare type UserAssignedIdentitiesListAssociatedResourcesResponse = AssociatedResourcesListResult;
380
+
287
381
  /** Optional parameters. */
288
382
  export declare interface UserAssignedIdentitiesListByResourceGroupNextOptionalParams extends coreClient.OperationOptions {
289
383
  }