Class ModelProps.Builder
java.lang.Object
software.amazon.awscdk.services.apigateway.ModelProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<ModelProps>
- Enclosing interface:
- ModelProps
@Stability(Stable)
public static final class ModelProps.Builder
extends Object
implements software.amazon.jsii.Builder<ModelProps>
A builder for
ModelProps
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.contentType
(String contentType) Sets the value ofModelOptions.getContentType()
description
(String description) Sets the value ofModelOptions.getDescription()
Sets the value ofModelOptions.getModelName()
Sets the value ofModelProps.getRestApi()
schema
(JsonSchema schema) Sets the value ofModelOptions.getSchema()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
restApi
Sets the value ofModelProps.getRestApi()
- Parameters:
restApi
- The rest API that this model is part of. This parameter is required. The reason we need the RestApi object itself and not just the ID is because the model is being tracked by the top-level RestApi object for the purpose of calculating it's hash to determine the ID of the deployment. This allows us to automatically update the deployment when the model of the REST API changes.- Returns:
this
-
schema
Sets the value ofModelOptions.getSchema()
- Parameters:
schema
- The schema to use to transform data to one or more output formats. This parameter is required. Specify null ({}) if you don't want to specify a schema.- Returns:
this
-
contentType
Sets the value ofModelOptions.getContentType()
- Parameters:
contentType
- The content type for the model. You can also force a content type in the request or response model mapping.- Returns:
this
-
description
Sets the value ofModelOptions.getDescription()
- Parameters:
description
- A description that identifies this model.- Returns:
this
-
modelName
Sets the value ofModelOptions.getModelName()
- Parameters:
modelName
- 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.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<ModelProps>
- Returns:
- a new instance of
ModelProps
- Throws:
NullPointerException
- if any required attribute was not provided
-