aws_sdk_connectcases/operation/create_related_item/
_create_related_item_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 CreateRelatedItemInput {
6    /// <p>The unique identifier of the Cases domain.</p>
7    pub domain_id: ::std::option::Option<::std::string::String>,
8    /// <p>A unique identifier of the case.</p>
9    pub case_id: ::std::option::Option<::std::string::String>,
10    /// <p>The type of a related item.</p>
11    pub r#type: ::std::option::Option<crate::types::RelatedItemType>,
12    /// <p>The content of a related item to be created.</p>
13    pub content: ::std::option::Option<crate::types::RelatedItemInputContent>,
14    /// <p>Represents the creator of the related item.</p>
15    pub performed_by: ::std::option::Option<crate::types::UserUnion>,
16}
17impl CreateRelatedItemInput {
18    /// <p>The unique identifier of the Cases domain.</p>
19    pub fn domain_id(&self) -> ::std::option::Option<&str> {
20        self.domain_id.as_deref()
21    }
22    /// <p>A unique identifier of the case.</p>
23    pub fn case_id(&self) -> ::std::option::Option<&str> {
24        self.case_id.as_deref()
25    }
26    /// <p>The type of a related item.</p>
27    pub fn r#type(&self) -> ::std::option::Option<&crate::types::RelatedItemType> {
28        self.r#type.as_ref()
29    }
30    /// <p>The content of a related item to be created.</p>
31    pub fn content(&self) -> ::std::option::Option<&crate::types::RelatedItemInputContent> {
32        self.content.as_ref()
33    }
34    /// <p>Represents the creator of the related item.</p>
35    pub fn performed_by(&self) -> ::std::option::Option<&crate::types::UserUnion> {
36        self.performed_by.as_ref()
37    }
38}
39impl CreateRelatedItemInput {
40    /// Creates a new builder-style object to manufacture [`CreateRelatedItemInput`](crate::operation::create_related_item::CreateRelatedItemInput).
41    pub fn builder() -> crate::operation::create_related_item::builders::CreateRelatedItemInputBuilder {
42        crate::operation::create_related_item::builders::CreateRelatedItemInputBuilder::default()
43    }
44}
45
46/// A builder for [`CreateRelatedItemInput`](crate::operation::create_related_item::CreateRelatedItemInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct CreateRelatedItemInputBuilder {
50    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
51    pub(crate) case_id: ::std::option::Option<::std::string::String>,
52    pub(crate) r#type: ::std::option::Option<crate::types::RelatedItemType>,
53    pub(crate) content: ::std::option::Option<crate::types::RelatedItemInputContent>,
54    pub(crate) performed_by: ::std::option::Option<crate::types::UserUnion>,
55}
56impl CreateRelatedItemInputBuilder {
57    /// <p>The unique identifier of the Cases domain.</p>
58    /// This field is required.
59    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.domain_id = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The unique identifier of the Cases domain.</p>
64    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.domain_id = input;
66        self
67    }
68    /// <p>The unique identifier of the Cases domain.</p>
69    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
70        &self.domain_id
71    }
72    /// <p>A unique identifier of the case.</p>
73    /// This field is required.
74    pub fn case_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.case_id = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>A unique identifier of the case.</p>
79    pub fn set_case_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.case_id = input;
81        self
82    }
83    /// <p>A unique identifier of the case.</p>
84    pub fn get_case_id(&self) -> &::std::option::Option<::std::string::String> {
85        &self.case_id
86    }
87    /// <p>The type of a related item.</p>
88    /// This field is required.
89    pub fn r#type(mut self, input: crate::types::RelatedItemType) -> Self {
90        self.r#type = ::std::option::Option::Some(input);
91        self
92    }
93    /// <p>The type of a related item.</p>
94    pub fn set_type(mut self, input: ::std::option::Option<crate::types::RelatedItemType>) -> Self {
95        self.r#type = input;
96        self
97    }
98    /// <p>The type of a related item.</p>
99    pub fn get_type(&self) -> &::std::option::Option<crate::types::RelatedItemType> {
100        &self.r#type
101    }
102    /// <p>The content of a related item to be created.</p>
103    /// This field is required.
104    pub fn content(mut self, input: crate::types::RelatedItemInputContent) -> Self {
105        self.content = ::std::option::Option::Some(input);
106        self
107    }
108    /// <p>The content of a related item to be created.</p>
109    pub fn set_content(mut self, input: ::std::option::Option<crate::types::RelatedItemInputContent>) -> Self {
110        self.content = input;
111        self
112    }
113    /// <p>The content of a related item to be created.</p>
114    pub fn get_content(&self) -> &::std::option::Option<crate::types::RelatedItemInputContent> {
115        &self.content
116    }
117    /// <p>Represents the creator of the related item.</p>
118    pub fn performed_by(mut self, input: crate::types::UserUnion) -> Self {
119        self.performed_by = ::std::option::Option::Some(input);
120        self
121    }
122    /// <p>Represents the creator of the related item.</p>
123    pub fn set_performed_by(mut self, input: ::std::option::Option<crate::types::UserUnion>) -> Self {
124        self.performed_by = input;
125        self
126    }
127    /// <p>Represents the creator of the related item.</p>
128    pub fn get_performed_by(&self) -> &::std::option::Option<crate::types::UserUnion> {
129        &self.performed_by
130    }
131    /// Consumes the builder and constructs a [`CreateRelatedItemInput`](crate::operation::create_related_item::CreateRelatedItemInput).
132    pub fn build(
133        self,
134    ) -> ::std::result::Result<crate::operation::create_related_item::CreateRelatedItemInput, ::aws_smithy_types::error::operation::BuildError> {
135        ::std::result::Result::Ok(crate::operation::create_related_item::CreateRelatedItemInput {
136            domain_id: self.domain_id,
137            case_id: self.case_id,
138            r#type: self.r#type,
139            content: self.content,
140            performed_by: self.performed_by,
141        })
142    }
143}