@azure/arm-msi 1.2.0 → 2.0.1-alpha.20211220.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 (129) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +69 -80
  4. package/dist/index.js +1029 -0
  5. package/dist/index.js.map +1 -0
  6. package/dist/index.min.js +1 -0
  7. package/dist/index.min.js.map +1 -0
  8. package/dist-esm/src/index.d.ts +5 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +12 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/managedServiceIdentityClient.d.ts +20 -0
  13. package/dist-esm/src/managedServiceIdentityClient.d.ts.map +1 -0
  14. package/dist-esm/src/managedServiceIdentityClient.js +53 -0
  15. package/dist-esm/src/managedServiceIdentityClient.js.map +1 -0
  16. package/dist-esm/src/models/index.d.ts +212 -0
  17. package/dist-esm/src/models/index.d.ts.map +1 -0
  18. package/dist-esm/src/models/index.js +9 -0
  19. package/dist-esm/src/models/index.js.map +1 -0
  20. package/dist-esm/src/models/mappers.d.ts +14 -0
  21. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  22. package/dist-esm/src/models/mappers.js +325 -0
  23. package/dist-esm/src/models/mappers.js.map +1 -0
  24. package/dist-esm/src/models/parameters.d.ts +13 -0
  25. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  26. package/dist-esm/src/models/parameters.js +113 -0
  27. package/dist-esm/src/models/parameters.js.map +1 -0
  28. package/dist-esm/src/operations/index.d.ts +4 -0
  29. package/dist-esm/src/operations/index.d.ts.map +1 -0
  30. package/dist-esm/src/operations/index.js +11 -0
  31. package/dist-esm/src/operations/index.js.map +1 -0
  32. package/dist-esm/src/operations/operations.d.ts +32 -0
  33. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  34. package/dist-esm/src/operations/operations.js +120 -0
  35. package/dist-esm/src/operations/operations.js.map +1 -0
  36. package/dist-esm/src/operations/systemAssignedIdentities.d.ts +20 -0
  37. package/dist-esm/src/operations/systemAssignedIdentities.d.ts.map +1 -0
  38. package/dist-esm/src/operations/systemAssignedIdentities.js +48 -0
  39. package/dist-esm/src/operations/systemAssignedIdentities.js.map +1 -0
  40. package/dist-esm/src/operations/userAssignedIdentities.d.ts +83 -0
  41. package/dist-esm/src/operations/userAssignedIdentities.d.ts.map +1 -0
  42. package/dist-esm/src/operations/userAssignedIdentities.js +359 -0
  43. package/dist-esm/src/operations/userAssignedIdentities.js.map +1 -0
  44. package/dist-esm/src/operationsInterfaces/index.d.ts +4 -0
  45. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  46. package/dist-esm/src/operationsInterfaces/index.js +11 -0
  47. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  48. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  49. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  50. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  51. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  52. package/dist-esm/src/operationsInterfaces/systemAssignedIdentities.d.ts +12 -0
  53. package/dist-esm/src/operationsInterfaces/systemAssignedIdentities.d.ts.map +1 -0
  54. package/dist-esm/src/operationsInterfaces/systemAssignedIdentities.js +9 -0
  55. package/dist-esm/src/operationsInterfaces/systemAssignedIdentities.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/userAssignedIdentities.d.ts +47 -0
  57. package/dist-esm/src/operationsInterfaces/userAssignedIdentities.d.ts.map +1 -0
  58. package/dist-esm/src/operationsInterfaces/userAssignedIdentities.js +9 -0
  59. package/dist-esm/src/operationsInterfaces/userAssignedIdentities.js.map +1 -0
  60. package/dist-esm/test/sampleTest.d.ts +2 -0
  61. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  62. package/dist-esm/test/sampleTest.js +40 -0
  63. package/dist-esm/test/sampleTest.js.map +1 -0
  64. package/package.json +67 -24
  65. package/review/arm-msi.api.md +218 -0
  66. package/rollup.config.js +184 -27
  67. package/src/index.ts +12 -0
  68. package/src/managedServiceIdentityClient.ts +74 -37
  69. package/src/models/index.ts +194 -304
  70. package/src/models/mappers.ts +245 -85
  71. package/src/models/parameters.ts +83 -24
  72. package/src/operations/index.ts +4 -5
  73. package/src/operations/operations.ts +87 -73
  74. package/src/operations/systemAssignedIdentities.ts +65 -0
  75. package/src/operations/userAssignedIdentities.ts +278 -307
  76. package/src/operationsInterfaces/index.ts +11 -0
  77. package/src/operationsInterfaces/operations.ts +22 -0
  78. package/src/operationsInterfaces/systemAssignedIdentities.ts +26 -0
  79. package/src/operationsInterfaces/userAssignedIdentities.ts +91 -0
  80. package/tsconfig.json +4 -4
  81. package/types/arm-msi.d.ts +330 -0
  82. package/types/tsdoc-metadata.json +11 -0
  83. package/dist/arm-msi.js +0 -830
  84. package/dist/arm-msi.js.map +0 -1
  85. package/dist/arm-msi.min.js +0 -1
  86. package/dist/arm-msi.min.js.map +0 -1
  87. package/esm/managedServiceIdentityClient.d.ts +0 -25
  88. package/esm/managedServiceIdentityClient.d.ts.map +0 -1
  89. package/esm/managedServiceIdentityClient.js +0 -39
  90. package/esm/managedServiceIdentityClient.js.map +0 -1
  91. package/esm/managedServiceIdentityClientContext.d.ts +0 -22
  92. package/esm/managedServiceIdentityClientContext.d.ts.map +0 -1
  93. package/esm/managedServiceIdentityClientContext.js +0 -61
  94. package/esm/managedServiceIdentityClientContext.js.map +0 -1
  95. package/esm/models/index.d.ts +0 -332
  96. package/esm/models/index.d.ts.map +0 -1
  97. package/esm/models/index.js +0 -10
  98. package/esm/models/index.js.map +0 -1
  99. package/esm/models/mappers.d.ts +0 -9
  100. package/esm/models/mappers.d.ts.map +0 -1
  101. package/esm/models/mappers.js +0 -197
  102. package/esm/models/mappers.js.map +0 -1
  103. package/esm/models/operationsMappers.d.ts +0 -2
  104. package/esm/models/operationsMappers.d.ts.map +0 -1
  105. package/esm/models/operationsMappers.js +0 -11
  106. package/esm/models/operationsMappers.js.map +0 -1
  107. package/esm/models/parameters.d.ts +0 -8
  108. package/esm/models/parameters.d.ts.map +0 -1
  109. package/esm/models/parameters.js +0 -71
  110. package/esm/models/parameters.js.map +0 -1
  111. package/esm/models/userAssignedIdentitiesMappers.d.ts +0 -2
  112. package/esm/models/userAssignedIdentitiesMappers.d.ts.map +0 -1
  113. package/esm/models/userAssignedIdentitiesMappers.js +0 -11
  114. package/esm/models/userAssignedIdentitiesMappers.js.map +0 -1
  115. package/esm/operations/index.d.ts +0 -3
  116. package/esm/operations/index.d.ts.map +0 -1
  117. package/esm/operations/index.js +0 -12
  118. package/esm/operations/index.js.map +0 -1
  119. package/esm/operations/operations.d.ts +0 -46
  120. package/esm/operations/operations.d.ts.map +0 -1
  121. package/esm/operations/operations.js +0 -77
  122. package/esm/operations/operations.js.map +0 -1
  123. package/esm/operations/userAssignedIdentities.d.ts +0 -172
  124. package/esm/operations/userAssignedIdentities.d.ts.map +0 -1
  125. package/esm/operations/userAssignedIdentities.js +0 -272
  126. package/esm/operations/userAssignedIdentities.js.map +0 -1
  127. package/src/managedServiceIdentityClientContext.ts +0 -68
  128. package/src/models/operationsMappers.ts +0 -17
  129. package/src/models/userAssignedIdentitiesMappers.ts +0 -17
