@aws-sdk/client-codeartifact 3.141.0 → 3.142.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.
@@ -10,12 +10,12 @@ const serializeAws_restJson1AssociateExternalConnectionCommand = async (input, c
10
10
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
11
11
  const headers = {};
12
12
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository/external-connection";
13
- const query = {
14
- ...(input.domain !== undefined && { domain: input.domain }),
15
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
16
- ...(input.repository !== undefined && { repository: input.repository }),
17
- ...(input.externalConnection !== undefined && { "external-connection": input.externalConnection }),
18
- };
13
+ const query = map({
14
+ domain: [, input.domain],
15
+ "domain-owner": [, input.domainOwner],
16
+ repository: [, input.repository],
17
+ "external-connection": [, input.externalConnection],
18
+ });
19
19
  let body;
20
20
  return new protocol_http_1.HttpRequest({
21
21
  protocol,
@@ -35,15 +35,15 @@ const serializeAws_restJson1CopyPackageVersionsCommand = async (input, context)
35
35
  "content-type": "application/json",
36
36
  };
37
37
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/versions/copy";
38
- const query = {
39
- ...(input.domain !== undefined && { domain: input.domain }),
40
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
41
- ...(input.sourceRepository !== undefined && { "source-repository": input.sourceRepository }),
42
- ...(input.destinationRepository !== undefined && { "destination-repository": input.destinationRepository }),
43
- ...(input.format !== undefined && { format: input.format }),
44
- ...(input.namespace !== undefined && { namespace: input.namespace }),
45
- ...(input.package !== undefined && { package: input.package }),
46
- };
38
+ const query = map({
39
+ domain: [, input.domain],
40
+ "domain-owner": [, input.domainOwner],
41
+ "source-repository": [, input.sourceRepository],
42
+ "destination-repository": [, input.destinationRepository],
43
+ format: [, input.format],
44
+ namespace: [, input.namespace],
45
+ package: [, input.package],
46
+ });
47
47
  let body;
48
48
  body = JSON.stringify({
49
49
  ...(input.allowOverwrite != null && { allowOverwrite: input.allowOverwrite }),
@@ -71,9 +71,9 @@ const serializeAws_restJson1CreateDomainCommand = async (input, context) => {
71
71
  "content-type": "application/json",
72
72
  };
73
73
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domain";
74
- const query = {
75
- ...(input.domain !== undefined && { domain: input.domain }),
76
- };
74
+ const query = map({
75
+ domain: [, input.domain],
76
+ });
77
77
  let body;
78
78
  body = JSON.stringify({
79
79
  ...(input.encryptionKey != null && { encryptionKey: input.encryptionKey }),
@@ -97,11 +97,11 @@ const serializeAws_restJson1CreateRepositoryCommand = async (input, context) =>
97
97
  "content-type": "application/json",
98
98
  };
99
99
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository";
100
- const query = {
101
- ...(input.domain !== undefined && { domain: input.domain }),
102
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
103
- ...(input.repository !== undefined && { repository: input.repository }),
104
- };
100
+ const query = map({
101
+ domain: [, input.domain],
102
+ "domain-owner": [, input.domainOwner],
103
+ repository: [, input.repository],
104
+ });
105
105
  let body;
106
106
  body = JSON.stringify({
107
107
  ...(input.description != null && { description: input.description }),
@@ -126,10 +126,10 @@ const serializeAws_restJson1DeleteDomainCommand = async (input, context) => {
126
126
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
127
127
  const headers = {};
128
128
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domain";
129
- const query = {
130
- ...(input.domain !== undefined && { domain: input.domain }),
131
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
132
- };
129
+ const query = map({
130
+ domain: [, input.domain],
131
+ "domain-owner": [, input.domainOwner],
132
+ });
133
133
  let body;
134
134
  return new protocol_http_1.HttpRequest({
135
135
  protocol,
@@ -147,11 +147,11 @@ const serializeAws_restJson1DeleteDomainPermissionsPolicyCommand = async (input,
147
147
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
148
148
  const headers = {};
149
149
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domain/permissions/policy";
150
- const query = {
151
- ...(input.domain !== undefined && { domain: input.domain }),
152
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
153
- ...(input.policyRevision !== undefined && { "policy-revision": input.policyRevision }),
154
- };
150
+ const query = map({
151
+ domain: [, input.domain],
152
+ "domain-owner": [, input.domainOwner],
153
+ "policy-revision": [, input.policyRevision],
154
+ });
155
155
  let body;
156
156
  return new protocol_http_1.HttpRequest({
157
157
  protocol,
@@ -171,14 +171,14 @@ const serializeAws_restJson1DeletePackageVersionsCommand = async (input, context
171
171
  "content-type": "application/json",
172
172
  };
173
173
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/versions/delete";
174
- const query = {
175
- ...(input.domain !== undefined && { domain: input.domain }),
176
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
177
- ...(input.repository !== undefined && { repository: input.repository }),
178
- ...(input.format !== undefined && { format: input.format }),
179
- ...(input.namespace !== undefined && { namespace: input.namespace }),
180
- ...(input.package !== undefined && { package: input.package }),
181
- };
174
+ const query = map({
175
+ domain: [, input.domain],
176
+ "domain-owner": [, input.domainOwner],
177
+ repository: [, input.repository],
178
+ format: [, input.format],
179
+ namespace: [, input.namespace],
180
+ package: [, input.package],
181
+ });
182
182
  let body;
183
183
  body = JSON.stringify({
184
184
  ...(input.expectedStatus != null && { expectedStatus: input.expectedStatus }),
@@ -200,11 +200,11 @@ const serializeAws_restJson1DeleteRepositoryCommand = async (input, context) =>
200
200
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
201
201
  const headers = {};
202
202
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository";
203
- const query = {
204
- ...(input.domain !== undefined && { domain: input.domain }),
205
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
206
- ...(input.repository !== undefined && { repository: input.repository }),
207
- };
203
+ const query = map({
204
+ domain: [, input.domain],
205
+ "domain-owner": [, input.domainOwner],
206
+ repository: [, input.repository],
207
+ });
208
208
  let body;
209
209
  return new protocol_http_1.HttpRequest({
210
210
  protocol,
@@ -222,12 +222,12 @@ const serializeAws_restJson1DeleteRepositoryPermissionsPolicyCommand = async (in
222
222
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
223
223
  const headers = {};
224
224
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository/permissions/policies";
225
- const query = {
226
- ...(input.domain !== undefined && { domain: input.domain }),
227
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
228
- ...(input.repository !== undefined && { repository: input.repository }),
229
- ...(input.policyRevision !== undefined && { "policy-revision": input.policyRevision }),
230
- };
225
+ const query = map({
226
+ domain: [, input.domain],
227
+ "domain-owner": [, input.domainOwner],
228
+ repository: [, input.repository],
229
+ "policy-revision": [, input.policyRevision],
230
+ });
231
231
  let body;
232
232
  return new protocol_http_1.HttpRequest({
233
233
  protocol,
@@ -245,10 +245,10 @@ const serializeAws_restJson1DescribeDomainCommand = async (input, context) => {
245
245
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
246
246
  const headers = {};
247
247
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domain";
248
- const query = {
249
- ...(input.domain !== undefined && { domain: input.domain }),
250
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
251
- };
248
+ const query = map({
249
+ domain: [, input.domain],
250
+ "domain-owner": [, input.domainOwner],
251
+ });
252
252
  let body;
253
253
  return new protocol_http_1.HttpRequest({
254
254
  protocol,
@@ -266,14 +266,14 @@ const serializeAws_restJson1DescribePackageCommand = async (input, context) => {
266
266
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
267
267
  const headers = {};
268
268
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package";
269
- const query = {
270
- ...(input.domain !== undefined && { domain: input.domain }),
271
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
272
- ...(input.repository !== undefined && { repository: input.repository }),
273
- ...(input.format !== undefined && { format: input.format }),
274
- ...(input.namespace !== undefined && { namespace: input.namespace }),
275
- ...(input.package !== undefined && { package: input.package }),
276
- };
269
+ const query = map({
270
+ domain: [, input.domain],
271
+ "domain-owner": [, input.domainOwner],
272
+ repository: [, input.repository],
273
+ format: [, input.format],
274
+ namespace: [, input.namespace],
275
+ package: [, input.package],
276
+ });
277
277
  let body;
278
278
  return new protocol_http_1.HttpRequest({
279
279
  protocol,
@@ -291,15 +291,15 @@ const serializeAws_restJson1DescribePackageVersionCommand = async (input, contex
291
291
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
292
292
  const headers = {};
293
293
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/version";
294
- const query = {
295
- ...(input.domain !== undefined && { domain: input.domain }),
296
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
297
- ...(input.repository !== undefined && { repository: input.repository }),
298
- ...(input.format !== undefined && { format: input.format }),
299
- ...(input.namespace !== undefined && { namespace: input.namespace }),
300
- ...(input.package !== undefined && { package: input.package }),
301
- ...(input.packageVersion !== undefined && { version: input.packageVersion }),
302
- };
294
+ const query = map({
295
+ domain: [, input.domain],
296
+ "domain-owner": [, input.domainOwner],
297
+ repository: [, input.repository],
298
+ format: [, input.format],
299
+ namespace: [, input.namespace],
300
+ package: [, input.package],
301
+ version: [, input.packageVersion],
302
+ });
303
303
  let body;
304
304
  return new protocol_http_1.HttpRequest({
305
305
  protocol,
@@ -317,11 +317,11 @@ const serializeAws_restJson1DescribeRepositoryCommand = async (input, context) =
317
317
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
318
318
  const headers = {};
319
319
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository";
320
- const query = {
321
- ...(input.domain !== undefined && { domain: input.domain }),
322
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
323
- ...(input.repository !== undefined && { repository: input.repository }),
324
- };
320
+ const query = map({
321
+ domain: [, input.domain],
322
+ "domain-owner": [, input.domainOwner],
323
+ repository: [, input.repository],
324
+ });
325
325
  let body;
326
326
  return new protocol_http_1.HttpRequest({
327
327
  protocol,
@@ -339,12 +339,12 @@ const serializeAws_restJson1DisassociateExternalConnectionCommand = async (input
339
339
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
340
340
  const headers = {};
341
341
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository/external-connection";
342
- const query = {
343
- ...(input.domain !== undefined && { domain: input.domain }),
344
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
345
- ...(input.repository !== undefined && { repository: input.repository }),
346
- ...(input.externalConnection !== undefined && { "external-connection": input.externalConnection }),
347
- };
342
+ const query = map({
343
+ domain: [, input.domain],
344
+ "domain-owner": [, input.domainOwner],
345
+ repository: [, input.repository],
346
+ "external-connection": [, input.externalConnection],
347
+ });
348
348
  let body;
349
349
  return new protocol_http_1.HttpRequest({
350
350
  protocol,
@@ -364,14 +364,14 @@ const serializeAws_restJson1DisposePackageVersionsCommand = async (input, contex
364
364
  "content-type": "application/json",
365
365
  };
366
366
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/versions/dispose";
367
- const query = {
368
- ...(input.domain !== undefined && { domain: input.domain }),
369
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
370
- ...(input.repository !== undefined && { repository: input.repository }),
371
- ...(input.format !== undefined && { format: input.format }),
372
- ...(input.namespace !== undefined && { namespace: input.namespace }),
373
- ...(input.package !== undefined && { package: input.package }),
374
- };
367
+ const query = map({
368
+ domain: [, input.domain],
369
+ "domain-owner": [, input.domainOwner],
370
+ repository: [, input.repository],
371
+ format: [, input.format],
372
+ namespace: [, input.namespace],
373
+ package: [, input.package],
374
+ });
375
375
  let body;
376
376
  body = JSON.stringify({
377
377
  ...(input.expectedStatus != null && { expectedStatus: input.expectedStatus }),
@@ -396,11 +396,11 @@ const serializeAws_restJson1GetAuthorizationTokenCommand = async (input, context
396
396
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
397
397
  const headers = {};
398
398
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/authorization-token";
399
- const query = {
400
- ...(input.domain !== undefined && { domain: input.domain }),
401
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
402
- ...(input.durationSeconds !== undefined && { duration: input.durationSeconds.toString() }),
403
- };
399
+ const query = map({
400
+ domain: [, input.domain],
401
+ "domain-owner": [, input.domainOwner],
402
+ duration: [() => input.durationSeconds !== void 0, () => input.durationSeconds.toString()],
403
+ });
404
404
  let body;
405
405
  return new protocol_http_1.HttpRequest({
406
406
  protocol,
@@ -418,10 +418,10 @@ const serializeAws_restJson1GetDomainPermissionsPolicyCommand = async (input, co
418
418
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
419
419
  const headers = {};
420
420
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domain/permissions/policy";
421
- const query = {
422
- ...(input.domain !== undefined && { domain: input.domain }),
423
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
424
- };
421
+ const query = map({
422
+ domain: [, input.domain],
423
+ "domain-owner": [, input.domainOwner],
424
+ });
425
425
  let body;
426
426
  return new protocol_http_1.HttpRequest({
427
427
  protocol,
@@ -439,17 +439,17 @@ const serializeAws_restJson1GetPackageVersionAssetCommand = async (input, contex
439
439
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
440
440
  const headers = {};
441
441
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/version/asset";
442
- const query = {
443
- ...(input.domain !== undefined && { domain: input.domain }),
444
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
445
- ...(input.repository !== undefined && { repository: input.repository }),
446
- ...(input.format !== undefined && { format: input.format }),
447
- ...(input.namespace !== undefined && { namespace: input.namespace }),
448
- ...(input.package !== undefined && { package: input.package }),
449
- ...(input.packageVersion !== undefined && { version: input.packageVersion }),
450
- ...(input.asset !== undefined && { asset: input.asset }),
451
- ...(input.packageVersionRevision !== undefined && { revision: input.packageVersionRevision }),
452
- };
442
+ const query = map({
443
+ domain: [, input.domain],
444
+ "domain-owner": [, input.domainOwner],
445
+ repository: [, input.repository],
446
+ format: [, input.format],
447
+ namespace: [, input.namespace],
448
+ package: [, input.package],
449
+ version: [, input.packageVersion],
450
+ asset: [, input.asset],
451
+ revision: [, input.packageVersionRevision],
452
+ });
453
453
  let body;
454
454
  return new protocol_http_1.HttpRequest({
455
455
  protocol,
@@ -467,15 +467,15 @@ const serializeAws_restJson1GetPackageVersionReadmeCommand = async (input, conte
467
467
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
468
468
  const headers = {};
469
469
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/version/readme";
470
- const query = {
471
- ...(input.domain !== undefined && { domain: input.domain }),
472
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
473
- ...(input.repository !== undefined && { repository: input.repository }),
474
- ...(input.format !== undefined && { format: input.format }),
475
- ...(input.namespace !== undefined && { namespace: input.namespace }),
476
- ...(input.package !== undefined && { package: input.package }),
477
- ...(input.packageVersion !== undefined && { version: input.packageVersion }),
478
- };
470
+ const query = map({
471
+ domain: [, input.domain],
472
+ "domain-owner": [, input.domainOwner],
473
+ repository: [, input.repository],
474
+ format: [, input.format],
475
+ namespace: [, input.namespace],
476
+ package: [, input.package],
477
+ version: [, input.packageVersion],
478
+ });
479
479
  let body;
480
480
  return new protocol_http_1.HttpRequest({
481
481
  protocol,
@@ -493,12 +493,12 @@ const serializeAws_restJson1GetRepositoryEndpointCommand = async (input, context
493
493
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
494
494
  const headers = {};
495
495
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository/endpoint";
496
- const query = {
497
- ...(input.domain !== undefined && { domain: input.domain }),
498
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
499
- ...(input.repository !== undefined && { repository: input.repository }),
500
- ...(input.format !== undefined && { format: input.format }),
501
- };
496
+ const query = map({
497
+ domain: [, input.domain],
498
+ "domain-owner": [, input.domainOwner],
499
+ repository: [, input.repository],
500
+ format: [, input.format],
501
+ });
502
502
  let body;
503
503
  return new protocol_http_1.HttpRequest({
504
504
  protocol,
@@ -516,11 +516,11 @@ const serializeAws_restJson1GetRepositoryPermissionsPolicyCommand = async (input
516
516
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
517
517
  const headers = {};
518
518
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository/permissions/policy";
519
- const query = {
520
- ...(input.domain !== undefined && { domain: input.domain }),
521
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
522
- ...(input.repository !== undefined && { repository: input.repository }),
523
- };
519
+ const query = map({
520
+ domain: [, input.domain],
521
+ "domain-owner": [, input.domainOwner],
522
+ repository: [, input.repository],
523
+ });
524
524
  let body;
525
525
  return new protocol_http_1.HttpRequest({
526
526
  protocol,
@@ -560,18 +560,18 @@ const serializeAws_restJson1ListPackagesCommand = async (input, context) => {
560
560
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
561
561
  const headers = {};
562
562
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/packages";
563
- const query = {
564
- ...(input.domain !== undefined && { domain: input.domain }),
565
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
566
- ...(input.repository !== undefined && { repository: input.repository }),
567
- ...(input.format !== undefined && { format: input.format }),
568
- ...(input.namespace !== undefined && { namespace: input.namespace }),
569
- ...(input.packagePrefix !== undefined && { "package-prefix": input.packagePrefix }),
570
- ...(input.maxResults !== undefined && { "max-results": input.maxResults.toString() }),
571
- ...(input.nextToken !== undefined && { "next-token": input.nextToken }),
572
- ...(input.publish !== undefined && { publish: input.publish }),
573
- ...(input.upstream !== undefined && { upstream: input.upstream }),
574
- };
563
+ const query = map({
564
+ domain: [, input.domain],
565
+ "domain-owner": [, input.domainOwner],
566
+ repository: [, input.repository],
567
+ format: [, input.format],
568
+ namespace: [, input.namespace],
569
+ "package-prefix": [, input.packagePrefix],
570
+ "max-results": [() => input.maxResults !== void 0, () => input.maxResults.toString()],
571
+ "next-token": [, input.nextToken],
572
+ publish: [, input.publish],
573
+ upstream: [, input.upstream],
574
+ });
575
575
  let body;
576
576
  return new protocol_http_1.HttpRequest({
577
577
  protocol,
@@ -589,17 +589,17 @@ const serializeAws_restJson1ListPackageVersionAssetsCommand = async (input, cont
589
589
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
590
590
  const headers = {};
591
591
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/version/assets";
592
- const query = {
593
- ...(input.domain !== undefined && { domain: input.domain }),
594
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
595
- ...(input.repository !== undefined && { repository: input.repository }),
596
- ...(input.format !== undefined && { format: input.format }),
597
- ...(input.namespace !== undefined && { namespace: input.namespace }),
598
- ...(input.package !== undefined && { package: input.package }),
599
- ...(input.packageVersion !== undefined && { version: input.packageVersion }),
600
- ...(input.maxResults !== undefined && { "max-results": input.maxResults.toString() }),
601
- ...(input.nextToken !== undefined && { "next-token": input.nextToken }),
602
- };
592
+ const query = map({
593
+ domain: [, input.domain],
594
+ "domain-owner": [, input.domainOwner],
595
+ repository: [, input.repository],
596
+ format: [, input.format],
597
+ namespace: [, input.namespace],
598
+ package: [, input.package],
599
+ version: [, input.packageVersion],
600
+ "max-results": [() => input.maxResults !== void 0, () => input.maxResults.toString()],
601
+ "next-token": [, input.nextToken],
602
+ });
603
603
  let body;
604
604
  return new protocol_http_1.HttpRequest({
605
605
  protocol,
@@ -617,16 +617,16 @@ const serializeAws_restJson1ListPackageVersionDependenciesCommand = async (input
617
617
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
618
618
  const headers = {};
619
619
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/version/dependencies";
620
- const query = {
621
- ...(input.domain !== undefined && { domain: input.domain }),
622
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
623
- ...(input.repository !== undefined && { repository: input.repository }),
624
- ...(input.format !== undefined && { format: input.format }),
625
- ...(input.namespace !== undefined && { namespace: input.namespace }),
626
- ...(input.package !== undefined && { package: input.package }),
627
- ...(input.packageVersion !== undefined && { version: input.packageVersion }),
628
- ...(input.nextToken !== undefined && { "next-token": input.nextToken }),
629
- };
620
+ const query = map({
621
+ domain: [, input.domain],
622
+ "domain-owner": [, input.domainOwner],
623
+ repository: [, input.repository],
624
+ format: [, input.format],
625
+ namespace: [, input.namespace],
626
+ package: [, input.package],
627
+ version: [, input.packageVersion],
628
+ "next-token": [, input.nextToken],
629
+ });
630
630
  let body;
631
631
  return new protocol_http_1.HttpRequest({
632
632
  protocol,
@@ -644,19 +644,19 @@ const serializeAws_restJson1ListPackageVersionsCommand = async (input, context)
644
644
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
645
645
  const headers = {};
646
646
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/versions";
647
- const query = {
648
- ...(input.domain !== undefined && { domain: input.domain }),
649
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
650
- ...(input.repository !== undefined && { repository: input.repository }),
651
- ...(input.format !== undefined && { format: input.format }),
652
- ...(input.namespace !== undefined && { namespace: input.namespace }),
653
- ...(input.package !== undefined && { package: input.package }),
654
- ...(input.status !== undefined && { status: input.status }),
655
- ...(input.sortBy !== undefined && { sortBy: input.sortBy }),
656
- ...(input.maxResults !== undefined && { "max-results": input.maxResults.toString() }),
657
- ...(input.nextToken !== undefined && { "next-token": input.nextToken }),
658
- ...(input.originType !== undefined && { originType: input.originType }),
659
- };
647
+ const query = map({
648
+ domain: [, input.domain],
649
+ "domain-owner": [, input.domainOwner],
650
+ repository: [, input.repository],
651
+ format: [, input.format],
652
+ namespace: [, input.namespace],
653
+ package: [, input.package],
654
+ status: [, input.status],
655
+ sortBy: [, input.sortBy],
656
+ "max-results": [() => input.maxResults !== void 0, () => input.maxResults.toString()],
657
+ "next-token": [, input.nextToken],
658
+ originType: [, input.originType],
659
+ });
660
660
  let body;
661
661
  return new protocol_http_1.HttpRequest({
662
662
  protocol,
@@ -674,11 +674,11 @@ const serializeAws_restJson1ListRepositoriesCommand = async (input, context) =>
674
674
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
675
675
  const headers = {};
676
676
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repositories";
677
- const query = {
678
- ...(input.repositoryPrefix !== undefined && { "repository-prefix": input.repositoryPrefix }),
679
- ...(input.maxResults !== undefined && { "max-results": input.maxResults.toString() }),
680
- ...(input.nextToken !== undefined && { "next-token": input.nextToken }),
681
- };
677
+ const query = map({
678
+ "repository-prefix": [, input.repositoryPrefix],
679
+ "max-results": [() => input.maxResults !== void 0, () => input.maxResults.toString()],
680
+ "next-token": [, input.nextToken],
681
+ });
682
682
  let body;
683
683
  return new protocol_http_1.HttpRequest({
684
684
  protocol,
@@ -696,14 +696,14 @@ const serializeAws_restJson1ListRepositoriesInDomainCommand = async (input, cont
696
696
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
697
697
  const headers = {};
698
698
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/domain/repositories";
699
- const query = {
700
- ...(input.domain !== undefined && { domain: input.domain }),
701
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
702
- ...(input.administratorAccount !== undefined && { "administrator-account": input.administratorAccount }),
703
- ...(input.repositoryPrefix !== undefined && { "repository-prefix": input.repositoryPrefix }),
704
- ...(input.maxResults !== undefined && { "max-results": input.maxResults.toString() }),
705
- ...(input.nextToken !== undefined && { "next-token": input.nextToken }),
706
- };
699
+ const query = map({
700
+ domain: [, input.domain],
701
+ "domain-owner": [, input.domainOwner],
702
+ "administrator-account": [, input.administratorAccount],
703
+ "repository-prefix": [, input.repositoryPrefix],
704
+ "max-results": [() => input.maxResults !== void 0, () => input.maxResults.toString()],
705
+ "next-token": [, input.nextToken],
706
+ });
707
707
  let body;
708
708
  return new protocol_http_1.HttpRequest({
709
709
  protocol,
@@ -721,9 +721,9 @@ const serializeAws_restJson1ListTagsForResourceCommand = async (input, context)
721
721
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
722
722
  const headers = {};
723
723
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/tags";
724
- const query = {
725
- ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }),
726
- };
724
+ const query = map({
725
+ resourceArn: [, input.resourceArn],
726
+ });
727
727
  let body;
728
728
  return new protocol_http_1.HttpRequest({
729
729
  protocol,
@@ -767,14 +767,14 @@ const serializeAws_restJson1PutPackageOriginConfigurationCommand = async (input,
767
767
  "content-type": "application/json",
768
768
  };
769
769
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package";
770
- const query = {
771
- ...(input.domain !== undefined && { domain: input.domain }),
772
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
773
- ...(input.repository !== undefined && { repository: input.repository }),
774
- ...(input.format !== undefined && { format: input.format }),
775
- ...(input.namespace !== undefined && { namespace: input.namespace }),
776
- ...(input.package !== undefined && { package: input.package }),
777
- };
770
+ const query = map({
771
+ domain: [, input.domain],
772
+ "domain-owner": [, input.domainOwner],
773
+ repository: [, input.repository],
774
+ format: [, input.format],
775
+ namespace: [, input.namespace],
776
+ package: [, input.package],
777
+ });
778
778
  let body;
779
779
  body = JSON.stringify({
780
780
  ...(input.restrictions != null && {
@@ -799,11 +799,11 @@ const serializeAws_restJson1PutRepositoryPermissionsPolicyCommand = async (input
799
799
  "content-type": "application/json",
800
800
  };
801
801
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository/permissions/policy";
802
- const query = {
803
- ...(input.domain !== undefined && { domain: input.domain }),
804
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
805
- ...(input.repository !== undefined && { repository: input.repository }),
806
- };
802
+ const query = map({
803
+ domain: [, input.domain],
804
+ "domain-owner": [, input.domainOwner],
805
+ repository: [, input.repository],
806
+ });
807
807
  let body;
808
808
  body = JSON.stringify({
809
809
  ...(input.policyDocument != null && { policyDocument: input.policyDocument }),
@@ -827,9 +827,9 @@ const serializeAws_restJson1TagResourceCommand = async (input, context) => {
827
827
  "content-type": "application/json",
828
828
  };
829
829
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/tag";
830
- const query = {
831
- ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }),
832
- };
830
+ const query = map({
831
+ resourceArn: [, input.resourceArn],
832
+ });
833
833
  let body;
834
834
  body = JSON.stringify({
835
835
  ...(input.tags != null && { tags: serializeAws_restJson1TagList(input.tags, context) }),
@@ -852,9 +852,9 @@ const serializeAws_restJson1UntagResourceCommand = async (input, context) => {
852
852
  "content-type": "application/json",
853
853
  };
854
854
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/untag";
855
- const query = {
856
- ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }),
857
- };
855
+ const query = map({
856
+ resourceArn: [, input.resourceArn],
857
+ });
858
858
  let body;
859
859
  body = JSON.stringify({
860
860
  ...(input.tagKeys != null && { tagKeys: serializeAws_restJson1TagKeyList(input.tagKeys, context) }),
@@ -877,14 +877,14 @@ const serializeAws_restJson1UpdatePackageVersionsStatusCommand = async (input, c
877
877
  "content-type": "application/json",
878
878
  };
879
879
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/package/versions/update_status";
880
- const query = {
881
- ...(input.domain !== undefined && { domain: input.domain }),
882
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
883
- ...(input.repository !== undefined && { repository: input.repository }),
884
- ...(input.format !== undefined && { format: input.format }),
885
- ...(input.namespace !== undefined && { namespace: input.namespace }),
886
- ...(input.package !== undefined && { package: input.package }),
887
- };
880
+ const query = map({
881
+ domain: [, input.domain],
882
+ "domain-owner": [, input.domainOwner],
883
+ repository: [, input.repository],
884
+ format: [, input.format],
885
+ namespace: [, input.namespace],
886
+ package: [, input.package],
887
+ });
888
888
  let body;
889
889
  body = JSON.stringify({
890
890
  ...(input.expectedStatus != null && { expectedStatus: input.expectedStatus }),
@@ -912,11 +912,11 @@ const serializeAws_restJson1UpdateRepositoryCommand = async (input, context) =>
912
912
  "content-type": "application/json",
913
913
  };
914
914
  const resolvedPath = `${(basePath === null || basePath === void 0 ? void 0 : basePath.endsWith("/")) ? basePath.slice(0, -1) : basePath || ""}` + "/v1/repository";
915
- const query = {
916
- ...(input.domain !== undefined && { domain: input.domain }),
917
- ...(input.domainOwner !== undefined && { "domain-owner": input.domainOwner }),
918
- ...(input.repository !== undefined && { repository: input.repository }),
919
- };
915
+ const query = map({
916
+ domain: [, input.domain],
917
+ "domain-owner": [, input.domainOwner],
918
+ repository: [, input.repository],
919
+ });
920
920
  let body;
921
921
  body = JSON.stringify({
922
922
  ...(input.description != null && { description: input.description }),
@@ -940,15 +940,14 @@ const deserializeAws_restJson1AssociateExternalConnectionCommand = async (output
940
940
  if (output.statusCode !== 200 && output.statusCode >= 300) {
941
941
  return deserializeAws_restJson1AssociateExternalConnectionCommandError(output, context);
942
942
  }
943
- const contents = {
943
+ const contents = map({
944
944
  $metadata: deserializeMetadata(output),
945
- repository: undefined,
946
- };
945
+ });
947
946
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
948
- if (data.repository !== undefined && data.repository !== null) {
947
+ if (data.repository != null) {
949
948
  contents.repository = deserializeAws_restJson1RepositoryDescription(data.repository, context);
950
949
  }
951
- return Promise.resolve(contents);
950
+ return contents;
952
951
  };
953
952
  exports.deserializeAws_restJson1AssociateExternalConnectionCommand = deserializeAws_restJson1AssociateExternalConnectionCommand;
954
953
  const deserializeAws_restJson1AssociateExternalConnectionCommandError = async (output, context) => {
@@ -956,7 +955,6 @@ const deserializeAws_restJson1AssociateExternalConnectionCommandError = async (o
956
955
  ...output,
957
956
  body: await parseBody(output.body, context),
958
957
  };
959
- let response;
960
958
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
961
959
  switch (errorCode) {
962
960
  case "AccessDeniedException":
@@ -982,33 +980,29 @@ const deserializeAws_restJson1AssociateExternalConnectionCommandError = async (o
982
980
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
983
981
  default:
984
982
  const parsedBody = parsedOutput.body;
985
- const $metadata = deserializeMetadata(output);
986
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
987
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
988
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
989
- $fault: "client",
990
- $metadata,
983
+ (0, smithy_client_1.throwDefaultError)({
984
+ output,
985
+ parsedBody,
986
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
987
+ errorCode,
991
988
  });
992
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
993
989
  }
994
990
  };
995
991
  const deserializeAws_restJson1CopyPackageVersionsCommand = async (output, context) => {
996
992
  if (output.statusCode !== 200 && output.statusCode >= 300) {
997
993
  return deserializeAws_restJson1CopyPackageVersionsCommandError(output, context);
998
994
  }
999
- const contents = {
995
+ const contents = map({
1000
996
  $metadata: deserializeMetadata(output),
1001
- failedVersions: undefined,
1002
- successfulVersions: undefined,
1003
- };
997
+ });
1004
998
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1005
- if (data.failedVersions !== undefined && data.failedVersions !== null) {
999
+ if (data.failedVersions != null) {
1006
1000
  contents.failedVersions = deserializeAws_restJson1PackageVersionErrorMap(data.failedVersions, context);
1007
1001
  }
1008
- if (data.successfulVersions !== undefined && data.successfulVersions !== null) {
1002
+ if (data.successfulVersions != null) {
1009
1003
  contents.successfulVersions = deserializeAws_restJson1SuccessfulPackageVersionInfoMap(data.successfulVersions, context);
1010
1004
  }
1011
- return Promise.resolve(contents);
1005
+ return contents;
1012
1006
  };
1013
1007
  exports.deserializeAws_restJson1CopyPackageVersionsCommand = deserializeAws_restJson1CopyPackageVersionsCommand;
1014
1008
  const deserializeAws_restJson1CopyPackageVersionsCommandError = async (output, context) => {
@@ -1016,7 +1010,6 @@ const deserializeAws_restJson1CopyPackageVersionsCommandError = async (output, c
1016
1010
  ...output,
1017
1011
  body: await parseBody(output.body, context),
1018
1012
  };
1019
- let response;
1020
1013
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1021
1014
  switch (errorCode) {
1022
1015
  case "AccessDeniedException":
@@ -1042,29 +1035,26 @@ const deserializeAws_restJson1CopyPackageVersionsCommandError = async (output, c
1042
1035
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1043
1036
  default:
1044
1037
  const parsedBody = parsedOutput.body;
1045
- const $metadata = deserializeMetadata(output);
1046
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1047
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1048
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1049
- $fault: "client",
1050
- $metadata,
1038
+ (0, smithy_client_1.throwDefaultError)({
1039
+ output,
1040
+ parsedBody,
1041
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1042
+ errorCode,
1051
1043
  });
1052
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1053
1044
  }
1054
1045
  };
1055
1046
  const deserializeAws_restJson1CreateDomainCommand = async (output, context) => {
1056
1047
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1057
1048
  return deserializeAws_restJson1CreateDomainCommandError(output, context);
1058
1049
  }
1059
- const contents = {
1050
+ const contents = map({
1060
1051
  $metadata: deserializeMetadata(output),
1061
- domain: undefined,
1062
- };
1052
+ });
1063
1053
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1064
- if (data.domain !== undefined && data.domain !== null) {
1054
+ if (data.domain != null) {
1065
1055
  contents.domain = deserializeAws_restJson1DomainDescription(data.domain, context);
1066
1056
  }
1067
- return Promise.resolve(contents);
1057
+ return contents;
1068
1058
  };
1069
1059
  exports.deserializeAws_restJson1CreateDomainCommand = deserializeAws_restJson1CreateDomainCommand;
1070
1060
  const deserializeAws_restJson1CreateDomainCommandError = async (output, context) => {
@@ -1072,7 +1062,6 @@ const deserializeAws_restJson1CreateDomainCommandError = async (output, context)
1072
1062
  ...output,
1073
1063
  body: await parseBody(output.body, context),
1074
1064
  };
1075
- let response;
1076
1065
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1077
1066
  switch (errorCode) {
1078
1067
  case "AccessDeniedException":
@@ -1098,29 +1087,26 @@ const deserializeAws_restJson1CreateDomainCommandError = async (output, context)
1098
1087
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1099
1088
  default:
1100
1089
  const parsedBody = parsedOutput.body;
1101
- const $metadata = deserializeMetadata(output);
1102
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1103
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1104
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1105
- $fault: "client",
1106
- $metadata,
1090
+ (0, smithy_client_1.throwDefaultError)({
1091
+ output,
1092
+ parsedBody,
1093
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1094
+ errorCode,
1107
1095
  });
1108
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1109
1096
  }
1110
1097
  };
1111
1098
  const deserializeAws_restJson1CreateRepositoryCommand = async (output, context) => {
1112
1099
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1113
1100
  return deserializeAws_restJson1CreateRepositoryCommandError(output, context);
1114
1101
  }
1115
- const contents = {
1102
+ const contents = map({
1116
1103
  $metadata: deserializeMetadata(output),
1117
- repository: undefined,
1118
- };
1104
+ });
1119
1105
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1120
- if (data.repository !== undefined && data.repository !== null) {
1106
+ if (data.repository != null) {
1121
1107
  contents.repository = deserializeAws_restJson1RepositoryDescription(data.repository, context);
1122
1108
  }
1123
- return Promise.resolve(contents);
1109
+ return contents;
1124
1110
  };
1125
1111
  exports.deserializeAws_restJson1CreateRepositoryCommand = deserializeAws_restJson1CreateRepositoryCommand;
1126
1112
  const deserializeAws_restJson1CreateRepositoryCommandError = async (output, context) => {
@@ -1128,7 +1114,6 @@ const deserializeAws_restJson1CreateRepositoryCommandError = async (output, cont
1128
1114
  ...output,
1129
1115
  body: await parseBody(output.body, context),
1130
1116
  };
1131
- let response;
1132
1117
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1133
1118
  switch (errorCode) {
1134
1119
  case "AccessDeniedException":
@@ -1154,29 +1139,26 @@ const deserializeAws_restJson1CreateRepositoryCommandError = async (output, cont
1154
1139
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1155
1140
  default:
1156
1141
  const parsedBody = parsedOutput.body;
1157
- const $metadata = deserializeMetadata(output);
1158
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1159
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1160
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1161
- $fault: "client",
1162
- $metadata,
1142
+ (0, smithy_client_1.throwDefaultError)({
1143
+ output,
1144
+ parsedBody,
1145
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1146
+ errorCode,
1163
1147
  });
1164
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1165
1148
  }
1166
1149
  };
1167
1150
  const deserializeAws_restJson1DeleteDomainCommand = async (output, context) => {
1168
1151
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1169
1152
  return deserializeAws_restJson1DeleteDomainCommandError(output, context);
1170
1153
  }
1171
- const contents = {
1154
+ const contents = map({
1172
1155
  $metadata: deserializeMetadata(output),
1173
- domain: undefined,
1174
- };
1156
+ });
1175
1157
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1176
- if (data.domain !== undefined && data.domain !== null) {
1158
+ if (data.domain != null) {
1177
1159
  contents.domain = deserializeAws_restJson1DomainDescription(data.domain, context);
1178
1160
  }
1179
- return Promise.resolve(contents);
1161
+ return contents;
1180
1162
  };
1181
1163
  exports.deserializeAws_restJson1DeleteDomainCommand = deserializeAws_restJson1DeleteDomainCommand;
1182
1164
  const deserializeAws_restJson1DeleteDomainCommandError = async (output, context) => {
@@ -1184,7 +1166,6 @@ const deserializeAws_restJson1DeleteDomainCommandError = async (output, context)
1184
1166
  ...output,
1185
1167
  body: await parseBody(output.body, context),
1186
1168
  };
1187
- let response;
1188
1169
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1189
1170
  switch (errorCode) {
1190
1171
  case "AccessDeniedException":
@@ -1204,29 +1185,26 @@ const deserializeAws_restJson1DeleteDomainCommandError = async (output, context)
1204
1185
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1205
1186
  default:
1206
1187
  const parsedBody = parsedOutput.body;
1207
- const $metadata = deserializeMetadata(output);
1208
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1209
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1210
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1211
- $fault: "client",
1212
- $metadata,
1188
+ (0, smithy_client_1.throwDefaultError)({
1189
+ output,
1190
+ parsedBody,
1191
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1192
+ errorCode,
1213
1193
  });
1214
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1215
1194
  }
1216
1195
  };
1217
1196
  const deserializeAws_restJson1DeleteDomainPermissionsPolicyCommand = async (output, context) => {
1218
1197
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1219
1198
  return deserializeAws_restJson1DeleteDomainPermissionsPolicyCommandError(output, context);
1220
1199
  }
1221
- const contents = {
1200
+ const contents = map({
1222
1201
  $metadata: deserializeMetadata(output),
1223
- policy: undefined,
1224
- };
1202
+ });
1225
1203
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1226
- if (data.policy !== undefined && data.policy !== null) {
1204
+ if (data.policy != null) {
1227
1205
  contents.policy = deserializeAws_restJson1ResourcePolicy(data.policy, context);
1228
1206
  }
1229
- return Promise.resolve(contents);
1207
+ return contents;
1230
1208
  };
1231
1209
  exports.deserializeAws_restJson1DeleteDomainPermissionsPolicyCommand = deserializeAws_restJson1DeleteDomainPermissionsPolicyCommand;
1232
1210
  const deserializeAws_restJson1DeleteDomainPermissionsPolicyCommandError = async (output, context) => {
@@ -1234,7 +1212,6 @@ const deserializeAws_restJson1DeleteDomainPermissionsPolicyCommandError = async
1234
1212
  ...output,
1235
1213
  body: await parseBody(output.body, context),
1236
1214
  };
1237
- let response;
1238
1215
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1239
1216
  switch (errorCode) {
1240
1217
  case "AccessDeniedException":
@@ -1257,33 +1234,29 @@ const deserializeAws_restJson1DeleteDomainPermissionsPolicyCommandError = async
1257
1234
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1258
1235
  default:
1259
1236
  const parsedBody = parsedOutput.body;
1260
- const $metadata = deserializeMetadata(output);
1261
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1262
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1263
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1264
- $fault: "client",
1265
- $metadata,
1237
+ (0, smithy_client_1.throwDefaultError)({
1238
+ output,
1239
+ parsedBody,
1240
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1241
+ errorCode,
1266
1242
  });
1267
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1268
1243
  }
1269
1244
  };
1270
1245
  const deserializeAws_restJson1DeletePackageVersionsCommand = async (output, context) => {
1271
1246
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1272
1247
  return deserializeAws_restJson1DeletePackageVersionsCommandError(output, context);
1273
1248
  }
1274
- const contents = {
1249
+ const contents = map({
1275
1250
  $metadata: deserializeMetadata(output),
1276
- failedVersions: undefined,
1277
- successfulVersions: undefined,
1278
- };
1251
+ });
1279
1252
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1280
- if (data.failedVersions !== undefined && data.failedVersions !== null) {
1253
+ if (data.failedVersions != null) {
1281
1254
  contents.failedVersions = deserializeAws_restJson1PackageVersionErrorMap(data.failedVersions, context);
1282
1255
  }
1283
- if (data.successfulVersions !== undefined && data.successfulVersions !== null) {
1256
+ if (data.successfulVersions != null) {
1284
1257
  contents.successfulVersions = deserializeAws_restJson1SuccessfulPackageVersionInfoMap(data.successfulVersions, context);
1285
1258
  }
1286
- return Promise.resolve(contents);
1259
+ return contents;
1287
1260
  };
1288
1261
  exports.deserializeAws_restJson1DeletePackageVersionsCommand = deserializeAws_restJson1DeletePackageVersionsCommand;
1289
1262
  const deserializeAws_restJson1DeletePackageVersionsCommandError = async (output, context) => {
@@ -1291,7 +1264,6 @@ const deserializeAws_restJson1DeletePackageVersionsCommandError = async (output,
1291
1264
  ...output,
1292
1265
  body: await parseBody(output.body, context),
1293
1266
  };
1294
- let response;
1295
1267
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1296
1268
  switch (errorCode) {
1297
1269
  case "AccessDeniedException":
@@ -1314,29 +1286,26 @@ const deserializeAws_restJson1DeletePackageVersionsCommandError = async (output,
1314
1286
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1315
1287
  default:
1316
1288
  const parsedBody = parsedOutput.body;
1317
- const $metadata = deserializeMetadata(output);
1318
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1319
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1320
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1321
- $fault: "client",
1322
- $metadata,
1289
+ (0, smithy_client_1.throwDefaultError)({
1290
+ output,
1291
+ parsedBody,
1292
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1293
+ errorCode,
1323
1294
  });
1324
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1325
1295
  }
1326
1296
  };
1327
1297
  const deserializeAws_restJson1DeleteRepositoryCommand = async (output, context) => {
1328
1298
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1329
1299
  return deserializeAws_restJson1DeleteRepositoryCommandError(output, context);
1330
1300
  }
1331
- const contents = {
1301
+ const contents = map({
1332
1302
  $metadata: deserializeMetadata(output),
1333
- repository: undefined,
1334
- };
1303
+ });
1335
1304
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1336
- if (data.repository !== undefined && data.repository !== null) {
1305
+ if (data.repository != null) {
1337
1306
  contents.repository = deserializeAws_restJson1RepositoryDescription(data.repository, context);
1338
1307
  }
1339
- return Promise.resolve(contents);
1308
+ return contents;
1340
1309
  };
1341
1310
  exports.deserializeAws_restJson1DeleteRepositoryCommand = deserializeAws_restJson1DeleteRepositoryCommand;
1342
1311
  const deserializeAws_restJson1DeleteRepositoryCommandError = async (output, context) => {
@@ -1344,7 +1313,6 @@ const deserializeAws_restJson1DeleteRepositoryCommandError = async (output, cont
1344
1313
  ...output,
1345
1314
  body: await parseBody(output.body, context),
1346
1315
  };
1347
- let response;
1348
1316
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1349
1317
  switch (errorCode) {
1350
1318
  case "AccessDeniedException":
@@ -1367,29 +1335,26 @@ const deserializeAws_restJson1DeleteRepositoryCommandError = async (output, cont
1367
1335
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1368
1336
  default:
1369
1337
  const parsedBody = parsedOutput.body;
1370
- const $metadata = deserializeMetadata(output);
1371
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1372
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1373
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1374
- $fault: "client",
1375
- $metadata,
1338
+ (0, smithy_client_1.throwDefaultError)({
1339
+ output,
1340
+ parsedBody,
1341
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1342
+ errorCode,
1376
1343
  });
1377
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1378
1344
  }
1379
1345
  };
1380
1346
  const deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommand = async (output, context) => {
1381
1347
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1382
1348
  return deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommandError(output, context);
1383
1349
  }
1384
- const contents = {
1350
+ const contents = map({
1385
1351
  $metadata: deserializeMetadata(output),
1386
- policy: undefined,
1387
- };
1352
+ });
1388
1353
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1389
- if (data.policy !== undefined && data.policy !== null) {
1354
+ if (data.policy != null) {
1390
1355
  contents.policy = deserializeAws_restJson1ResourcePolicy(data.policy, context);
1391
1356
  }
1392
- return Promise.resolve(contents);
1357
+ return contents;
1393
1358
  };
1394
1359
  exports.deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommand = deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommand;
1395
1360
  const deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommandError = async (output, context) => {
@@ -1397,7 +1362,6 @@ const deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommandError = as
1397
1362
  ...output,
1398
1363
  body: await parseBody(output.body, context),
1399
1364
  };
1400
- let response;
1401
1365
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1402
1366
  switch (errorCode) {
1403
1367
  case "AccessDeniedException":
@@ -1420,29 +1384,26 @@ const deserializeAws_restJson1DeleteRepositoryPermissionsPolicyCommandError = as
1420
1384
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1421
1385
  default:
1422
1386
  const parsedBody = parsedOutput.body;
1423
- const $metadata = deserializeMetadata(output);
1424
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1425
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1426
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1427
- $fault: "client",
1428
- $metadata,
1387
+ (0, smithy_client_1.throwDefaultError)({
1388
+ output,
1389
+ parsedBody,
1390
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1391
+ errorCode,
1429
1392
  });
1430
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1431
1393
  }
1432
1394
  };
1433
1395
  const deserializeAws_restJson1DescribeDomainCommand = async (output, context) => {
1434
1396
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1435
1397
  return deserializeAws_restJson1DescribeDomainCommandError(output, context);
1436
1398
  }
1437
- const contents = {
1399
+ const contents = map({
1438
1400
  $metadata: deserializeMetadata(output),
1439
- domain: undefined,
1440
- };
1401
+ });
1441
1402
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1442
- if (data.domain !== undefined && data.domain !== null) {
1403
+ if (data.domain != null) {
1443
1404
  contents.domain = deserializeAws_restJson1DomainDescription(data.domain, context);
1444
1405
  }
1445
- return Promise.resolve(contents);
1406
+ return contents;
1446
1407
  };
1447
1408
  exports.deserializeAws_restJson1DescribeDomainCommand = deserializeAws_restJson1DescribeDomainCommand;
1448
1409
  const deserializeAws_restJson1DescribeDomainCommandError = async (output, context) => {
@@ -1450,7 +1411,6 @@ const deserializeAws_restJson1DescribeDomainCommandError = async (output, contex
1450
1411
  ...output,
1451
1412
  body: await parseBody(output.body, context),
1452
1413
  };
1453
- let response;
1454
1414
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1455
1415
  switch (errorCode) {
1456
1416
  case "AccessDeniedException":
@@ -1470,29 +1430,26 @@ const deserializeAws_restJson1DescribeDomainCommandError = async (output, contex
1470
1430
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1471
1431
  default:
1472
1432
  const parsedBody = parsedOutput.body;
1473
- const $metadata = deserializeMetadata(output);
1474
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1475
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1476
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1477
- $fault: "client",
1478
- $metadata,
1433
+ (0, smithy_client_1.throwDefaultError)({
1434
+ output,
1435
+ parsedBody,
1436
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1437
+ errorCode,
1479
1438
  });
1480
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1481
1439
  }
1482
1440
  };
1483
1441
  const deserializeAws_restJson1DescribePackageCommand = async (output, context) => {
1484
1442
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1485
1443
  return deserializeAws_restJson1DescribePackageCommandError(output, context);
1486
1444
  }
1487
- const contents = {
1445
+ const contents = map({
1488
1446
  $metadata: deserializeMetadata(output),
1489
- package: undefined,
1490
- };
1447
+ });
1491
1448
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1492
- if (data.package !== undefined && data.package !== null) {
1449
+ if (data.package != null) {
1493
1450
  contents.package = deserializeAws_restJson1PackageDescription(data.package, context);
1494
1451
  }
1495
- return Promise.resolve(contents);
1452
+ return contents;
1496
1453
  };
1497
1454
  exports.deserializeAws_restJson1DescribePackageCommand = deserializeAws_restJson1DescribePackageCommand;
1498
1455
  const deserializeAws_restJson1DescribePackageCommandError = async (output, context) => {
@@ -1500,7 +1457,6 @@ const deserializeAws_restJson1DescribePackageCommandError = async (output, conte
1500
1457
  ...output,
1501
1458
  body: await parseBody(output.body, context),
1502
1459
  };
1503
- let response;
1504
1460
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1505
1461
  switch (errorCode) {
1506
1462
  case "AccessDeniedException":
@@ -1520,29 +1476,26 @@ const deserializeAws_restJson1DescribePackageCommandError = async (output, conte
1520
1476
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1521
1477
  default:
1522
1478
  const parsedBody = parsedOutput.body;
1523
- const $metadata = deserializeMetadata(output);
1524
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1525
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1526
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1527
- $fault: "client",
1528
- $metadata,
1479
+ (0, smithy_client_1.throwDefaultError)({
1480
+ output,
1481
+ parsedBody,
1482
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1483
+ errorCode,
1529
1484
  });
1530
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1531
1485
  }
1532
1486
  };
1533
1487
  const deserializeAws_restJson1DescribePackageVersionCommand = async (output, context) => {
1534
1488
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1535
1489
  return deserializeAws_restJson1DescribePackageVersionCommandError(output, context);
1536
1490
  }
1537
- const contents = {
1491
+ const contents = map({
1538
1492
  $metadata: deserializeMetadata(output),
1539
- packageVersion: undefined,
1540
- };
1493
+ });
1541
1494
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1542
- if (data.packageVersion !== undefined && data.packageVersion !== null) {
1495
+ if (data.packageVersion != null) {
1543
1496
  contents.packageVersion = deserializeAws_restJson1PackageVersionDescription(data.packageVersion, context);
1544
1497
  }
1545
- return Promise.resolve(contents);
1498
+ return contents;
1546
1499
  };
1547
1500
  exports.deserializeAws_restJson1DescribePackageVersionCommand = deserializeAws_restJson1DescribePackageVersionCommand;
1548
1501
  const deserializeAws_restJson1DescribePackageVersionCommandError = async (output, context) => {
@@ -1550,7 +1503,6 @@ const deserializeAws_restJson1DescribePackageVersionCommandError = async (output
1550
1503
  ...output,
1551
1504
  body: await parseBody(output.body, context),
1552
1505
  };
1553
- let response;
1554
1506
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1555
1507
  switch (errorCode) {
1556
1508
  case "AccessDeniedException":
@@ -1573,29 +1525,26 @@ const deserializeAws_restJson1DescribePackageVersionCommandError = async (output
1573
1525
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1574
1526
  default:
1575
1527
  const parsedBody = parsedOutput.body;
1576
- const $metadata = deserializeMetadata(output);
1577
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1578
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1579
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1580
- $fault: "client",
1581
- $metadata,
1528
+ (0, smithy_client_1.throwDefaultError)({
1529
+ output,
1530
+ parsedBody,
1531
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1532
+ errorCode,
1582
1533
  });
1583
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1584
1534
  }
1585
1535
  };
1586
1536
  const deserializeAws_restJson1DescribeRepositoryCommand = async (output, context) => {
1587
1537
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1588
1538
  return deserializeAws_restJson1DescribeRepositoryCommandError(output, context);
1589
1539
  }
1590
- const contents = {
1540
+ const contents = map({
1591
1541
  $metadata: deserializeMetadata(output),
1592
- repository: undefined,
1593
- };
1542
+ });
1594
1543
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1595
- if (data.repository !== undefined && data.repository !== null) {
1544
+ if (data.repository != null) {
1596
1545
  contents.repository = deserializeAws_restJson1RepositoryDescription(data.repository, context);
1597
1546
  }
1598
- return Promise.resolve(contents);
1547
+ return contents;
1599
1548
  };
1600
1549
  exports.deserializeAws_restJson1DescribeRepositoryCommand = deserializeAws_restJson1DescribeRepositoryCommand;
1601
1550
  const deserializeAws_restJson1DescribeRepositoryCommandError = async (output, context) => {
@@ -1603,7 +1552,6 @@ const deserializeAws_restJson1DescribeRepositoryCommandError = async (output, co
1603
1552
  ...output,
1604
1553
  body: await parseBody(output.body, context),
1605
1554
  };
1606
- let response;
1607
1555
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1608
1556
  switch (errorCode) {
1609
1557
  case "AccessDeniedException":
@@ -1623,29 +1571,26 @@ const deserializeAws_restJson1DescribeRepositoryCommandError = async (output, co
1623
1571
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1624
1572
  default:
1625
1573
  const parsedBody = parsedOutput.body;
1626
- const $metadata = deserializeMetadata(output);
1627
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1628
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1629
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1630
- $fault: "client",
1631
- $metadata,
1574
+ (0, smithy_client_1.throwDefaultError)({
1575
+ output,
1576
+ parsedBody,
1577
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1578
+ errorCode,
1632
1579
  });
1633
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1634
1580
  }
1635
1581
  };
1636
1582
  const deserializeAws_restJson1DisassociateExternalConnectionCommand = async (output, context) => {
1637
1583
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1638
1584
  return deserializeAws_restJson1DisassociateExternalConnectionCommandError(output, context);
1639
1585
  }
1640
- const contents = {
1586
+ const contents = map({
1641
1587
  $metadata: deserializeMetadata(output),
1642
- repository: undefined,
1643
- };
1588
+ });
1644
1589
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1645
- if (data.repository !== undefined && data.repository !== null) {
1590
+ if (data.repository != null) {
1646
1591
  contents.repository = deserializeAws_restJson1RepositoryDescription(data.repository, context);
1647
1592
  }
1648
- return Promise.resolve(contents);
1593
+ return contents;
1649
1594
  };
1650
1595
  exports.deserializeAws_restJson1DisassociateExternalConnectionCommand = deserializeAws_restJson1DisassociateExternalConnectionCommand;
1651
1596
  const deserializeAws_restJson1DisassociateExternalConnectionCommandError = async (output, context) => {
@@ -1653,7 +1598,6 @@ const deserializeAws_restJson1DisassociateExternalConnectionCommandError = async
1653
1598
  ...output,
1654
1599
  body: await parseBody(output.body, context),
1655
1600
  };
1656
- let response;
1657
1601
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1658
1602
  switch (errorCode) {
1659
1603
  case "AccessDeniedException":
@@ -1679,33 +1623,29 @@ const deserializeAws_restJson1DisassociateExternalConnectionCommandError = async
1679
1623
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1680
1624
  default:
1681
1625
  const parsedBody = parsedOutput.body;
1682
- const $metadata = deserializeMetadata(output);
1683
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1684
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1685
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1686
- $fault: "client",
1687
- $metadata,
1626
+ (0, smithy_client_1.throwDefaultError)({
1627
+ output,
1628
+ parsedBody,
1629
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1630
+ errorCode,
1688
1631
  });
1689
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1690
1632
  }
1691
1633
  };
1692
1634
  const deserializeAws_restJson1DisposePackageVersionsCommand = async (output, context) => {
1693
1635
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1694
1636
  return deserializeAws_restJson1DisposePackageVersionsCommandError(output, context);
1695
1637
  }
1696
- const contents = {
1638
+ const contents = map({
1697
1639
  $metadata: deserializeMetadata(output),
1698
- failedVersions: undefined,
1699
- successfulVersions: undefined,
1700
- };
1640
+ });
1701
1641
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1702
- if (data.failedVersions !== undefined && data.failedVersions !== null) {
1642
+ if (data.failedVersions != null) {
1703
1643
  contents.failedVersions = deserializeAws_restJson1PackageVersionErrorMap(data.failedVersions, context);
1704
1644
  }
1705
- if (data.successfulVersions !== undefined && data.successfulVersions !== null) {
1645
+ if (data.successfulVersions != null) {
1706
1646
  contents.successfulVersions = deserializeAws_restJson1SuccessfulPackageVersionInfoMap(data.successfulVersions, context);
1707
1647
  }
1708
- return Promise.resolve(contents);
1648
+ return contents;
1709
1649
  };
1710
1650
  exports.deserializeAws_restJson1DisposePackageVersionsCommand = deserializeAws_restJson1DisposePackageVersionsCommand;
1711
1651
  const deserializeAws_restJson1DisposePackageVersionsCommandError = async (output, context) => {
@@ -1713,7 +1653,6 @@ const deserializeAws_restJson1DisposePackageVersionsCommandError = async (output
1713
1653
  ...output,
1714
1654
  body: await parseBody(output.body, context),
1715
1655
  };
1716
- let response;
1717
1656
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1718
1657
  switch (errorCode) {
1719
1658
  case "AccessDeniedException":
@@ -1736,33 +1675,29 @@ const deserializeAws_restJson1DisposePackageVersionsCommandError = async (output
1736
1675
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1737
1676
  default:
1738
1677
  const parsedBody = parsedOutput.body;
1739
- const $metadata = deserializeMetadata(output);
1740
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1741
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1742
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1743
- $fault: "client",
1744
- $metadata,
1678
+ (0, smithy_client_1.throwDefaultError)({
1679
+ output,
1680
+ parsedBody,
1681
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1682
+ errorCode,
1745
1683
  });
1746
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1747
1684
  }
1748
1685
  };
1749
1686
  const deserializeAws_restJson1GetAuthorizationTokenCommand = async (output, context) => {
1750
1687
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1751
1688
  return deserializeAws_restJson1GetAuthorizationTokenCommandError(output, context);
1752
1689
  }
1753
- const contents = {
1690
+ const contents = map({
1754
1691
  $metadata: deserializeMetadata(output),
1755
- authorizationToken: undefined,
1756
- expiration: undefined,
1757
- };
1692
+ });
1758
1693
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1759
- if (data.authorizationToken !== undefined && data.authorizationToken !== null) {
1694
+ if (data.authorizationToken != null) {
1760
1695
  contents.authorizationToken = (0, smithy_client_1.expectString)(data.authorizationToken);
1761
1696
  }
1762
- if (data.expiration !== undefined && data.expiration !== null) {
1697
+ if (data.expiration != null) {
1763
1698
  contents.expiration = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.parseEpochTimestamp)((0, smithy_client_1.expectNumber)(data.expiration)));
1764
1699
  }
1765
- return Promise.resolve(contents);
1700
+ return contents;
1766
1701
  };
1767
1702
  exports.deserializeAws_restJson1GetAuthorizationTokenCommand = deserializeAws_restJson1GetAuthorizationTokenCommand;
1768
1703
  const deserializeAws_restJson1GetAuthorizationTokenCommandError = async (output, context) => {
@@ -1770,7 +1705,6 @@ const deserializeAws_restJson1GetAuthorizationTokenCommandError = async (output,
1770
1705
  ...output,
1771
1706
  body: await parseBody(output.body, context),
1772
1707
  };
1773
- let response;
1774
1708
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1775
1709
  switch (errorCode) {
1776
1710
  case "AccessDeniedException":
@@ -1790,29 +1724,26 @@ const deserializeAws_restJson1GetAuthorizationTokenCommandError = async (output,
1790
1724
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1791
1725
  default:
1792
1726
  const parsedBody = parsedOutput.body;
1793
- const $metadata = deserializeMetadata(output);
1794
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1795
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1796
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1797
- $fault: "client",
1798
- $metadata,
1727
+ (0, smithy_client_1.throwDefaultError)({
1728
+ output,
1729
+ parsedBody,
1730
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1731
+ errorCode,
1799
1732
  });
1800
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1801
1733
  }
1802
1734
  };
1803
1735
  const deserializeAws_restJson1GetDomainPermissionsPolicyCommand = async (output, context) => {
1804
1736
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1805
1737
  return deserializeAws_restJson1GetDomainPermissionsPolicyCommandError(output, context);
1806
1738
  }
1807
- const contents = {
1739
+ const contents = map({
1808
1740
  $metadata: deserializeMetadata(output),
1809
- policy: undefined,
1810
- };
1741
+ });
1811
1742
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1812
- if (data.policy !== undefined && data.policy !== null) {
1743
+ if (data.policy != null) {
1813
1744
  contents.policy = deserializeAws_restJson1ResourcePolicy(data.policy, context);
1814
1745
  }
1815
- return Promise.resolve(contents);
1746
+ return contents;
1816
1747
  };
1817
1748
  exports.deserializeAws_restJson1GetDomainPermissionsPolicyCommand = deserializeAws_restJson1GetDomainPermissionsPolicyCommand;
1818
1749
  const deserializeAws_restJson1GetDomainPermissionsPolicyCommandError = async (output, context) => {
@@ -1820,7 +1751,6 @@ const deserializeAws_restJson1GetDomainPermissionsPolicyCommandError = async (ou
1820
1751
  ...output,
1821
1752
  body: await parseBody(output.body, context),
1822
1753
  };
1823
- let response;
1824
1754
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1825
1755
  switch (errorCode) {
1826
1756
  case "AccessDeniedException":
@@ -1840,39 +1770,27 @@ const deserializeAws_restJson1GetDomainPermissionsPolicyCommandError = async (ou
1840
1770
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1841
1771
  default:
1842
1772
  const parsedBody = parsedOutput.body;
1843
- const $metadata = deserializeMetadata(output);
1844
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1845
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1846
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1847
- $fault: "client",
1848
- $metadata,
1773
+ (0, smithy_client_1.throwDefaultError)({
1774
+ output,
1775
+ parsedBody,
1776
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1777
+ errorCode,
1849
1778
  });
1850
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1851
1779
  }
1852
1780
  };
1853
1781
  const deserializeAws_restJson1GetPackageVersionAssetCommand = async (output, context) => {
1854
1782
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1855
1783
  return deserializeAws_restJson1GetPackageVersionAssetCommandError(output, context);
1856
1784
  }
1857
- const contents = {
1785
+ const contents = map({
1858
1786
  $metadata: deserializeMetadata(output),
1859
- asset: undefined,
1860
- assetName: undefined,
1861
- packageVersion: undefined,
1862
- packageVersionRevision: undefined,
1863
- };
1864
- if (output.headers["x-assetname"] !== undefined) {
1865
- contents.assetName = output.headers["x-assetname"];
1866
- }
1867
- if (output.headers["x-packageversion"] !== undefined) {
1868
- contents.packageVersion = output.headers["x-packageversion"];
1869
- }
1870
- if (output.headers["x-packageversionrevision"] !== undefined) {
1871
- contents.packageVersionRevision = output.headers["x-packageversionrevision"];
1872
- }
1787
+ assetName: [, output.headers["x-assetname"]],
1788
+ packageVersion: [, output.headers["x-packageversion"]],
1789
+ packageVersionRevision: [, output.headers["x-packageversionrevision"]],
1790
+ });
1873
1791
  const data = output.body;
1874
1792
  contents.asset = data;
1875
- return Promise.resolve(contents);
1793
+ return contents;
1876
1794
  };
1877
1795
  exports.deserializeAws_restJson1GetPackageVersionAssetCommand = deserializeAws_restJson1GetPackageVersionAssetCommand;
1878
1796
  const deserializeAws_restJson1GetPackageVersionAssetCommandError = async (output, context) => {
@@ -1880,7 +1798,6 @@ const deserializeAws_restJson1GetPackageVersionAssetCommandError = async (output
1880
1798
  ...output,
1881
1799
  body: await parseBody(output.body, context),
1882
1800
  };
1883
- let response;
1884
1801
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1885
1802
  switch (errorCode) {
1886
1803
  case "AccessDeniedException":
@@ -1903,49 +1820,41 @@ const deserializeAws_restJson1GetPackageVersionAssetCommandError = async (output
1903
1820
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1904
1821
  default:
1905
1822
  const parsedBody = parsedOutput.body;
1906
- const $metadata = deserializeMetadata(output);
1907
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1908
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1909
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1910
- $fault: "client",
1911
- $metadata,
1823
+ (0, smithy_client_1.throwDefaultError)({
1824
+ output,
1825
+ parsedBody,
1826
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1827
+ errorCode,
1912
1828
  });
1913
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1914
1829
  }
1915
1830
  };
1916
1831
  const deserializeAws_restJson1GetPackageVersionReadmeCommand = async (output, context) => {
1917
1832
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1918
1833
  return deserializeAws_restJson1GetPackageVersionReadmeCommandError(output, context);
1919
1834
  }
1920
- const contents = {
1835
+ const contents = map({
1921
1836
  $metadata: deserializeMetadata(output),
1922
- format: undefined,
1923
- namespace: undefined,
1924
- package: undefined,
1925
- readme: undefined,
1926
- version: undefined,
1927
- versionRevision: undefined,
1928
- };
1837
+ });
1929
1838
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1930
- if (data.format !== undefined && data.format !== null) {
1839
+ if (data.format != null) {
1931
1840
  contents.format = (0, smithy_client_1.expectString)(data.format);
1932
1841
  }
1933
- if (data.namespace !== undefined && data.namespace !== null) {
1842
+ if (data.namespace != null) {
1934
1843
  contents.namespace = (0, smithy_client_1.expectString)(data.namespace);
1935
1844
  }
1936
- if (data.package !== undefined && data.package !== null) {
1845
+ if (data.package != null) {
1937
1846
  contents.package = (0, smithy_client_1.expectString)(data.package);
1938
1847
  }
1939
- if (data.readme !== undefined && data.readme !== null) {
1848
+ if (data.readme != null) {
1940
1849
  contents.readme = (0, smithy_client_1.expectString)(data.readme);
1941
1850
  }
1942
- if (data.version !== undefined && data.version !== null) {
1851
+ if (data.version != null) {
1943
1852
  contents.version = (0, smithy_client_1.expectString)(data.version);
1944
1853
  }
1945
- if (data.versionRevision !== undefined && data.versionRevision !== null) {
1854
+ if (data.versionRevision != null) {
1946
1855
  contents.versionRevision = (0, smithy_client_1.expectString)(data.versionRevision);
1947
1856
  }
1948
- return Promise.resolve(contents);
1857
+ return contents;
1949
1858
  };
1950
1859
  exports.deserializeAws_restJson1GetPackageVersionReadmeCommand = deserializeAws_restJson1GetPackageVersionReadmeCommand;
1951
1860
  const deserializeAws_restJson1GetPackageVersionReadmeCommandError = async (output, context) => {
@@ -1953,7 +1862,6 @@ const deserializeAws_restJson1GetPackageVersionReadmeCommandError = async (outpu
1953
1862
  ...output,
1954
1863
  body: await parseBody(output.body, context),
1955
1864
  };
1956
- let response;
1957
1865
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
1958
1866
  switch (errorCode) {
1959
1867
  case "AccessDeniedException":
@@ -1973,29 +1881,26 @@ const deserializeAws_restJson1GetPackageVersionReadmeCommandError = async (outpu
1973
1881
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
1974
1882
  default:
1975
1883
  const parsedBody = parsedOutput.body;
1976
- const $metadata = deserializeMetadata(output);
1977
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
1978
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
1979
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
1980
- $fault: "client",
1981
- $metadata,
1884
+ (0, smithy_client_1.throwDefaultError)({
1885
+ output,
1886
+ parsedBody,
1887
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1888
+ errorCode,
1982
1889
  });
1983
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
1984
1890
  }
1985
1891
  };
1986
1892
  const deserializeAws_restJson1GetRepositoryEndpointCommand = async (output, context) => {
1987
1893
  if (output.statusCode !== 200 && output.statusCode >= 300) {
1988
1894
  return deserializeAws_restJson1GetRepositoryEndpointCommandError(output, context);
1989
1895
  }
1990
- const contents = {
1896
+ const contents = map({
1991
1897
  $metadata: deserializeMetadata(output),
1992
- repositoryEndpoint: undefined,
1993
- };
1898
+ });
1994
1899
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
1995
- if (data.repositoryEndpoint !== undefined && data.repositoryEndpoint !== null) {
1900
+ if (data.repositoryEndpoint != null) {
1996
1901
  contents.repositoryEndpoint = (0, smithy_client_1.expectString)(data.repositoryEndpoint);
1997
1902
  }
1998
- return Promise.resolve(contents);
1903
+ return contents;
1999
1904
  };
2000
1905
  exports.deserializeAws_restJson1GetRepositoryEndpointCommand = deserializeAws_restJson1GetRepositoryEndpointCommand;
2001
1906
  const deserializeAws_restJson1GetRepositoryEndpointCommandError = async (output, context) => {
@@ -2003,7 +1908,6 @@ const deserializeAws_restJson1GetRepositoryEndpointCommandError = async (output,
2003
1908
  ...output,
2004
1909
  body: await parseBody(output.body, context),
2005
1910
  };
2006
- let response;
2007
1911
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2008
1912
  switch (errorCode) {
2009
1913
  case "AccessDeniedException":
@@ -2023,29 +1927,26 @@ const deserializeAws_restJson1GetRepositoryEndpointCommandError = async (output,
2023
1927
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2024
1928
  default:
2025
1929
  const parsedBody = parsedOutput.body;
2026
- const $metadata = deserializeMetadata(output);
2027
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2028
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2029
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2030
- $fault: "client",
2031
- $metadata,
1930
+ (0, smithy_client_1.throwDefaultError)({
1931
+ output,
1932
+ parsedBody,
1933
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1934
+ errorCode,
2032
1935
  });
2033
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2034
1936
  }
2035
1937
  };
2036
1938
  const deserializeAws_restJson1GetRepositoryPermissionsPolicyCommand = async (output, context) => {
2037
1939
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2038
1940
  return deserializeAws_restJson1GetRepositoryPermissionsPolicyCommandError(output, context);
2039
1941
  }
2040
- const contents = {
1942
+ const contents = map({
2041
1943
  $metadata: deserializeMetadata(output),
2042
- policy: undefined,
2043
- };
1944
+ });
2044
1945
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2045
- if (data.policy !== undefined && data.policy !== null) {
1946
+ if (data.policy != null) {
2046
1947
  contents.policy = deserializeAws_restJson1ResourcePolicy(data.policy, context);
2047
1948
  }
2048
- return Promise.resolve(contents);
1949
+ return contents;
2049
1950
  };
2050
1951
  exports.deserializeAws_restJson1GetRepositoryPermissionsPolicyCommand = deserializeAws_restJson1GetRepositoryPermissionsPolicyCommand;
2051
1952
  const deserializeAws_restJson1GetRepositoryPermissionsPolicyCommandError = async (output, context) => {
@@ -2053,7 +1954,6 @@ const deserializeAws_restJson1GetRepositoryPermissionsPolicyCommandError = async
2053
1954
  ...output,
2054
1955
  body: await parseBody(output.body, context),
2055
1956
  };
2056
- let response;
2057
1957
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2058
1958
  switch (errorCode) {
2059
1959
  case "AccessDeniedException":
@@ -2073,33 +1973,29 @@ const deserializeAws_restJson1GetRepositoryPermissionsPolicyCommandError = async
2073
1973
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2074
1974
  default:
2075
1975
  const parsedBody = parsedOutput.body;
2076
- const $metadata = deserializeMetadata(output);
2077
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2078
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2079
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2080
- $fault: "client",
2081
- $metadata,
1976
+ (0, smithy_client_1.throwDefaultError)({
1977
+ output,
1978
+ parsedBody,
1979
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
1980
+ errorCode,
2082
1981
  });
2083
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2084
1982
  }
2085
1983
  };
2086
1984
  const deserializeAws_restJson1ListDomainsCommand = async (output, context) => {
2087
1985
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2088
1986
  return deserializeAws_restJson1ListDomainsCommandError(output, context);
2089
1987
  }
2090
- const contents = {
1988
+ const contents = map({
2091
1989
  $metadata: deserializeMetadata(output),
2092
- domains: undefined,
2093
- nextToken: undefined,
2094
- };
1990
+ });
2095
1991
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2096
- if (data.domains !== undefined && data.domains !== null) {
1992
+ if (data.domains != null) {
2097
1993
  contents.domains = deserializeAws_restJson1DomainSummaryList(data.domains, context);
2098
1994
  }
2099
- if (data.nextToken !== undefined && data.nextToken !== null) {
1995
+ if (data.nextToken != null) {
2100
1996
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2101
1997
  }
2102
- return Promise.resolve(contents);
1998
+ return contents;
2103
1999
  };
2104
2000
  exports.deserializeAws_restJson1ListDomainsCommand = deserializeAws_restJson1ListDomainsCommand;
2105
2001
  const deserializeAws_restJson1ListDomainsCommandError = async (output, context) => {
@@ -2107,7 +2003,6 @@ const deserializeAws_restJson1ListDomainsCommandError = async (output, context)
2107
2003
  ...output,
2108
2004
  body: await parseBody(output.body, context),
2109
2005
  };
2110
- let response;
2111
2006
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2112
2007
  switch (errorCode) {
2113
2008
  case "AccessDeniedException":
@@ -2124,33 +2019,29 @@ const deserializeAws_restJson1ListDomainsCommandError = async (output, context)
2124
2019
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2125
2020
  default:
2126
2021
  const parsedBody = parsedOutput.body;
2127
- const $metadata = deserializeMetadata(output);
2128
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2129
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2130
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2131
- $fault: "client",
2132
- $metadata,
2022
+ (0, smithy_client_1.throwDefaultError)({
2023
+ output,
2024
+ parsedBody,
2025
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2026
+ errorCode,
2133
2027
  });
2134
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2135
2028
  }
2136
2029
  };
2137
2030
  const deserializeAws_restJson1ListPackagesCommand = async (output, context) => {
2138
2031
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2139
2032
  return deserializeAws_restJson1ListPackagesCommandError(output, context);
2140
2033
  }
2141
- const contents = {
2034
+ const contents = map({
2142
2035
  $metadata: deserializeMetadata(output),
2143
- nextToken: undefined,
2144
- packages: undefined,
2145
- };
2036
+ });
2146
2037
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2147
- if (data.nextToken !== undefined && data.nextToken !== null) {
2038
+ if (data.nextToken != null) {
2148
2039
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2149
2040
  }
2150
- if (data.packages !== undefined && data.packages !== null) {
2041
+ if (data.packages != null) {
2151
2042
  contents.packages = deserializeAws_restJson1PackageSummaryList(data.packages, context);
2152
2043
  }
2153
- return Promise.resolve(contents);
2044
+ return contents;
2154
2045
  };
2155
2046
  exports.deserializeAws_restJson1ListPackagesCommand = deserializeAws_restJson1ListPackagesCommand;
2156
2047
  const deserializeAws_restJson1ListPackagesCommandError = async (output, context) => {
@@ -2158,7 +2049,6 @@ const deserializeAws_restJson1ListPackagesCommandError = async (output, context)
2158
2049
  ...output,
2159
2050
  body: await parseBody(output.body, context),
2160
2051
  };
2161
- let response;
2162
2052
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2163
2053
  switch (errorCode) {
2164
2054
  case "AccessDeniedException":
@@ -2178,53 +2068,44 @@ const deserializeAws_restJson1ListPackagesCommandError = async (output, context)
2178
2068
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2179
2069
  default:
2180
2070
  const parsedBody = parsedOutput.body;
2181
- const $metadata = deserializeMetadata(output);
2182
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2183
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2184
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2185
- $fault: "client",
2186
- $metadata,
2071
+ (0, smithy_client_1.throwDefaultError)({
2072
+ output,
2073
+ parsedBody,
2074
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2075
+ errorCode,
2187
2076
  });
2188
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2189
2077
  }
2190
2078
  };
2191
2079
  const deserializeAws_restJson1ListPackageVersionAssetsCommand = async (output, context) => {
2192
2080
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2193
2081
  return deserializeAws_restJson1ListPackageVersionAssetsCommandError(output, context);
2194
2082
  }
2195
- const contents = {
2083
+ const contents = map({
2196
2084
  $metadata: deserializeMetadata(output),
2197
- assets: undefined,
2198
- format: undefined,
2199
- namespace: undefined,
2200
- nextToken: undefined,
2201
- package: undefined,
2202
- version: undefined,
2203
- versionRevision: undefined,
2204
- };
2085
+ });
2205
2086
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2206
- if (data.assets !== undefined && data.assets !== null) {
2087
+ if (data.assets != null) {
2207
2088
  contents.assets = deserializeAws_restJson1AssetSummaryList(data.assets, context);
2208
2089
  }
2209
- if (data.format !== undefined && data.format !== null) {
2090
+ if (data.format != null) {
2210
2091
  contents.format = (0, smithy_client_1.expectString)(data.format);
2211
2092
  }
2212
- if (data.namespace !== undefined && data.namespace !== null) {
2093
+ if (data.namespace != null) {
2213
2094
  contents.namespace = (0, smithy_client_1.expectString)(data.namespace);
2214
2095
  }
2215
- if (data.nextToken !== undefined && data.nextToken !== null) {
2096
+ if (data.nextToken != null) {
2216
2097
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2217
2098
  }
2218
- if (data.package !== undefined && data.package !== null) {
2099
+ if (data.package != null) {
2219
2100
  contents.package = (0, smithy_client_1.expectString)(data.package);
2220
2101
  }
2221
- if (data.version !== undefined && data.version !== null) {
2102
+ if (data.version != null) {
2222
2103
  contents.version = (0, smithy_client_1.expectString)(data.version);
2223
2104
  }
2224
- if (data.versionRevision !== undefined && data.versionRevision !== null) {
2105
+ if (data.versionRevision != null) {
2225
2106
  contents.versionRevision = (0, smithy_client_1.expectString)(data.versionRevision);
2226
2107
  }
2227
- return Promise.resolve(contents);
2108
+ return contents;
2228
2109
  };
2229
2110
  exports.deserializeAws_restJson1ListPackageVersionAssetsCommand = deserializeAws_restJson1ListPackageVersionAssetsCommand;
2230
2111
  const deserializeAws_restJson1ListPackageVersionAssetsCommandError = async (output, context) => {
@@ -2232,7 +2113,6 @@ const deserializeAws_restJson1ListPackageVersionAssetsCommandError = async (outp
2232
2113
  ...output,
2233
2114
  body: await parseBody(output.body, context),
2234
2115
  };
2235
- let response;
2236
2116
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2237
2117
  switch (errorCode) {
2238
2118
  case "AccessDeniedException":
@@ -2252,53 +2132,44 @@ const deserializeAws_restJson1ListPackageVersionAssetsCommandError = async (outp
2252
2132
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2253
2133
  default:
2254
2134
  const parsedBody = parsedOutput.body;
2255
- const $metadata = deserializeMetadata(output);
2256
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2257
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2258
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2259
- $fault: "client",
2260
- $metadata,
2135
+ (0, smithy_client_1.throwDefaultError)({
2136
+ output,
2137
+ parsedBody,
2138
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2139
+ errorCode,
2261
2140
  });
2262
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2263
2141
  }
2264
2142
  };
2265
2143
  const deserializeAws_restJson1ListPackageVersionDependenciesCommand = async (output, context) => {
2266
2144
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2267
2145
  return deserializeAws_restJson1ListPackageVersionDependenciesCommandError(output, context);
2268
2146
  }
2269
- const contents = {
2147
+ const contents = map({
2270
2148
  $metadata: deserializeMetadata(output),
2271
- dependencies: undefined,
2272
- format: undefined,
2273
- namespace: undefined,
2274
- nextToken: undefined,
2275
- package: undefined,
2276
- version: undefined,
2277
- versionRevision: undefined,
2278
- };
2149
+ });
2279
2150
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2280
- if (data.dependencies !== undefined && data.dependencies !== null) {
2151
+ if (data.dependencies != null) {
2281
2152
  contents.dependencies = deserializeAws_restJson1PackageDependencyList(data.dependencies, context);
2282
2153
  }
2283
- if (data.format !== undefined && data.format !== null) {
2154
+ if (data.format != null) {
2284
2155
  contents.format = (0, smithy_client_1.expectString)(data.format);
2285
2156
  }
2286
- if (data.namespace !== undefined && data.namespace !== null) {
2157
+ if (data.namespace != null) {
2287
2158
  contents.namespace = (0, smithy_client_1.expectString)(data.namespace);
2288
2159
  }
2289
- if (data.nextToken !== undefined && data.nextToken !== null) {
2160
+ if (data.nextToken != null) {
2290
2161
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2291
2162
  }
2292
- if (data.package !== undefined && data.package !== null) {
2163
+ if (data.package != null) {
2293
2164
  contents.package = (0, smithy_client_1.expectString)(data.package);
2294
2165
  }
2295
- if (data.version !== undefined && data.version !== null) {
2166
+ if (data.version != null) {
2296
2167
  contents.version = (0, smithy_client_1.expectString)(data.version);
2297
2168
  }
2298
- if (data.versionRevision !== undefined && data.versionRevision !== null) {
2169
+ if (data.versionRevision != null) {
2299
2170
  contents.versionRevision = (0, smithy_client_1.expectString)(data.versionRevision);
2300
2171
  }
2301
- return Promise.resolve(contents);
2172
+ return contents;
2302
2173
  };
2303
2174
  exports.deserializeAws_restJson1ListPackageVersionDependenciesCommand = deserializeAws_restJson1ListPackageVersionDependenciesCommand;
2304
2175
  const deserializeAws_restJson1ListPackageVersionDependenciesCommandError = async (output, context) => {
@@ -2306,7 +2177,6 @@ const deserializeAws_restJson1ListPackageVersionDependenciesCommandError = async
2306
2177
  ...output,
2307
2178
  body: await parseBody(output.body, context),
2308
2179
  };
2309
- let response;
2310
2180
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2311
2181
  switch (errorCode) {
2312
2182
  case "AccessDeniedException":
@@ -2326,49 +2196,41 @@ const deserializeAws_restJson1ListPackageVersionDependenciesCommandError = async
2326
2196
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2327
2197
  default:
2328
2198
  const parsedBody = parsedOutput.body;
2329
- const $metadata = deserializeMetadata(output);
2330
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2331
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2332
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2333
- $fault: "client",
2334
- $metadata,
2199
+ (0, smithy_client_1.throwDefaultError)({
2200
+ output,
2201
+ parsedBody,
2202
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2203
+ errorCode,
2335
2204
  });
2336
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2337
2205
  }
2338
2206
  };
2339
2207
  const deserializeAws_restJson1ListPackageVersionsCommand = async (output, context) => {
2340
2208
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2341
2209
  return deserializeAws_restJson1ListPackageVersionsCommandError(output, context);
2342
2210
  }
2343
- const contents = {
2211
+ const contents = map({
2344
2212
  $metadata: deserializeMetadata(output),
2345
- defaultDisplayVersion: undefined,
2346
- format: undefined,
2347
- namespace: undefined,
2348
- nextToken: undefined,
2349
- package: undefined,
2350
- versions: undefined,
2351
- };
2213
+ });
2352
2214
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2353
- if (data.defaultDisplayVersion !== undefined && data.defaultDisplayVersion !== null) {
2215
+ if (data.defaultDisplayVersion != null) {
2354
2216
  contents.defaultDisplayVersion = (0, smithy_client_1.expectString)(data.defaultDisplayVersion);
2355
2217
  }
2356
- if (data.format !== undefined && data.format !== null) {
2218
+ if (data.format != null) {
2357
2219
  contents.format = (0, smithy_client_1.expectString)(data.format);
2358
2220
  }
2359
- if (data.namespace !== undefined && data.namespace !== null) {
2221
+ if (data.namespace != null) {
2360
2222
  contents.namespace = (0, smithy_client_1.expectString)(data.namespace);
2361
2223
  }
2362
- if (data.nextToken !== undefined && data.nextToken !== null) {
2224
+ if (data.nextToken != null) {
2363
2225
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2364
2226
  }
2365
- if (data.package !== undefined && data.package !== null) {
2227
+ if (data.package != null) {
2366
2228
  contents.package = (0, smithy_client_1.expectString)(data.package);
2367
2229
  }
2368
- if (data.versions !== undefined && data.versions !== null) {
2230
+ if (data.versions != null) {
2369
2231
  contents.versions = deserializeAws_restJson1PackageVersionSummaryList(data.versions, context);
2370
2232
  }
2371
- return Promise.resolve(contents);
2233
+ return contents;
2372
2234
  };
2373
2235
  exports.deserializeAws_restJson1ListPackageVersionsCommand = deserializeAws_restJson1ListPackageVersionsCommand;
2374
2236
  const deserializeAws_restJson1ListPackageVersionsCommandError = async (output, context) => {
@@ -2376,7 +2238,6 @@ const deserializeAws_restJson1ListPackageVersionsCommandError = async (output, c
2376
2238
  ...output,
2377
2239
  body: await parseBody(output.body, context),
2378
2240
  };
2379
- let response;
2380
2241
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2381
2242
  switch (errorCode) {
2382
2243
  case "AccessDeniedException":
@@ -2396,33 +2257,29 @@ const deserializeAws_restJson1ListPackageVersionsCommandError = async (output, c
2396
2257
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2397
2258
  default:
2398
2259
  const parsedBody = parsedOutput.body;
2399
- const $metadata = deserializeMetadata(output);
2400
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2401
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2402
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2403
- $fault: "client",
2404
- $metadata,
2260
+ (0, smithy_client_1.throwDefaultError)({
2261
+ output,
2262
+ parsedBody,
2263
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2264
+ errorCode,
2405
2265
  });
2406
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2407
2266
  }
2408
2267
  };
2409
2268
  const deserializeAws_restJson1ListRepositoriesCommand = async (output, context) => {
2410
2269
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2411
2270
  return deserializeAws_restJson1ListRepositoriesCommandError(output, context);
2412
2271
  }
2413
- const contents = {
2272
+ const contents = map({
2414
2273
  $metadata: deserializeMetadata(output),
2415
- nextToken: undefined,
2416
- repositories: undefined,
2417
- };
2274
+ });
2418
2275
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2419
- if (data.nextToken !== undefined && data.nextToken !== null) {
2276
+ if (data.nextToken != null) {
2420
2277
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2421
2278
  }
2422
- if (data.repositories !== undefined && data.repositories !== null) {
2279
+ if (data.repositories != null) {
2423
2280
  contents.repositories = deserializeAws_restJson1RepositorySummaryList(data.repositories, context);
2424
2281
  }
2425
- return Promise.resolve(contents);
2282
+ return contents;
2426
2283
  };
2427
2284
  exports.deserializeAws_restJson1ListRepositoriesCommand = deserializeAws_restJson1ListRepositoriesCommand;
2428
2285
  const deserializeAws_restJson1ListRepositoriesCommandError = async (output, context) => {
@@ -2430,7 +2287,6 @@ const deserializeAws_restJson1ListRepositoriesCommandError = async (output, cont
2430
2287
  ...output,
2431
2288
  body: await parseBody(output.body, context),
2432
2289
  };
2433
- let response;
2434
2290
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2435
2291
  switch (errorCode) {
2436
2292
  case "AccessDeniedException":
@@ -2447,33 +2303,29 @@ const deserializeAws_restJson1ListRepositoriesCommandError = async (output, cont
2447
2303
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2448
2304
  default:
2449
2305
  const parsedBody = parsedOutput.body;
2450
- const $metadata = deserializeMetadata(output);
2451
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2452
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2453
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2454
- $fault: "client",
2455
- $metadata,
2306
+ (0, smithy_client_1.throwDefaultError)({
2307
+ output,
2308
+ parsedBody,
2309
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2310
+ errorCode,
2456
2311
  });
2457
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2458
2312
  }
2459
2313
  };
2460
2314
  const deserializeAws_restJson1ListRepositoriesInDomainCommand = async (output, context) => {
2461
2315
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2462
2316
  return deserializeAws_restJson1ListRepositoriesInDomainCommandError(output, context);
2463
2317
  }
2464
- const contents = {
2318
+ const contents = map({
2465
2319
  $metadata: deserializeMetadata(output),
2466
- nextToken: undefined,
2467
- repositories: undefined,
2468
- };
2320
+ });
2469
2321
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2470
- if (data.nextToken !== undefined && data.nextToken !== null) {
2322
+ if (data.nextToken != null) {
2471
2323
  contents.nextToken = (0, smithy_client_1.expectString)(data.nextToken);
2472
2324
  }
2473
- if (data.repositories !== undefined && data.repositories !== null) {
2325
+ if (data.repositories != null) {
2474
2326
  contents.repositories = deserializeAws_restJson1RepositorySummaryList(data.repositories, context);
2475
2327
  }
2476
- return Promise.resolve(contents);
2328
+ return contents;
2477
2329
  };
2478
2330
  exports.deserializeAws_restJson1ListRepositoriesInDomainCommand = deserializeAws_restJson1ListRepositoriesInDomainCommand;
2479
2331
  const deserializeAws_restJson1ListRepositoriesInDomainCommandError = async (output, context) => {
@@ -2481,7 +2333,6 @@ const deserializeAws_restJson1ListRepositoriesInDomainCommandError = async (outp
2481
2333
  ...output,
2482
2334
  body: await parseBody(output.body, context),
2483
2335
  };
2484
- let response;
2485
2336
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2486
2337
  switch (errorCode) {
2487
2338
  case "AccessDeniedException":
@@ -2501,29 +2352,26 @@ const deserializeAws_restJson1ListRepositoriesInDomainCommandError = async (outp
2501
2352
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2502
2353
  default:
2503
2354
  const parsedBody = parsedOutput.body;
2504
- const $metadata = deserializeMetadata(output);
2505
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2506
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2507
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2508
- $fault: "client",
2509
- $metadata,
2355
+ (0, smithy_client_1.throwDefaultError)({
2356
+ output,
2357
+ parsedBody,
2358
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2359
+ errorCode,
2510
2360
  });
2511
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2512
2361
  }
2513
2362
  };
2514
2363
  const deserializeAws_restJson1ListTagsForResourceCommand = async (output, context) => {
2515
2364
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2516
2365
  return deserializeAws_restJson1ListTagsForResourceCommandError(output, context);
2517
2366
  }
2518
- const contents = {
2367
+ const contents = map({
2519
2368
  $metadata: deserializeMetadata(output),
2520
- tags: undefined,
2521
- };
2369
+ });
2522
2370
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2523
- if (data.tags !== undefined && data.tags !== null) {
2371
+ if (data.tags != null) {
2524
2372
  contents.tags = deserializeAws_restJson1TagList(data.tags, context);
2525
2373
  }
2526
- return Promise.resolve(contents);
2374
+ return contents;
2527
2375
  };
2528
2376
  exports.deserializeAws_restJson1ListTagsForResourceCommand = deserializeAws_restJson1ListTagsForResourceCommand;
2529
2377
  const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, context) => {
@@ -2531,7 +2379,6 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2531
2379
  ...output,
2532
2380
  body: await parseBody(output.body, context),
2533
2381
  };
2534
- let response;
2535
2382
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2536
2383
  switch (errorCode) {
2537
2384
  case "AccessDeniedException":
@@ -2548,29 +2395,26 @@ const deserializeAws_restJson1ListTagsForResourceCommandError = async (output, c
2548
2395
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2549
2396
  default:
2550
2397
  const parsedBody = parsedOutput.body;
2551
- const $metadata = deserializeMetadata(output);
2552
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2553
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2554
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2555
- $fault: "client",
2556
- $metadata,
2398
+ (0, smithy_client_1.throwDefaultError)({
2399
+ output,
2400
+ parsedBody,
2401
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2402
+ errorCode,
2557
2403
  });
2558
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2559
2404
  }
2560
2405
  };
2561
2406
  const deserializeAws_restJson1PutDomainPermissionsPolicyCommand = async (output, context) => {
2562
2407
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2563
2408
  return deserializeAws_restJson1PutDomainPermissionsPolicyCommandError(output, context);
2564
2409
  }
2565
- const contents = {
2410
+ const contents = map({
2566
2411
  $metadata: deserializeMetadata(output),
2567
- policy: undefined,
2568
- };
2412
+ });
2569
2413
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2570
- if (data.policy !== undefined && data.policy !== null) {
2414
+ if (data.policy != null) {
2571
2415
  contents.policy = deserializeAws_restJson1ResourcePolicy(data.policy, context);
2572
2416
  }
2573
- return Promise.resolve(contents);
2417
+ return contents;
2574
2418
  };
2575
2419
  exports.deserializeAws_restJson1PutDomainPermissionsPolicyCommand = deserializeAws_restJson1PutDomainPermissionsPolicyCommand;
2576
2420
  const deserializeAws_restJson1PutDomainPermissionsPolicyCommandError = async (output, context) => {
@@ -2578,7 +2422,6 @@ const deserializeAws_restJson1PutDomainPermissionsPolicyCommandError = async (ou
2578
2422
  ...output,
2579
2423
  body: await parseBody(output.body, context),
2580
2424
  };
2581
- let response;
2582
2425
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2583
2426
  switch (errorCode) {
2584
2427
  case "AccessDeniedException":
@@ -2604,29 +2447,26 @@ const deserializeAws_restJson1PutDomainPermissionsPolicyCommandError = async (ou
2604
2447
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2605
2448
  default:
2606
2449
  const parsedBody = parsedOutput.body;
2607
- const $metadata = deserializeMetadata(output);
2608
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2609
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2610
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2611
- $fault: "client",
2612
- $metadata,
2450
+ (0, smithy_client_1.throwDefaultError)({
2451
+ output,
2452
+ parsedBody,
2453
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2454
+ errorCode,
2613
2455
  });
2614
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2615
2456
  }
2616
2457
  };
2617
2458
  const deserializeAws_restJson1PutPackageOriginConfigurationCommand = async (output, context) => {
2618
2459
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2619
2460
  return deserializeAws_restJson1PutPackageOriginConfigurationCommandError(output, context);
2620
2461
  }
2621
- const contents = {
2462
+ const contents = map({
2622
2463
  $metadata: deserializeMetadata(output),
2623
- originConfiguration: undefined,
2624
- };
2464
+ });
2625
2465
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2626
- if (data.originConfiguration !== undefined && data.originConfiguration !== null) {
2466
+ if (data.originConfiguration != null) {
2627
2467
  contents.originConfiguration = deserializeAws_restJson1PackageOriginConfiguration(data.originConfiguration, context);
2628
2468
  }
2629
- return Promise.resolve(contents);
2469
+ return contents;
2630
2470
  };
2631
2471
  exports.deserializeAws_restJson1PutPackageOriginConfigurationCommand = deserializeAws_restJson1PutPackageOriginConfigurationCommand;
2632
2472
  const deserializeAws_restJson1PutPackageOriginConfigurationCommandError = async (output, context) => {
@@ -2634,7 +2474,6 @@ const deserializeAws_restJson1PutPackageOriginConfigurationCommandError = async
2634
2474
  ...output,
2635
2475
  body: await parseBody(output.body, context),
2636
2476
  };
2637
- let response;
2638
2477
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2639
2478
  switch (errorCode) {
2640
2479
  case "AccessDeniedException":
@@ -2654,29 +2493,26 @@ const deserializeAws_restJson1PutPackageOriginConfigurationCommandError = async
2654
2493
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2655
2494
  default:
2656
2495
  const parsedBody = parsedOutput.body;
2657
- const $metadata = deserializeMetadata(output);
2658
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2659
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2660
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2661
- $fault: "client",
2662
- $metadata,
2496
+ (0, smithy_client_1.throwDefaultError)({
2497
+ output,
2498
+ parsedBody,
2499
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2500
+ errorCode,
2663
2501
  });
2664
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2665
2502
  }
2666
2503
  };
2667
2504
  const deserializeAws_restJson1PutRepositoryPermissionsPolicyCommand = async (output, context) => {
2668
2505
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2669
2506
  return deserializeAws_restJson1PutRepositoryPermissionsPolicyCommandError(output, context);
2670
2507
  }
2671
- const contents = {
2508
+ const contents = map({
2672
2509
  $metadata: deserializeMetadata(output),
2673
- policy: undefined,
2674
- };
2510
+ });
2675
2511
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2676
- if (data.policy !== undefined && data.policy !== null) {
2512
+ if (data.policy != null) {
2677
2513
  contents.policy = deserializeAws_restJson1ResourcePolicy(data.policy, context);
2678
2514
  }
2679
- return Promise.resolve(contents);
2515
+ return contents;
2680
2516
  };
2681
2517
  exports.deserializeAws_restJson1PutRepositoryPermissionsPolicyCommand = deserializeAws_restJson1PutRepositoryPermissionsPolicyCommand;
2682
2518
  const deserializeAws_restJson1PutRepositoryPermissionsPolicyCommandError = async (output, context) => {
@@ -2684,7 +2520,6 @@ const deserializeAws_restJson1PutRepositoryPermissionsPolicyCommandError = async
2684
2520
  ...output,
2685
2521
  body: await parseBody(output.body, context),
2686
2522
  };
2687
- let response;
2688
2523
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2689
2524
  switch (errorCode) {
2690
2525
  case "AccessDeniedException":
@@ -2710,25 +2545,23 @@ const deserializeAws_restJson1PutRepositoryPermissionsPolicyCommandError = async
2710
2545
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2711
2546
  default:
2712
2547
  const parsedBody = parsedOutput.body;
2713
- const $metadata = deserializeMetadata(output);
2714
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2715
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2716
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2717
- $fault: "client",
2718
- $metadata,
2548
+ (0, smithy_client_1.throwDefaultError)({
2549
+ output,
2550
+ parsedBody,
2551
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2552
+ errorCode,
2719
2553
  });
2720
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2721
2554
  }
2722
2555
  };
2723
2556
  const deserializeAws_restJson1TagResourceCommand = async (output, context) => {
2724
2557
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2725
2558
  return deserializeAws_restJson1TagResourceCommandError(output, context);
2726
2559
  }
2727
- const contents = {
2560
+ const contents = map({
2728
2561
  $metadata: deserializeMetadata(output),
2729
- };
2562
+ });
2730
2563
  await collectBody(output.body, context);
2731
- return Promise.resolve(contents);
2564
+ return contents;
2732
2565
  };
2733
2566
  exports.deserializeAws_restJson1TagResourceCommand = deserializeAws_restJson1TagResourceCommand;
2734
2567
  const deserializeAws_restJson1TagResourceCommandError = async (output, context) => {
@@ -2736,7 +2569,6 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2736
2569
  ...output,
2737
2570
  body: await parseBody(output.body, context),
2738
2571
  };
2739
- let response;
2740
2572
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2741
2573
  switch (errorCode) {
2742
2574
  case "AccessDeniedException":
@@ -2756,25 +2588,23 @@ const deserializeAws_restJson1TagResourceCommandError = async (output, context)
2756
2588
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2757
2589
  default:
2758
2590
  const parsedBody = parsedOutput.body;
2759
- const $metadata = deserializeMetadata(output);
2760
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2761
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2762
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2763
- $fault: "client",
2764
- $metadata,
2591
+ (0, smithy_client_1.throwDefaultError)({
2592
+ output,
2593
+ parsedBody,
2594
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2595
+ errorCode,
2765
2596
  });
2766
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2767
2597
  }
2768
2598
  };
2769
2599
  const deserializeAws_restJson1UntagResourceCommand = async (output, context) => {
2770
2600
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2771
2601
  return deserializeAws_restJson1UntagResourceCommandError(output, context);
2772
2602
  }
2773
- const contents = {
2603
+ const contents = map({
2774
2604
  $metadata: deserializeMetadata(output),
2775
- };
2605
+ });
2776
2606
  await collectBody(output.body, context);
2777
- return Promise.resolve(contents);
2607
+ return contents;
2778
2608
  };
2779
2609
  exports.deserializeAws_restJson1UntagResourceCommand = deserializeAws_restJson1UntagResourceCommand;
2780
2610
  const deserializeAws_restJson1UntagResourceCommandError = async (output, context) => {
@@ -2782,7 +2612,6 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2782
2612
  ...output,
2783
2613
  body: await parseBody(output.body, context),
2784
2614
  };
2785
- let response;
2786
2615
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2787
2616
  switch (errorCode) {
2788
2617
  case "AccessDeniedException":
@@ -2799,33 +2628,29 @@ const deserializeAws_restJson1UntagResourceCommandError = async (output, context
2799
2628
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2800
2629
  default:
2801
2630
  const parsedBody = parsedOutput.body;
2802
- const $metadata = deserializeMetadata(output);
2803
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2804
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2805
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2806
- $fault: "client",
2807
- $metadata,
2631
+ (0, smithy_client_1.throwDefaultError)({
2632
+ output,
2633
+ parsedBody,
2634
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2635
+ errorCode,
2808
2636
  });
2809
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2810
2637
  }
2811
2638
  };
2812
2639
  const deserializeAws_restJson1UpdatePackageVersionsStatusCommand = async (output, context) => {
2813
2640
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2814
2641
  return deserializeAws_restJson1UpdatePackageVersionsStatusCommandError(output, context);
2815
2642
  }
2816
- const contents = {
2643
+ const contents = map({
2817
2644
  $metadata: deserializeMetadata(output),
2818
- failedVersions: undefined,
2819
- successfulVersions: undefined,
2820
- };
2645
+ });
2821
2646
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2822
- if (data.failedVersions !== undefined && data.failedVersions !== null) {
2647
+ if (data.failedVersions != null) {
2823
2648
  contents.failedVersions = deserializeAws_restJson1PackageVersionErrorMap(data.failedVersions, context);
2824
2649
  }
2825
- if (data.successfulVersions !== undefined && data.successfulVersions !== null) {
2650
+ if (data.successfulVersions != null) {
2826
2651
  contents.successfulVersions = deserializeAws_restJson1SuccessfulPackageVersionInfoMap(data.successfulVersions, context);
2827
2652
  }
2828
- return Promise.resolve(contents);
2653
+ return contents;
2829
2654
  };
2830
2655
  exports.deserializeAws_restJson1UpdatePackageVersionsStatusCommand = deserializeAws_restJson1UpdatePackageVersionsStatusCommand;
2831
2656
  const deserializeAws_restJson1UpdatePackageVersionsStatusCommandError = async (output, context) => {
@@ -2833,7 +2658,6 @@ const deserializeAws_restJson1UpdatePackageVersionsStatusCommandError = async (o
2833
2658
  ...output,
2834
2659
  body: await parseBody(output.body, context),
2835
2660
  };
2836
- let response;
2837
2661
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2838
2662
  switch (errorCode) {
2839
2663
  case "AccessDeniedException":
@@ -2856,29 +2680,26 @@ const deserializeAws_restJson1UpdatePackageVersionsStatusCommandError = async (o
2856
2680
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2857
2681
  default:
2858
2682
  const parsedBody = parsedOutput.body;
2859
- const $metadata = deserializeMetadata(output);
2860
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2861
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2862
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2863
- $fault: "client",
2864
- $metadata,
2683
+ (0, smithy_client_1.throwDefaultError)({
2684
+ output,
2685
+ parsedBody,
2686
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2687
+ errorCode,
2865
2688
  });
2866
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2867
2689
  }
2868
2690
  };
2869
2691
  const deserializeAws_restJson1UpdateRepositoryCommand = async (output, context) => {
2870
2692
  if (output.statusCode !== 200 && output.statusCode >= 300) {
2871
2693
  return deserializeAws_restJson1UpdateRepositoryCommandError(output, context);
2872
2694
  }
2873
- const contents = {
2695
+ const contents = map({
2874
2696
  $metadata: deserializeMetadata(output),
2875
- repository: undefined,
2876
- };
2697
+ });
2877
2698
  const data = (0, smithy_client_1.expectNonNull)((0, smithy_client_1.expectObject)(await parseBody(output.body, context)), "body");
2878
- if (data.repository !== undefined && data.repository !== null) {
2699
+ if (data.repository != null) {
2879
2700
  contents.repository = deserializeAws_restJson1RepositoryDescription(data.repository, context);
2880
2701
  }
2881
- return Promise.resolve(contents);
2702
+ return contents;
2882
2703
  };
2883
2704
  exports.deserializeAws_restJson1UpdateRepositoryCommand = deserializeAws_restJson1UpdateRepositoryCommand;
2884
2705
  const deserializeAws_restJson1UpdateRepositoryCommandError = async (output, context) => {
@@ -2886,7 +2707,6 @@ const deserializeAws_restJson1UpdateRepositoryCommandError = async (output, cont
2886
2707
  ...output,
2887
2708
  body: await parseBody(output.body, context),
2888
2709
  };
2889
- let response;
2890
2710
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
2891
2711
  switch (errorCode) {
2892
2712
  case "AccessDeniedException":
@@ -2912,20 +2732,19 @@ const deserializeAws_restJson1UpdateRepositoryCommandError = async (output, cont
2912
2732
  throw await deserializeAws_restJson1ValidationExceptionResponse(parsedOutput, context);
2913
2733
  default:
2914
2734
  const parsedBody = parsedOutput.body;
2915
- const $metadata = deserializeMetadata(output);
2916
- const statusCode = $metadata.httpStatusCode ? $metadata.httpStatusCode + "" : undefined;
2917
- response = new CodeartifactServiceException_1.CodeartifactServiceException({
2918
- name: parsedBody.code || parsedBody.Code || errorCode || statusCode || "UnknowError",
2919
- $fault: "client",
2920
- $metadata,
2735
+ (0, smithy_client_1.throwDefaultError)({
2736
+ output,
2737
+ parsedBody,
2738
+ exceptionCtor: CodeartifactServiceException_1.CodeartifactServiceException,
2739
+ errorCode,
2921
2740
  });
2922
- throw (0, smithy_client_1.decorateServiceException)(response, parsedBody);
2923
2741
  }
2924
2742
  };
2743
+ const map = smithy_client_1.map;
2925
2744
  const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutput, context) => {
2926
- const contents = {};
2745
+ const contents = map({});
2927
2746
  const data = parsedOutput.body;
2928
- if (data.message !== undefined && data.message !== null) {
2747
+ if (data.message != null) {
2929
2748
  contents.message = (0, smithy_client_1.expectString)(data.message);
2930
2749
  }
2931
2750
  const exception = new models_0_1.AccessDeniedException({
@@ -2935,15 +2754,15 @@ const deserializeAws_restJson1AccessDeniedExceptionResponse = async (parsedOutpu
2935
2754
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2936
2755
  };
2937
2756
  const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, context) => {
2938
- const contents = {};
2757
+ const contents = map({});
2939
2758
  const data = parsedOutput.body;
2940
- if (data.message !== undefined && data.message !== null) {
2759
+ if (data.message != null) {
2941
2760
  contents.message = (0, smithy_client_1.expectString)(data.message);
2942
2761
  }
2943
- if (data.resourceId !== undefined && data.resourceId !== null) {
2762
+ if (data.resourceId != null) {
2944
2763
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2945
2764
  }
2946
- if (data.resourceType !== undefined && data.resourceType !== null) {
2765
+ if (data.resourceType != null) {
2947
2766
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
2948
2767
  }
2949
2768
  const exception = new models_0_1.ConflictException({
@@ -2953,9 +2772,9 @@ const deserializeAws_restJson1ConflictExceptionResponse = async (parsedOutput, c
2953
2772
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2954
2773
  };
2955
2774
  const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOutput, context) => {
2956
- const contents = {};
2775
+ const contents = map({});
2957
2776
  const data = parsedOutput.body;
2958
- if (data.message !== undefined && data.message !== null) {
2777
+ if (data.message != null) {
2959
2778
  contents.message = (0, smithy_client_1.expectString)(data.message);
2960
2779
  }
2961
2780
  const exception = new models_0_1.InternalServerException({
@@ -2965,15 +2784,15 @@ const deserializeAws_restJson1InternalServerExceptionResponse = async (parsedOut
2965
2784
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2966
2785
  };
2967
2786
  const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedOutput, context) => {
2968
- const contents = {};
2787
+ const contents = map({});
2969
2788
  const data = parsedOutput.body;
2970
- if (data.message !== undefined && data.message !== null) {
2789
+ if (data.message != null) {
2971
2790
  contents.message = (0, smithy_client_1.expectString)(data.message);
2972
2791
  }
2973
- if (data.resourceId !== undefined && data.resourceId !== null) {
2792
+ if (data.resourceId != null) {
2974
2793
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2975
2794
  }
2976
- if (data.resourceType !== undefined && data.resourceType !== null) {
2795
+ if (data.resourceType != null) {
2977
2796
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
2978
2797
  }
2979
2798
  const exception = new models_0_1.ResourceNotFoundException({
@@ -2983,15 +2802,15 @@ const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async (parsedO
2983
2802
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
2984
2803
  };
2985
2804
  const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (parsedOutput, context) => {
2986
- const contents = {};
2805
+ const contents = map({});
2987
2806
  const data = parsedOutput.body;
2988
- if (data.message !== undefined && data.message !== null) {
2807
+ if (data.message != null) {
2989
2808
  contents.message = (0, smithy_client_1.expectString)(data.message);
2990
2809
  }
2991
- if (data.resourceId !== undefined && data.resourceId !== null) {
2810
+ if (data.resourceId != null) {
2992
2811
  contents.resourceId = (0, smithy_client_1.expectString)(data.resourceId);
2993
2812
  }
2994
- if (data.resourceType !== undefined && data.resourceType !== null) {
2813
+ if (data.resourceType != null) {
2995
2814
  contents.resourceType = (0, smithy_client_1.expectString)(data.resourceType);
2996
2815
  }
2997
2816
  const exception = new models_0_1.ServiceQuotaExceededException({
@@ -3001,12 +2820,14 @@ const deserializeAws_restJson1ServiceQuotaExceededExceptionResponse = async (par
3001
2820
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3002
2821
  };
3003
2822
  const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput, context) => {
3004
- const contents = {};
3005
- if (parsedOutput.headers["retry-after"] !== undefined) {
3006
- contents.retryAfterSeconds = (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]);
3007
- }
2823
+ const contents = map({
2824
+ retryAfterSeconds: [
2825
+ () => void 0 !== parsedOutput.headers["retry-after"],
2826
+ () => (0, smithy_client_1.strictParseInt32)(parsedOutput.headers["retry-after"]),
2827
+ ],
2828
+ });
3008
2829
  const data = parsedOutput.body;
3009
- if (data.message !== undefined && data.message !== null) {
2830
+ if (data.message != null) {
3010
2831
  contents.message = (0, smithy_client_1.expectString)(data.message);
3011
2832
  }
3012
2833
  const exception = new models_0_1.ThrottlingException({
@@ -3016,12 +2837,12 @@ const deserializeAws_restJson1ThrottlingExceptionResponse = async (parsedOutput,
3016
2837
  return (0, smithy_client_1.decorateServiceException)(exception, parsedOutput.body);
3017
2838
  };
3018
2839
  const deserializeAws_restJson1ValidationExceptionResponse = async (parsedOutput, context) => {
3019
- const contents = {};
2840
+ const contents = map({});
3020
2841
  const data = parsedOutput.body;
3021
- if (data.message !== undefined && data.message !== null) {
2842
+ if (data.message != null) {
3022
2843
  contents.message = (0, smithy_client_1.expectString)(data.message);
3023
2844
  }
3024
- if (data.reason !== undefined && data.reason !== null) {
2845
+ if (data.reason != null) {
3025
2846
  contents.reason = (0, smithy_client_1.expectString)(data.reason);
3026
2847
  }
3027
2848
  const exception = new models_0_1.ValidationException({
@@ -3040,9 +2861,6 @@ const serializeAws_restJson1PackageVersionList = (input, context) => {
3040
2861
  return input
3041
2862
  .filter((e) => e != null)
3042
2863
  .map((entry) => {
3043
- if (entry === null) {
3044
- return null;
3045
- }
3046
2864
  return entry;
3047
2865
  });
3048
2866
  };
@@ -3067,9 +2885,6 @@ const serializeAws_restJson1TagKeyList = (input, context) => {
3067
2885
  return input
3068
2886
  .filter((e) => e != null)
3069
2887
  .map((entry) => {
3070
- if (entry === null) {
3071
- return null;
3072
- }
3073
2888
  return entry;
3074
2889
  });
3075
2890
  };
@@ -3077,9 +2892,6 @@ const serializeAws_restJson1TagList = (input, context) => {
3077
2892
  return input
3078
2893
  .filter((e) => e != null)
3079
2894
  .map((entry) => {
3080
- if (entry === null) {
3081
- return null;
3082
- }
3083
2895
  return serializeAws_restJson1Tag(entry, context);
3084
2896
  });
3085
2897
  };
@@ -3092,9 +2904,6 @@ const serializeAws_restJson1UpstreamRepositoryList = (input, context) => {
3092
2904
  return input
3093
2905
  .filter((e) => e != null)
3094
2906
  .map((entry) => {
3095
- if (entry === null) {
3096
- return null;
3097
- }
3098
2907
  return serializeAws_restJson1UpstreamRepository(entry, context);
3099
2908
  });
3100
2909
  };