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