Class AwsRestJson1Protocol
- java.lang.Object
- 
- software.amazon.smithy.openapi.fromsmithy.protocols.AwsRestJson1Protocol
 
- 
- All Implemented Interfaces:
- OpenApiProtocol<RestJson1Trait>
 
 public final class AwsRestJson1Protocol extends java.lang.ObjectConverts theaws.protocols#restJson1protocol to OpenAPI.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface software.amazon.smithy.openapi.fromsmithy.OpenApiProtocolOpenApiProtocol.Operation
 
- 
 - 
Constructor SummaryConstructors Constructor Description AwsRestJson1Protocol()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Optional<OpenApiProtocol.Operation>createOperation(Context<T> context, OperationShape operation)Creates an operation entry, including the method, URI, and operation object builder.protected java.lang.StringgetEventStreamMediaType(Context<T> context, EventStreamInfo info)Gets the media type of an event stream for the protocol.java.util.Set<java.lang.String>getProtocolRequestHeaders(Context<RestJson1Trait> context, OperationShape operationShape)Gets the unmodeled protocol-specific HTTP headers of a request that are considered significant for the provided operation.java.util.Set<java.lang.String>getProtocolResponseHeaders(Context<RestJson1Trait> context, OperationShape operationShape)Gets the unmodeled protocol-specific HTTP headers of a response that are considered significant for the provided operation.java.lang.Class<RestJson1Trait>getProtocolType()Gets the protocol type that this converter handles.voidupdateDefaultSettings(Model model, OpenApiConfig config)Sets protocol-specific default values on the OpenAPI configuration object.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface software.amazon.smithy.openapi.fromsmithy.OpenApiProtocolgetOperationMethod, getOperationResponseStatusCode, getOperationUri
 
- 
 
- 
- 
- 
Method Detail- 
getProtocolTypepublic java.lang.Class<RestJson1Trait> getProtocolType() Description copied from interface:OpenApiProtocolGets the protocol type that this converter handles.- Returns:
- Returns the shape ID.
 
 - 
getProtocolRequestHeaderspublic java.util.Set<java.lang.String> getProtocolRequestHeaders(Context<RestJson1Trait> context, OperationShape operationShape) Description copied from interface:OpenApiProtocolGets 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:
- getProtocolRequestHeadersin interface- OpenApiProtocol<RestJson1Trait>
- Parameters:
- context- OpenAPI context
- operationShape- Smithy operation
- Returns:
- Returns a set of header names.
 
 - 
getProtocolResponseHeaderspublic java.util.Set<java.lang.String> getProtocolResponseHeaders(Context<RestJson1Trait> context, OperationShape operationShape) Description copied from interface:OpenApiProtocolGets 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:
- getProtocolResponseHeadersin interface- OpenApiProtocol<RestJson1Trait>
- Parameters:
- context- OpenAPI context
- operationShape- Smithy operation
- Returns:
- Returns a set of header names.
 
 - 
updateDefaultSettingspublic void updateDefaultSettings(Model model, OpenApiConfig config) Description copied from interface:OpenApiProtocolSets protocol-specific default values on the OpenAPI configuration object.- Parameters:
- model- Model being converted.
- config- Configuration object to modify.
 
 - 
createOperationpublic java.util.Optional<OpenApiProtocol.Operation> createOperation(Context<T> context, OperationShape operation) Description copied from interface:OpenApiProtocolCreates an operation entry, including the method, URI, and operation object builder. The returned operation object builder should contain protocol-specific fields of an OpenAPI Operation object, such as: [parameters, requestBody, responses] and [examples for any of the above, contained by respective objects that the example values are for]. The returned operation object builder should not contain protocol-agnostic fields of an OpenAPI Operation object, such as: tags, summary, description, externalDocs, deprecated, security.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:
- createOperationin interface- OpenApiProtocol<T extends Trait>
- Parameters:
- context- The build context.
- operation- The operation shape to create.
- Returns:
- Returns the optionally created operation entry.
 
 - 
getEventStreamMediaTypeprotected 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.
 
 
- 
 
-