java.lang.Object
software.amazon.smithy.protocoltests.traits.eventstream.Event
All Implemented Interfaces:
ToSmithyBuilder<Event>

public final class Event extends Object implements ToSmithyBuilder<Event>
An event sent over the event stream.
  • Method Details

    • getType

      public EventType getType()
      Returns:
      Returns the type of event.
    • getParams

      public Optional<ObjectNode> getParams()
      Gets the optional parameters used to generate the event.

      If set, these parameters MUST be compatible with a modeled event. If not set, this event represents an unmodeled event.

      Returns:
      Returns the optional parameters used to generate the event.
    • getHeaders

      public Map<String,EventHeaderValue<?>> getHeaders()
      Gets a map of expected headers.

      Headers that are not listed in this map are ignored unless they are explicitly forbidden through forbidHeaders.

      Returns:
      Returns a map of expected headers.
    • getForbidHeaders

      public List<String> getForbidHeaders()
      Returns:
      Returns a list of headers field names that MUST NOT appear in the serialized event.
    • getRequireHeaders

      public List<String> getRequireHeaders()
      Gets a list of header field names that MUST appear in the serialized event.

      No assertion is made on the value of the headers.

      Headers listed in headers do not need to appear in this list.

      Returns:
      Returns a list of required header keys.
    • getBody

      public Optional<String> getBody()
      Gets the optional expected event body.

      If no request body is defined, then no assertions are made about the body of the event.

      Returns:
      Returns the optional expected event body.
    • getBodyMediaType

      public Optional<String> getBodyMediaType()
      Gets the optional media type of the body.

      This is used to help test runners parse and validate the expected data against generated data.

      Returns:
      Returns the optional media type of the event body.
    • getBytes

      public Optional<byte[]> getBytes()
      Gets an optional binary representation of the entire event.

      This is used to test deserialization. If set, implementations SHOULD use this value to represent the binary value of received events rather than constructing that binary value from the other properties of the event.

      This value SHOULD NOT be used to make assertions about serialized events as such assertions likely would not be reliable. They would suffer from the same problems of making body assertions without a bodyMediaType where nonspecified ordering and optional whitespace can cause semantically equivalent values to have different bytes. This is made worse by headers having no defined order, and is likely made even worse by common event framing features such as checksums.

      Returns:
      Returns an optional binary representation of the entire event.
    • getVendorParams

      public Optional<ObjectNode> getVendorParams()
      Gets vendor-specific params used to influence the request.

      For example, some vendors might utilize environment variables, configuration files on disk, or other means to influence the serialization formats used by clients or servers.

      If vendorParamsShape is set, this MUST be compatible with that shape's definition.

      Returns:
      Returns a map of vendor-specific params used to influence the request.
    • getVendorParamsShape

      public Optional<ShapeId> getVendorParamsShape()
      Returns:
      Returns an optional shape used to validate vendorParams.
    • toBuilder

      public SmithyBuilder<Event> toBuilder()
      Description copied from interface: ToSmithyBuilder
      Take this object and create a builder that contains all of the current property values of this object.
      Specified by:
      toBuilder in interface ToSmithyBuilder<Event>
      Returns:
      a builder for type T
    • builder

      public static Event.Builder builder()
      Returns:
      Returns a newly-created builder for Event.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object