Skip to main content

aws_sdk_securityhub/types/
_aws_s3_bucket_website_configuration_routing_rule_redirect.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>The rules to redirect the request if the condition in <code>Condition</code> is met.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct AwsS3BucketWebsiteConfigurationRoutingRuleRedirect {
7    /// <p>The host name to use in the redirect request.</p>
8    pub hostname: ::std::option::Option<::std::string::String>,
9    /// <p>The HTTP redirect code to use in the response.</p>
10    pub http_redirect_code: ::std::option::Option<::std::string::String>,
11    /// <p>The protocol to use to redirect the request. By default, uses the protocol from the original request.</p>
12    pub protocol: ::std::option::Option<::std::string::String>,
13    /// <p>The object key prefix to use in the redirect request.</p>
14    /// <p>Cannot be provided if <code>ReplaceKeyWith</code> is present.</p>
15    pub replace_key_prefix_with: ::std::option::Option<::std::string::String>,
16    /// <p>The specific object key to use in the redirect request.</p>
17    /// <p>Cannot be provided if <code>ReplaceKeyPrefixWith</code> is present.</p>
18    pub replace_key_with: ::std::option::Option<::std::string::String>,
19}
20impl AwsS3BucketWebsiteConfigurationRoutingRuleRedirect {
21    /// <p>The host name to use in the redirect request.</p>
22    pub fn hostname(&self) -> ::std::option::Option<&str> {
23        self.hostname.as_deref()
24    }
25    /// <p>The HTTP redirect code to use in the response.</p>
26    pub fn http_redirect_code(&self) -> ::std::option::Option<&str> {
27        self.http_redirect_code.as_deref()
28    }
29    /// <p>The protocol to use to redirect the request. By default, uses the protocol from the original request.</p>
30    pub fn protocol(&self) -> ::std::option::Option<&str> {
31        self.protocol.as_deref()
32    }
33    /// <p>The object key prefix to use in the redirect request.</p>
34    /// <p>Cannot be provided if <code>ReplaceKeyWith</code> is present.</p>
35    pub fn replace_key_prefix_with(&self) -> ::std::option::Option<&str> {
36        self.replace_key_prefix_with.as_deref()
37    }
38    /// <p>The specific object key to use in the redirect request.</p>
39    /// <p>Cannot be provided if <code>ReplaceKeyPrefixWith</code> is present.</p>
40    pub fn replace_key_with(&self) -> ::std::option::Option<&str> {
41        self.replace_key_with.as_deref()
42    }
43}
44impl AwsS3BucketWebsiteConfigurationRoutingRuleRedirect {
45    /// Creates a new builder-style object to manufacture [`AwsS3BucketWebsiteConfigurationRoutingRuleRedirect`](crate::types::AwsS3BucketWebsiteConfigurationRoutingRuleRedirect).
46    pub fn builder() -> crate::types::builders::AwsS3BucketWebsiteConfigurationRoutingRuleRedirectBuilder {
47        crate::types::builders::AwsS3BucketWebsiteConfigurationRoutingRuleRedirectBuilder::default()
48    }
49}
50
51/// A builder for [`AwsS3BucketWebsiteConfigurationRoutingRuleRedirect`](crate::types::AwsS3BucketWebsiteConfigurationRoutingRuleRedirect).
52#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
53#[non_exhaustive]
54pub struct AwsS3BucketWebsiteConfigurationRoutingRuleRedirectBuilder {
55    pub(crate) hostname: ::std::option::Option<::std::string::String>,
56    pub(crate) http_redirect_code: ::std::option::Option<::std::string::String>,
57    pub(crate) protocol: ::std::option::Option<::std::string::String>,
58    pub(crate) replace_key_prefix_with: ::std::option::Option<::std::string::String>,
59    pub(crate) replace_key_with: ::std::option::Option<::std::string::String>,
60}
61impl AwsS3BucketWebsiteConfigurationRoutingRuleRedirectBuilder {
62    /// <p>The host name to use in the redirect request.</p>
63    pub fn hostname(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.hostname = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The host name to use in the redirect request.</p>
68    pub fn set_hostname(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.hostname = input;
70        self
71    }
72    /// <p>The host name to use in the redirect request.</p>
73    pub fn get_hostname(&self) -> &::std::option::Option<::std::string::String> {
74        &self.hostname
75    }
76    /// <p>The HTTP redirect code to use in the response.</p>
77    pub fn http_redirect_code(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.http_redirect_code = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The HTTP redirect code to use in the response.</p>
82    pub fn set_http_redirect_code(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.http_redirect_code = input;
84        self
85    }
86    /// <p>The HTTP redirect code to use in the response.</p>
87    pub fn get_http_redirect_code(&self) -> &::std::option::Option<::std::string::String> {
88        &self.http_redirect_code
89    }
90    /// <p>The protocol to use to redirect the request. By default, uses the protocol from the original request.</p>
91    pub fn protocol(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92        self.protocol = ::std::option::Option::Some(input.into());
93        self
94    }
95    /// <p>The protocol to use to redirect the request. By default, uses the protocol from the original request.</p>
96    pub fn set_protocol(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
97        self.protocol = input;
98        self
99    }
100    /// <p>The protocol to use to redirect the request. By default, uses the protocol from the original request.</p>
101    pub fn get_protocol(&self) -> &::std::option::Option<::std::string::String> {
102        &self.protocol
103    }
104    /// <p>The object key prefix to use in the redirect request.</p>
105    /// <p>Cannot be provided if <code>ReplaceKeyWith</code> is present.</p>
106    pub fn replace_key_prefix_with(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
107        self.replace_key_prefix_with = ::std::option::Option::Some(input.into());
108        self
109    }
110    /// <p>The object key prefix to use in the redirect request.</p>
111    /// <p>Cannot be provided if <code>ReplaceKeyWith</code> is present.</p>
112    pub fn set_replace_key_prefix_with(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
113        self.replace_key_prefix_with = input;
114        self
115    }
116    /// <p>The object key prefix to use in the redirect request.</p>
117    /// <p>Cannot be provided if <code>ReplaceKeyWith</code> is present.</p>
118    pub fn get_replace_key_prefix_with(&self) -> &::std::option::Option<::std::string::String> {
119        &self.replace_key_prefix_with
120    }
121    /// <p>The specific object key to use in the redirect request.</p>
122    /// <p>Cannot be provided if <code>ReplaceKeyPrefixWith</code> is present.</p>
123    pub fn replace_key_with(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
124        self.replace_key_with = ::std::option::Option::Some(input.into());
125        self
126    }
127    /// <p>The specific object key to use in the redirect request.</p>
128    /// <p>Cannot be provided if <code>ReplaceKeyPrefixWith</code> is present.</p>
129    pub fn set_replace_key_with(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
130        self.replace_key_with = input;
131        self
132    }
133    /// <p>The specific object key to use in the redirect request.</p>
134    /// <p>Cannot be provided if <code>ReplaceKeyPrefixWith</code> is present.</p>
135    pub fn get_replace_key_with(&self) -> &::std::option::Option<::std::string::String> {
136        &self.replace_key_with
137    }
138    /// Consumes the builder and constructs a [`AwsS3BucketWebsiteConfigurationRoutingRuleRedirect`](crate::types::AwsS3BucketWebsiteConfigurationRoutingRuleRedirect).
139    pub fn build(self) -> crate::types::AwsS3BucketWebsiteConfigurationRoutingRuleRedirect {
140        crate::types::AwsS3BucketWebsiteConfigurationRoutingRuleRedirect {
141            hostname: self.hostname,
142            http_redirect_code: self.http_redirect_code,
143            protocol: self.protocol,
144            replace_key_prefix_with: self.replace_key_prefix_with,
145            replace_key_with: self.replace_key_with,
146        }
147    }
148}