@aws-sdk/client-ec2-instance-connect 3.312.0 → 3.316.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.
@@ -1,37 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EC2InstanceConnect = void 0;
4
+ const smithy_client_1 = require("@aws-sdk/smithy-client");
4
5
  const SendSerialConsoleSSHPublicKeyCommand_1 = require("./commands/SendSerialConsoleSSHPublicKeyCommand");
5
6
  const SendSSHPublicKeyCommand_1 = require("./commands/SendSSHPublicKeyCommand");
6
7
  const EC2InstanceConnectClient_1 = require("./EC2InstanceConnectClient");
8
+ const commands = {
9
+ SendSerialConsoleSSHPublicKeyCommand: SendSerialConsoleSSHPublicKeyCommand_1.SendSerialConsoleSSHPublicKeyCommand,
10
+ SendSSHPublicKeyCommand: SendSSHPublicKeyCommand_1.SendSSHPublicKeyCommand,
11
+ };
7
12
  class EC2InstanceConnect extends EC2InstanceConnectClient_1.EC2InstanceConnectClient {
8
- sendSerialConsoleSSHPublicKey(args, optionsOrCb, cb) {
9
- const command = new SendSerialConsoleSSHPublicKeyCommand_1.SendSerialConsoleSSHPublicKeyCommand(args);
10
- if (typeof optionsOrCb === "function") {
11
- this.send(command, optionsOrCb);
12
- }
13
- else if (typeof cb === "function") {
14
- if (typeof optionsOrCb !== "object")
15
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
16
- this.send(command, optionsOrCb || {}, cb);
17
- }
18
- else {
19
- return this.send(command, optionsOrCb);
20
- }
21
- }
22
- sendSSHPublicKey(args, optionsOrCb, cb) {
23
- const command = new SendSSHPublicKeyCommand_1.SendSSHPublicKeyCommand(args);
24
- if (typeof optionsOrCb === "function") {
25
- this.send(command, optionsOrCb);
26
- }
27
- else if (typeof cb === "function") {
28
- if (typeof optionsOrCb !== "object")
29
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
30
- this.send(command, optionsOrCb || {}, cb);
31
- }
32
- else {
33
- return this.send(command, optionsOrCb);
34
- }
35
- }
36
13
  }
37
14
  exports.EC2InstanceConnect = EC2InstanceConnect;
15
+ (0, smithy_client_1.createAggregatedClient)(commands, EC2InstanceConnect);
@@ -8,14 +8,14 @@ const models_0_1 = require("../models/models_0");
8
8
  const se_SendSerialConsoleSSHPublicKeyCommand = async (input, context) => {
9
9
  const headers = sharedHeaders("SendSerialConsoleSSHPublicKey");
10
10
  let body;
11
- body = JSON.stringify(se_SendSerialConsoleSSHPublicKeyRequest(input, context));
11
+ body = JSON.stringify((0, smithy_client_1._json)(input));
12
12
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
13
  };
14
14
  exports.se_SendSerialConsoleSSHPublicKeyCommand = se_SendSerialConsoleSSHPublicKeyCommand;
15
15
  const se_SendSSHPublicKeyCommand = async (input, context) => {
16
16
  const headers = sharedHeaders("SendSSHPublicKey");
17
17
  let body;
18
- body = JSON.stringify(se_SendSSHPublicKeyRequest(input, context));
18
+ body = JSON.stringify((0, smithy_client_1._json)(input));
19
19
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
20
20
  };
21
21
  exports.se_SendSSHPublicKeyCommand = se_SendSSHPublicKeyCommand;
@@ -25,12 +25,12 @@ const de_SendSerialConsoleSSHPublicKeyCommand = async (output, context) => {
25
25
  }
26
26
  const data = await parseBody(output.body, context);
27
27
  let contents = {};
28
- contents = de_SendSerialConsoleSSHPublicKeyResponse(data, context);
28
+ contents = (0, smithy_client_1._json)(data);
29
29
  const response = {
30
30
  $metadata: deserializeMetadata(output),
31
31
  ...contents,
32
32
  };
33
- return Promise.resolve(response);
33
+ return response;
34
34
  };
35
35
  exports.de_SendSerialConsoleSSHPublicKeyCommand = de_SendSerialConsoleSSHPublicKeyCommand;
