aws_sdk_connectcases/types/
_search_related_items_response_item.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SearchRelatedItemsResponseItem {
7    pub related_item_id: ::std::string::String,
9    pub r#type: crate::types::RelatedItemType,
11    pub association_time: ::aws_smithy_types::DateTime,
13    pub content: ::std::option::Option<crate::types::RelatedItemContent>,
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
17    pub performed_by: ::std::option::Option<crate::types::UserUnion>,
19}
20impl SearchRelatedItemsResponseItem {
21    pub fn related_item_id(&self) -> &str {
23        use std::ops::Deref;
24        self.related_item_id.deref()
25    }
26    pub fn r#type(&self) -> &crate::types::RelatedItemType {
28        &self.r#type
29    }
30    pub fn association_time(&self) -> &::aws_smithy_types::DateTime {
32        &self.association_time
33    }
34    pub fn content(&self) -> ::std::option::Option<&crate::types::RelatedItemContent> {
36        self.content.as_ref()
37    }
38    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
40        self.tags.as_ref()
41    }
42    pub fn performed_by(&self) -> ::std::option::Option<&crate::types::UserUnion> {
44        self.performed_by.as_ref()
45    }
46}
47impl SearchRelatedItemsResponseItem {
48    pub fn builder() -> crate::types::builders::SearchRelatedItemsResponseItemBuilder {
50        crate::types::builders::SearchRelatedItemsResponseItemBuilder::default()
51    }
52}
53
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct SearchRelatedItemsResponseItemBuilder {
58    pub(crate) related_item_id: ::std::option::Option<::std::string::String>,
59    pub(crate) r#type: ::std::option::Option<crate::types::RelatedItemType>,
60    pub(crate) association_time: ::std::option::Option<::aws_smithy_types::DateTime>,
61    pub(crate) content: ::std::option::Option<crate::types::RelatedItemContent>,
62    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
63    pub(crate) performed_by: ::std::option::Option<crate::types::UserUnion>,
64}
65impl SearchRelatedItemsResponseItemBuilder {
66    pub fn related_item_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.related_item_id = ::std::option::Option::Some(input.into());
70        self
71    }
72    pub fn set_related_item_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.related_item_id = input;
75        self
76    }
77    pub fn get_related_item_id(&self) -> &::std::option::Option<::std::string::String> {
79        &self.related_item_id
80    }
81    pub fn r#type(mut self, input: crate::types::RelatedItemType) -> Self {
84        self.r#type = ::std::option::Option::Some(input);
85        self
86    }
87    pub fn set_type(mut self, input: ::std::option::Option<crate::types::RelatedItemType>) -> Self {
89        self.r#type = input;
90        self
91    }
92    pub fn get_type(&self) -> &::std::option::Option<crate::types::RelatedItemType> {
94        &self.r#type
95    }
96    pub fn association_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
99        self.association_time = ::std::option::Option::Some(input);
100        self
101    }
102    pub fn set_association_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
104        self.association_time = input;
105        self
106    }
107    pub fn get_association_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
109        &self.association_time
110    }
111    pub fn content(mut self, input: crate::types::RelatedItemContent) -> Self {
114        self.content = ::std::option::Option::Some(input);
115        self
116    }
117    pub fn set_content(mut self, input: ::std::option::Option<crate::types::RelatedItemContent>) -> Self {
119        self.content = input;
120        self
121    }
122    pub fn get_content(&self) -> &::std::option::Option<crate::types::RelatedItemContent> {
124        &self.content
125    }
126    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
132        let mut hash_map = self.tags.unwrap_or_default();
133        hash_map.insert(k.into(), v);
134        self.tags = ::std::option::Option::Some(hash_map);
135        self
136    }
137    pub fn set_tags(
139        mut self,
140        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
141    ) -> Self {
142        self.tags = input;
143        self
144    }
145    pub fn get_tags(
147        &self,
148    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
149        &self.tags
150    }
151    pub fn performed_by(mut self, input: crate::types::UserUnion) -> Self {
153        self.performed_by = ::std::option::Option::Some(input);
154        self
155    }
156    pub fn set_performed_by(mut self, input: ::std::option::Option<crate::types::UserUnion>) -> Self {
158        self.performed_by = input;
159        self
160    }
161    pub fn get_performed_by(&self) -> &::std::option::Option<crate::types::UserUnion> {
163        &self.performed_by
164    }
165    pub fn build(self) -> ::std::result::Result<crate::types::SearchRelatedItemsResponseItem, ::aws_smithy_types::error::operation::BuildError> {
171        ::std::result::Result::Ok(crate::types::SearchRelatedItemsResponseItem {
172            related_item_id: self.related_item_id.ok_or_else(|| {
173                ::aws_smithy_types::error::operation::BuildError::missing_field(
174                    "related_item_id",
175                    "related_item_id was not specified but it is required when building SearchRelatedItemsResponseItem",
176                )
177            })?,
178            r#type: self.r#type.ok_or_else(|| {
179                ::aws_smithy_types::error::operation::BuildError::missing_field(
180                    "r#type",
181                    "r#type was not specified but it is required when building SearchRelatedItemsResponseItem",
182                )
183            })?,
184            association_time: self.association_time.ok_or_else(|| {
185                ::aws_smithy_types::error::operation::BuildError::missing_field(
186                    "association_time",
187                    "association_time was not specified but it is required when building SearchRelatedItemsResponseItem",
188                )
189            })?,
190            content: self.content,
191            tags: self.tags,
192            performed_by: self.performed_by,
193        })
194    }
195}