Interface ModelOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
ModelProps
- All Known Implementing Classes:
ModelOptions.Jsii$Proxy
,ModelProps.Jsii$Proxy
@Generated(value="jsii-pacmak/1.103.1 (build bef2dea)",
date="2024-10-05T03:43:37.984Z")
@Stability(Stable)
public interface ModelOptions
extends software.amazon.jsii.JsiiSerializable
Example:
RestApi api; // We define the JSON Schema for the transformed valid response Model responseModel = api.addModel("ResponseModel", ModelOptions.builder() .contentType("application/json") .modelName("ResponseModel") .schema(JsonSchema.builder() .schema(JsonSchemaVersion.DRAFT4) .title("pollResponse") .type(JsonSchemaType.OBJECT) .properties(Map.of( "state", JsonSchema.builder().type(JsonSchemaType.STRING).build(), "greeting", JsonSchema.builder().type(JsonSchemaType.STRING).build())) .build()) .build()); // We define the JSON Schema for the transformed error response Model errorResponseModel = api.addModel("ErrorResponseModel", ModelOptions.builder() .contentType("application/json") .modelName("ErrorResponseModel") .schema(JsonSchema.builder() .schema(JsonSchemaVersion.DRAFT4) .title("errorResponse") .type(JsonSchemaType.OBJECT) .properties(Map.of( "state", JsonSchema.builder().type(JsonSchemaType.STRING).build(), "message", JsonSchema.builder().type(JsonSchemaType.STRING).build())) .build()) .build());
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forModelOptions
static final class
An implementation forModelOptions
-
Method Summary
Modifier and TypeMethodDescriptionstatic ModelOptions.Builder
builder()
default String
The content type for the model.default String
A description that identifies this model.default String
A name for the model.The schema to use to transform data to one or more output formats.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getSchema
The schema to use to transform data to one or more output formats.Specify null ({}) if you don't want to specify a schema.
-
getContentType
The content type for the model.You can also force a content type in the request or response model mapping.
Default: 'application/json'
-
getDescription
A description that identifies this model.Default: None
-
getModelName
A name for the model.Important If you specify a name, you cannot perform updates that require replacement of this resource. You can perform updates that require no or some interruption. If you must replace the resource, specify a new name.
Default:
If you don't specify a name, AWS CloudFormation generates a unique physical ID and uses that ID for the model name. For more information, see Name Type. -
builder
- Returns:
- a
ModelOptions.Builder
ofModelOptions
-