Class AwsRestJson1Protocol

  • All Implemented Interfaces:
    OpenApiProtocol<RestJson1Trait>

    public final class AwsRestJson1Protocol
    extends java.lang.Object
    Converts the aws.protocols#restJson1 protocol to OpenAPI.
    • Constructor Detail

      • AwsRestJson1Protocol

        public AwsRestJson1Protocol()
    • Method Detail

      • getProtocolType

        public java.lang.Class<RestJson1Trait> getProtocolType()
        Description copied from interface: OpenApiProtocol
        Gets the protocol type that this converter handles.
        Returns:
        Returns the shape ID.
      • getProtocolRequestHeaders

        public java.util.Set<java.lang.String> getProtocolRequestHeaders​(Context<RestJson1Trait> context,
                                                                         OperationShape operationShape)
        Description copied from interface: OpenApiProtocol
        Gets the unmodeled protocol-specific HTTP headers of a request that are considered significant for the provided operation.

        These protocol specific headers are not automatically added to requests, but are used when integrating with things like CORS.

        Specified by:
        getProtocolRequestHeaders in interface OpenApiProtocol<RestJson1Trait>
        Parameters:
        context - OpenAPI context
        operationShape - Smithy operation
        Returns:
        Returns a set of header names.
      • getProtocolResponseHeaders

        public java.util.Set<java.lang.String> getProtocolResponseHeaders​(Context<RestJson1Trait> context,
                                                                          OperationShape operationShape)
        Description copied from interface: OpenApiProtocol
        Gets the unmodeled protocol-specific HTTP headers of a response that are considered significant for the provided operation.

        These protocol specific headers are not automatically added to responses, but are used when integrating with things like CORS.

        Specified by:
        getProtocolResponseHeaders in interface OpenApiProtocol<RestJson1Trait>
        Parameters:
        context - OpenAPI context
        operationShape - Smithy operation
        Returns:
        Returns a set of header names.
      • updateDefaultSettings

        public void updateDefaultSettings​(Model model,
                                          OpenApiConfig config)
        Description copied from interface: OpenApiProtocol
        Sets protocol-specific default values on the OpenAPI configuration object.
        Parameters:
        model - Model being converted.
        config - Configuration object to modify.
      • getEventStreamMediaType

        protected java.lang.String getEventStreamMediaType​(Context<T> context,
                                                           EventStreamInfo info)
        Gets the media type of an event stream for the protocol.

        By default, this method returns the binary AWS event stream media type, application/vnd.amazon.eventstream.

        Parameters:
        context - Conversion context.
        info - Event stream info to provide the media type for.
        Returns:
        Returns the media type of the event stream.