@aws-sdk/client-kafkaconnect 3.141.0 → 3.150.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.
@@ -98,19 +98,10 @@ const serializeAws_restJson1DeleteConnectorCommand = async (input, context) => {
98
98
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
99
99
  const headers = {};
100
100
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
101
- if (input.connectorArn !== undefined) {
102
- const labelValue = input.connectorArn;
103
- if (labelValue.length <= 0) {
104
- throw new Error("Empty value provided for input HTTP label: connectorArn.");
105
- }
106
- resolvedPath = resolvedPath.replace("{connectorArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
107
- }
108
- else {
109
- throw new Error("No value provided for input HTTP label: connectorArn.");
110
- }
111
- const query = {
112
- ...(input.currentVersion !== undefined && { currentVersion: input.currentVersion }),
113
- };
101
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
102
+ const query = map({
103
+ currentVersion: [, input.currentVersion],
104
+ });
114
105
  let body;
115
106
  return new protocol_http_1.HttpRequest({
116
107
  protocol,
@@ -128,16 +119,7 @@ const serializeAws_restJson1DeleteCustomPluginCommand = async (input, context) =
128
119
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
129
120
  const headers = {};
130
121
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins/{customPluginArn}";
131
- if (input.customPluginArn !== undefined) {
132
- const labelValue = input.customPluginArn;
133
- if (labelValue.length <= 0) {
134
- throw new Error("Empty value provided for input HTTP label: customPluginArn.");
135
- }
136
- resolvedPath = resolvedPath.replace("{customPluginArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
137
- }
138
- else {
139
- throw new Error("No value provided for input HTTP label: customPluginArn.");
140
- }
122
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
141
123
  let body;
142
124
  return new protocol_http_1.HttpRequest({
143
125
  protocol,
@@ -154,16 +136,7 @@ const serializeAws_restJson1DescribeConnectorCommand = async (input, context) =>
154
136
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
155
137
  const headers = {};
156
138
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
157
- if (input.connectorArn !== undefined) {
158
- const labelValue = input.connectorArn;
159
- if (labelValue.length <= 0) {
160
- throw new Error("Empty value provided for input HTTP label: connectorArn.");
161
- }
162
- resolvedPath = resolvedPath.replace("{connectorArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
163
- }
164
- else {
165
- throw new Error("No value provided for input HTTP label: connectorArn.");
166
- }
139
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
167
140
  let body;
168
141
  return new protocol_http_1.HttpRequest({
169
142
  protocol,
@@ -180,16 +153,7 @@ const serializeAws_restJson1DescribeCustomPluginCommand = async (input, context)
180
153
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
181
154
  const headers = {};
182
155
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins/{customPluginArn}";
183
- if (input.customPluginArn !== undefined) {
184
- const labelValue = input.customPluginArn;
185
- if (labelValue.length <= 0) {
186
- throw new Error("Empty value provided for input HTTP label: customPluginArn.");
187
- }
188
- resolvedPath = resolvedPath.replace("{customPluginArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
189
- }
190
- else {
191
- throw new Error("No value provided for input HTTP label: customPluginArn.");
192
- }
156
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "customPluginArn", () => input.customPluginArn, "{customPluginArn}", false);
193
157
  let body;
194
158
  return new protocol_http_1.HttpRequest({
195
159
  protocol,
@@ -207,16 +171,7 @@ const serializeAws_restJson1DescribeWorkerConfigurationCommand = async (input, c
207
171
  const headers = {};
208
172
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` +
209
173
  "/v1/worker-configurations/{workerConfigurationArn}";
210
- if (input.workerConfigurationArn !== undefined) {
211
- const labelValue = input.workerConfigurationArn;
212
- if (labelValue.length <= 0) {
213
- throw new Error("Empty value provided for input HTTP label: workerConfigurationArn.");
214
- }
215
- resolvedPath = resolvedPath.replace("{workerConfigurationArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
216
- }
217
- else {
218
- throw new Error("No value provided for input HTTP label: workerConfigurationArn.");
219
- }
174
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "workerConfigurationArn", () => input.workerConfigurationArn, "{workerConfigurationArn}", false);
220
175
  let body;
221
176
  return new protocol_http_1.HttpRequest({
222
177
  protocol,
@@ -233,11 +188,11 @@ const serializeAws_restJson1ListConnectorsCommand = async (input, context) => {
233
188
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
234
189
  const headers = {};
235
190
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors";
236
- const query = {
237
- ...(input.connectorNamePrefix !== undefined && { connectorNamePrefix: input.connectorNamePrefix }),
238
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
239
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
240
- };
191
+ const query = map({
192
+ connectorNamePrefix: [, input.connectorNamePrefix],
193
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
194
+ nextToken: [, input.nextToken],
195
+ });
241
196
  let body;
242
197
  return new protocol_http_1.HttpRequest({
243
198
  protocol,
@@ -255,10 +210,10 @@ const serializeAws_restJson1ListCustomPluginsCommand = async (input, context) =>
255
210
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
256
211
  const headers = {};
257
212
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/custom-plugins";
258
- const query = {
259
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
260
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
261
- };
213
+ const query = map({
214
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
215
+ nextToken: [, input.nextToken],
216
+ });
262
217
  let body;
263
218
  return new protocol_http_1.HttpRequest({
264
219
  protocol,
@@ -276,10 +231,10 @@ const serializeAws_restJson1ListWorkerConfigurationsCommand = async (input, cont
276
231
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
277
232
  const headers = {};
278
233
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/worker-configurations";
279
- const query = {
280
- ...(input.maxResults !== undefined && { maxResults: input.maxResults.toString() }),
281
- ...(input.nextToken !== undefined && { nextToken: input.nextToken }),
282
- };
234
+ const query = map({
235
+ maxResults: [() => input.maxResults !== void 0, () => input.maxResults.toString()],
236
+ nextToken: [, input.nextToken],
237
+ });
283
238
  let body;
284
239
  return new protocol_http_1.HttpRequest({
285
240
  protocol,
@@ -299,19 +254,10 @@ const serializeAws_restJson1UpdateConnectorCommand = async (input, context) => {
299
254
  "content-type": "application/json",
300
255
  };
301
256
  let resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/connectors/{connectorArn}";
302
- if (input.connectorArn !== undefined) {
303
- const labelValue = input.connectorArn;
304
- if (labelValue.length <= 0) {
305
- throw new Error("Empty value provided for input HTTP label: connectorArn.");
306
- }
307
- resolvedPath = resolvedPath.replace("{connectorArn}", (0, smithy_client_1.extendedEncodeURIComponent)(labelValue));
308
- }
309
- else {
310
- throw new Error("No value provided for input HTTP label: connectorArn.");
311
- }
312
- const query = {
313
- ...(input.currentVersion !== undefined && { currentVersion: input.currentVersion }),
314
- };
257
+ resolvedPath = (0, smithy_client_1.resolvedPath)(resolvedPath, input, "connectorArn", () => input.connectorArn, "{connectorArn}", false);
258
+ const query = map({
259
+ currentVersion: [, input.currentVersion],
260
+ });
315
261
  let body;
316
262
  body = JSON.stringify({
317
263
  ...(input.capacity != null && { capacity: serializeAws_restJson1CapacityUpdate(input.capacity, context) }),
@@ -332,23 +278,20 @@ const deserializeAws_restJson1CreateConnectorCommand = async (output, context) =
332
278
  if (output.statusCode !== 200 && output.statusCode >= 300) {
333
279
  return deserializeAws_restJson1CreateConnectorCommandError(output, context);
334
280
  }
335
- const contents = {
281
+ const contents = map({
336
282
  $metadata: deserializeMetadata(output),
337
- connectorArn: undefined,
338
- connectorName: undefined,
339
- connectorState: undefined,
340
- };
283
+ });
341
284
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
342
- if (data.connectorArn !== undefined && data.connectorArn !== null) {
285
+ if (data.connectorArn != null) {
343
286
  contents.connectorArn = (0, smithy_client_1.expectString)(data.connectorArn);
344
287
  }
345
- if (data.connectorName !== undefined && data.connectorName !== null) {
288
+ if (data.connectorName != null) {
346
289
  contents.connectorName = (0, smithy_client_1.expectString)(data.connectorName);
347
290
  }
348
- if (data.connectorState !== undefined && data.connectorState !== null) {
291
+ if (data.connectorState != null) {
349
292
  contents.connectorState = (0, smithy_client_1.expectString)(data.connectorState);
350
293
  }
351
- return Promise.resolve(contents);
294
+ return contents;
352
295
  };
353
296
  exports.deserializeAws_restJson1CreateConnectorCommand = deserializeAws_restJson1CreateConnectorCommand;
354
297
  const deserializeAws_restJson1CreateConnectorCommandError = async (output, context) => {
@@ -356,7 +299,6 @@ const deserializeAws_restJson1CreateConnectorCommandError = async (output, conte
356
299
  ...output,
357
300
  body: await parseBody(output.body, context),
358
301
  };
359
- let response;
360
302
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
361
303
  switch (errorCode) {
362
304
  case "BadRequestException":
@@ -385,41 +327,35 @@ const deserializeAws_restJson1CreateConnectorCommandError = async (output, conte
385
327
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
386
328
  default:
387
329
  const parsedBody = parsedOutput.body;
388
- const $metadata = deserializeMetadata(output);
389
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
390
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
391
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
392
- $fault: "client",
393
- $metadata,
330
+ (0, smithy_client_1.throwDefaultError)({
331
+ output,
332
+ parsedBody,
333
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
334
+ errorCode,
394
335
  });
395
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
396
336
  }
397
337
  };
398
338
  const deserializeAws_restJson1CreateCustomPluginCommand = async (output, context) => {
399
339
  if (output.statusCode !== 200 && output.statusCode >= 300) {
400
340
  return deserializeAws_restJson1CreateCustomPluginCommandError(output, context);
401
341
  }
402
- const contents = {
342
+ const contents = map({
403
343
  $metadata: deserializeMetadata(output),
404
- customPluginArn: undefined,
405
- customPluginState: undefined,
406
- name: undefined,
407
- revision: undefined,
408
- };
344
+ });
409
345
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
410
- if (data.customPluginArn !== undefined && data.customPluginArn !== null) {
346
+ if (data.customPluginArn != null) {
411
347
  contents.customPluginArn = (0, smithy_client_1.expectString)(data.customPluginArn);
412
348
  }
413
- if (data.customPluginState !== undefined && data.customPluginState !== null) {
349
+ if (data.customPluginState != null) {
414
350
  contents.customPluginState = (0, smithy_client_1.expectString)(data.customPluginState);
415
351
  }
416
- if (data.name !== undefined && data.name !== null) {
352
+ if (data.name != null) {
417
353
  contents.name = (0, smithy_client_1.expectString)(data.name);
418
354
  }
419
- if (data.revision !== undefined && data.revision !== null) {
355
+ if (data.revision != null) {
420
356
  contents.revision = (0, smithy_client_1.expectLong)(data.revision);
421
357
  }
422
- return Promise.resolve(contents);
358
+ return contents;
423
359
  };
424
360
  exports.deserializeAws_restJson1CreateCustomPluginCommand = deserializeAws_restJson1CreateCustomPluginCommand;
425
361
  const deserializeAws_restJson1CreateCustomPluginCommandError = async (output, context) => {
@@ -427,7 +363,6 @@ const deserializeAws_restJson1CreateCustomPluginCommandError = async (output, co
427
363
  ...output,
428
364
  body: await parseBody(output.body, context),
429
365
  };
430
- let response;
431
366
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
432
367
  switch (errorCode) {
433
368
  case "BadRequestException":
@@ -456,41 +391,35 @@ const deserializeAws_restJson1CreateCustomPluginCommandError = async (output, co
456
391
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
457
392
  default:
458
393
  const parsedBody = parsedOutput.body;
459
- const $metadata = deserializeMetadata(output);
460
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
461
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
462
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
463
- $fault: "client",
464
- $metadata,
394
+ (0, smithy_client_1.throwDefaultError)({
395
+ output,
396
+ parsedBody,
397
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
398
+ errorCode,
465
399
  });
466
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
467
400
  }
468
401
  };
469
402
  const deserializeAws_restJson1CreateWorkerConfigurationCommand = async (output, context) => {
470
403
  if (output.statusCode !== 200 && output.statusCode >= 300) {
471
404
  return deserializeAws_restJson1CreateWorkerConfigurationCommandError(output, context);
472
405
  }
473
- const contents = {
406
+ const contents = map({
474
407
  $metadata: deserializeMetadata(output),
475
- creationTime: undefined,
476
- latestRevision: undefined,
477
- name: undefined,
478
- workerConfigurationArn: undefined,
479
- };
408
+ });
480
409
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
481
- if (data.creationTime !== undefined && data.creationTime !== null) {
410
+ if (data.creationTime != null) {
482
411
  contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.creationTime));
483
412
  }
484
- if (data.latestRevision !== undefined && data.latestRevision !== null) {
413
+ if (data.latestRevision != null) {
485
414
  contents.latestRevision = deserializeAws_restJson1WorkerConfigurationRevisionSummary(data.latestRevision, context);
486
415
  }
487
- if (data.name !== undefined && data.name !== null) {
416
+ if (data.name != null) {
488
417
  contents.name = (0, smithy_client_1.expectString)(data.name);
489
418
  }
490
- if (data.workerConfigurationArn !== undefined && data.workerConfigurationArn !== null) {
419
+ if (data.workerConfigurationArn != null) {
491
420
  contents.workerConfigurationArn = (0, smithy_client_1.expectString)(data.workerConfigurationArn);
492
421
  }
493
- return Promise.resolve(contents);
422
+ return contents;
494
423
  };
495
424
  exports.deserializeAws_restJson1CreateWorkerConfigurationCommand = deserializeAws_restJson1CreateWorkerConfigurationCommand;
496
425
  const deserializeAws_restJson1CreateWorkerConfigurationCommandError = async (output, context) => {
@@ -498,7 +427,6 @@ const deserializeAws_restJson1CreateWorkerConfigurationCommandError = async (out
498
427
  ...output,
499
428
  body: await parseBody(output.body, context),
500
429
  };
501
- let response;
502
430
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
503
431
  switch (errorCode) {
504
432
  case "BadRequestException":
@@ -527,33 +455,29 @@ const deserializeAws_restJson1CreateWorkerConfigurationCommandError = async (out
527
455
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
528
456
  default:
529
457
  const parsedBody = parsedOutput.body;
530
- const $metadata = deserializeMetadata(output);
531
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
532
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
533
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
534
- $fault: "client",
535
- $metadata,
458
+ (0, smithy_client_1.throwDefaultError)({
459
+ output,
460
+ parsedBody,
461
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
462
+ errorCode,
536
463
  });
537
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
538
464
  }
539
465
  };
540
466
  const deserializeAws_restJson1DeleteConnectorCommand = async (output, context) => {
541
467
  if (output.statusCode !== 200 && output.statusCode >= 300) {
542
468
  return deserializeAws_restJson1DeleteConnectorCommandError(output, context);
543
469
  }
544
- const contents = {
470
+ const contents = map({
545
471
  $metadata: deserializeMetadata(output),
546
- connectorArn: undefined,
547
- connectorState: undefined,
548
- };
472
+ });
549
473
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
550
- if (data.connectorArn !== undefined && data.connectorArn !== null) {
474
+ if (data.connectorArn != null) {
551
475
  contents.connectorArn = (0, smithy_client_1.expectString)(data.connectorArn);
552
476
  }
553
- if (data.connectorState !== undefined && data.connectorState !== null) {
477
+ if (data.connectorState != null) {
554
478
  contents.connectorState = (0, smithy_client_1.expectString)(data.connectorState);
555
479
  }
556
- return Promise.resolve(contents);
480
+ return contents;
557
481
  };
558
482
  exports.deserializeAws_restJson1DeleteConnectorCommand = deserializeAws_restJson1DeleteConnectorCommand;
559
483
  const deserializeAws_restJson1DeleteConnectorCommandError = async (output, context) => {
@@ -561,7 +485,6 @@ const deserializeAws_restJson1DeleteConnectorCommandError = async (output, conte
561
485
  ...output,
562
486
  body: await parseBody(output.body, context),
563
487
  };
564
- let response;
565
488
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
566
489
  switch (errorCode) {
567
490
  case "BadRequestException":
@@ -587,33 +510,29 @@ const deserializeAws_restJson1DeleteConnectorCommandError = async (output, conte
587
510
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
588
511
  default:
589
512
  const parsedBody = parsedOutput.body;
590
- const $metadata = deserializeMetadata(output);
591
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
592
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
593
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
594
- $fault: "client",
595
- $metadata,
513
+ (0, smithy_client_1.throwDefaultError)({
514
+ output,
515
+ parsedBody,
516
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
517
+ errorCode,
596
518
  });
597
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
598
519
  }
599
520
  };
600
521
  const deserializeAws_restJson1DeleteCustomPluginCommand = async (output, context) => {
601
522
  if (output.statusCode !== 200 && output.statusCode >= 300) {
602
523
  return deserializeAws_restJson1DeleteCustomPluginCommandError(output, context);
603
524
  }
604
- const contents = {
525
+ const contents = map({
605
526
  $metadata: deserializeMetadata(output),
606
- customPluginArn: undefined,
607
- customPluginState: undefined,
608
- };
527
+ });
609
528
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
610
- if (data.customPluginArn !== undefined && data.customPluginArn !== null) {
529
+ if (data.customPluginArn != null) {
611
530
  contents.customPluginArn = (0, smithy_client_1.expectString)(data.customPluginArn);
612
531
  }
613
- if (data.customPluginState !== undefined && data.customPluginState !== null) {
532
+ if (data.customPluginState != null) {
614
533
  contents.customPluginState = (0, smithy_client_1.expectString)(data.customPluginState);
615
534
  }
616
- return Promise.resolve(contents);
535
+ return contents;
617
536
  };
618
537
  exports.deserializeAws_restJson1DeleteCustomPluginCommand = deserializeAws_restJson1DeleteCustomPluginCommand;
619
538
  const deserializeAws_restJson1DeleteCustomPluginCommandError = async (output, context) => {
@@ -621,7 +540,6 @@ const deserializeAws_restJson1DeleteCustomPluginCommandError = async (output, co
621
540
  ...output,
622
541
  body: await parseBody(output.body, context),
623
542
  };
624
- let response;
625
543
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
626
544
  switch (errorCode) {
627
545
  case "BadRequestException":
@@ -647,93 +565,74 @@ const deserializeAws_restJson1DeleteCustomPluginCommandError = async (output, co
647
565
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
648
566
  default:
649
567
  const parsedBody = parsedOutput.body;
650
- const $metadata = deserializeMetadata(output);
651
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
652
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
653
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
654
- $fault: "client",
655
- $metadata,
568
+ (0, smithy_client_1.throwDefaultError)({
569
+ output,
570
+ parsedBody,
571
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
572
+ errorCode,
656
573
  });
657
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
658
574
  }
659
575
  };
660
576
  const deserializeAws_restJson1DescribeConnectorCommand = async (output, context) => {
661
577
  if (output.statusCode !== 200 && output.statusCode >= 300) {
662
578
  return deserializeAws_restJson1DescribeConnectorCommandError(output, context);
663
579
  }
664
- const contents = {
580
+ const contents = map({
665
581
  $metadata: deserializeMetadata(output),
666
- capacity: undefined,
667
- connectorArn: undefined,
668
- connectorConfiguration: undefined,
669
- connectorDescription: undefined,
670
- connectorName: undefined,
671
- connectorState: undefined,
672
- creationTime: undefined,
673
- currentVersion: undefined,
674
- kafkaCluster: undefined,
675
- kafkaClusterClientAuthentication: undefined,
676
- kafkaClusterEncryptionInTransit: undefined,
677
- kafkaConnectVersion: undefined,
678
- logDelivery: undefined,
679
- plugins: undefined,
680
- serviceExecutionRoleArn: undefined,
681
- stateDescription: undefined,
682
- workerConfiguration: undefined,
683
- };
582
+ });
684
583
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
685
- if (data.capacity !== undefined && data.capacity !== null) {
584
+ if (data.capacity != null) {
686
585
  contents.capacity = deserializeAws_restJson1CapacityDescription(data.capacity, context);
687
586
  }
688
- if (data.connectorArn !== undefined && data.connectorArn !== null) {
587
+ if (data.connectorArn != null) {
689
588
  contents.connectorArn = (0, smithy_client_1.expectString)(data.connectorArn);
690
589
  }
691
- if (data.connectorConfiguration !== undefined && data.connectorConfiguration !== null) {
590
+ if (data.connectorConfiguration != null) {
692
591
  contents.connectorConfiguration = deserializeAws_restJson1__mapOf__string(data.connectorConfiguration, context);
693
592
  }
694
- if (data.connectorDescription !== undefined && data.connectorDescription !== null) {
593
+ if (data.connectorDescription != null) {
695
594
  contents.connectorDescription = (0, smithy_client_1.expectString)(data.connectorDescription);
696
595
  }
697
- if (data.connectorName !== undefined && data.connectorName !== null) {
596
+ if (data.connectorName != null) {
698
597
  contents.connectorName = (0, smithy_client_1.expectString)(data.connectorName);
699
598
  }
700
- if (data.connectorState !== undefined && data.connectorState !== null) {
599
+ if (data.connectorState != null) {
701
600
  contents.connectorState = (0, smithy_client_1.expectString)(data.connectorState);
702
601
  }
703
- if (data.creationTime !== undefined && data.creationTime !== null) {
602
+ if (data.creationTime != null) {
704
603
  contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.creationTime));
705
604
  }
706
- if (data.currentVersion !== undefined && data.currentVersion !== null) {
605
+ if (data.currentVersion != null) {
707
606
  contents.currentVersion = (0, smithy_client_1.expectString)(data.currentVersion);
708
607
  }
709
- if (data.kafkaCluster !== undefined && data.kafkaCluster !== null) {
608
+ if (data.kafkaCluster != null) {
710
609
  contents.kafkaCluster = deserializeAws_restJson1KafkaClusterDescription(data.kafkaCluster, context);
711
610
  }
712
- if (data.kafkaClusterClientAuthentication !== undefined && data.kafkaClusterClientAuthentication !== null) {
611
+ if (data.kafkaClusterClientAuthentication != null) {
713
612
  contents.kafkaClusterClientAuthentication = deserializeAws_restJson1KafkaClusterClientAuthenticationDescription(data.kafkaClusterClientAuthentication, context);
714
613
  }
715
- if (data.kafkaClusterEncryptionInTransit !== undefined && data.kafkaClusterEncryptionInTransit !== null) {
614
+ if (data.kafkaClusterEncryptionInTransit != null) {
716
615
  contents.kafkaClusterEncryptionInTransit = deserializeAws_restJson1KafkaClusterEncryptionInTransitDescription(data.kafkaClusterEncryptionInTransit, context);
717
616
  }
718
- if (data.kafkaConnectVersion !== undefined && data.kafkaConnectVersion !== null) {
617
+ if (data.kafkaConnectVersion != null) {
719
618
  contents.kafkaConnectVersion = (0, smithy_client_1.expectString)(data.kafkaConnectVersion);
720
619
  }
721
- if (data.logDelivery !== undefined && data.logDelivery !== null) {
620
+ if (data.logDelivery != null) {
722
621
  contents.logDelivery = deserializeAws_restJson1LogDeliveryDescription(data.logDelivery, context);
723
622
  }
724
- if (data.plugins !== undefined && data.plugins !== null) {
623
+ if (data.plugins != null) {
725
624
  contents.plugins = deserializeAws_restJson1__listOfPluginDescription(data.plugins, context);
726
625
  }
727
- if (data.serviceExecutionRoleArn !== undefined && data.serviceExecutionRoleArn !== null) {
626
+ if (data.serviceExecutionRoleArn != null) {
728
627
  contents.serviceExecutionRoleArn = (0, smithy_client_1.expectString)(data.serviceExecutionRoleArn);
729
628
  }
730
- if (data.stateDescription !== undefined && data.stateDescription !== null) {
629
+ if (data.stateDescription != null) {
731
630
  contents.stateDescription = deserializeAws_restJson1StateDescription(data.stateDescription, context);
732
631
  }
733
- if (data.workerConfiguration !== undefined && data.workerConfiguration !== null) {
632
+ if (data.workerConfiguration != null) {
734
633
  contents.workerConfiguration = deserializeAws_restJson1WorkerConfigurationDescription(data.workerConfiguration, context);
735
634
  }
736
- return Promise.resolve(contents);
635
+ return contents;
737
636
  };
738
637
  exports.deserializeAws_restJson1DescribeConnectorCommand = deserializeAws_restJson1DescribeConnectorCommand;
739
638
  const deserializeAws_restJson1DescribeConnectorCommandError = async (output, context) => {
@@ -741,7 +640,6 @@ const deserializeAws_restJson1DescribeConnectorCommandError = async (output, con
741
640
  ...output,
742
641
  body: await parseBody(output.body, context),
743
642
  };
744
- let response;
745
643
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
746
644
  switch (errorCode) {
747
645
  case "BadRequestException":
@@ -767,53 +665,44 @@ const deserializeAws_restJson1DescribeConnectorCommandError = async (output, con
767
665
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
768
666
  default:
769
667
  const parsedBody = parsedOutput.body;
770
- const $metadata = deserializeMetadata(output);
771
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
772
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
773
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
774
- $fault: "client",
775
- $metadata,
668
+ (0, smithy_client_1.throwDefaultError)({
669
+ output,
670
+ parsedBody,
671
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
672
+ errorCode,
776
673
  });
777
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
778
674
  }
779
675
  };
780
676
  const deserializeAws_restJson1DescribeCustomPluginCommand = async (output, context) => {
781
677
  if (output.statusCode !== 200 && output.statusCode >= 300) {
782
678
  return deserializeAws_restJson1DescribeCustomPluginCommandError(output, context);
783
679
  }
784
- const contents = {
680
+ const contents = map({
785
681
  $metadata: deserializeMetadata(output),
786
- creationTime: undefined,
787
- customPluginArn: undefined,
788
- customPluginState: undefined,
789
- description: undefined,
790
- latestRevision: undefined,
791
- name: undefined,
792
- stateDescription: undefined,
793
- };
682
+ });
794
683
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
795
- if (data.creationTime !== undefined && data.creationTime !== null) {
684
+ if (data.creationTime != null) {
796
685
  contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.creationTime));
797
686
  }
798
- if (data.customPluginArn !== undefined && data.customPluginArn !== null) {
687
+ if (data.customPluginArn != null) {
799
688
  contents.customPluginArn = (0, smithy_client_1.expectString)(data.customPluginArn);
800
689
  }
801
- if (data.customPluginState !== undefined && data.customPluginState !== null) {
690
+ if (data.customPluginState != null) {
802
691
  contents.customPluginState = (0, smithy_client_1.expectString)(data.customPluginState);
803
692
  }
804
- if (data.description !== undefined && data.description !== null) {
693
+ if (data.description != null) {
805
694
  contents.description = (0, smithy_client_1.expectString)(data.description);
806
695
  }
807
- if (data.latestRevision !== undefined && data.latestRevision !== null) {
696
+ if (data.latestRevision != null) {
808
697
  contents.latestRevision = deserializeAws_restJson1CustomPluginRevisionSummary(data.latestRevision, context);
809
698
  }
810
- if (data.name !== undefined && data.name !== null) {
699
+ if (data.name != null) {
811
700
  contents.name = (0, smithy_client_1.expectString)(data.name);
812
701
  }
813
- if (data.stateDescription !== undefined && data.stateDescription !== null) {
702
+ if (data.stateDescription != null) {
814
703
  contents.stateDescription = deserializeAws_restJson1StateDescription(data.stateDescription, context);
815
704
  }
816
- return Promise.resolve(contents);
705
+ return contents;
817
706
  };
818
707
  exports.deserializeAws_restJson1DescribeCustomPluginCommand = deserializeAws_restJson1DescribeCustomPluginCommand;
819
708
  const deserializeAws_restJson1DescribeCustomPluginCommandError = async (output, context) => {
@@ -821,7 +710,6 @@ const deserializeAws_restJson1DescribeCustomPluginCommandError = async (output,
821
710
  ...output,
822
711
  body: await parseBody(output.body, context),
823
712
  };
824
- let response;
825
713
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
826
714
  switch (errorCode) {
827
715
  case "BadRequestException":
@@ -847,45 +735,38 @@ const deserializeAws_restJson1DescribeCustomPluginCommandError = async (output,
847
735
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
848
736
  default:
849
737
  const parsedBody = parsedOutput.body;
850
- const $metadata = deserializeMetadata(output);
851
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
852
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
853
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
854
- $fault: "client",
855
- $metadata,
738
+ (0, smithy_client_1.throwDefaultError)({
739
+ output,
740
+ parsedBody,
741
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
742
+ errorCode,
856
743
  });
857
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
858
744
  }
859
745
  };
860
746
  const deserializeAws_restJson1DescribeWorkerConfigurationCommand = async (output, context) => {
861
747
  if (output.statusCode !== 200 && output.statusCode >= 300) {
862
748
  return deserializeAws_restJson1DescribeWorkerConfigurationCommandError(output, context);
863
749
  }
864
- const contents = {
750
+ const contents = map({
865
751
  $metadata: deserializeMetadata(output),
866
- creationTime: undefined,
867
- description: undefined,
868
- latestRevision: undefined,
869
- name: undefined,
870
- workerConfigurationArn: undefined,
871
- };
752
+ });
872
753
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
873
- if (data.creationTime !== undefined && data.creationTime !== null) {
754
+ if (data.creationTime != null) {
874
755
  contents.creationTime = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseRfc3339DateTime)(data.creationTime));
875
756
  }
876
- if (data.description !== undefined && data.description !== null) {
757
+ if (data.description != null) {
877
758
  contents.description = (0, smithy_client_1.expectString)(data.description);
878
759
  }
879
- if (data.latestRevision !== undefined && data.latestRevision !== null) {
760
+ if (data.latestRevision != null) {
880
761
  contents.latestRevision = deserializeAws_restJson1WorkerConfigurationRevisionDescription(data.latestRevision, context);
881
762
  }
882
- if (data.name !== undefined && data.name !== null) {
763
+ if (data.name != null) {
883
764
  contents.name = (0, smithy_client_1.expectString)(data.name);
884
765
  }
885
- if (data.workerConfigurationArn !== undefined && data.workerConfigurationArn !== null) {
766
+ if (data.workerConfigurationArn != null) {
886
767
  contents.workerConfigurationArn = (0, smithy_client_1.expectString)(data.workerConfigurationArn);
887
768
  }
888
- return Promise.resolve(contents);
769
+ return contents;
889
770
  };
890
771
  exports.deserializeAws_restJson1DescribeWorkerConfigurationCommand = deserializeAws_restJson1DescribeWorkerConfigurationCommand;
891
772
  const deserializeAws_restJson1DescribeWorkerConfigurationCommandError = async (output, context) => {
@@ -893,7 +774,6 @@ const deserializeAws_restJson1DescribeWorkerConfigurationCommandError = async (o
893
774
  ...output,
894
775
  body: await parseBody(output.body, context),
895
776
  };
896
- let response;
897
777
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
898
778
  switch (errorCode) {
899
779
  case "BadRequestException":
@@ -919,33 +799,29 @@ const deserializeAws_restJson1DescribeWorkerConfigurationCommandError = async (o
919
799
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
920
800
  default:
921
801
  const parsedBody = parsedOutput.body;
922
- const $metadata = deserializeMetadata(output);
923
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
924
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
925
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
926
- $fault: "client",
927
- $metadata,
802
+ (0, smithy_client_1.throwDefaultError)({
803
+ output,
804
+ parsedBody,
805
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
806
+ errorCode,
928
807
  });
929
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
930
808
  }
931
809
  };
932
810
  const deserializeAws_restJson1ListConnectorsCommand = async (output, context) => {
933
811
  if (output.statusCode !== 200 && output.statusCode >= 300) {
934
812
  return deserializeAws_restJson1ListConnectorsCommandError(output, context);
935
813
  }
936
- const contents = {
814
+ const contents = map({
937
815
  $metadata: deserializeMetadata(output),
938
- connectors: undefined,
939
- nextToken: undefined,
940
- };
816
+ });
941
817
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
942
- if (data.connectors !== undefined && data.connectors !== null) {
818
+ if (data.connectors != null) {
943
819
  contents.connectors = deserializeAws_restJson1__listOfConnectorSummary(data.connectors, context);
944
820
  }
945
- if (data.nextToken !== undefined && data.nextToken !== null) {
821
+ if (data.nextToken != null) {
946
822
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
947
823
  }
948
- return Promise.resolve(contents);
824
+ return contents;
949
825
  };
950
826
  exports.deserializeAws_restJson1ListConnectorsCommand = deserializeAws_restJson1ListConnectorsCommand;
951
827
  const deserializeAws_restJson1ListConnectorsCommandError = async (output, context) => {
@@ -953,7 +829,6 @@ const deserializeAws_restJson1ListConnectorsCommandError = async (output, contex
953
829
  ...output,
954
830
  body: await parseBody(output.body, context),
955
831
  };
956
- let response;
957
832
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
958
833
  switch (errorCode) {
959
834
  case "BadRequestException":
@@ -979,33 +854,29 @@ const deserializeAws_restJson1ListConnectorsCommandError = async (output, contex
979
854
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
980
855
  default:
981
856
  const parsedBody = parsedOutput.body;
982
- const $metadata = deserializeMetadata(output);
983
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
984
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
985
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
986
- $fault: "client",
987
- $metadata,
857
+ (0, smithy_client_1.throwDefaultError)({
858
+ output,
859
+ parsedBody,
860
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
861
+ errorCode,
988
862
  });
989
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
990
863
  }
991
864
  };
992
865
  const deserializeAws_restJson1ListCustomPluginsCommand = async (output, context) => {
993
866
  if (output.statusCode !== 200 && output.statusCode >= 300) {
994
867
  return deserializeAws_restJson1ListCustomPluginsCommandError(output, context);
995
868
  }
996
- const contents = {
869
+ const contents = map({
997
870
  $metadata: deserializeMetadata(output),
998
- customPlugins: undefined,
999
- nextToken: undefined,
1000
- };
871
+ });
1001
872
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1002
- if (data.customPlugins !== undefined && data.customPlugins !== null) {
873
+ if (data.customPlugins != null) {
1003
874
  contents.customPlugins = deserializeAws_restJson1__listOfCustomPluginSummary(data.customPlugins, context);
1004
875
  }
1005
- if (data.nextToken !== undefined && data.nextToken !== null) {
876
+ if (data.nextToken != null) {
1006
877
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1007
878
  }
1008
- return Promise.resolve(contents);
879
+ return contents;
1009
880
  };
1010
881
  exports.deserializeAws_restJson1ListCustomPluginsCommand = deserializeAws_restJson1ListCustomPluginsCommand;
1011
882
  const deserializeAws_restJson1ListCustomPluginsCommandError = async (output, context) => {
@@ -1013,7 +884,6 @@ const deserializeAws_restJson1ListCustomPluginsCommandError = async (output, con
1013
884
  ...output,
1014
885
  body: await parseBody(output.body, context),
1015
886
  };
1016
- let response;
1017
887
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1018
888
  switch (errorCode) {
1019
889
  case "BadRequestException":
@@ -1039,33 +909,29 @@ const deserializeAws_restJson1ListCustomPluginsCommandError = async (output, con
1039
909
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1040
910
  default:
1041
911
  const parsedBody = parsedOutput.body;
1042
- const $metadata = deserializeMetadata(output);
1043
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1044
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
1045
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1046
- $fault: "client",
1047
- $metadata,
912
+ (0, smithy_client_1.throwDefaultError)({
913
+ output,
914
+ parsedBody,
915
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
916
+ errorCode,
1048
917
  });
1049
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1050
918
  }
1051
919
  };
1052
920
  const deserializeAws_restJson1ListWorkerConfigurationsCommand = async (output, context) => {
1053
921
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1054
922
  return deserializeAws_restJson1ListWorkerConfigurationsCommandError(output, context);
1055
923
  }
1056
- const contents = {
924
+ const contents = map({
1057
925
  $metadata: deserializeMetadata(output),
1058
- nextToken: undefined,
1059
- workerConfigurations: undefined,
1060
- };
926
+ });
1061
927
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1062
- if (data.nextToken !== undefined && data.nextToken !== null) {
928
+ if (data.nextToken != null) {
1063
929
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
1064
930
  }
1065
- if (data.workerConfigurations !== undefined && data.workerConfigurations !== null) {
931
+ if (data.workerConfigurations != null) {
1066
932
  contents.workerConfigurations = deserializeAws_restJson1__listOfWorkerConfigurationSummary(data.workerConfigurations, context);
1067
933
  }
1068
- return Promise.resolve(contents);
934
+ return contents;
1069
935
  };
1070
936
  exports.deserializeAws_restJson1ListWorkerConfigurationsCommand = deserializeAws_restJson1ListWorkerConfigurationsCommand;
1071
937
  const deserializeAws_restJson1ListWorkerConfigurationsCommandError = async (output, context) => {
@@ -1073,7 +939,6 @@ const deserializeAws_restJson1ListWorkerConfigurationsCommandError = async (outp
1073
939
  ...output,
1074
940
  body: await parseBody(output.body, context),
1075
941
  };
1076
- let response;
1077
942
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1078
943
  switch (errorCode) {
1079
944
  case "BadRequestException":
@@ -1099,33 +964,29 @@ const deserializeAws_restJson1ListWorkerConfigurationsCommandError = async (outp
1099
964
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1100
965
  default:
1101
966
  const parsedBody = parsedOutput.body;
1102
- const $metadata = deserializeMetadata(output);
1103
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1104
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
1105
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1106
- $fault: "client",
1107
- $metadata,
967
+ (0, smithy_client_1.throwDefaultError)({
968
+ output,
969
+ parsedBody,
970
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
971
+ errorCode,
1108
972
  });
1109
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1110
973
  }
1111
974
  };
1112
975
  const deserializeAws_restJson1UpdateConnectorCommand = async (output, context) => {
1113
976
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1114
977
  return deserializeAws_restJson1UpdateConnectorCommandError(output, context);
1115
978
  }
1116
- const contents = {
979
+ const contents = map({
1117
980
  $metadata: deserializeMetadata(output),
1118
- connectorArn: undefined,
1119
- connectorState: undefined,
1120
- };
981
+ });
1121
982
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1122
- if (data.connectorArn !== undefined && data.connectorArn !== null) {
983
+ if (data.connectorArn != null) {
1123
984
  contents.connectorArn = (0, smithy_client_1.expectString)(data.connectorArn);
1124
985
  }
1125
- if (data.connectorState !== undefined && data.connectorState !== null) {
986
+ if (data.connectorState != null) {
1126
987
  contents.connectorState = (0, smithy_client_1.expectString)(data.connectorState);
1127
988
  }
1128
- return Promise.resolve(contents);
989
+ return contents;
1129
990
  };
1130
991
  exports.deserializeAws_restJson1UpdateConnectorCommand = deserializeAws_restJson1UpdateConnectorCommand;
1131
992
  const deserializeAws_restJson1UpdateConnectorCommandError = async (output, context) => {
@@ -1133,7 +994,6 @@ const deserializeAws_restJson1UpdateConnectorCommandError = async (output, conte
1133
994
  ...output,
1134
995
  body: await parseBody(output.body, context),
1135
996
  };
1136
- let response;
1137
997
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1138
998
  switch (errorCode) {
1139
999
  case "BadRequestException":
@@ -1159,20 +1019,19 @@ const deserializeAws_restJson1UpdateConnectorCommandError = async (output, conte
1159
1019
  throw await deserializeAws_restJson1UnauthorizedExceptionResponse(parsedOutput, context);
1160
1020
  default:
1161
1021
  const parsedBody = parsedOutput.body;
1162
- const $metadata = deserializeMetadata(output);
1163
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1164
- response = new KafkaConnectServiceException_1.KafkaConnectServiceException({
1165
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1166
- $fault: "client",
1167
- $metadata,
1022
+ (0, smithy_client_1.throwDefaultError)({
1023
+ output,
1024
+ parsedBody,
1025
+ exceptionCtor: KafkaConnectServiceException_1.KafkaConnectServiceException,
1026
+ errorCode,
1168
1027
  });
1169
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1170
1028
  }
1171
1029
  };
1030
+ const map = smithy_client_1.map;
1172
1031
  const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput, context) => {
1173
- const contents = {};
1032
+ const contents = map({});
1174
1033
  const data = parsedOutput.body;
1175
- if (data.message !== undefined && data.message !== null) {
1034
+ if (data.message != null) {
1176
1035
  contents.message = (0, smithy_client_1.expectString)(data.message);
1177
1036
  }
1178
1037
  const exception = new models_0_1.BadRequestException({
@@ -1182,9 +1041,9 @@ const deserializeAws_restJson1BadRequestExceptionResponse = async (parsedOutput,
1182
1041
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1183
1042
  };
1184
1043
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
1185
- const contents = {};
1044
+ const contents = map({});
1186
1045
  const data = parsedOutput.body;
1187
- if (data.message !== undefined && data.message !== null) {
1046
+ if (data.message != null) {
1188
1047
  contents.message = (0, smithy_client_1.expectString)(data.message);
1189
1048
  }
1190
1049
  const exception = new models_0_1.ConflictException({
@@ -1194,9 +1053,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
1194
1053
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1195
1054
  };
1196
1055
  const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput, context) => {
1197
- const contents = {};
1056
+ const contents = map({});
1198
1057
  const data = parsedOutput.body;
1199
- if (data.message !== undefined && data.message !== null) {
1058
+ if (data.message != null) {
1200
1059
  contents.message = (0, smithy_client_1.expectString)(data.message);
1201
1060
  }
1202
1061
  const exception = new models_0_1.ForbiddenException({
@@ -1206,9 +1065,9 @@ const deserializeAws_restJson1ForbiddenExceptionResponse = async (parsedOutput,
1206
1065
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1207
1066
  };
1208
1067
  const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (parsedOutput, context) => {
1209
- const contents = {};
1068
+ const contents = map({});
1210
1069
  const data = parsedOutput.body;
1211
- if (data.message !== undefined && data.message !== null) {
1070
+ if (data.message != null) {
1212
1071
  contents.message = (0, smithy_client_1.expectString)(data.message);
1213
1072
  }
1214
1073
  const exception = new models_0_1.InternalServerErrorException({
@@ -1218,9 +1077,9 @@ const deserializeAws_restJson1InternalServerErrorExceptionResponse = async (pars
1218
1077
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1219
1078
  };
1220
1079
  const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, context) => {
1221
- const contents = {};
1080
+ const contents = map({});
1222
1081
  const data = parsedOutput.body;
1223
- if (data.message !== undefined && data.message !== null) {
1082
+ if (data.message != null) {
1224
1083
  contents.message = (0, smithy_client_1.expectString)(data.message);
1225
1084
  }
1226
1085
  const exception = new models_0_1.NotFoundException({
@@ -1230,9 +1089,9 @@ const deserializeAws_restJson1NotFoundExceptionResponse = async (parsedOutput, c
1230
1089
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1231
1090
  };
1232
1091
  const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parsedOutput, context) => {
1233
- const contents = {};
1092
+ const contents = map({});
1234
1093
  const data = parsedOutput.body;
1235
- if (data.message !== undefined && data.message !== null) {
1094
+ if (data.message != null) {
1236
1095
  contents.message = (0, smithy_client_1.expectString)(data.message);
1237
1096
  }
1238
1097
  const exception = new models_0_1.ServiceUnavailableException({
@@ -1242,9 +1101,9 @@ const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async (parse
1242
1101
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1243
1102
  };
1244
1103
  const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOutput, context) => {
1245
- const contents = {};
1104
+ const contents = map({});
1246
1105
  const data = parsedOutput.body;
1247
- if (data.message !== undefined && data.message !== null) {
1106
+ if (data.message != null) {
1248
1107
  contents.message = (0, smithy_client_1.expectString)(data.message);
1249
1108
  }
1250
1109
  const exception = new models_0_1.TooManyRequestsException({
@@ -1254,9 +1113,9 @@ const deserializeAws_restJson1TooManyRequestsExceptionResponse = async (parsedOu
1254
1113
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
1255
1114
  };
1256
1115
  const deserializeAws_restJson1UnauthorizedExceptionResponse = async (parsedOutput, context) => {
1257
- const contents = {};
1116
+ const contents = map({});
1258
1117
  const data = parsedOutput.body;
1259
- if (data.message !== undefined && data.message !== null) {
1118
+ if (data.message != null) {
1260
1119
  contents.message = (0, smithy_client_1.expectString)(data.message);
1261
1120
  }
1262
1121
  const exception = new models_0_1.UnauthorizedException({
@@ -1269,9 +1128,6 @@ const serializeAws_restJson1__listOf__string = (input, context) => {
1269
1128
  return input
1270
1129
  .filter((e) => e != null)
1271
1130
  .map((entry) => {
1272
- if (entry === null) {
1273
- return null;
1274
- }
1275
1131
  return entry;
1276
1132
  });
1277
1133
  };
@@ -1279,9 +1135,6 @@ const serializeAws_restJson1__listOfPlugin = (input, context) => {
1279
1135
  return input
1280
1136
  .filter((e) => e != null)
1281
1137
  .map((entry) => {
1282
- if (entry === null) {
1283
- return null;
1284
- }
1285
1138
  return serializeAws_restJson1Plugin(entry, context);
1286
1139
  });
1287
1140
  };