@@ -1,95 +1,111 @@
1
1
  /*
2
- * Copyright (c) Microsoft Corporation. All rights reserved.
3
- * Licensed under the MIT License. See License.txt in the project root for
4
- * license information.
2
+ * Copyright (c) Microsoft Corporation.
3
+ * Licensed under the MIT License.
5
4
  *
6
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
7
- * Changes may cause incorrect behavior and will be lost if the code is
8
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
9
7
  */
10
8
 
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as Models from "../models";
13
- import * as Mappers from "../models/operationsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { Operations } from "../operationsInterfaces";
11
+ import * as coreClient from "@azure/core-client";
12
+ import * as Mappers from "../models/mappers";
14
13
  import * as Parameters from "../models/parameters";
15
- import { ManagedServiceIdentityClientContext } from "../managedServiceIdentityClientContext";
14
+ import { ManagedServiceIdentityClient } from "../managedServiceIdentityClient";
15
+ import {
16
+ Operation,
17
+ OperationsListNextOptionalParams,
18
+ OperationsListOptionalParams,
19
+ OperationsListResponse,
20
+ OperationsListNextResponse
21
+ } from "../models";
16
22
 
17
- /** Class representing a Operations. */
18
- export class Operations {
19
- private readonly client: ManagedServiceIdentityClientContext;
23
+ /// <reference lib="esnext.asynciterable" />
24
+ /** Class containing Operations operations. */
25
+ export class OperationsImpl implements Operations {
26
+ private readonly client: ManagedServiceIdentityClient;
20
27
 
21
28
  /**
22
- * Create a Operations.
23
- * @param {ManagedServiceIdentityClientContext} client Reference to the service client.
29
+ * Initialize a new instance of the class Operations class.
30
+ * @param client Reference to the service client
24
31
  */
25
- constructor(client: ManagedServiceIdentityClientContext) {
32
+ constructor(client: ManagedServiceIdentityClient) {
26
33
  this.client = client;
27
34
  }
28
35
 
29
36
  /**
30
37
  * Lists available operations for the Microsoft.ManagedIdentity provider
31
- * @param [options] The optional parameters
32
- * @returns Promise<Models.OperationsListResponse>
38
+ * @param options The options parameters.
33
39
  */
34
- list(options?: msRest.RequestOptionsBase): Promise<Models.OperationsListResponse>;
35
- /**
36
- * @param callback The callback
37
- */
38
- list(callback: msRest.ServiceCallback<Models.OperationListResult>): void;
39
- /**
40
- * @param options The optional parameters
41
- * @param callback The callback
42
- */
43
- list(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
44
- list(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.OperationsListResponse> {
45
- return this.client.sendOperationRequest(
46
- {
47
- options
40
+ public list(
41
+ options?: OperationsListOptionalParams
42
+ ): PagedAsyncIterableIterator<Operation> {
43
+ const iter = this.listPagingAll(options);
44
+ return {
45
+ next() {
46
+ return iter.next();
47
+ },
48
+ [Symbol.asyncIterator]() {
49
+ return this;
48
50
  },
49
- listOperationSpec,
50
- callback) as Promise<Models.OperationsListResponse>;
51
+ byPage: () => {
52
+ return this.listPagingPage(options);
53
+ }
54
+ };
55
+ }
56
+
57
+ private async *listPagingPage(
58
+ options?: OperationsListOptionalParams
59
+ ): AsyncIterableIterator<Operation[]> {
60
+ let result = await this._list(options);
61
+ yield result.value || [];
62
+ let continuationToken = result.nextLink;
63
+ while (continuationToken) {
64
+ result = await this._listNext(continuationToken, options);
65
+ continuationToken = result.nextLink;
66
+ yield result.value || [];
67
+ }
68
+ }
69
+
70
+ private async *listPagingAll(
71
+ options?: OperationsListOptionalParams
72
+ ): AsyncIterableIterator<Operation> {
73
+ for await (const page of this.listPagingPage(options)) {
74
+ yield* page;
75
+ }
51
76
  }
52
77
 
53
78
  /**
54
79
  * Lists available operations for the Microsoft.ManagedIdentity provider
55
- * @param nextPageLink The NextLink from the previous successful call to List operation.
56
- * @param [options] The optional parameters
57
- * @returns Promise<Models.OperationsListNextResponse>
58
- */
59
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase): Promise<Models.OperationsListNextResponse>;
60
- /**
61
- * @param nextPageLink The NextLink from the previous successful call to List operation.
62
- * @param callback The callback
80
+ * @param options The options parameters.
63
81
  */
64
- listNext(nextPageLink: string, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
82
+ private _list(
83
+ options?: OperationsListOptionalParams
84
+ ): Promise<OperationsListResponse> {
85
+ return this.client.sendOperationRequest({ options }, listOperationSpec);
86
+ }
87
+
65
88
  /**
66
- * @param nextPageLink The NextLink from the previous successful call to List operation.
67
- * @param options The optional parameters
68
- * @param callback The callback
89
+ * ListNext
90
+ * @param nextLink The nextLink from the previous successful call to the List method.
91
+ * @param options The options parameters.
69
92
  */
70
- listNext(nextPageLink: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.OperationListResult>): void;
71
- listNext(nextPageLink: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.OperationListResult>, callback?: msRest.ServiceCallback<Models.OperationListResult>): Promise<Models.OperationsListNextResponse> {
93
+ private _listNext(
94
+ nextLink: string,
95
+ options?: OperationsListNextOptionalParams
96
+ ): Promise<OperationsListNextResponse> {
72
97
  return this.client.sendOperationRequest(
73
- {
74
- nextPageLink,
75
- options
76
- },
77
- listNextOperationSpec,
78
- callback) as Promise<Models.OperationsListNextResponse>;
98
+ { nextLink, options },
99
+ listNextOperationSpec
100
+ );
79
101
  }
80
102
  }
81
-
82
103
  // Operation Specifications
83
- const serializer = new msRest.Serializer(Mappers);
84
- const listOperationSpec: msRest.OperationSpec = {
104
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
105
+
106
+ const listOperationSpec: coreClient.OperationSpec = {
107
+ path: "/providers/Microsoft.ManagedIdentity/operations",
85
108
  httpMethod: "GET",
86
- path: "providers/Microsoft.ManagedIdentity/operations",
87
- queryParameters: [
88
- Parameters.apiVersion
89
- ],
90
- headerParameters: [
91
- Parameters.acceptLanguage
92
- ],
93
109
  responses: {
94
110
  200: {
95
111
  bodyMapper: Mappers.OperationListResult
@@ -98,19 +114,14 @@ const listOperationSpec: msRest.OperationSpec = {
98
114
  bodyMapper: Mappers.CloudError
99
115
  }
100
116
  },
117
+ queryParameters: [Parameters.apiVersion],
118
+ urlParameters: [Parameters.$host],
119
+ headerParameters: [Parameters.accept],
101
120
  serializer
102
121
  };
103
-
104
- const listNextOperationSpec: msRest.OperationSpec = {
105
- httpMethod: "GET",
106
- baseUrl: "https://management.azure.com",
122
+ const listNextOperationSpec: coreClient.OperationSpec = {
107
123
  path: "{nextLink}",
108
- urlParameters: [
109
- Parameters.nextPageLink
110
- ],
111
- headerParameters: [
112
- Parameters.acceptLanguage
113
- ],
124
+ httpMethod: "GET",
114
125
  responses: {
115
126
  200: {
116
127
  bodyMapper: Mappers.OperationListResult
@@ -119,5 +130,8 @@ const listNextOperationSpec: msRest.OperationSpec = {
119
130
  bodyMapper: Mappers.CloudError
120
131
  }
121
132
  },
133
+ queryParameters: [Parameters.apiVersion],
134
+ urlParameters: [Parameters.$host, Parameters.nextLink],
135
+ headerParameters: [Parameters.accept],
122
136
  serializer
123
137
  };
@@ -0,0 +1,65 @@
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
+ import { SystemAssignedIdentities } from "../operationsInterfaces";
10
+ import * as coreClient from "@azure/core-client";
11
+ import * as Mappers from "../models/mappers";
12
+ import * as Parameters from "../models/parameters";
13
+ import { ManagedServiceIdentityClient } from "../managedServiceIdentityClient";
14
+ import {
15
+ SystemAssignedIdentitiesGetByScopeOptionalParams,
16
+ SystemAssignedIdentitiesGetByScopeResponse
17
+ } from "../models";
18
+
19
+ /** Class containing SystemAssignedIdentities operations. */
20
+ export class SystemAssignedIdentitiesImpl implements SystemAssignedIdentities {
21
+ private readonly client: ManagedServiceIdentityClient;
22
+
23
+ /**
24
+ * Initialize a new instance of the class SystemAssignedIdentities class.
25
+ * @param client Reference to the service client
26
+ */
27
+ constructor(client: ManagedServiceIdentityClient) {
28
+ this.client = client;
29
+ }
30
+
31
+ /**
32
+ * Gets the systemAssignedIdentity available under the specified RP scope.
33
+ * @param scope The resource provider scope of the resource. Parent resource being extended by Managed
34
+ * Identities.
35
+ * @param options The options parameters.
36
+ */
37
+ getByScope(
38
+ scope: string,
39
+ options?: SystemAssignedIdentitiesGetByScopeOptionalParams
40
+ ): Promise<SystemAssignedIdentitiesGetByScopeResponse> {
41
+ return this.client.sendOperationRequest(
42
+ { scope, options },
43
+ getByScopeOperationSpec
44
+ );
45
+ }
46
+ }
47
+ // Operation Specifications
48
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
49
+
50
+ const getByScopeOperationSpec: coreClient.OperationSpec = {
51
+ path: "/{scope}/providers/Microsoft.ManagedIdentity/identities/default",
52
+ httpMethod: "GET",
53
+ responses: {
54
+ 200: {
55
+ bodyMapper: Mappers.SystemAssignedIdentity
56
+ },
57
+ default: {
58
+ bodyMapper: Mappers.CloudError
59
+ }
60
+ },
61
+ queryParameters: [Parameters.apiVersion],
62
+ urlParameters: [Parameters.$host, Parameters.scope],
63
+ headerParameters: [Parameters.accept],
64
+ serializer
65
+ };