@azure/arm-resourcehealth 1.1.0 → 3.0.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +14 -0
- package/{LICENSE.txt → LICENSE} +21 -21
- package/README.md +98 -100
- package/dist/index.js +1811 -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/microsoftResourceHealth.d.ts +20 -0
- package/dist-esm/src/microsoftResourceHealth.d.ts.map +1 -0
- package/dist-esm/src/microsoftResourceHealth.js +27 -0
- package/dist-esm/src/microsoftResourceHealth.js.map +1 -0
- package/dist-esm/src/microsoftResourceHealthContext.d.ts +17 -0
- package/dist-esm/src/microsoftResourceHealthContext.d.ts.map +1 -0
- package/dist-esm/src/microsoftResourceHealthContext.js +50 -0
- package/dist-esm/src/microsoftResourceHealthContext.js.map +1 -0
- package/dist-esm/src/models/index.d.ts +402 -0
- package/dist-esm/src/models/index.d.ts.map +1 -0
- package/dist-esm/src/models/index.js +22 -0
- package/dist-esm/src/models/index.js.map +1 -0
- package/dist-esm/src/models/mappers.d.ts +21 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/mappers.js +393 -170
- package/dist-esm/src/models/mappers.js.map +1 -0
- package/dist-esm/src/models/parameters.d.ts +12 -0
- package/dist-esm/src/models/parameters.d.ts.map +1 -0
- package/{esm → dist-esm/src}/models/parameters.js +52 -36
- package/dist-esm/src/models/parameters.js.map +1 -0
- package/dist-esm/src/operations/availabilityStatuses.d.ts +102 -0
- package/dist-esm/src/operations/availabilityStatuses.d.ts.map +1 -0
- package/dist-esm/src/operations/availabilityStatuses.js +407 -0
- package/dist-esm/src/operations/availabilityStatuses.js.map +1 -0
- package/dist-esm/src/operations/childAvailabilityStatuses.d.ts +51 -0
- package/dist-esm/src/operations/childAvailabilityStatuses.d.ts.map +1 -0
- package/dist-esm/src/operations/childAvailabilityStatuses.js +173 -0
- package/dist-esm/src/operations/childAvailabilityStatuses.js.map +1 -0
- package/dist-esm/src/operations/childResources.d.ts +43 -0
- package/dist-esm/src/operations/childResources.d.ts.map +1 -0
- package/dist-esm/src/operations/childResources.js +143 -0
- package/dist-esm/src/operations/childResources.js.map +1 -0
- package/dist-esm/src/operations/emergingIssues.d.ts +37 -0
- package/dist-esm/src/operations/emergingIssues.d.ts.map +1 -0
- package/dist-esm/src/operations/emergingIssues.js +143 -0
- package/dist-esm/src/operations/emergingIssues.js.map +1 -0
- package/dist-esm/src/operations/index.d.ts +6 -0
- package/dist-esm/src/operations/index.d.ts.map +1 -0
- package/dist-esm/src/operations/index.js +13 -0
- package/dist-esm/src/operations/index.js.map +1 -0
- package/dist-esm/src/operations/operations.d.ts +18 -0
- package/dist-esm/src/operations/operations.d.ts.map +1 -0
- package/dist-esm/src/operations/operations.js +46 -0
- package/dist-esm/src/operations/operations.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts +40 -0
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.js +9 -0
- package/dist-esm/src/operationsInterfaces/availabilityStatuses.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.d.ts +23 -0
- package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js +9 -0
- package/dist-esm/src/operationsInterfaces/childAvailabilityStatuses.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/childResources.d.ts +15 -0
- package/dist-esm/src/operationsInterfaces/childResources.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/childResources.js +9 -0
- package/dist-esm/src/operationsInterfaces/childResources.js.map +1 -0
- package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts +16 -0
- package/dist-esm/src/operationsInterfaces/emergingIssues.d.ts.map +1 -0
- package/dist-esm/src/operationsInterfaces/emergingIssues.js +9 -0
- package/dist-esm/src/operationsInterfaces/emergingIssues.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/operations.d.ts +10 -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 +68 -34
- package/review/arm-resourcehealth.api.md +396 -0
- package/rollup.config.js +184 -27
- package/src/index.ts +13 -0
- package/src/microsoftResourceHealth.ts +53 -0
- package/src/microsoftResourceHealthContext.ts +71 -0
- package/src/models/index.ts +478 -0
- package/{lib → src}/models/mappers.ts +409 -175
- package/src/models/parameters.ts +127 -0
- package/src/operations/availabilityStatuses.ts +479 -0
- package/src/operations/childAvailabilityStatuses.ts +210 -0
- package/src/operations/childResources.ts +168 -0
- package/src/operations/emergingIssues.ts +165 -0
- package/src/operations/index.ts +13 -0
- package/src/operations/operations.ts +59 -0
- package/src/operationsInterfaces/availabilityStatuses.ts +67 -0
- package/src/operationsInterfaces/childAvailabilityStatuses.ts +43 -0
- package/src/operationsInterfaces/childResources.ts +30 -0
- package/src/operationsInterfaces/emergingIssues.ts +34 -0
- package/src/operationsInterfaces/index.ts +13 -0
- package/src/operationsInterfaces/operations.ts +21 -0
- package/tsconfig.json +4 -4
- package/types/arm-resourcehealth.d.ts +588 -0
- package/types/tsdoc-metadata.json +11 -0
- package/dist/arm-resourcehealth.js +0 -1037
- package/dist/arm-resourcehealth.js.map +0 -1
- package/dist/arm-resourcehealth.min.js +0 -1
- package/dist/arm-resourcehealth.min.js.map +0 -1
- package/esm/microsoftResourceHealth.d.ts +0 -20
- package/esm/microsoftResourceHealth.d.ts.map +0 -1
- package/esm/microsoftResourceHealth.js +0 -35
- package/esm/microsoftResourceHealth.js.map +0 -1
- package/esm/microsoftResourceHealthContext.d.ts +0 -17
- package/esm/microsoftResourceHealthContext.d.ts.map +0 -1
- package/esm/microsoftResourceHealthContext.js +0 -57
- package/esm/microsoftResourceHealthContext.js.map +0 -1
- package/esm/models/availabilityStatusesMappers.d.ts +0 -2
- package/esm/models/availabilityStatusesMappers.d.ts.map +0 -1
- package/esm/models/availabilityStatusesMappers.js +0 -11
- package/esm/models/availabilityStatusesMappers.js.map +0 -1
- package/esm/models/index.d.ts +0 -589
- 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/mappers.d.ts +0 -16
- 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 -10
- package/esm/models/parameters.d.ts.map +0 -1
- package/esm/models/parameters.js.map +0 -1
- package/esm/operations/availabilityStatuses.d.ts +0 -166
- package/esm/operations/availabilityStatuses.d.ts.map +0 -1
- package/esm/operations/availabilityStatuses.js +0 -225
- package/esm/operations/availabilityStatuses.js.map +0 -1
- package/esm/operations/index.d.ts +0 -3
- package/esm/operations/index.d.ts.map +0 -1
- package/esm/operations/index.js +0 -12
- package/esm/operations/index.js.map +0 -1
- package/esm/operations/operations.d.ts +0 -28
- package/esm/operations/operations.d.ts.map +0 -1
- package/esm/operations/operations.js +0 -51
- package/esm/operations/operations.js.map +0 -1
- package/lib/microsoftResourceHealth.ts +0 -45
- package/lib/microsoftResourceHealthContext.ts +0 -63
- package/lib/models/availabilityStatusesMappers.ts +0 -22
- package/lib/models/index.ts +0 -628
- package/lib/models/operationsMappers.ts +0 -17
- package/lib/models/parameters.ts +0 -98
- package/lib/operations/availabilityStatuses.ts +0 -416
- package/lib/operations/index.ts +0 -12
- package/lib/operations/operations.ts +0 -74
package/rollup.config.js
CHANGED
@@ -1,31 +1,188 @@
|
|
1
|
-
|
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
|
-
*
|
94
|
+
* Construct a warning handler for the shared rollup configuration
|
95
|
+
* that ignores certain warnings that are not relevant to testing.
|
4
96
|
*/
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
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
|
-
|
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 { MicrosoftResourceHealth } from "./microsoftResourceHealth";
|
12
|
+
export { MicrosoftResourceHealthContext } from "./microsoftResourceHealthContext";
|
13
|
+
export * from "./operationsInterfaces";
|
@@ -0,0 +1,53 @@
|
|
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 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";
|
24
|
+
import { MicrosoftResourceHealthContext } from "./microsoftResourceHealthContext";
|
25
|
+
import { MicrosoftResourceHealthOptionalParams } from "./models";
|
26
|
+
|
27
|
+
export class MicrosoftResourceHealth extends MicrosoftResourceHealthContext {
|
28
|
+
/**
|
29
|
+
* Initializes a new instance of the MicrosoftResourceHealth class.
|
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
|
34
|
+
*/
|
35
|
+
constructor(
|
36
|
+
credentials: coreAuth.TokenCredential,
|
37
|
+
subscriptionId: string,
|
38
|
+
options?: MicrosoftResourceHealthOptionalParams
|
39
|
+
) {
|
40
|
+
super(credentials, subscriptionId, options);
|
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);
|
46
|
+
}
|
47
|
+
|
48
|
+
availabilityStatuses: AvailabilityStatuses;
|
49
|
+
childAvailabilityStatuses: ChildAvailabilityStatuses;
|
50
|
+
childResources: ChildResources;
|
51
|
+
operations: Operations;
|
52
|
+
emergingIssues: EmergingIssues;
|
53
|
+
}
|
@@ -0,0 +1,71 @@
|
|
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 { MicrosoftResourceHealthOptionalParams } from "./models";
|
12
|
+
|
13
|
+
export class MicrosoftResourceHealthContext extends coreClient.ServiceClient {
|
14
|
+
$host: string;
|
15
|
+
apiVersion: string;
|
16
|
+
subscriptionId: string;
|
17
|
+
|
18
|
+
/**
|
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
|
24
|
+
*/
|
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");
|
32
|
+
}
|
33
|
+
if (subscriptionId === undefined) {
|
34
|
+
throw new Error("'subscriptionId' cannot be null");
|
35
|
+
}
|
36
|
+
|
37
|
+
// Initializing default values for options
|
38
|
+
if (!options) {
|
39
|
+
options = {};
|
40
|
+
}
|
41
|
+
const defaults: MicrosoftResourceHealthOptionalParams = {
|
42
|
+
requestContentType: "application/json; charset=utf-8",
|
43
|
+
credential: credentials
|
44
|
+
};
|
45
|
+
|
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}`;
|
51
|
+
|
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
|
65
|
+
this.subscriptionId = subscriptionId;
|
66
|
+
|
67
|
+
// Assigning values to Constant parameters
|
68
|
+
this.$host = options.$host || "https://management.azure.com";
|
69
|
+
this.apiVersion = options.apiVersion || "2017-07-01";
|
70
|
+
}
|
71
|
+
}
|