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