Class CfnRestApiProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnRestApiProps>
- Enclosing interface:
CfnRestApiProps
CfnRestApiProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionapiKeySourceType
(String apiKeySourceType) Sets the value ofCfnRestApiProps.getApiKeySourceType()
binaryMediaTypes
(List<String> binaryMediaTypes) Sets the value ofCfnRestApiProps.getBinaryMediaTypes()
Sets the value ofCfnRestApiProps.getBody()
bodyS3Location
(IResolvable bodyS3Location) Sets the value ofCfnRestApiProps.getBodyS3Location()
bodyS3Location
(CfnRestApi.S3LocationProperty bodyS3Location) Sets the value ofCfnRestApiProps.getBodyS3Location()
build()
Builds the configured instance.Sets the value ofCfnRestApiProps.getCloneFrom()
description
(String description) Sets the value ofCfnRestApiProps.getDescription()
disableExecuteApiEndpoint
(Boolean disableExecuteApiEndpoint) Sets the value ofCfnRestApiProps.getDisableExecuteApiEndpoint()
disableExecuteApiEndpoint
(IResolvable disableExecuteApiEndpoint) Sets the value ofCfnRestApiProps.getDisableExecuteApiEndpoint()
endpointConfiguration
(IResolvable endpointConfiguration) Sets the value ofCfnRestApiProps.getEndpointConfiguration()
endpointConfiguration
(CfnRestApi.EndpointConfigurationProperty endpointConfiguration) Sets the value ofCfnRestApiProps.getEndpointConfiguration()
failOnWarnings
(Boolean failOnWarnings) Sets the value ofCfnRestApiProps.getFailOnWarnings()
failOnWarnings
(IResolvable failOnWarnings) Sets the value ofCfnRestApiProps.getFailOnWarnings()
minimumCompressionSize
(Number minimumCompressionSize) Sets the value ofCfnRestApiProps.getMinimumCompressionSize()
Sets the value ofCfnRestApiProps.getMode()
Sets the value ofCfnRestApiProps.getName()
parameters
(Map<String, String> parameters) Sets the value ofCfnRestApiProps.getParameters()
parameters
(IResolvable parameters) Sets the value ofCfnRestApiProps.getParameters()
Sets the value ofCfnRestApiProps.getPolicy()
Sets the value ofCfnRestApiProps.getTags()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
apiKeySourceType
Sets the value ofCfnRestApiProps.getApiKeySourceType()
- Parameters:
apiKeySourceType
- The source of the API key for metering requests according to a usage plan. Valid values are:HEADER
to read the API key from theX-API-Key
header of a request.AUTHORIZER
to read the API key from theUsageIdentifierKey
from a custom authorizer.- Returns:
this
-
binaryMediaTypes
Sets the value ofCfnRestApiProps.getBinaryMediaTypes()
- Parameters:
binaryMediaTypes
- The list of binary media types supported by the RestApi. By default, the RestApi supports only UTF-8-encoded text payloads.- Returns:
this
-
body
Sets the value ofCfnRestApiProps.getBody()
- Parameters:
body
- An OpenAPI specification that defines a set of RESTful APIs in JSON format. For YAML templates, you can also provide the specification in YAML format.- Returns:
this
-
bodyS3Location
Sets the value ofCfnRestApiProps.getBodyS3Location()
- Parameters:
bodyS3Location
- The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.- Returns:
this
-
bodyS3Location
@Stability(Stable) public CfnRestApiProps.Builder bodyS3Location(CfnRestApi.S3LocationProperty bodyS3Location) Sets the value ofCfnRestApiProps.getBodyS3Location()
- Parameters:
bodyS3Location
- The Amazon Simple Storage Service (Amazon S3) location that points to an OpenAPI file, which defines a set of RESTful APIs in JSON or YAML format.- Returns:
this
-
cloneFrom
Sets the value ofCfnRestApiProps.getCloneFrom()
- Parameters:
cloneFrom
- The ID of the RestApi that you want to clone from.- Returns:
this
-
description
Sets the value ofCfnRestApiProps.getDescription()
- Parameters:
description
- The description of the RestApi.- Returns:
this
-
disableExecuteApiEndpoint
@Stability(Stable) public CfnRestApiProps.Builder disableExecuteApiEndpoint(Boolean disableExecuteApiEndpoint) Sets the value ofCfnRestApiProps.getDisableExecuteApiEndpoint()
- Parameters:
disableExecuteApiEndpoint
- Specifies whether clients can invoke your API by using the defaultexecute-api
endpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint- Returns:
this
-
disableExecuteApiEndpoint
@Stability(Stable) public CfnRestApiProps.Builder disableExecuteApiEndpoint(IResolvable disableExecuteApiEndpoint) Sets the value ofCfnRestApiProps.getDisableExecuteApiEndpoint()
- Parameters:
disableExecuteApiEndpoint
- Specifies whether clients can invoke your API by using the defaultexecute-api
endpoint. By default, clients can invoke your API with the defaulthttps://{api_id}.execute-api.{region}.amazonaws.com
endpoint. To require that clients use a custom domain name to invoke your API, disable the default endpoint- Returns:
this
-
endpointConfiguration
@Stability(Stable) public CfnRestApiProps.Builder endpointConfiguration(IResolvable endpointConfiguration) Sets the value ofCfnRestApiProps.getEndpointConfiguration()
- Parameters:
endpointConfiguration
- A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using theParameters
property.- Returns:
this
-
endpointConfiguration
@Stability(Stable) public CfnRestApiProps.Builder endpointConfiguration(CfnRestApi.EndpointConfigurationProperty endpointConfiguration) Sets the value ofCfnRestApiProps.getEndpointConfiguration()
- Parameters:
endpointConfiguration
- A list of the endpoint types of the API. Use this property when creating an API. When importing an existing API, specify the endpoint configuration types using theParameters
property.- Returns:
this
-
failOnWarnings
Sets the value ofCfnRestApiProps.getFailOnWarnings()
- Parameters:
failOnWarnings
- A query parameter to indicate whether to rollback the API update (true
) or not (false
) when a warning is encountered. The default value isfalse
.- Returns:
this
-
failOnWarnings
Sets the value ofCfnRestApiProps.getFailOnWarnings()
- Parameters:
failOnWarnings
- A query parameter to indicate whether to rollback the API update (true
) or not (false
) when a warning is encountered. The default value isfalse
.- Returns:
this
-
minimumCompressionSize
@Stability(Stable) public CfnRestApiProps.Builder minimumCompressionSize(Number minimumCompressionSize) Sets the value ofCfnRestApiProps.getMinimumCompressionSize()
- Parameters:
minimumCompressionSize
- A nullable integer that is used to enable compression (with non-negative between 0 and 10485760 (10M) bytes, inclusive) or disable compression (with a null value) on an API. When compression is enabled, compression or decompression is not applied on the payload if the payload size is smaller than this value. Setting it to zero allows compression for any payload size.- Returns:
this
-
mode
Sets the value ofCfnRestApiProps.getMode()
- Parameters:
mode
- This property applies only when you use OpenAPI to define your REST API. TheMode
determines how API Gateway handles resource updates.Valid values are
overwrite
ormerge
.For
overwrite
, the new API definition replaces the existing one. The existing API identifier remains unchanged.For
merge
, the new API definition is merged with the existing API.If you don't specify this property, a default value is chosen. For REST APIs created before March 29, 2021, the default is
overwrite
. For REST APIs created after March 29, 2021, the new API definition takes precedence, but any container types such as endpoint configurations and binary media types are merged with the existing API.Use the default mode to define top-level
RestApi
properties in addition to using OpenAPI. Generally, it's preferred to use API Gateway's OpenAPI extensions to model these properties.- Returns:
this
-
name
Sets the value ofCfnRestApiProps.getName()
- Parameters:
name
- The name of the RestApi. A name is required if the REST API is not based on an OpenAPI specification.- Returns:
this
-
parameters
Sets the value ofCfnRestApiProps.getParameters()
- Parameters:
parameters
- Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, setignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
.- Returns:
this
-
parameters
Sets the value ofCfnRestApiProps.getParameters()
- Parameters:
parameters
- Custom header parameters as part of the request. For example, to exclude DocumentationParts from an imported API, setignore=documentation
as aparameters
value, as in the AWS CLI command ofaws apigateway import-rest-api --parameters ignore=documentation --body 'file:///path/to/imported-api-body.json'
.- Returns:
this
-
policy
Sets the value ofCfnRestApiProps.getPolicy()
- Parameters:
policy
- A policy document that contains the permissions for theRestApi
resource. To set the ARN for the policy, use the!Join
intrinsic function with""
as delimiter and values of"execute-api:/"
and"*"
.- Returns:
this
-
tags
Sets the value ofCfnRestApiProps.getTags()
- Parameters:
tags
- The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The tag key can be up to 128 characters and must not start withaws:
. The tag value can be up to 256 characters.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnRestApiProps>
- Returns:
- a new instance of
CfnRestApiProps
- Throws:
NullPointerException
- if any required attribute was not provided
-