@@ -139,12 +139,6 @@ public GeneratorDriver(ServiceConfiguration config, GenerationManifest generatio
139
139
140
140
public void Execute ( )
141
141
{
142
- if ( Configuration . ServiceModel . H2Support == H2SupportDegree . Required )
143
- {
144
- Console . WriteLine ( "This service requires HTTP2 for all operations. The AWS SDK for .NET does not yet support this functionality. Not generating service." ) ;
145
- return ;
146
- }
147
-
148
142
ValidateServiceModel ( ) ;
149
143
150
144
this . FilesWrittenToGeneratorFolder . Clear ( ) ;
@@ -248,6 +242,7 @@ public void Execute()
248
242
GenerateEndpointDiscoveryMarshaller ( operation ) ;
249
243
GenerateExceptions ( operation ) ;
250
244
GenerateStructures ( operation ) ;
245
+ GenerateEventStreamPublisher ( operation ) ;
251
246
}
252
247
253
248
if ( Configuration . ServiceModel . Customizations . GenerateCustomUnmarshaller )
@@ -300,6 +295,45 @@ void GenerateRequest(Operation operation)
300
295
this . DetermineStructuresToProcess ( operation . RequestStructure , false ) ;
301
296
}
302
297
298
+ void GenerateEventStreamPublisher ( Operation operation )
299
+ {
300
+ var eventStreamStructure = operation . RequestEventStreamingMember ? . Shape ;
301
+ if ( eventStreamStructure == null )
302
+ return ;
303
+
304
+ var publisherMarshaller = new EventStreamPublisherMarshaller
305
+ {
306
+ ClassName = eventStreamStructure . Name + "PublisherMarshaller" ,
307
+ Structure = eventStreamStructure
308
+ } ;
309
+
310
+ this . ExecuteGenerator ( publisherMarshaller , publisherMarshaller . ClassName + ".cs" , "Model.Internal.MarshallTransformations" ) ;
311
+
312
+ var evntTypes = new List < string > ( ) ;
313
+ foreach ( var member in eventStreamStructure . Members )
314
+ {
315
+ if ( member . Shape . IsEvent )
316
+ {
317
+ evntTypes . Add ( member . Shape . Name ) ;
318
+ var addIntefaceImpementationGenerator = new EventCollectionAddImplementation
319
+ {
320
+ InterfaceName = "I" + eventStreamStructure . Name + "Event" ,
321
+ ClassName = member . Shape . Name
322
+ } ;
323
+ this . ExecuteGenerator ( addIntefaceImpementationGenerator , member . Shape . Name + "." + addIntefaceImpementationGenerator . InterfaceName + ".cs" , "Model" ) ;
324
+ }
325
+ }
326
+
327
+ var eventCollectionInterface = new EventCollectionInterface ( )
328
+ {
329
+ InterfaceName = "I" + eventStreamStructure . Name + "Event" ,
330
+ OperationName = operation . Name ,
331
+ EvntTypes = evntTypes
332
+ } ;
333
+
334
+ this . ExecuteGenerator ( eventCollectionInterface , eventCollectionInterface . InterfaceName + ".cs" , "Model" ) ;
335
+ }
336
+
303
337
private void ValidateServiceModel ( )
304
338
{
305
339
// Check to see if any of the GET operations have invalid request body members.
@@ -545,7 +579,7 @@ void GenerateRequestMarshaller(Operation operation)
545
579
if ( nestedStructure . IsDocument )
546
580
continue ;
547
581
548
- if ( ! this . _processedMarshallers . Contains ( nestedStructure . Name ) )
582
+ if ( ! this . _processedMarshallers . Contains ( nestedStructure . Name ) && ! nestedStructure . IsEventStream )
549
583
{
550
584
var structureGenerator = GetStructureMarshaller ( ) ;
551
585
structureGenerator . Structure = nestedStructure ;
@@ -734,7 +768,7 @@ void GenerateEndpointDiscoveryMarshaller(Operation operation)
734
768
private void GenerateExceptions ( Operation operation )
735
769
{
736
770
//Generate a special EventStreamException class that extends EventStreamException
737
- //We need a parameterless constructor to use it in EnumerableEventStream . Only once per service
771
+ //We need a parameterless constructor to use it in EnumerableEventOutputStream . Only once per service
738
772
if ( operation . IsEventStreamOutput && ! Configuration . GeneratedEventStreamException )
739
773
{
740
774
var eventStreamExceptionGenerator = new EventStreamExceptionGenerator ( ) ;
@@ -964,6 +998,10 @@ void GenerateStructures(Operation operation)
964
998
if ( IsShapePresentInParentModel ( this . Configuration , definition . Name ) )
965
999
continue ;
966
1000
1001
+ // Skip structures that are only used as input event streams. Those structures are handled separately as part of the GenerateEventStreamPublisher method.
1002
+ if ( definition . IsEventStream && ! Configuration . ServiceModel . Operations . Any ( x => string . Equals ( x . ResponseEventStreamingMember ? . Shape . Name , definition . Name ) ) )
1003
+ continue ;
1004
+
967
1005
if ( ! this . _processedStructures . Contains ( definition . Name ) )
968
1006
{
969
1007
// if the shape had a substitution, we can skip generation
@@ -1001,7 +1039,6 @@ void GenerateStructures(Operation operation)
1001
1039
1002
1040
this . ExecuteGenerator ( generator , definition . Name + ".cs" , "Model" ) ;
1003
1041
this . _processedStructures . Add ( definition . Name ) ;
1004
-
1005
1042
}
1006
1043
}
1007
1044
}
0 commit comments