Class CfnBucket.CorsRuleProperty.Builder
java.lang.Object
software.amazon.awscdk.services.s3.CfnBucket.CorsRuleProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnBucket.CorsRuleProperty>
- Enclosing interface:
CfnBucket.CorsRuleProperty
@Stability(Stable)
public static final class CfnBucket.CorsRuleProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnBucket.CorsRuleProperty>
A builder for
CfnBucket.CorsRuleProperty
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionallowedHeaders
(List<String> allowedHeaders) Sets the value ofCfnBucket.CorsRuleProperty.getAllowedHeaders()
allowedMethods
(List<String> allowedMethods) Sets the value ofCfnBucket.CorsRuleProperty.getAllowedMethods()
allowedOrigins
(List<String> allowedOrigins) Sets the value ofCfnBucket.CorsRuleProperty.getAllowedOrigins()
build()
Builds the configured instance.exposedHeaders
(List<String> exposedHeaders) Sets the value ofCfnBucket.CorsRuleProperty.getExposedHeaders()
Sets the value ofCfnBucket.CorsRuleProperty.getId()
Sets the value ofCfnBucket.CorsRuleProperty.getMaxAge()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowedMethods
@Stability(Stable) public CfnBucket.CorsRuleProperty.Builder allowedMethods(List<String> allowedMethods) Sets the value ofCfnBucket.CorsRuleProperty.getAllowedMethods()
- Parameters:
allowedMethods
- An HTTP method that you allow the origin to run. This parameter is required. Allowed values :GET
|PUT
|HEAD
|POST
|DELETE
- Returns:
this
-
allowedOrigins
@Stability(Stable) public CfnBucket.CorsRuleProperty.Builder allowedOrigins(List<String> allowedOrigins) Sets the value ofCfnBucket.CorsRuleProperty.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
@Stability(Stable) public CfnBucket.CorsRuleProperty.Builder allowedHeaders(List<String> allowedHeaders) Sets the value ofCfnBucket.CorsRuleProperty.getAllowedHeaders()
- Parameters:
allowedHeaders
- Headers that are specified in theAccess-Control-Request-Headers
header. These headers are allowed in a preflight OPTIONS request. In response to any preflight OPTIONS request, Amazon S3 returns any requested headers that are allowed.- Returns:
this
-
exposedHeaders
@Stability(Stable) public CfnBucket.CorsRuleProperty.Builder exposedHeaders(List<String> exposedHeaders) Sets the value ofCfnBucket.CorsRuleProperty.getExposedHeaders()
- Parameters:
exposedHeaders
- One or more headers in the response that you want customers to be able to access from their applications (for example, from a JavaScriptXMLHttpRequest
object).- Returns:
this
-
id
Sets the value ofCfnBucket.CorsRuleProperty.getId()
- Parameters:
id
- A unique identifier for this rule. The value must be no more than 255 characters.- Returns:
this
-
maxAge
Sets the value ofCfnBucket.CorsRuleProperty.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<CfnBucket.CorsRuleProperty>
- Returns:
- a new instance of
CfnBucket.CorsRuleProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-