@azure/arm-resourcehealth 2.0.0 → 3.0.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/{LICENSE.txt → LICENSE} +1 -1
  3. package/README.md +70 -82
  4. package/dist/index.js +1811 -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/microsoftResourceHealth.d.ts +20 -0
  13. package/dist-esm/src/microsoftResourceHealth.d.ts.map +1 -0
  14. package/dist-esm/src/microsoftResourceHealth.js +27 -0
  15. package/dist-esm/src/microsoftResourceHealth.js.map +1 -0
  16. package/dist-esm/src/microsoftResourceHealthContext.d.ts +17 -0
  17. package/dist-esm/src/microsoftResourceHealthContext.d.ts.map +1 -0
  18. package/dist-esm/src/microsoftResourceHealthContext.js +50 -0
  19. package/dist-esm/src/microsoftResourceHealthContext.js.map +1 -0
  20. package/dist-esm/src/models/index.d.ts +402 -0
  21. package/dist-esm/src/models/index.d.ts.map +1 -0
  22. package/dist-esm/src/models/index.js +22 -0
  23. package/dist-esm/src/models/index.js.map +1 -0
  24. package/dist-esm/src/models/mappers.d.ts +21 -0
  25. package/dist-esm/src/models/mappers.d.ts.map +1 -0
  26. package/{esm → dist-esm/src}/models/mappers.js +233 -309
  27. package/dist-esm/src/models/mappers.js.map +1 -0
  28. package/dist-esm/src/models/parameters.d.ts +12 -0
  29. package/dist-esm/src/models/parameters.d.ts.map +1 -0
  30. package/{esm → dist-esm/src}/models/parameters.js +44 -39
  31. package/dist-esm/src/models/parameters.js.map +1 -0
  32. package/dist-esm/src/operations/availabilityStatuses.d.ts +102 -0
  33. package/dist-esm/src/operations/availabilityStatuses.d.ts.map +1 -0
  34. package/dist-esm/src/operations/availabilityStatuses.js +407 -0
  35. package/dist-esm/src/operations/availabilityStatuses.js.map +1 -0
  36. package/dist-esm/src/operations/childAvailabilityStatuses.d.ts +51 -0
  37. package/dist-esm/src/operations/childAvailabilityStatuses.d.ts.map +1 -0
  38. package/dist-esm/src/operations/childAvailabilityStatuses.js +173 -0
  39. package/dist-esm/src/operations/childAvailabilityStatuses.js.map +1 -0
  40. package/dist-esm/src/operations/childResources.d.ts +43 -0
  41. package/dist-esm/src/operations/childResources.d.ts.map +1 -0
  42. package/dist-esm/src/operations/childResources.js +143 -0
  43. package/dist-esm/src/operations/childResources.js.map +1 -0
  44. package/dist-esm/src/operations/emergingIssues.d.ts +37 -0
  45. package/dist-esm/src/operations/emergingIssues.d.ts.map +1 -0
  46. package/dist-esm/src/operations/emergingIssues.js +143 -0
  47. package/dist-esm/src/operations/emergingIssues.js.map +1 -0
  48. package/{esm → dist-esm/src}/operations/index.d.ts +0 -0
  49. package/dist-esm/src/operations/index.d.ts.map +1 -0
  50. package/{esm → dist-esm/src}/operations/index.js +1 -2
  51. package/dist-esm/src/operations/index.js.map +1 -0
  52. package/dist-esm/src/operations/operations.d.ts +18 -0
  53. package/dist-esm/src/operations/operations.d.ts.map +1 -0
  54. package/dist-esm/src/operations/operations.js +46 -0
  55. package/dist-esm/src/operations/operations.js.map +1 -0
  56. package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts +40 -0
  57. package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts.map +1 -0
  58. package/{src/models/operationsMappers.ts → dist-esm/src/operationsInterfaces/availabilityStatuses.js} +2 -7
  59. package/dist-esm/src/operationsInterfaces/availabilityStatuses.js.map +1 -0
  60. package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.d.ts +23 -0
  61. package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.d.ts.map +1 -0
  62. package/{esm/models/operationsMappers.js → dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js} +2 -2
  63. package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js.map +1 -0
  64. package/dist-esm/src/operationsInterfaces/childResources.d.ts +15 -0
  65. package/dist-esm/src/operationsInterfaces/childResources.d.ts.map +1 -0
  66. package/dist-esm/src/operationsInterfaces/childResources.js +9 -0
  67. package/dist-esm/src/operationsInterfaces/childResources.js.map +1 -0
  68. package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts +16 -0
  69. package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts.map +1 -0
  70. package/dist-esm/src/operationsInterfaces/emergingIssues.js +9 -0
  71. package/dist-esm/src/operationsInterfaces/emergingIssues.js.map +1 -0
  72. package/dist-esm/src/operationsInterfaces/index.d.ts +6 -0
  73. package/dist-esm/src/operationsInterfaces/index.d.ts.map +1 -0
  74. package/dist-esm/src/operationsInterfaces/index.js +13 -0
  75. package/dist-esm/src/operationsInterfaces/index.js.map +1 -0
  76. package/dist-esm/src/operationsInterfaces/operations.d.ts +10 -0
  77. package/dist-esm/src/operationsInterfaces/operations.d.ts.map +1 -0
  78. package/{esm/models/index.js → dist-esm/src/operationsInterfaces/operations.js} +2 -1
  79. package/dist-esm/src/operationsInterfaces/operations.js.map +1 -0
  80. package/dist-esm/test/sampleTest.d.ts +2 -0
  81. package/dist-esm/test/sampleTest.d.ts.map +1 -0
  82. package/dist-esm/test/sampleTest.js +40 -0
  83. package/dist-esm/test/sampleTest.js.map +1 -0
  84. package/package.json +63 -32
  85. package/review/arm-resourcehealth.api.md +396 -0
  86. package/rollup.config.js +181 -30
  87. package/src/index.ts +13 -0
  88. package/src/microsoftResourceHealth.ts +38 -41
  89. package/src/microsoftResourceHealthContext.ts +47 -44
  90. package/src/models/index.ts +322 -878
  91. package/src/models/mappers.ts +232 -320
  92. package/src/models/parameters.ts +58 -40
  93. package/src/operations/availabilityStatuses.ts +325 -276
  94. package/src/operations/childAvailabilityStatuses.ts +137 -130
  95. package/src/operations/childResources.ts +109 -85
  96. package/src/operations/emergingIssues.ts +96 -103
  97. package/src/operations/index.ts +1 -2
  98. package/src/operations/operations.ts +24 -38
  99. package/src/operationsInterfaces/availabilityStatuses.ts +67 -0
  100. package/src/operationsInterfaces/childAvailabilityStatuses.ts +43 -0
  101. package/src/operationsInterfaces/childResources.ts +30 -0
  102. package/src/operationsInterfaces/emergingIssues.ts +34 -0
  103. package/src/operationsInterfaces/index.ts +13 -0
  104. package/src/operationsInterfaces/operations.ts +21 -0
  105. package/tsconfig.json +3 -3
  106. package/types/arm-resourcehealth.d.ts +588 -0
  107. package/types/tsdoc-metadata.json +11 -0
  108. package/dist/arm-resourcehealth.js +0 -1743
  109. package/dist/arm-resourcehealth.js.map +0 -1
  110. package/dist/arm-resourcehealth.min.js +0 -1
  111. package/dist/arm-resourcehealth.min.js.map +0 -1
  112. package/esm/microsoftResourceHealth.d.ts +0 -29
  113. package/esm/microsoftResourceHealth.d.ts.map +0 -1
  114. package/esm/microsoftResourceHealth.js +0 -42
  115. package/esm/microsoftResourceHealth.js.map +0 -1
  116. package/esm/microsoftResourceHealthContext.d.ts +0 -23
  117. package/esm/microsoftResourceHealthContext.d.ts.map +0 -1
  118. package/esm/microsoftResourceHealthContext.js +0 -61
  119. package/esm/microsoftResourceHealthContext.js.map +0 -1
  120. package/esm/models/availabilityStatusesMappers.d.ts +0 -2
  121. package/esm/models/availabilityStatusesMappers.d.ts.map +0 -1
  122. package/esm/models/availabilityStatusesMappers.js +0 -9
  123. package/esm/models/availabilityStatusesMappers.js.map +0 -1
  124. package/esm/models/childAvailabilityStatusesMappers.d.ts +0 -2
  125. package/esm/models/childAvailabilityStatusesMappers.d.ts.map +0 -1
  126. package/esm/models/childAvailabilityStatusesMappers.js +0 -9
  127. package/esm/models/childAvailabilityStatusesMappers.js.map +0 -1
  128. package/esm/models/childResourcesMappers.d.ts +0 -2
  129. package/esm/models/childResourcesMappers.d.ts.map +0 -1
  130. package/esm/models/childResourcesMappers.js +0 -9
  131. package/esm/models/childResourcesMappers.js.map +0 -1
  132. package/esm/models/emergingIssuesMappers.d.ts +0 -2
  133. package/esm/models/emergingIssuesMappers.d.ts.map +0 -1
  134. package/esm/models/emergingIssuesMappers.js +0 -9
  135. package/esm/models/emergingIssuesMappers.js.map +0 -1
  136. package/esm/models/index.d.ts +0 -957
  137. package/esm/models/index.d.ts.map +0 -1
  138. package/esm/models/index.js.map +0 -1
  139. package/esm/models/mappers.d.ts +0 -26
  140. package/esm/models/mappers.d.ts.map +0 -1
  141. package/esm/models/mappers.js.map +0 -1
  142. package/esm/models/operationsMappers.d.ts +0 -2
  143. package/esm/models/operationsMappers.d.ts.map +0 -1
  144. package/esm/models/operationsMappers.js.map +0 -1
  145. package/esm/models/parameters.d.ts +0 -11
  146. package/esm/models/parameters.d.ts.map +0 -1
  147. package/esm/models/parameters.js.map +0 -1
  148. package/esm/operations/availabilityStatuses.d.ts +0 -166
  149. package/esm/operations/availabilityStatuses.d.ts.map +0 -1
  150. package/esm/operations/availabilityStatuses.js +0 -239
  151. package/esm/operations/availabilityStatuses.js.map +0 -1
  152. package/esm/operations/childAvailabilityStatuses.d.ts +0 -81
  153. package/esm/operations/childAvailabilityStatuses.d.ts.map +0 -1
  154. package/esm/operations/childAvailabilityStatuses.js +0 -117
  155. package/esm/operations/childAvailabilityStatuses.js.map +0 -1
  156. package/esm/operations/childResources.d.ts +0 -57
  157. package/esm/operations/childResources.d.ts.map +0 -1
  158. package/esm/operations/childResources.js +0 -87
  159. package/esm/operations/childResources.js.map +0 -1
  160. package/esm/operations/emergingIssues.d.ts +0 -61
  161. package/esm/operations/emergingIssues.d.ts.map +0 -1
  162. package/esm/operations/emergingIssues.js +0 -106
  163. package/esm/operations/emergingIssues.js.map +0 -1
  164. package/esm/operations/index.d.ts.map +0 -1
  165. package/esm/operations/index.js.map +0 -1
  166. package/esm/operations/operations.d.ts +0 -28
  167. package/esm/operations/operations.d.ts.map +0 -1
  168. package/esm/operations/operations.js +0 -50
  169. package/esm/operations/operations.js.map +0 -1
  170. package/src/models/availabilityStatusesMappers.ts +0 -19
  171. package/src/models/childAvailabilityStatusesMappers.ts +0 -19
  172. package/src/models/childResourcesMappers.ts +0 -19
  173. package/src/models/emergingIssuesMappers.ts +0 -22
