@azure/arm-managementgroups 1.2.0 → 2.0.0-alpha.20211215.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 (173) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +72 -83
  4. package/dist/index.js +2881 -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 +6 -0
  9. package/dist-esm/src/index.d.ts.map +1 -0
  10. package/dist-esm/src/index.js +13 -0
  11. package/dist-esm/src/index.js.map +1 -0
  12. package/dist-esm/src/lroImpl.d.ts +16 -0
  13. package/dist-esm/src/lroImpl.d.ts.map +1 -0
  14. package/dist-esm/src/lroImpl.js +29 -0
  15. package/dist-esm/src/lroImpl.js.map +1 -0
  16. package/dist-esm/src/managementGroupsAPI.d.ts +34 -0
  17. package/dist-esm/src/managementGroupsAPI.d.ts.map +1 -0
  18. package/dist-esm/src/managementGroupsAPI.js +102 -0
  19. package/dist-esm/src/managementGroupsAPI.js.map +1 -0
  20. package/dist-esm/src/managementGroupsAPIContext.d.ts +14 -0
  21. package/dist-esm/src/managementGroupsAPIContext.d.ts.map +1 -0
  22. package/dist-esm/src/managementGroupsAPIContext.js +43 -0
  23. package/dist-esm/src/managementGroupsAPIContext.js.map +1 -0
  24. package/dist-esm/src/models/index.d.ts +956 -0
  25. package/dist-esm/src/models/index.d.ts.map +1 -0
  26. package/dist-esm/src/models/index.js +46 -0
  27. package/dist-esm/src/models/index.js.map +1 -0
  28. package/dist-esm/src/models/mappers.d.ts +39 -0
  29. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  30. package/{esm → dist-esm/src}/models/mappers.js +776 -396
  31. package/dist-esm/src/models/mappers.js.map +1 -0
  32. package/dist-esm/src/models/parameters.d.ts +24 -0
  33. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  34. package/dist-esm/src/models/parameters.js +200 -0
  35. package/dist-esm/src/models/parameters.js.map +1 -0
  36. package/dist-esm/src/operations/entities.d.ts +34 -0
  37. package/dist-esm/src/operations/entities.d.ts.map +1 -0
  38. package/dist-esm/src/operations/entities.js +142 -0
  39. package/dist-esm/src/operations/entities.js.map +1 -0
  40. package/dist-esm/src/operations/hierarchySettingsOperations.d.ts +52 -0
  41. package/dist-esm/src/operations/hierarchySettingsOperations.d.ts.map +1 -0
  42. package/dist-esm/src/operations/hierarchySettingsOperations.js +154 -0
  43. package/dist-esm/src/operations/hierarchySettingsOperations.js.map +1 -0
  44. package/{esm → dist-esm/src}/operations/index.d.ts +1 -0
  45. package/dist-esm/src/operations/index.d.ts.map +1 -0
  46. package/{esm → dist-esm/src}/operations/index.js +4 -5
  47. package/dist-esm/src/operations/index.js.map +1 -0
  48. package/dist-esm/src/operations/managementGroupSubscriptions.d.ts +62 -0
  49. package/dist-esm/src/operations/managementGroupSubscriptions.d.ts.map +1 -0
  50. package/dist-esm/src/operations/managementGroupSubscriptions.js +215 -0
  51. package/dist-esm/src/operations/managementGroupSubscriptions.js.map +1 -0
  52. package/dist-esm/src/operations/managementGroups.d.ts +109 -0
  53. package/dist-esm/src/operations/managementGroups.d.ts.map +1 -0
  54. package/dist-esm/src/operations/managementGroups.js +462 -0
  55. package/dist-esm/src/operations/managementGroups.js.map +1 -0
  56. package/dist-esm/src/operations/operations.d.ts +32 -0
  57. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  58. package/dist-esm/src/operations/operations.js +120 -0
  59. package/dist-esm/src/operations/operations.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/entities.d.ts +12 -0
  61. package/dist-esm/src/operationsInterfaces/entities.d.ts.map +1 -0
  62. package/dist-esm/src/operationsInterfaces/entities.js +9 -0
  63. package/dist-esm/src/operationsInterfaces/entities.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.d.ts +44 -0
  65. package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
  69. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/index.js +13 -0
  71. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.d.ts +37 -0
  73. package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.js +9 -0
  75. package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/managementGroups.d.ts +71 -0
  77. package/dist-esm/src/operationsInterfaces/managementGroups.d.ts.map +1 -0
  78. package/dist-esm/src/operationsInterfaces/managementGroups.js +9 -0
  79. package/dist-esm/src/operationsInterfaces/managementGroups.js.map +1 -0
  80. package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
  81. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  82. package/dist-esm/src/operationsInterfaces/operations.js +9 -0
  83. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  84. package/dist-esm/test/sampleTest.d.ts +2 -0
  85. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  86. package/dist-esm/test/sampleTest.js +40 -0
  87. package/dist-esm/test/sampleTest.js.map +1 -0
  88. package/package.json +69 -24
  89. package/review/arm-managementgroups.api.md +667 -0
  90. package/rollup.config.js +184 -27
  91. package/src/index.ts +13 -0
  92. package/src/lroImpl.ts +34 -0
  93. package/src/managementGroupsAPI.ts +93 -130
  94. package/src/managementGroupsAPIContext.ts +45 -45
  95. package/src/models/index.ts +801 -1185
  96. package/src/models/mappers.ts +792 -400
  97. package/src/models/parameters.ts +130 -94
  98. package/src/operations/entities.ts +105 -79
  99. package/src/operations/hierarchySettingsOperations.ts +214 -0
  100. package/src/operations/index.ts +4 -5
  101. package/src/operations/managementGroupSubscriptions.ts +226 -72
  102. package/src/operations/managementGroups.ts +449 -222
  103. package/src/operations/operations.ts +84 -70
  104. package/src/operationsInterfaces/entities.ts +23 -0
  105. package/src/operationsInterfaces/hierarchySettingsOperations.ts +80 -0
  106. package/src/operationsInterfaces/index.ts +13 -0
  107. package/src/operationsInterfaces/managementGroupSubscriptions.ts +69 -0
  108. package/src/operationsInterfaces/managementGroups.ts +131 -0
  109. package/src/operationsInterfaces/operations.ts +22 -0
  110. package/tsconfig.json +4 -4
  111. package/types/arm-managementgroups.d.ts +1266 -0
  112. package/types/tsdoc-metadata.json +11 -0
  113. package/dist/arm-managementgroups.js +0 -2017
  114. package/dist/arm-managementgroups.js.map +0 -1
  115. package/dist/arm-managementgroups.min.js +0 -1
  116. package/dist/arm-managementgroups.min.js.map +0 -1
  117. package/esm/managementGroupsAPI.d.ts +0 -74
  118. package/esm/managementGroupsAPI.d.ts.map +0 -1
  119. package/esm/managementGroupsAPI.js +0 -120
  120. package/esm/managementGroupsAPI.js.map +0 -1
  121. package/esm/managementGroupsAPIContext.d.ts +0 -20
  122. package/esm/managementGroupsAPIContext.d.ts.map +0 -1
  123. package/esm/managementGroupsAPIContext.js +0 -56
  124. package/esm/managementGroupsAPIContext.js.map +0 -1
  125. package/esm/models/entitiesMappers.d.ts +0 -2
  126. package/esm/models/entitiesMappers.d.ts.map +0 -1
  127. package/esm/models/entitiesMappers.js +0 -11
  128. package/esm/models/entitiesMappers.js.map +0 -1
  129. package/esm/models/index.d.ts +0 -1390
  130. package/esm/models/index.d.ts.map +0 -1
  131. package/esm/models/index.js +0 -10
  132. package/esm/models/index.js.map +0 -1
  133. package/esm/models/managementGroupSubscriptionsMappers.d.ts +0 -2
  134. package/esm/models/managementGroupSubscriptionsMappers.d.ts.map +0 -1
  135. package/esm/models/managementGroupSubscriptionsMappers.js +0 -11
  136. package/esm/models/managementGroupSubscriptionsMappers.js.map +0 -1
  137. package/esm/models/managementGroupsMappers.d.ts +0 -2
  138. package/esm/models/managementGroupsMappers.d.ts.map +0 -1
  139. package/esm/models/managementGroupsMappers.js +0 -11
  140. package/esm/models/managementGroupsMappers.js.map +0 -1
  141. package/esm/models/mappers.d.ts +0 -28
  142. package/esm/models/mappers.d.ts.map +0 -1
  143. package/esm/models/mappers.js.map +0 -1
  144. package/esm/models/operationsMappers.d.ts +0 -2
  145. package/esm/models/operationsMappers.d.ts.map +0 -1
  146. package/esm/models/operationsMappers.js +0 -11
  147. package/esm/models/operationsMappers.js.map +0 -1
  148. package/esm/models/parameters.d.ts +0 -18
  149. package/esm/models/parameters.d.ts.map +0 -1
  150. package/esm/models/parameters.js +0 -194
  151. package/esm/models/parameters.js.map +0 -1
  152. package/esm/operations/entities.d.ts +0 -46
  153. package/esm/operations/entities.d.ts.map +0 -1
  154. package/esm/operations/entities.js +0 -87
  155. package/esm/operations/entities.js.map +0 -1
  156. package/esm/operations/index.d.ts.map +0 -1
  157. package/esm/operations/index.js.map +0 -1
  158. package/esm/operations/managementGroupSubscriptions.d.ts +0 -55
  159. package/esm/operations/managementGroupSubscriptions.d.ts.map +0 -1
  160. package/esm/operations/managementGroupSubscriptions.js +0 -85
  161. package/esm/operations/managementGroupSubscriptions.js.map +0 -1
  162. package/esm/operations/managementGroups.d.ts +0 -120
  163. package/esm/operations/managementGroups.d.ts.map +0 -1
  164. package/esm/operations/managementGroups.js +0 -252
  165. package/esm/operations/managementGroups.js.map +0 -1
  166. package/esm/operations/operations.d.ts +0 -46
  167. package/esm/operations/operations.d.ts.map +0 -1
  168. package/esm/operations/operations.js +0 -77
  169. package/esm/operations/operations.js.map +0 -1
  170. package/src/models/entitiesMappers.ts +0 -18
  171. package/src/models/managementGroupSubscriptionsMappers.ts +0 -15
  172. package/src/models/managementGroupsMappers.ts +0 -29
  173. package/src/models/operationsMappers.ts +0 -18
