aws_sdk_s3control/operation/create_bucket/_create_bucket_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 CreateBucketOutput {
6 /// <p>The location of the bucket.</p>
7 pub location: ::std::option::Option<::std::string::String>,
8 /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
9 /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
10 /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
11 /// :
12 /// <account-id>
13 /// :outpost/
14 /// <outpost-id>
15 /// /bucket/
16 /// <my-bucket-name></my-bucket-name>
17 /// </outpost-id>
18 /// </account-id>
19 /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
20 pub bucket_arn: ::std::option::Option<::std::string::String>,
21 _request_id: Option<String>,
22}
23impl CreateBucketOutput {
24 /// <p>The location of the bucket.</p>
25 pub fn location(&self) -> ::std::option::Option<&str> {
26 self.location.as_deref()
27 }
28 /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
29 /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
30 /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
31 /// :
32 /// <account-id>
33 /// :outpost/
34 /// <outpost-id>
35 /// /bucket/
36 /// <my-bucket-name></my-bucket-name>
37 /// </outpost-id>
38 /// </account-id>
39 /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
40 pub fn bucket_arn(&self) -> ::std::option::Option<&str> {
41 self.bucket_arn.as_deref()
42 }
43}
44impl ::aws_types::request_id::RequestId for CreateBucketOutput {
45 fn request_id(&self) -> Option<&str> {
46 self._request_id.as_deref()
47 }
48}
49impl CreateBucketOutput {
50 /// Creates a new builder-style object to manufacture [`CreateBucketOutput`](crate::operation::create_bucket::CreateBucketOutput).
51 pub fn builder() -> crate::operation::create_bucket::builders::CreateBucketOutputBuilder {
52 crate::operation::create_bucket::builders::CreateBucketOutputBuilder::default()
53 }
54}
55
56/// A builder for [`CreateBucketOutput`](crate::operation::create_bucket::CreateBucketOutput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct CreateBucketOutputBuilder {
60 pub(crate) location: ::std::option::Option<::std::string::String>,
61 pub(crate) bucket_arn: ::std::option::Option<::std::string::String>,
62 _request_id: Option<String>,
63}
64impl CreateBucketOutputBuilder {
65 /// <p>The location of the bucket.</p>
66 pub fn location(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67 self.location = ::std::option::Option::Some(input.into());
68 self
69 }
70 /// <p>The location of the bucket.</p>
71 pub fn set_location(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.location = input;
73 self
74 }
75 /// <p>The location of the bucket.</p>
76 pub fn get_location(&self) -> &::std::option::Option<::std::string::String> {
77 &self.location
78 }
79 /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
80 /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
81 /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
82 /// :
83 /// <account-id>
84 /// :outpost/
85 /// <outpost-id>
86 /// /bucket/
87 /// <my-bucket-name></my-bucket-name>
88 /// </outpost-id>
89 /// </account-id>
90 /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
91 pub fn bucket_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
92 self.bucket_arn = ::std::option::Option::Some(input.into());
93 self
94 }
95 /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
96 /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
97 /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
98 /// :
99 /// <account-id>
100 /// :outpost/
101 /// <outpost-id>
102 /// /bucket/
103 /// <my-bucket-name></my-bucket-name>
104 /// </outpost-id>
105 /// </account-id>
106 /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
107 pub fn set_bucket_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108 self.bucket_arn = input;
109 self
110 }
111 /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
112 /// <p>For using this parameter with Amazon S3 on Outposts with the REST API, you must specify the name and the x-amz-outpost-id as well.</p>
113 /// <p>For using this parameter with S3 on Outposts with the Amazon Web Services SDK and CLI, you must specify the ARN of the bucket accessed in the format <code>arn:aws:s3-outposts:<region>
114 /// :
115 /// <account-id>
116 /// :outpost/
117 /// <outpost-id>
118 /// /bucket/
119 /// <my-bucket-name></my-bucket-name>
120 /// </outpost-id>
121 /// </account-id>
122 /// </region></code>. For example, to access the bucket <code>reports</code> through Outpost <code>my-outpost</code> owned by account <code>123456789012</code> in Region <code>us-west-2</code>, use the URL encoding of <code>arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/bucket/reports</code>. The value must be URL encoded.</p>
123 pub fn get_bucket_arn(&self) -> &::std::option::Option<::std::string::String> {
124 &self.bucket_arn
125 }
126 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
127 self._request_id = Some(request_id.into());
128 self
129 }
130
131 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
132 self._request_id = request_id;
133 self
134 }
135 /// Consumes the builder and constructs a [`CreateBucketOutput`](crate::operation::create_bucket::CreateBucketOutput).
136 pub fn build(self) -> crate::operation::create_bucket::CreateBucketOutput {
137 crate::operation::create_bucket::CreateBucketOutput {
138 location: self.location,
139 bucket_arn: self.bucket_arn,
140 _request_id: self._request_id,
141 }
142 }
143}