aws_sdk_pipes/types/
_tag.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
6pub struct Tag {
7 pub key: ::std::string::String,
9 pub value: ::std::string::String,
11}
12impl Tag {
13 pub fn key(&self) -> &str {
15 use std::ops::Deref;
16 self.key.deref()
17 }
18 pub fn value(&self) -> &str {
20 use std::ops::Deref;
21 self.value.deref()
22 }
23}
24impl ::std::fmt::Debug for Tag {
25 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
26 let mut formatter = f.debug_struct("Tag");
27 formatter.field("key", &self.key);
28 formatter.field("value", &"*** Sensitive Data Redacted ***");
29 formatter.finish()
30 }
31}
32impl Tag {
33 pub fn builder() -> crate::types::builders::TagBuilder {
35 crate::types::builders::TagBuilder::default()
36 }
37}
38
39#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
41#[non_exhaustive]
42pub struct TagBuilder {
43 pub(crate) key: ::std::option::Option<::std::string::String>,
44 pub(crate) value: ::std::option::Option<::std::string::String>,
45}
46impl TagBuilder {
47 pub fn key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
50 self.key = ::std::option::Option::Some(input.into());
51 self
52 }
53 pub fn set_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
55 self.key = input;
56 self
57 }
58 pub fn get_key(&self) -> &::std::option::Option<::std::string::String> {
60 &self.key
61 }
62 pub fn value(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
65 self.value = ::std::option::Option::Some(input.into());
66 self
67 }
68 pub fn set_value(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
70 self.value = input;
71 self
72 }
73 pub fn get_value(&self) -> &::std::option::Option<::std::string::String> {
75 &self.value
76 }
77 pub fn build(self) -> ::std::result::Result<crate::types::Tag, ::aws_smithy_types::error::operation::BuildError> {
82 ::std::result::Result::Ok(crate::types::Tag {
83 key: self.key.ok_or_else(|| {
84 ::aws_smithy_types::error::operation::BuildError::missing_field("key", "key was not specified but it is required when building Tag")
85 })?,
86 value: self.value.ok_or_else(|| {
87 ::aws_smithy_types::error::operation::BuildError::missing_field(
88 "value",
89 "value was not specified but it is required when building Tag",
90 )
91 })?,
92 })
93 }
94}
95impl ::std::fmt::Debug for TagBuilder {
96 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
97 let mut formatter = f.debug_struct("TagBuilder");
98 formatter.field("key", &self.key);
99 formatter.field("value", &"*** Sensitive Data Redacted ***");
100 formatter.finish()
101 }
102}