@aws-sdk/client-iot-data-plane 3.899.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 +829 -983
  2. package/package.json +38 -38
package/dist-cjs/index.js CHANGED
@@ -1,1029 +1,875 @@
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 });
1
+ 'use strict';
2
+
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');
19
+
20
+ const resolveClientEndpointParameters = (options) => {
21
+ return Object.assign(options, {
22
+ useDualstackEndpoint: options.useDualstackEndpoint ?? false,
23
+ useFipsEndpoint: options.useFipsEndpoint ?? false,
24
+ defaultSigningName: "iotdata",
25
+ });
10
26
  };
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;
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" },
18
32
  };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/index.ts
22
- var index_exports = {};
23
- __export(index_exports, {
24
- ConflictException: () => ConflictException,
25
- DeleteConnectionCommand: () => DeleteConnectionCommand,
26
- DeleteThingShadowCommand: () => DeleteThingShadowCommand,
27
- ForbiddenException: () => ForbiddenException,
28
- GetRetainedMessageCommand: () => GetRetainedMessageCommand,
29
- GetThingShadowCommand: () => GetThingShadowCommand,
30
- InternalFailureException: () => InternalFailureException,
31
- InvalidRequestException: () => InvalidRequestException,
32
- IoTDataPlane: () => IoTDataPlane,
33
- IoTDataPlaneClient: () => IoTDataPlaneClient,
34
- IoTDataPlaneServiceException: () => IoTDataPlaneServiceException,
35
- ListNamedShadowsForThingCommand: () => ListNamedShadowsForThingCommand,
36
- ListRetainedMessagesCommand: () => ListRetainedMessagesCommand,
37
- MethodNotAllowedException: () => MethodNotAllowedException,
38
- PayloadFormatIndicator: () => PayloadFormatIndicator,
39
- PublishCommand: () => PublishCommand,
40
- RequestEntityTooLargeException: () => RequestEntityTooLargeException,
41
- ResourceNotFoundException: () => ResourceNotFoundException,
42
- ServiceUnavailableException: () => ServiceUnavailableException,
43
- ThrottlingException: () => ThrottlingException,
44
- UnauthorizedException: () => UnauthorizedException,
45
- UnsupportedDocumentEncodingException: () => UnsupportedDocumentEncodingException,
46
- UpdateThingShadowCommand: () => UpdateThingShadowCommand,
47
- __Client: () => import_smithy_client.Client,
48
- paginateListRetainedMessages: () => paginateListRetainedMessages
49
- });
50
- module.exports = __toCommonJS(index_exports);
51
-
52
- // src/IoTDataPlaneClient.ts
53
- var import_middleware_host_header = require("@aws-sdk/middleware-host-header");
54
- var import_middleware_logger = require("@aws-sdk/middleware-logger");
55
- var import_middleware_recursion_detection = require("@aws-sdk/middleware-recursion-detection");
56
- var import_middleware_user_agent = require("@aws-sdk/middleware-user-agent");
57
- var import_config_resolver = require("@smithy/config-resolver");
58
- var import_core = require("@smithy/core");
59
- var import_middleware_content_length = require("@smithy/middleware-content-length");
60
- var import_middleware_endpoint = require("@smithy/middleware-endpoint");
61
- var import_middleware_retry = require("@smithy/middleware-retry");
62
33
 
63
- var import_httpAuthSchemeProvider = require("./auth/httpAuthSchemeProvider");
64
-
65
- // src/endpoint/EndpointParameters.ts
66
- var resolveClientEndpointParameters = /* @__PURE__ */ __name((options) => {
67
- return Object.assign(options, {
68
- useDualstackEndpoint: options.useDualstackEndpoint ?? false,
69
- useFipsEndpoint: options.useFipsEndpoint ?? false,
70
- defaultSigningName: "iotdata"
71
- });
72
- }, "resolveClientEndpointParameters");
73
- var commonParams = {
74
- UseFIPS: { type: "builtInParams", name: "useFipsEndpoint" },
75
- Endpoint: { type: "builtInParams", name: "endpoint" },
76
- Region: { type: "builtInParams", name: "region" },
77
- 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
+ };
78
71
  };
79
72
 
80
- // src/IoTDataPlaneClient.ts
81
- var import_runtimeConfig = require("././runtimeConfig");
82
-
83
- // src/runtimeExtensions.ts
84
- var import_region_config_resolver = require("@aws-sdk/region-config-resolver");
85
- var import_protocol_http = require("@smithy/protocol-http");
86
- var import_smithy_client = require("@smithy/smithy-client");
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
+ };
87
78
 
88
- // src/auth/httpAuthExtensionConfiguration.ts
89
- var getHttpAuthExtensionConfiguration = /* @__PURE__ */ __name((runtimeConfig) => {
90
- const _httpAuthSchemes = runtimeConfig.httpAuthSchemes;
91
- let _httpAuthSchemeProvider = runtimeConfig.httpAuthSchemeProvider;
92
- let _credentials = runtimeConfig.credentials;
93
- return {
94
- setHttpAuthScheme(httpAuthScheme) {
95
- const index = _httpAuthSchemes.findIndex((scheme) => scheme.schemeId === httpAuthScheme.schemeId);
96
- if (index === -1) {
97
- _httpAuthSchemes.push(httpAuthScheme);
98
- } else {
99
- _httpAuthSchemes.splice(index, 1, httpAuthScheme);
100
- }
101
- },
102
- httpAuthSchemes() {
103
- return _httpAuthSchemes;
104
- },
105
- setHttpAuthSchemeProvider(httpAuthSchemeProvider) {
106
- _httpAuthSchemeProvider = httpAuthSchemeProvider;
107
- },
108
- httpAuthSchemeProvider() {
109
- return _httpAuthSchemeProvider;
110
- },
111
- setCredentials(credentials) {
112
- _credentials = credentials;
113
- },
114
- credentials() {
115
- return _credentials;
79
+ class IoTDataPlaneClient 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.defaultIoTDataPlaneHttpAuthSchemeParametersProvider,
102
+ identityProviderConfigProvider: async (config) => new core.DefaultIdentityProviderConfig({
103
+ "aws.auth#sigv4": config.credentials,
104
+ }),
105
+ }));
106
+ this.middlewareStack.use(core.getHttpSigningPlugin(this.config));
116
107
  }
117
- };
118
- }, "getHttpAuthExtensionConfiguration");
119
- var resolveHttpAuthRuntimeConfig = /* @__PURE__ */ __name((config) => {
120
- return {
121
- httpAuthSchemes: config.httpAuthSchemes(),
122
- httpAuthSchemeProvider: config.httpAuthSchemeProvider(),
123
- credentials: config.credentials()
124
- };
125
- }, "resolveHttpAuthRuntimeConfig");
126
-
127
- // src/runtimeExtensions.ts
128
- var resolveRuntimeExtensions = /* @__PURE__ */ __name((runtimeConfig, extensions) => {
129
- const extensionConfiguration = Object.assign(
130
- (0, import_region_config_resolver.getAwsRegionExtensionConfiguration)(runtimeConfig),
131
- (0, import_smithy_client.getDefaultExtensionConfiguration)(runtimeConfig),
132
- (0, import_protocol_http.getHttpHandlerExtensionConfiguration)(runtimeConfig),
133
- getHttpAuthExtensionConfiguration(runtimeConfig)
134
- );
135
- extensions.forEach((extension) => extension.configure(extensionConfiguration));
136
- return Object.assign(
137
- runtimeConfig,
138
- (0, import_region_config_resolver.resolveAwsRegionExtensionConfiguration)(extensionConfiguration),
139
- (0, import_smithy_client.resolveDefaultRuntimeConfig)(extensionConfiguration),
140
- (0, import_protocol_http.resolveHttpHandlerRuntimeConfig)(extensionConfiguration),
141
- resolveHttpAuthRuntimeConfig(extensionConfiguration)
142
- );
143
- }, "resolveRuntimeExtensions");
108
+ destroy() {
109
+ super.destroy();
110
+ }
111
+ }
144
112
 