package/rollup.config.js CHANGED
@@ -1,37 +1,188 @@
1
- import rollup from "rollup";
2
- import nodeResolve from "rollup-plugin-node-resolve";
3
- import sourcemaps from "rollup-plugin-sourcemaps";
4
-
5
- /**
6
- * @type {rollup.RollupFileOptions}
7
- */
8
- const config = {
9
- input: "./esm/microsoftResourceHealth.js",
10
- external: [
11
- "@azure/ms-rest-js",
12
- "@azure/ms-rest-azure-js"
13
- ],
14
- output: {
15
- file: "./dist/arm-resourcehealth.js",
16
- format: "umd",
17
- name: "Azure.ArmResourcehealth",
18
- sourcemap: true,
19
- globals: {
20
- "@azure/ms-rest-js": "msRest",
21
- "@azure/ms-rest-azure-js": "msRestAzure"
22
- },
23
- banner: `/*
1
+ /*
24
2
  * Copyright (c) Microsoft Corporation.
25
3
  * Licensed under the MIT License.
26
4
  *
27
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
28
6
  * Changes may cause incorrect behavior and will be lost if the code is regenerated.
29
- */`
30
- },
31
- plugins: [
32
- nodeResolve({ mainFields: ['module', 'main'] }),
33
- sourcemaps()
34
- ]
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
+
93
+ /**
94
+ * Construct a warning handler for the shared rollup configuration
95
+ * that ignores certain warnings that are not relevant to testing.
96
+ */
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/**"]
113
+ },
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
35
158
  };
36
159
 
37
- export default config;
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 { MicrosoftResourceHealth } from "./microsoftResourceHealth";
12
+ export { MicrosoftResourceHealthContext } from "./microsoftResourceHealthContext";
13
+ export * from "./operationsInterfaces";
@@ -3,54 +3,51 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as msRest from "@azure/ms-rest-js";
11
- import { TokenCredential } from "@azure/core-auth";
12
- import * as Models from "./models";
13
- import * as Mappers from "./models/mappers";
14
- import * as operations from "./operations";
9
+ import * as coreAuth from "@azure/core-auth";
10
+ import {
11
+ AvailabilityStatusesImpl,
12
+ ChildAvailabilityStatusesImpl,
13
+ ChildResourcesImpl,
14
+ OperationsImpl,
15
+ EmergingIssuesImpl
16
+ } from "./operations";
17
+ import {
18
+ AvailabilityStatuses,
19
+ ChildAvailabilityStatuses,
20
+ ChildResources,
21
+ Operations,
22
+ EmergingIssues
23
+ } from "./operationsInterfaces";
15
24
  import { MicrosoftResourceHealthContext } from "./microsoftResourceHealthContext";
25
+ import { MicrosoftResourceHealthOptionalParams } from "./models";
16
26
 
17
-
18
- class MicrosoftResourceHealth extends MicrosoftResourceHealthContext {
19
- // Operation groups
20
- availabilityStatuses: operations.AvailabilityStatuses;
21
- childAvailabilityStatuses: operations.ChildAvailabilityStatuses;
22
- childResources: operations.ChildResources;
23
- operations: operations.Operations;
24
- emergingIssues: operations.EmergingIssues;
25
-
27
+ export class MicrosoftResourceHealth extends MicrosoftResourceHealthContext {
26
28
  /**
27
29
  * Initializes a new instance of the MicrosoftResourceHealth class.
28
- * @param credentials Credentials needed for the client to connect to Azure. Credentials
29
- * implementing the TokenCredential interface from the @azure/identity package are recommended. For
30
- * more information about these credentials, see
31
- * {@link https://www.npmjs.com/package/@azure/identity}. Credentials implementing the
32
- * ServiceClientCredentials interface from the older packages @azure/ms-rest-nodeauth and
33
- * @azure/ms-rest-browserauth are also supported.
34
- * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure
35
- * subscription. The subscription ID forms part of the URI for every service call.
36
- * @param [options] The parameter options
30
+ * @param credentials Subscription credentials which uniquely identify client subscription.
31
+ * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription.
32
+ * The subscription ID forms part of the URI for every service call.
33
+ * @param options The parameter options
37
34
  */
38
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.MicrosoftResourceHealthOptions) {
35
+ constructor(
36
+ credentials: coreAuth.TokenCredential,
37
+ subscriptionId: string,
38
+ options?: MicrosoftResourceHealthOptionalParams
39
+ ) {
39
40
  super(credentials, subscriptionId, options);
40
- this.availabilityStatuses = new operations.AvailabilityStatuses(this);
41
- this.childAvailabilityStatuses = new operations.ChildAvailabilityStatuses(this);
42
- this.childResources = new operations.ChildResources(this);
43
- this.operations = new operations.Operations(this);
44
- this.emergingIssues = new operations.EmergingIssues(this);
41
+ this.availabilityStatuses = new AvailabilityStatusesImpl(this);
42
+ this.childAvailabilityStatuses = new ChildAvailabilityStatusesImpl(this);
43
+ this.childResources = new ChildResourcesImpl(this);
44
+ this.operations = new OperationsImpl(this);
45
+ this.emergingIssues = new EmergingIssuesImpl(this);
45
46
  }
46
- }
47
47
 
