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