@azure/arm-managementgroups 1.1.0 → 2.0.0-alpha.20211214.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 (181) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/{LICENSE.txt → LICENSE} +2 -2
  3. package/README.md +78 -77
  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 +71 -25
  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 +160 -0
  94. package/src/managementGroupsAPIContext.ts +62 -0
  95. package/src/models/index.ts +1082 -0
  96. package/{lib → src}/models/mappers.ts +792 -400
  97. package/src/models/parameters.ts +232 -0
  98. package/src/operations/entities.ts +159 -0
  99. package/src/operations/hierarchySettingsOperations.ts +214 -0
  100. package/{lib → src}/operations/index.ts +4 -5
  101. package/src/operations/managementGroupSubscriptions.ts +294 -0
  102. package/src/operations/managementGroups.ts +592 -0
  103. package/src/operations/operations.ts +137 -0
  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 -2007
  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 -68
  118. package/esm/managementGroupsAPI.d.ts.map +0 -1
  119. package/esm/managementGroupsAPI.js +0 -115
  120. package/esm/managementGroupsAPI.js.map +0 -1
  121. package/esm/managementGroupsAPIContext.d.ts +0 -14
  122. package/esm/managementGroupsAPIContext.d.ts.map +0 -1
  123. package/esm/managementGroupsAPIContext.js +0 -51
  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/lib/managementGroupsAPI.ts +0 -191
  171. package/lib/managementGroupsAPIContext.ts +0 -56
  172. package/lib/models/entitiesMappers.ts +0 -18
  173. package/lib/models/index.ts +0 -1466
  174. package/lib/models/managementGroupSubscriptionsMappers.ts +0 -15
  175. package/lib/models/managementGroupsMappers.ts +0 -29
  176. package/lib/models/operationsMappers.ts +0 -18
  177. package/lib/models/parameters.ts +0 -196
  178. package/lib/operations/entities.ts +0 -133
  179. package/lib/operations/managementGroupSubscriptions.ts +0 -140
  180. package/lib/operations/managementGroups.ts +0 -365
  181. package/lib/operations/operations.ts +0 -123
package/rollup.config.js CHANGED
@@ -1,31 +1,188 @@
1
- import nodeResolve from "rollup-plugin-node-resolve";
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 nodeResolve from "@rollup/plugin-node-resolve";
10
+ import cjs from "@rollup/plugin-commonjs";
11
+ import sourcemaps from "rollup-plugin-sourcemaps";
12
+ import multiEntry from "@rollup/plugin-multi-entry";
13
+ import json from "@rollup/plugin-json";
14
+
15
+ import nodeBuiltins from "builtin-modules";
16
+
17
+ /**
18
+ * Gets the proper configuration needed for rollup's commonJS plugin for @opentelemetry/api.
19
+ *
20
+ * NOTE: this manual configuration is only needed because OpenTelemetry uses an
21
+ * __exportStar downleveled helper function to declare its exports which confuses
22
+ * rollup's automatic discovery mechanism.
23
+ *
24
+ * @returns an object reference that can be `...`'d into your cjs() configuration.
25
+ */
26
+ export function openTelemetryCommonJs() {
27
+ const namedExports = {};
28
+
29
+ for (const key of [
30
+ "@opentelemetry/api",
31
+ "@azure/core-tracing/node_modules/@opentelemetry/api"
32
+ ]) {
33
+ namedExports[key] = [
34
+ "SpanKind",
35
+ "TraceFlags",
36
+ "getSpan",
37
+ "setSpan",
38
+ "SpanStatusCode",
39
+ "getSpanContext",
40
+ "setSpanContext"
41
+ ];
42
+ }
43
+
44
+ const releasedOpenTelemetryVersions = ["0.10.2", "1.0.0-rc.0"];
45
+
46
+ for (const version of releasedOpenTelemetryVersions) {
47
+ namedExports[
48
+ // working around a limitation in the rollup common.js plugin - it's not able to resolve these modules so the named exports listed above will not get applied. We have to drill down to the actual path.
49
+ `../../../common/temp/node_modules/.pnpm/@opentelemetry/api@${version}/node_modules/@opentelemetry/api/build/src/index.js`
50
+ ] = [
51
+ "SpanKind",
52
+ "TraceFlags",
53
+ "getSpan",
54
+ "setSpan",
55
+ "StatusCode",
56
+ "CanonicalCode",
57
+ "getSpanContext",
58
+ "setSpanContext"
59
+ ];
60
+ }
61
+
62
+ return namedExports;
63
+ }
64
+
65
+ // #region Warning Handler
66
+
67
+ /**
68
+ * A function that can determine whether a rollupwarning should be ignored. If
69
+ * the function returns `true`, then the warning will not be displayed.
70
+ */
71
+
72
+ function ignoreNiseSinonEvalWarnings(warning) {
73
+ return (
74
+ warning.code === "EVAL" &&
75
+ warning.id &&
76
+ (warning.id.includes("node_modules/nise") ||
77
+ warning.id.includes("node_modules/sinon")) === true
78
+ );
79
+ }
80
+
81
+ function ignoreChaiCircularDependencyWarnings(warning) {
82
+ return (
83
+ warning.code === "CIRCULAR_DEPENDENCY" &&
84
+ warning.importer && warning.importer.includes("node_modules/chai") === true
85
+ );
86
+ }
87
+
88
+ const warningInhibitors = [
89
+ ignoreChaiCircularDependencyWarnings,
90
+ ignoreNiseSinonEvalWarnings
91
+ ];
92
+
2
93
  /**
3
- * @type {import('rollup').RollupFileOptions}
94
+ * Construct a warning handler for the shared rollup configuration
95
+ * that ignores certain warnings that are not relevant to testing.
4
96
  */