48
- // Operation Specifications
49
-
50
- export {
51
- MicrosoftResourceHealth,
52
- MicrosoftResourceHealthContext,
53
- Models as MicrosoftResourceHealthModels,
54
- Mappers as MicrosoftResourceHealthMappers
55
- };
56
- export * from "./operations";
48
+ availabilityStatuses: AvailabilityStatuses;
49
+ childAvailabilityStatuses: ChildAvailabilityStatuses;
50
+ childResources: ChildResources;
51
+ operations: Operations;
52
+ emergingIssues: EmergingIssues;
53
+ }
@@ -3,66 +3,69 @@
3
3
  * Licensed under the MIT License.
4
4
  *
5
5
  * Code generated by Microsoft (R) AutoRest Code Generator.
6
- * Changes may cause incorrect behavior and will be lost if the code is
7
- * regenerated.
6
+ * Changes may cause incorrect behavior and will be lost if the code is regenerated.
8
7
  */
9
8
 
10
- import * as Models from "./models";
11
- import * as msRest from "@azure/ms-rest-js";
12
- import * as msRestAzure from "@azure/ms-rest-azure-js";
13
- import { TokenCredential } from "@azure/core-auth";
9
+ import * as coreClient from "@azure/core-client";
10
+ import * as coreAuth from "@azure/core-auth";
11
+ import { MicrosoftResourceHealthOptionalParams } from "./models";
14
12
 
