aws_sdk_directory/operation/remove_tags_from_resource/
_remove_tags_from_resource_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 RemoveTagsFromResourceInput {
6    /// <p>Identifier (ID) of the directory from which to remove the tag.</p>
7    pub resource_id: ::std::option::Option<::std::string::String>,
8    /// <p>The tag key (name) of the tag to be removed.</p>
9    pub tag_keys: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
10}
11impl RemoveTagsFromResourceInput {
12    /// <p>Identifier (ID) of the directory from which to remove the tag.</p>
13    pub fn resource_id(&self) -> ::std::option::Option<&str> {
14        self.resource_id.as_deref()
15    }
16    /// <p>The tag key (name) of the tag to be removed.</p>
17    ///
18    /// 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_keys.is_none()`.
19    pub fn tag_keys(&self) -> &[::std::string::String] {
20        self.tag_keys.as_deref().unwrap_or_default()
21    }
22}
23impl RemoveTagsFromResourceInput {
24    /// Creates a new builder-style object to manufacture [`RemoveTagsFromResourceInput`](crate::operation::remove_tags_from_resource::RemoveTagsFromResourceInput).
25    pub fn builder() -> crate::operation::remove_tags_from_resource::builders::RemoveTagsFromResourceInputBuilder {
26        crate::operation::remove_tags_from_resource::builders::RemoveTagsFromResourceInputBuilder::default()
27    }
28}
29
30/// A builder for [`RemoveTagsFromResourceInput`](crate::operation::remove_tags_from_resource::RemoveTagsFromResourceInput).
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct RemoveTagsFromResourceInputBuilder {
34    pub(crate) resource_id: ::std::option::Option<::std::string::String>,
35    pub(crate) tag_keys: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
36}
37impl RemoveTagsFromResourceInputBuilder {
38    /// <p>Identifier (ID) of the directory from which to remove the tag.</p>
39    /// This field is required.
40    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41        self.resource_id = ::std::option::Option::Some(input.into());
42        self
43    }
44    /// <p>Identifier (ID) of the directory from which to remove the tag.</p>
45    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46        self.resource_id = input;
47        self
48    }
49    /// <p>Identifier (ID) of the directory from which to remove the tag.</p>
50    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
51        &self.resource_id
52    }
53    /// Appends an item to `tag_keys`.
54    ///
55    /// To override the contents of this collection use [`set_tag_keys`](Self::set_tag_keys).
56    ///
57    /// <p>The tag key (name) of the tag to be removed.</p>
58    pub fn tag_keys(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        let mut v = self.tag_keys.unwrap_or_default();
60        v.push(input.into());
61        self.tag_keys = ::std::option::Option::Some(v);
62        self
63    }
64    /// <p>The tag key (name) of the tag to be removed.</p>
65    pub fn set_tag_keys(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
66        self.tag_keys = input;
67        self
68    }
69    /// <p>The tag key (name) of the tag to be removed.</p>
70    pub fn get_tag_keys(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
71        &self.tag_keys
72    }
73    /// Consumes the builder and constructs a [`RemoveTagsFromResourceInput`](crate::operation::remove_tags_from_resource::RemoveTagsFromResourceInput).
74    pub fn build(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::remove_tags_from_resource::RemoveTagsFromResourceInput,
78        ::aws_smithy_types::error::operation::BuildError,
79    > {
80        ::std::result::Result::Ok(crate::operation::remove_tags_from_resource::RemoveTagsFromResourceInput {
81            resource_id: self.resource_id,
82            tag_keys: self.tag_keys,
83        })
84    }
85}