36
36
  const de_SendSerialConsoleSSHPublicKeyCommandError = async (output, context) => {
@@ -75,10 +75,9 @@ const de_SendSerialConsoleSSHPublicKeyCommandError = async (output, context) =>
75
75
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
76
76
  default:
77
77
  const parsedBody = parsedOutput.body;
78
- (0, smithy_client_1.throwDefaultError)({
78
+ return throwDefaultError({
79
79
  output,
80
80
  parsedBody,
81
- exceptionCtor: EC2InstanceConnectServiceException_1.EC2InstanceConnectServiceException,
82
81
  errorCode,
83
82
  });
84
83
  }
@@ -89,12 +88,12 @@ const de_SendSSHPublicKeyCommand = async (output, context) => {
89
88
  }
90
89
  const data = await parseBody(output.body, context);
91
90
  let contents = {};
92
- contents = de_SendSSHPublicKeyResponse(data, context);
91
+ contents = (0, smithy_client_1._json)(data);
93
92
  const response = {
94
93
  $metadata: deserializeMetadata(output),
95
94
  ...contents,
96
95
  };
97
- return Promise.resolve(response);
96
+ return response;
98
97
  };
99
98
  exports.de_SendSSHPublicKeyCommand = de_SendSSHPublicKeyCommand;
100
99
  const de_SendSSHPublicKeyCommandError = async (output, context) => {
@@ -127,17 +126,16 @@ const de_SendSSHPublicKeyCommandError = async (output, context) => {
127
126
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
128
127
  default:
129
128
  const parsedBody = parsedOutput.body;
130
- (0, smithy_client_1.throwDefaultError)({
129
+ return throwDefaultError({
131
130
  output,
132
131
  parsedBody,
133
- exceptionCtor: EC2InstanceConnectServiceException_1.EC2InstanceConnectServiceException,
134
132
  errorCode,
135
133
  });
136
134
  }
137
135
  };
138
136
  const de_AuthExceptionRes = async (parsedOutput, context) => {
139
137
  const body = parsedOutput.body;
140
- const deserialized = de_AuthException(body, context);
138
+ const deserialized = (0, smithy_client_1._json)(body);
141
139
  const exception = new models_0_1.AuthException({
142
140
  $metadata: deserializeMetadata(parsedOutput),
143
141
  ...deserialized,
@@ -146,7 +144,7 @@ const de_AuthExceptionRes = async (parsedOutput, context) => {
146
144
  };
147
145
  const de_EC2InstanceNotFoundExceptionRes = async (parsedOutput, context) => {
148
146
  const body = parsedOutput.body;
149
- const deserialized = de_EC2InstanceNotFoundException(body, context);
147
+ const deserialized = (0, smithy_client_1._json)(body);
150
148
  const exception = new models_0_1.EC2InstanceNotFoundException({
151
149
  $metadata: deserializeMetadata(parsedOutput),
152
150
  ...deserialized,
@@ -155,7 +153,7 @@ const de_EC2InstanceNotFoundExceptionRes = async (parsedOutput, context) => {
155
153
  };
156
154
  const de_EC2InstanceStateInvalidExceptionRes = async (parsedOutput, context) => {
157
155
  const body = parsedOutput.body;
158
- const deserialized = de_EC2InstanceStateInvalidException(body, context);
156
+ const deserialized = (0, smithy_client_1._json)(body);
159
157
  const exception = new models_0_1.EC2InstanceStateInvalidException({
160
158
  $metadata: deserializeMetadata(parsedOutput),
161
159
  ...deserialized,
@@ -164,7 +162,7 @@ const de_EC2InstanceStateInvalidExceptionRes = async (parsedOutput, context) =>
164
162
  };
165
163
  const de_EC2InstanceTypeInvalidExceptionRes = async (parsedOutput, context) => {
166
164
  const body = parsedOutput.body;
167
- const deserialized = de_EC2InstanceTypeInvalidException(body, context);
165
+ const deserialized = (0, smithy_client_1._json)(body);
168
166
  const exception = new models_0_1.EC2InstanceTypeInvalidException({
169
167
  $metadata: deserializeMetadata(parsedOutput),
170
168
  ...deserialized,
@@ -173,7 +171,7 @@ const de_EC2InstanceTypeInvalidExceptionRes = async (parsedOutput, context) => {
173
171
  };
174
172
  const de_EC2InstanceUnavailableExceptionRes = async (parsedOutput, context) => {
175
173
  const body = parsedOutput.body;
176
- const deserialized = de_EC2InstanceUnavailableException(body, context);
174
+ const deserialized = (0, smithy_client_1._json)(body);
177
175
  const exception = new models_0_1.EC2InstanceUnavailableException({
178
176
  $metadata: deserializeMetadata(parsedOutput),
179
177
  ...deserialized,
@@ -182,7 +180,7 @@ const de_EC2InstanceUnavailableExceptionRes = async (parsedOutput, context) => {
182
180
  };
183
181
  const de_InvalidArgsExceptionRes = async (parsedOutput, context) => {
184
182
  const body = parsedOutput.body;
185
- const deserialized = de_InvalidArgsException(body, context);
183
+ const deserialized = (0, smithy_client_1._json)(body);
186
184
  const exception = new models_0_1.InvalidArgsException({
187
185
  $metadata: deserializeMetadata(parsedOutput),
188
186
  ...deserialized,
@@ -191,7 +189,7 @@ const de_InvalidArgsExceptionRes = async (parsedOutput, context) => {
191
189
  };
192
190
  const de_SerialConsoleAccessDisabledExceptionRes = async (parsedOutput, context) => {
193
191
  const body = parsedOutput.body;
194
- const deserialized = de_SerialConsoleAccessDisabledException(body, context);
192
+ const deserialized = (0, smithy_client_1._json)(body);
195
193
  const exception = new models_0_1.SerialConsoleAccessDisabledException({
196
194
  $metadata: deserializeMetadata(parsedOutput),
197
195
  ...deserialized,
@@ -200,7 +198,7 @@ const de_SerialConsoleAccessDisabledExceptionRes = async (parsedOutput, context)
200
198
  };
201
199
  const de_SerialConsoleSessionLimitExceededExceptionRes = async (parsedOutput, context) => {
202
200
  const body = parsedOutput.body;
203
- const deserialized = de_SerialConsoleSessionLimitExceededException(body, context);
201
+ const deserialized = (0, smithy_client_1._json)(body);
204
202
  const exception = new models_0_1.SerialConsoleSessionLimitExceededException({
205
203
  $metadata: deserializeMetadata(parsedOutput),
206
204
  ...deserialized,
@@ -209,7 +207,7 @@ const de_SerialConsoleSessionLimitExceededExceptionRes = async (parsedOutput, co
209
207
  };
210
208
  const de_SerialConsoleSessionUnavailableExceptionRes = async (parsedOutput, context) => {
211
209
  const body = parsedOutput.body;
212
- const deserialized = de_SerialConsoleSessionUnavailableException(body, context);
210
+ const deserialized = (0, smithy_client_1._json)(body);
213
211
  const exception = new models_0_1.SerialConsoleSessionUnavailableException({
214
212
  $metadata: deserializeMetadata(parsedOutput),
215
213
  ...deserialized,
@@ -218,7 +216,7 @@ const de_SerialConsoleSessionUnavailableExceptionRes = async (parsedOutput, cont
218
216
  };
219
217
  const de_ServiceExceptionRes = async (parsedOutput, context) => {
220
218
  const body = parsedOutput.body;
221
- const deserialized = de_ServiceException(body, context);
219
+ const deserialized = (0, smithy_client_1._json)(body);
222
220
  const exception = new models_0_1.ServiceException({
223
221
  $metadata: deserializeMetadata(parsedOutput),
224
222
  ...deserialized,
@@ -227,95 +225,13 @@ const de_ServiceExceptionRes = async (parsedOutput, context) => {
227
225
  };
228
226
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
229
227
  const body = parsedOutput.body;
230
- const deserialized = de_ThrottlingException(body, context);
228
+ const deserialized = (0, smithy_client_1._json)(body);
231
229
  const exception = new models_0_1.ThrottlingException({
232
230
  $metadata: deserializeMetadata(parsedOutput),
233
231
  ...deserialized,
234
232
  });
235
233
  return (0, smithy_client_1.decorateServiceException)(exception, body);
236
234
  };
237
- const se_SendSerialConsoleSSHPublicKeyRequest = (input, context) => {
238
- return {
239
- ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
240
- ...(input.SSHPublicKey != null && { SSHPublicKey: input.SSHPublicKey }),
241
- ...(input.SerialPort != null && { SerialPort: input.SerialPort }),
242
- };
243
- };
244
- const se_SendSSHPublicKeyRequest = (input, context) => {
245
- return {
246
- ...(input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone }),
247
- ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
248
- ...(input.InstanceOSUser != null && { InstanceOSUser: input.InstanceOSUser }),
249
- ...(input.SSHPublicKey != null && { SSHPublicKey: input.SSHPublicKey }),
250
- };
251
- };
252
- const de_AuthException = (output, context) => {
253
- return {
254
- Message: (0, smithy_client_1.expectString)(output.Message),
255
- };
256
- };
257
- const de_EC2InstanceNotFoundException = (output, context) => {
258
- return {
259
- Message: (0, smithy_client_1.expectString)(output.Message),
260
- };
261
- };
262
- const de_EC2InstanceStateInvalidException = (output, context) => {
263
- return {
264
- Message: (0, smithy_client_1.expectString)(output.Message),
265
- };
266
- };
267
- const de_EC2InstanceTypeInvalidException = (output, context) => {
268
- return {
269
- Message: (0, smithy_client_1.expectString)(output.Message),
270
- };
271
- };
272
- const de_EC2InstanceUnavailableException = (output, context) => {
273
- return {
274
- Message: (0, smithy_client_1.expectString)(output.Message),
275
- };
276
- };
277
- const de_InvalidArgsException = (output, context) => {
278
- return {
279
- Message: (0, smithy_client_1.expectString)(output.Message),
280
- };
281
- };
282
- const de_SendSerialConsoleSSHPublicKeyResponse = (output, context) => {
283
- return {
284
- RequestId: (0, smithy_client_1.expectString)(output.RequestId),
285
- Success: (0, smithy_client_1.expectBoolean)(output.Success),
286
- };
287
- };
288
- const de_SendSSHPublicKeyResponse = (output, context) => {
289
- return {
290
- RequestId: (0, smithy_client_1.expectString)(output.RequestId),
291
- Success: (0, smithy_client_1.expectBoolean)(output.Success),
292
- };
293
- };
294
- const de_SerialConsoleAccessDisabledException = (output, context) => {
295
- return {
296
- Message: (0, smithy_client_1.expectString)(output.Message),
297
- };
298
- };
299
- const de_SerialConsoleSessionLimitExceededException = (output, context) => {
300
- return {
301
- Message: (0, smithy_client_1.expectString)(output.Message),
302
- };
303
- };
304
- const de_SerialConsoleSessionUnavailableException = (output, context) => {
305
- return {
306
- Message: (0, smithy_client_1.expectString)(output.Message),
307
- };
308
- };
309
- const de_ServiceException = (output, context) => {
310
- return {
311
- Message: (0, smithy_client_1.expectString)(output.Message),
312
- };
313
- };
314
- const de_ThrottlingException = (output, context) => {
315
- return {
316
- Message: (0, smithy_client_1.expectString)(output.Message),
317
- };
318
- };
319
235
  const deserializeMetadata = (output) => ({
320
236
  httpStatusCode: output.statusCode,
321
237
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -329,6 +245,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
329
245
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
330
246
  };
331
247
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
248
+ const throwDefaultError = (0, smithy_client_1.withBaseException)(EC2InstanceConnectServiceException_1.EC2InstanceConnectServiceException);
332
249
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
333
250
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
334
251
  const contents = {
@@ -1,33 +1,11 @@
1
+ import { createAggregatedClient } from "@aws-sdk/smithy-client";
1
2
  import { SendSerialConsoleSSHPublicKeyCommand, } from "./commands/SendSerialConsoleSSHPublicKeyCommand";
2
3
  import { SendSSHPublicKeyCommand, } from "./commands/SendSSHPublicKeyCommand";
3
4
  import { EC2InstanceConnectClient } from "./EC2InstanceConnectClient";
5
+ const commands = {
6
+ SendSerialConsoleSSHPublicKeyCommand,
7
+ SendSSHPublicKeyCommand,
8
+ };
4
9
  export class EC2InstanceConnect extends EC2InstanceConnectClient {
5
- sendSerialConsoleSSHPublicKey(args, optionsOrCb, cb) {
6
- const command = new SendSerialConsoleSSHPublicKeyCommand(args);
7
- if (typeof optionsOrCb === "function") {
8
- this.send(command, optionsOrCb);
9
- }
10
- else if (typeof cb === "function") {
11
- if (typeof optionsOrCb !== "object")
12
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
13
- this.send(command, optionsOrCb || {}, cb);
14
- }
15
- else {
16
- return this.send(command, optionsOrCb);
17
- }
18
- }
19
- sendSSHPublicKey(args, optionsOrCb, cb) {
20
- const command = new SendSSHPublicKeyCommand(args);
21
- if (typeof optionsOrCb === "function") {
22
- this.send(command, optionsOrCb);
23
- }
24
- else if (typeof cb === "function") {
25
- if (typeof optionsOrCb !== "object")
26
- throw new Error(`Expect http options but get ${typeof optionsOrCb}`);
27
- this.send(command, optionsOrCb || {}, cb);
28
- }
29
- else {
30
- return this.send(command, optionsOrCb);
31
- }
32
- }
33
10
  }
11
+ createAggregatedClient(commands, EC2InstanceConnect);
@@ -1,17 +1,17 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectBoolean as __expectBoolean, expectString as __expectString, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { EC2InstanceConnectServiceException as __BaseException } from "../models/EC2InstanceConnectServiceException";
4
4
  import { AuthException, EC2InstanceNotFoundException, EC2InstanceStateInvalidException, EC2InstanceTypeInvalidException, EC2InstanceUnavailableException, InvalidArgsException, SerialConsoleAccessDisabledException, SerialConsoleSessionLimitExceededException, SerialConsoleSessionUnavailableException, ServiceException, ThrottlingException, } from "../models/models_0";
5
5
  export const se_SendSerialConsoleSSHPublicKeyCommand = async (input, context) => {
6
6
  const headers = sharedHeaders("SendSerialConsoleSSHPublicKey");
7
7
  let body;
8
- body = JSON.stringify(se_SendSerialConsoleSSHPublicKeyRequest(input, context));
8
+ body = JSON.stringify(_json(input));
9
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
10
10
  };
11
11
  export const se_SendSSHPublicKeyCommand = async (input, context) => {
12
12
  const headers = sharedHeaders("SendSSHPublicKey");
13
13
  let body;
14
- body = JSON.stringify(se_SendSSHPublicKeyRequest(input, context));
14
+ body = JSON.stringify(_json(input));
15
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
16
16
  };
17
17
  export const de_SendSerialConsoleSSHPublicKeyCommand = async (output, context) => {
@@ -20,12 +20,12 @@ export const de_SendSerialConsoleSSHPublicKeyCommand = async (output, context) =
20
20
  }
21
21
  const data = await parseBody(output.body, context);
22
22
  let contents = {};
23
- contents = de_SendSerialConsoleSSHPublicKeyResponse(data, context);
23
+ contents = _json(data);
24
24
  const response = {
25
25
  $metadata: deserializeMetadata(output),
26
26
  ...contents,
27
27
  };
28
- return Promise.resolve(response);
28
+ return response;
29
29
  };
30
30
  const de_SendSerialConsoleSSHPublicKeyCommandError = async (output, context) => {
31
31
  const parsedOutput = {
@@ -69,10 +69,9 @@ const de_SendSerialConsoleSSHPublicKeyCommandError = async (output, context) =>
69
69
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
70
70
  default:
71
71
  const parsedBody = parsedOutput.body;
72
- throwDefaultError({
72
+ return throwDefaultError({
73
73
  output,
74
74
  parsedBody,
75
- exceptionCtor: __BaseException,
76
75
  errorCode,
77
76
  });
78
77
  }
@@ -83,12 +82,12 @@ export const de_SendSSHPublicKeyCommand = async (output, context) => {
83
82
  }
84
83
  const data = await parseBody(output.body, context);
85
84
  let contents = {};
86
- contents = de_SendSSHPublicKeyResponse(data, context);
85
+ contents = _json(data);
87
86
  const response = {
88
87
  $metadata: deserializeMetadata(output),
89
88
  ...contents,
90
89
  };
91
- return Promise.resolve(response);
90
+ return response;
92
91
  };
93
92
  const de_SendSSHPublicKeyCommandError = async (output, context) => {
94
93
  const parsedOutput = {
@@ -120,17 +119,16 @@ const de_SendSSHPublicKeyCommandError = async (output, context) => {
120
119
  throw await de_ThrottlingExceptionRes(parsedOutput, context);
121
120
  default:
122
121
  const parsedBody = parsedOutput.body;
123
- throwDefaultError({
122
+ return throwDefaultError({
124
123
  output,
125
124
  parsedBody,
126
- exceptionCtor: __BaseException,
127
125
  errorCode,
128
126
  });
129
127
  }
130
128
  };
131
129
  const de_AuthExceptionRes = async (parsedOutput, context) => {
132
130
  const body = parsedOutput.body;
133
- const deserialized = de_AuthException(body, context);
131
+ const deserialized = _json(body);
134
132
  const exception = new AuthException({
135
133
  $metadata: deserializeMetadata(parsedOutput),
136
134
  ...deserialized,
@@ -139,7 +137,7 @@ const de_AuthExceptionRes = async (parsedOutput, context) => {
139
137
  };
140
138
  const de_EC2InstanceNotFoundExceptionRes = async (parsedOutput, context) => {
141
139
  const body = parsedOutput.body;
142
- const deserialized = de_EC2InstanceNotFoundException(body, context);
140
+ const deserialized = _json(body);
143
141
  const exception = new EC2InstanceNotFoundException({
144
142
  $metadata: deserializeMetadata(parsedOutput),
145
143
  ...deserialized,
@@ -148,7 +146,7 @@ const de_EC2InstanceNotFoundExceptionRes = async (parsedOutput, context) => {
148
146
  };
149
147
  const de_EC2InstanceStateInvalidExceptionRes = async (parsedOutput, context) => {
150
148
  const body = parsedOutput.body;
151
- const deserialized = de_EC2InstanceStateInvalidException(body, context);
149
+ const deserialized = _json(body);
152
150
  const exception = new EC2InstanceStateInvalidException({
153
151
  $metadata: deserializeMetadata(parsedOutput),
154
152
  ...deserialized,
@@ -157,7 +155,7 @@ const de_EC2InstanceStateInvalidExceptionRes = async (parsedOutput, context) =>
157
155
  };
158
156
  const de_EC2InstanceTypeInvalidExceptionRes = async (parsedOutput, context) => {
159
157
  const body = parsedOutput.body;
160
- const deserialized = de_EC2InstanceTypeInvalidException(body, context);
158
+ const deserialized = _json(body);
161
159
  const exception = new EC2InstanceTypeInvalidException({
162
160
  $metadata: deserializeMetadata(parsedOutput),
163
161
  ...deserialized,
@@ -166,7 +164,7 @@ const de_EC2InstanceTypeInvalidExceptionRes = async (parsedOutput, context) => {
166
164
  };
167
165
  const de_EC2InstanceUnavailableExceptionRes = async (parsedOutput, context) => {
168
166
  const body = parsedOutput.body;
169
- const deserialized = de_EC2InstanceUnavailableException(body, context);
167
+ const deserialized = _json(body);
170
168
  const exception = new EC2InstanceUnavailableException({
171
169
  $metadata: deserializeMetadata(parsedOutput),
172
170
  ...deserialized,
@@ -175,7 +173,7 @@ const de_EC2InstanceUnavailableExceptionRes = async (parsedOutput, context) => {
175
173
  };
176
174
  const de_InvalidArgsExceptionRes = async (parsedOutput, context) => {
177
175
  const body = parsedOutput.body;
178
- const deserialized = de_InvalidArgsException(body, context);
176
+ const deserialized = _json(body);
179
177
  const exception = new InvalidArgsException({
180
178
  $metadata: deserializeMetadata(parsedOutput),
181
179
  ...deserialized,
@@ -184,7 +182,7 @@ const de_InvalidArgsExceptionRes = async (parsedOutput, context) => {
184
182
  };
185
183
  const de_SerialConsoleAccessDisabledExceptionRes = async (parsedOutput, context) => {
186
184
  const body = parsedOutput.body;
187
- const deserialized = de_SerialConsoleAccessDisabledException(body, context);
185
+ const deserialized = _json(body);
188
186
  const exception = new SerialConsoleAccessDisabledException({
189
187
  $metadata: deserializeMetadata(parsedOutput),
190
188
  ...deserialized,
@@ -193,7 +191,7 @@ const de_SerialConsoleAccessDisabledExceptionRes = async (parsedOutput, context)
193
191
  };
194
192
  const de_SerialConsoleSessionLimitExceededExceptionRes = async (parsedOutput, context) => {
195
193
  const body = parsedOutput.body;
196
- const deserialized = de_SerialConsoleSessionLimitExceededException(body, context);
194
+ const deserialized = _json(body);
197
195
  const exception = new SerialConsoleSessionLimitExceededException({
198
196
  $metadata: deserializeMetadata(parsedOutput),
199
197
  ...deserialized,
@@ -202,7 +200,7 @@ const de_SerialConsoleSessionLimitExceededExceptionRes = async (parsedOutput, co
202
200
  };
203
201
  const de_SerialConsoleSessionUnavailableExceptionRes = async (parsedOutput, context) => {
204
202
  const body = parsedOutput.body;
205
- const deserialized = de_SerialConsoleSessionUnavailableException(body, context);
203
+ const deserialized = _json(body);
206
204
  const exception = new SerialConsoleSessionUnavailableException({
207
205
  $metadata: deserializeMetadata(parsedOutput),
208
206
  ...deserialized,
@@ -211,7 +209,7 @@ const de_SerialConsoleSessionUnavailableExceptionRes = async (parsedOutput, cont
211
209
  };
212
210
  const de_ServiceExceptionRes = async (parsedOutput, context) => {
213
211
  const body = parsedOutput.body;
214
- const deserialized = de_ServiceException(body, context);
212
+ const deserialized = _json(body);
215
213
  const exception = new ServiceException({
216
214
  $metadata: deserializeMetadata(parsedOutput),
217
215
  ...deserialized,
@@ -220,95 +218,13 @@ const de_ServiceExceptionRes = async (parsedOutput, context) => {
220
218
  };
221
219
  const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
222
220
  const body = parsedOutput.body;
223
- const deserialized = de_ThrottlingException(body, context);
221
+ const deserialized = _json(body);
224
222
  const exception = new ThrottlingException({
225
223
  $metadata: deserializeMetadata(parsedOutput),
226
224
  ...deserialized,
227
225
  });
228
226
  return __decorateServiceException(exception, body);
229
227
  };
230
- const se_SendSerialConsoleSSHPublicKeyRequest = (input, context) => {
231
- return {
232
- ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
233
- ...(input.SSHPublicKey != null && { SSHPublicKey: input.SSHPublicKey }),
234
- ...(input.SerialPort != null && { SerialPort: input.SerialPort }),
235
- };
236
- };
237
- const se_SendSSHPublicKeyRequest = (input, context) => {
238
- return {
239
- ...(input.AvailabilityZone != null && { AvailabilityZone: input.AvailabilityZone }),
240
- ...(input.InstanceId != null && { InstanceId: input.InstanceId }),
241
- ...(input.InstanceOSUser != null && { InstanceOSUser: input.InstanceOSUser }),
242
- ...(input.SSHPublicKey != null && { SSHPublicKey: input.SSHPublicKey }),
243
- };
244
- };
245
- const de_AuthException = (output, context) => {
246
- return {
247
- Message: __expectString(output.Message),
248
- };
249
- };
250
- const de_EC2InstanceNotFoundException = (output, context) => {
251
- return {
252
- Message: __expectString(output.Message),
253
- };
254
- };
255
- const de_EC2InstanceStateInvalidException = (output, context) => {
256
- return {
257
- Message: __expectString(output.Message),
258
- };
259
- };
260
- const de_EC2InstanceTypeInvalidException = (output, context) => {
261
- return {
262
- Message: __expectString(output.Message),
263
- };
264
- };
265
- const de_EC2InstanceUnavailableException = (output, context) => {
266
- return {
267
- Message: __expectString(output.Message),
268
- };
269
- };
270
- const de_InvalidArgsException = (output, context) => {
271
- return {
272
- Message: __expectString(output.Message),
273
- };
274
- };
275
- const de_SendSerialConsoleSSHPublicKeyResponse = (output, context) => {
276
- return {
277
- RequestId: __expectString(output.RequestId),
278
- Success: __expectBoolean(output.Success),
279
- };
280
- };
281
- const de_SendSSHPublicKeyResponse = (output, context) => {
282
- return {
283
- RequestId: __expectString(output.RequestId),
284
- Success: __expectBoolean(output.Success),
285
- };
286
- };
287
- const de_SerialConsoleAccessDisabledException = (output, context) => {
288
- return {
289
- Message: __expectString(output.Message),
290
- };
291
- };
292
- const de_SerialConsoleSessionLimitExceededException = (output, context) => {
293
- return {
294
- Message: __expectString(output.Message),
295
- };
296
- };
297
- const de_SerialConsoleSessionUnavailableException = (output, context) => {
298
- return {
299
- Message: __expectString(output.Message),
300
- };
301
- };
302
- const de_ServiceException = (output, context) => {
303
- return {
304
- Message: __expectString(output.Message),
305
- };
306
- };
307
- const de_ThrottlingException = (output, context) => {
308
- return {
309
- Message: __expectString(output.Message),
310
- };
311
- };
312
228
  const deserializeMetadata = (output) => ({
313
229
  httpStatusCode: output.statusCode,
314
230
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -322,6 +238,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
322
238
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
323
239
  };
324
240
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
241
+ const throwDefaultError = withBaseException(__BaseException);
325
242
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
326
243
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
327
244
  const contents = {
@@ -2,31 +2,25 @@ import { HttpHandlerOptions as __HttpHandlerOptions } from "@aws-sdk/types";
2
2
  import { SendSerialConsoleSSHPublicKeyCommandInput, SendSerialConsoleSSHPublicKeyCommandOutput } from "./commands/SendSerialConsoleSSHPublicKeyCommand";
3
3
  import { SendSSHPublicKeyCommandInput, SendSSHPublicKeyCommandOutput } from "./commands/SendSSHPublicKeyCommand";
4
4
  import { EC2InstanceConnectClient } from "./EC2InstanceConnectClient";
5
- /**
6
- * @public
7
- * <p>Amazon EC2 Instance Connect enables system administrators to publish one-time use SSH
8
- * public keys to EC2, providing users a simple and secure way to connect to their
9
- * instances.</p>
10
- */
11
- export declare class EC2InstanceConnect extends EC2InstanceConnectClient {
5
+ export interface EC2InstanceConnect {
12
6
  /**
13
- * @public
14
- * <p>Pushes an SSH public key to the specified EC2 instance. The key remains for 60
15
- * seconds, which gives you 60 seconds to establish a serial console connection to the
16
- * instance using SSH. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-serial-console.html">EC2 Serial Console</a> in
17
- * the <i>Amazon EC2 User Guide</i>.</p>
7
+ * @see {@link SendSerialConsoleSSHPublicKeyCommand}
18
8
  */
19
9
  sendSerialConsoleSSHPublicKey(args: SendSerialConsoleSSHPublicKeyCommandInput, options?: __HttpHandlerOptions): Promise<SendSerialConsoleSSHPublicKeyCommandOutput>;
20
10
  sendSerialConsoleSSHPublicKey(args: SendSerialConsoleSSHPublicKeyCommandInput, cb: (err: any, data?: SendSerialConsoleSSHPublicKeyCommandOutput) => void): void;
21
11
  sendSerialConsoleSSHPublicKey(args: SendSerialConsoleSSHPublicKeyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SendSerialConsoleSSHPublicKeyCommandOutput) => void): void;
22
12
  /**
23
- * @public
24
- * <p>Pushes an SSH public key to the specified EC2 instance for use by the specified user.
25
- * The key remains for 60 seconds. For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Connect-using-EC2-Instance-Connect.html">Connect to
26
- * your Linux instance using EC2 Instance Connect</a> in the <i>Amazon EC2
27
- * User Guide</i>.</p>
13
+ * @see {@link SendSSHPublicKeyCommand}
28
14
  */
29
15
  sendSSHPublicKey(args: SendSSHPublicKeyCommandInput, options?: __HttpHandlerOptions): Promise<SendSSHPublicKeyCommandOutput>;
30
16
  sendSSHPublicKey(args: SendSSHPublicKeyCommandInput, cb: (err: any, data?: SendSSHPublicKeyCommandOutput) => void): void;
31
17
  sendSSHPublicKey(args: SendSSHPublicKeyCommandInput, options: __HttpHandlerOptions, cb: (err: any, data?: SendSSHPublicKeyCommandOutput) => void): void;
32
18
  }
19
+ /**
20
+ * @public
21
+ * <p>Amazon EC2 Instance Connect enables system administrators to publish one-time use SSH
22
+ * public keys to EC2, providing users a simple and secure way to connect to their
23
+ * instances.</p>
24
+ */
25
+ export declare class EC2InstanceConnect extends EC2InstanceConnectClient implements EC2InstanceConnect {
26
+ }
@@ -8,7 +8,7 @@ import {
8
8
  SendSSHPublicKeyCommandOutput,
9
9
  } from "./commands/SendSSHPublicKeyCommand";
10
10
  import { EC2InstanceConnectClient } from "./EC2InstanceConnectClient";
11
- export declare class EC2InstanceConnect extends EC2InstanceConnectClient {
11
+ export interface EC2InstanceConnect {
12
12
  sendSerialConsoleSSHPublicKey(
13
13
  args: SendSerialConsoleSSHPublicKeyCommandInput,
14
14
  options?: __HttpHandlerOptions
@@ -36,3 +36,6 @@ export declare class EC2InstanceConnect extends EC2InstanceConnectClient {
36
36
  cb: (err: any, data?: SendSSHPublicKeyCommandOutput) => void
37
37
  ): void;
38
38
  }
39
+ export declare class EC2InstanceConnect
40
+ extends EC2InstanceConnectClient
41
+ implements EC2InstanceConnect {}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@aws-sdk/client-ec2-instance-connect",
3
3
  "description": "AWS SDK for JavaScript Ec2 Instance Connect Client for Node.js, Browser and React Native",
4
- "version": "3.312.0",
4
+ "version": "3.316.0",
5
5
  "scripts": {
6
6
  "build": "concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'",
7
7
  "build:cjs": "tsc -p tsconfig.cjs.json",
@@ -21,9 +21,9 @@
21
21
  "dependencies": {
22
22
  "@aws-crypto/sha256-browser": "3.0.0",
23
23
  "@aws-crypto/sha256-js": "3.0.0",
24
- "@aws-sdk/client-sts": "3.312.0",
24
+ "@aws-sdk/client-sts": "3.316.0",
25
25
  "@aws-sdk/config-resolver": "3.310.0",
26
- "@aws-sdk/credential-provider-node": "3.310.0",
26
+ "@aws-sdk/credential-provider-node": "3.316.0",
27
27
  "@aws-sdk/fetch-http-handler": "3.310.0",
28
28
  "@aws-sdk/hash-node": "3.310.0",
29
29
  "@aws-sdk/invalid-dependency": "3.310.0",
@@ -40,14 +40,14 @@
40
40
  "@aws-sdk/node-config-provider": "3.310.0",
41
41
  "@aws-sdk/node-http-handler": "3.310.0",
42
42
  "@aws-sdk/protocol-http": "3.310.0",
43
- "@aws-sdk/smithy-client": "3.310.0",
43
+ "@aws-sdk/smithy-client": "3.316.0",
44
44
  "@aws-sdk/types": "3.310.0",
45
45
  "@aws-sdk/url-parser": "3.310.0",
46
46
  "@aws-sdk/util-base64": "3.310.0",
47
47
  "@aws-sdk/util-body-length-browser": "3.310.0",
48
48
  "@aws-sdk/util-body-length-node": "3.310.0",
49
- "@aws-sdk/util-defaults-mode-browser": "3.310.0",
50
- "@aws-sdk/util-defaults-mode-node": "3.310.0",
49
+ "@aws-sdk/util-defaults-mode-browser": "3.316.0",
50
+ "@aws-sdk/util-defaults-mode-node": "3.316.0",
51
51
  "@aws-sdk/util-endpoints": "3.310.0",
52
52
  "@aws-sdk/util-retry": "3.310.0",
53
53
  "@aws-sdk/util-user-agent-browser": "3.310.0",