15
- const packageName = "@azure/arm-resourcehealth";
16
- const packageVersion = "2.0.0";
17
-
18
- export class MicrosoftResourceHealthContext extends msRestAzure.AzureServiceClient {
19
- credentials: msRest.ServiceClientCredentials | TokenCredential;
13
+ export class MicrosoftResourceHealthContext extends coreClient.ServiceClient {
14
+ $host: string;
15
+ apiVersion: string;
20
16
  subscriptionId: string;
21
- apiVersion?: string;
22
17
 
23
18
  /**
24
- * Initializes a new instance of the MicrosoftResourceHealth 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 subscriptionId Subscription credentials which uniquely identify Microsoft Azure
32
- * subscription. The subscription ID forms part of the URI for every service call.
33
- * @param [options] The parameter options
19
+ * Initializes a new instance of the MicrosoftResourceHealthContext class.
20
+ * @param credentials Subscription credentials which uniquely identify client subscription.
21
+ * @param subscriptionId Subscription credentials which uniquely identify Microsoft Azure subscription.
22
+ * The subscription ID forms part of the URI for every service call.
23
+ * @param options The parameter options
34
24
  */
35
- constructor(credentials: msRest.ServiceClientCredentials | TokenCredential, subscriptionId: string, options?: Models.MicrosoftResourceHealthOptions) {
36
- if (credentials == undefined) {
37
- throw new Error('\'credentials\' cannot be null.');
25
+ constructor(
26
+ credentials: coreAuth.TokenCredential,
27
+ subscriptionId: string,
28
+ options?: MicrosoftResourceHealthOptionalParams
29
+ ) {
30
+ if (credentials === undefined) {
31
+ throw new Error("'credentials' cannot be null");
38
32
  }
39
- if (subscriptionId == undefined) {
40
- throw new Error('\'subscriptionId\' cannot be null.');
33
+ if (subscriptionId === undefined) {
34
+ throw new Error("'subscriptionId' cannot be null");
41
35
  }
42
36
 
37
+ // Initializing default values for options
43
38
  if (!options) {
44
39
  options = {};
45
40
  }
46
- if (!options.userAgent) {
47
- const defaultUserAgent = msRestAzure.getDefaultUserAgentValue();
48
- options.userAgent = `${packageName}/${packageVersion} ${defaultUserAgent}`;
49
- }
41
+ const defaults: MicrosoftResourceHealthOptionalParams = {
42
+ requestContentType: "application/json; charset=utf-8",
43
+ credential: credentials
44
+ };
50
45
 
51
- super(credentials, options);
46
+ const packageDetails = `azsdk-js-arm-resourcehealth/3.0.0-beta.1`;
47
+ const userAgentPrefix =
48
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
49
+ ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
50
+ : `${packageDetails}`;
52
51
 
53
- this.apiVersion = '2017-07-01';
54
- this.acceptLanguage = 'en-US';
55
- this.longRunningOperationRetryTimeout = 30;
56
- this.baseUri = options.baseUri || this.baseUri || "https://management.azure.com";
57
- this.requestContentType = "application/json; charset=utf-8";
58
- this.credentials = credentials;
52
+ if (!options.credentialScopes) {
53
+ options.credentialScopes = ["https://management.azure.com/.default"];
54
+ }
55
+ const optionsWithDefaults = {
56
+ ...defaults,
57
+ ...options,
58
+ userAgentOptions: {
59
+ userAgentPrefix
60
+ },
61
+ baseUri: options.endpoint || "https://management.azure.com"
62
+ };
63
+ super(optionsWithDefaults);
64
+ // Parameter assignments
59
65
  this.subscriptionId = subscriptionId;
60
66
 
61
- if (options.acceptLanguage !== null && options.acceptLanguage !== undefined) {
62
- this.acceptLanguage = options.acceptLanguage;
63
- }
64
- if (options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) {
65
- this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout;
66
- }
67
+ // Assigning values to Constant parameters
68
+ this.$host = options.$host || "https://management.azure.com";
69
+ this.apiVersion = options.apiVersion || "2017-07-01";
67
70
  }
68
71
  }