1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetBucketWebsiteOutput {
6/// <p>Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.</p>
7pub redirect_all_requests_to: ::std::option::Option<crate::types::RedirectAllRequestsTo>,
8/// <p>The name of the index document for the website (for example <code>index.html</code>).</p>
9pub index_document: ::std::option::Option<crate::types::IndexDocument>,
10/// <p>The object key name of the website error document to use for 4XX class errors.</p>
11pub error_document: ::std::option::Option<crate::types::ErrorDocument>,
12/// <p>Rules that define when a redirect is applied and the redirect behavior.</p>
13pub routing_rules: ::std::option::Option<::std::vec::Vec<crate::types::RoutingRule>>,
14 _extended_request_id: Option<String>,
15 _request_id: Option<String>,
16}
17impl GetBucketWebsiteOutput {
18/// <p>Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.</p>
19pub fn redirect_all_requests_to(&self) -> ::std::option::Option<&crate::types::RedirectAllRequestsTo> {
20self.redirect_all_requests_to.as_ref()
21 }
22/// <p>The name of the index document for the website (for example <code>index.html</code>).</p>
23pub fn index_document(&self) -> ::std::option::Option<&crate::types::IndexDocument> {
24self.index_document.as_ref()
25 }
26/// <p>The object key name of the website error document to use for 4XX class errors.</p>
27pub fn error_document(&self) -> ::std::option::Option<&crate::types::ErrorDocument> {
28self.error_document.as_ref()
29 }
30/// <p>Rules that define when a redirect is applied and the redirect behavior.</p>
31 ///
32 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.routing_rules.is_none()`.
33pub fn routing_rules(&self) -> &[crate::types::RoutingRule] {
34self.routing_rules.as_deref().unwrap_or_default()
35 }
36}
37impl crate::s3_request_id::RequestIdExt for GetBucketWebsiteOutput {
38fn extended_request_id(&self) -> Option<&str> {
39self._extended_request_id.as_deref()
40 }
41}
42impl ::aws_types::request_id::RequestId for GetBucketWebsiteOutput {
43fn request_id(&self) -> Option<&str> {
44self._request_id.as_deref()
45 }
46}
47impl GetBucketWebsiteOutput {
48/// Creates a new builder-style object to manufacture [`GetBucketWebsiteOutput`](crate::operation::get_bucket_website::GetBucketWebsiteOutput).
49pub fn builder() -> crate::operation::get_bucket_website::builders::GetBucketWebsiteOutputBuilder {
50crate::operation::get_bucket_website::builders::GetBucketWebsiteOutputBuilder::default()
51 }
52}
5354/// A builder for [`GetBucketWebsiteOutput`](crate::operation::get_bucket_website::GetBucketWebsiteOutput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct GetBucketWebsiteOutputBuilder {
58pub(crate) redirect_all_requests_to: ::std::option::Option<crate::types::RedirectAllRequestsTo>,
59pub(crate) index_document: ::std::option::Option<crate::types::IndexDocument>,
60pub(crate) error_document: ::std::option::Option<crate::types::ErrorDocument>,
61pub(crate) routing_rules: ::std::option::Option<::std::vec::Vec<crate::types::RoutingRule>>,
62 _extended_request_id: Option<String>,
63 _request_id: Option<String>,
64}
65impl GetBucketWebsiteOutputBuilder {
66/// <p>Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.</p>
67pub fn redirect_all_requests_to(mut self, input: crate::types::RedirectAllRequestsTo) -> Self {
68self.redirect_all_requests_to = ::std::option::Option::Some(input);
69self
70}
71/// <p>Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.</p>
72pub fn set_redirect_all_requests_to(mut self, input: ::std::option::Option<crate::types::RedirectAllRequestsTo>) -> Self {
73self.redirect_all_requests_to = input;
74self
75}
76/// <p>Specifies the redirect behavior of all requests to a website endpoint of an Amazon S3 bucket.</p>
77pub fn get_redirect_all_requests_to(&self) -> &::std::option::Option<crate::types::RedirectAllRequestsTo> {
78&self.redirect_all_requests_to
79 }
80/// <p>The name of the index document for the website (for example <code>index.html</code>).</p>
81pub fn index_document(mut self, input: crate::types::IndexDocument) -> Self {
82self.index_document = ::std::option::Option::Some(input);
83self
84}
85/// <p>The name of the index document for the website (for example <code>index.html</code>).</p>
86pub fn set_index_document(mut self, input: ::std::option::Option<crate::types::IndexDocument>) -> Self {
87self.index_document = input;
88self
89}
90/// <p>The name of the index document for the website (for example <code>index.html</code>).</p>
91pub fn get_index_document(&self) -> &::std::option::Option<crate::types::IndexDocument> {
92&self.index_document
93 }
94/// <p>The object key name of the website error document to use for 4XX class errors.</p>
95pub fn error_document(mut self, input: crate::types::ErrorDocument) -> Self {
96self.error_document = ::std::option::Option::Some(input);
97self
98}
99/// <p>The object key name of the website error document to use for 4XX class errors.</p>
100pub fn set_error_document(mut self, input: ::std::option::Option<crate::types::ErrorDocument>) -> Self {
101self.error_document = input;
102self
103}
104/// <p>The object key name of the website error document to use for 4XX class errors.</p>
105pub fn get_error_document(&self) -> &::std::option::Option<crate::types::ErrorDocument> {
106&self.error_document
107 }
108/// Appends an item to `routing_rules`.
109 ///
110 /// To override the contents of this collection use [`set_routing_rules`](Self::set_routing_rules).
111 ///
112 /// <p>Rules that define when a redirect is applied and the redirect behavior.</p>
113pub fn routing_rules(mut self, input: crate::types::RoutingRule) -> Self {
114let mut v = self.routing_rules.unwrap_or_default();
115 v.push(input);
116self.routing_rules = ::std::option::Option::Some(v);
117self
118}
119/// <p>Rules that define when a redirect is applied and the redirect behavior.</p>
120pub fn set_routing_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RoutingRule>>) -> Self {
121self.routing_rules = input;
122self
123}
124/// <p>Rules that define when a redirect is applied and the redirect behavior.</p>
125pub fn get_routing_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RoutingRule>> {
126&self.routing_rules
127 }
128pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
129self._extended_request_id = Some(extended_request_id.into());
130self
131}
132133pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
134self._extended_request_id = extended_request_id;
135self
136}
137pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
138self._request_id = Some(request_id.into());
139self
140}
141142pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
143self._request_id = request_id;
144self
145}
146/// Consumes the builder and constructs a [`GetBucketWebsiteOutput`](crate::operation::get_bucket_website::GetBucketWebsiteOutput).
147pub fn build(self) -> crate::operation::get_bucket_website::GetBucketWebsiteOutput {
148crate::operation::get_bucket_website::GetBucketWebsiteOutput {
149 redirect_all_requests_to: self.redirect_all_requests_to,
150 index_document: self.index_document,
151 error_document: self.error_document,
152 routing_rules: self.routing_rules,
153 _extended_request_id: self._extended_request_id,
154 _request_id: self._request_id,
155 }
156 }
157}