@@ -22,13 +22,16 @@ import {
22
22
ResponseMetadata as __ResponseMetadata ,
23
23
SerdeContext as __SerdeContext ,
24
24
} from "@smithy/types" ;
25
+ import { v4 as generateIdempotencyToken } from "uuid" ;
25
26
27
+ import { CreateTemplateCommandInput , CreateTemplateCommandOutput } from "../commands/CreateTemplateCommand" ;
26
28
import { CreateWorkflowCommandInput , CreateWorkflowCommandOutput } from "../commands/CreateWorkflowCommand" ;
27
29
import { CreateWorkflowStepCommandInput , CreateWorkflowStepCommandOutput } from "../commands/CreateWorkflowStepCommand" ;
28
30
import {
29
31
CreateWorkflowStepGroupCommandInput ,
30
32
CreateWorkflowStepGroupCommandOutput ,
31
33
} from "../commands/CreateWorkflowStepGroupCommand" ;
34
+ import { DeleteTemplateCommandInput , DeleteTemplateCommandOutput } from "../commands/DeleteTemplateCommand" ;
32
35
import { DeleteWorkflowCommandInput , DeleteWorkflowCommandOutput } from "../commands/DeleteWorkflowCommand" ;
33
36
import { DeleteWorkflowStepCommandInput , DeleteWorkflowStepCommandOutput } from "../commands/DeleteWorkflowStepCommand" ;
34
37
import {
@@ -69,6 +72,7 @@ import { StartWorkflowCommandInput, StartWorkflowCommandOutput } from "../comman
69
72
import { StopWorkflowCommandInput , StopWorkflowCommandOutput } from "../commands/StopWorkflowCommand" ;
70
73
import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ;
71
74
import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ;
75
+ import { UpdateTemplateCommandInput , UpdateTemplateCommandOutput } from "../commands/UpdateTemplateCommand" ;
72
76
import { UpdateWorkflowCommandInput , UpdateWorkflowCommandOutput } from "../commands/UpdateWorkflowCommand" ;
73
77
import { UpdateWorkflowStepCommandInput , UpdateWorkflowStepCommandOutput } from "../commands/UpdateWorkflowStepCommand" ;
74
78
import {
@@ -78,19 +82,47 @@ import {
78
82
import { MigrationHubOrchestratorServiceException as __BaseException } from "../models/MigrationHubOrchestratorServiceException" ;
79
83
import {
80
84
AccessDeniedException ,
85
+ ConflictException ,
81
86
InternalServerException ,
82
87
MigrationWorkflowSummary ,
83
88
PlatformCommand ,
84
89
PlatformScriptKey ,
85
90
ResourceNotFoundException ,
86
91
StepInput ,
92
+ TemplateSource ,
87
93
ThrottlingException ,
88
94
ValidationException ,
89
95
WorkflowStepAutomationConfiguration ,
90
96
WorkflowStepOutput ,
91
97
WorkflowStepOutputUnion ,
92
98
} from "../models/models_0" ;
93
99
100
+ /**
101
+ * serializeAws_restJson1CreateTemplateCommand
102
+ */
103
+ export const se_CreateTemplateCommand = async (
104
+ input : CreateTemplateCommandInput ,
105
+ context : __SerdeContext
106
+ ) : Promise < __HttpRequest > => {
107
+ const b = rb ( input , context ) ;
108
+ const headers : any = {
109
+ "content-type" : "application/json" ,
110
+ } ;
111
+ b . bp ( "/template" ) ;
112
+ let body : any ;
113
+ body = JSON . stringify (
114
+ take ( input , {
115
+ clientToken : [ true , ( _ ) => _ ?? generateIdempotencyToken ( ) ] ,
116
+ tags : ( _ ) => _json ( _ ) ,
117
+ templateDescription : [ ] ,
118
+ templateName : [ ] ,
119
+ templateSource : ( _ ) => _json ( _ ) ,
120
+ } )
121
+ ) ;
122
+ b . m ( "POST" ) . h ( headers ) . b ( body ) ;
123
+ return b . build ( ) ;
124
+ } ;
125
+
94
126
/**
95
127
* serializeAws_restJson1CreateWorkflowCommand
96
128
*/
@@ -176,6 +208,22 @@ export const se_CreateWorkflowStepGroupCommand = async (
176
208
return b . build ( ) ;
177
209
} ;
178
210
211
+ /**
212
+ * serializeAws_restJson1DeleteTemplateCommand
213
+ */
214
+ export const se_DeleteTemplateCommand = async (
215
+ input : DeleteTemplateCommandInput ,
216
+ context : __SerdeContext
217
+ ) : Promise < __HttpRequest > => {
218
+ const b = rb ( input , context ) ;
219
+ const headers : any = { } ;
220
+ b . bp ( "/template/{id}" ) ;
221
+ b . p ( "id" , ( ) => input . id ! , "{id}" , false ) ;
222
+ let body : any ;
223
+ b . m ( "DELETE" ) . h ( headers ) . b ( body ) ;
224
+ return b . build ( ) ;
225
+ } ;
226
+
179
227
/**
180
228
* serializeAws_restJson1DeleteWorkflowCommand
181
229
*/
@@ -596,6 +644,31 @@ export const se_UntagResourceCommand = async (
596
644
return b . build ( ) ;
597
645
} ;
598
646
647
+ /**
648
+ * serializeAws_restJson1UpdateTemplateCommand
649
+ */
650
+ export const se_UpdateTemplateCommand = async (
651
+ input : UpdateTemplateCommandInput ,
652
+ context : __SerdeContext
653
+ ) : Promise < __HttpRequest > => {
654
+ const b = rb ( input , context ) ;
655
+ const headers : any = {
656
+ "content-type" : "application/json" ,
657
+ } ;
658
+ b . bp ( "/template/{id}" ) ;
659
+ b . p ( "id" , ( ) => input . id ! , "{id}" , false ) ;
660
+ let body : any ;
661
+ body = JSON . stringify (
662
+ take ( input , {
663
+ clientToken : [ true , ( _ ) => _ ?? generateIdempotencyToken ( ) ] ,
664
+ templateDescription : [ ] ,
665
+ templateName : [ ] ,
666
+ } )
667
+ ) ;
668
+ b . m ( "POST" ) . h ( headers ) . b ( body ) ;
669
+ return b . build ( ) ;
670
+ } ;
671
+
599
672
/**
600
673
* serializeAws_restJson1UpdateWorkflowCommand
601
674
*/
@@ -684,6 +757,29 @@ export const se_UpdateWorkflowStepGroupCommand = async (
684
757
return b . build ( ) ;
685
758
} ;
686
759
760
+ /**
761
+ * deserializeAws_restJson1CreateTemplateCommand
762
+ */
763
+ export const de_CreateTemplateCommand = async (
764
+ output : __HttpResponse ,
765
+ context : __SerdeContext
766
+ ) : Promise < CreateTemplateCommandOutput > => {
767
+ if ( output . statusCode !== 200 && output . statusCode >= 300 ) {
768
+ return de_CommandError ( output , context ) ;
769
+ }
770
+ const contents : any = map ( {
771
+ $metadata : deserializeMetadata ( output ) ,
772
+ } ) ;
773
+ const data : Record < string , any > = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ;
774
+ const doc = take ( data , {
775
+ tags : _json ,
776
+ templateArn : __expectString ,
777
+ templateId : __expectString ,
778
+ } ) ;
779
+ Object . assign ( contents , doc ) ;
780
+ return contents ;
781
+ } ;
782
+
687
783
/**
688
784
* deserializeAws_restJson1CreateWorkflowCommand
689
785
*/
@@ -767,6 +863,23 @@ export const de_CreateWorkflowStepGroupCommand = async (
767
863
return contents ;
768
864
} ;
769
865
866
+ /**
867
+ * deserializeAws_restJson1DeleteTemplateCommand
868
+ */
869
+ export const de_DeleteTemplateCommand = async (
870
+ output : __HttpResponse ,
871
+ context : __SerdeContext
872
+ ) : Promise < DeleteTemplateCommandOutput > => {
873
+ if ( output . statusCode !== 200 && output . statusCode >= 300 ) {
874
+ return de_CommandError ( output , context ) ;
875
+ }
876
+ const contents : any = map ( {
877
+ $metadata : deserializeMetadata ( output ) ,
878
+ } ) ;
879
+ await collectBody ( output . body , context ) ;
880
+ return contents ;
881
+ } ;
882
+
770
883
/**
771
884
* deserializeAws_restJson1DeleteWorkflowCommand
772
885
*/
@@ -844,7 +957,12 @@ export const de_GetTemplateCommand = async (
844
957
id : __expectString ,
845
958
inputs : _json ,
846
959
name : __expectString ,
960
+ owner : __expectString ,
847
961
status : __expectString ,
962
+ statusMessage : __expectString ,
963
+ tags : _json ,
964
+ templateArn : __expectString ,
965
+ templateClass : __expectString ,
848
966
tools : _json ,
849
967
} ) ;
850
968
Object . assign ( contents , doc ) ;
@@ -1308,6 +1426,29 @@ export const de_UntagResourceCommand = async (
1308
1426
return contents ;
1309
1427
} ;
1310
1428
1429
+ /**
1430
+ * deserializeAws_restJson1UpdateTemplateCommand
1431
+ */
1432
+ export const de_UpdateTemplateCommand = async (
1433
+ output : __HttpResponse ,
1434
+ context : __SerdeContext
1435
+ ) : Promise < UpdateTemplateCommandOutput > => {
1436
+ if ( output . statusCode !== 200 && output . statusCode >= 300 ) {
1437
+ return de_CommandError ( output , context ) ;
1438
+ }
1439
+ const contents : any = map ( {
1440
+ $metadata : deserializeMetadata ( output ) ,
1441
+ } ) ;
1442
+ const data : Record < string , any > = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ;
1443
+ const doc = take ( data , {
1444
+ tags : _json ,
1445
+ templateArn : __expectString ,
1446
+ templateId : __expectString ,
1447
+ } ) ;
1448
+ Object . assign ( contents , doc ) ;
1449
+ return contents ;
1450
+ } ;
1451
+
1311
1452
/**
1312
1453
* deserializeAws_restJson1UpdateWorkflowCommand
1313
1454
*/
@@ -1405,6 +1546,9 @@ const de_CommandError = async (output: __HttpResponse, context: __SerdeContext):
1405
1546
case "AccessDeniedException" :
1406
1547
case "com.amazonaws.migrationhuborchestrator#AccessDeniedException" :
1407
1548
throw await de_AccessDeniedExceptionRes ( parsedOutput , context ) ;
1549
+ case "ConflictException" :
1550
+ case "com.amazonaws.migrationhuborchestrator#ConflictException" :
1551
+ throw await de_ConflictExceptionRes ( parsedOutput , context ) ;
1408
1552
case "InternalServerException" :
1409
1553
case "com.amazonaws.migrationhuborchestrator#InternalServerException" :
1410
1554
throw await de_InternalServerExceptionRes ( parsedOutput , context ) ;
@@ -1448,6 +1592,23 @@ const de_AccessDeniedExceptionRes = async (
1448
1592
return __decorateServiceException ( exception , parsedOutput . body ) ;
1449
1593
} ;
1450
1594
1595
+ /**
1596
+ * deserializeAws_restJson1ConflictExceptionRes
1597
+ */
1598
+ const de_ConflictExceptionRes = async ( parsedOutput : any , context : __SerdeContext ) : Promise < ConflictException > => {
1599
+ const contents : any = map ( { } ) ;
1600
+ const data : any = parsedOutput . body ;
1601
+ const doc = take ( data , {
1602
+ message : __expectString ,
1603
+ } ) ;
1604
+ Object . assign ( contents , doc ) ;
1605
+ const exception = new ConflictException ( {
1606
+ $metadata : deserializeMetadata ( parsedOutput ) ,
1607
+ ...contents ,
1608
+ } ) ;
1609
+ return __decorateServiceException ( exception , parsedOutput . body ) ;
1610
+ } ;
1611
+
1451
1612
/**
1452
1613
* deserializeAws_restJson1InternalServerExceptionRes
1453
1614
*/
@@ -1522,6 +1683,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
1522
1683
return __decorateServiceException ( exception , parsedOutput . body ) ;
1523
1684
} ;
1524
1685
1686
+ // se_MaxStringList omitted.
1687
+
1525
1688
// se_PlatformCommand omitted.
1526
1689
1527
1690
// se_PlatformScriptKey omitted.
@@ -1536,6 +1699,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
1536
1699
1537
1700
// se_TagMap omitted.
1538
1701
1702
+ // se_TemplateSource omitted.
1703
+
1539
1704
// se_WorkflowStepAutomationConfiguration omitted.
1540
1705
1541
1706
// se_WorkflowStepOutput omitted.
@@ -1544,6 +1709,8 @@ const de_ValidationExceptionRes = async (parsedOutput: any, context: __SerdeCont
1544
1709
1545
1710
// se_WorkflowStepOutputUnion omitted.
1546
1711
1712
+ // de_MaxStringList omitted.
1713
+
1547
1714
/**
1548
1715
* deserializeAws_restJson1MigrationWorkflowSummary
1549
1716
*/
0 commit comments