@aws-sdk/client-codestar-connections 3.310.0 → 3.315.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.
@@ -1,113 +1,77 @@
1
1
  import { HttpRequest as __HttpRequest } from "@aws-sdk/protocol-http";
2
- import { decorateServiceException as __decorateServiceException, expectString as __expectString, throwDefaultError, } from "@aws-sdk/smithy-client";
2
+ import { _json, decorateServiceException as __decorateServiceException, withBaseException, } from "@aws-sdk/smithy-client";
3
3
  import { CodeStarConnectionsServiceException as __BaseException } from "../models/CodeStarConnectionsServiceException";
4
4
  import { ConflictException, LimitExceededException, ResourceNotFoundException, ResourceUnavailableException, UnsupportedOperationException, } from "../models/models_0";
5
5
  export const se_CreateConnectionCommand = async (input, context) => {
6
- const headers = {
7
- "content-type": "application/x-amz-json-1.0",
8
- "x-amz-target": "CodeStar_connections_20191201.CreateConnection",
9
- };
6
+ const headers = sharedHeaders("CreateConnection");
10
7
  let body;
11
- body = JSON.stringify(se_CreateConnectionInput(input, context));
8
+ body = JSON.stringify(_json(input));
12
9
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
13
10
  };
14
11
  export const se_CreateHostCommand = async (input, context) => {
15
- const headers = {
16
- "content-type": "application/x-amz-json-1.0",
17
- "x-amz-target": "CodeStar_connections_20191201.CreateHost",
18
- };
12
+ const headers = sharedHeaders("CreateHost");
19
13
  let body;
20
- body = JSON.stringify(se_CreateHostInput(input, context));
14
+ body = JSON.stringify(_json(input));
21
15
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
22
16
  };
23
17
  export const se_DeleteConnectionCommand = async (input, context) => {
24
- const headers = {
25
- "content-type": "application/x-amz-json-1.0",
26
- "x-amz-target": "CodeStar_connections_20191201.DeleteConnection",
27
- };
18
+ const headers = sharedHeaders("DeleteConnection");
28
19
  let body;
29
- body = JSON.stringify(se_DeleteConnectionInput(input, context));
20
+ body = JSON.stringify(_json(input));
30
21
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
31
22
  };
32
23
  export const se_DeleteHostCommand = async (input, context) => {
33
- const headers = {
34
- "content-type": "application/x-amz-json-1.0",
35
- "x-amz-target": "CodeStar_connections_20191201.DeleteHost",
36
- };
24
+ const headers = sharedHeaders("DeleteHost");
37
25
  let body;
38
- body = JSON.stringify(se_DeleteHostInput(input, context));
26
+ body = JSON.stringify(_json(input));
39
27
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
40
28
  };
41
29
  export const se_GetConnectionCommand = async (input, context) => {
42
- const headers = {
43
- "content-type": "application/x-amz-json-1.0",
44
- "x-amz-target": "CodeStar_connections_20191201.GetConnection",
45
- };
30
+ const headers = sharedHeaders("GetConnection");
46
31
  let body;
47
- body = JSON.stringify(se_GetConnectionInput(input, context));
32
+ body = JSON.stringify(_json(input));
48
33
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
49
34
  };
50
35
  export const se_GetHostCommand = async (input, context) => {
51
- const headers = {
52
- "content-type": "application/x-amz-json-1.0",
53
- "x-amz-target": "CodeStar_connections_20191201.GetHost",
54
- };
36
+ const headers = sharedHeaders("GetHost");
55
37
  let body;
56
- body = JSON.stringify(se_GetHostInput(input, context));
38
+ body = JSON.stringify(_json(input));
57
39
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
58
40
  };
59
41
  export const se_ListConnectionsCommand = async (input, context) => {
60
- const headers = {
61
- "content-type": "application/x-amz-json-1.0",
62
- "x-amz-target": "CodeStar_connections_20191201.ListConnections",
63
- };
42
+ const headers = sharedHeaders("ListConnections");
64
43
  let body;
65
- body = JSON.stringify(se_ListConnectionsInput(input, context));
44
+ body = JSON.stringify(_json(input));
66
45
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
67
46
  };
