aws_sdk_honeycode/operation/tag_resource/
_tag_resource_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct TagResourceInput {
6 pub resource_arn: ::std::option::Option<::std::string::String>,
8 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
10}
11impl TagResourceInput {
12 pub fn resource_arn(&self) -> ::std::option::Option<&str> {
14 self.resource_arn.as_deref()
15 }
16 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
18 self.tags.as_ref()
19 }
20}
21impl TagResourceInput {
22 pub fn builder() -> crate::operation::tag_resource::builders::TagResourceInputBuilder {
24 crate::operation::tag_resource::builders::TagResourceInputBuilder::default()
25 }
26}
27
28#[non_exhaustive]
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31pub struct TagResourceInputBuilder {
32 pub(crate) resource_arn: ::std::option::Option<::std::string::String>,
33 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
34}
35impl TagResourceInputBuilder {
36 pub fn resource_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
39 self.resource_arn = ::std::option::Option::Some(input.into());
40 self
41 }
42 pub fn set_resource_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
44 self.resource_arn = input;
45 self
46 }
47 pub fn get_resource_arn(&self) -> &::std::option::Option<::std::string::String> {
49 &self.resource_arn
50 }
51 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
57 let mut hash_map = self.tags.unwrap_or_default();
58 hash_map.insert(k.into(), v.into());
59 self.tags = ::std::option::Option::Some(hash_map);
60 self
61 }
62 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
64 self.tags = input;
65 self
66 }
67 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
69 &self.tags
70 }
71 pub fn build(self) -> ::std::result::Result<crate::operation::tag_resource::TagResourceInput, ::aws_smithy_types::error::operation::BuildError> {
73 ::std::result::Result::Ok(crate::operation::tag_resource::TagResourceInput {
74 resource_arn: self.resource_arn,
75 tags: self.tags,
76 })
77 }
78}