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