@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
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
+ }
@@ -1,142 +1,116 @@
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 { TokenCredential } from "@azure/core-auth";
13
- import * as Models from "./models";
14
- import * as Mappers from "./models/mappers";
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";
15
25
  import * as Parameters from "./models/parameters";
16
- import * as operations from "./operations";
26
+ import * as Mappers from "./models/mappers";
17
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";
18
38
 
19
-
20
- class ManagementGroupsAPI extends ManagementGroupsAPIContext {
21
- // Operation groups
22
- managementGroups: operations.ManagementGroups;
23
- managementGroupSubscriptions: operations.ManagementGroupSubscriptions;
24
- operations: operations.Operations;
25
- entities: operations.Entities;
26
-
39
+ export class ManagementGroupsAPI extends ManagementGroupsAPIContext {
27
40
  /**
28
41
  * Initializes a new instance of the ManagementGroupsAPI class.
29
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
30
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
31
- * more information about these credentials, see
32
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
33
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
34
- * @azure/ms-rest-browserauth are also supported.
35
- * @param [options] The parameter options
42
+ * @param credentials Subscription credentials which uniquely identify client subscription.
43
+ * @param options The parameter options
36
44
  */
37
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, options?: Models.ManagementGroupsAPIOptions) {
45
+ constructor(
46
+ credentials: coreAuth.TokenCredential,
47
+ options?: ManagementGroupsAPIOptionalParams
48
+ ) {
38
49
  super(credentials, options);
39
- this.managementGroups = new operations.ManagementGroups(this);
40
- this.managementGroupSubscriptions = new operations.ManagementGroupSubscriptions(this);
41
- this.operations = new operations.Operations(this);
42
- this.entities = new operations.Entities(this);
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);
43
59
  }
44
60
 
45
61
  /**
46
62
  * Checks if the specified management group name is valid and unique
47
63
  * @param checkNameAvailabilityRequest Management group name availability check parameters.
48
- * @param [options] The optional parameters
49
- * @returns Promise<Models.CheckNameAvailabilityResponse>
50
- */
51
- checkNameAvailability(checkNameAvailabilityRequest: Models.CheckNameAvailabilityRequest, options?: msRest.RequestOptionsBase): Promise<Models.CheckNameAvailabilityResponse>;
52
- /**
53
- * @param checkNameAvailabilityRequest Management group name availability check parameters.
54
- * @param callback The callback
64
+ * @param options The options parameters.
55
65
  */
56
- checkNameAvailability(checkNameAvailabilityRequest: Models.CheckNameAvailabilityRequest, callback: msRest.ServiceCallback<Models.CheckNameAvailabilityResult>): void;
57
- /**
58
- * @param checkNameAvailabilityRequest Management group name availability check parameters.
59
- * @param options The optional parameters
60
- * @param callback The callback
61
- */
62
- checkNameAvailability(checkNameAvailabilityRequest: Models.CheckNameAvailabilityRequest, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.CheckNameAvailabilityResult>): void;
63
- checkNameAvailability(checkNameAvailabilityRequest: Models.CheckNameAvailabilityRequest, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.CheckNameAvailabilityResult>, callback?: msRest.ServiceCallback<Models.CheckNameAvailabilityResult>): Promise<Models.CheckNameAvailabilityResponse> {
66
+ checkNameAvailability(
67
+ checkNameAvailabilityRequest: CheckNameAvailabilityRequest,
68
+ options?: CheckNameAvailabilityOptionalParams
69
+ ): Promise<CheckNameAvailabilityResponse> {
64
70
  return this.sendOperationRequest(
65
- {
66
- checkNameAvailabilityRequest,
67
- options
68
- },
69
- checkNameAvailabilityOperationSpec,
70
- callback) as Promise<Models.CheckNameAvailabilityResponse>;
71
+ { checkNameAvailabilityRequest, options },
72
+ checkNameAvailabilityOperationSpec
73
+ );
71
74
  }
72
75
 
73
76
  /**
74
77
  * Starts backfilling subscriptions for the Tenant.
75
- * @param [options] The optional parameters
76
- * @returns Promise<Models.StartTenantBackfillResponse>
77
- */
78
- startTenantBackfill(options?: msRest.RequestOptionsBase): Promise<Models.StartTenantBackfillResponse>;
79
- /**
80
- * @param callback The callback
81
- */
82
- startTenantBackfill(callback: msRest.ServiceCallback<Models.TenantBackfillStatusResult>): void;
83
- /**
84
- * @param options The optional parameters
85
- * @param callback The callback
78
+ * @param options The options parameters.
86
79
  */
87
- startTenantBackfill(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.TenantBackfillStatusResult>): void;
88
- startTenantBackfill(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.TenantBackfillStatusResult>, callback?: msRest.ServiceCallback<Models.TenantBackfillStatusResult>): Promise<Models.StartTenantBackfillResponse> {
80
+ startTenantBackfill(
81
+ options?: StartTenantBackfillOptionalParams
82
+ ): Promise<StartTenantBackfillResponse> {
89
83
  return this.sendOperationRequest(
90
- {
91
- options
92
- },
93
- startTenantBackfillOperationSpec,
94
- callback) as Promise<Models.StartTenantBackfillResponse>;
84
+ { options },
85
+ startTenantBackfillOperationSpec
86
+ );
95
87
  }
96
88
 
97
89
  /**
98
90
  * Gets tenant backfill status
99
- * @param [options] The optional parameters
100
- * @returns Promise<Models.TenantBackfillStatusResponse>
91
+ * @param options The options parameters.
101
92
  */
102
- tenantBackfillStatus(options?: msRest.RequestOptionsBase): Promise<Models.TenantBackfillStatusResponse>;
103
- /**
104
- * @param callback The callback
105
- */
106
- tenantBackfillStatus(callback: msRest.ServiceCallback<Models.TenantBackfillStatusResult>): void;
107
- /**
108
- * @param options The optional parameters
109
- * @param callback The callback
110
- */
111
- tenantBackfillStatus(options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.TenantBackfillStatusResult>): void;
112
- tenantBackfillStatus(options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.TenantBackfillStatusResult>, callback?: msRest.ServiceCallback<Models.TenantBackfillStatusResult>): Promise<Models.TenantBackfillStatusResponse> {
93
+ tenantBackfillStatus(
94
+ options?: TenantBackfillStatusOptionalParams
95
+ ): Promise<TenantBackfillStatusResponse> {
113
96
  return this.sendOperationRequest(
114
- {
115
- options
116
- },
117
- tenantBackfillStatusOperationSpec,
118
- callback) as Promise<Models.TenantBackfillStatusResponse>;
97
+ { options },
98
+ tenantBackfillStatusOperationSpec
99
+ );
119
100
  }
120
- }
121
101
 
