Class EventStreamUtils
java.lang.Object
software.amazon.awssdk.codegen.poet.eventstream.EventStreamUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
doesShapeContainsEventStream
(ShapeModel parentShape, ShapeModel childEventStreamShape) Returns true if the #childEventStreamShape is a member of the #parentShape.static Collection
<OperationModel> findOperationsWithEventStream
(IntermediateModel model, ShapeModel eventStreamShape) Returns the all operations that contain the given event stream shape.static Optional
<ShapeModel> getBaseEventStreamShape
(IntermediateModel model, ShapeModel eventShape) Returns the event streamShapeModel
that contains the given event.static List
<ShapeModel> getBaseEventStreamShapes
(IntermediateModel model, ShapeModel eventShape) static Stream
<MemberModel> getErrorMembers
(ShapeModel eventStreamShape) static Stream
<MemberModel> getEventMembers
(ShapeModel eventStreamShape) Returns the stream of event members ('event: true') excluding exceptions from the input event stream shape ('eventstream: true').static Stream
<MemberModel> getEvents
(ShapeModel eventStreamShape) Returns the stream of event members ('event: true') excluding exceptions from the input event stream shape ('eventstream: true').static ShapeModel
getEventStreamInRequest
(ShapeModel requestShape) Get eventstream member from a request shape model.static ShapeModel
getEventStreamInResponse
(ShapeModel responseShape) Get eventstream member from a response shape model.static boolean
isEventStreamParentModel
(ShapeModel shapeModel) static boolean
isRequestEvent
(IntermediateModel model, ShapeModel eventShape) Returns true if the given event shape is a sub-member of any operation request.
-
Method Details
-
getEventStreamInRequest
Get eventstream member from a request shape model. If shape doesn't have any eventstream member, throw an IllegalStateException.- Parameters:
requestShape
- request shape of an operation- Returns:
- eventstream member (shape with "eventstream" trait set to true) in the request shape. If there is no eventstream member, thrown IllegalStateException.
-
getEventStreamInResponse
Get eventstream member from a response shape model. If shape doesn't have any eventstream member, throw an IllegalStateException.- Parameters:
responseShape
- response shape of an operation- Returns:
- eventstream member (shape with "eventstream" trait set to true) in the response shape. If there is no eventstream member, thrown IllegalStateException.
-
getBaseEventStreamShape
public static Optional<ShapeModel> getBaseEventStreamShape(IntermediateModel model, ShapeModel eventShape) Returns the event streamShapeModel
that contains the given event.- Parameters:
model
- Intermediate modeleventShape
- shape with "event: true" trait- Returns:
- the event stream shape (eventstream: true) that contains the given event, or an empty optional if the C2J shape is marked as an event but the intermediate model representation is not used by an event stream
-
getBaseEventStreamShapes
public static List<ShapeModel> getBaseEventStreamShapes(IntermediateModel model, ShapeModel eventShape) -
getEvents
Returns the stream of event members ('event: true') excluding exceptions from the input event stream shape ('eventstream: true'). -
getEventMembers
Returns the stream of event members ('event: true') excluding exceptions from the input event stream shape ('eventstream: true'). -
getErrorMembers
-
findOperationsWithEventStream
public static Collection<OperationModel> findOperationsWithEventStream(IntermediateModel model, ShapeModel eventStreamShape) Returns the all operations that contain the given event stream shape. The event stream can be in operation request or response shape. -
doesShapeContainsEventStream
public static boolean doesShapeContainsEventStream(ShapeModel parentShape, ShapeModel childEventStreamShape) Returns true if the #childEventStreamShape is a member of the #parentShape. Otherwise false. -
isRequestEvent
Returns true if the given event shape is a sub-member of any operation request. -
isEventStreamParentModel
- Returns:
- true if the provide model is a request/response shape model that contains event stream shape. Otherwise return false.
-