aws_sdk_s3/types/_location_info.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies the location where the bucket will be created.</p>
4/// <p>For directory buckets, the location type is Availability Zone or Local Zone. For more information about directory buckets, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/directory-buckets-overview.html">Working with directory buckets</a> in the <i>Amazon S3 User Guide</i>.</p><note>
5/// <p>This functionality is only supported by directory buckets.</p>
6/// </note>
7#[non_exhaustive]
8#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
9pub struct LocationInfo {
10 /// <p>The type of location where the bucket will be created.</p>
11 pub r#type: ::std::option::Option<crate::types::LocationType>,
12 /// <p>The name of the location where the bucket will be created.</p>
13 /// <p>For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is <code>usw2-az1</code>.</p>
14 pub name: ::std::option::Option<::std::string::String>,
15}
16impl LocationInfo {
17 /// <p>The type of location where the bucket will be created.</p>
18 pub fn r#type(&self) -> ::std::option::Option<&crate::types::LocationType> {
19 self.r#type.as_ref()
20 }
21 /// <p>The name of the location where the bucket will be created.</p>
22 /// <p>For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is <code>usw2-az1</code>.</p>
23 pub fn name(&self) -> ::std::option::Option<&str> {
24 self.name.as_deref()
25 }
26}
27impl LocationInfo {
28 /// Creates a new builder-style object to manufacture [`LocationInfo`](crate::types::LocationInfo).
29 pub fn builder() -> crate::types::builders::LocationInfoBuilder {
30 crate::types::builders::LocationInfoBuilder::default()
31 }
32}
33
34/// A builder for [`LocationInfo`](crate::types::LocationInfo).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct LocationInfoBuilder {
38 pub(crate) r#type: ::std::option::Option<crate::types::LocationType>,
39 pub(crate) name: ::std::option::Option<::std::string::String>,
40}
41impl LocationInfoBuilder {
42 /// <p>The type of location where the bucket will be created.</p>
43 pub fn r#type(mut self, input: crate::types::LocationType) -> Self {
44 self.r#type = ::std::option::Option::Some(input);
45 self
46 }
47 /// <p>The type of location where the bucket will be created.</p>
48 pub fn set_type(mut self, input: ::std::option::Option<crate::types::LocationType>) -> Self {
49 self.r#type = input;
50 self
51 }
52 /// <p>The type of location where the bucket will be created.</p>
53 pub fn get_type(&self) -> &::std::option::Option<crate::types::LocationType> {
54 &self.r#type
55 }
56 /// <p>The name of the location where the bucket will be created.</p>
57 /// <p>For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is <code>usw2-az1</code>.</p>
58 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59 self.name = ::std::option::Option::Some(input.into());
60 self
61 }
62 /// <p>The name of the location where the bucket will be created.</p>
63 /// <p>For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is <code>usw2-az1</code>.</p>
64 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65 self.name = input;
66 self
67 }
68 /// <p>The name of the location where the bucket will be created.</p>
69 /// <p>For directory buckets, the name of the location is the Zone ID of the Availability Zone (AZ) or Local Zone (LZ) where the bucket will be created. An example AZ ID value is <code>usw2-az1</code>.</p>
70 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
71 &self.name
72 }
73 /// Consumes the builder and constructs a [`LocationInfo`](crate::types::LocationInfo).
74 pub fn build(self) -> crate::types::LocationInfo {
75 crate::types::LocationInfo {
76 r#type: self.r#type,
77 name: self.name,
78 }
79 }
80}