Class CfnApi.CorsProperty.Builder
java.lang.Object
software.amazon.awscdk.services.apigatewayv2.CfnApi.CorsProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnApi.CorsProperty>
- Enclosing interface:
CfnApi.CorsProperty
@Stability(Stable)
public static final class CfnApi.CorsProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnApi.CorsProperty>
A builder for
CfnApi.CorsProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowCredentials
(Boolean allowCredentials) Sets the value ofCfnApi.CorsProperty.getAllowCredentials()
allowCredentials
(IResolvable allowCredentials) Sets the value ofCfnApi.CorsProperty.getAllowCredentials()
allowHeaders
(List<String> allowHeaders) Sets the value ofCfnApi.CorsProperty.getAllowHeaders()
allowMethods
(List<String> allowMethods) Sets the value ofCfnApi.CorsProperty.getAllowMethods()
allowOrigins
(List<String> allowOrigins) Sets the value ofCfnApi.CorsProperty.getAllowOrigins()
build()
Builds the configured instance.exposeHeaders
(List<String> exposeHeaders) Sets the value ofCfnApi.CorsProperty.getExposeHeaders()
Sets the value ofCfnApi.CorsProperty.getMaxAge()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowCredentials
Sets the value ofCfnApi.CorsProperty.getAllowCredentials()
- Parameters:
allowCredentials
- Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.- Returns:
this
-
allowCredentials
@Stability(Stable) public CfnApi.CorsProperty.Builder allowCredentials(IResolvable allowCredentials) Sets the value ofCfnApi.CorsProperty.getAllowCredentials()
- Parameters:
allowCredentials
- Specifies whether credentials are included in the CORS request. Supported only for HTTP APIs.- Returns:
this
-
allowHeaders
Sets the value ofCfnApi.CorsProperty.getAllowHeaders()
- Parameters:
allowHeaders
- Represents a collection of allowed headers. Supported only for HTTP APIs.- Returns:
this
-
allowMethods
Sets the value ofCfnApi.CorsProperty.getAllowMethods()
- Parameters:
allowMethods
- Represents a collection of allowed HTTP methods. Supported only for HTTP APIs.- Returns:
this
-
allowOrigins
Sets the value ofCfnApi.CorsProperty.getAllowOrigins()
- Parameters:
allowOrigins
- Represents a collection of allowed origins. Supported only for HTTP APIs.- Returns:
this
-
exposeHeaders
Sets the value ofCfnApi.CorsProperty.getExposeHeaders()
- Parameters:
exposeHeaders
- Represents a collection of exposed headers. Supported only for HTTP APIs.- Returns:
this
-
maxAge
Sets the value ofCfnApi.CorsProperty.getMaxAge()
- Parameters:
maxAge
- The number of seconds that the browser should cache preflight request results. Supported only for HTTP APIs.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnApi.CorsProperty>
- Returns:
- a new instance of
CfnApi.CorsProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-