aws_sdk_s3control/operation/put_bucket_tagging/
_put_bucket_tagging_input.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 PutBucketTaggingInput {
6    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
7    pub account_id: ::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: ::std::option::Option<::std::string::String>,
21    /// <p></p>
22    pub tagging: ::std::option::Option<crate::types::Tagging>,
23}
24impl PutBucketTaggingInput {
25    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
26    pub fn account_id(&self) -> ::std::option::Option<&str> {
27        self.account_id.as_deref()
28    }
29    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
30    /// <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>
31    /// <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>
32    /// :
33    /// <account-id>
34    /// :outpost/
35    /// <outpost-id>
36    /// /bucket/
37    /// <my-bucket-name></my-bucket-name>
38    /// </outpost-id>
39    /// </account-id>
40    /// </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>
41    pub fn bucket(&self) -> ::std::option::Option<&str> {
42        self.bucket.as_deref()
43    }
44    /// <p></p>
45    pub fn tagging(&self) -> ::std::option::Option<&crate::types::Tagging> {
46        self.tagging.as_ref()
47    }
48}
49impl PutBucketTaggingInput {
50    /// Creates a new builder-style object to manufacture [`PutBucketTaggingInput`](crate::operation::put_bucket_tagging::PutBucketTaggingInput).
51    pub fn builder() -> crate::operation::put_bucket_tagging::builders::PutBucketTaggingInputBuilder {
52        crate::operation::put_bucket_tagging::builders::PutBucketTaggingInputBuilder::default()
53    }
54}
55
56/// A builder for [`PutBucketTaggingInput`](crate::operation::put_bucket_tagging::PutBucketTaggingInput).
57#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
58#[non_exhaustive]
59pub struct PutBucketTaggingInputBuilder {
60    pub(crate) account_id: ::std::option::Option<::std::string::String>,
61    pub(crate) bucket: ::std::option::Option<::std::string::String>,
62    pub(crate) tagging: ::std::option::Option<crate::types::Tagging>,
63}
64impl PutBucketTaggingInputBuilder {
65    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
66    /// This field is required.
67    pub fn account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
68        self.account_id = ::std::option::Option::Some(input.into());
69        self
70    }
71    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
72    pub fn set_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
73        self.account_id = input;
74        self
75    }
76    /// <p>The Amazon Web Services account ID of the Outposts bucket.</p>
77    pub fn get_account_id(&self) -> &::std::option::Option<::std::string::String> {
78        &self.account_id
79    }
80    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
81    /// <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>
82    /// <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>
83    /// :
84    /// <account-id>
85    /// :outpost/
86    /// <outpost-id>
87    /// /bucket/
88    /// <my-bucket-name></my-bucket-name>
89    /// </outpost-id>
90    /// </account-id>
91    /// </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>
92    /// This field is required.
93    pub fn bucket(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
94        self.bucket = ::std::option::Option::Some(input.into());
95        self
96    }
97    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
98    /// <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>
99    /// <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>
100    /// :
101    /// <account-id>
102    /// :outpost/
103    /// <outpost-id>
104    /// /bucket/
105    /// <my-bucket-name></my-bucket-name>
106    /// </outpost-id>
107    /// </account-id>
108    /// </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>
109    pub fn set_bucket(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
110        self.bucket = input;
111        self
112    }
113    /// <p>The Amazon Resource Name (ARN) of the bucket.</p>
114    /// <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>
115    /// <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>
116    /// :
117    /// <account-id>
118    /// :outpost/
119    /// <outpost-id>
120    /// /bucket/
121    /// <my-bucket-name></my-bucket-name>
122    /// </outpost-id>
123    /// </account-id>
124    /// </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>
125    pub fn get_bucket(&self) -> &::std::option::Option<::std::string::String> {
126        &self.bucket
127    }
128    /// <p></p>
129    /// This field is required.
130    pub fn tagging(mut self, input: crate::types::Tagging) -> Self {
131        self.tagging = ::std::option::Option::Some(input);
132        self
133    }
134    /// <p></p>
135    pub fn set_tagging(mut self, input: ::std::option::Option<crate::types::Tagging>) -> Self {
136        self.tagging = input;
137        self
138    }
139    /// <p></p>
140    pub fn get_tagging(&self) -> &::std::option::Option<crate::types::Tagging> {
141        &self.tagging
142    }
143    /// Consumes the builder and constructs a [`PutBucketTaggingInput`](crate::operation::put_bucket_tagging::PutBucketTaggingInput).
144    pub fn build(
145        self,
146    ) -> ::std::result::Result<crate::operation::put_bucket_tagging::PutBucketTaggingInput, ::aws_smithy_types::error::operation::BuildError> {
147        ::std::result::Result::Ok(crate::operation::put_bucket_tagging::PutBucketTaggingInput {
148            account_id: self.account_id,
149            bucket: self.bucket,
150            tagging: self.tagging,
151        })
152    }
153}