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
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
/// <p>A Region that supports a Multi-Region Access Point as well as the associated bucket for the Region.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Region {
/// <p>The name of the associated bucket for the Region.</p>
pub bucket: ::std::string::String,
/// <p>The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi-Region Access Point.</p>
pub bucket_account_id: ::std::option::Option<::std::string::String>,
}
impl Region {
/// <p>The name of the associated bucket for the Region.</p>
pub fn bucket(&self) -> &str {
use std::ops::Deref;
self.bucket.deref()
}
/// <p>The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi-Region Access Point.</p>
pub fn bucket_account_id(&self) -> ::std::option::Option<&str> {
self.bucket_account_id.as_deref()
}
}
impl Region {
/// Creates a new builder-style object to manufacture [`Region`](crate::types::Region).
pub fn builder() -> crate::types::builders::RegionBuilder {
crate::types::builders::RegionBuilder::default()
}
}
/// A builder for [`Region`](crate::types::Region).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RegionBuilder {
pub(crate) bucket: ::std::option::Option<::std::string::String>,
pub(crate) bucket_account_id: ::std::option::Option<::std::string::String>,
}
impl RegionBuilder {
/// <p>The name of the associated bucket for the Region.</p>
/// This field is required.
pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.bucket = ::std::option::Option::Some(input.into());
self
}
/// <p>The name of the associated bucket for the Region.</p>
pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.bucket = input;
self
}
/// <p>The name of the associated bucket for the Region.</p>
pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
&self.bucket
}
/// <p>The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi-Region Access Point.</p>
pub fn bucket_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.bucket_account_id = ::std::option::Option::Some(input.into());
self
}
/// <p>The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi-Region Access Point.</p>
pub fn set_bucket_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.bucket_account_id = input;
self
}
/// <p>The Amazon Web Services account ID that owns the Amazon S3 bucket that's associated with this Multi-Region Access Point.</p>
pub fn get_bucket_account_id(&self) -> &::std::option::Option<::std::string::String> {
&self.bucket_account_id
}
/// Consumes the builder and constructs a [`Region`](crate::types::Region).
/// This method will fail if any of the following fields are not set:
/// - [`bucket`](crate::types::builders::RegionBuilder::bucket)
pub fn build(self) -> ::std::result::Result<crate::types::Region, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Region {
bucket: self.bucket.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"bucket",
"bucket was not specified but it is required when building Region",
)
})?,
bucket_account_id: self.bucket_account_id,
})
}
}