68
47
  export const se_ListHostsCommand = async (input, context) => {
69
- const headers = {
70
- "content-type": "application/x-amz-json-1.0",
71
- "x-amz-target": "CodeStar_connections_20191201.ListHosts",
72
- };
48
+ const headers = sharedHeaders("ListHosts");
73
49
  let body;
74
- body = JSON.stringify(se_ListHostsInput(input, context));
50
+ body = JSON.stringify(_json(input));
75
51
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
76
52
  };
77
53
  export const se_ListTagsForResourceCommand = async (input, context) => {
78
- const headers = {
79
- "content-type": "application/x-amz-json-1.0",
80
- "x-amz-target": "CodeStar_connections_20191201.ListTagsForResource",
81
- };
54
+ const headers = sharedHeaders("ListTagsForResource");
82
55
  let body;
83
- body = JSON.stringify(se_ListTagsForResourceInput(input, context));
56
+ body = JSON.stringify(_json(input));
84
57
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
85
58
  };
86
59
  export const se_TagResourceCommand = async (input, context) => {
87
- const headers = {
88
- "content-type": "application/x-amz-json-1.0",
89
- "x-amz-target": "CodeStar_connections_20191201.TagResource",
90
- };
60
+ const headers = sharedHeaders("TagResource");
91
61
  let body;
92
- body = JSON.stringify(se_TagResourceInput(input, context));
62
+ body = JSON.stringify(_json(input));
93
63
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
94
64
  };
95
65
  export const se_UntagResourceCommand = async (input, context) => {
96
- const headers = {
97
- "content-type": "application/x-amz-json-1.0",
98
- "x-amz-target": "CodeStar_connections_20191201.UntagResource",
99
- };
66
+ const headers = sharedHeaders("UntagResource");
100
67
  let body;
101
- body = JSON.stringify(se_UntagResourceInput(input, context));
68
+ body = JSON.stringify(_json(input));
102
69
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
103
70
  };
104
71
  export const se_UpdateHostCommand = async (input, context) => {
105
- const headers = {
106
- "content-type": "application/x-amz-json-1.0",
107
- "x-amz-target": "CodeStar_connections_20191201.UpdateHost",
108
- };
72
+ const headers = sharedHeaders("UpdateHost");
109
73
  let body;
110
- body = JSON.stringify(se_UpdateHostInput(input, context));
74
+ body = JSON.stringify(_json(input));
111
75
  return buildHttpRpcRequest(context, headers, "/", undefined, body);
112
76
  };
113
77
  export const de_CreateConnectionCommand = async (output, context) => {
@@ -116,12 +80,12 @@ export const de_CreateConnectionCommand = async (output, context) => {
116
80
  }
117
81
  const data = await parseBody(output.body, context);
118
82
  let contents = {};
119
- contents = de_CreateConnectionOutput(data, context);
83
+ contents = _json(data);
120
84
  const response = {
121
85
  $metadata: deserializeMetadata(output),
122
86
  ...contents,
123
87
  };
124
- return Promise.resolve(response);
88
+ return response;
125
89
  };
