Class CfnContainer.CorsRuleProperty.Builder
java.lang.Object
software.amazon.awscdk.services.mediastore.CfnContainer.CorsRuleProperty.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<CfnContainer.CorsRuleProperty>
- Enclosing interface:
CfnContainer.CorsRuleProperty
@Stability(Stable)
public static final class CfnContainer.CorsRuleProperty.Builder
extends Object
implements software.amazon.jsii.Builder<CfnContainer.CorsRuleProperty>
A builder for
CfnContainer.CorsRuleProperty
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowedHeaders
(List<String> allowedHeaders) Sets the value ofCfnContainer.CorsRuleProperty.getAllowedHeaders()
allowedMethods
(List<String> allowedMethods) Sets the value ofCfnContainer.CorsRuleProperty.getAllowedMethods()
allowedOrigins
(List<String> allowedOrigins) Sets the value ofCfnContainer.CorsRuleProperty.getAllowedOrigins()
build()
Builds the configured instance.exposeHeaders
(List<String> exposeHeaders) Sets the value ofCfnContainer.CorsRuleProperty.getExposeHeaders()
maxAgeSeconds
(Number maxAgeSeconds) Sets the value ofCfnContainer.CorsRuleProperty.getMaxAgeSeconds()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
allowedHeaders
@Stability(Stable) public CfnContainer.CorsRuleProperty.Builder allowedHeaders(List<String> allowedHeaders) Sets the value ofCfnContainer.CorsRuleProperty.getAllowedHeaders()
- Parameters:
allowedHeaders
- Specifies which headers are allowed in a preflightOPTIONS
request through theAccess-Control-Request-Headers
header. Each header name that is specified inAccess-Control-Request-Headers
must have a corresponding entry in the rule. Only the headers that were requested are sent back.This element can contain only one wildcard character (*).
- Returns:
this
-
allowedMethods
@Stability(Stable) public CfnContainer.CorsRuleProperty.Builder allowedMethods(List<String> allowedMethods) Sets the value ofCfnContainer.CorsRuleProperty.getAllowedMethods()
- Parameters:
allowedMethods
- Identifies an HTTP method that the origin that is specified in the rule is allowed to execute. Each CORS rule must contain at least oneAllowedMethods
and oneAllowedOrigins
element.- Returns:
this
-
allowedOrigins
@Stability(Stable) public CfnContainer.CorsRuleProperty.Builder allowedOrigins(List<String> allowedOrigins) Sets the value ofCfnContainer.CorsRuleProperty.getAllowedOrigins()
- Parameters:
allowedOrigins
- One or more response headers that you want users to be able to access from their applications (for example, from a JavaScriptXMLHttpRequest
object). Each CORS rule must have at least oneAllowedOrigins
element. The string value can include only one wildcard character (), for example, http://.example.com. Additionally, you can specify only one wildcard character to allow cross-origin access for all origins.- Returns:
this
-
exposeHeaders
@Stability(Stable) public CfnContainer.CorsRuleProperty.Builder exposeHeaders(List<String> exposeHeaders) Sets the value ofCfnContainer.CorsRuleProperty.getExposeHeaders()
- Parameters:
exposeHeaders
- One or more headers in the response that you want users to be able to access from their applications (for example, from a JavaScriptXMLHttpRequest
object). This element is optional for each rule.- Returns:
this
-
maxAgeSeconds
Sets the value ofCfnContainer.CorsRuleProperty.getMaxAgeSeconds()
- Parameters:
maxAgeSeconds
- The time in seconds that your browser caches the preflight response for the specified resource. A CORS rule can have only oneMaxAgeSeconds
element.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<CfnContainer.CorsRuleProperty>
- Returns:
- a new instance of
CfnContainer.CorsRuleProperty
- Throws:
NullPointerException
- if any required attribute was not provided
-