@aws-sdk/client-ec2-instance-connect 3.183.0 → 3.185.0
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/CHANGELOG.md +11 -0
- package/dist-cjs/protocols/Aws_json1_1.js +2 -2
- package/dist-es/EC2InstanceConnect.js +17 -10
- package/dist-es/EC2InstanceConnectClient.js +28 -22
- package/dist-es/commands/SendSSHPublicKeyCommand.js +28 -21
- package/dist-es/commands/SendSerialConsoleSSHPublicKeyCommand.js +28 -21
- package/dist-es/endpoints.js +8 -8
- package/dist-es/models/EC2InstanceConnectServiceException.js +10 -5
- package/dist-es/models/models_0.js +137 -144
- package/dist-es/protocols/Aws_json1_1.js +358 -287
- package/dist-es/runtimeConfig.browser.js +12 -26
- package/dist-es/runtimeConfig.js +12 -30
- package/dist-es/runtimeConfig.native.js +5 -8
- package/dist-es/runtimeConfig.shared.js +11 -8
- package/package.json +5 -5
|
@@ -1,366 +1,437 @@
|
|
|
1
|
+
import { __assign, __awaiter, __generator } from "tslib";
|
|
1
2
|
import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
|
|
2
3
|
import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectString as __expectString, throwDefaultError, } from "@aws-sdk/smithy-client";
|
|
3
4
|
import { EC2InstanceConnectServiceException as __BaseException } from "../models/EC2InstanceConnectServiceException";
|
|
4
5
|
import { AuthException, EC2InstanceNotFoundException, EC2InstanceStateInvalidException, EC2InstanceTypeInvalidException, EC2InstanceUnavailableException, InvalidArgsException, SerialConsoleAccessDisabledException, SerialConsoleSessionLimitExceededException, SerialConsoleSessionUnavailableException, ServiceException, ThrottlingException, } from "../models/models_0";
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export const serializeAws_json1_1SendSSHPublicKeyCommand = async (input, context) => {
|
|
15
|
-
const headers = {
|
|
16
|
-
"content-type": "application/x-amz-json-1.1",
|
|
17
|
-
"x-amz-target": "AWSEC2InstanceConnectService.SendSSHPublicKey",
|
|
18
|
-
};
|
|
19
|
-
let body;
|
|
20
|
-
body = JSON.stringify(serializeAws_json1_1SendSSHPublicKeyRequest(input, context));
|
|
21
|
-
return buildHttpRpcRequest(context, headers, "/", undefined, body);
|
|
22
|
-
};
|
|
23
|
-
export const deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommand = async (output, context) => {
|
|
24
|
-
if (output.statusCode >= 300) {
|
|
25
|
-
return deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommandError(output, context);
|
|
26
|
-
}
|
|
27
|
-
const data = await parseBody(output.body, context);
|
|
28
|
-
let contents = {};
|
|
29
|
-
contents = deserializeAws_json1_1SendSerialConsoleSSHPublicKeyResponse(data, context);
|
|
30
|
-
const response = {
|
|
31
|
-
$metadata: deserializeMetadata(output),
|
|
32
|
-
...contents,
|
|
33
|
-
};
|
|
34
|
-
return Promise.resolve(response);
|
|
35
|
-
};
|
|
36
|
-
const deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommandError = async (output, context) => {
|
|
37
|
-
const parsedOutput = {
|
|
38
|
-
...output,
|
|
39
|
-
body: await parseErrorBody(output.body, context),
|
|
40
|
-
};
|
|
41
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
42
|
-
switch (errorCode) {
|
|
43
|
-
case "AuthException":
|
|
44
|
-
case "com.amazonaws.ec2instanceconnect#AuthException":
|
|
45
|
-
throw await deserializeAws_json1_1AuthExceptionResponse(parsedOutput, context);
|
|
46
|
-
case "EC2InstanceNotFoundException":
|
|
47
|
-
case "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException":
|
|
48
|
-
throw await deserializeAws_json1_1EC2InstanceNotFoundExceptionResponse(parsedOutput, context);
|
|
49
|
-
case "EC2InstanceStateInvalidException":
|
|
50
|
-
case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException":
|
|
51
|
-
throw await deserializeAws_json1_1EC2InstanceStateInvalidExceptionResponse(parsedOutput, context);
|
|
52
|
-
case "EC2InstanceTypeInvalidException":
|
|
53
|
-
case "com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException":
|
|
54
|
-
throw await deserializeAws_json1_1EC2InstanceTypeInvalidExceptionResponse(parsedOutput, context);
|
|
55
|
-
case "EC2InstanceUnavailableException":
|
|
56
|
-
case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException":
|
|
57
|
-
throw await deserializeAws_json1_1EC2InstanceUnavailableExceptionResponse(parsedOutput, context);
|
|
58
|
-
case "InvalidArgsException":
|
|
59
|
-
case "com.amazonaws.ec2instanceconnect#InvalidArgsException":
|
|
60
|
-
throw await deserializeAws_json1_1InvalidArgsExceptionResponse(parsedOutput, context);
|
|
61
|
-
case "SerialConsoleAccessDisabledException":
|
|
62
|
-
case "com.amazonaws.ec2instanceconnect#SerialConsoleAccessDisabledException":
|
|
63
|
-
throw await deserializeAws_json1_1SerialConsoleAccessDisabledExceptionResponse(parsedOutput, context);
|
|
64
|
-
case "SerialConsoleSessionLimitExceededException":
|
|
65
|
-
case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionLimitExceededException":
|
|
66
|
-
throw await deserializeAws_json1_1SerialConsoleSessionLimitExceededExceptionResponse(parsedOutput, context);
|
|
67
|
-
case "SerialConsoleSessionUnavailableException":
|
|
68
|
-
case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionUnavailableException":
|
|
69
|
-
throw await deserializeAws_json1_1SerialConsoleSessionUnavailableExceptionResponse(parsedOutput, context);
|
|
70
|
-
case "ServiceException":
|
|
71
|
-
case "com.amazonaws.ec2instanceconnect#ServiceException":
|
|
72
|
-
throw await deserializeAws_json1_1ServiceExceptionResponse(parsedOutput, context);
|
|
73
|
-
case "ThrottlingException":
|
|
74
|
-
case "com.amazonaws.ec2instanceconnect#ThrottlingException":
|
|
75
|
-
throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
|
|
76
|
-
default:
|
|
77
|
-
const parsedBody = parsedOutput.body;
|
|
78
|
-
throwDefaultError({
|
|
79
|
-
output,
|
|
80
|
-
parsedBody,
|
|
81
|
-
exceptionCtor: __BaseException,
|
|
82
|
-
errorCode,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
export const deserializeAws_json1_1SendSSHPublicKeyCommand = async (output, context) => {
|
|
87
|
-
if (output.statusCode >= 300) {
|
|
88
|
-
return deserializeAws_json1_1SendSSHPublicKeyCommandError(output, context);
|
|
89
|
-
}
|
|
90
|
-
const data = await parseBody(output.body, context);
|
|
91
|
-
let contents = {};
|
|
92
|
-
contents = deserializeAws_json1_1SendSSHPublicKeyResponse(data, context);
|
|
93
|
-
const response = {
|
|
94
|
-
$metadata: deserializeMetadata(output),
|
|
95
|
-
...contents,
|
|
96
|
-
};
|
|
97
|
-
return Promise.resolve(response);
|
|
98
|
-
};
|
|
99
|
-
const deserializeAws_json1_1SendSSHPublicKeyCommandError = async (output, context) => {
|
|
100
|
-
const parsedOutput = {
|
|
101
|
-
...output,
|
|
102
|
-
body: await parseErrorBody(output.body, context),
|
|
103
|
-
};
|
|
104
|
-
const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
105
|
-
switch (errorCode) {
|
|
106
|
-
case "AuthException":
|
|
107
|
-
case "com.amazonaws.ec2instanceconnect#AuthException":
|
|
108
|
-
throw await deserializeAws_json1_1AuthExceptionResponse(parsedOutput, context);
|
|
109
|
-
case "EC2InstanceNotFoundException":
|
|
110
|
-
case "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException":
|
|
111
|
-
throw await deserializeAws_json1_1EC2InstanceNotFoundExceptionResponse(parsedOutput, context);
|
|
112
|
-
case "EC2InstanceStateInvalidException":
|
|
113
|
-
case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException":
|
|
114
|
-
throw await deserializeAws_json1_1EC2InstanceStateInvalidExceptionResponse(parsedOutput, context);
|
|
115
|
-
case "EC2InstanceUnavailableException":
|
|
116
|
-
case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException":
|
|
117
|
-
throw await deserializeAws_json1_1EC2InstanceUnavailableExceptionResponse(parsedOutput, context);
|
|
118
|
-
case "InvalidArgsException":
|
|
119
|
-
case "com.amazonaws.ec2instanceconnect#InvalidArgsException":
|
|
120
|
-
throw await deserializeAws_json1_1InvalidArgsExceptionResponse(parsedOutput, context);
|
|
121
|
-
case "ServiceException":
|
|
122
|
-
case "com.amazonaws.ec2instanceconnect#ServiceException":
|
|
123
|
-
throw await deserializeAws_json1_1ServiceExceptionResponse(parsedOutput, context);
|
|
124
|
-
case "ThrottlingException":
|
|
125
|
-
case "com.amazonaws.ec2instanceconnect#ThrottlingException":
|
|
126
|
-
throw await deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context);
|
|
127
|
-
default:
|
|
128
|
-
const parsedBody = parsedOutput.body;
|
|
129
|
-
throwDefaultError({
|
|
130
|
-
output,
|
|
131
|
-
parsedBody,
|
|
132
|
-
exceptionCtor: __BaseException,
|
|
133
|
-
errorCode,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
const deserializeAws_json1_1AuthExceptionResponse = async (parsedOutput, context) => {
|
|
138
|
-
const body = parsedOutput.body;
|
|
139
|
-
const deserialized = deserializeAws_json1_1AuthException(body, context);
|
|
140
|
-
const exception = new AuthException({
|
|
141
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
142
|
-
...deserialized,
|
|
6
|
+
export var serializeAws_json1_1SendSerialConsoleSSHPublicKeyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7
|
+
var headers, body;
|
|
8
|
+
return __generator(this, function (_a) {
|
|
9
|
+
headers = {
|
|
10
|
+
"content-type": "application/x-amz-json-1.1",
|
|
11
|
+
"x-amz-target": "AWSEC2InstanceConnectService.SendSerialConsoleSSHPublicKey",
|
|
12
|
+
};
|
|
13
|
+
body = JSON.stringify(serializeAws_json1_1SendSerialConsoleSSHPublicKeyRequest(input, context));
|
|
14
|
+
return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
|
|
143
15
|
});
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
16
|
+
}); };
|
|
17
|
+
export var serializeAws_json1_1SendSSHPublicKeyCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
18
|
+
var headers, body;
|
|
19
|
+
return __generator(this, function (_a) {
|
|
20
|
+
headers = {
|
|
21
|
+
"content-type": "application/x-amz-json-1.1",
|
|
22
|
+
"x-amz-target": "AWSEC2InstanceConnectService.SendSSHPublicKey",
|
|
23
|
+
};
|
|
24
|
+
body = JSON.stringify(serializeAws_json1_1SendSSHPublicKeyRequest(input, context));
|
|
25
|
+
return [2, buildHttpRpcRequest(context, headers, "/", undefined, body)];
|
|
152
26
|
});
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
27
|
+
}); };
|
|
28
|
+
export var deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
29
|
+
var data, contents, response;
|
|
30
|
+
return __generator(this, function (_a) {
|
|
31
|
+
switch (_a.label) {
|
|
32
|
+
case 0:
|
|
33
|
+
if (output.statusCode >= 300) {
|
|
34
|
+
return [2, deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommandError(output, context)];
|
|
35
|
+
}
|
|
36
|
+
return [4, parseBody(output.body, context)];
|
|
37
|
+
case 1:
|
|
38
|
+
data = _a.sent();
|
|
39
|
+
contents = {};
|
|
40
|
+
contents = deserializeAws_json1_1SendSerialConsoleSSHPublicKeyResponse(data, context);
|
|
41
|
+
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
42
|
+
return [2, Promise.resolve(response)];
|
|
43
|
+
}
|
|
161
44
|
});
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
45
|
+
}); };
|
|
46
|
+
var deserializeAws_json1_1SendSerialConsoleSSHPublicKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
47
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
48
|
+
var _c;
|
|
49
|
+
return __generator(this, function (_d) {
|
|
50
|
+
switch (_d.label) {
|
|
51
|
+
case 0:
|
|
52
|
+
_a = [__assign({}, output)];
|
|
53
|
+
_c = {};
|
|
54
|
+
return [4, parseErrorBody(output.body, context)];
|
|
55
|
+
case 1:
|
|
56
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
57
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
58
|
+
_b = errorCode;
|
|
59
|
+
switch (_b) {
|
|
60
|
+
case "AuthException": return [3, 2];
|
|
61
|
+
case "com.amazonaws.ec2instanceconnect#AuthException": return [3, 2];
|
|
62
|
+
case "EC2InstanceNotFoundException": return [3, 4];
|
|
63
|
+
case "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException": return [3, 4];
|
|
64
|
+
case "EC2InstanceStateInvalidException": return [3, 6];
|
|
65
|
+
case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException": return [3, 6];
|
|
66
|
+
case "EC2InstanceTypeInvalidException": return [3, 8];
|
|
67
|
+
case "com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException": return [3, 8];
|
|
68
|
+
case "EC2InstanceUnavailableException": return [3, 10];
|
|
69
|
+
case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException": return [3, 10];
|
|
70
|
+
case "InvalidArgsException": return [3, 12];
|
|
71
|
+
case "com.amazonaws.ec2instanceconnect#InvalidArgsException": return [3, 12];
|
|
72
|
+
case "SerialConsoleAccessDisabledException": return [3, 14];
|
|
73
|
+
case "com.amazonaws.ec2instanceconnect#SerialConsoleAccessDisabledException": return [3, 14];
|
|
74
|
+
case "SerialConsoleSessionLimitExceededException": return [3, 16];
|
|
75
|
+
case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionLimitExceededException": return [3, 16];
|
|
76
|
+
case "SerialConsoleSessionUnavailableException": return [3, 18];
|
|
77
|
+
case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionUnavailableException": return [3, 18];
|
|
78
|
+
case "ServiceException": return [3, 20];
|
|
79
|
+
case "com.amazonaws.ec2instanceconnect#ServiceException": return [3, 20];
|
|
80
|
+
case "ThrottlingException": return [3, 22];
|
|
81
|
+
case "com.amazonaws.ec2instanceconnect#ThrottlingException": return [3, 22];
|
|
82
|
+
}
|
|
83
|
+
return [3, 24];
|
|
84
|
+
case 2: return [4, deserializeAws_json1_1AuthExceptionResponse(parsedOutput, context)];
|
|
85
|
+
case 3: throw _d.sent();
|
|
86
|
+
case 4: return [4, deserializeAws_json1_1EC2InstanceNotFoundExceptionResponse(parsedOutput, context)];
|
|
87
|
+
case 5: throw _d.sent();
|
|
88
|
+
case 6: return [4, deserializeAws_json1_1EC2InstanceStateInvalidExceptionResponse(parsedOutput, context)];
|
|
89
|
+
case 7: throw _d.sent();
|
|
90
|
+
case 8: return [4, deserializeAws_json1_1EC2InstanceTypeInvalidExceptionResponse(parsedOutput, context)];
|
|
91
|
+
case 9: throw _d.sent();
|
|
92
|
+
case 10: return [4, deserializeAws_json1_1EC2InstanceUnavailableExceptionResponse(parsedOutput, context)];
|
|
93
|
+
case 11: throw _d.sent();
|
|
94
|
+
case 12: return [4, deserializeAws_json1_1InvalidArgsExceptionResponse(parsedOutput, context)];
|
|
95
|
+
case 13: throw _d.sent();
|
|
96
|
+
case 14: return [4, deserializeAws_json1_1SerialConsoleAccessDisabledExceptionResponse(parsedOutput, context)];
|
|
97
|
+
case 15: throw _d.sent();
|
|
98
|
+
case 16: return [4, deserializeAws_json1_1SerialConsoleSessionLimitExceededExceptionResponse(parsedOutput, context)];
|
|
99
|
+
case 17: throw _d.sent();
|
|
100
|
+
case 18: return [4, deserializeAws_json1_1SerialConsoleSessionUnavailableExceptionResponse(parsedOutput, context)];
|
|
101
|
+
case 19: throw _d.sent();
|
|
102
|
+
case 20: return [4, deserializeAws_json1_1ServiceExceptionResponse(parsedOutput, context)];
|
|
103
|
+
case 21: throw _d.sent();
|
|
104
|
+
case 22: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
105
|
+
case 23: throw _d.sent();
|
|
106
|
+
case 24:
|
|
107
|
+
parsedBody = parsedOutput.body;
|
|
108
|
+
throwDefaultError({
|
|
109
|
+
output: output,
|
|
110
|
+
parsedBody: parsedBody,
|
|
111
|
+
exceptionCtor: __BaseException,
|
|
112
|
+
errorCode: errorCode,
|
|
113
|
+
});
|
|
114
|
+
_d.label = 25;
|
|
115
|
+
case 25: return [2];
|
|
116
|
+
}
|
|
170
117
|
});
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
118
|
+
}); };
|
|
119
|
+
export var deserializeAws_json1_1SendSSHPublicKeyCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
120
|
+
var data, contents, response;
|
|
121
|
+
return __generator(this, function (_a) {
|
|
122
|
+
switch (_a.label) {
|
|
123
|
+
case 0:
|
|
124
|
+
if (output.statusCode >= 300) {
|
|
125
|
+
return [2, deserializeAws_json1_1SendSSHPublicKeyCommandError(output, context)];
|
|
126
|
+
}
|
|
127
|
+
return [4, parseBody(output.body, context)];
|
|
128
|
+
case 1:
|
|
129
|
+
data = _a.sent();
|
|
130
|
+
contents = {};
|
|
131
|
+
contents = deserializeAws_json1_1SendSSHPublicKeyResponse(data, context);
|
|
132
|
+
response = __assign({ $metadata: deserializeMetadata(output) }, contents);
|
|
133
|
+
return [2, Promise.resolve(response)];
|
|
134
|
+
}
|
|
179
135
|
});
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
136
|
+
}); };
|
|
137
|
+
var deserializeAws_json1_1SendSSHPublicKeyCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
138
|
+
var parsedOutput, _a, errorCode, _b, parsedBody;
|
|
139
|
+
var _c;
|
|
140
|
+
return __generator(this, function (_d) {
|
|
141
|
+
switch (_d.label) {
|
|
142
|
+
case 0:
|
|
143
|
+
_a = [__assign({}, output)];
|
|
144
|
+
_c = {};
|
|
145
|
+
return [4, parseErrorBody(output.body, context)];
|
|
146
|
+
case 1:
|
|
147
|
+
parsedOutput = __assign.apply(void 0, _a.concat([(_c.body = _d.sent(), _c)]));
|
|
148
|
+
errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
|
|
149
|
+
_b = errorCode;
|
|
150
|
+
switch (_b) {
|
|
151
|
+
case "AuthException": return [3, 2];
|
|
152
|
+
case "com.amazonaws.ec2instanceconnect#AuthException": return [3, 2];
|
|
153
|
+
case "EC2InstanceNotFoundException": return [3, 4];
|
|
154
|
+
case "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException": return [3, 4];
|
|
155
|
+
case "EC2InstanceStateInvalidException": return [3, 6];
|
|
156
|
+
case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException": return [3, 6];
|
|
157
|
+
case "EC2InstanceUnavailableException": return [3, 8];
|
|
158
|
+
case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException": return [3, 8];
|
|
159
|
+
case "InvalidArgsException": return [3, 10];
|
|
160
|
+
case "com.amazonaws.ec2instanceconnect#InvalidArgsException": return [3, 10];
|
|
161
|
+
case "ServiceException": return [3, 12];
|
|
162
|
+
case "com.amazonaws.ec2instanceconnect#ServiceException": return [3, 12];
|
|
163
|
+
case "ThrottlingException": return [3, 14];
|
|
164
|
+
case "com.amazonaws.ec2instanceconnect#ThrottlingException": return [3, 14];
|
|
165
|
+
}
|
|
166
|
+
return [3, 16];
|
|
167
|
+
case 2: return [4, deserializeAws_json1_1AuthExceptionResponse(parsedOutput, context)];
|
|
168
|
+
case 3: throw _d.sent();
|
|
169
|
+
case 4: return [4, deserializeAws_json1_1EC2InstanceNotFoundExceptionResponse(parsedOutput, context)];
|
|
170
|
+
case 5: throw _d.sent();
|
|
171
|
+
case 6: return [4, deserializeAws_json1_1EC2InstanceStateInvalidExceptionResponse(parsedOutput, context)];
|
|
172
|
+
case 7: throw _d.sent();
|
|
173
|
+
case 8: return [4, deserializeAws_json1_1EC2InstanceUnavailableExceptionResponse(parsedOutput, context)];
|
|
174
|
+
case 9: throw _d.sent();
|
|
175
|
+
case 10: return [4, deserializeAws_json1_1InvalidArgsExceptionResponse(parsedOutput, context)];
|
|
176
|
+
case 11: throw _d.sent();
|
|
177
|
+
case 12: return [4, deserializeAws_json1_1ServiceExceptionResponse(parsedOutput, context)];
|
|
178
|
+
case 13: throw _d.sent();
|
|
179
|
+
case 14: return [4, deserializeAws_json1_1ThrottlingExceptionResponse(parsedOutput, context)];
|
|
180
|
+
case 15: throw _d.sent();
|
|
181
|
+
case 16:
|
|
182
|
+
parsedBody = parsedOutput.body;
|
|
183
|
+
throwDefaultError({
|
|
184
|
+
output: output,
|
|
185
|
+
parsedBody: parsedBody,
|
|
186
|
+
exceptionCtor: __BaseException,
|
|
187
|
+
errorCode: errorCode,
|
|
188
|
+
});
|
|
189
|
+
_d.label = 17;
|
|
190
|
+
case 17: return [2];
|
|
191
|
+
}
|
|
188
192
|
});
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
196
|
-
|
|
193
|
+
}); };
|
|
194
|
+
var deserializeAws_json1_1AuthExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
195
|
+
var body, deserialized, exception;
|
|
196
|
+
return __generator(this, function (_a) {
|
|
197
|
+
body = parsedOutput.body;
|
|
198
|
+
deserialized = deserializeAws_json1_1AuthException(body, context);
|
|
199
|
+
exception = new AuthException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
200
|
+
return [2, __decorateServiceException(exception, body)];
|
|
197
201
|
});
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
205
|
-
|
|
202
|
+
}); };
|
|
203
|
+
var deserializeAws_json1_1EC2InstanceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
204
|
+
var body, deserialized, exception;
|
|
205
|
+
return __generator(this, function (_a) {
|
|
206
|
+
body = parsedOutput.body;
|
|
207
|
+
deserialized = deserializeAws_json1_1EC2InstanceNotFoundException(body, context);
|
|
208
|
+
exception = new EC2InstanceNotFoundException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
209
|
+
return [2, __decorateServiceException(exception, body)];
|
|
206
210
|
});
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
214
|
-
|
|
211
|
+
}); };
|
|
212
|
+
var deserializeAws_json1_1EC2InstanceStateInvalidExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
213
|
+
var body, deserialized, exception;
|
|
214
|
+
return __generator(this, function (_a) {
|
|
215
|
+
body = parsedOutput.body;
|
|
216
|
+
deserialized = deserializeAws_json1_1EC2InstanceStateInvalidException(body, context);
|
|
217
|
+
exception = new EC2InstanceStateInvalidException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
218
|
+
return [2, __decorateServiceException(exception, body)];
|
|
215
219
|
});
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
223
|
-
|
|
220
|
+
}); };
|
|
221
|
+
var deserializeAws_json1_1EC2InstanceTypeInvalidExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
222
|
+
var body, deserialized, exception;
|
|
223
|
+
return __generator(this, function (_a) {
|
|
224
|
+
body = parsedOutput.body;
|
|
225
|
+
deserialized = deserializeAws_json1_1EC2InstanceTypeInvalidException(body, context);
|
|
226
|
+
exception = new EC2InstanceTypeInvalidException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
227
|
+
return [2, __decorateServiceException(exception, body)];
|
|
224
228
|
});
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
$metadata: deserializeMetadata(parsedOutput),
|
|
232
|
-
|
|
229
|
+
}); };
|
|
230
|
+
var deserializeAws_json1_1EC2InstanceUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
231
|
+
var body, deserialized, exception;
|
|
232
|
+
return __generator(this, function (_a) {
|
|
233
|
+
body = parsedOutput.body;
|
|
234
|
+
deserialized = deserializeAws_json1_1EC2InstanceUnavailableException(body, context);
|
|
235
|
+
exception = new EC2InstanceUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
236
|
+
return [2, __decorateServiceException(exception, body)];
|
|
233
237
|
});
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
return {
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
}); };
|
|
239
|
+
var deserializeAws_json1_1InvalidArgsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
240
|
+
var body, deserialized, exception;
|
|
241
|
+
return __generator(this, function (_a) {
|
|
242
|
+
body = parsedOutput.body;
|
|
243
|
+
deserialized = deserializeAws_json1_1InvalidArgsException(body, context);
|
|
244
|
+
exception = new InvalidArgsException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
245
|
+
return [2, __decorateServiceException(exception, body)];
|
|
246
|
+
});
|
|
247
|
+
}); };
|
|
248
|
+
var deserializeAws_json1_1SerialConsoleAccessDisabledExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
249
|
+
var body, deserialized, exception;
|
|
250
|
+
return __generator(this, function (_a) {
|
|
251
|
+
body = parsedOutput.body;
|
|
252
|
+
deserialized = deserializeAws_json1_1SerialConsoleAccessDisabledException(body, context);
|
|
253
|
+
exception = new SerialConsoleAccessDisabledException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
254
|
+
return [2, __decorateServiceException(exception, body)];
|
|
255
|
+
});
|
|
256
|
+
}); };
|
|
257
|
+
var deserializeAws_json1_1SerialConsoleSessionLimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
258
|
+
var body, deserialized, exception;
|
|
259
|
+
return __generator(this, function (_a) {
|
|
260
|
+
body = parsedOutput.body;
|
|
261
|
+
deserialized = deserializeAws_json1_1SerialConsoleSessionLimitExceededException(body, context);
|
|
262
|
+
exception = new SerialConsoleSessionLimitExceededException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
263
|
+
return [2, __decorateServiceException(exception, body)];
|
|
264
|
+
});
|
|
265
|
+
}); };
|
|
266
|
+
var deserializeAws_json1_1SerialConsoleSessionUnavailableExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
267
|
+
var body, deserialized, exception;
|
|
268
|
+
return __generator(this, function (_a) {
|
|
269
|
+
body = parsedOutput.body;
|
|
270
|
+
deserialized = deserializeAws_json1_1SerialConsoleSessionUnavailableException(body, context);
|
|
271
|
+
exception = new SerialConsoleSessionUnavailableException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
272
|
+
return [2, __decorateServiceException(exception, body)];
|
|
273
|
+
});
|
|
274
|
+
}); };
|
|
275
|
+
var deserializeAws_json1_1ServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
276
|
+
var body, deserialized, exception;
|
|
277
|
+
return __generator(this, function (_a) {
|
|
278
|
+
body = parsedOutput.body;
|
|
279
|
+
deserialized = deserializeAws_json1_1ServiceException(body, context);
|
|
280
|
+
exception = new ServiceException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
281
|
+
return [2, __decorateServiceException(exception, body)];
|
|
282
|
+
});
|
|
283
|
+
}); };
|
|
284
|
+
var deserializeAws_json1_1ThrottlingExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
285
|
+
var body, deserialized, exception;
|
|
286
|
+
return __generator(this, function (_a) {
|
|
287
|
+
body = parsedOutput.body;
|
|
288
|
+
deserialized = deserializeAws_json1_1ThrottlingException(body, context);
|
|
289
|
+
exception = new ThrottlingException(__assign({ $metadata: deserializeMetadata(parsedOutput) }, deserialized));
|
|
290
|
+
return [2, __decorateServiceException(exception, body)];
|
|
291
|
+
});
|
|
292
|
+
}); };
|
|
293
|
+
var serializeAws_json1_1SendSerialConsoleSSHPublicKeyRequest = function (input, context) {
|
|
294
|
+
return __assign(__assign(__assign({}, (input.InstanceId != null && { InstanceId: input.InstanceId })), (input.SSHPublicKey != null && { SSHPublicKey: input.SSHPublicKey })), (input.SerialPort != null && { SerialPort: input.SerialPort }));
|
|
242
295
|
};
|
|
243
|
-
|
|
244
|
-
return {
|
|
245
|
-
...(input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone }),
|
|
246
|
-
...(input.InstanceId != null && { InstanceId: input.InstanceId }),
|
|
247
|
-
...(input.InstanceOSUser != null && { InstanceOSUser: input.InstanceOSUser }),
|
|
248
|
-
...(input.SSHPublicKey != null && { SSHPublicKey: input.SSHPublicKey }),
|
|
249
|
-
};
|
|
296
|
+
var serializeAws_json1_1SendSSHPublicKeyRequest = function (input, context) {
|
|
297
|
+
return __assign(__assign(__assign(__assign({}, (input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone })), (input.InstanceId != null && { InstanceId: input.InstanceId })), (input.InstanceOSUser != null && { InstanceOSUser: input.InstanceOSUser })), (input.SSHPublicKey != null && { SSHPublicKey: input.SSHPublicKey }));
|
|
250
298
|
};
|
|
251
|
-
|
|
299
|
+
var deserializeAws_json1_1AuthException = function (output, context) {
|
|
252
300
|
return {
|
|
253
301
|
Message: __expectString(output.Message),
|
|
254
302
|
};
|
|
255
303
|
};
|
|
256
|
-
|
|
304
|
+
var deserializeAws_json1_1EC2InstanceNotFoundException = function (output, context) {
|
|
257
305
|
return {
|
|
258
306
|
Message: __expectString(output.Message),
|
|
259
307
|
};
|
|
260
308
|
};
|
|
261
|
-
|
|
309
|
+
var deserializeAws_json1_1EC2InstanceStateInvalidException = function (output, context) {
|
|
262
310
|
return {
|
|
263
311
|
Message: __expectString(output.Message),
|
|
264
312
|
};
|
|
265
313
|
};
|
|
266
|
-
|
|
314
|
+
var deserializeAws_json1_1EC2InstanceTypeInvalidException = function (output, context) {
|
|
267
315
|
return {
|
|
268
316
|
Message: __expectString(output.Message),
|
|
269
317
|
};
|
|
270
318
|
};
|
|
271
|
-
|
|
319
|
+
var deserializeAws_json1_1EC2InstanceUnavailableException = function (output, context) {
|
|
272
320
|
return {
|
|
273
321
|
Message: __expectString(output.Message),
|
|
274
322
|
};
|
|
275
323
|
};
|
|
276
|
-
|
|
324
|
+
var deserializeAws_json1_1InvalidArgsException = function (output, context) {
|
|
277
325
|
return {
|
|
278
326
|
Message: __expectString(output.Message),
|
|
279
327
|
};
|
|
280
328
|
};
|
|
281
|
-
|
|
329
|
+
var deserializeAws_json1_1SendSerialConsoleSSHPublicKeyResponse = function (output, context) {
|
|
282
330
|
return {
|
|
283
331
|
RequestId: __expectString(output.RequestId),
|
|
284
332
|
Success: __expectBoolean(output.Success),
|
|
285
333
|
};
|
|
286
334
|
};
|
|
287
|
-
|
|
335
|
+
var deserializeAws_json1_1SendSSHPublicKeyResponse = function (output, context) {
|
|
288
336
|
return {
|
|
289
337
|
RequestId: __expectString(output.RequestId),
|
|
290
338
|
Success: __expectBoolean(output.Success),
|
|
291
339
|
};
|
|
292
340
|
};
|
|
293
|
-
|
|
341
|
+
var deserializeAws_json1_1SerialConsoleAccessDisabledException = function (output, context) {
|
|
294
342
|
return {
|
|
295
343
|
Message: __expectString(output.Message),
|
|
296
344
|
};
|
|
297
345
|
};
|
|
298
|
-
|
|
346
|
+
var deserializeAws_json1_1SerialConsoleSessionLimitExceededException = function (output, context) {
|
|
299
347
|
return {
|
|
300
348
|
Message: __expectString(output.Message),
|
|
301
349
|
};
|
|
302
350
|
};
|
|
303
|
-
|
|
351
|
+
var deserializeAws_json1_1SerialConsoleSessionUnavailableException = function (output, context) {
|
|
304
352
|
return {
|
|
305
353
|
Message: __expectString(output.Message),
|
|
306
354
|
};
|
|
307
355
|
};
|
|
308
|
-
|
|
356
|
+
var deserializeAws_json1_1ServiceException = function (output, context) {
|
|
309
357
|
return {
|
|
310
358
|
Message: __expectString(output.Message),
|
|
311
359
|
};
|
|
312
360
|
};
|
|
313
|
-
|
|
361
|
+
var deserializeAws_json1_1ThrottlingException = function (output, context) {
|
|
314
362
|
return {
|
|
315
363
|
Message: __expectString(output.Message),
|
|
316
364
|
};
|
|
317
365
|
};
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
366
|
+
var deserializeMetadata = function (output) {
|
|
367
|
+
var _a, _b;
|
|
368
|
+
return ({
|
|
369
|
+
httpStatusCode: output.statusCode,
|
|
370
|
+
requestId: (_b = (_a = output.headers["x-amzn-requestid"]) !== null && _a !== void 0 ? _a : output.headers["x-amzn-request-id"]) !== null && _b !== void 0 ? _b : output.headers["x-amz-request-id"],
|
|
371
|
+
extendedRequestId: output.headers["x-amz-id-2"],
|
|
372
|
+
cfId: output.headers["x-amz-cf-id"],
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
var collectBody = function (streamBody, context) {
|
|
376
|
+
if (streamBody === void 0) { streamBody = new Uint8Array(); }
|
|
325
377
|
if (streamBody instanceof Uint8Array) {
|
|
326
378
|
return Promise.resolve(streamBody);
|
|
327
379
|
}
|
|
328
380
|
return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
|
|
329
381
|
};
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
382
|
+
var collectBodyString = function (streamBody, context) {
|
|
383
|
+
return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });
|
|
384
|
+
};
|
|
385
|
+
var buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {
|
|
386
|
+
var _a, hostname, _b, protocol, port, basePath, contents;
|
|
387
|
+
return __generator(this, function (_c) {
|
|
388
|
+
switch (_c.label) {
|
|
389
|
+
case 0: return [4, context.endpoint()];
|
|
390
|
+
case 1:
|
|
391
|
+
_a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? "https" : _b, port = _a.port, basePath = _a.path;
|
|
392
|
+
contents = {
|
|
393
|
+
protocol: protocol,
|
|
394
|
+
hostname: hostname,
|
|
395
|
+
port: port,
|
|
396
|
+
method: "POST",
|
|
397
|
+
path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
|
|
398
|
+
headers: headers,
|
|
399
|
+
};
|
|
400
|
+
if (resolvedHostname !== undefined) {
|
|
401
|
+
contents.hostname = resolvedHostname;
|
|
402
|
+
}
|
|
403
|
+
if (body !== undefined) {
|
|
404
|
+
contents.body = body;
|
|
405
|
+
}
|
|
406
|
+
return [2, new __HttpRequest(contents)];
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
}); };
|
|
410
|
+
var parseBody = function (streamBody, context) {
|
|
411
|
+
return collectBodyString(streamBody, context).then(function (encoded) {
|
|
412
|
+
if (encoded.length) {
|
|
413
|
+
return JSON.parse(encoded);
|
|
414
|
+
}
|
|
415
|
+
return {};
|
|
416
|
+
});
|
|
359
417
|
};
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
418
|
+
var parseErrorBody = function (errorBody, context) { return __awaiter(void 0, void 0, void 0, function () {
|
|
419
|
+
var value;
|
|
420
|
+
var _a;
|
|
421
|
+
return __generator(this, function (_b) {
|
|
422
|
+
switch (_b.label) {
|
|
423
|
+
case 0: return [4, parseBody(errorBody, context)];
|
|
424
|
+
case 1:
|
|
425
|
+
value = _b.sent();
|
|
426
|
+
value.message = (_a = value.message) !== null && _a !== void 0 ? _a : value.Message;
|
|
427
|
+
return [2, value];
|
|
428
|
+
}
|
|
429
|
+
});
|
|
430
|
+
}); };
|
|
431
|
+
var loadRestJsonErrorCode = function (output, data) {
|
|
432
|
+
var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };
|
|
433
|
+
var sanitizeErrorCode = function (rawValue) {
|
|
434
|
+
var cleanValue = rawValue;
|
|
364
435
|
if (typeof cleanValue === "number") {
|
|
365
436
|
cleanValue = cleanValue.toString();
|
|
366
437
|
}
|
|
@@ -375,7 +446,7 @@ const loadRestJsonErrorCode = (output, data) => {
|
|
|
375
446
|
}
|
|
376
447
|
return cleanValue;
|
|
377
448
|
};
|
|
378
|
-
|
|
449
|
+
var headerKey = findKey(output.headers, "x-amzn-errortype");
|
|
379
450
|
if (headerKey !== undefined) {
|
|
380
451
|
return sanitizeErrorCode(output.headers[headerKey]);
|
|
381
452
|
}
|