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