@@ -0,0 +1,214 @@
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 { HierarchySettingsOperations } 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 { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
14
+ import {
15
+ HierarchySettingsListOptionalParams,
16
+ HierarchySettingsListResponse,
17
+ HierarchySettingsGetOptionalParams,
18
+ HierarchySettingsGetResponse,
19
+ CreateOrUpdateSettingsRequest,
20
+ HierarchySettingsCreateOrUpdateOptionalParams,
21
+ HierarchySettingsCreateOrUpdateResponse,
22
+ HierarchySettingsUpdateOptionalParams,
23
+ HierarchySettingsUpdateResponse,
24
+ HierarchySettingsDeleteOptionalParams
25
+ } from "../models";
26
+
27
+ /** Class containing HierarchySettingsOperations operations. */
28
+ export class HierarchySettingsOperationsImpl
29
+ implements HierarchySettingsOperations {
30
+ private readonly client: ManagementGroupsAPIContext;
31
+
32
+ /**
33
+ * Initialize a new instance of the class HierarchySettingsOperations class.
34
+ * @param client Reference to the service client
35
+ */
36
+ constructor(client: ManagementGroupsAPIContext) {
37
+ this.client = client;
38
+ }
39
+
40
+ /**
41
+ * Gets all the hierarchy settings defined at the Management Group level. Settings can only be set on
42
+ * the root Management Group of the hierarchy.
43
+ *
44
+ * @param groupId Management Group ID.
45
+ * @param options The options parameters.
46
+ */
47
+ list(
48
+ groupId: string,
49
+ options?: HierarchySettingsListOptionalParams
50
+ ): Promise<HierarchySettingsListResponse> {
51
+ return this.client.sendOperationRequest(
52
+ { groupId, options },
53
+ listOperationSpec
54
+ );
55
+ }
56
+
57
+ /**
58
+ * Gets the hierarchy settings defined at the Management Group level. Settings can only be set on the
59
+ * root Management Group of the hierarchy.
60
+ *
61
+ * @param groupId Management Group ID.
62
+ * @param options The options parameters.
63
+ */
64
+ get(
65
+ groupId: string,
66
+ options?: HierarchySettingsGetOptionalParams
67
+ ): Promise<HierarchySettingsGetResponse> {
68
+ return this.client.sendOperationRequest(
69
+ { groupId, options },
70
+ getOperationSpec
71
+ );
72
+ }
73
+
74
+ /**
75
+ * Creates or updates the hierarchy settings defined at the Management Group level.
76
+ *
77
+ * @param groupId Management Group ID.
78
+ * @param createTenantSettingsRequest Tenant level settings request parameter.
79
+ * @param options The options parameters.
80
+ */
81
+ createOrUpdate(
82
+ groupId: string,
83
+ createTenantSettingsRequest: CreateOrUpdateSettingsRequest,
84
+ options?: HierarchySettingsCreateOrUpdateOptionalParams
85
+ ): Promise<HierarchySettingsCreateOrUpdateResponse> {
86
+ return this.client.sendOperationRequest(
87
+ { groupId, createTenantSettingsRequest, options },
88
+ createOrUpdateOperationSpec
89
+ );
90
+ }
91
+
92
+ /**
93
+ * Updates the hierarchy settings defined at the Management Group level.
94
+ *
95
+ * @param groupId Management Group ID.
96
+ * @param createTenantSettingsRequest Tenant level settings request parameter.
97
+ * @param options The options parameters.
98
+ */
99
+ update(
100
+ groupId: string,
101
+ createTenantSettingsRequest: CreateOrUpdateSettingsRequest,
102
+ options?: HierarchySettingsUpdateOptionalParams
103
+ ): Promise<HierarchySettingsUpdateResponse> {
104
+ return this.client.sendOperationRequest(
105
+ { groupId, createTenantSettingsRequest, options },
106
+ updateOperationSpec
107
+ );
108
+ }
109
+
110
+ /**
111
+ * Deletes the hierarchy settings defined at the Management Group level.
112
+ *
113
+ * @param groupId Management Group ID.
114
+ * @param options The options parameters.
115
+ */
116
+ delete(
117
+ groupId: string,
118
+ options?: HierarchySettingsDeleteOptionalParams
119
+ ): Promise<void> {
120
+ return this.client.sendOperationRequest(
121
+ { groupId, options },
122
+ deleteOperationSpec
123
+ );
124
+ }
125
+ }
126
+ // Operation Specifications
127
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
128
+
129
+ const listOperationSpec: coreClient.OperationSpec = {
130
+ path: "/providers/Microsoft.Management/managementGroups/{groupId}/settings",
131
+ httpMethod: "GET",
132
+ responses: {
133
+ 200: {
134
+ bodyMapper: Mappers.HierarchySettingsList
135
+ },
136
+ default: {
137
+ bodyMapper: Mappers.ErrorResponse
138
+ }
139
+ },
140
+ queryParameters: [Parameters.apiVersion],
141
+ urlParameters: [Parameters.$host, Parameters.groupId],
142
+ headerParameters: [Parameters.accept],
143
+ serializer
144
+ };
145
+ const getOperationSpec: coreClient.OperationSpec = {
146
+ path:
147
+ "/providers/Microsoft.Management/managementGroups/{groupId}/settings/default",
148
+ httpMethod: "GET",
149
+ responses: {
150
+ 200: {
151
+ bodyMapper: Mappers.HierarchySettings
152
+ },
153
+ default: {
154
+ bodyMapper: Mappers.ErrorResponse
155
+ }
156
+ },
157
+ queryParameters: [Parameters.apiVersion],
158
+ urlParameters: [Parameters.$host, Parameters.groupId],
159
+ headerParameters: [Parameters.accept],
160
+ serializer
161
+ };
162
+ const createOrUpdateOperationSpec: coreClient.OperationSpec = {
163
+ path:
164
+ "/providers/Microsoft.Management/managementGroups/{groupId}/settings/default",
165
+ httpMethod: "PUT",
166
+ responses: {
167
+ 200: {
168
+ bodyMapper: Mappers.HierarchySettings
169
+ },
170
+ default: {
171
+ bodyMapper: Mappers.ErrorResponse
172
+ }
173
+ },
174
+ requestBody: Parameters.createTenantSettingsRequest,
175
+ queryParameters: [Parameters.apiVersion],
176
+ urlParameters: [Parameters.$host, Parameters.groupId],
177
+ headerParameters: [Parameters.accept, Parameters.contentType],
178
+ mediaType: "json",
179
+ serializer
180
+ };
181
+ const updateOperationSpec: coreClient.OperationSpec = {
182
+ path:
183
+ "/providers/Microsoft.Management/managementGroups/{groupId}/settings/default",
184
+ httpMethod: "PATCH",
185
+ responses: {
186
+ 200: {
187
+ bodyMapper: Mappers.HierarchySettings
188
+ },
189
+ default: {
190
+ bodyMapper: Mappers.ErrorResponse
191
+ }
192
+ },
193
+ requestBody: Parameters.createTenantSettingsRequest,
194
+ queryParameters: [Parameters.apiVersion],
195
+ urlParameters: [Parameters.$host, Parameters.groupId],
196
+ headerParameters: [Parameters.accept, Parameters.contentType],
197
+ mediaType: "json",
198
+ serializer
199
+ };
200
+ const deleteOperationSpec: coreClient.OperationSpec = {
201
+ path:
202
+ "/providers/Microsoft.Management/managementGroups/{groupId}/settings/default",
203
+ httpMethod: "DELETE",
204
+ responses: {
205
+ 200: {},
206
+ default: {
207
+ bodyMapper: Mappers.ErrorResponse
208
+ }
209
+ },
210
+ queryParameters: [Parameters.apiVersion],
211
+ urlParameters: [Parameters.$host, Parameters.groupId],
212
+ headerParameters: [Parameters.accept],
213
+ serializer
214
+ };
@@ -1,14 +1,13 @@
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
9
  export * from "./managementGroups";
12
10
  export * from "./managementGroupSubscriptions";
11
+ export * from "./hierarchySettingsOperations";
13
12
  export * from "./operations";
14
13
  export * from "./entities";
@@ -1,140 +1,294 @@
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/managementGroupSubscriptionsMappers";
9
+ import { PagedAsyncIterableIterator } from "@azure/core-paging";
10
+ import { ManagementGroupSubscriptions } 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
14
  import { ManagementGroupsAPIContext } from "../managementGroupsAPIContext";
15
+ import {
16
+ SubscriptionUnderManagementGroup,
17
+ ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupNextOptionalParams,
18
+ ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupOptionalParams,
19
+ ManagementGroupSubscriptionsCreateOptionalParams,
20
+ ManagementGroupSubscriptionsCreateResponse,
21
+ ManagementGroupSubscriptionsDeleteOptionalParams,
22
+ ManagementGroupSubscriptionsGetSubscriptionOptionalParams,
23
+ ManagementGroupSubscriptionsGetSubscriptionResponse,
24
+ ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupResponse,
25
+ ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupNextResponse
26
+ } from "../models";
16
27
 
17
- /** Class representing a ManagementGroupSubscriptions. */
18
- export class ManagementGroupSubscriptions {
28
+ /// <reference lib="esnext.asynciterable" />
29
+ /** Class containing ManagementGroupSubscriptions operations. */
30
+ export class ManagementGroupSubscriptionsImpl
31
+ implements ManagementGroupSubscriptions {
19
32
  private readonly client: ManagementGroupsAPIContext;
20
33
 
21
34
  /**
22
- * Create a ManagementGroupSubscriptions.
23
- * @param {ManagementGroupsAPIContext} client Reference to the service client.
35
+ * Initialize a new instance of the class ManagementGroupSubscriptions class.
36
+ * @param client Reference to the service client
24
37
  */
25
38
  constructor(client: ManagementGroupsAPIContext) {
26
39
  this.client = client;
27
40
  }
28
41
 
29
42
  /**
30
- * Associates existing subscription with the management group.
43
+ * Retrieves details about all subscriptions which are associated with the management group.
44
+ *
31
45
  * @param groupId Management Group ID.
32
- * @param subscriptionId Subscription ID.
33
- * @param [options] The optional parameters
34
- * @returns Promise<msRest.RestResponse>
46
+ * @param options The options parameters.
35
47
  */
36
- create(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsCreateOptionalParams): Promise<msRest.RestResponse>;
48
+ public listSubscriptionsUnderManagementGroup(
49
+ groupId: string,
50
+ options?: ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupOptionalParams
51
+ ): PagedAsyncIterableIterator<SubscriptionUnderManagementGroup> {
52
+ const iter = this.getSubscriptionsUnderManagementGroupPagingAll(
53
+ groupId,
54
+ options
55
+ );
56
+ return {
57
+ next() {
58
+ return iter.next();
59
+ },
60
+ [Symbol.asyncIterator]() {
61
+ return this;
62
+ },
63
+ byPage: () => {
64
+ return this.getSubscriptionsUnderManagementGroupPagingPage(
65
+ groupId,
66
+ options
67
+ );
68
+ }
69
+ };
70
+ }
71
+
72
+ private async *getSubscriptionsUnderManagementGroupPagingPage(
73
+ groupId: string,
74
+ options?: ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupOptionalParams
75
+ ): AsyncIterableIterator<SubscriptionUnderManagementGroup[]> {
76
+ let result = await this._getSubscriptionsUnderManagementGroup(
77
+ groupId,
78
+ options
79
+ );
80
+ yield result.value || [];
81
+ let continuationToken = result.nextLink;
82
+ while (continuationToken) {
83
+ result = await this._getSubscriptionsUnderManagementGroupNext(
84
+ groupId,
85
+ continuationToken,
86
+ options
87
+ );
88
+ continuationToken = result.nextLink;
89
+ yield result.value || [];
90
+ }
91
+ }
92
+
93
+ private async *getSubscriptionsUnderManagementGroupPagingAll(
94
+ groupId: string,
95
+ options?: ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupOptionalParams
96
+ ): AsyncIterableIterator<SubscriptionUnderManagementGroup> {
97
+ for await (const page of this.getSubscriptionsUnderManagementGroupPagingPage(
98
+ groupId,
99
+ options
100
+ )) {
101
+ yield* page;
102
+ }
103
+ }
104
+
37
105
  /**
106
+ * Associates existing subscription with the management group.
107
+ *
38
108
  * @param groupId Management Group ID.
39
109
  * @param subscriptionId Subscription ID.
40
- * @param callback The callback
110
+ * @param options The options parameters.
41
111
  */
42
- create(groupId: string, subscriptionId: string, callback: msRest.ServiceCallback<void>): void;
112
+ create(
113
+ groupId: string,
114
+ subscriptionId: string,
115
+ options?: ManagementGroupSubscriptionsCreateOptionalParams
116
+ ): Promise<ManagementGroupSubscriptionsCreateResponse> {
117
+ return this.client.sendOperationRequest(
118
+ { groupId, subscriptionId, options },
119
+ createOperationSpec
120
+ );
121
+ }
122
+
43
123
  /**
124
+ * De-associates subscription from the management group.
125
+ *
44
126
  * @param groupId Management Group ID.
45
127
  * @param subscriptionId Subscription ID.
46
- * @param options The optional parameters
47
- * @param callback The callback
128
+ * @param options The options parameters.
48
129
  */
49
- create(groupId: string, subscriptionId: string, options: Models.ManagementGroupSubscriptionsCreateOptionalParams, callback: msRest.ServiceCallback<void>): void;
50
- create(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsCreateOptionalParams | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
130
+ delete(
131
+ groupId: string,
132
+ subscriptionId: string,
133
+ options?: ManagementGroupSubscriptionsDeleteOptionalParams
134
+ ): Promise<void> {
51
135
  return this.client.sendOperationRequest(
52
- {
53
- groupId,
54
- subscriptionId,
55
- options
56
- },
57
- createOperationSpec,
58
- callback);
136
+ { groupId, subscriptionId, options },
137
+ deleteOperationSpec
138
+ );
59
139
  }
60
140
 
61
141
  /**
62
- * De-associates subscription from the management group.
142
+ * Retrieves details about given subscription which is associated with the management group.
143
+ *
63
144
  * @param groupId Management Group ID.
64
145
  * @param subscriptionId Subscription ID.
65
- * @param [options] The optional parameters
66
- * @returns Promise<msRest.RestResponse>
146
+ * @param options The options parameters.
67
147
  */
68
- deleteMethod(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsDeleteMethodOptionalParams): Promise<msRest.RestResponse>;
148
+ getSubscription(
149
+ groupId: string,
150
+ subscriptionId: string,
151
+ options?: ManagementGroupSubscriptionsGetSubscriptionOptionalParams
152
+ ): Promise<ManagementGroupSubscriptionsGetSubscriptionResponse> {
153
+ return this.client.sendOperationRequest(
154
+ { groupId, subscriptionId, options },
155
+ getSubscriptionOperationSpec
156
+ );
157
+ }
158
+
69
159
  /**
160
+ * Retrieves details about all subscriptions which are associated with the management group.
161
+ *
70
162
  * @param groupId Management Group ID.
71
- * @param subscriptionId Subscription ID.
72
- * @param callback The callback
163
+ * @param options The options parameters.
73
164
  */
74
- deleteMethod(groupId: string, subscriptionId: string, callback: msRest.ServiceCallback<void>): void;
165
+ private _getSubscriptionsUnderManagementGroup(
166
+ groupId: string,
167
+ options?: ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupOptionalParams
168
+ ): Promise<
169
+ ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupResponse
170
+ > {
171
+ return this.client.sendOperationRequest(
172
+ { groupId, options },
173
+ getSubscriptionsUnderManagementGroupOperationSpec
174
+ );
175
+ }
176
+
75
177
  /**
178
+ * GetSubscriptionsUnderManagementGroupNext
76
179
  * @param groupId Management Group ID.
77
- * @param subscriptionId Subscription ID.
78
- * @param options The optional parameters
79
- * @param callback The callback
180
+ * @param nextLink The nextLink from the previous successful call to the
181
+ * GetSubscriptionsUnderManagementGroup method.
182
+ * @param options The options parameters.
80
183
  */
81
- deleteMethod(groupId: string, subscriptionId: string, options: Models.ManagementGroupSubscriptionsDeleteMethodOptionalParams, callback: msRest.ServiceCallback<void>): void;
82
- deleteMethod(groupId: string, subscriptionId: string, options?: Models.ManagementGroupSubscriptionsDeleteMethodOptionalParams | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<msRest.RestResponse> {
184
+ private _getSubscriptionsUnderManagementGroupNext(
185
+ groupId: string,
186
+ nextLink: string,
187
+ options?: ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupNextOptionalParams
188
+ ): Promise<
189
+ ManagementGroupSubscriptionsGetSubscriptionsUnderManagementGroupNextResponse
190
+ > {
83
191
  return this.client.sendOperationRequest(
84
- {
85
- groupId,
86
- subscriptionId,
87
- options
88
- },
89
- deleteMethodOperationSpec,
90
- callback);
192
+ { groupId, nextLink, options },
193
+ getSubscriptionsUnderManagementGroupNextOperationSpec
194
+ );
91
195
  }
92
196
  }
93
-
94
197
  // Operation Specifications
95
- const serializer = new msRest.Serializer(Mappers);
96
- const createOperationSpec: msRest.OperationSpec = {
198
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
199
+
200
+ const createOperationSpec: coreClient.OperationSpec = {
201
+ path:
202
+ "/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}",
97
203
  httpMethod: "PUT",
98
- path: "providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}",
204
+ responses: {
205
+ 200: {
206
+ bodyMapper: Mappers.SubscriptionUnderManagementGroup
207
+ },
208
+ default: {
209
+ bodyMapper: Mappers.ErrorResponse
210
+ }
211
+ },
212
+ queryParameters: [Parameters.apiVersion],
99
213
  urlParameters: [
214
+ Parameters.$host,
100
215
  Parameters.groupId,
101
216
  Parameters.subscriptionId
102
217
  ],
103
- queryParameters: [
104
- Parameters.apiVersion
105
- ],
106
- headerParameters: [
107
- Parameters.cacheControl,
108
- Parameters.acceptLanguage
109
- ],
218
+ headerParameters: [Parameters.accept, Parameters.cacheControl],
219
+ serializer
220
+ };
221
+ const deleteOperationSpec: coreClient.OperationSpec = {
222
+ path:
223
+ "/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}",
224
+ httpMethod: "DELETE",
110
225
  responses: {
226
+ 200: {},
111
227
  204: {},
112
228
  default: {
113
229
  bodyMapper: Mappers.ErrorResponse
114
230
  }
115
231
  },
232
+ queryParameters: [Parameters.apiVersion],
233
+ urlParameters: [
234
+ Parameters.$host,
235
+ Parameters.groupId,
236
+ Parameters.subscriptionId
237
+ ],
238
+ headerParameters: [Parameters.accept, Parameters.cacheControl],
116
239
  serializer
117
240
  };
118
-
119
- const deleteMethodOperationSpec: msRest.OperationSpec = {
120
- httpMethod: "DELETE",
121
- path: "providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}",
241
+ const getSubscriptionOperationSpec: coreClient.OperationSpec = {
242
+ path:
243
+ "/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions/{subscriptionId}",
244
+ httpMethod: "GET",
245
+ responses: {
246
+ 200: {
247
+ bodyMapper: Mappers.SubscriptionUnderManagementGroup
248
+ },
249
+ default: {
250
+ bodyMapper: Mappers.ErrorResponse
251
+ }
252
+ },
253
+ queryParameters: [Parameters.apiVersion],
122
254
  urlParameters: [
255
+ Parameters.$host,
123
256
  Parameters.groupId,
124
257
  Parameters.subscriptionId
125
258
  ],
126
- queryParameters: [
127
- Parameters.apiVersion
128
- ],
129
- headerParameters: [
130
- Parameters.cacheControl,
131
- Parameters.acceptLanguage
132
- ],
259
+ headerParameters: [Parameters.accept, Parameters.cacheControl],
260
+ serializer
261
+ };
262
+ const getSubscriptionsUnderManagementGroupOperationSpec: coreClient.OperationSpec = {
263
+ path:
264
+ "/providers/Microsoft.Management/managementGroups/{groupId}/subscriptions",
265
+ httpMethod: "GET",
133
266
  responses: {
134
- 204: {},
267
+ 200: {
268
+ bodyMapper: Mappers.ListSubscriptionUnderManagementGroup
269
+ },
270
+ default: {
271
+ bodyMapper: Mappers.ErrorResponse
272
+ }
273
+ },
274
+ queryParameters: [Parameters.apiVersion, Parameters.skiptoken],
275
+ urlParameters: [Parameters.$host, Parameters.groupId],
276
+ headerParameters: [Parameters.accept],
277
+ serializer
278
+ };
279
+ const getSubscriptionsUnderManagementGroupNextOperationSpec: coreClient.OperationSpec = {
280
+ path: "{nextLink}",
281
+ httpMethod: "GET",
282
+ responses: {
283
+ 200: {
284
+ bodyMapper: Mappers.ListSubscriptionUnderManagementGroup
285
+ },
135
286
  default: {
136
287
  bodyMapper: Mappers.ErrorResponse
137
288
  }
138
289
  },
290
+ queryParameters: [Parameters.apiVersion, Parameters.skiptoken],
291
+ urlParameters: [Parameters.$host, Parameters.groupId, Parameters.nextLink],
292
+ headerParameters: [Parameters.accept],
139
293
  serializer
140
294
  };