Class FunctionUrlCorsOptions.Builder
java.lang.Object
software.amazon.awscdk.services.lambda.FunctionUrlCorsOptions.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<FunctionUrlCorsOptions>
- Enclosing interface:
- FunctionUrlCorsOptions
@Stability(Stable)
public static final class FunctionUrlCorsOptions.Builder
extends Object
implements software.amazon.jsii.Builder<FunctionUrlCorsOptions>
A builder for
FunctionUrlCorsOptions
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowCredentials
(Boolean allowCredentials) Sets the value ofFunctionUrlCorsOptions.getAllowCredentials()
allowedHeaders
(List<String> allowedHeaders) Sets the value ofFunctionUrlCorsOptions.getAllowedHeaders()
allowedMethods
(List<? extends HttpMethod> allowedMethods) Sets the value ofFunctionUrlCorsOptions.getAllowedMethods()
allowedOrigins
(List<String> allowedOrigins) Sets the value ofFunctionUrlCorsOptions.getAllowedOrigins()
build()
Builds the configured instance.exposedHeaders
(List<String> exposedHeaders) Sets the value ofFunctionUrlCorsOptions.getExposedHeaders()
Sets the value ofFunctionUrlCorsOptions.getMaxAge()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowCredentials
Sets the value ofFunctionUrlCorsOptions.getAllowCredentials()
- Parameters:
allowCredentials
- Whether to allow cookies or other credentials in requests to your function URL.- Returns:
this
-
allowedHeaders
@Stability(Stable) public FunctionUrlCorsOptions.Builder allowedHeaders(List<String> allowedHeaders) Sets the value ofFunctionUrlCorsOptions.getAllowedHeaders()
- Parameters:
allowedHeaders
- Headers that are specified in the Access-Control-Request-Headers header.- Returns:
this
-
allowedMethods
@Stability(Stable) public FunctionUrlCorsOptions.Builder allowedMethods(List<? extends HttpMethod> allowedMethods) Sets the value ofFunctionUrlCorsOptions.getAllowedMethods()
- Parameters:
allowedMethods
- An HTTP method that you allow the origin to execute.- Returns:
this
-
allowedOrigins
@Stability(Stable) public FunctionUrlCorsOptions.Builder allowedOrigins(List<String> allowedOrigins) Sets the value ofFunctionUrlCorsOptions.getAllowedOrigins()
- Parameters:
allowedOrigins
- One or more origins you want customers to be able to access the bucket from.- Returns:
this
-
exposedHeaders
@Stability(Stable) public FunctionUrlCorsOptions.Builder exposedHeaders(List<String> exposedHeaders) Sets the value ofFunctionUrlCorsOptions.getExposedHeaders()
- Parameters:
exposedHeaders
- One or more headers in the response that you want customers to be able to access from their applications.- Returns:
this
-
maxAge
Sets the value ofFunctionUrlCorsOptions.getMaxAge()
- Parameters:
maxAge
- The time in seconds that your browser is to cache the preflight response for the specified resource.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<FunctionUrlCorsOptions>
- Returns:
- a new instance of
FunctionUrlCorsOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-