Class: AWSCDK::S3::RoutingRule
- Inherits:
-
Jsii::Struct
- Object
- Jsii::Struct
- AWSCDK::S3::RoutingRule
- Defined in:
- s3/routing_rule.rb
Overview
Rule that define when a redirect is applied and the redirect behavior.
Instance Attribute Summary collapse
-
#condition ⇒ AWSCDK::S3::RoutingRuleCondition?
readonly
Specifies a condition that must be met for the specified redirect to apply.
-
#host_name ⇒ String?
readonly
The host name to use in the redirect request.
-
#http_redirect_code ⇒ String?
readonly
The HTTP redirect code to use on the response.
-
#protocol ⇒ AWSCDK::S3::RedirectProtocol?
readonly
Protocol to use when redirecting requests.
-
#replace_key ⇒ AWSCDK::S3::ReplaceKey?
readonly
Specifies the object key prefix to use in the redirect request.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(condition: nil, host_name: nil, http_redirect_code: nil, protocol: nil, replace_key: nil) ⇒ RoutingRule
constructor
A new instance of RoutingRule.
- #to_jsii ⇒ Object
Constructor Details
#initialize(condition: nil, host_name: nil, http_redirect_code: nil, protocol: nil, replace_key: nil) ⇒ RoutingRule
Returns a new instance of RoutingRule.
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 's3/routing_rule.rb', line 14 def initialize(condition: nil, host_name: nil, http_redirect_code: nil, protocol: nil, replace_key: nil) @condition = condition.is_a?(Hash) ? ::AWSCDK::S3::RoutingRuleCondition.new(**condition.transform_keys(&:to_sym)) : condition Jsii::Type.check_type(@condition, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuUm91dGluZ1J1bGVDb25kaXRpb24ifQ==")), "condition") unless @condition.nil? @host_name = host_name Jsii::Type.check_type(@host_name, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "hostName") unless @host_name.nil? @http_redirect_code = http_redirect_code Jsii::Type.check_type(@http_redirect_code, JSON.parse(Base64.strict_decode64("eyJwcmltaXRpdmUiOiJzdHJpbmcifQ==")), "httpRedirectCode") unless @http_redirect_code.nil? @protocol = protocol Jsii::Type.check_type(@protocol, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuUmVkaXJlY3RQcm90b2NvbCJ9")), "protocol") unless @protocol.nil? @replace_key = replace_key Jsii::Type.check_type(@replace_key, JSON.parse(Base64.strict_decode64("eyJmcW4iOiJhd3MtY2RrLWxpYi5hd3NfczMuUmVwbGFjZUtleSJ9")), "replaceKey") unless @replace_key.nil? end |
Instance Attribute Details
#condition ⇒ AWSCDK::S3::RoutingRuleCondition? (readonly)
Default: - No condition
Specifies a condition that must be met for the specified redirect to apply.
31 32 33 |
# File 's3/routing_rule.rb', line 31 def condition @condition end |
#host_name ⇒ String? (readonly)
Default: - The host name used in the original request.
The host name to use in the redirect request.
36 37 38 |
# File 's3/routing_rule.rb', line 36 def host_name @host_name end |
#http_redirect_code ⇒ String? (readonly)
Default: "301" - Moved Permanently
The HTTP redirect code to use on the response.
41 42 43 |
# File 's3/routing_rule.rb', line 41 def http_redirect_code @http_redirect_code end |
#protocol ⇒ AWSCDK::S3::RedirectProtocol? (readonly)
Default: - The protocol used in the original request.
Protocol to use when redirecting requests.
46 47 48 |
# File 's3/routing_rule.rb', line 46 def protocol @protocol end |
#replace_key ⇒ AWSCDK::S3::ReplaceKey? (readonly)
Default: - The key will not be replaced
Specifies the object key prefix to use in the redirect request.
51 52 53 |
# File 's3/routing_rule.rb', line 51 def replace_key @replace_key end |
Class Method Details
.jsii_properties ⇒ Object
53 54 55 56 57 58 59 60 61 |
# File 's3/routing_rule.rb', line 53 def self.jsii_properties { :condition => "condition", :host_name => "hostName", :http_redirect_code => "httpRedirectCode", :protocol => "protocol", :replace_key => "replaceKey", } end |
Instance Method Details
#to_jsii ⇒ Object
63 64 65 66 67 68 69 70 71 72 73 |
# File 's3/routing_rule.rb', line 63 def to_jsii result = {} result.merge!({ "condition" => @condition, "hostName" => @host_name, "httpRedirectCode" => @http_redirect_code, "protocol" => @protocol, "replaceKey" => @replace_key, }) result.compact end |