5
- const config = {
6
- input: './esm/managementGroupsAPI.js',
7
- external: ["@azure/ms-rest-js", "@azure/ms-rest-azure-js"],
8
- output: {
9
- file: "./dist/arm-managementgroups.js",
10
- format: "umd",
11
- name: "Azure.ArmManagementgroups",
12
- sourcemap: true,
13
- globals: {
14
- "@azure/ms-rest-js": "msRest",
15
- "@azure/ms-rest-azure-js": "msRestAzure"
97
+ function makeOnWarnForTesting() {
98
+ return (warning, warn) => {
99
+ // If every inhibitor returns false (i.e. no inhibitors), then show the warning
100
+ if (warningInhibitors.every((inhib) => !inhib(warning))) {
101
+ warn(warning);
102
+ }
103
+ };
104
+ }
105
+
106
+ // #endregion
107
+
108
+ function makeBrowserTestConfig() {
109
+ const config = {
110
+ input: {
111
+ include: ["dist-esm/test/**/*.spec.js"],
112
+ exclude: ["dist-esm/test/**/node/**"]
16
113
  },
17
- banner: `/*
18
- * Copyright (c) Microsoft Corporation. All rights reserved.
19
- * Licensed under the MIT License. See License.txt in the project root for
20
- * license information.
21
- *
22
- * Code generated by Microsoft (R) AutoRest Code Generator.
23
- * Changes may cause incorrect behavior and will be lost if the code is
24
- * regenerated.
25
- */`
26
- },
27
- plugins: [
28
- nodeResolve({ module: true })
29
- ]
114
+ output: {
115
+ file: `dist-test/index.browser.js`,
116
+ format: "umd",
117
+ sourcemap: true
118
+ },
119
+ preserveSymlinks: false,
120
+ plugins: [
121
+ multiEntry({ exports: false }),
122
+ nodeResolve({
123
+ mainFields: ["module", "browser"]
124
+ }),
125
+ cjs({
126
+ namedExports: {
127
+ // Chai's strange internal architecture makes it impossible to statically
128
+ // analyze its exports.
129
+ chai: [
130
+ "version",
131
+ "use",
132
+ "util",
133
+ "config",
134
+ "expect",
135
+ "should",
136
+ "assert"
137
+ ],
138
+ ...openTelemetryCommonJs()
139
+ }
140
+ }),
141
+ json(),
142
+ sourcemaps()
143
+ //viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
144
+ ],
145
+ onwarn: makeOnWarnForTesting(),
146
+ // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
147
+ // rollup started respecting the "sideEffects" field in package.json. Since
148
+ // our package.json sets "sideEffects=false", this also applies to test
149
+ // code, which causes all tests to be removed by tree-shaking.
150
+ treeshake: false
151
+ };
152
+
153
+ return config;
154
+ }
155
+
156
+ const defaultConfigurationOptions = {
157
+ disableBrowserBundle: false
30
158
  };
31
- export default config;
159
+
160
+ export function makeConfig(pkg, options) {
161
+ options = {
162
+ ...defaultConfigurationOptions,
163
+ ...(options || {})
164
+ };
165
+
166
+ const baseConfig = {
167
+ // Use the package's module field if it has one
168
+ input: pkg["module"] || "dist-esm/src/index.js",
169
+ external: [
170
+ ...nodeBuiltins,
171
+ ...Object.keys(pkg.dependencies),
172
+ ...Object.keys(pkg.devDependencies)
173
+ ],
174
+ output: { file: "dist/index.js", format: "cjs", sourcemap: true },
175
+ preserveSymlinks: false,
176
+ plugins: [sourcemaps(), nodeResolve(), cjs()]
177
+ };
178
+
179
+ const config = [baseConfig];
180
+
181
+ if (!options.disableBrowserBundle) {
182
+ config.push(makeBrowserTestConfig());
183
+ }
184
+
185
+ return config;
186
+ }
187
+
188
+ export default makeConfig(require("./package.json"));
package/src/index.ts ADDED
@@ -0,0 +1,13 @@
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
+ /// <reference lib="esnext.asynciterable" />
10
+ export * from "./models";
11
+ export { ManagementGroupsAPI } from "./managementGroupsAPI";
12
+ export { ManagementGroupsAPIContext } from "./managementGroupsAPIContext";
13
+ export * from "./operationsInterfaces";
package/src/lroImpl.ts ADDED
@@ -0,0 +1,34 @@
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 { LongRunningOperation, LroResponse } from "@azure/core-lro";
10
+
11
+ export class LroImpl<T> implements LongRunningOperation<T> {
12
+ constructor(
13
+ private sendOperationFn: (args: any, spec: any) => Promise<LroResponse<T>>,
14
+ private args: Record<string, unknown>,
15
+ private spec: {
16
+ readonly requestBody?: unknown;
17
+ readonly path?: string;
18
+ readonly httpMethod: string;
19
+ } & Record<string, any>,
20
+ public requestPath: string = spec.path!,
21
+ public requestMethod: string = spec.httpMethod
22
+ ) {}
23
+ public async sendInitialRequest(): Promise<LroResponse<T>> {
24
+ return this.sendOperationFn(this.args, this.spec);
25
+ }
26
+ public async sendPollRequest(path: string): Promise<LroResponse<T>> {
27
+ const { requestBody, ...restSpec } = this.spec;
28
+ return this.sendOperationFn(this.args, {
29
+ ...restSpec,
30
+ path,
31
+ httpMethod: "GET"
32
+ });
33
+ }
34
+ }
@@ -0,0 +1,160 @@
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 * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import {
12
+ ManagementGroupsImpl,
13
+ ManagementGroupSubscriptionsImpl,
14
+ HierarchySettingsOperationsImpl,
15
+ OperationsImpl,
16
+ EntitiesImpl
17
+ } from "./operations";
18
+ import {
19
+ ManagementGroups,
20
+ ManagementGroupSubscriptions,
21
+ HierarchySettingsOperations,
22
+ Operations,
23
+ Entities
24
+ } from "./operationsInterfaces";
25
+ import * as Parameters from "./models/parameters";
26
+ import * as Mappers from "./models/mappers";
27
+ import { ManagementGroupsAPIContext } from "./managementGroupsAPIContext";
28
+ import {
29
+ ManagementGroupsAPIOptionalParams,
30
+ CheckNameAvailabilityRequest,
31
+ CheckNameAvailabilityOptionalParams,
32
+ CheckNameAvailabilityResponse,
33
+ StartTenantBackfillOptionalParams,
34
+ StartTenantBackfillResponse,
35
+ TenantBackfillStatusOptionalParams,
36
+ TenantBackfillStatusResponse
37
+ } from "./models";
38
+
39
+ export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
40
+ /**
41
+ * Initializes a new instance of the ManagementGroupsAPI class.
42
+ * @param credentials Subscription credentials which uniquely identify client subscription.
43
+ * @param options The parameter options
44
+ */
45
+ constructor(
46
+ credentials: coreAuth.TokenCredential,
47
+ options?: ManagementGroupsAPIOptionalParams
48
+ ) {
49
+ super(credentials, options);
50
+ this.managementGroups = new ManagementGroupsImpl(this);
51
+ this.managementGroupSubscriptions = new ManagementGroupSubscriptionsImpl(
52
+ this
53
+ );
54
+ this.hierarchySettingsOperations = new HierarchySettingsOperationsImpl(
55
+ this
56
+ );
57
+ this.operations = new OperationsImpl(this);
58
+ this.entities = new EntitiesImpl(this);
59
+ }
60
+
61
+ /**
62
+ * Checks if the specified management group name is valid and unique
63
+ * @param checkNameAvailabilityRequest Management group name availability check parameters.
64
+ * @param options The options parameters.
65
+ */
66
+ checkNameAvailability(
67
+ checkNameAvailabilityRequest: CheckNameAvailabilityRequest,
68
+ options?: CheckNameAvailabilityOptionalParams
69
+ ): Promise<CheckNameAvailabilityResponse> {
70
+ return this.sendOperationRequest(
71
+ { checkNameAvailabilityRequest, options },
72
+ checkNameAvailabilityOperationSpec
73
+ );
74
+ }
75
+
76
+ /**
77
+ * Starts backfilling subscriptions for the Tenant.
78
+ * @param options The options parameters.
79
+ */
80
+ startTenantBackfill(
81
+ options?: StartTenantBackfillOptionalParams
82
+ ): Promise<StartTenantBackfillResponse> {
83
+ return this.sendOperationRequest(
84
+ { options },
85
+ startTenantBackfillOperationSpec
86
+ );
87
+ }
88
+
89
+ /**
90
+ * Gets tenant backfill status
91
+ * @param options The options parameters.
92
+ */
93
+ tenantBackfillStatus(
94
+ options?: TenantBackfillStatusOptionalParams
95
+ ): Promise<TenantBackfillStatusResponse> {
96
+ return this.sendOperationRequest(
97
+ { options },
98
+ tenantBackfillStatusOperationSpec
99
+ );
100
+ }
101
+
102
+ managementGroups: ManagementGroups;
103
+ managementGroupSubscriptions: ManagementGroupSubscriptions;
104
+ hierarchySettingsOperations: HierarchySettingsOperations;
105
+ operations: Operations;
106
+ entities: Entities;
107
+ }
108
+ // Operation Specifications
109
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
110
+
111
+ const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = {
112
+ path: "/providers/Microsoft.Management/checkNameAvailability",
113
+ httpMethod: "POST",
114
+ responses: {
115
+ 200: {
116
+ bodyMapper: Mappers.CheckNameAvailabilityResult
117
+ },
118
+ default: {
119
+ bodyMapper: Mappers.ErrorResponse
120
+ }
121
+ },
122
+ requestBody: Parameters.checkNameAvailabilityRequest,
123
+ queryParameters: [Parameters.apiVersion],
124
+ urlParameters: [Parameters.$host],
125
+ headerParameters: [Parameters.accept, Parameters.contentType],
126
+ mediaType: "json",
127
+ serializer
128
+ };
129
+ const startTenantBackfillOperationSpec: coreClient.OperationSpec = {
130
+ path: "/providers/Microsoft.Management/startTenantBackfill",
131
+ httpMethod: "POST",
132
+ responses: {
133
+ 200: {
134
+ bodyMapper: Mappers.TenantBackfillStatusResult
135
+ },
136
+ default: {
137
+ bodyMapper: Mappers.ErrorResponse
138
+ }
139
+ },
140
+ queryParameters: [Parameters.apiVersion],
141
+ urlParameters: [Parameters.$host],
142
+ headerParameters: [Parameters.accept],
143
+ serializer
144
+ };
145
+ const tenantBackfillStatusOperationSpec: coreClient.OperationSpec = {
146
+ path: "/providers/Microsoft.Management/tenantBackfillStatus",
147
+ httpMethod: "POST",
148
+ responses: {
149
+ 200: {
150
+ bodyMapper: Mappers.TenantBackfillStatusResult
151
+ },
152
+ default: {
153
+ bodyMapper: Mappers.ErrorResponse
154
+ }
155
+ },
156
+ queryParameters: [Parameters.apiVersion],
157
+ urlParameters: [Parameters.$host],
158
+ headerParameters: [Parameters.accept],
159
+ serializer
160
+ };
@@ -0,0 +1,62 @@
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 * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import { ManagementGroupsAPIOptionalParams } from "./models";
12
+
13
+ export class ManagementGroupsAPIContext extends coreClient.ServiceClient {
14
+ $host: string;
15
+ apiVersion: string;
16
+
17
+ /**
18
+ * Initializes a new instance of the ManagementGroupsAPIContext class.
19
+ * @param credentials Subscription credentials which uniquely identify client subscription.
20
+ * @param options The parameter options
21
+ */
22
+ constructor(
23
+ credentials: coreAuth.TokenCredential,
24
+ options?: ManagementGroupsAPIOptionalParams
25
+ ) {
26
+ if (credentials === undefined) {
27
+ throw new Error("'credentials' cannot be null");
28
+ }
29
+
30
+ // Initializing default values for options
31
+ if (!options) {
32
+ options = {};
33
+ }
34
+ const defaults: ManagementGroupsAPIOptionalParams = {
35
+ requestContentType: "application/json; charset=utf-8",
36
+ credential: credentials
37
+ };
38
+
39
+ const packageDetails = `azsdk-js-arm-managementgroups/2.0.0-beta.1`;
40
+ const userAgentPrefix =
41
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
42
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
43
+ : `${packageDetails}`;
44
+
45
+ if (!options.credentialScopes) {
46
+ options.credentialScopes = ["https://management.azure.com/.default"];
47
+ }
48
+ const optionsWithDefaults = {
49
+ ...defaults,
50
+ ...options,
51
+ userAgentOptions: {
52
+ userAgentPrefix
53
+ },
54
+ baseUri: options.endpoint || "https://management.azure.com"
55
+ };
56
+ super(optionsWithDefaults);
57
+
58
+ // Assigning values to Constant parameters
59
+ this.$host = options.$host || "https://management.azure.com";
60
+ this.apiVersion = options.apiVersion || "2021-04-01";
61
+ }
62
+ }