126
90
  const de_CreateConnectionCommandError = async (output, context) => {
127
91
  const parsedOutput = {
@@ -141,10 +105,9 @@ const de_CreateConnectionCommandError = async (output, context) => {
141
105
  throw await de_ResourceUnavailableExceptionRes(parsedOutput, context);
142
106
  default:
143
107
  const parsedBody = parsedOutput.body;
144
- throwDefaultError({
108
+ return throwDefaultError({
145
109
  output,
146
110
  parsedBody,
147
- exceptionCtor: __BaseException,
148
111
  errorCode,
149
112
  });
150
113
  }
@@ -155,12 +118,12 @@ export const de_CreateHostCommand = async (output, context) => {
155
118
  }
156
119
  const data = await parseBody(output.body, context);
157
120
  let contents = {};
158
- contents = de_CreateHostOutput(data, context);
121
+ contents = _json(data);
159
122
  const response = {
160
123
  $metadata: deserializeMetadata(output),
161
124
  ...contents,
162
125
  };
163
- return Promise.resolve(response);
126
+ return response;
164
127
  };
165
128
  const de_CreateHostCommandError = async (output, context) => {
166
129
  const parsedOutput = {
@@ -174,10 +137,9 @@ const de_CreateHostCommandError = async (output, context) => {
174
137
  throw await de_LimitExceededExceptionRes(parsedOutput, context);
175
138
  default:
176
139
  const parsedBody = parsedOutput.body;
177
- throwDefaultError({
140
+ return throwDefaultError({
178
141
  output,
179
142
  parsedBody,
180
- exceptionCtor: __BaseException,
181
143
  errorCode,
182
144
  });
183
145
  }
@@ -188,12 +150,12 @@ export const de_DeleteConnectionCommand = async (output, context) => {
188
150
  }
189
151
  const data = await parseBody(output.body, context);
190
152
  let contents = {};
191
- contents = de_DeleteConnectionOutput(data, context);
153
+ contents = _json(data);
192
154
  const response = {
193
155
  $metadata: deserializeMetadata(output),
194
156
  ...contents,
195
157
  };
196
- return Promise.resolve(response);
158
+ return response;
197
159
  };
198
160
  const de_DeleteConnectionCommandError = async (output, context) => {
199
161
  const parsedOutput = {
@@ -207,10 +169,9 @@ const de_DeleteConnectionCommandError = async (output, context) => {
207
169
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
208
170
  default:
209
171
  const parsedBody = parsedOutput.body;
210
- throwDefaultError({
172
+ return throwDefaultError({
211
173
  output,
212
174
  parsedBody,
213
- exceptionCtor: __BaseException,
214
175
  errorCode,
215
176
  });
216
177
  }
@@ -221,12 +182,12 @@ export const de_DeleteHostCommand = async (output, context) => {
221
182
  }
222
183
  const data = await parseBody(output.body, context);
223
184
  let contents = {};
224
- contents = de_DeleteHostOutput(data, context);
185
+ contents = _json(data);
225
186
  const response = {
226
187
  $metadata: deserializeMetadata(output),
227
188
  ...contents,
228
189
  };
229
- return Promise.resolve(response);
190
+ return response;
230
191
  };
231
192
  const de_DeleteHostCommandError = async (output, context) => {
232
193
  const parsedOutput = {
@@ -243,10 +204,9 @@ const de_DeleteHostCommandError = async (output, context) => {
243
204
  throw await de_ResourceUnavailableExceptionRes(parsedOutput, context);
244
205
  default:
245
206
  const parsedBody = parsedOutput.body;
246
- throwDefaultError({
207
+ return throwDefaultError({
247
208
  output,
248
209
  parsedBody,
249
- exceptionCtor: __BaseException,
250
210
  errorCode,
251
211
  });
252
212
  }
@@ -257,12 +217,12 @@ export const de_GetConnectionCommand = async (output, context) => {
257
217
  }
258
218
  const data = await parseBody(output.body, context);
259
219
  let contents = {};
260
- contents = de_GetConnectionOutput(data, context);
220
+ contents = _json(data);
261
221
  const response = {
262
222
  $metadata: deserializeMetadata(output),
263
223
  ...contents,
264
224
  };
265
- return Promise.resolve(response);
225
+ return response;
266
226
  };
267
227
  const de_GetConnectionCommandError = async (output, context) => {
268
228
  const parsedOutput = {
@@ -279,10 +239,9 @@ const de_GetConnectionCommandError = async (output, context) => {
279
239
  throw await de_ResourceUnavailableExceptionRes(parsedOutput, context);
280
240
  default:
281
241
  const parsedBody = parsedOutput.body;
282
- throwDefaultError({
242
+ return throwDefaultError({
283
243
  output,
284
244
  parsedBody,
285
- exceptionCtor: __BaseException,
286
245
  errorCode,
287
246
  });
288
247
  }
@@ -293,12 +252,12 @@ export const de_GetHostCommand = async (output, context) => {
293
252
  }
294
253
  const data = await parseBody(output.body, context);
295
254
  let contents = {};
296
- contents = de_GetHostOutput(data, context);
255
+ contents = _json(data);
297
256
  const response = {
298
257
  $metadata: deserializeMetadata(output),
299
258
  ...contents,
300
259
  };
301
- return Promise.resolve(response);
260
+ return response;
302
261
  };
303
262
  const de_GetHostCommandError = async (output, context) => {
304
263
  const parsedOutput = {
@@ -315,10 +274,9 @@ const de_GetHostCommandError = async (output, context) => {
315
274
  throw await de_ResourceUnavailableExceptionRes(parsedOutput, context);
316
275
  default:
317
276
  const parsedBody = parsedOutput.body;
318
- throwDefaultError({
277
+ return throwDefaultError({
319
278
  output,
320
279
  parsedBody,
321
- exceptionCtor: __BaseException,
322
280
  errorCode,
323
281
  });
324
282
  }
@@ -329,12 +287,12 @@ export const de_ListConnectionsCommand = async (output, context) => {
329
287
  }
330
288
  const data = await parseBody(output.body, context);
331
289
  let contents = {};
332
- contents = de_ListConnectionsOutput(data, context);
290
+ contents = _json(data);
333
291
  const response = {
334
292
  $metadata: deserializeMetadata(output),
335
293
  ...contents,
336
294
  };
337
- return Promise.resolve(response);
295
+ return response;
338
296
  };
339
297
  const de_ListConnectionsCommandError = async (output, context) => {
340
298
  const parsedOutput = {
@@ -343,10 +301,9 @@ const de_ListConnectionsCommandError = async (output, context) => {
343
301
  };
344
302
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
345
303
  const parsedBody = parsedOutput.body;
346
- throwDefaultError({
304
+ return throwDefaultError({
347
305
  output,
348
306
  parsedBody,
349
- exceptionCtor: __BaseException,
350
307
  errorCode,
351
308
  });
352
309
  };
@@ -356,12 +313,12 @@ export const de_ListHostsCommand = async (output, context) => {
356
313
  }
357
314
  const data = await parseBody(output.body, context);
358
315
  let contents = {};
359
- contents = de_ListHostsOutput(data, context);
316
+ contents = _json(data);
360
317
  const response = {
361
318
  $metadata: deserializeMetadata(output),
362
319
  ...contents,
363
320
  };
364
- return Promise.resolve(response);
321
+ return response;
365
322
  };
366
323
  const de_ListHostsCommandError = async (output, context) => {
367
324
  const parsedOutput = {
@@ -370,10 +327,9 @@ const de_ListHostsCommandError = async (output, context) => {
370
327
  };
371
328
  const errorCode = loadRestJsonErrorCode(output, parsedOutput.body);
372
329
  const parsedBody = parsedOutput.body;
373
- throwDefaultError({
330
+ return throwDefaultError({
374
331
  output,
375
332
  parsedBody,
376
- exceptionCtor: __BaseException,
377
333
  errorCode,
378
334
  });
379
335
  };
@@ -383,12 +339,12 @@ export const de_ListTagsForResourceCommand = async (output, context) => {
383
339
  }
384
340
  const data = await parseBody(output.body, context);
385
341
  let contents = {};
386
- contents = de_ListTagsForResourceOutput(data, context);
342
+ contents = _json(data);
387
343
  const response = {
388
344
  $metadata: deserializeMetadata(output),
389
345
  ...contents,
390
346
  };
391
- return Promise.resolve(response);
347
+ return response;
392
348
  };
393
349
  const de_ListTagsForResourceCommandError = async (output, context) => {
394
350
  const parsedOutput = {
@@ -402,10 +358,9 @@ const de_ListTagsForResourceCommandError = async (output, context) => {
402
358
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
403
359
  default:
404
360
  const parsedBody = parsedOutput.body;
405
- throwDefaultError({
361
+ return throwDefaultError({
406
362
  output,
407
363
  parsedBody,
408
- exceptionCtor: __BaseException,
409
364
  errorCode,
410
365
  });
411
366
  }
@@ -416,12 +371,12 @@ export const de_TagResourceCommand = async (output, context) => {
416
371
  }
417
372
  const data = await parseBody(output.body, context);
418
373
  let contents = {};
419
- contents = de_TagResourceOutput(data, context);
374
+ contents = _json(data);
420
375
  const response = {
421
376
  $metadata: deserializeMetadata(output),
422
377
  ...contents,
423
378
  };
424
- return Promise.resolve(response);
379
+ return response;
425
380
  };
426
381
  const de_TagResourceCommandError = async (output, context) => {
427
382
  const parsedOutput = {
@@ -438,10 +393,9 @@ const de_TagResourceCommandError = async (output, context) => {
438
393
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
439
394
  default:
440
395
  const parsedBody = parsedOutput.body;
441
- throwDefaultError({
396
+ return throwDefaultError({
442
397
  output,
443
398
  parsedBody,
444
- exceptionCtor: __BaseException,
445
399
  errorCode,
446
400
  });
447
401
  }
@@ -452,12 +406,12 @@ export const de_UntagResourceCommand = async (output, context) => {
452
406
  }
453
407
  const data = await parseBody(output.body, context);
454
408
  let contents = {};
455
- contents = de_UntagResourceOutput(data, context);
409
+ contents = _json(data);
456
410
  const response = {
457
411
  $metadata: deserializeMetadata(output),
458
412
  ...contents,
459
413
  };
460
- return Promise.resolve(response);
414
+ return response;
461
415
  };
462
416
  const de_UntagResourceCommandError = async (output, context) => {
463
417
  const parsedOutput = {
@@ -471,10 +425,9 @@ const de_UntagResourceCommandError = async (output, context) => {
471
425
  throw await de_ResourceNotFoundExceptionRes(parsedOutput, context);
472
426
  default:
473
427
  const parsedBody = parsedOutput.body;
474
- throwDefaultError({
428
+ return throwDefaultError({
475
429
  output,
476
430
  parsedBody,
477
- exceptionCtor: __BaseException,
478
431
  errorCode,
479
432
  });
480
433
  }
@@ -485,12 +438,12 @@ export const de_UpdateHostCommand = async (output, context) => {
485
438
  }
486
439
  const data = await parseBody(output.body, context);
487
440
  let contents = {};
488
- contents = de_UpdateHostOutput(data, context);
441
+ contents = _json(data);
489
442
  const response = {
490
443
  $metadata: deserializeMetadata(output),
491
444
  ...contents,
492
445
  };
493
- return Promise.resolve(response);
446
+ return response;
494
447
  };
495
448
  const de_UpdateHostCommandError = async (output, context) => {
496
449
  const parsedOutput = {
@@ -513,17 +466,16 @@ const de_UpdateHostCommandError = async (output, context) => {
513
466
  throw await de_UnsupportedOperationExceptionRes(parsedOutput, context);
514
467
  default:
515
468
  const parsedBody = parsedOutput.body;
516
- throwDefaultError({
469
+ return throwDefaultError({
517
470
  output,
518
471
  parsedBody,
519
- exceptionCtor: __BaseException,
520
472
  errorCode,
521
473
  });
522
474
  }
523
475
  };
524
476
  const de_ConflictExceptionRes = async (parsedOutput, context) => {
525
477
  const body = parsedOutput.body;
526
- const deserialized = de_ConflictException(body, context);
478
+ const deserialized = _json(body);
527
479
  const exception = new ConflictException({
528
480
  $metadata: deserializeMetadata(parsedOutput),
529
481
  ...deserialized,
@@ -532,7 +484,7 @@ const de_ConflictExceptionRes = async (parsedOutput, context) => {
532
484
  };
533
485
  const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
534
486
  const body = parsedOutput.body;
535
- const deserialized = de_LimitExceededException(body, context);
487
+ const deserialized = _json(body);
536
488
  const exception = new LimitExceededException({
537
489
  $metadata: deserializeMetadata(parsedOutput),
538
490
  ...deserialized,
@@ -541,7 +493,7 @@ const de_LimitExceededExceptionRes = async (parsedOutput, context) => {
541
493
  };
542
494
  const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
543
495
  const body = parsedOutput.body;
544
- const deserialized = de_ResourceNotFoundException(body, context);
496
+ const deserialized = _json(body);
545
497
  const exception = new ResourceNotFoundException({
546
498
  $metadata: deserializeMetadata(parsedOutput),
547
499
  ...deserialized,
@@ -550,7 +502,7 @@ const de_ResourceNotFoundExceptionRes = async (parsedOutput, context) => {
550
502
  };
551
503
  const de_ResourceUnavailableExceptionRes = async (parsedOutput, context) => {
552
504
  const body = parsedOutput.body;
553
- const deserialized = de_ResourceUnavailableException(body, context);
505
+ const deserialized = _json(body);
554
506
  const exception = new ResourceUnavailableException({
555
507
  $metadata: deserializeMetadata(parsedOutput),
556
508
  ...deserialized,
@@ -559,303 +511,13 @@ const de_ResourceUnavailableExceptionRes = async (parsedOutput, context) => {
559
511
  };
560
512
  const de_UnsupportedOperationExceptionRes = async (parsedOutput, context) => {
561
513
  const body = parsedOutput.body;
562
- const deserialized = de_UnsupportedOperationException(body, context);
514
+ const deserialized = _json(body);
563
515
  const exception = new UnsupportedOperationException({
564
516
  $metadata: deserializeMetadata(parsedOutput),
565
517
  ...deserialized,
566
518
  });
567
519
  return __decorateServiceException(exception, body);
568
520
  };
569
- const se_CreateConnectionInput = (input, context) => {
570
- return {
571
- ...(input.ConnectionName != null && { ConnectionName: input.ConnectionName }),
572
- ...(input.HostArn != null && { HostArn: input.HostArn }),
573
- ...(input.ProviderType != null && { ProviderType: input.ProviderType }),
574
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
575
- };
576
- };
577
- const se_CreateHostInput = (input, context) => {
578
- return {
579
- ...(input.Name != null && { Name: input.Name }),
580
- ...(input.ProviderEndpoint != null && { ProviderEndpoint: input.ProviderEndpoint }),
581
- ...(input.ProviderType != null && { ProviderType: input.ProviderType }),
582
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
583
- ...(input.VpcConfiguration != null && { VpcConfiguration: se_VpcConfiguration(input.VpcConfiguration, context) }),
584
- };
585
- };
586
- const se_DeleteConnectionInput = (input, context) => {
587
- return {
588
- ...(input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn }),
589
- };
590
- };
591
- const se_DeleteHostInput = (input, context) => {
592
- return {
593
- ...(input.HostArn != null && { HostArn: input.HostArn }),
594
- };
595
- };
596
- const se_GetConnectionInput = (input, context) => {
597
- return {
598
- ...(input.ConnectionArn != null && { ConnectionArn: input.ConnectionArn }),
599
- };
600
- };
601
- const se_GetHostInput = (input, context) => {
602
- return {
603
- ...(input.HostArn != null && { HostArn: input.HostArn }),
604
- };
605
- };
606
- const se_ListConnectionsInput = (input, context) => {
607
- return {
608
- ...(input.HostArnFilter != null && { HostArnFilter: input.HostArnFilter }),
609
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
610
- ...(input.NextToken != null && { NextToken: input.NextToken }),
611
- ...(input.ProviderTypeFilter != null && { ProviderTypeFilter: input.ProviderTypeFilter }),
612
- };
613
- };
614
- const se_ListHostsInput = (input, context) => {
615
- return {
616
- ...(input.MaxResults != null && { MaxResults: input.MaxResults }),
617
- ...(input.NextToken != null && { NextToken: input.NextToken }),
618
- };
619
- };
620
- const se_ListTagsForResourceInput = (input, context) => {
621
- return {
622
- ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
623
- };
624
- };
625
- const se_SecurityGroupIds = (input, context) => {
626
- return input
627
- .filter((e) => e != null)
628
- .map((entry) => {
629
- return entry;
630
- });
631
- };
632
- const se_SubnetIds = (input, context) => {
633
- return input
634
- .filter((e) => e != null)
635
- .map((entry) => {
636
- return entry;
637
- });
638
- };
639
- const se_Tag = (input, context) => {
640
- return {
641
- ...(input.Key != null && { Key: input.Key }),
642
- ...(input.Value != null && { Value: input.Value }),
643
- };
644
- };
645
- const se_TagKeyList = (input, context) => {
646
- return input
647
- .filter((e) => e != null)
648
- .map((entry) => {
649
- return entry;
650
- });
651
- };
652
- const se_TagList = (input, context) => {
653
- return input
654
- .filter((e) => e != null)
655
- .map((entry) => {
656
- return se_Tag(entry, context);
657
- });
658
- };
659
- const se_TagResourceInput = (input, context) => {
660
- return {
661
- ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
662
- ...(input.Tags != null && { Tags: se_TagList(input.Tags, context) }),
663
- };
664
- };
665
- const se_UntagResourceInput = (input, context) => {
666
- return {
667
- ...(input.ResourceArn != null && { ResourceArn: input.ResourceArn }),
668
- ...(input.TagKeys != null && { TagKeys: se_TagKeyList(input.TagKeys, context) }),
669
- };
670
- };
671
- const se_UpdateHostInput = (input, context) => {
672
- return {
673
- ...(input.HostArn != null && { HostArn: input.HostArn }),
674
- ...(input.ProviderEndpoint != null && { ProviderEndpoint: input.ProviderEndpoint }),
675
- ...(input.VpcConfiguration != null && { VpcConfiguration: se_VpcConfiguration(input.VpcConfiguration, context) }),
676
- };
677
- };
678
- const se_VpcConfiguration = (input, context) => {
679
- return {
680
- ...(input.SecurityGroupIds != null && { SecurityGroupIds: se_SecurityGroupIds(input.SecurityGroupIds, context) }),
681
- ...(input.SubnetIds != null && { SubnetIds: se_SubnetIds(input.SubnetIds, context) }),
682
- ...(input.TlsCertificate != null && { TlsCertificate: input.TlsCertificate }),
683
- ...(input.VpcId != null && { VpcId: input.VpcId }),
684
- };
685
- };
686
- const de_ConflictException = (output, context) => {
687
- return {
688
- Message: __expectString(output.Message),
689
- };
690
- };
691
- const de_Connection = (output, context) => {
692
- return {
693
- ConnectionArn: __expectString(output.ConnectionArn),
694
- ConnectionName: __expectString(output.ConnectionName),
695
- ConnectionStatus: __expectString(output.ConnectionStatus),
696
- HostArn: __expectString(output.HostArn),
697
- OwnerAccountId: __expectString(output.OwnerAccountId),
698
- ProviderType: __expectString(output.ProviderType),
699
- };
700
- };
701
- const de_ConnectionList = (output, context) => {
702
- const retVal = (output || [])
703
- .filter((e) => e != null)
704
- .map((entry) => {
705
- if (entry === null) {
706
- return null;
707
- }
708
- return de_Connection(entry, context);
709
- });
710
- return retVal;
711
- };
712
- const de_CreateConnectionOutput = (output, context) => {
713
- return {
714
- ConnectionArn: __expectString(output.ConnectionArn),
715
- Tags: output.Tags != null ? de_TagList(output.Tags, context) : undefined,
716
- };
717
- };
718
- const de_CreateHostOutput = (output, context) => {
719
- return {
720
- HostArn: __expectString(output.HostArn),
721
- Tags: output.Tags != null ? de_TagList(output.Tags, context) : undefined,
722
- };
723
- };
724
- const de_DeleteConnectionOutput = (output, context) => {
725
- return {};
726
- };
727
- const de_DeleteHostOutput = (output, context) => {
728
- return {};
729
- };
730
- const de_GetConnectionOutput = (output, context) => {
731
- return {
732
- Connection: output.Connection != null ? de_Connection(output.Connection, context) : undefined,
733
- };
734
- };
735
- const de_GetHostOutput = (output, context) => {
736
- return {
737
- Name: __expectString(output.Name),
738
- ProviderEndpoint: __expectString(output.ProviderEndpoint),
739
- ProviderType: __expectString(output.ProviderType),
740
- Status: __expectString(output.Status),
741
- VpcConfiguration: output.VpcConfiguration != null ? de_VpcConfiguration(output.VpcConfiguration, context) : undefined,
742
- };
743
- };
744
- const de_Host = (output, context) => {
745
- return {
746
- HostArn: __expectString(output.HostArn),
747
- Name: __expectString(output.Name),
748
- ProviderEndpoint: __expectString(output.ProviderEndpoint),
749
- ProviderType: __expectString(output.ProviderType),
750
- Status: __expectString(output.Status),
751
- StatusMessage: __expectString(output.StatusMessage),
752
- VpcConfiguration: output.VpcConfiguration != null ? de_VpcConfiguration(output.VpcConfiguration, context) : undefined,
753
- };
754
- };
755
- const de_HostList = (output, context) => {
756
- const retVal = (output || [])
757
- .filter((e) => e != null)
758
- .map((entry) => {
759
- if (entry === null) {
760
- return null;
761
- }
762
- return de_Host(entry, context);
763
- });
764
- return retVal;
765
- };
766
- const de_LimitExceededException = (output, context) => {
767
- return {
768
- Message: __expectString(output.Message),
769
- };
770
- };
771
- const de_ListConnectionsOutput = (output, context) => {
772
- return {
773
- Connections: output.Connections != null ? de_ConnectionList(output.Connections, context) : undefined,
774
- NextToken: __expectString(output.NextToken),
775
- };
776
- };
777
- const de_ListHostsOutput = (output, context) => {
778
- return {
779
- Hosts: output.Hosts != null ? de_HostList(output.Hosts, context) : undefined,
780
- NextToken: __expectString(output.NextToken),
781
- };
782
- };
783
- const de_ListTagsForResourceOutput = (output, context) => {
784
- return {
785
- Tags: output.Tags != null ? de_TagList(output.Tags, context) : undefined,
786
- };
787
- };
788
- const de_ResourceNotFoundException = (output, context) => {
789
- return {
790
- Message: __expectString(output.Message),
791
- };
792
- };
793
- const de_ResourceUnavailableException = (output, context) => {
794
- return {
795
- Message: __expectString(output.Message),
796
- };
797
- };
798
- const de_SecurityGroupIds = (output, context) => {
799
- const retVal = (output || [])
800
- .filter((e) => e != null)
801
- .map((entry) => {
802
- if (entry === null) {
803
- return null;
804
- }
805
- return __expectString(entry);
806
- });
807
- return retVal;
808
- };
809
- const de_SubnetIds = (output, context) => {
810
- const retVal = (output || [])
811
- .filter((e) => e != null)
812
- .map((entry) => {
813
- if (entry === null) {
814
- return null;
815
- }
816
- return __expectString(entry);
817
- });
818
- return retVal;
819
- };
820
- const de_Tag = (output, context) => {
821
- return {
822
- Key: __expectString(output.Key),
823
- Value: __expectString(output.Value),
824
- };
825
- };
826
- const de_TagList = (output, context) => {
827
- const retVal = (output || [])
828
- .filter((e) => e != null)
829
- .map((entry) => {
830
- if (entry === null) {
831
- return null;
832
- }
833
- return de_Tag(entry, context);
834
- });
835
- return retVal;
836
- };
837
- const de_TagResourceOutput = (output, context) => {
838
- return {};
839
- };
840
- const de_UnsupportedOperationException = (output, context) => {
841
- return {
842
- Message: __expectString(output.Message),
843
- };
844
- };
845
- const de_UntagResourceOutput = (output, context) => {
846
- return {};
847
- };
848
- const de_UpdateHostOutput = (output, context) => {
849
- return {};
850
- };
851
- const de_VpcConfiguration = (output, context) => {
852
- return {
853
- SecurityGroupIds: output.SecurityGroupIds != null ? de_SecurityGroupIds(output.SecurityGroupIds, context) : undefined,
854
- SubnetIds: output.SubnetIds != null ? de_SubnetIds(output.SubnetIds, context) : undefined,
855
- TlsCertificate: __expectString(output.TlsCertificate),
856
- VpcId: __expectString(output.VpcId),
857
- };
858
- };
859
521
  const deserializeMetadata = (output) => ({
860
522
  httpStatusCode: output.statusCode,
861
523
  requestId: output.headers["x-amzn-requestid"] ?? output.headers["x-amzn-request-id"] ?? output.headers["x-amz-request-id"],
@@ -869,6 +531,7 @@ const collectBody = (streamBody = new Uint8Array(), context) => {
869
531
  return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());
870
532
  };
871
533
  const collectBodyString = (streamBody, context) => collectBody(streamBody, context).then((body) => context.utf8Encoder(body));
534
+ const throwDefaultError = withBaseException(__BaseException);
872
535
  const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, body) => {
873
536
  const { hostname, protocol = "https", port, path: basePath } = await context.endpoint();
874
537
  const contents = {
@@ -887,6 +550,12 @@ const buildHttpRpcRequest = async (context, headers, path, resolvedHostname, bod
887
550
  }
888
551
  return new __HttpRequest(contents);
889
552
  };
553
+ function sharedHeaders(operation) {
554
+ return {
555
+ "content-type": "application/x-amz-json-1.0",
556
+ "x-amz-target": `CodeStar_connections_20191201.${operation}`,
557
+ };
558
+ }
890
559
  const parseBody = (streamBody, context) => collectBodyString(streamBody, context).then((encoded) => {
891
560
  if (encoded.length) {
892
561
  return JSON.parse(encoded);