@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.
- package/CHANGELOG.md +26 -0
- package/{LICENSE.txt → LICENSE} +2 -2
- package/README.md +72 -83
- package/dist/index.js +2881 -0
- package/dist/index.js.map +1 -0
- package/dist/index.min.js +1 -0
- package/dist/index.min.js.map +1 -0
- package/dist-esm/src/index.d.ts +6 -0
- package/dist-esm/src/index.d.ts.map +1 -0
- package/dist-esm/src/index.js +13 -0
- package/dist-esm/src/index.js.map +1 -0
- package/dist-esm/src/lroImpl.d.ts +16 -0
- package/dist-esm/src/lroImpl.d.ts.map +1 -0
- package/dist-esm/src/lroImpl.js +29 -0
- package/dist-esm/src/lroImpl.js.map +1 -0
- package/dist-esm/src/managementGroupsAPI.d.ts +34 -0
- package/dist-esm/src/managementGroupsAPI.d.ts.map +1 -0
- package/dist-esm/src/managementGroupsAPI.js +102 -0
- package/dist-esm/src/managementGroupsAPI.js.map +1 -0
- package/dist-esm/src/managementGroupsAPIContext.d.ts +14 -0
- package/dist-esm/src/managementGroupsAPIContext.d.ts.map +1 -0
- package/dist-esm/src/managementGroupsAPIContext.js +43 -0
- package/dist-esm/src/managementGroupsAPIContext.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +956 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +46 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +39 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +776 -396
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +24 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/dist-esm/src/models/parameters.js +200 -0
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/entities.d.ts +34 -0
- package/dist-esm/src/operations/entities.d.ts.map +1 -0
- package/dist-esm/src/operations/entities.js +142 -0
- package/dist-esm/src/operations/entities.js.map +1 -0
- package/dist-esm/src/operations/hierarchySettingsOperations.d.ts +52 -0
- package/dist-esm/src/operations/hierarchySettingsOperations.d.ts.map +1 -0
- package/dist-esm/src/operations/hierarchySettingsOperations.js +154 -0
- package/dist-esm/src/operations/hierarchySettingsOperations.js.map +1 -0
- package/{esm → dist-esm/src}/operations/index.d.ts +1 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/{esm → dist-esm/src}/operations/index.js +4 -5
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/managementGroupSubscriptions.d.ts +62 -0
- package/dist-esm/src/operations/managementGroupSubscriptions.d.ts.map +1 -0
- package/dist-esm/src/operations/managementGroupSubscriptions.js +215 -0
- package/dist-esm/src/operations/managementGroupSubscriptions.js.map +1 -0
- package/dist-esm/src/operations/managementGroups.d.ts +109 -0
- package/dist-esm/src/operations/managementGroups.d.ts.map +1 -0
- package/dist-esm/src/operations/managementGroups.js +462 -0
- package/dist-esm/src/operations/managementGroups.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +32 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +120 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/entities.d.ts +12 -0
- package/dist-esm/src/operationsInterfaces/entities.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/entities.js +9 -0
- package/dist-esm/src/operationsInterfaces/entities.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.d.ts +44 -0
- package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.js +9 -0
- package/dist-esm/src/operationsInterfaces/hierarchySettingsOperations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
- package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/index.js +13 -0
- package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.d.ts +37 -0
- package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.js +9 -0
- package/dist-esm/src/operationsInterfaces/managementGroupSubscriptions.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/managementGroups.d.ts +71 -0
- package/dist-esm/src/operationsInterfaces/managementGroups.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/managementGroups.js +9 -0
- package/dist-esm/src/operationsInterfaces/managementGroups.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts +11 -0
- package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/operations.js +9 -0
- package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
- package/dist-esm/test/sampleTest.d.ts +2 -0
- package/dist-esm/test/sampleTest.d.ts.map +1 -0
- package/dist-esm/test/sampleTest.js +40 -0
- package/dist-esm/test/sampleTest.js.map +1 -0
- package/package.json +69 -24
- package/review/arm-managementgroups.api.md +667 -0
- package/rollup.config.js +184 -27
- package/src/index.ts +13 -0
- package/src/lroImpl.ts +34 -0
- package/src/managementGroupsAPI.ts +93 -130
- package/src/managementGroupsAPIContext.ts +45 -45
- package/src/models/index.ts +801 -1185
- package/src/models/mappers.ts +792 -400
- package/src/models/parameters.ts +130 -94
- package/src/operations/entities.ts +105 -79
- package/src/operations/hierarchySettingsOperations.ts +214 -0
- package/src/operations/index.ts +4 -5
- package/src/operations/managementGroupSubscriptions.ts +226 -72
- package/src/operations/managementGroups.ts +449 -222
- package/src/operations/operations.ts +84 -70
- package/src/operationsInterfaces/entities.ts +23 -0
- package/src/operationsInterfaces/hierarchySettingsOperations.ts +80 -0
- package/src/operationsInterfaces/index.ts +13 -0
- package/src/operationsInterfaces/managementGroupSubscriptions.ts +69 -0
- package/src/operationsInterfaces/managementGroups.ts +131 -0
- package/src/operationsInterfaces/operations.ts +22 -0
- package/tsconfig.json +4 -4
- package/types/arm-managementgroups.d.ts +1266 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-managementgroups.js +0 -2017
- package/dist/arm-managementgroups.js.map +0 -1
- package/dist/arm-managementgroups.min.js +0 -1
- package/dist/arm-managementgroups.min.js.map +0 -1
- package/esm/managementGroupsAPI.d.ts +0 -74
- package/esm/managementGroupsAPI.d.ts.map +0 -1
- package/esm/managementGroupsAPI.js +0 -120
- package/esm/managementGroupsAPI.js.map +0 -1
- package/esm/managementGroupsAPIContext.d.ts +0 -20
- package/esm/managementGroupsAPIContext.d.ts.map +0 -1
- package/esm/managementGroupsAPIContext.js +0 -56
- package/esm/managementGroupsAPIContext.js.map +0 -1
- package/esm/models/entitiesMappers.d.ts +0 -2
- package/esm/models/entitiesMappers.d.ts.map +0 -1
- package/esm/models/entitiesMappers.js +0 -11
- package/esm/models/entitiesMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -1390
- package/esm/models/index.d.ts.map +0 -1
- package/esm/models/index.js +0 -10
- package/esm/models/index.js.map +0 -1
- package/esm/models/managementGroupSubscriptionsMappers.d.ts +0 -2
- package/esm/models/managementGroupSubscriptionsMappers.d.ts.map +0 -1
- package/esm/models/managementGroupSubscriptionsMappers.js +0 -11
- package/esm/models/managementGroupSubscriptionsMappers.js.map +0 -1
- package/esm/models/managementGroupsMappers.d.ts +0 -2
- package/esm/models/managementGroupsMappers.d.ts.map +0 -1
- package/esm/models/managementGroupsMappers.js +0 -11
- package/esm/models/managementGroupsMappers.js.map +0 -1
- package/esm/models/mappers.d.ts +0 -28
- package/esm/models/mappers.d.ts.map +0 -1
- package/esm/models/mappers.js.map +0 -1
- package/esm/models/operationsMappers.d.ts +0 -2
- package/esm/models/operationsMappers.d.ts.map +0 -1
- package/esm/models/operationsMappers.js +0 -11
- package/esm/models/operationsMappers.js.map +0 -1
- package/esm/models/parameters.d.ts +0 -18
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js +0 -194
- package/esm/models/parameters.js.map +0 -1
- package/esm/operations/entities.d.ts +0 -46
- package/esm/operations/entities.d.ts.map +0 -1
- package/esm/operations/entities.js +0 -87
- package/esm/operations/entities.js.map +0 -1
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/managementGroupSubscriptions.d.ts +0 -55
- package/esm/operations/managementGroupSubscriptions.d.ts.map +0 -1
- package/esm/operations/managementGroupSubscriptions.js +0 -85
- package/esm/operations/managementGroupSubscriptions.js.map +0 -1
- package/esm/operations/managementGroups.d.ts +0 -120
- package/esm/operations/managementGroups.d.ts.map +0 -1
- package/esm/operations/managementGroups.js +0 -252
- package/esm/operations/managementGroups.js.map +0 -1
- package/esm/operations/operations.d.ts +0 -46
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -77
- package/esm/operations/operations.js.map +0 -1
- package/src/models/entitiesMappers.ts +0 -18
- package/src/models/managementGroupSubscriptionsMappers.ts +0 -15
- package/src/models/managementGroupsMappers.ts +0 -29
- 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
|
+
};
|
package/src/operations/index.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
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.
|
|
3
|
-
* Licensed under the MIT License.
|
|
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
|
|
12
|
-
import
|
|
13
|
-
import * as
|
|
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
|
-
|
|
18
|
-
|
|
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
|
-
*
|
|
23
|
-
* @param
|
|
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
|
-
*
|
|
43
|
+
* Retrieves details about all subscriptions which are associated with the management group.
|
|
44
|
+
*
|
|
31
45
|
* @param groupId Management Group ID.
|
|
32
|
-
* @param
|
|
33
|
-
* @param [options] The optional parameters
|
|
34
|
-
* @returns Promise<msRest.RestResponse>
|
|
46
|
+
* @param options The options parameters.
|
|
35
47
|
*/
|
|
36
|
-
|
|
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
|
|
110
|
+
* @param options The options parameters.
|
|
41
111
|
*/
|
|
42
|
-
create(
|
|
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
|
|
47
|
-
* @param callback The callback
|
|
128
|
+
* @param options The options parameters.
|
|
48
129
|
*/
|
|
49
|
-
|
|
50
|
-
|
|
130
|
+
delete(
|
|
131
|
+
groupId: string,
|
|
132
|
+
subscriptionId: string,
|
|
133
|
+
options?: ManagementGroupSubscriptionsDeleteOptionalParams
|
|
134
|
+
): Promise<void> {
|
|
51
135
|
return this.client.sendOperationRequest(
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
options
|
|
56
|
-
},
|
|
57
|
-
createOperationSpec,
|
|
58
|
-
callback);
|
|
136
|
+
{ groupId, subscriptionId, options },
|
|
137
|
+
deleteOperationSpec
|
|
138
|
+
);
|
|
59
139
|
}
|
|
60
140
|
|
|
61
141
|
/**
|
|
62
|
-
*
|
|
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
|
|
66
|
-
* @returns Promise<msRest.RestResponse>
|
|
146
|
+
* @param options The options parameters.
|
|
67
147
|
*/
|
|
68
|
-
|
|
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
|
|
72
|
-
* @param callback The callback
|
|
163
|
+
* @param options The options parameters.
|
|
73
164
|
*/
|
|
74
|
-
|
|
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
|
|
78
|
-
*
|
|
79
|
-
* @param
|
|
180
|
+
* @param nextLink The nextLink from the previous successful call to the
|
|
181
|
+
* GetSubscriptionsUnderManagementGroup method.
|
|
182
|
+
* @param options The options parameters.
|
|
80
183
|
*/
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
86
|
-
|
|
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 =
|
|
96
|
-
|
|
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
|
-
|
|
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
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
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
|
};
|