Class CorsRule.Builder
java.lang.Object
software.amazon.awscdk.services.s3.CorsRule.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CorsRule>
- Enclosing interface:
CorsRule
@Stability(Stable)
public static final class CorsRule.Builder
extends Object
implements software.amazon.jsii.Builder<CorsRule>
A builder for
CorsRule
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowedHeaders
(List<String> allowedHeaders) Sets the value ofCorsRule.getAllowedHeaders()
allowedMethods
(List<? extends HttpMethods> allowedMethods) Sets the value ofCorsRule.getAllowedMethods()
allowedOrigins
(List<String> allowedOrigins) Sets the value ofCorsRule.getAllowedOrigins()
build()
Builds the configured instance.exposedHeaders
(List<String> exposedHeaders) Sets the value ofCorsRule.getExposedHeaders()
Sets the value ofCorsRule.getId()
Sets the value ofCorsRule.getMaxAge()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowedMethods
@Stability(Stable) public CorsRule.Builder allowedMethods(List<? extends HttpMethods> allowedMethods) Sets the value ofCorsRule.getAllowedMethods()
- Parameters:
allowedMethods
- An HTTP method that you allow the origin to execute. This parameter is required.- Returns:
this
-
allowedOrigins
Sets the value ofCorsRule.getAllowedOrigins()
- Parameters:
allowedOrigins
- One or more origins you want customers to be able to access the bucket from. This parameter is required.- Returns:
this
-
allowedHeaders
Sets the value ofCorsRule.getAllowedHeaders()
- Parameters:
allowedHeaders
- Headers that are specified in the Access-Control-Request-Headers header.- Returns:
this
-
exposedHeaders
Sets the value ofCorsRule.getExposedHeaders()
- Parameters:
exposedHeaders
- One or more headers in the response that you want customers to be able to access from their applications.- Returns:
this
-
id
Sets the value ofCorsRule.getId()
- Parameters:
id
- A unique identifier for this rule.- Returns:
this
-
maxAge
Sets the value ofCorsRule.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<CorsRule>
- Returns:
- a new instance of
CorsRule
- Throws:
NullPointerException
- if any required attribute was not provided
-