Struct aws_sdk_s3::output::get_bucket_website_output::Builder
source · pub struct Builder { /* private fields */ }
Expand description
A builder for GetBucketWebsiteOutput
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn redirect_all_requests_to(self, input: RedirectAllRequestsTo) -> Self
pub fn redirect_all_requests_to(self, input: RedirectAllRequestsTo) -> Self
Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.
sourcepub fn set_redirect_all_requests_to(
self,
input: Option<RedirectAllRequestsTo>
) -> Self
pub fn set_redirect_all_requests_to(
self,
input: Option<RedirectAllRequestsTo>
) -> Self
Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.
Examples found in repository?
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958
pub fn deser_operation_crate_operation_get_bucket_website(
inp: &[u8],
mut builder: crate::output::get_bucket_website_output::Builder,
) -> Result<crate::output::get_bucket_website_output::Builder, aws_smithy_xml::decode::XmlDecodeError>
{
let mut doc = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
#[allow(unused_variables)]
let start_el = decoder.start_el();
if !start_el.matches("WebsiteConfiguration") {
return Err(
aws_smithy_xml::decode::XmlDecodeError::custom(
format!("encountered invalid XML root: expected WebsiteConfiguration but got {:?}. This is likely a bug in the SDK.", start_el)
)
);
}
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("IndexDocument") /* IndexDocument com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$IndexDocument */ => {
let var_40 =
Some(
crate::xml_deser::deser_structure_crate_model_index_document(&mut tag)
?
)
;
builder = builder.set_index_document(var_40);
}
,
s if s.matches("RedirectAllRequestsTo") /* RedirectAllRequestsTo com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$RedirectAllRequestsTo */ => {
let var_41 =
Some(
crate::xml_deser::deser_structure_crate_model_redirect_all_requests_to(&mut tag)
?
)
;
builder = builder.set_redirect_all_requests_to(var_41);
}
,
s if s.matches("RoutingRules") /* RoutingRules com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$RoutingRules */ => {
let var_42 =
Some(
crate::xml_deser::deser_list_com_amazonaws_s3_routing_rules(&mut tag)
?
)
;
builder = builder.set_routing_rules(var_42);
}
,
s if s.matches("ErrorDocument") /* ErrorDocument com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$ErrorDocument */ => {
let var_43 =
Some(
crate::xml_deser::deser_structure_crate_model_error_document(&mut tag)
?
)
;
builder = builder.set_error_document(var_43);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn index_document(self, input: IndexDocument) -> Self
pub fn index_document(self, input: IndexDocument) -> Self
The name of the index document for the website (for example index.html
).
sourcepub fn set_index_document(self, input: Option<IndexDocument>) -> Self
pub fn set_index_document(self, input: Option<IndexDocument>) -> Self
The name of the index document for the website (for example index.html
).
Examples found in repository?
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958
pub fn deser_operation_crate_operation_get_bucket_website(
inp: &[u8],
mut builder: crate::output::get_bucket_website_output::Builder,
) -> Result<crate::output::get_bucket_website_output::Builder, aws_smithy_xml::decode::XmlDecodeError>
{
let mut doc = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
#[allow(unused_variables)]
let start_el = decoder.start_el();
if !start_el.matches("WebsiteConfiguration") {
return Err(
aws_smithy_xml::decode::XmlDecodeError::custom(
format!("encountered invalid XML root: expected WebsiteConfiguration but got {:?}. This is likely a bug in the SDK.", start_el)
)
);
}
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("IndexDocument") /* IndexDocument com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$IndexDocument */ => {
let var_40 =
Some(
crate::xml_deser::deser_structure_crate_model_index_document(&mut tag)
?
)
;
builder = builder.set_index_document(var_40);
}
,
s if s.matches("RedirectAllRequestsTo") /* RedirectAllRequestsTo com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$RedirectAllRequestsTo */ => {
let var_41 =
Some(
crate::xml_deser::deser_structure_crate_model_redirect_all_requests_to(&mut tag)
?
)
;
builder = builder.set_redirect_all_requests_to(var_41);
}
,
s if s.matches("RoutingRules") /* RoutingRules com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$RoutingRules */ => {
let var_42 =
Some(
crate::xml_deser::deser_list_com_amazonaws_s3_routing_rules(&mut tag)
?
)
;
builder = builder.set_routing_rules(var_42);
}
,
s if s.matches("ErrorDocument") /* ErrorDocument com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$ErrorDocument */ => {
let var_43 =
Some(
crate::xml_deser::deser_structure_crate_model_error_document(&mut tag)
?
)
;
builder = builder.set_error_document(var_43);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn error_document(self, input: ErrorDocument) -> Self
pub fn error_document(self, input: ErrorDocument) -> Self
The object key name of the website error document to use for 4XX class errors.
sourcepub fn set_error_document(self, input: Option<ErrorDocument>) -> Self
pub fn set_error_document(self, input: Option<ErrorDocument>) -> Self
The object key name of the website error document to use for 4XX class errors.
Examples found in repository?
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958
pub fn deser_operation_crate_operation_get_bucket_website(
inp: &[u8],
mut builder: crate::output::get_bucket_website_output::Builder,
) -> Result<crate::output::get_bucket_website_output::Builder, aws_smithy_xml::decode::XmlDecodeError>
{
let mut doc = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
#[allow(unused_variables)]
let start_el = decoder.start_el();
if !start_el.matches("WebsiteConfiguration") {
return Err(
aws_smithy_xml::decode::XmlDecodeError::custom(
format!("encountered invalid XML root: expected WebsiteConfiguration but got {:?}. This is likely a bug in the SDK.", start_el)
)
);
}
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("IndexDocument") /* IndexDocument com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$IndexDocument */ => {
let var_40 =
Some(
crate::xml_deser::deser_structure_crate_model_index_document(&mut tag)
?
)
;
builder = builder.set_index_document(var_40);
}
,
s if s.matches("RedirectAllRequestsTo") /* RedirectAllRequestsTo com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$RedirectAllRequestsTo */ => {
let var_41 =
Some(
crate::xml_deser::deser_structure_crate_model_redirect_all_requests_to(&mut tag)
?
)
;
builder = builder.set_redirect_all_requests_to(var_41);
}
,
s if s.matches("RoutingRules") /* RoutingRules com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$RoutingRules */ => {
let var_42 =
Some(
crate::xml_deser::deser_list_com_amazonaws_s3_routing_rules(&mut tag)
?
)
;
builder = builder.set_routing_rules(var_42);
}
,
s if s.matches("ErrorDocument") /* ErrorDocument com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$ErrorDocument */ => {
let var_43 =
Some(
crate::xml_deser::deser_structure_crate_model_error_document(&mut tag)
?
)
;
builder = builder.set_error_document(var_43);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn routing_rules(self, input: RoutingRule) -> Self
pub fn routing_rules(self, input: RoutingRule) -> Self
Appends an item to routing_rules
.
To override the contents of this collection use set_routing_rules
.
Rules that define when a redirect is applied and the redirect behavior.
sourcepub fn set_routing_rules(self, input: Option<Vec<RoutingRule>>) -> Self
pub fn set_routing_rules(self, input: Option<Vec<RoutingRule>>) -> Self
Rules that define when a redirect is applied and the redirect behavior.
Examples found in repository?
894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958
pub fn deser_operation_crate_operation_get_bucket_website(
inp: &[u8],
mut builder: crate::output::get_bucket_website_output::Builder,
) -> Result<crate::output::get_bucket_website_output::Builder, aws_smithy_xml::decode::XmlDecodeError>
{
let mut doc = aws_smithy_xml::decode::Document::try_from(inp)?;
#[allow(unused_mut)]
let mut decoder = doc.root_element()?;
#[allow(unused_variables)]
let start_el = decoder.start_el();
if !start_el.matches("WebsiteConfiguration") {
return Err(
aws_smithy_xml::decode::XmlDecodeError::custom(
format!("encountered invalid XML root: expected WebsiteConfiguration but got {:?}. This is likely a bug in the SDK.", start_el)
)
);
}
while let Some(mut tag) = decoder.next_tag() {
match tag.start_el() {
s if s.matches("IndexDocument") /* IndexDocument com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$IndexDocument */ => {
let var_40 =
Some(
crate::xml_deser::deser_structure_crate_model_index_document(&mut tag)
?
)
;
builder = builder.set_index_document(var_40);
}
,
s if s.matches("RedirectAllRequestsTo") /* RedirectAllRequestsTo com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$RedirectAllRequestsTo */ => {
let var_41 =
Some(
crate::xml_deser::deser_structure_crate_model_redirect_all_requests_to(&mut tag)
?
)
;
builder = builder.set_redirect_all_requests_to(var_41);
}
,
s if s.matches("RoutingRules") /* RoutingRules com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$RoutingRules */ => {
let var_42 =
Some(
crate::xml_deser::deser_list_com_amazonaws_s3_routing_rules(&mut tag)
?
)
;
builder = builder.set_routing_rules(var_42);
}
,
s if s.matches("ErrorDocument") /* ErrorDocument com.amazonaws.s3.synthetic#GetBucketWebsiteOutput$ErrorDocument */ => {
let var_43 =
Some(
crate::xml_deser::deser_structure_crate_model_error_document(&mut tag)
?
)
;
builder = builder.set_error_document(var_43);
}
,
_ => {}
}
}
Ok(builder)
}
sourcepub fn build(self) -> GetBucketWebsiteOutput
pub fn build(self) -> GetBucketWebsiteOutput
Consumes the builder and constructs a GetBucketWebsiteOutput
.
Examples found in repository?
1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474
pub fn parse_get_bucket_website_response(
response: &http::Response<bytes::Bytes>,
) -> std::result::Result<crate::output::GetBucketWebsiteOutput, crate::error::GetBucketWebsiteError>
{
Ok({
#[allow(unused_mut)]
let mut output = crate::output::get_bucket_website_output::Builder::default();
let _ = response;
output = crate::xml_deser::deser_operation_crate_operation_get_bucket_website(
response.body().as_ref(),
output,
)
.map_err(crate::error::GetBucketWebsiteError::unhandled)?;
output.build()
})
}