aws_sdk_s3control/types/
_s3_set_object_tagging_operation.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Contains the configuration parameters for a PUT Object Tagging operation. S3 Batch Operations passes every object to the underlying <code>PutObjectTagging</code> API operation. For more information about the parameters for this operation, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectPUTtagging.html">PutObjectTagging</a>.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct S3SetObjectTaggingOperation {
7    /// <p></p>
8    pub tag_set: ::std::option::Option<::std::vec::Vec<crate::types::S3Tag>>,
9}
10impl S3SetObjectTaggingOperation {
11    /// <p></p>
12    ///
13    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_set.is_none()`.
14    pub fn tag_set(&self) -> &[crate::types::S3Tag] {
15        self.tag_set.as_deref().unwrap_or_default()
16    }
17}
18impl S3SetObjectTaggingOperation {
19    /// Creates a new builder-style object to manufacture [`S3SetObjectTaggingOperation`](crate::types::S3SetObjectTaggingOperation).
20    pub fn builder() -> crate::types::builders::S3SetObjectTaggingOperationBuilder {
21        crate::types::builders::S3SetObjectTaggingOperationBuilder::default()
22    }
23}
24
25/// A builder for [`S3SetObjectTaggingOperation`](crate::types::S3SetObjectTaggingOperation).
26#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
27#[non_exhaustive]
28pub struct S3SetObjectTaggingOperationBuilder {
29    pub(crate) tag_set: ::std::option::Option<::std::vec::Vec<crate::types::S3Tag>>,
30}
31impl S3SetObjectTaggingOperationBuilder {
32    /// Appends an item to `tag_set`.
33    ///
34    /// To override the contents of this collection use [`set_tag_set`](Self::set_tag_set).
35    ///
36    /// <p></p>
37    pub fn tag_set(mut self, input: crate::types::S3Tag) -> Self {
38        let mut v = self.tag_set.unwrap_or_default();
39        v.push(input);
40        self.tag_set = ::std::option::Option::Some(v);
41        self
42    }
43    /// <p></p>
44    pub fn set_tag_set(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::S3Tag>>) -> Self {
45        self.tag_set = input;
46        self
47    }
48    /// <p></p>
49    pub fn get_tag_set(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::S3Tag>> {
50        &self.tag_set
51    }
52    /// Consumes the builder and constructs a [`S3SetObjectTaggingOperation`](crate::types::S3SetObjectTaggingOperation).
53    pub fn build(self) -> crate::types::S3SetObjectTaggingOperation {
54        crate::types::S3SetObjectTaggingOperation { tag_set: self.tag_set }
55    }
56}