102
+ managementGroups: ManagementGroups;
103
+ managementGroupSubscriptions: ManagementGroupSubscriptions;
104
+ hierarchySettingsOperations: HierarchySettingsOperations;
105
+ operations: Operations;
106
+ entities: Entities;
107
+ }
122
108
  // Operation Specifications
123
- const serializer = new msRest.Serializer(Mappers);
124
- const checkNameAvailabilityOperationSpec: msRest.OperationSpec = {
109
+ const serializer = coreClient.createSerializer(Mappers, /* isXml */ false);
110
+
111
+ const checkNameAvailabilityOperationSpec: coreClient.OperationSpec = {
112
+ path: "/providers/Microsoft.Management/checkNameAvailability",
125
113
  httpMethod: "POST",
126
- path: "providers/Microsoft.Management/checkNameAvailability",
127
- queryParameters: [
128
- Parameters.apiVersion
129
- ],
130
- headerParameters: [
131
- Parameters.acceptLanguage
132
- ],
133
- requestBody: {
134
- parameterPath: "checkNameAvailabilityRequest",
135
- mapper: {
136
- ...Mappers.CheckNameAvailabilityRequest,
137
- required: true
138
- }
139
- },
140
114
  responses: {
141
115
  200: {
142
116
  bodyMapper: Mappers.CheckNameAvailabilityResult
@@ -145,18 +119,16 @@ const checkNameAvailabilityOperationSpec: msRest.OperationSpec = {
145
119
  bodyMapper: Mappers.ErrorResponse
146
120
  }
147
121
  },
122
+ requestBody: Parameters.checkNameAvailabilityRequest,
123
+ queryParameters: [Parameters.apiVersion],
124
+ urlParameters: [Parameters.$host],
125
+ headerParameters: [Parameters.accept, Parameters.contentType],
126
+ mediaType: "json",
148
127
  serializer
149
128
  };
150
-
151
- const startTenantBackfillOperationSpec: msRest.OperationSpec = {
129
+ const startTenantBackfillOperationSpec: coreClient.OperationSpec = {
130
+ path: "/providers/Microsoft.Management/startTenantBackfill",
152
131
  httpMethod: "POST",
153
- path: "providers/Microsoft.Management/startTenantBackfill",
154
- queryParameters: [
155
- Parameters.apiVersion
156
- ],
157
- headerParameters: [
158
- Parameters.acceptLanguage
159
- ],
160
132
  responses: {
161
133
  200: {
162
134
  bodyMapper: Mappers.TenantBackfillStatusResult
@@ -165,18 +137,14 @@ const startTenantBackfillOperationSpec: msRest.OperationSpec = {
165
137
  bodyMapper: Mappers.ErrorResponse
166
138
  }
167
139
  },
140
+ queryParameters: [Parameters.apiVersion],
141
+ urlParameters: [Parameters.$host],
142
+ headerParameters: [Parameters.accept],
168
143
  serializer
169
144
  };
170
-
171
- const tenantBackfillStatusOperationSpec: msRest.OperationSpec = {
145
+ const tenantBackfillStatusOperationSpec: coreClient.OperationSpec = {
146
+ path: "/providers/Microsoft.Management/tenantBackfillStatus",
172
147
  httpMethod: "POST",
173
- path: "providers/Microsoft.Management/tenantBackfillStatus",
174
- queryParameters: [
175
- Parameters.apiVersion
176
- ],
177
- headerParameters: [
178
- Parameters.acceptLanguage
179
- ],
180
148
  responses: {
181
149
  200: {
182
150
  bodyMapper: Mappers.TenantBackfillStatusResult
@@ -185,13 +153,8 @@ const tenantBackfillStatusOperationSpec: msRest.OperationSpec = {
185
153
  bodyMapper: Mappers.ErrorResponse
186
154
  }
187
155
  },
156
+ queryParameters: [Parameters.apiVersion],
157
+ urlParameters: [Parameters.$host],
158
+ headerParameters: [Parameters.accept],
188
159
  serializer
189
160
  };
190
-
191
- export {
192
- ManagementGroupsAPI,
193
- ManagementGroupsAPIContext,
194
- Models as ManagementGroupsAPIModels,
195
- Mappers as ManagementGroupsAPIMappers
196
- };
197
- export * from "./operations";
@@ -1,62 +1,62 @@
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 Models from "./models";
12
- import * as msRest from "@azure/ms-rest-js";
13
- import { TokenCredential } from "@azure/core-auth";
14
- import * as msRestAzure from "@azure/ms-rest-azure-js";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import { ManagementGroupsAPIOptionalParams } from "./models";
15
12
 
16
- const packageName = "@azure/arm-managementgroups";
17
- const packageVersion = "1.2.0";
18
-
19
- export class ManagementGroupsAPIContext extends msRestAzure.AzureServiceClient {
20
- credentials: msRest.ServiceClientCredentials | TokenCredential;
21
- apiVersion?: string;
13
+ export class ManagementGroupsAPIContext extends coreClient.ServiceClient {
14
+ $host: string;
15
+ apiVersion: string;
22
16
 
23
17
  /**
24
- * Initializes a new instance of the ManagementGroupsAPI class.
25
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
26
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
27
- * more information about these credentials, see
28
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
29
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
30
- * @azure/ms-rest-browserauth are also supported.
31
- * @param [options] The parameter options
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
32
21
  */
33
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, options?: Models.ManagementGroupsAPIOptions) {
34
- if (credentials == undefined) {
35
- throw new Error('\'credentials\' cannot be null.');
22
+ constructor(
23
+ credentials: coreAuth.TokenCredential,
24
+ options?: ManagementGroupsAPIOptionalParams
25
+ ) {
26
+ if (credentials === undefined) {
27
+ throw new Error("'credentials' cannot be null");
36
28
  }
37
29
 
30
+ // Initializing default values for options
38
31
  if (!options) {
39
32
  options = {};
40
33
  }
41
- if(!options.userAgent) {
42
- const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
43
- options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
44
- }
45
-
46
- super(credentials, options);
47
-
48
- this.apiVersion = '2018-03-01-preview';
49
- this.acceptLanguage = 'en-US';
50
- this.longRunningOperationRetryTimeout = 30;
51
- this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
52
- this.requestContentType = "application/json; charset=utf-8";
53
- this.credentials = credentials;
54
-
55
- if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
56
- this.acceptLanguage = options.acceptLanguage;
57
- }
58
- if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
59
- this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
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"];
60
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
61
  }
62
62
  }