Class AwsRestJson1Protocol
- All Implemented Interfaces:
OpenApiProtocol<RestJson1Trait>
aws.protocols#restJson1
protocol to OpenAPI.-
Nested Class Summary
Nested classes/interfaces inherited from interface software.amazon.smithy.openapi.fromsmithy.OpenApiProtocol
OpenApiProtocol.Operation
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateOperation
(Context<RestJson1Trait> context, OperationShape operation) Creates an operation entry, including the method, URI, and operation object builder.protected String
getEventStreamMediaType
(Context<RestJson1Trait> context, EventStreamInfo info) Gets the media type of an event stream for the protocol.getProtocolRequestHeaders
(Context<RestJson1Trait> context, OperationShape operationShape) Gets the unmodeled protocol-specific HTTP headers of a request that are considered significant for the provided operation.getProtocolResponseHeaders
(Context<RestJson1Trait> context, OperationShape operationShape) Gets the unmodeled protocol-specific HTTP headers of a response that are considered significant for the provided operation.Gets the protocol type that this converter handles.void
updateDefaultSettings
(Model model, OpenApiConfig config) Sets protocol-specific default values on the OpenAPI configuration object.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.smithy.openapi.fromsmithy.OpenApiProtocol
getOperationMethod, getOperationResponseStatusCode, getOperationUri
-
Constructor Details
-
AwsRestJson1Protocol
public AwsRestJson1Protocol()
-
-
Method Details
-
getProtocolType
Description copied from interface:OpenApiProtocol
Gets the protocol type that this converter handles.- Returns:
- Returns the shape ID.
-
getProtocolRequestHeaders
public Set<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 interfaceOpenApiProtocol<RestJson1Trait>
- Parameters:
context
- OpenAPI contextoperationShape
- Smithy operation- Returns:
- Returns a set of header names.
-
getProtocolResponseHeaders
public Set<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 interfaceOpenApiProtocol<RestJson1Trait>
- Parameters:
context
- OpenAPI contextoperationShape
- Smithy operation- Returns:
- Returns a set of header names.
-
updateDefaultSettings
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.
-
createOperation
public Optional<OpenApiProtocol.Operation> createOperation(Context<RestJson1Trait> context, OperationShape operation) Description copied from interface:OpenApiProtocol
Creates an operation entry, including the method, URI, and operation object builder.The operation is returned as an empty Optional if the operation is not supported by the protocol. This method should make calls to
OpenApiProtocol.getOperationUri(software.amazon.smithy.openapi.fromsmithy.Context<T>, software.amazon.smithy.model.shapes.OperationShape)
andOpenApiProtocol.getOperationMethod(software.amazon.smithy.openapi.fromsmithy.Context<T>, software.amazon.smithy.model.shapes.OperationShape)
when creating the Operation object.- Specified by:
createOperation
in interfaceOpenApiProtocol<T extends Trait>
- Parameters:
context
- The build context.operation
- The operation shape to create.- Returns:
- Returns the optionally created operation entry.
-
getEventStreamMediaType
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.
-