145
- // src/IoTDataPlaneClient.ts
146
- var IoTDataPlaneClient = class extends import_smithy_client.Client {
147
- static {
148
- __name(this, "IoTDataPlaneClient");
149
- }
150
- /**
151
- * The resolved configuration of IoTDataPlaneClient class. This is resolved and normalized from the {@link IoTDataPlaneClientConfig | constructor configuration interface}.
152
- */
153
- config;
154
- constructor(...[configuration]) {
155
- const _config_0 = (0, import_runtimeConfig.getRuntimeConfig)(configuration || {});
156
- super(_config_0);
157
- this.initConfig = _config_0;
158
- const _config_1 = resolveClientEndpointParameters(_config_0);
159
- const _config_2 = (0, import_middleware_user_agent.resolveUserAgentConfig)(_config_1);
160
- const _config_3 = (0, import_middleware_retry.resolveRetryConfig)(_config_2);
161
- const _config_4 = (0, import_config_resolver.resolveRegionConfig)(_config_3);
162
- const _config_5 = (0, import_middleware_host_header.resolveHostHeaderConfig)(_config_4);
163
- const _config_6 = (0, import_middleware_endpoint.resolveEndpointConfig)(_config_5);
164
- const _config_7 = (0, import_httpAuthSchemeProvider.resolveHttpAuthSchemeConfig)(_config_6);
165
- const _config_8 = resolveRuntimeExtensions(_config_7, configuration?.extensions || []);
166
- this.config = _config_8;
167
- this.middlewareStack.use((0, import_middleware_user_agent.getUserAgentPlugin)(this.config));
168
- this.middlewareStack.use((0, import_middleware_retry.getRetryPlugin)(this.config));
169
- this.middlewareStack.use((0, import_middleware_content_length.getContentLengthPlugin)(this.config));
170
- this.middlewareStack.use((0, import_middleware_host_header.getHostHeaderPlugin)(this.config));
171
- this.middlewareStack.use((0, import_middleware_logger.getLoggerPlugin)(this.config));
172
- this.middlewareStack.use((0, import_middleware_recursion_detection.getRecursionDetectionPlugin)(this.config));
173
- this.middlewareStack.use(
174
- (0, import_core.getHttpAuthSchemeEndpointRuleSetPlugin)(this.config, {
175
- httpAuthSchemeParametersProvider: import_httpAuthSchemeProvider.defaultIoTDataPlaneHttpAuthSchemeParametersProvider,
176
- identityProviderConfigProvider: /* @__PURE__ */ __name(async (config) => new import_core.DefaultIdentityProviderConfig({
177
- "aws.auth#sigv4": config.credentials
178
- }), "identityProviderConfigProvider")
179
- })
180
- );
181
- this.middlewareStack.use((0, import_core.getHttpSigningPlugin)(this.config));
182
- }
183
- /**
184
- * Destroy underlying resources, like sockets. It's usually not necessary to do this.
185
- * However in Node.js, it's best to explicitly shut down the client's agent when it is no longer needed.
186
- * Otherwise, sockets might stay open for quite a long time before the server terminates them.
187
- */
188
- destroy() {
189
- super.destroy();
190
- }
113
+ class IoTDataPlaneServiceException extends smithyClient.ServiceException {
114
+ constructor(options) {
115
+ super(options);
116
+ Object.setPrototypeOf(this, IoTDataPlaneServiceException.prototype);
117
+ }
118
+ }
119
+
120
+ class ConflictException extends IoTDataPlaneServiceException {
121
+ name = "ConflictException";
122
+ $fault = "client";
123
+ constructor(opts) {
124
+ super({
125
+ name: "ConflictException",
126
+ $fault: "client",
127
+ ...opts,
128
+ });
129
+ Object.setPrototypeOf(this, ConflictException.prototype);
130
+ }
131
+ }
132
+ class ForbiddenException extends IoTDataPlaneServiceException {
133
+ name = "ForbiddenException";
134
+ $fault = "client";
135
+ constructor(opts) {
136
+ super({
137
+ name: "ForbiddenException",
138
+ $fault: "client",
139
+ ...opts,
140
+ });
141
+ Object.setPrototypeOf(this, ForbiddenException.prototype);
142
+ }
143
+ }
144
+ class InternalFailureException extends IoTDataPlaneServiceException {
145
+ name = "InternalFailureException";
146
+ $fault = "server";
147
+ constructor(opts) {
148
+ super({
149
+ name: "InternalFailureException",
150
+ $fault: "server",
151
+ ...opts,
152
+ });
153
+ Object.setPrototypeOf(this, InternalFailureException.prototype);
154
+ }
155
+ }
156
+ class InvalidRequestException extends IoTDataPlaneServiceException {
157
+ name = "InvalidRequestException";
158
+ $fault = "client";
159
+ constructor(opts) {
160
+ super({
161
+ name: "InvalidRequestException",
162
+ $fault: "client",
163
+ ...opts,
164
+ });
165
+ Object.setPrototypeOf(this, InvalidRequestException.prototype);
166
+ }
167
+ }
168
+ class ResourceNotFoundException extends IoTDataPlaneServiceException {
169
+ name = "ResourceNotFoundException";
170
+ $fault = "client";
171
+ constructor(opts) {
172
+ super({
173
+ name: "ResourceNotFoundException",
174
+ $fault: "client",
175
+ ...opts,
176
+ });
177
+ Object.setPrototypeOf(this, ResourceNotFoundException.prototype);
178
+ }
179
+ }
180
+ class ThrottlingException extends IoTDataPlaneServiceException {
181
+ name = "ThrottlingException";
182
+ $fault = "client";
183
+ constructor(opts) {
184
+ super({
185
+ name: "ThrottlingException",
186
+ $fault: "client",
187
+ ...opts,
188
+ });
189
+ Object.setPrototypeOf(this, ThrottlingException.prototype);
190
+ }
191
+ }
192
+ class MethodNotAllowedException extends IoTDataPlaneServiceException {
193
+ name = "MethodNotAllowedException";
194
+ $fault = "client";
195
+ constructor(opts) {
196
+ super({
197
+ name: "MethodNotAllowedException",
198
+ $fault: "client",
199
+ ...opts,
200
+ });
201
+ Object.setPrototypeOf(this, MethodNotAllowedException.prototype);
202
+ }
203
+ }
204
+ class ServiceUnavailableException extends IoTDataPlaneServiceException {
205
+ name = "ServiceUnavailableException";
206
+ $fault = "server";
207
+ constructor(opts) {
208
+ super({
209
+ name: "ServiceUnavailableException",
210
+ $fault: "server",
211
+ ...opts,
212
+ });
213
+ Object.setPrototypeOf(this, ServiceUnavailableException.prototype);
214
+ }
215
+ }
216
+ class UnauthorizedException extends IoTDataPlaneServiceException {
217
+ name = "UnauthorizedException";
218
+ $fault = "client";
219
+ constructor(opts) {
220
+ super({
221
+ name: "UnauthorizedException",
222
+ $fault: "client",
223
+ ...opts,
224
+ });
225
+ Object.setPrototypeOf(this, UnauthorizedException.prototype);
226
+ }
227
+ }
228
+ class UnsupportedDocumentEncodingException extends IoTDataPlaneServiceException {
229
+ name = "UnsupportedDocumentEncodingException";
230
+ $fault = "client";
231
+ constructor(opts) {
232
+ super({
233
+ name: "UnsupportedDocumentEncodingException",
234
+ $fault: "client",
235
+ ...opts,
236
+ });
237
+ Object.setPrototypeOf(this, UnsupportedDocumentEncodingException.prototype);
238
+ }
239
+ }
240
+ const PayloadFormatIndicator = {
241
+ UNSPECIFIED_BYTES: "UNSPECIFIED_BYTES",
242
+ UTF8_DATA: "UTF8_DATA",
191
243
  };
192
-
193
- // src/IoTDataPlane.ts
194
-
195
-
196
- // src/commands/DeleteConnectionCommand.ts
197
-
198
- var import_middleware_serde = require("@smithy/middleware-serde");
199
-
200
-
201
- // src/protocols/Aws_restJson1.ts
202
- var import_core2 = require("@aws-sdk/core");
203
-
204
-
205
-
206
- // src/models/IoTDataPlaneServiceException.ts
207
-
208
- var IoTDataPlaneServiceException = class _IoTDataPlaneServiceException extends import_smithy_client.ServiceException {
209
- static {
210
- __name(this, "IoTDataPlaneServiceException");
211
- }
212
- /**
213
- * @internal
214
- */
215
- constructor(options) {
216
- super(options);
217
- Object.setPrototypeOf(this, _IoTDataPlaneServiceException.prototype);
218
- }
244
+ class RequestEntityTooLargeException extends IoTDataPlaneServiceException {
245
+ name = "RequestEntityTooLargeException";
246
+ $fault = "client";
247
+ constructor(opts) {
248
+ super({
249
+ name: "RequestEntityTooLargeException",
250
+ $fault: "client",
251
+ ...opts,
252
+ });
253
+ Object.setPrototypeOf(this, RequestEntityTooLargeException.prototype);
254
+ }
255
+ }
256
+
257
+ const se_DeleteConnectionCommand = async (input, context) => {
258
+ const b = core.requestBuilder(input, context);
259
+ const headers = {};
260
+ b.bp("/connections/{clientId}");
261
+ b.p("clientId", () => input.clientId, "{clientId}", false);
262
+ const query = smithyClient.map({
263
+ [_cS]: [() => input.cleanSession !== void 0, () => input[_cS].toString()],
264
+ [_pWM]: [() => input.preventWillMessage !== void 0, () => input[_pWM].toString()],
265
+ });
266
+ let body;
267
+ b.m("DELETE").h(headers).q(query).b(body);
268
+ return b.build();
219
269
  };
220
-
221
- // src/models/models_0.ts
222
- var ConflictException = class _ConflictException extends IoTDataPlaneServiceException {
223
- static {
224
- __name(this, "ConflictException");
225
- }
226
- name = "ConflictException";
227
- $fault = "client";
228
- /**
229
- * @internal
230
- */
231
- constructor(opts) {
232
- super({
233
- name: "ConflictException",
234
- $fault: "client",
235
- ...opts
270
+ const se_DeleteThingShadowCommand = async (input, context) => {
271
+ const b = core.requestBuilder(input, context);
272
+ const headers = {};
273
+ b.bp("/things/{thingName}/shadow");
274
+ b.p("thingName", () => input.thingName, "{thingName}", false);
275
+ const query = smithyClient.map({
276
+ [_n]: [, input[_sN]],
236
277
  });
237
- Object.setPrototypeOf(this, _ConflictException.prototype);
238
- }
278
+ let body;
279
+ b.m("DELETE").h(headers).q(query).b(body);
280
+ return b.build();
281
+ };
282
+ const se_GetRetainedMessageCommand = async (input, context) => {
283
+ const b = core.requestBuilder(input, context);
284
+ const headers = {};
285
+ b.bp("/retainedMessage/{topic}");
286
+ b.p("topic", () => input.topic, "{topic}", false);
287
+ let body;
288
+ b.m("GET").h(headers).b(body);
289
+ return b.build();
239
290
  };
240
- var ForbiddenException = class _ForbiddenException extends IoTDataPlaneServiceException {
241
- static {
242
- __name(this, "ForbiddenException");
243
- }
244
- name = "ForbiddenException";
245
- $fault = "client";
246
- /**
247
- * @internal
248
- */
249
- constructor(opts) {
250
- super({
251
- name: "ForbiddenException",
252
- $fault: "client",
253
- ...opts
291
+ const se_GetThingShadowCommand = async (input, context) => {
292
+ const b = core.requestBuilder(input, context);
293
+ const headers = {};
294
+ b.bp("/things/{thingName}/shadow");
295
+ b.p("thingName", () => input.thingName, "{thingName}", false);
296
+ const query = smithyClient.map({
297
+ [_n]: [, input[_sN]],
254
298
  });
255
- Object.setPrototypeOf(this, _ForbiddenException.prototype);
256
- }
299
+ let body;
300
+ b.m("GET").h(headers).q(query).b(body);
301
+ return b.build();
257
302
  };
258
- var InternalFailureException = class _InternalFailureException extends IoTDataPlaneServiceException {
259
- static {
260
- __name(this, "InternalFailureException");
261
- }
262
- name = "InternalFailureException";
263
- $fault = "server";
264
- /**
265
- * @internal
266
- */
267
- constructor(opts) {
268
- super({
269
- name: "InternalFailureException",
270
- $fault: "server",
271
- ...opts
303
+ const se_ListNamedShadowsForThingCommand = async (input, context) => {
304
+ const b = core.requestBuilder(input, context);
305
+ const headers = {};
306
+ b.bp("/api/things/shadow/ListNamedShadowsForThing/{thingName}");
307
+ b.p("thingName", () => input.thingName, "{thingName}", false);
308
+ const query = smithyClient.map({
309
+ [_nT]: [, input[_nT]],
310
+ [_pS]: [() => input.pageSize !== void 0, () => input[_pS].toString()],
272
311
  });
273
- Object.setPrototypeOf(this, _InternalFailureException.prototype);
274
- }
312
+ let body;
313
+ b.m("GET").h(headers).q(query).b(body);
314
+ return b.build();
275
315
  };
276
- var InvalidRequestException = class _InvalidRequestException extends IoTDataPlaneServiceException {
277
- static {
278
- __name(this, "InvalidRequestException");
279
- }
280
- name = "InvalidRequestException";
281
- $fault = "client";
282
- /**
283
- * @internal
284
- */
285
- constructor(opts) {
286
- super({
287
- name: "InvalidRequestException",
288
- $fault: "client",
289
- ...opts
316
+ const se_ListRetainedMessagesCommand = async (input, context) => {
317
+ const b = core.requestBuilder(input, context);
318
+ const headers = {};
319
+ b.bp("/retainedMessage");
320
+ const query = smithyClient.map({
321
+ [_nT]: [, input[_nT]],
322
+ [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()],
290
323
  });
291
- Object.setPrototypeOf(this, _InvalidRequestException.prototype);
292
- }
324
+ let body;
325
+ b.m("GET").h(headers).q(query).b(body);
326
+ return b.build();
293
327
  };
294
- var ResourceNotFoundException = class _ResourceNotFoundException extends IoTDataPlaneServiceException {
295
- static {
296
- __name(this, "ResourceNotFoundException");
297
- }
298
- name = "ResourceNotFoundException";
299
- $fault = "client";
300
- /**
301
- * @internal
302
- */
303
- constructor(opts) {
304
- super({
305
- name: "ResourceNotFoundException",
306
- $fault: "client",
307
- ...opts
328
+ const se_PublishCommand = async (input, context) => {
329
+ const b = core.requestBuilder(input, context);
330
+ const headers = smithyClient.map({}, smithyClient.isSerializableHeaderValue, {
331
+ "content-type": "application/octet-stream",
332
+ [_xamup]: [
333
+ () => smithyClient.isSerializableHeaderValue(input[_uP]),
334
+ () => context.base64Encoder(Buffer.from(smithyClient.LazyJsonString.from(input[_uP]))),
335
+ ],
336
+ [_xampfi]: input[_pFI],
337
+ [_xamcd]: input[_cD],
308
338
  });
309
- Object.setPrototypeOf(this, _ResourceNotFoundException.prototype);
310
- }
339
+ b.bp("/topics/{topic}");
340
+ b.p("topic", () => input.topic, "{topic}", false);
341
+ const query = smithyClient.map({
342
+ [_q]: [() => input.qos !== void 0, () => input[_q].toString()],
343
+ [_r]: [() => input.retain !== void 0, () => input[_r].toString()],
344
+ [_cT]: [, input[_cT]],
345
+ [_rT]: [, input[_rT]],
346
+ [_mE]: [() => input.messageExpiry !== void 0, () => input[_mE].toString()],
347
+ });
348
+ let body;
349
+ if (input.payload !== undefined) {
350
+ body = input.payload;
351
+ }
352
+ b.m("POST").h(headers).q(query).b(body);
353
+ return b.build();
311
354
  };
312
- var ThrottlingException = class _ThrottlingException extends IoTDataPlaneServiceException {
313
- static {
314
- __name(this, "ThrottlingException");
315
- }
316
- name = "ThrottlingException";
317
- $fault = "client";
318
- /**
319
- * @internal
320
- */
321
- constructor(opts) {
322
- super({
323
- name: "ThrottlingException",
324
- $fault: "client",
325
- ...opts
355
+ const se_UpdateThingShadowCommand = async (input, context) => {
356
+ const b = core.requestBuilder(input, context);
357
+ const headers = {
358
+ "content-type": "application/octet-stream",
359
+ };
360
+ b.bp("/things/{thingName}/shadow");
361
+ b.p("thingName", () => input.thingName, "{thingName}", false);
362
+ const query = smithyClient.map({
363
+ [_n]: [, input[_sN]],
326
364
  });
327
- Object.setPrototypeOf(this, _ThrottlingException.prototype);
328
- }
365
+ let body;
366
+ if (input.payload !== undefined) {
367
+ body = input.payload;
368
+ }
369
+ b.m("POST").h(headers).q(query).b(body);
370
+ return b.build();
329
371
  };
330
- var MethodNotAllowedException = class _MethodNotAllowedException extends IoTDataPlaneServiceException {
331
- static {
332
- __name(this, "MethodNotAllowedException");
333
- }
334
- name = "MethodNotAllowedException";
335
- $fault = "client";
336
- /**
337
- * @internal
338
- */
339
- constructor(opts) {
340
- super({
341
- name: "MethodNotAllowedException",
342
- $fault: "client",
343
- ...opts
372
+ const de_DeleteConnectionCommand = async (output, context) => {
373
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
374
+ return de_CommandError(output, context);
375
+ }
376
+ const contents = smithyClient.map({
377
+ $metadata: deserializeMetadata(output),
344
378
  });
345
- Object.setPrototypeOf(this, _MethodNotAllowedException.prototype);
346
- }
379
+ await smithyClient.collectBody(output.body, context);
380
+ return contents;
347
381
  };
348
- var ServiceUnavailableException = class _ServiceUnavailableException extends IoTDataPlaneServiceException {
349
- static {
350
- __name(this, "ServiceUnavailableException");
351
- }
352
- name = "ServiceUnavailableException";
353
- $fault = "server";
354
- /**
355
- * @internal
356
- */
357
- constructor(opts) {
358
- super({
359
- name: "ServiceUnavailableException",
360
- $fault: "server",
361
- ...opts
382
+ const de_DeleteThingShadowCommand = async (output, context) => {
383
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
384
+ return de_CommandError(output, context);
385
+ }
386
+ const contents = smithyClient.map({
387
+ $metadata: deserializeMetadata(output),
362
388
  });
363
- Object.setPrototypeOf(this, _ServiceUnavailableException.prototype);
364
- }
389
+ const data = await smithyClient.collectBody(output.body, context);
390
+ contents.payload = data;
391
+ return contents;
365
392
  };
366
- var UnauthorizedException = class _UnauthorizedException extends IoTDataPlaneServiceException {
367
- static {
368
- __name(this, "UnauthorizedException");
369
- }
370
- name = "UnauthorizedException";
371
- $fault = "client";
372
- /**
373
- * @internal
374
- */
375
- constructor(opts) {
376
- super({
377
- name: "UnauthorizedException",
378
- $fault: "client",
379
- ...opts
393
+ const de_GetRetainedMessageCommand = async (output, context) => {
394
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
395
+ return de_CommandError(output, context);
396
+ }
397
+ const contents = smithyClient.map({
398
+ $metadata: deserializeMetadata(output),
380
399
  });
381
- Object.setPrototypeOf(this, _UnauthorizedException.prototype);
382
- }
400
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
401
+ const doc = smithyClient.take(data, {
402
+ lastModifiedTime: smithyClient.expectLong,
403
+ payload: context.base64Decoder,
404
+ qos: smithyClient.expectInt32,
405
+ topic: smithyClient.expectString,
406
+ userProperties: context.base64Decoder,
407
+ });
408
+ Object.assign(contents, doc);
409
+ return contents;
383
410
  };
384
- var UnsupportedDocumentEncodingException = class _UnsupportedDocumentEncodingException extends IoTDataPlaneServiceException {
385
- static {
386
- __name(this, "UnsupportedDocumentEncodingException");
387
- }
388
- name = "UnsupportedDocumentEncodingException";
389
- $fault = "client";
390
- /**
391
- * @internal
392
- */
393
- constructor(opts) {
394
- super({
395
- name: "UnsupportedDocumentEncodingException",
396
- $fault: "client",
397
- ...opts
411
+ const de_GetThingShadowCommand = async (output, context) => {
412
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
413
+ return de_CommandError(output, context);
414
+ }
415
+ const contents = smithyClient.map({
416
+ $metadata: deserializeMetadata(output),
398
417
  });
399
- Object.setPrototypeOf(this, _UnsupportedDocumentEncodingException.prototype);
400
- }
418
+ const data = await smithyClient.collectBody(output.body, context);
419
+ contents.payload = data;
420
+ return contents;
401
421
  };
402
- var PayloadFormatIndicator = {
403
- UNSPECIFIED_BYTES: "UNSPECIFIED_BYTES",
404
- UTF8_DATA: "UTF8_DATA"
422
+ const de_ListNamedShadowsForThingCommand = async (output, context) => {
423
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
424
+ return de_CommandError(output, context);
425
+ }
426
+ const contents = smithyClient.map({
427
+ $metadata: deserializeMetadata(output),
428
+ });
429
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
430
+ const doc = smithyClient.take(data, {
431
+ nextToken: smithyClient.expectString,
432
+ results: smithyClient._json,
433
+ timestamp: smithyClient.expectLong,
434
+ });
435
+ Object.assign(contents, doc);
436
+ return contents;
405
437
  };
406
- var RequestEntityTooLargeException = class _RequestEntityTooLargeException extends IoTDataPlaneServiceException {
407
- static {
408
- __name(this, "RequestEntityTooLargeException");
409
- }
410
- name = "RequestEntityTooLargeException";
411
- $fault = "client";
412
- /**
413
- * @internal
414
- */
415
- constructor(opts) {
416
- super({
417
- name: "RequestEntityTooLargeException",
418
- $fault: "client",
419
- ...opts
438
+ const de_ListRetainedMessagesCommand = async (output, context) => {
439
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
440
+ return de_CommandError(output, context);
441
+ }
442
+ const contents = smithyClient.map({
443
+ $metadata: deserializeMetadata(output),
444
+ });
445
+ const data = smithyClient.expectNonNull(smithyClient.expectObject(await core$1.parseJsonBody(output.body, context)), "body");
446
+ const doc = smithyClient.take(data, {
447
+ nextToken: smithyClient.expectString,
448
+ retainedTopics: smithyClient._json,
420
449
  });
421
- Object.setPrototypeOf(this, _RequestEntityTooLargeException.prototype);
422
- }
450
+ Object.assign(contents, doc);
451
+ return contents;
423
452
  };
424
-
425
- // src/protocols/Aws_restJson1.ts
426
- var se_DeleteConnectionCommand = /* @__PURE__ */ __name(async (input, context) => {
427
- const b = (0, import_core.requestBuilder)(input, context);
428
- const headers = {};
429
- b.bp("/connections/{clientId}");
430
- b.p("clientId", () => input.clientId, "{clientId}", false);
431
- const query = (0, import_smithy_client.map)({
432
- [_cS]: [() => input.cleanSession !== void 0, () => input[_cS].toString()],
433
- [_pWM]: [() => input.preventWillMessage !== void 0, () => input[_pWM].toString()]
434
- });
435
- let body;
436
- b.m("DELETE").h(headers).q(query).b(body);
437
- return b.build();
438
- }, "se_DeleteConnectionCommand");
439
- var se_DeleteThingShadowCommand = /* @__PURE__ */ __name(async (input, context) => {
440
- const b = (0, import_core.requestBuilder)(input, context);
441
- const headers = {};
442
- b.bp("/things/{thingName}/shadow");
443
- b.p("thingName", () => input.thingName, "{thingName}", false);
444
- const query = (0, import_smithy_client.map)({
445
- [_n]: [, input[_sN]]
446
- });
447
- let body;
448
- b.m("DELETE").h(headers).q(query).b(body);
449
- return b.build();
450
- }, "se_DeleteThingShadowCommand");
451
- var se_GetRetainedMessageCommand = /* @__PURE__ */ __name(async (input, context) => {
452
- const b = (0, import_core.requestBuilder)(input, context);
453
- const headers = {};
454
- b.bp("/retainedMessage/{topic}");
455
- b.p("topic", () => input.topic, "{topic}", false);
456
- let body;
457
- b.m("GET").h(headers).b(body);
458
- return b.build();
459
- }, "se_GetRetainedMessageCommand");
460
- var se_GetThingShadowCommand = /* @__PURE__ */ __name(async (input, context) => {
461
- const b = (0, import_core.requestBuilder)(input, context);
462
- const headers = {};
463
- b.bp("/things/{thingName}/shadow");
464
- b.p("thingName", () => input.thingName, "{thingName}", false);
465
- const query = (0, import_smithy_client.map)({
466
- [_n]: [, input[_sN]]
467
- });
468
- let body;
469
- b.m("GET").h(headers).q(query).b(body);
470
- return b.build();
471
- }, "se_GetThingShadowCommand");
472
- var se_ListNamedShadowsForThingCommand = /* @__PURE__ */ __name(async (input, context) => {
473
- const b = (0, import_core.requestBuilder)(input, context);
474
- const headers = {};
475
- b.bp("/api/things/shadow/ListNamedShadowsForThing/{thingName}");
476
- b.p("thingName", () => input.thingName, "{thingName}", false);
477
- const query = (0, import_smithy_client.map)({
478
- [_nT]: [, input[_nT]],
479
- [_pS]: [() => input.pageSize !== void 0, () => input[_pS].toString()]
480
- });
481
- let body;
482
- b.m("GET").h(headers).q(query).b(body);
483
- return b.build();
484
- }, "se_ListNamedShadowsForThingCommand");
485
- var se_ListRetainedMessagesCommand = /* @__PURE__ */ __name(async (input, context) => {
486
- const b = (0, import_core.requestBuilder)(input, context);
487
- const headers = {};
488
- b.bp("/retainedMessage");
489
- const query = (0, import_smithy_client.map)({
490
- [_nT]: [, input[_nT]],
491
- [_mR]: [() => input.maxResults !== void 0, () => input[_mR].toString()]
492
- });
493
- let body;
494
- b.m("GET").h(headers).q(query).b(body);
495
- return b.build();
496
- }, "se_ListRetainedMessagesCommand");
497
- var se_PublishCommand = /* @__PURE__ */ __name(async (input, context) => {
498
- const b = (0, import_core.requestBuilder)(input, context);
499
- const headers = (0, import_smithy_client.map)({}, import_smithy_client.isSerializableHeaderValue, {
500
- "content-type": "application/octet-stream",
501
- [_xamup]: [
502
- () => (0, import_smithy_client.isSerializableHeaderValue)(input[_uP]),
503
- () => context.base64Encoder(Buffer.from(import_smithy_client.LazyJsonString.from(input[_uP])))
504
- ],
505
- [_xampfi]: input[_pFI],
506
- [_xamcd]: input[_cD]
507
- });
508
- b.bp("/topics/{topic}");
509
- b.p("topic", () => input.topic, "{topic}", false);
510
- const query = (0, import_smithy_client.map)({
511
- [_q]: [() => input.qos !== void 0, () => input[_q].toString()],
512
- [_r]: [() => input.retain !== void 0, () => input[_r].toString()],
513
- [_cT]: [, input[_cT]],
514
- [_rT]: [, input[_rT]],
515
- [_mE]: [() => input.messageExpiry !== void 0, () => input[_mE].toString()]
516
- });
517
- let body;
518
- if (input.payload !== void 0) {
519
- body = input.payload;
520
- }
521
- b.m("POST").h(headers).q(query).b(body);
522
- return b.build();
523
- }, "se_PublishCommand");
524
- var se_UpdateThingShadowCommand = /* @__PURE__ */ __name(async (input, context) => {
525
- const b = (0, import_core.requestBuilder)(input, context);
526
- const headers = {
527
- "content-type": "application/octet-stream"
528
- };
529
- b.bp("/things/{thingName}/shadow");
530
- b.p("thingName", () => input.thingName, "{thingName}", false);
531
- const query = (0, import_smithy_client.map)({
532
- [_n]: [, input[_sN]]
533
- });
534
- let body;
535
- if (input.payload !== void 0) {
536
- body = input.payload;
537
- }
538
- b.m("POST").h(headers).q(query).b(body);
539
- return b.build();
540
- }, "se_UpdateThingShadowCommand");
541
- var de_DeleteConnectionCommand = /* @__PURE__ */ __name(async (output, context) => {
542
- if (output.statusCode !== 200 && output.statusCode >= 300) {
543
- return de_CommandError(output, context);
544
- }
545
- const contents = (0, import_smithy_client.map)({
546
- $metadata: deserializeMetadata(output)
547
- });
548
- await (0, import_smithy_client.collectBody)(output.body, context);
549
- return contents;
550
- }, "de_DeleteConnectionCommand");
551
- var de_DeleteThingShadowCommand = /* @__PURE__ */ __name(async (output, context) => {
552
- if (output.statusCode !== 200 && output.statusCode >= 300) {
553
- return de_CommandError(output, context);
554
- }
555
- const contents = (0, import_smithy_client.map)({
556
- $metadata: deserializeMetadata(output)
557
- });
558
- const data = await (0, import_smithy_client.collectBody)(output.body, context);
559
- contents.payload = data;
560
- return contents;
561
- }, "de_DeleteThingShadowCommand");
562
- var de_GetRetainedMessageCommand = /* @__PURE__ */ __name(async (output, context) => {
563
- if (output.statusCode !== 200 && output.statusCode >= 300) {
564
- return de_CommandError(output, context);
565
- }
566
- const contents = (0, import_smithy_client.map)({
567
- $metadata: deserializeMetadata(output)
568
- });
569
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
570
- const doc = (0, import_smithy_client.take)(data, {
571
- lastModifiedTime: import_smithy_client.expectLong,
572
- payload: context.base64Decoder,
573
- qos: import_smithy_client.expectInt32,
574
- topic: import_smithy_client.expectString,
575
- userProperties: context.base64Decoder
576
- });
577
- Object.assign(contents, doc);
578
- return contents;
579
- }, "de_GetRetainedMessageCommand");
580
- var de_GetThingShadowCommand = /* @__PURE__ */ __name(async (output, context) => {
581
- if (output.statusCode !== 200 && output.statusCode >= 300) {
582
- return de_CommandError(output, context);
583
- }
584
- const contents = (0, import_smithy_client.map)({
585
- $metadata: deserializeMetadata(output)
586
- });
587
- const data = await (0, import_smithy_client.collectBody)(output.body, context);
588
- contents.payload = data;
589
- return contents;
590
- }, "de_GetThingShadowCommand");
591
- var de_ListNamedShadowsForThingCommand = /* @__PURE__ */ __name(async (output, context) => {
592
- if (output.statusCode !== 200 && output.statusCode >= 300) {
593
- return de_CommandError(output, context);
594
- }
595
- const contents = (0, import_smithy_client.map)({
596
- $metadata: deserializeMetadata(output)
597
- });
598
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
599
- const doc = (0, import_smithy_client.take)(data, {
600
- nextToken: import_smithy_client.expectString,
601
- results: import_smithy_client._json,
602
- timestamp: import_smithy_client.expectLong
603
- });
604
- Object.assign(contents, doc);
605
- return contents;
606
- }, "de_ListNamedShadowsForThingCommand");
607
- var de_ListRetainedMessagesCommand = /* @__PURE__ */ __name(async (output, context) => {
608
- if (output.statusCode !== 200 && output.statusCode >= 300) {
609
- return de_CommandError(output, context);
610
- }
611
- const contents = (0, import_smithy_client.map)({
612
- $metadata: deserializeMetadata(output)
613
- });
614
- const data = (0, import_smithy_client.expectNonNull)((0, import_smithy_client.expectObject)(await (0, import_core2.parseJsonBody)(output.body, context)), "body");
615
- const doc = (0, import_smithy_client.take)(data, {
616
- nextToken: import_smithy_client.expectString,
617
- retainedTopics: import_smithy_client._json
618
- });
619
- Object.assign(contents, doc);
620
- return contents;
621
- }, "de_ListRetainedMessagesCommand");
622
- var de_PublishCommand = /* @__PURE__ */ __name(async (output, context) => {
623
- if (output.statusCode !== 200 && output.statusCode >= 300) {
624
- return de_CommandError(output, context);
625
- }
626
- const contents = (0, import_smithy_client.map)({
627
- $metadata: deserializeMetadata(output)
628
- });
629
- await (0, import_smithy_client.collectBody)(output.body, context);
630
- return contents;
631
- }, "de_PublishCommand");
632
- var de_UpdateThingShadowCommand = /* @__PURE__ */ __name(async (output, context) => {
633
- if (output.statusCode !== 200 && output.statusCode >= 300) {
634
- return de_CommandError(output, context);
635
- }
636
- const contents = (0, import_smithy_client.map)({
637
- $metadata: deserializeMetadata(output)
638
- });
639
- const data = await (0, import_smithy_client.collectBody)(output.body, context);
640
- contents.payload = data;
641
- return contents;
642
- }, "de_UpdateThingShadowCommand");
643
- var de_CommandError = /* @__PURE__ */ __name(async (output, context) => {
644
- const parsedOutput = {
645
- ...output,
646
- body: await (0, import_core2.parseJsonErrorBody)(output.body, context)
647
- };
648
- const errorCode = (0, import_core2.loadRestJsonErrorCode)(output, parsedOutput.body);
649
- switch (errorCode) {
650
- case "ForbiddenException":
651
- case "com.amazonaws.iotdataplane#ForbiddenException":
652
- throw await de_ForbiddenExceptionRes(parsedOutput, context);
653
- case "InternalFailureException":
654
- case "com.amazonaws.iotdataplane#InternalFailureException":
655
- throw await de_InternalFailureExceptionRes(parsedOutput, context);
656
- case "InvalidRequestException":
657
- case "com.amazonaws.iotdataplane#InvalidRequestException":
658
- throw await de_InvalidRequestExceptionRes(parsedOutput, context);
659
- case "ResourceNotFoundException":
660
- case "com.amazonaws.iotdataplane#ResourceNotFoundException":
661
- throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
662
- case "ThrottlingException":
663
- case "com.amazonaws.iotdataplane#ThrottlingException":
664
- throw await de_ThrottlingExceptionRes(parsedOutput, context);
665
- case "MethodNotAllowedException":
666
- case "com.amazonaws.iotdataplane#MethodNotAllowedException":
667
- throw await de_MethodNotAllowedExceptionRes(parsedOutput, context);
668
- case "ServiceUnavailableException":
669
- case "com.amazonaws.iotdataplane#ServiceUnavailableException":
670
- throw await de_ServiceUnavailableExceptionRes(parsedOutput, context);
671
- case "UnauthorizedException":
672
- case "com.amazonaws.iotdataplane#UnauthorizedException":
673
- throw await de_UnauthorizedExceptionRes(parsedOutput, context);
674
- case "UnsupportedDocumentEncodingException":
675
- case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException":
676
- throw await de_UnsupportedDocumentEncodingExceptionRes(parsedOutput, context);
677
- case "ConflictException":
678
- case "com.amazonaws.iotdataplane#ConflictException":
679
- throw await de_ConflictExceptionRes(parsedOutput, context);
680
- case "RequestEntityTooLargeException":
681
- case "com.amazonaws.iotdataplane#RequestEntityTooLargeException":
682
- throw await de_RequestEntityTooLargeExceptionRes(parsedOutput, context);
683
- default:
684
- const parsedBody = parsedOutput.body;
685
- return throwDefaultError({
686
- output,
687
- parsedBody,
688
- errorCode
689
- });
690
- }
691
- }, "de_CommandError");
692
- var throwDefaultError = (0, import_smithy_client.withBaseException)(IoTDataPlaneServiceException);
693
- var de_ConflictExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
694
- const contents = (0, import_smithy_client.map)({});
695
- const data = parsedOutput.body;
696
- const doc = (0, import_smithy_client.take)(data, {
697
- message: import_smithy_client.expectString
698
- });
699
- Object.assign(contents, doc);
700
- const exception = new ConflictException({
701
- $metadata: deserializeMetadata(parsedOutput),
702
- ...contents
703
- });
704
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
705
- }, "de_ConflictExceptionRes");
706
- var de_ForbiddenExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
707
- const contents = (0, import_smithy_client.map)({});
708
- const data = parsedOutput.body;
709
- const doc = (0, import_smithy_client.take)(data, {
710
- message: import_smithy_client.expectString
711
- });
712
- Object.assign(contents, doc);
713
- const exception = new ForbiddenException({
714
- $metadata: deserializeMetadata(parsedOutput),
715
- ...contents
716
- });
717
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
718
- }, "de_ForbiddenExceptionRes");
719
- var de_InternalFailureExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
720
- const contents = (0, import_smithy_client.map)({});
721
- const data = parsedOutput.body;
722
- const doc = (0, import_smithy_client.take)(data, {
723
- message: import_smithy_client.expectString
724
- });
725
- Object.assign(contents, doc);
726
- const exception = new InternalFailureException({
727
- $metadata: deserializeMetadata(parsedOutput),
728
- ...contents
729
- });
730
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
731
- }, "de_InternalFailureExceptionRes");
732
- var de_InvalidRequestExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
733
- const contents = (0, import_smithy_client.map)({});
734
- const data = parsedOutput.body;
735
- const doc = (0, import_smithy_client.take)(data, {
736
- message: import_smithy_client.expectString
737
- });
738
- Object.assign(contents, doc);
739
- const exception = new InvalidRequestException({
740
- $metadata: deserializeMetadata(parsedOutput),
741
- ...contents
742
- });
743
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
744
- }, "de_InvalidRequestExceptionRes");
745
- var de_MethodNotAllowedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
746
- const contents = (0, import_smithy_client.map)({});
747
- const data = parsedOutput.body;
748
- const doc = (0, import_smithy_client.take)(data, {
749
- message: import_smithy_client.expectString
750
- });
751
- Object.assign(contents, doc);
752
- const exception = new MethodNotAllowedException({
753
- $metadata: deserializeMetadata(parsedOutput),
754
- ...contents
755
- });
756
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
757
- }, "de_MethodNotAllowedExceptionRes");
758
- var de_RequestEntityTooLargeExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
759
- const contents = (0, import_smithy_client.map)({});
760
- const data = parsedOutput.body;
761
- const doc = (0, import_smithy_client.take)(data, {
762
- message: import_smithy_client.expectString
763
- });
764
- Object.assign(contents, doc);
765
- const exception = new RequestEntityTooLargeException({
766
- $metadata: deserializeMetadata(parsedOutput),
767
- ...contents
768
- });
769
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
770
- }, "de_RequestEntityTooLargeExceptionRes");
771
- var de_ResourceNotFoundExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
772
- const contents = (0, import_smithy_client.map)({});
773
- const data = parsedOutput.body;
774
- const doc = (0, import_smithy_client.take)(data, {
775
- message: import_smithy_client.expectString
776
- });
777
- Object.assign(contents, doc);
778
- const exception = new ResourceNotFoundException({
779
- $metadata: deserializeMetadata(parsedOutput),
780
- ...contents
781
- });
782
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
783
- }, "de_ResourceNotFoundExceptionRes");
784
- var de_ServiceUnavailableExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
785
- const contents = (0, import_smithy_client.map)({});
786
- const data = parsedOutput.body;
787
- const doc = (0, import_smithy_client.take)(data, {
788
- message: import_smithy_client.expectString
789
- });
790
- Object.assign(contents, doc);
791
- const exception = new ServiceUnavailableException({
792
- $metadata: deserializeMetadata(parsedOutput),
793
- ...contents
794
- });
795
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
796
- }, "de_ServiceUnavailableExceptionRes");
797
- var de_ThrottlingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
798
- const contents = (0, import_smithy_client.map)({});
799
- const data = parsedOutput.body;
800
- const doc = (0, import_smithy_client.take)(data, {
801
- message: import_smithy_client.expectString
802
- });
803
- Object.assign(contents, doc);
804
- const exception = new ThrottlingException({
805
- $metadata: deserializeMetadata(parsedOutput),
806
- ...contents
807
- });
808
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
809
- }, "de_ThrottlingExceptionRes");
810
- var de_UnauthorizedExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
811
- const contents = (0, import_smithy_client.map)({});
812
- const data = parsedOutput.body;
813
- const doc = (0, import_smithy_client.take)(data, {
814
- message: import_smithy_client.expectString
815
- });
816
- Object.assign(contents, doc);
817
- const exception = new UnauthorizedException({
818
- $metadata: deserializeMetadata(parsedOutput),
819
- ...contents
820
- });
821
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
822
- }, "de_UnauthorizedExceptionRes");
823
- var de_UnsupportedDocumentEncodingExceptionRes = /* @__PURE__ */ __name(async (parsedOutput, context) => {
824
- const contents = (0, import_smithy_client.map)({});
825
- const data = parsedOutput.body;
826
- const doc = (0, import_smithy_client.take)(data, {
827
- message: import_smithy_client.expectString
828
- });
829
- Object.assign(contents, doc);
830
- const exception = new UnsupportedDocumentEncodingException({
831
- $metadata: deserializeMetadata(parsedOutput),
832
- ...contents
833
- });
834
- return (0, import_smithy_client.decorateServiceException)(exception, parsedOutput.body);
835
- }, "de_UnsupportedDocumentEncodingExceptionRes");
836
- var deserializeMetadata = /* @__PURE__ */ __name((output) => ({
837
- httpStatusCode: output.statusCode,
838
- requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
839
- extendedRequestId: output.headers["x-amz-id-2"],
840
- cfId: output.headers["x-amz-cf-id"]
841
- }), "deserializeMetadata");
842
- var _cD = "correlationData";
843
- var _cS = "cleanSession";
844
- var _cT = "contentType";
845
- var _mE = "messageExpiry";
846
- var _mR = "maxResults";
847
- var _n = "name";
848
- var _nT = "nextToken";
849
- var _pFI = "payloadFormatIndicator";
850
- var _pS = "pageSize";
851
- var _pWM = "preventWillMessage";
852
- var _q = "qos";
853
- var _r = "retain";
854
- var _rT = "responseTopic";
855
- var _sN = "shadowName";
856
- var _uP = "userProperties";
857
- var _xamcd = "x-amz-mqtt5-correlation-data";
858
- var _xampfi = "x-amz-mqtt5-payload-format-indicator";
859
- var _xamup = "x-amz-mqtt5-user-properties";
860
-
861
- // src/commands/DeleteConnectionCommand.ts
862
- var DeleteConnectionCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
863
- return [
864
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
865
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
866
- ];
867
- }).s("IotMoonrakerService", "DeleteConnection", {}).n("IoTDataPlaneClient", "DeleteConnectionCommand").f(void 0, void 0).ser(se_DeleteConnectionCommand).de(de_DeleteConnectionCommand).build() {
868
- static {
869
- __name(this, "DeleteConnectionCommand");
870
- }
453
+ const de_PublishCommand = async (output, context) => {
454
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
455
+ return de_CommandError(output, context);
456
+ }
457
+ const contents = smithyClient.map({
458
+ $metadata: deserializeMetadata(output),
459
+ });
460
+ await smithyClient.collectBody(output.body, context);
461
+ return contents;
871
462
  };
872
-
873
- // src/commands/DeleteThingShadowCommand.ts
874
-
875
-
876
-
877
- var DeleteThingShadowCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
878
- return [
879
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
880
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
881
- ];
882
- }).s("IotMoonrakerService", "DeleteThingShadow", {}).n("IoTDataPlaneClient", "DeleteThingShadowCommand").f(void 0, void 0).ser(se_DeleteThingShadowCommand).de(de_DeleteThingShadowCommand).build() {
883
- static {
884
- __name(this, "DeleteThingShadowCommand");
885
- }
463
+ const de_UpdateThingShadowCommand = async (output, context) => {
464
+ if (output.statusCode !== 200 && output.statusCode >= 300) {
465
+ return de_CommandError(output, context);
466
+ }
467
+ const contents = smithyClient.map({
468
+ $metadata: deserializeMetadata(output),
469
+ });
470
+ const data = await smithyClient.collectBody(output.body, context);
471
+ contents.payload = data;
472
+ return contents;
886
473
  };
887
-
888
- // src/commands/GetRetainedMessageCommand.ts
889
-
890
-
891
-
892
- var GetRetainedMessageCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
893
- return [
894
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
895
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
896
- ];
897
- }).s("IotMoonrakerService", "GetRetainedMessage", {}).n("IoTDataPlaneClient", "GetRetainedMessageCommand").f(void 0, void 0).ser(se_GetRetainedMessageCommand).de(de_GetRetainedMessageCommand).build() {
898
- static {
899
- __name(this, "GetRetainedMessageCommand");
900
- }
474
+ const de_CommandError = async (output, context) => {
475
+ const parsedOutput = {
476
+ ...output,
477
+ body: await core$1.parseJsonErrorBody(output.body, context),
478
+ };
479
+ const errorCode = core$1.loadRestJsonErrorCode(output, parsedOutput.body);
480
+ switch (errorCode) {
481
+ case "ForbiddenException":
482
+ case "com.amazonaws.iotdataplane#ForbiddenException":
483
+ throw await de_ForbiddenExceptionRes(parsedOutput);
484
+ case "InternalFailureException":
485
+ case "com.amazonaws.iotdataplane#InternalFailureException":
486
+ throw await de_InternalFailureExceptionRes(parsedOutput);
487
+ case "InvalidRequestException":
488
+ case "com.amazonaws.iotdataplane#InvalidRequestException":
489
+ throw await de_InvalidRequestExceptionRes(parsedOutput);
490
+ case "ResourceNotFoundException":
491
+ case "com.amazonaws.iotdataplane#ResourceNotFoundException":
492
+ throw await de_ResourceNotFoundExceptionRes(parsedOutput);
493
+ case "ThrottlingException":
494
+ case "com.amazonaws.iotdataplane#ThrottlingException":
495
+ throw await de_ThrottlingExceptionRes(parsedOutput);
496
+ case "MethodNotAllowedException":
497
+ case "com.amazonaws.iotdataplane#MethodNotAllowedException":
498
+ throw await de_MethodNotAllowedExceptionRes(parsedOutput);
499
+ case "ServiceUnavailableException":
500
+ case "com.amazonaws.iotdataplane#ServiceUnavailableException":
501
+ throw await de_ServiceUnavailableExceptionRes(parsedOutput);
502
+ case "UnauthorizedException":
503
+ case "com.amazonaws.iotdataplane#UnauthorizedException":
504
+ throw await de_UnauthorizedExceptionRes(parsedOutput);
505
+ case "UnsupportedDocumentEncodingException":
506
+ case "com.amazonaws.iotdataplane#UnsupportedDocumentEncodingException":
507
+ throw await de_UnsupportedDocumentEncodingExceptionRes(parsedOutput);
508
+ case "ConflictException":
509
+ case "com.amazonaws.iotdataplane#ConflictException":
510
+ throw await de_ConflictExceptionRes(parsedOutput);
511
+ case "RequestEntityTooLargeException":
512
+ case "com.amazonaws.iotdataplane#RequestEntityTooLargeException":
513
+ throw await de_RequestEntityTooLargeExceptionRes(parsedOutput);
514
+ default:
515
+ const parsedBody = parsedOutput.body;
516
+ return throwDefaultError({
517
+ output,
518
+ parsedBody,
519
+ errorCode,
520
+ });
521
+ }
901
522
  };
902
-
903
- // src/commands/GetThingShadowCommand.ts
904
-
905
-
906
-
907
- var GetThingShadowCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
908
- return [
909
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
910
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
911
- ];
912
- }).s("IotMoonrakerService", "GetThingShadow", {}).n("IoTDataPlaneClient", "GetThingShadowCommand").f(void 0, void 0).ser(se_GetThingShadowCommand).de(de_GetThingShadowCommand).build() {
913
- static {
914
- __name(this, "GetThingShadowCommand");
915
- }
523
+ const throwDefaultError = smithyClient.withBaseException(IoTDataPlaneServiceException);
524
+ const de_ConflictExceptionRes = async (parsedOutput, context) => {
525
+ const contents = smithyClient.map({});
526
+ const data = parsedOutput.body;
527
+ const doc = smithyClient.take(data, {
528
+ message: smithyClient.expectString,
529
+ });
530
+ Object.assign(contents, doc);
531
+ const exception = new ConflictException({
532
+ $metadata: deserializeMetadata(parsedOutput),
533
+ ...contents,
534
+ });
535
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
916
536
  };
917
-
918
- // src/commands/ListNamedShadowsForThingCommand.ts
919
-
920
-
921
-
922
- var ListNamedShadowsForThingCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
923
- return [
924
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
925
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
926
- ];
927
- }).s("IotMoonrakerService", "ListNamedShadowsForThing", {}).n("IoTDataPlaneClient", "ListNamedShadowsForThingCommand").f(void 0, void 0).ser(se_ListNamedShadowsForThingCommand).de(de_ListNamedShadowsForThingCommand).build() {
928
- static {
929
- __name(this, "ListNamedShadowsForThingCommand");
930
- }
537
+ const de_ForbiddenExceptionRes = async (parsedOutput, context) => {
538
+ const contents = smithyClient.map({});
539
+ const data = parsedOutput.body;
540
+ const doc = smithyClient.take(data, {
541
+ message: smithyClient.expectString,
542
+ });
543
+ Object.assign(contents, doc);
544
+ const exception = new ForbiddenException({
545
+ $metadata: deserializeMetadata(parsedOutput),
546
+ ...contents,
547
+ });
548
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
931
549
  };
932
-
933
- // src/commands/ListRetainedMessagesCommand.ts
934
-
935
-
936
-
937
- var ListRetainedMessagesCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
938
- return [
939
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
940
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
941
- ];
942
- }).s("IotMoonrakerService", "ListRetainedMessages", {}).n("IoTDataPlaneClient", "ListRetainedMessagesCommand").f(void 0, void 0).ser(se_ListRetainedMessagesCommand).de(de_ListRetainedMessagesCommand).build() {
943
- static {
944
- __name(this, "ListRetainedMessagesCommand");
945
- }
550
+ const de_InternalFailureExceptionRes = async (parsedOutput, context) => {
551
+ const contents = smithyClient.map({});
552
+ const data = parsedOutput.body;
553
+ const doc = smithyClient.take(data, {
554
+ message: smithyClient.expectString,
555
+ });
556
+ Object.assign(contents, doc);
557
+ const exception = new InternalFailureException({
558
+ $metadata: deserializeMetadata(parsedOutput),
559
+ ...contents,
560
+ });
561
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
946
562
  };
947
-
948
- // src/commands/PublishCommand.ts
949
-
950
-
951
-
952
- var PublishCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
953
- return [
954
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
955
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
956
- ];
957
- }).s("IotMoonrakerService", "Publish", {}).n("IoTDataPlaneClient", "PublishCommand").f(void 0, void 0).ser(se_PublishCommand).de(de_PublishCommand).build() {
958
- static {
959
- __name(this, "PublishCommand");
960
- }
563
+ const de_InvalidRequestExceptionRes = async (parsedOutput, context) => {
564
+ const contents = smithyClient.map({});
565
+ const data = parsedOutput.body;
566
+ const doc = smithyClient.take(data, {
567
+ message: smithyClient.expectString,
568
+ });
569
+ Object.assign(contents, doc);
570
+ const exception = new InvalidRequestException({
571
+ $metadata: deserializeMetadata(parsedOutput),
572
+ ...contents,
573
+ });
574
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
961
575
  };
962
-
963
- // src/commands/UpdateThingShadowCommand.ts
964
-
965
-
966
-
967
- var UpdateThingShadowCommand = class extends import_smithy_client.Command.classBuilder().ep(commonParams).m(function(Command, cs, config, o) {
968
- return [
969
- (0, import_middleware_serde.getSerdePlugin)(config, this.serialize, this.deserialize),
970
- (0, import_middleware_endpoint.getEndpointPlugin)(config, Command.getEndpointParameterInstructions())
971
- ];
972
- }).s("IotMoonrakerService", "UpdateThingShadow", {}).n("IoTDataPlaneClient", "UpdateThingShadowCommand").f(void 0, void 0).ser(se_UpdateThingShadowCommand).de(de_UpdateThingShadowCommand).build() {
973
- static {
974
- __name(this, "UpdateThingShadowCommand");
975
- }
576
+ const de_MethodNotAllowedExceptionRes = async (parsedOutput, context) => {
577
+ const contents = smithyClient.map({});
578
+ const data = parsedOutput.body;
579
+ const doc = smithyClient.take(data, {
580
+ message: smithyClient.expectString,
581
+ });
582
+ Object.assign(contents, doc);
583
+ const exception = new MethodNotAllowedException({
584
+ $metadata: deserializeMetadata(parsedOutput),
585
+ ...contents,
586
+ });
587
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
976
588
  };
977
-
978
- // src/IoTDataPlane.ts
979
- var commands = {
980
- DeleteConnectionCommand,
981
- DeleteThingShadowCommand,
982
- GetRetainedMessageCommand,
983
- GetThingShadowCommand,
984
- ListNamedShadowsForThingCommand,
985
- ListRetainedMessagesCommand,
986
- PublishCommand,
987
- UpdateThingShadowCommand
589
+ const de_RequestEntityTooLargeExceptionRes = async (parsedOutput, context) => {
590
+ const contents = smithyClient.map({});
591
+ const data = parsedOutput.body;
592
+ const doc = smithyClient.take(data, {
593
+ message: smithyClient.expectString,
594
+ });
595
+ Object.assign(contents, doc);
596
+ const exception = new RequestEntityTooLargeException({
597
+ $metadata: deserializeMetadata(parsedOutput),
598
+ ...contents,
599
+ });
600
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
988
601
  };
989
- var IoTDataPlane = class extends IoTDataPlaneClient {
990
- static {
991
- __name(this, "IoTDataPlane");
992
- }
602
+ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
603
+ const contents = smithyClient.map({});
604
+ const data = parsedOutput.body;
605
+ const doc = smithyClient.take(data, {
606
+ message: smithyClient.expectString,
607
+ });
608
+ Object.assign(contents, doc);
609
+ const exception = new ResourceNotFoundException({
610
+ $metadata: deserializeMetadata(parsedOutput),
611
+ ...contents,
612
+ });
613
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
993
614
  };
994
- (0, import_smithy_client.createAggregatedClient)(commands, IoTDataPlane);
995
-
996
- // src/pagination/ListRetainedMessagesPaginator.ts
615
+ const de_ServiceUnavailableExceptionRes = async (parsedOutput, context) => {
616
+ const contents = smithyClient.map({});
617
+ const data = parsedOutput.body;
618
+ const doc = smithyClient.take(data, {
619
+ message: smithyClient.expectString,
620
+ });
621
+ Object.assign(contents, doc);
622
+ const exception = new ServiceUnavailableException({
623
+ $metadata: deserializeMetadata(parsedOutput),
624
+ ...contents,
625
+ });
626
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
627
+ };
628
+ const de_ThrottlingExceptionRes = async (parsedOutput, context) => {
629
+ const contents = smithyClient.map({});
630
+ const data = parsedOutput.body;
631
+ const doc = smithyClient.take(data, {
632
+ message: smithyClient.expectString,
633
+ });
634
+ Object.assign(contents, doc);
635
+ const exception = new ThrottlingException({
636
+ $metadata: deserializeMetadata(parsedOutput),
637
+ ...contents,
638
+ });
639
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
640
+ };
641
+ const de_UnauthorizedExceptionRes = async (parsedOutput, context) => {
642
+ const contents = smithyClient.map({});
643
+ const data = parsedOutput.body;
644
+ const doc = smithyClient.take(data, {
645
+ message: smithyClient.expectString,
646
+ });
647
+ Object.assign(contents, doc);
648
+ const exception = new UnauthorizedException({
649
+ $metadata: deserializeMetadata(parsedOutput),
650
+ ...contents,
651
+ });
652
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
653
+ };
654
+ const de_UnsupportedDocumentEncodingExceptionRes = async (parsedOutput, context) => {
655
+ const contents = smithyClient.map({});
656
+ const data = parsedOutput.body;
657
+ const doc = smithyClient.take(data, {
658
+ message: smithyClient.expectString,
659
+ });
660
+ Object.assign(contents, doc);
661
+ const exception = new UnsupportedDocumentEncodingException({
662
+ $metadata: deserializeMetadata(parsedOutput),
663
+ ...contents,
664
+ });
665
+ return smithyClient.decorateServiceException(exception, parsedOutput.body);
666
+ };
667
+ const deserializeMetadata = (output) => ({
668
+ httpStatusCode: output.statusCode,
669
+ requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
670
+ extendedRequestId: output.headers["x-amz-id-2"],
671
+ cfId: output.headers["x-amz-cf-id"],
672
+ });
673
+ const _cD = "correlationData";
674
+ const _cS = "cleanSession";
675
+ const _cT = "contentType";
676
+ const _mE = "messageExpiry";
677
+ const _mR = "maxResults";
678
+ const _n = "name";
679
+ const _nT = "nextToken";
680
+ const _pFI = "payloadFormatIndicator";
681
+ const _pS = "pageSize";
682
+ const _pWM = "preventWillMessage";
683
+ const _q = "qos";
684
+ const _r = "retain";
685
+ const _rT = "responseTopic";
686
+ const _sN = "shadowName";
687
+ const _uP = "userProperties";
688
+ const _xamcd = "x-amz-mqtt5-correlation-data";
689
+ const _xampfi = "x-amz-mqtt5-payload-format-indicator";
690
+ const _xamup = "x-amz-mqtt5-user-properties";
691
+
692
+ class DeleteConnectionCommand extends smithyClient.Command
693
+ .classBuilder()
694
+ .ep(commonParams)
695
+ .m(function (Command, cs, config, o) {
696
+ return [
697
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
698
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
699
+ ];
700
+ })
701
+ .s("IotMoonrakerService", "DeleteConnection", {})
702
+ .n("IoTDataPlaneClient", "DeleteConnectionCommand")
703
+ .f(void 0, void 0)
704
+ .ser(se_DeleteConnectionCommand)
705
+ .de(de_DeleteConnectionCommand)
706
+ .build() {
707
+ }
708
+
709
+ class DeleteThingShadowCommand extends smithyClient.Command
710
+ .classBuilder()
711
+ .ep(commonParams)
712
+ .m(function (Command, cs, config, o) {
713
+ return [
714
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
715
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
716
+ ];
717
+ })
718
+ .s("IotMoonrakerService", "DeleteThingShadow", {})
719
+ .n("IoTDataPlaneClient", "DeleteThingShadowCommand")
720
+ .f(void 0, void 0)
721
+ .ser(se_DeleteThingShadowCommand)
722
+ .de(de_DeleteThingShadowCommand)
723
+ .build() {
724
+ }
725
+
726
+ class GetRetainedMessageCommand extends smithyClient.Command
727
+ .classBuilder()
728
+ .ep(commonParams)
729
+ .m(function (Command, cs, config, o) {
730
+ return [
731
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
732
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
733
+ ];
734
+ })
735
+ .s("IotMoonrakerService", "GetRetainedMessage", {})
736
+ .n("IoTDataPlaneClient", "GetRetainedMessageCommand")
737
+ .f(void 0, void 0)
738
+ .ser(se_GetRetainedMessageCommand)
739
+ .de(de_GetRetainedMessageCommand)
740
+ .build() {
741
+ }
742
+
743
+ class GetThingShadowCommand extends smithyClient.Command
744
+ .classBuilder()
745
+ .ep(commonParams)
746
+ .m(function (Command, cs, config, o) {
747
+ return [
748
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
749
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
750
+ ];
751
+ })
752
+ .s("IotMoonrakerService", "GetThingShadow", {})
753
+ .n("IoTDataPlaneClient", "GetThingShadowCommand")
754
+ .f(void 0, void 0)
755
+ .ser(se_GetThingShadowCommand)
756
+ .de(de_GetThingShadowCommand)
757
+ .build() {
758
+ }
759
+
760
+ class ListNamedShadowsForThingCommand extends smithyClient.Command
761
+ .classBuilder()
762
+ .ep(commonParams)
763
+ .m(function (Command, cs, config, o) {
764
+ return [
765
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
766
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
767
+ ];
768
+ })
769
+ .s("IotMoonrakerService", "ListNamedShadowsForThing", {})
770
+ .n("IoTDataPlaneClient", "ListNamedShadowsForThingCommand")
771
+ .f(void 0, void 0)
772
+ .ser(se_ListNamedShadowsForThingCommand)
773
+ .de(de_ListNamedShadowsForThingCommand)
774
+ .build() {
775
+ }
776
+
777
+ class ListRetainedMessagesCommand extends smithyClient.Command
778
+ .classBuilder()
779
+ .ep(commonParams)
780
+ .m(function (Command, cs, config, o) {
781
+ return [
782
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
783
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
784
+ ];
785
+ })
786
+ .s("IotMoonrakerService", "ListRetainedMessages", {})
787
+ .n("IoTDataPlaneClient", "ListRetainedMessagesCommand")
788
+ .f(void 0, void 0)
789
+ .ser(se_ListRetainedMessagesCommand)
790
+ .de(de_ListRetainedMessagesCommand)
791
+ .build() {
792
+ }
793
+
794
+ class PublishCommand extends smithyClient.Command
795
+ .classBuilder()
796
+ .ep(commonParams)
797
+ .m(function (Command, cs, config, o) {
798
+ return [
799
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
800
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
801
+ ];
802
+ })
803
+ .s("IotMoonrakerService", "Publish", {})
804
+ .n("IoTDataPlaneClient", "PublishCommand")
805
+ .f(void 0, void 0)
806
+ .ser(se_PublishCommand)
807
+ .de(de_PublishCommand)
808
+ .build() {
809
+ }
810
+
811
+ class UpdateThingShadowCommand extends smithyClient.Command
812
+ .classBuilder()
813
+ .ep(commonParams)
814
+ .m(function (Command, cs, config, o) {
815
+ return [
816
+ middlewareSerde.getSerdePlugin(config, this.serialize, this.deserialize),
817
+ middlewareEndpoint.getEndpointPlugin(config, Command.getEndpointParameterInstructions()),
818
+ ];
819
+ })
820
+ .s("IotMoonrakerService", "UpdateThingShadow", {})
821
+ .n("IoTDataPlaneClient", "UpdateThingShadowCommand")
822
+ .f(void 0, void 0)
823
+ .ser(se_UpdateThingShadowCommand)
824
+ .de(de_UpdateThingShadowCommand)
825
+ .build() {
826
+ }
827
+
828
+ const commands = {
829
+ DeleteConnectionCommand,
830
+ DeleteThingShadowCommand,
831
+ GetRetainedMessageCommand,
832
+ GetThingShadowCommand,
833
+ ListNamedShadowsForThingCommand,
834
+ ListRetainedMessagesCommand,
835
+ PublishCommand,
836
+ UpdateThingShadowCommand,
837
+ };
838
+ class IoTDataPlane extends IoTDataPlaneClient {
839
+ }
840
+ smithyClient.createAggregatedClient(commands, IoTDataPlane);
997
841
 
998
- var paginateListRetainedMessages = (0, import_core.createPaginator)(IoTDataPlaneClient, ListRetainedMessagesCommand, "nextToken", "nextToken", "maxResults");
999
- // Annotate the CommonJS export names for ESM import in node:
842
+ const paginateListRetainedMessages = core.createPaginator(IoTDataPlaneClient, ListRetainedMessagesCommand, "nextToken", "nextToken", "maxResults");
1000
843
 
1001
- 0 && (module.exports = {
1002
- IoTDataPlaneServiceException,
1003
- __Client,
1004
- IoTDataPlaneClient,
1005
- IoTDataPlane,
1006
- $Command,
1007
- DeleteConnectionCommand,
1008
- DeleteThingShadowCommand,
1009
- GetRetainedMessageCommand,
1010
- GetThingShadowCommand,
1011
- ListNamedShadowsForThingCommand,
1012
- ListRetainedMessagesCommand,
1013
- PublishCommand,
1014
- UpdateThingShadowCommand,
1015
- paginateListRetainedMessages,
1016
- ConflictException,
1017
- ForbiddenException,
1018
- InternalFailureException,
1019
- InvalidRequestException,
1020
- ResourceNotFoundException,
1021
- ThrottlingException,
1022
- MethodNotAllowedException,
1023
- ServiceUnavailableException,
1024
- UnauthorizedException,
1025
- UnsupportedDocumentEncodingException,
1026
- PayloadFormatIndicator,
1027
- RequestEntityTooLargeException
844
+ Object.defineProperty(exports, "$Command", {
845
+ enumerable: true,
846
+ get: function () { return smithyClient.Command; }
1028
847
  });
1029
-
848
+ Object.defineProperty(exports, "__Client", {
849
+ enumerable: true,
850
+ get: function () { return smithyClient.Client; }
851
+ });
852
+ exports.ConflictException = ConflictException;
853
+ exports.DeleteConnectionCommand = DeleteConnectionCommand;
854
+ exports.DeleteThingShadowCommand = DeleteThingShadowCommand;
855
+ exports.ForbiddenException = ForbiddenException;
856
+ exports.GetRetainedMessageCommand = GetRetainedMessageCommand;
857
+ exports.GetThingShadowCommand = GetThingShadowCommand;
858
+ exports.InternalFailureException = InternalFailureException;
859
+ exports.InvalidRequestException = InvalidRequestException;
860
+ exports.IoTDataPlane = IoTDataPlane;
861
+ exports.IoTDataPlaneClient = IoTDataPlaneClient;
862
+ exports.IoTDataPlaneServiceException = IoTDataPlaneServiceException;
863
+ exports.ListNamedShadowsForThingCommand = ListNamedShadowsForThingCommand;
864
+ exports.ListRetainedMessagesCommand = ListRetainedMessagesCommand;
865
+ exports.MethodNotAllowedException = MethodNotAllowedException;
866
+ exports.PayloadFormatIndicator = PayloadFormatIndicator;
867
+ exports.PublishCommand = PublishCommand;
868
+ exports.RequestEntityTooLargeException = RequestEntityTooLargeException;
869
+ exports.ResourceNotFoundException = ResourceNotFoundException;
870
+ exports.ServiceUnavailableException = ServiceUnavailableException;
871
+ exports.ThrottlingException = ThrottlingException;
872
+ exports.UnauthorizedException = UnauthorizedException;
873
+ exports.UnsupportedDocumentEncodingException = UnsupportedDocumentEncodingException;
874
+ exports.UpdateThingShadowCommand = UpdateThingShadowCommand;
875
+ exports.paginateListRetainedMessages = paginateListRetainedMessages;