@aws-sdk/client-ec2-instance-connect 3.489.0 → 3.495.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/dist-cjs/index.js CHANGED
@@ -1,11 +1,716 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EC2InstanceConnectServiceException = void 0;
4
- const tslib_1 = require("tslib");
5
- tslib_1.__exportStar(require("./EC2InstanceConnectClient"), exports);
6
- tslib_1.__exportStar(require("./EC2InstanceConnect"), exports);
7
- tslib_1.__exportStar(require("./commands"), exports);
8
- tslib_1.__exportStar(require("./models"), exports);
9
- require("@aws-sdk/util-endpoints");
10
- var EC2InstanceConnectServiceException_1 = require("./models/EC2InstanceConnectServiceException");
11
- Object.defineProperty(exports, "EC2InstanceConnectServiceException", { enumerable: true, get: function () { return EC2InstanceConnectServiceException_1.EC2InstanceConnectServiceException; } });
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // src/index.ts
22
+ var src_exports = {};
23
+ __export(src_exports, {
24
+ AuthException: () => AuthException,
25
+ EC2InstanceConnect: () => EC2InstanceConnect,
26
+ EC2InstanceConnectClient: () => EC2InstanceConnectClient,
27
+ EC2InstanceConnectServiceException: () => EC2InstanceConnectServiceException,
28
+ EC2InstanceNotFoundException: () => EC2InstanceNotFoundException,
29
+ EC2InstanceStateInvalidException: () => EC2InstanceStateInvalidException,
30
+ EC2InstanceTypeInvalidException: () => EC2InstanceTypeInvalidException,
31
+ EC2InstanceUnavailableException: () => EC2InstanceUnavailableException,
32
+ InvalidArgsException: () => InvalidArgsException,
33
+ SendSSHPublicKeyCommand: () => SendSSHPublicKeyCommand,
34
+ SendSerialConsoleSSHPublicKeyCommand: () => SendSerialConsoleSSHPublicKeyCommand,
35
+ SerialConsoleAccessDisabledException: () => SerialConsoleAccessDisabledException,
36
+ SerialConsoleSessionLimitExceededException: () => SerialConsoleSessionLimitExceededException,
37
+ SerialConsoleSessionUnavailableException: () => SerialConsoleSessionUnavailableException,
38
+ ServiceException: () => ServiceException,
39
+ ThrottlingException: () => ThrottlingException,
40
+ __Client: () => import_smithy_client.Client
41
+ });
42
+ module.exports = __toCommonJS(src_exports);
43
+
44
+ // src/EC2InstanceConnectClient.ts
45
+ var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
46
+ var import_middleware_logger = require("@aws-sdk/middleware-logger");
47
+ var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
48
+ var import_middleware_signing = require("@aws-sdk/middleware-signing");
49
+ var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
50
+ var import_config_resolver = require("@smithy/config-resolver");
51
+ var import_middleware_content_length = require("@smithy/middleware-content-length");
52
+ var import_middleware_endpoint = require("@smithy/middleware-endpoint");
53
+ var import_middleware_retry = require("@smithy/middleware-retry");
54
+
55
+
56
+ // src/endpoint/EndpointParameters.ts
57
+ var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
58
+ return {
59
+ ...options,
60
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
61
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
62
+ defaultSigningName: "ec2-instance-connect"
63
+ };
64
+ }, "resolveClientEndpointParameters");
65
+ var commonParams = {
66
+ UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
67
+ Endpoint: { type: "builtInParams", name: "endpoint" },
68
+ Region: { type: "builtInParams", name: "region" },
69
+ UseDualStack: { type: "builtInParams", name: "useDualstackEndpoint" }
70
+ };
71
+
72
+ // src/EC2InstanceConnectClient.ts
73
+ var import_runtimeConfig = require("././runtimeConfig");
74
+
75
+ // src/runtimeExtensions.ts
76
+ var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
77
+ var import_protocol_http = require("@smithy/protocol-http");
78
+ var import_smithy_client = require("@smithy/smithy-client");
79
+ var asPartial = /* @__PURE__ */ __name((t) => t, "asPartial");
80
+ var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
81
+ const extensionConfiguration = {
82
+ ...asPartial((0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig)),
83
+ ...asPartial((0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig)),
84
+ ...asPartial((0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig))
85
+ };
86
+ extensions.forEach((extension) => extension.configure(extensionConfiguration));
87
+ return {
88
+ ...runtimeConfig,
89
+ ...(0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
90
+ ...(0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
91
+ ...(0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration)
92
+ };
93
+ }, "resolveRuntimeExtensions");
94
+
95
+ // src/EC2InstanceConnectClient.ts
96
+ var _EC2InstanceConnectClient = class _EC2InstanceConnectClient extends import_smithy_client.Client {
97
+ constructor(...[configuration]) {
98
+ const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
99
+ const _config_1 = resolveClientEndpointParameters(_config_0);
100
+ const _config_2 = (0, import_config_resolver.resolveRegionConfig)(_config_1);
101
+ const _config_3 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_2);
102
+ const _config_4 = (0, import_middleware_retry.resolveRetryConfig)(_config_3);
103
+ const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
104
+ const _config_6 = (0, import_middleware_signing.resolveAwsAuthConfig)(_config_5);
105
+ const _config_7 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_6);
106
+ const _config_8 = resolveRuntimeExtensions(_config_7, (configuration == null ? void 0 : configuration.extensions) || []);
107
+ super(_config_8);
108
+ this.config = _config_8;
109
+ this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
110
+ this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
111
+ this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
112
+ this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
113
+ this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
114
+ this.middlewareStack.use((0, import_middleware_signing.getAwsAuthPlugin)(this.config));
115
+ this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
116
+ }
117
+ /**
118
+ * Destroy underlying resources, like sockets. It's usually not necessary to do this.
119
+ * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
120
+ * Otherwise, sockets might stay open for quite a long time before the server terminates them.
121
+ */
122
+ destroy() {
123
+ super.destroy();
124
+ }
125
+ };
126
+ __name(_EC2InstanceConnectClient, "EC2InstanceConnectClient");
127
+ var EC2InstanceConnectClient = _EC2InstanceConnectClient;
128
+
129
+ // src/EC2InstanceConnect.ts
130
+
131
+
132
+ // src/commands/SendSerialConsoleSSHPublicKeyCommand.ts
133
+
134
+ var import_middleware_serde = require("@smithy/middleware-serde");
135
+
136
+ var import_types = require("@smithy/types");
137
+
138
+ // src/protocols/Aws_json1_1.ts
139
+
140
+
141
+
142
+ // src/models/EC2InstanceConnectServiceException.ts
143
+
144
+ var _EC2InstanceConnectServiceException = class _EC2InstanceConnectServiceException extends import_smithy_client.ServiceException {
145
+ /**
146
+ * @internal
147
+ */
148
+ constructor(options) {
149
+ super(options);
150
+ Object.setPrototypeOf(this, _EC2InstanceConnectServiceException.prototype);
151
+ }
152
+ };
153
+ __name(_EC2InstanceConnectServiceException, "EC2InstanceConnectServiceException");
154
+ var EC2InstanceConnectServiceException = _EC2InstanceConnectServiceException;
155
+
156
+ // src/models/models_0.ts
157
+ var _AuthException = class _AuthException extends EC2InstanceConnectServiceException {
158
+ /**
159
+ * @internal
160
+ */
161
+ constructor(opts) {
162
+ super({
163
+ name: "AuthException",
164
+ $fault: "client",
165
+ ...opts
166
+ });
167
+ this.name = "AuthException";
168
+ this.$fault = "client";
169
+ Object.setPrototypeOf(this, _AuthException.prototype);
170
+ this.Message = opts.Message;
171
+ }
172
+ };
173
+ __name(_AuthException, "AuthException");
174
+ var AuthException = _AuthException;
175
+ var _EC2InstanceNotFoundException = class _EC2InstanceNotFoundException extends EC2InstanceConnectServiceException {
176
+ /**
177
+ * @internal
178
+ */
179
+ constructor(opts) {
180
+ super({
181
+ name: "EC2InstanceNotFoundException",
182
+ $fault: "client",
183
+ ...opts
184
+ });
185
+ this.name = "EC2InstanceNotFoundException";
186
+ this.$fault = "client";
187
+ Object.setPrototypeOf(this, _EC2InstanceNotFoundException.prototype);
188
+ this.Message = opts.Message;
189
+ }
190
+ };
191
+ __name(_EC2InstanceNotFoundException, "EC2InstanceNotFoundException");
192
+ var EC2InstanceNotFoundException = _EC2InstanceNotFoundException;
193
+ var _EC2InstanceStateInvalidException = class _EC2InstanceStateInvalidException extends EC2InstanceConnectServiceException {
194
+ /**
195
+ * @internal
196
+ */
197
+ constructor(opts) {
198
+ super({
199
+ name: "EC2InstanceStateInvalidException",
200
+ $fault: "client",
201
+ ...opts
202
+ });
203
+ this.name = "EC2InstanceStateInvalidException";
204
+ this.$fault = "client";
205
+ Object.setPrototypeOf(this, _EC2InstanceStateInvalidException.prototype);
206
+ this.Message = opts.Message;
207
+ }
208
+ };
209
+ __name(_EC2InstanceStateInvalidException, "EC2InstanceStateInvalidException");
210
+ var EC2InstanceStateInvalidException = _EC2InstanceStateInvalidException;
211
+ var _EC2InstanceTypeInvalidException = class _EC2InstanceTypeInvalidException extends EC2InstanceConnectServiceException {
212
+ /**
213
+ * @internal
214
+ */
215
+ constructor(opts) {
216
+ super({
217
+ name: "EC2InstanceTypeInvalidException",
218
+ $fault: "client",
219
+ ...opts
220
+ });
221
+ this.name = "EC2InstanceTypeInvalidException";
222
+ this.$fault = "client";
223
+ Object.setPrototypeOf(this, _EC2InstanceTypeInvalidException.prototype);
224
+ this.Message = opts.Message;
225
+ }
226
+ };
227
+ __name(_EC2InstanceTypeInvalidException, "EC2InstanceTypeInvalidException");
228
+ var EC2InstanceTypeInvalidException = _EC2InstanceTypeInvalidException;
229
+ var _EC2InstanceUnavailableException = class _EC2InstanceUnavailableException extends EC2InstanceConnectServiceException {
230
+ /**
231
+ * @internal
232
+ */
233
+ constructor(opts) {
234
+ super({
235
+ name: "EC2InstanceUnavailableException",
236
+ $fault: "server",
237
+ ...opts
238
+ });
239
+ this.name = "EC2InstanceUnavailableException";
240
+ this.$fault = "server";
241
+ Object.setPrototypeOf(this, _EC2InstanceUnavailableException.prototype);
242
+ this.Message = opts.Message;
243
+ }
244
+ };
245
+ __name(_EC2InstanceUnavailableException, "EC2InstanceUnavailableException");
246
+ var EC2InstanceUnavailableException = _EC2InstanceUnavailableException;
247
+ var _InvalidArgsException = class _InvalidArgsException extends EC2InstanceConnectServiceException {
248
+ /**
249
+ * @internal
250
+ */
251
+ constructor(opts) {
252
+ super({
253
+ name: "InvalidArgsException",
254
+ $fault: "client",
255
+ ...opts
256
+ });
257
+ this.name = "InvalidArgsException";
258
+ this.$fault = "client";
259
+ Object.setPrototypeOf(this, _InvalidArgsException.prototype);
260
+ this.Message = opts.Message;
261
+ }
262
+ };
263
+ __name(_InvalidArgsException, "InvalidArgsException");
264
+ var InvalidArgsException = _InvalidArgsException;
265
+ var _SerialConsoleAccessDisabledException = class _SerialConsoleAccessDisabledException extends EC2InstanceConnectServiceException {
266
+ /**
267
+ * @internal
268
+ */
269
+ constructor(opts) {
270
+ super({
271
+ name: "SerialConsoleAccessDisabledException",
272
+ $fault: "client",
273
+ ...opts
274
+ });
275
+ this.name = "SerialConsoleAccessDisabledException";
276
+ this.$fault = "client";
277
+ Object.setPrototypeOf(this, _SerialConsoleAccessDisabledException.prototype);
278
+ this.Message = opts.Message;
279
+ }
280
+ };
281
+ __name(_SerialConsoleAccessDisabledException, "SerialConsoleAccessDisabledException");
282
+ var SerialConsoleAccessDisabledException = _SerialConsoleAccessDisabledException;
283
+ var _SerialConsoleSessionLimitExceededException = class _SerialConsoleSessionLimitExceededException extends EC2InstanceConnectServiceException {
284
+ /**
285
+ * @internal
286
+ */
287
+ constructor(opts) {
288
+ super({
289
+ name: "SerialConsoleSessionLimitExceededException",
290
+ $fault: "client",
291
+ ...opts
292
+ });
293
+ this.name = "SerialConsoleSessionLimitExceededException";
294
+ this.$fault = "client";
295
+ Object.setPrototypeOf(this, _SerialConsoleSessionLimitExceededException.prototype);
296
+ this.Message = opts.Message;
297
+ }
298
+ };
299
+ __name(_SerialConsoleSessionLimitExceededException, "SerialConsoleSessionLimitExceededException");
300
+ var SerialConsoleSessionLimitExceededException = _SerialConsoleSessionLimitExceededException;
301
+ var _SerialConsoleSessionUnavailableException = class _SerialConsoleSessionUnavailableException extends EC2InstanceConnectServiceException {
302
+ /**
303
+ * @internal
304
+ */
305
+ constructor(opts) {
306
+ super({
307
+ name: "SerialConsoleSessionUnavailableException",
308
+ $fault: "server",
309
+ ...opts
310
+ });
311
+ this.name = "SerialConsoleSessionUnavailableException";
312
+ this.$fault = "server";
313
+ Object.setPrototypeOf(this, _SerialConsoleSessionUnavailableException.prototype);
314
+ this.Message = opts.Message;
315
+ }
316
+ };
317
+ __name(_SerialConsoleSessionUnavailableException, "SerialConsoleSessionUnavailableException");
318
+ var SerialConsoleSessionUnavailableException = _SerialConsoleSessionUnavailableException;
319
+ var _ServiceException = class _ServiceException extends EC2InstanceConnectServiceException {
320
+ /**
321
+ * @internal
322
+ */
323
+ constructor(opts) {
324
+ super({
325
+ name: "ServiceException",
326
+ $fault: "server",
327
+ ...opts
328
+ });
329
+ this.name = "ServiceException";
330
+ this.$fault = "server";
331
+ Object.setPrototypeOf(this, _ServiceException.prototype);
332
+ this.Message = opts.Message;
333
+ }
334
+ };
335
+ __name(_ServiceException, "ServiceException");
336
+ var ServiceException = _ServiceException;
337
+ var _ThrottlingException = class _ThrottlingException extends EC2InstanceConnectServiceException {
338
+ /**
339
+ * @internal
340
+ */
341
+ constructor(opts) {
342
+ super({
343
+ name: "ThrottlingException",
344
+ $fault: "client",
345
+ ...opts
346
+ });
347
+ this.name = "ThrottlingException";
348
+ this.$fault = "client";
349
+ Object.setPrototypeOf(this, _ThrottlingException.prototype);
350
+ this.Message = opts.Message;
351
+ }
352
+ };
353
+ __name(_ThrottlingException, "ThrottlingException");
354
+ var ThrottlingException = _ThrottlingException;
355
+
356
+ // src/protocols/Aws_json1_1.ts
357
+ var se_SendSerialConsoleSSHPublicKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
358
+ const headers = sharedHeaders("SendSerialConsoleSSHPublicKey");
359
+ let body;
360
+ body = JSON.stringify((0, import_smithy_client._json)(input));
361
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
362
+ }, "se_SendSerialConsoleSSHPublicKeyCommand");
363
+ var se_SendSSHPublicKeyCommand = /* @__PURE__ */ __name(async (input, context) => {
364
+ const headers = sharedHeaders("SendSSHPublicKey");
365
+ let body;
366
+ body = JSON.stringify((0, import_smithy_client._json)(input));
367
+ return buildHttpRpcRequest(context, headers, "/", void 0, body);
368
+ }, "se_SendSSHPublicKeyCommand");
369
+ var de_SendSerialConsoleSSHPublicKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
370
+ if (output.statusCode >= 300) {
371
+ return de_SendSerialConsoleSSHPublicKeyCommandError(output, context);
372
+ }
373
+ const data = await parseBody(output.body, context);
374
+ let contents = {};
375
+ contents = (0, import_smithy_client._json)(data);
376
+ const response = {
377
+ $metadata: deserializeMetadata(output),
378
+ ...contents
379
+ };
380
+ return response;
381
+ }, "de_SendSerialConsoleSSHPublicKeyCommand");
382
+ var de_SendSerialConsoleSSHPublicKeyCommandError = /* @__PURE__ */ __name(async (output, context) => {
383
+ const parsedOutput = {
384
+ ...output,
385
+ body: await parseErrorBody(output.body, context)
386
+ };
387
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
388
+ switch (errorCode) {
389
+ case "AuthException":
390
+ case "com.amazonaws.ec2instanceconnect#AuthException":
391
+ throw await de_AuthExceptionRes(parsedOutput, context);
392
+ case "EC2InstanceNotFoundException":
393
+ case "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException":
394
+ throw await de_EC2InstanceNotFoundExceptionRes(parsedOutput, context);
395
+ case "EC2InstanceStateInvalidException":
396
+ case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException":
397
+ throw await de_EC2InstanceStateInvalidExceptionRes(parsedOutput, context);
398
+ case "EC2InstanceTypeInvalidException":
399
+ case "com.amazonaws.ec2instanceconnect#EC2InstanceTypeInvalidException":
400
+ throw await de_EC2InstanceTypeInvalidExceptionRes(parsedOutput, context);
401
+ case "EC2InstanceUnavailableException":
402
+ case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException":
403
+ throw await de_EC2InstanceUnavailableExceptionRes(parsedOutput, context);
404
+ case "InvalidArgsException":
405
+ case "com.amazonaws.ec2instanceconnect#InvalidArgsException":
406
+ throw await de_InvalidArgsExceptionRes(parsedOutput, context);
407
+ case "SerialConsoleAccessDisabledException":
408
+ case "com.amazonaws.ec2instanceconnect#SerialConsoleAccessDisabledException":
409
+ throw await de_SerialConsoleAccessDisabledExceptionRes(parsedOutput, context);
410
+ case "SerialConsoleSessionLimitExceededException":
411
+ case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionLimitExceededException":
412
+ throw await de_SerialConsoleSessionLimitExceededExceptionRes(parsedOutput, context);
413
+ case "SerialConsoleSessionUnavailableException":
414
+ case "com.amazonaws.ec2instanceconnect#SerialConsoleSessionUnavailableException":
415
+ throw await de_SerialConsoleSessionUnavailableExceptionRes(parsedOutput, context);
416
+ case "ServiceException":
417
+ case "com.amazonaws.ec2instanceconnect#ServiceException":
418
+ throw await de_ServiceExceptionRes(parsedOutput, context);
419
+ case "ThrottlingException":
420
+ case "com.amazonaws.ec2instanceconnect#ThrottlingException":
421
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
422
+ default:
423
+ const parsedBody = parsedOutput.body;
424
+ return throwDefaultError({
425
+ output,
426
+ parsedBody,
427
+ errorCode
428
+ });
429
+ }
430
+ }, "de_SendSerialConsoleSSHPublicKeyCommandError");
431
+ var de_SendSSHPublicKeyCommand = /* @__PURE__ */ __name(async (output, context) => {
432
+ if (output.statusCode >= 300) {
433
+ return de_SendSSHPublicKeyCommandError(output, context);
434
+ }
435
+ const data = await parseBody(output.body, context);
436
+ let contents = {};
437
+ contents = (0, import_smithy_client._json)(data);
438
+ const response = {
439
+ $metadata: deserializeMetadata(output),
440
+ ...contents
441
+ };
442
+ return response;
443
+ }, "de_SendSSHPublicKeyCommand");
444
+ var de_SendSSHPublicKeyCommandError = /* @__PURE__ */ __name(async (output, context) => {
445
+ const parsedOutput = {
446
+ ...output,
447
+ body: await parseErrorBody(output.body, context)
448
+ };
449
+ const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
450
+ switch (errorCode) {
451
+ case "AuthException":
452
+ case "com.amazonaws.ec2instanceconnect#AuthException":
453
+ throw await de_AuthExceptionRes(parsedOutput, context);
454
+ case "EC2InstanceNotFoundException":
455
+ case "com.amazonaws.ec2instanceconnect#EC2InstanceNotFoundException":
456
+ throw await de_EC2InstanceNotFoundExceptionRes(parsedOutput, context);
457
+ case "EC2InstanceStateInvalidException":
458
+ case "com.amazonaws.ec2instanceconnect#EC2InstanceStateInvalidException":
459
+ throw await de_EC2InstanceStateInvalidExceptionRes(parsedOutput, context);
460
+ case "EC2InstanceUnavailableException":
461
+ case "com.amazonaws.ec2instanceconnect#EC2InstanceUnavailableException":
462
+ throw await de_EC2InstanceUnavailableExceptionRes(parsedOutput, context);
463
+ case "InvalidArgsException":
464
+ case "com.amazonaws.ec2instanceconnect#InvalidArgsException":
465
+ throw await de_InvalidArgsExceptionRes(parsedOutput, context);
466
+ case "ServiceException":
467
+ case "com.amazonaws.ec2instanceconnect#ServiceException":
468
+ throw await de_ServiceExceptionRes(parsedOutput, context);
469
+ case "ThrottlingException":
470
+ case "com.amazonaws.ec2instanceconnect#ThrottlingException":
471
+ throw await de_ThrottlingExceptionRes(parsedOutput, context);
472
+ default:
473
+ const parsedBody = parsedOutput.body;
474
+ return throwDefaultError({
475
+ output,
476
+ parsedBody,
477
+ errorCode
478
+ });
479
+ }
480
+ }, "de_SendSSHPublicKeyCommandError");
481
+ var de_AuthExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
482
+ const body = parsedOutput.body;
483
+ const deserialized = (0, import_smithy_client._json)(body);
484
+ const exception = new AuthException({
485
+ $metadata: deserializeMetadata(parsedOutput),
486
+ ...deserialized
487
+ });
488
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
489
+ }, "de_AuthExceptionRes");
490
+ var de_EC2InstanceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
491
+ const body = parsedOutput.body;
492
+ const deserialized = (0, import_smithy_client._json)(body);
493
+ const exception = new EC2InstanceNotFoundException({
494
+ $metadata: deserializeMetadata(parsedOutput),
495
+ ...deserialized
496
+ });
497
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
498
+ }, "de_EC2InstanceNotFoundExceptionRes");
499
+ var de_EC2InstanceStateInvalidExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
500
+ const body = parsedOutput.body;
501
+ const deserialized = (0, import_smithy_client._json)(body);
502
+ const exception = new EC2InstanceStateInvalidException({
503
+ $metadata: deserializeMetadata(parsedOutput),
504
+ ...deserialized
505
+ });
506
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
507
+ }, "de_EC2InstanceStateInvalidExceptionRes");
508
+ var de_EC2InstanceTypeInvalidExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
509
+ const body = parsedOutput.body;
510
+ const deserialized = (0, import_smithy_client._json)(body);
511
+ const exception = new EC2InstanceTypeInvalidException({
512
+ $metadata: deserializeMetadata(parsedOutput),
513
+ ...deserialized
514
+ });
515
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
516
+ }, "de_EC2InstanceTypeInvalidExceptionRes");
517
+ var de_EC2InstanceUnavailableExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
518
+ const body = parsedOutput.body;
519
+ const deserialized = (0, import_smithy_client._json)(body);
520
+ const exception = new EC2InstanceUnavailableException({
521
+ $metadata: deserializeMetadata(parsedOutput),
522
+ ...deserialized
523
+ });
524
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
525
+ }, "de_EC2InstanceUnavailableExceptionRes");
526
+ var de_InvalidArgsExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
527
+ const body = parsedOutput.body;
528
+ const deserialized = (0, import_smithy_client._json)(body);
529
+ const exception = new InvalidArgsException({
530
+ $metadata: deserializeMetadata(parsedOutput),
531
+ ...deserialized
532
+ });
533
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
534
+ }, "de_InvalidArgsExceptionRes");
535
+ var de_SerialConsoleAccessDisabledExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
536
+ const body = parsedOutput.body;
537
+ const deserialized = (0, import_smithy_client._json)(body);
538
+ const exception = new SerialConsoleAccessDisabledException({
539
+ $metadata: deserializeMetadata(parsedOutput),
540
+ ...deserialized
541
+ });
542
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
543
+ }, "de_SerialConsoleAccessDisabledExceptionRes");
544
+ var de_SerialConsoleSessionLimitExceededExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
545
+ const body = parsedOutput.body;
546
+ const deserialized = (0, import_smithy_client._json)(body);
547
+ const exception = new SerialConsoleSessionLimitExceededException({
548
+ $metadata: deserializeMetadata(parsedOutput),
549
+ ...deserialized
550
+ });
551
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
552
+ }, "de_SerialConsoleSessionLimitExceededExceptionRes");
553
+ var de_SerialConsoleSessionUnavailableExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
554
+ const body = parsedOutput.body;
555
+ const deserialized = (0, import_smithy_client._json)(body);
556
+ const exception = new SerialConsoleSessionUnavailableException({
557
+ $metadata: deserializeMetadata(parsedOutput),
558
+ ...deserialized
559
+ });
560
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
561
+ }, "de_SerialConsoleSessionUnavailableExceptionRes");
562
+ var de_ServiceExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
563
+ const body = parsedOutput.body;
564
+ const deserialized = (0, import_smithy_client._json)(body);
565
+ const exception = new ServiceException({
566
+ $metadata: deserializeMetadata(parsedOutput),
567
+ ...deserialized
568
+ });
569
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
570
+ }, "de_ServiceExceptionRes");
571
+ var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
572
+ const body = parsedOutput.body;
573
+ const deserialized = (0, import_smithy_client._json)(body);
574
+ const exception = new ThrottlingException({
575
+ $metadata: deserializeMetadata(parsedOutput),
576
+ ...deserialized
577
+ });
578
+ return (0, import_smithy_client.decorateServiceException)(exception, body);
579
+ }, "de_ThrottlingExceptionRes");
580
+ var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
581
+ httpStatusCode: output.statusCode,
582
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
583
+ extendedRequestId: output.headers["x-amz-id-2"],
584
+ cfId: output.headers["x-amz-cf-id"]
585
+ }), "deserializeMetadata");
586
+ var collectBodyString = /* @__PURE__ */ __name((streamBody, context) => (0, import_smithy_client.collectBody)(streamBody, context).then((body) => context.utf8Encoder(body)), "collectBodyString");
587
+ var throwDefaultError = (0, import_smithy_client.withBaseException)(EC2InstanceConnectServiceException);
588
+ var buildHttpRpcRequest = /* @__PURE__ */ __name(async (context, headers, path, resolvedHostname, body) => {
589
+ const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
590
+ const contents = {
591
+ protocol,
592
+ hostname,
593
+ port,
594
+ method: "POST",
595
+ path: basePath.endsWith("/") ? basePath.slice(0, -1) + path : basePath + path,
596
+ headers
597
+ };
598
+ if (resolvedHostname !== void 0) {
599
+ contents.hostname = resolvedHostname;
600
+ }
601
+ if (body !== void 0) {
602
+ contents.body = body;
603
+ }
604
+ return new import_protocol_http.HttpRequest(contents);
605
+ }, "buildHttpRpcRequest");
606
+ function sharedHeaders(operation) {
607
+ return {
608
+ "content-type": "application/x-amz-json-1.1",
609
+ "x-amz-target": `AWSEC2InstanceConnectService.${operation}`
610
+ };
611
+ }
612
+ __name(sharedHeaders, "sharedHeaders");
613
+ var parseBody = /* @__PURE__ */ __name((streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
614
+ if (encoded.length) {
615
+ return JSON.parse(encoded);
616
+ }
617
+ return {};
618
+ }), "parseBody");
619
+ var parseErrorBody = /* @__PURE__ */ __name(async (errorBody, context) => {
620
+ const value = await parseBody(errorBody, context);
621
+ value.message = value.message ?? value.Message;
622
+ return value;
623
+ }, "parseErrorBody");
624
+ var loadRestJsonErrorCode = /* @__PURE__ */ __name((output, data) => {
625
+ const findKey = /* @__PURE__ */ __name((object, key) => Object.keys(object).find((k) => k.toLowerCase() === key.toLowerCase()), "findKey");
626
+ const sanitizeErrorCode = /* @__PURE__ */ __name((rawValue) => {
627
+ let cleanValue = rawValue;
628
+ if (typeof cleanValue === "number") {
629
+ cleanValue = cleanValue.toString();
630
+ }
631
+ if (cleanValue.indexOf(",") >= 0) {
632
+ cleanValue = cleanValue.split(",")[0];
633
+ }
634
+ if (cleanValue.indexOf(":") >= 0) {
635
+ cleanValue = cleanValue.split(":")[0];
636
+ }
637
+ if (cleanValue.indexOf("#") >= 0) {
638
+ cleanValue = cleanValue.split("#")[1];
639
+ }
640
+ return cleanValue;
641
+ }, "sanitizeErrorCode");
642
+ const headerKey = findKey(output.headers, "x-amzn-errortype");
643
+ if (headerKey !== void 0) {
644
+ return sanitizeErrorCode(output.headers[headerKey]);
645
+ }
646
+ if (data.code !== void 0) {
647
+ return sanitizeErrorCode(data.code);
648
+ }
649
+ if (data["__type"] !== void 0) {
650
+ return sanitizeErrorCode(data["__type"]);
651
+ }
652
+ }, "loadRestJsonErrorCode");
653
+
654
+ // src/commands/SendSerialConsoleSSHPublicKeyCommand.ts
655
+ var _SendSerialConsoleSSHPublicKeyCommand = class _SendSerialConsoleSSHPublicKeyCommand extends import_smithy_client.Command.classBuilder().ep({
656
+ ...commonParams
657
+ }).m(function(Command, cs, config, o) {
658
+ return [
659
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
660
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
661
+ ];
662
+ }).s("AWSEC2InstanceConnectService", "SendSerialConsoleSSHPublicKey", {}).n("EC2InstanceConnectClient", "SendSerialConsoleSSHPublicKeyCommand").f(void 0, void 0).ser(se_SendSerialConsoleSSHPublicKeyCommand).de(de_SendSerialConsoleSSHPublicKeyCommand).build() {
663
+ };
664
+ __name(_SendSerialConsoleSSHPublicKeyCommand, "SendSerialConsoleSSHPublicKeyCommand");
665
+ var SendSerialConsoleSSHPublicKeyCommand = _SendSerialConsoleSSHPublicKeyCommand;
666
+
667
+ // src/commands/SendSSHPublicKeyCommand.ts
668
+
669
+
670
+
671
+
672
+ var _SendSSHPublicKeyCommand = class _SendSSHPublicKeyCommand extends import_smithy_client.Command.classBuilder().ep({
673
+ ...commonParams
674
+ }).m(function(Command, cs, config, o) {
675
+ return [
676
+ (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
677
+ (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
678
+ ];
679
+ }).s("AWSEC2InstanceConnectService", "SendSSHPublicKey", {}).n("EC2InstanceConnectClient", "SendSSHPublicKeyCommand").f(void 0, void 0).ser(se_SendSSHPublicKeyCommand).de(de_SendSSHPublicKeyCommand).build() {
680
+ };
681
+ __name(_SendSSHPublicKeyCommand, "SendSSHPublicKeyCommand");
682
+ var SendSSHPublicKeyCommand = _SendSSHPublicKeyCommand;
683
+
684
+ // src/EC2InstanceConnect.ts
685
+ var commands = {
686
+ SendSerialConsoleSSHPublicKeyCommand,
687
+ SendSSHPublicKeyCommand
688
+ };
689
+ var _EC2InstanceConnect = class _EC2InstanceConnect extends EC2InstanceConnectClient {
690
+ };
691
+ __name(_EC2InstanceConnect, "EC2InstanceConnect");
692
+ var EC2InstanceConnect = _EC2InstanceConnect;
693
+ (0, import_smithy_client.createAggregatedClient)(commands, EC2InstanceConnect);
694
+
695
+ // src/index.ts
696
+ var import_util_endpoints = require("@aws-sdk/util-endpoints");
697
+ // Annotate the CommonJS export names for ESM import in node:
698
+ 0 && (module.exports = {
699
+ AuthException,
700
+ EC2InstanceConnect,
701
+ EC2InstanceConnectClient,
702
+ EC2InstanceConnectServiceException,
703
+ EC2InstanceNotFoundException,
704
+ EC2InstanceStateInvalidException,
705
+ EC2InstanceTypeInvalidException,
706
+ EC2InstanceUnavailableException,
707
+ InvalidArgsException,
708
+ SendSSHPublicKeyCommand,
709
+ SendSerialConsoleSSHPublicKeyCommand,
710
+ SerialConsoleAccessDisabledException,
711
+ SerialConsoleSessionLimitExceededException,
712
+ SerialConsoleSessionUnavailableException,
713
+ ServiceException,
714
+ ThrottlingException,
715
+ __Client
716
+ });