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(Stable)
public static final class CorsPreflightOptions.Builder
extends Object
implements software.amazon.jsii.Builder<CorsPreflightOptions>
A builder for
CorsPreflightOptions-
Constructor Summary
Constructors -
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
Sets the value ofCorsPreflightOptions.getAllowCredentials()- Parameters:
allowCredentials- Specifies whether credentials are included in the CORS request.- Returns:
this
-
allowHeaders
Sets the value ofCorsPreflightOptions.getAllowHeaders()- Parameters:
allowHeaders- Represents a collection of allowed headers.- Returns:
this
-
allowMethods
@Stability(Stable) 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
Sets the value ofCorsPreflightOptions.getAllowOrigins()- Parameters:
allowOrigins- Represents a collection of allowed origins.- Returns:
this
-
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:
buildin interfacesoftware.amazon.jsii.Builder<CorsPreflightOptions>- Returns:
- a new instance of
CorsPreflightOptions - Throws:
NullPointerException- if any required attribute was not provided
-