@azure/arm-serialconsole 2.1.2-alpha.20260303.1 → 2.1.2-alpha.20260304.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonjs/index.js +26 -16
- package/dist/commonjs/index.js.map +7 -1
- package/dist/commonjs/microsoftSerialConsoleClient.js +225 -201
- package/dist/commonjs/microsoftSerialConsoleClient.js.map +7 -1
- package/dist/commonjs/models/index.js +15 -10
- package/dist/commonjs/models/index.js.map +7 -1
- package/dist/commonjs/models/mappers.js +273 -249
- package/dist/commonjs/models/mappers.js.map +7 -1
- package/dist/commonjs/models/parameters.js +132 -110
- package/dist/commonjs/models/parameters.js.map +7 -1
- package/dist/commonjs/operations/index.js +17 -12
- package/dist/commonjs/operations/index.js.map +7 -1
- package/dist/commonjs/operations/serialPorts.js +296 -257
- package/dist/commonjs/operations/serialPorts.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/index.js +17 -12
- package/dist/commonjs/operationsInterfaces/index.js.map +7 -1
- package/dist/commonjs/operationsInterfaces/serialPorts.js +15 -10
- package/dist/commonjs/operationsInterfaces/serialPorts.js.map +7 -1
- package/dist/esm/index.js +4 -9
- package/dist/esm/index.js.map +7 -1
- package/dist/esm/microsoftSerialConsoleClient.js +192 -192
- package/dist/esm/microsoftSerialConsoleClient.js.map +7 -1
- package/dist/esm/models/index.js +0 -9
- package/dist/esm/models/index.js.map +7 -1
- package/dist/esm/models/mappers.js +254 -246
- package/dist/esm/models/mappers.js.map +7 -1
- package/dist/esm/models/parameters.js +112 -106
- package/dist/esm/models/parameters.js.map +7 -1
- package/dist/esm/operations/index.js +0 -8
- package/dist/esm/operations/index.js.map +7 -1
- package/dist/esm/operations/serialPorts.js +265 -250
- package/dist/esm/operations/serialPorts.js.map +7 -1
- package/dist/esm/operationsInterfaces/index.js +0 -8
- package/dist/esm/operationsInterfaces/index.js.map +7 -1
- package/dist/esm/operationsInterfaces/serialPorts.js +0 -9
- package/dist/esm/operationsInterfaces/serialPorts.js.map +7 -1
- package/package.json +1 -18
package/dist/commonjs/index.js
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var src_exports = {};
|
|
20
|
+
__export(src_exports, {
|
|
21
|
+
MicrosoftSerialConsoleClient: () => import_microsoftSerialConsoleClient.MicrosoftSerialConsoleClient
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(src_exports);
|
|
24
|
+
__reExport(src_exports, require("./models/index.js"), module.exports);
|
|
25
|
+
var import_microsoftSerialConsoleClient = require("./microsoftSerialConsoleClient.js");
|
|
26
|
+
__reExport(src_exports, require("./operationsInterfaces/index.js"), module.exports);
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/serialconsole/arm-serialconsole/src/index.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nexport * from \"./models/index.js\";\nexport { MicrosoftSerialConsoleClient } from \"./microsoftSerialConsoleClient.js\";\nexport * from \"./operationsInterfaces/index.js\";\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,wBAAc,8BARd;AASA,0CAA6C;AAC7C,wBAAc,4CAVd;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,220 +1,244 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
var microsoftSerialConsoleClient_exports = {};
|
|
29
|
+
__export(microsoftSerialConsoleClient_exports, {
|
|
30
|
+
MicrosoftSerialConsoleClient: () => MicrosoftSerialConsoleClient
|
|
31
|
+
});
|
|
32
|
+
module.exports = __toCommonJS(microsoftSerialConsoleClient_exports);
|
|
33
|
+
var coreClient = __toESM(require("@azure/core-client"));
|
|
34
|
+
var coreRestPipeline = __toESM(require("@azure/core-rest-pipeline"));
|
|
35
|
+
var import_operations = require("./operations/index.js");
|
|
36
|
+
var Parameters = __toESM(require("./models/parameters.js"));
|
|
37
|
+
var Mappers = __toESM(require("./models/mappers.js"));
|
|
17
38
|
class MicrosoftSerialConsoleClient extends coreClient.ServiceClient {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
-
if (subscriptionId === undefined) {
|
|
33
|
-
throw new Error("'subscriptionId' cannot be null");
|
|
34
|
-
}
|
|
35
|
-
// Initializing default values for options
|
|
36
|
-
if (!options) {
|
|
37
|
-
options = {};
|
|
38
|
-
}
|
|
39
|
-
const defaults = {
|
|
40
|
-
requestContentType: "application/json; charset=utf-8",
|
|
41
|
-
credential: credentials
|
|
42
|
-
};
|
|
43
|
-
const packageDetails = `azsdk-js-arm-serialconsole/2.1.2`;
|
|
44
|
-
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
45
|
-
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
46
|
-
: `${packageDetails}`;
|
|
47
|
-
const optionsWithDefaults = {
|
|
48
|
-
...defaults,
|
|
49
|
-
...options,
|
|
50
|
-
userAgentOptions: {
|
|
51
|
-
userAgentPrefix
|
|
52
|
-
},
|
|
53
|
-
endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
54
|
-
};
|
|
55
|
-
super(optionsWithDefaults);
|
|
56
|
-
let bearerTokenAuthenticationPolicyFound = false;
|
|
57
|
-
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
58
|
-
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
59
|
-
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some((pipelinePolicy) => pipelinePolicy.name ===
|
|
60
|
-
coreRestPipeline.bearerTokenAuthenticationPolicyName);
|
|
61
|
-
}
|
|
62
|
-
if (!options ||
|
|
63
|
-
!options.pipeline ||
|
|
64
|
-
options.pipeline.getOrderedPolicies().length == 0 ||
|
|
65
|
-
!bearerTokenAuthenticationPolicyFound) {
|
|
66
|
-
this.pipeline.removePolicy({
|
|
67
|
-
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
68
|
-
});
|
|
69
|
-
this.pipeline.addPolicy(coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
70
|
-
credential: credentials,
|
|
71
|
-
scopes: optionsWithDefaults.credentialScopes ??
|
|
72
|
-
`${optionsWithDefaults.endpoint}/.default`,
|
|
73
|
-
challengeCallbacks: {
|
|
74
|
-
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
75
|
-
}
|
|
76
|
-
}));
|
|
77
|
-
}
|
|
78
|
-
// Parameter assignments
|
|
79
|
-
this.subscriptionId = subscriptionId;
|
|
80
|
-
// Assigning values to Constant parameters
|
|
81
|
-
this.$host = options.$host || "https://management.azure.com";
|
|
82
|
-
this.apiVersion = options.apiVersion || "2018-05-01";
|
|
83
|
-
this.serialPorts = new index_js_1.SerialPortsImpl(this);
|
|
84
|
-
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
39
|
+
$host;
|
|
40
|
+
apiVersion;
|
|
41
|
+
subscriptionId;
|
|
42
|
+
/**
|
|
43
|
+
* Initializes a new instance of the MicrosoftSerialConsoleClient class.
|
|
44
|
+
* @param credentials Subscription credentials which uniquely identify client subscription.
|
|
45
|
+
* @param subscriptionId Subscription ID which uniquely identifies the Microsoft Azure subscription.
|
|
46
|
+
* The subscription ID forms part of the URI for every service call requiring it.
|
|
47
|
+
* @param options The parameter options
|
|
48
|
+
*/
|
|
49
|
+
constructor(credentials, subscriptionId, options) {
|
|
50
|
+
if (credentials === void 0) {
|
|
51
|
+
throw new Error("'credentials' cannot be null");
|
|
85
52
|
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
if (!apiVersion) {
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
const apiVersionPolicy = {
|
|
92
|
-
name: "CustomApiVersionPolicy",
|
|
93
|
-
async sendRequest(request, next) {
|
|
94
|
-
const param = request.url.split("?");
|
|
95
|
-
if (param.length > 1) {
|
|
96
|
-
const newParams = param[1].split("&").map((item) => {
|
|
97
|
-
if (item.indexOf("api-version") > -1) {
|
|
98
|
-
return "api-version=" + apiVersion;
|
|
99
|
-
}
|
|
100
|
-
else {
|
|
101
|
-
return item;
|
|
102
|
-
}
|
|
103
|
-
});
|
|
104
|
-
request.url = param[0] + "?" + newParams.join("&");
|
|
105
|
-
}
|
|
106
|
-
return next(request);
|
|
107
|
-
}
|
|
108
|
-
};
|
|
109
|
-
this.pipeline.addPolicy(apiVersionPolicy);
|
|
53
|
+
if (subscriptionId === void 0) {
|
|
54
|
+
throw new Error("'subscriptionId' cannot be null");
|
|
110
55
|
}
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
* @param options The options parameters.
|
|
114
|
-
*/
|
|
115
|
-
listOperations(options) {
|
|
116
|
-
return this.sendOperationRequest({ options }, listOperationsOperationSpec);
|
|
56
|
+
if (!options) {
|
|
57
|
+
options = {};
|
|
117
58
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
59
|
+
const defaults = {
|
|
60
|
+
requestContentType: "application/json; charset=utf-8",
|
|
61
|
+
credential: credentials
|
|
62
|
+
};
|
|
63
|
+
const packageDetails = `azsdk-js-arm-serialconsole/2.1.2`;
|
|
64
|
+
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`;
|
|
65
|
+
const optionsWithDefaults = {
|
|
66
|
+
...defaults,
|
|
67
|
+
...options,
|
|
68
|
+
userAgentOptions: {
|
|
69
|
+
userAgentPrefix
|
|
70
|
+
},
|
|
71
|
+
endpoint: options.endpoint ?? options.baseUri ?? "https://management.azure.com"
|
|
72
|
+
};
|
|
73
|
+
super(optionsWithDefaults);
|
|
74
|
+
let bearerTokenAuthenticationPolicyFound = false;
|
|
75
|
+
if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {
|
|
76
|
+
const pipelinePolicies = options.pipeline.getOrderedPolicies();
|
|
77
|
+
bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(
|
|
78
|
+
(pipelinePolicy) => pipelinePolicy.name === coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
79
|
+
);
|
|
125
80
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
81
|
+
if (!options || !options.pipeline || options.pipeline.getOrderedPolicies().length == 0 || !bearerTokenAuthenticationPolicyFound) {
|
|
82
|
+
this.pipeline.removePolicy({
|
|
83
|
+
name: coreRestPipeline.bearerTokenAuthenticationPolicyName
|
|
84
|
+
});
|
|
85
|
+
this.pipeline.addPolicy(
|
|
86
|
+
coreRestPipeline.bearerTokenAuthenticationPolicy({
|
|
87
|
+
credential: credentials,
|
|
88
|
+
scopes: optionsWithDefaults.credentialScopes ?? `${optionsWithDefaults.endpoint}/.default`,
|
|
89
|
+
challengeCallbacks: {
|
|
90
|
+
authorizeRequestOnChallenge: coreClient.authorizeRequestOnClaimChallenge
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
);
|
|
133
94
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
95
|
+
this.subscriptionId = subscriptionId;
|
|
96
|
+
this.$host = options.$host || "https://management.azure.com";
|
|
97
|
+
this.apiVersion = options.apiVersion || "2018-05-01";
|
|
98
|
+
this.serialPorts = new import_operations.SerialPortsImpl(this);
|
|
99
|
+
this.addCustomApiVersionPolicy(options.apiVersion);
|
|
100
|
+
}
|
|
101
|
+
/** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */
|
|
102
|
+
addCustomApiVersionPolicy(apiVersion) {
|
|
103
|
+
if (!apiVersion) {
|
|
104
|
+
return;
|
|
141
105
|
}
|
|
142
|
-
|
|
106
|
+
const apiVersionPolicy = {
|
|
107
|
+
name: "CustomApiVersionPolicy",
|
|
108
|
+
async sendRequest(request, next) {
|
|
109
|
+
const param = request.url.split("?");
|
|
110
|
+
if (param.length > 1) {
|
|
111
|
+
const newParams = param[1].split("&").map((item) => {
|
|
112
|
+
if (item.indexOf("api-version") > -1) {
|
|
113
|
+
return "api-version=" + apiVersion;
|
|
114
|
+
} else {
|
|
115
|
+
return item;
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
request.url = param[0] + "?" + newParams.join("&");
|
|
119
|
+
}
|
|
120
|
+
return next(request);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
this.pipeline.addPolicy(apiVersionPolicy);
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Gets a list of Serial Console API operations.
|
|
127
|
+
* @param options The options parameters.
|
|
128
|
+
*/
|
|
129
|
+
listOperations(options) {
|
|
130
|
+
return this.sendOperationRequest({ options }, listOperationsOperationSpec);
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Gets whether or not Serial Console is disabled for a given subscription
|
|
134
|
+
* @param defaultParam Default parameter. Leave the value as "default".
|
|
135
|
+
* @param options The options parameters.
|
|
136
|
+
*/
|
|
137
|
+
getConsoleStatus(defaultParam, options) {
|
|
138
|
+
return this.sendOperationRequest(
|
|
139
|
+
{ defaultParam, options },
|
|
140
|
+
getConsoleStatusOperationSpec
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Disables the Serial Console service for all VMs and VM scale sets in the provided subscription
|
|
145
|
+
* @param defaultParam Default parameter. Leave the value as "default".
|
|
146
|
+
* @param options The options parameters.
|
|
147
|
+
*/
|
|
148
|
+
disableConsole(defaultParam, options) {
|
|
149
|
+
return this.sendOperationRequest(
|
|
150
|
+
{ defaultParam, options },
|
|
151
|
+
disableConsoleOperationSpec
|
|
152
|
+
);
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Enables the Serial Console service for all VMs and VM scale sets in the provided subscription
|
|
156
|
+
* @param defaultParam Default parameter. Leave the value as "default".
|
|
157
|
+
* @param options The options parameters.
|
|
158
|
+
*/
|
|
159
|
+
enableConsole(defaultParam, options) {
|
|
160
|
+
return this.sendOperationRequest(
|
|
161
|
+
{ defaultParam, options },
|
|
162
|
+
enableConsoleOperationSpec
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
serialPorts;
|
|
143
166
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
167
|
+
const serializer = coreClient.createSerializer(
|
|
168
|
+
Mappers,
|
|
169
|
+
/* isXml */
|
|
170
|
+
false
|
|
171
|
+
);
|
|
147
172
|
const listOperationsOperationSpec = {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
173
|
+
path: "/providers/Microsoft.SerialConsole/operations",
|
|
174
|
+
httpMethod: "GET",
|
|
175
|
+
responses: {
|
|
176
|
+
200: {
|
|
177
|
+
bodyMapper: Mappers.SerialConsoleOperations
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
queryParameters: [Parameters.apiVersion],
|
|
181
|
+
urlParameters: [Parameters.$host],
|
|
182
|
+
headerParameters: [Parameters.accept],
|
|
183
|
+
serializer
|
|
159
184
|
};
|
|
160
185
|
const getConsoleStatusOperationSpec = {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
},
|
|
167
|
-
404: {
|
|
168
|
-
bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound
|
|
169
|
-
}
|
|
186
|
+
path: "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}",
|
|
187
|
+
httpMethod: "GET",
|
|
188
|
+
responses: {
|
|
189
|
+
200: {
|
|
190
|
+
bodyMapper: Mappers.SerialConsoleStatus
|
|
170
191
|
},
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
192
|
+
404: {
|
|
193
|
+
bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound
|
|
194
|
+
}
|
|
195
|
+
},
|
|
196
|
+
queryParameters: [Parameters.apiVersion],
|
|
197
|
+
urlParameters: [
|
|
198
|
+
Parameters.$host,
|
|
199
|
+
Parameters.subscriptionId,
|
|
200
|
+
Parameters.defaultParam
|
|
201
|
+
],
|
|
202
|
+
headerParameters: [Parameters.accept],
|
|
203
|
+
serializer
|
|
179
204
|
};
|
|
180
205
|
const disableConsoleOperationSpec = {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
},
|
|
187
|
-
404: {
|
|
188
|
-
bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound
|
|
189
|
-
}
|
|
206
|
+
path: "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole",
|
|
207
|
+
httpMethod: "POST",
|
|
208
|
+
responses: {
|
|
209
|
+
200: {
|
|
210
|
+
bodyMapper: Mappers.DisableSerialConsoleResult
|
|
190
211
|
},
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
212
|
+
404: {
|
|
213
|
+
bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
queryParameters: [Parameters.apiVersion],
|
|
217
|
+
urlParameters: [
|
|
218
|
+
Parameters.$host,
|
|
219
|
+
Parameters.subscriptionId,
|
|
220
|
+
Parameters.defaultParam
|
|
221
|
+
],
|
|
222
|
+
headerParameters: [Parameters.accept],
|
|
223
|
+
serializer
|
|
199
224
|
};
|
|
200
225
|
const enableConsoleOperationSpec = {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
404: {
|
|
208
|
-
bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound
|
|
209
|
-
}
|
|
226
|
+
path: "/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole",
|
|
227
|
+
httpMethod: "POST",
|
|
228
|
+
responses: {
|
|
229
|
+
200: {
|
|
230
|
+
bodyMapper: Mappers.EnableSerialConsoleResult
|
|
210
231
|
},
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
232
|
+
404: {
|
|
233
|
+
bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
queryParameters: [Parameters.apiVersion],
|
|
237
|
+
urlParameters: [
|
|
238
|
+
Parameters.$host,
|
|
239
|
+
Parameters.subscriptionId,
|
|
240
|
+
Parameters.defaultParam
|
|
241
|
+
],
|
|
242
|
+
headerParameters: [Parameters.accept],
|
|
243
|
+
serializer
|
|
219
244
|
};
|
|
220
|
-
//# sourceMappingURL=microsoftSerialConsoleClient.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{"version":3,"file":"microsoftSerialConsoleClient.js","sourceRoot":"","sources":["../../src/microsoftSerialConsoleClient.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;AAEH,uEAAiD;AACjD,oFAA8D;AAO9D,oDAAwD;AAExD,2EAAqD;AACrD,qEAA+C;AAa/C,MAAa,4BAA6B,SAAQ,UAAU,CAAC,aAAa;IACxE,KAAK,CAAS;IACd,UAAU,CAAS;IACnB,cAAc,CAAS;IAEvB;;;;;;OAMG;IACH,YACE,WAAqC,EACrC,cAAsB,EACtB,OAAoD;QAEpD,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;YAC9B,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;QAClD,CAAC;QACD,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAA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S,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,yBAAyB;SAC9C;QACD,GAAG,EAAE;YACH,UAAU,EAAE,OAAO,CAAC,oCAAoC;SACzD;KACF;IACD,eAAe,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC;IACxC,aAAa,EAAE;QACb,UAAU,CAAC,KAAK;QAChB,UAAU,CAAC,cAAc;QACzB,UAAU,CAAC,YAAY;KACxB;IACD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport { SerialPortsImpl } from \"./operations/index.js\";\nimport { SerialPorts } from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n MicrosoftSerialConsoleClientOptionalParams,\n ListOperationsOptionalParams,\n ListOperationsResponse,\n GetConsoleStatusOptionalParams,\n GetConsoleStatusResponse,\n DisableConsoleOptionalParams,\n DisableConsoleResponse,\n EnableConsoleOptionalParams,\n EnableConsoleResponse\n} from \"./models/index.js\";\n\nexport class MicrosoftSerialConsoleClient extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n subscriptionId: string;\n\n /**\n * Initializes a new instance of the MicrosoftSerialConsoleClient class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param subscriptionId Subscription ID which uniquely identifies the Microsoft Azure subscription.\n * The subscription ID forms part of the URI for every service call requiring it.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionId: string,\n options?: MicrosoftSerialConsoleClientOptionalParams\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (subscriptionId === undefined) {\n throw new Error(\"'subscriptionId' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MicrosoftSerialConsoleClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials\n };\n\n const packageDetails = `azsdk-js-arm-serialconsole/2.1.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint:\n options.endpoint ?? options.baseUri ?? \"https://management.azure.com\"\n };\n super(optionsWithDefaults);\n\n let bearerTokenAuthenticationPolicyFound: boolean = false;\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n }\n if (\n !options ||\n !options.pipeline ||\n options.pipeline.getOrderedPolicies().length == 0 ||\n !bearerTokenAuthenticationPolicyFound\n ) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n credential: credentials,\n scopes:\n optionsWithDefaults.credentialScopes ??\n `${optionsWithDefaults.endpoint}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n // Parameter assignments\n this.subscriptionId = subscriptionId;\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.apiVersion = options.apiVersion || \"2018-05-01\";\n this.serialPorts = new SerialPortsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Gets a list of Serial Console API operations.\n * @param options The options parameters.\n */\n listOperations(\n options?: ListOperationsOptionalParams\n ): Promise<ListOperationsResponse> {\n return this.sendOperationRequest({ options }, listOperationsOperationSpec);\n }\n\n /**\n * Gets whether or not Serial Console is disabled for a given subscription\n * @param defaultParam Default parameter. Leave the value as \"default\".\n * @param options The options parameters.\n */\n getConsoleStatus(\n defaultParam: string,\n options?: GetConsoleStatusOptionalParams\n ): Promise<GetConsoleStatusResponse> {\n return this.sendOperationRequest(\n { defaultParam, options },\n getConsoleStatusOperationSpec\n );\n }\n\n /**\n * Disables the Serial Console service for all VMs and VM scale sets in the provided subscription\n * @param defaultParam Default parameter. Leave the value as \"default\".\n * @param options The options parameters.\n */\n disableConsole(\n defaultParam: string,\n options?: DisableConsoleOptionalParams\n ): Promise<DisableConsoleResponse> {\n return this.sendOperationRequest(\n { defaultParam, options },\n disableConsoleOperationSpec\n );\n }\n\n /**\n * Enables the Serial Console service for all VMs and VM scale sets in the provided subscription\n * @param defaultParam Default parameter. Leave the value as \"default\".\n * @param options The options parameters.\n */\n enableConsole(\n defaultParam: string,\n options?: EnableConsoleOptionalParams\n ): Promise<EnableConsoleResponse> {\n return this.sendOperationRequest(\n { defaultParam, options },\n enableConsoleOperationSpec\n );\n }\n\n serialPorts: SerialPorts;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationsOperationSpec: coreClient.OperationSpec = {\n path: \"/providers/Microsoft.SerialConsole/operations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SerialConsoleOperations\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getConsoleStatusOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SerialConsoleStatus\n },\n 404: {\n bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.defaultParam\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst disableConsoleOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DisableSerialConsoleResult\n },\n 404: {\n bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.defaultParam\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst enableConsoleOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.EnableSerialConsoleResult\n },\n 404: {\n bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.defaultParam\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\n"]}
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["/mnt/vss/_work/1/s/sdk/serialconsole/arm-serialconsole/src/microsoftSerialConsoleClient.ts"],
|
|
4
|
+
"sourcesContent": ["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport {\n PipelineRequest,\n PipelineResponse,\n SendRequest\n} from \"@azure/core-rest-pipeline\";\nimport * as coreAuth from \"@azure/core-auth\";\nimport { SerialPortsImpl } from \"./operations/index.js\";\nimport { SerialPorts } from \"./operationsInterfaces/index.js\";\nimport * as Parameters from \"./models/parameters.js\";\nimport * as Mappers from \"./models/mappers.js\";\nimport {\n MicrosoftSerialConsoleClientOptionalParams,\n ListOperationsOptionalParams,\n ListOperationsResponse,\n GetConsoleStatusOptionalParams,\n GetConsoleStatusResponse,\n DisableConsoleOptionalParams,\n DisableConsoleResponse,\n EnableConsoleOptionalParams,\n EnableConsoleResponse\n} from \"./models/index.js\";\n\nexport class MicrosoftSerialConsoleClient extends coreClient.ServiceClient {\n $host: string;\n apiVersion: string;\n subscriptionId: string;\n\n /**\n * Initializes a new instance of the MicrosoftSerialConsoleClient class.\n * @param credentials Subscription credentials which uniquely identify client subscription.\n * @param subscriptionId Subscription ID which uniquely identifies the Microsoft Azure subscription.\n * The subscription ID forms part of the URI for every service call requiring it.\n * @param options The parameter options\n */\n constructor(\n credentials: coreAuth.TokenCredential,\n subscriptionId: string,\n options?: MicrosoftSerialConsoleClientOptionalParams\n ) {\n if (credentials === undefined) {\n throw new Error(\"'credentials' cannot be null\");\n }\n if (subscriptionId === undefined) {\n throw new Error(\"'subscriptionId' cannot be null\");\n }\n\n // Initializing default values for options\n if (!options) {\n options = {};\n }\n const defaults: MicrosoftSerialConsoleClientOptionalParams = {\n requestContentType: \"application/json; charset=utf-8\",\n credential: credentials\n };\n\n const packageDetails = `azsdk-js-arm-serialconsole/2.1.2`;\n const userAgentPrefix =\n options.userAgentOptions && options.userAgentOptions.userAgentPrefix\n ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`\n : `${packageDetails}`;\n\n const optionsWithDefaults = {\n ...defaults,\n ...options,\n userAgentOptions: {\n userAgentPrefix\n },\n endpoint:\n options.endpoint ?? options.baseUri ?? \"https://management.azure.com\"\n };\n super(optionsWithDefaults);\n\n let bearerTokenAuthenticationPolicyFound: boolean = false;\n if (options?.pipeline && options.pipeline.getOrderedPolicies().length > 0) {\n const pipelinePolicies: coreRestPipeline.PipelinePolicy[] = options.pipeline.getOrderedPolicies();\n bearerTokenAuthenticationPolicyFound = pipelinePolicies.some(\n (pipelinePolicy) =>\n pipelinePolicy.name ===\n coreRestPipeline.bearerTokenAuthenticationPolicyName\n );\n }\n if (\n !options ||\n !options.pipeline ||\n options.pipeline.getOrderedPolicies().length == 0 ||\n !bearerTokenAuthenticationPolicyFound\n ) {\n this.pipeline.removePolicy({\n name: coreRestPipeline.bearerTokenAuthenticationPolicyName\n });\n this.pipeline.addPolicy(\n coreRestPipeline.bearerTokenAuthenticationPolicy({\n credential: credentials,\n scopes:\n optionsWithDefaults.credentialScopes ??\n `${optionsWithDefaults.endpoint}/.default`,\n challengeCallbacks: {\n authorizeRequestOnChallenge:\n coreClient.authorizeRequestOnClaimChallenge\n }\n })\n );\n }\n // Parameter assignments\n this.subscriptionId = subscriptionId;\n\n // Assigning values to Constant parameters\n this.$host = options.$host || \"https://management.azure.com\";\n this.apiVersion = options.apiVersion || \"2018-05-01\";\n this.serialPorts = new SerialPortsImpl(this);\n this.addCustomApiVersionPolicy(options.apiVersion);\n }\n\n /** A function that adds a policy that sets the api-version (or equivalent) to reflect the library version. */\n private addCustomApiVersionPolicy(apiVersion?: string) {\n if (!apiVersion) {\n return;\n }\n const apiVersionPolicy = {\n name: \"CustomApiVersionPolicy\",\n async sendRequest(\n request: PipelineRequest,\n next: SendRequest\n ): Promise<PipelineResponse> {\n const param = request.url.split(\"?\");\n if (param.length > 1) {\n const newParams = param[1].split(\"&\").map((item) => {\n if (item.indexOf(\"api-version\") > -1) {\n return \"api-version=\" + apiVersion;\n } else {\n return item;\n }\n });\n request.url = param[0] + \"?\" + newParams.join(\"&\");\n }\n return next(request);\n }\n };\n this.pipeline.addPolicy(apiVersionPolicy);\n }\n\n /**\n * Gets a list of Serial Console API operations.\n * @param options The options parameters.\n */\n listOperations(\n options?: ListOperationsOptionalParams\n ): Promise<ListOperationsResponse> {\n return this.sendOperationRequest({ options }, listOperationsOperationSpec);\n }\n\n /**\n * Gets whether or not Serial Console is disabled for a given subscription\n * @param defaultParam Default parameter. Leave the value as \"default\".\n * @param options The options parameters.\n */\n getConsoleStatus(\n defaultParam: string,\n options?: GetConsoleStatusOptionalParams\n ): Promise<GetConsoleStatusResponse> {\n return this.sendOperationRequest(\n { defaultParam, options },\n getConsoleStatusOperationSpec\n );\n }\n\n /**\n * Disables the Serial Console service for all VMs and VM scale sets in the provided subscription\n * @param defaultParam Default parameter. Leave the value as \"default\".\n * @param options The options parameters.\n */\n disableConsole(\n defaultParam: string,\n options?: DisableConsoleOptionalParams\n ): Promise<DisableConsoleResponse> {\n return this.sendOperationRequest(\n { defaultParam, options },\n disableConsoleOperationSpec\n );\n }\n\n /**\n * Enables the Serial Console service for all VMs and VM scale sets in the provided subscription\n * @param defaultParam Default parameter. Leave the value as \"default\".\n * @param options The options parameters.\n */\n enableConsole(\n defaultParam: string,\n options?: EnableConsoleOptionalParams\n ): Promise<EnableConsoleResponse> {\n return this.sendOperationRequest(\n { defaultParam, options },\n enableConsoleOperationSpec\n );\n }\n\n serialPorts: SerialPorts;\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst listOperationsOperationSpec: coreClient.OperationSpec = {\n path: \"/providers/Microsoft.SerialConsole/operations\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SerialConsoleOperations\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [Parameters.$host],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getConsoleStatusOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: Mappers.SerialConsoleStatus\n },\n 404: {\n bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.defaultParam\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst disableConsoleOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/disableConsole\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.DisableSerialConsoleResult\n },\n 404: {\n bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.defaultParam\n ],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst enableConsoleOperationSpec: coreClient.OperationSpec = {\n path:\n \"/subscriptions/{subscriptionId}/providers/Microsoft.SerialConsole/consoleServices/{default}/enableConsole\",\n httpMethod: \"POST\",\n responses: {\n 200: {\n bodyMapper: Mappers.EnableSerialConsoleResult\n },\n 404: {\n bodyMapper: Mappers.GetSerialConsoleSubscriptionNotFound\n }\n },\n queryParameters: [Parameters.apiVersion],\n urlParameters: [\n Parameters.$host,\n Parameters.subscriptionId,\n Parameters.defa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,EACA,iBAAiB,CAAC,WAAW,UAAU;AAAA,EACvC,eAAe;AAAA,IACb,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AAAA,EACA,kBAAkB,CAAC,WAAW,MAAM;AAAA,EACpC;AACF;AACA,MAAM,6BAAuD;AAAA,EAC3D,MACE;AAAA,EACF,YAAY;AAAA,EACZ,WAAW;AAAA,IACT,KAAK;AAAA,MACH,YAAY,QAAQ;AAAA,IACtB;AAAA,IACA,KAAK;AAAA,MACH,YAAY,QAAQ;AAAA,IACtB;AAAA,EACF;AAAA,EACA,iBAAiB,CAAC,WAAW,UAAU;AAAA,EACvC,eAAe;AAAA,IACb,WAAW;AAAA,IACX,WAAW;AAAA,IACX,WAAW;AAAA,EACb;AAAA,EACA,kBAAkB,CAAC,WAAW,MAAM;AAAA,EACpC;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
14
|
+
var models_exports = {};
|
|
15
|
+
module.exports = __toCommonJS(models_exports);
|