aws_sdk_s3/operation/get_bucket_location/_get_bucket_location_output.rs
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 GetBucketLocationOutput {
6 /// <p>Specifies the Region where the bucket resides. For a list of all the Amazon S3 supported location constraints by Region, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a>.</p>
7 /// <p>Buckets in Region <code>us-east-1</code> have a LocationConstraint of <code>null</code>. Buckets with a LocationConstraint of <code>EU</code> reside in <code>eu-west-1</code>.</p>
8 pub location_constraint: ::std::option::Option<crate::types::BucketLocationConstraint>,
9 _extended_request_id: Option<String>,
10 _request_id: Option<String>,
11}
12impl GetBucketLocationOutput {
13 /// <p>Specifies the Region where the bucket resides. For a list of all the Amazon S3 supported location constraints by Region, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a>.</p>
14 /// <p>Buckets in Region <code>us-east-1</code> have a LocationConstraint of <code>null</code>. Buckets with a LocationConstraint of <code>EU</code> reside in <code>eu-west-1</code>.</p>
15 pub fn location_constraint(&self) -> ::std::option::Option<&crate::types::BucketLocationConstraint> {
16 self.location_constraint.as_ref()
17 }
18}
19impl crate::s3_request_id::RequestIdExt for GetBucketLocationOutput {
20 fn extended_request_id(&self) -> Option<&str> {
21 self._extended_request_id.as_deref()
22 }
23}
24impl ::aws_types::request_id::RequestId for GetBucketLocationOutput {
25 fn request_id(&self) -> Option<&str> {
26 self._request_id.as_deref()
27 }
28}
29impl GetBucketLocationOutput {
30 /// Creates a new builder-style object to manufacture [`GetBucketLocationOutput`](crate::operation::get_bucket_location::GetBucketLocationOutput).
31 pub fn builder() -> crate::operation::get_bucket_location::builders::GetBucketLocationOutputBuilder {
32 crate::operation::get_bucket_location::builders::GetBucketLocationOutputBuilder::default()
33 }
34}
35
36/// A builder for [`GetBucketLocationOutput`](crate::operation::get_bucket_location::GetBucketLocationOutput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct GetBucketLocationOutputBuilder {
40 pub(crate) location_constraint: ::std::option::Option<crate::types::BucketLocationConstraint>,
41 _extended_request_id: Option<String>,
42 _request_id: Option<String>,
43}
44impl GetBucketLocationOutputBuilder {
45 /// <p>Specifies the Region where the bucket resides. For a list of all the Amazon S3 supported location constraints by Region, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a>.</p>
46 /// <p>Buckets in Region <code>us-east-1</code> have a LocationConstraint of <code>null</code>. Buckets with a LocationConstraint of <code>EU</code> reside in <code>eu-west-1</code>.</p>
47 pub fn location_constraint(mut self, input: crate::types::BucketLocationConstraint) -> Self {
48 self.location_constraint = ::std::option::Option::Some(input);
49 self
50 }
51 /// <p>Specifies the Region where the bucket resides. For a list of all the Amazon S3 supported location constraints by Region, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a>.</p>
52 /// <p>Buckets in Region <code>us-east-1</code> have a LocationConstraint of <code>null</code>. Buckets with a LocationConstraint of <code>EU</code> reside in <code>eu-west-1</code>.</p>
53 pub fn set_location_constraint(mut self, input: ::std::option::Option<crate::types::BucketLocationConstraint>) -> Self {
54 self.location_constraint = input;
55 self
56 }
57 /// <p>Specifies the Region where the bucket resides. For a list of all the Amazon S3 supported location constraints by Region, see <a href="https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region">Regions and Endpoints</a>.</p>
58 /// <p>Buckets in Region <code>us-east-1</code> have a LocationConstraint of <code>null</code>. Buckets with a LocationConstraint of <code>EU</code> reside in <code>eu-west-1</code>.</p>
59 pub fn get_location_constraint(&self) -> &::std::option::Option<crate::types::BucketLocationConstraint> {
60 &self.location_constraint
61 }
62 pub(crate) fn _extended_request_id(mut self, extended_request_id: impl Into<String>) -> Self {
63 self._extended_request_id = Some(extended_request_id.into());
64 self
65 }
66
67 pub(crate) fn _set_extended_request_id(&mut self, extended_request_id: Option<String>) -> &mut Self {
68 self._extended_request_id = extended_request_id;
69 self
70 }
71 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
72 self._request_id = Some(request_id.into());
73 self
74 }
75
76 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
77 self._request_id = request_id;
78 self
79 }
80 /// Consumes the builder and constructs a [`GetBucketLocationOutput`](crate::operation::get_bucket_location::GetBucketLocationOutput).
81 pub fn build(self) -> crate::operation::get_bucket_location::GetBucketLocationOutput {
82 crate::operation::get_bucket_location::GetBucketLocationOutput {
83 location_constraint: self.location_constraint,
84 _extended_request_id: self._extended_request_id,
85 _request_id: self._request_id,
86 }
87 }
88}