aws_sdk_support/types/_communication.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>A communication associated with a support case. The communication consists of the case ID, the message body, attachment information, the submitter of the communication, and the date and time of the communication.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Communication {
7 /// <p>The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-<i>12345678910-2013-c4c1d2bf33c5cf47</i></p>
8 pub case_id: ::std::option::Option<::std::string::String>,
9 /// <p>The text of the communication between the customer and Amazon Web Services Support.</p>
10 pub body: ::std::option::Option<::std::string::String>,
11 /// <p>The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM role as well as the email address (for example, "AdminRole (Role) <janedoe@example.com>
12 /// ). Entries from the Amazon Web Services Support team display "Amazon Web Services," and don't show an email address.
13 /// </janedoe@example.com></p>
14 pub submitted_by: ::std::option::Option<::std::string::String>,
15 /// <p>The time the communication was created.</p>
16 pub time_created: ::std::option::Option<::std::string::String>,
17 /// <p>Information about the attachments to the case communication.</p>
18 pub attachment_set: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentDetails>>,
19}
20impl Communication {
21 /// <p>The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-<i>12345678910-2013-c4c1d2bf33c5cf47</i></p>
22 pub fn case_id(&self) -> ::std::option::Option<&str> {
23 self.case_id.as_deref()
24 }
25 /// <p>The text of the communication between the customer and Amazon Web Services Support.</p>
26 pub fn body(&self) -> ::std::option::Option<&str> {
27 self.body.as_deref()
28 }
29 /// <p>The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM role as well as the email address (for example, "AdminRole (Role) <janedoe@example.com>
30 /// ). Entries from the Amazon Web Services Support team display "Amazon Web Services," and don't show an email address.
31 /// </janedoe@example.com></p>
32 pub fn submitted_by(&self) -> ::std::option::Option<&str> {
33 self.submitted_by.as_deref()
34 }
35 /// <p>The time the communication was created.</p>
36 pub fn time_created(&self) -> ::std::option::Option<&str> {
37 self.time_created.as_deref()
38 }
39 /// <p>Information about the attachments to the case communication.</p>
40 ///
41 /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.attachment_set.is_none()`.
42 pub fn attachment_set(&self) -> &[crate::types::AttachmentDetails] {
43 self.attachment_set.as_deref().unwrap_or_default()
44 }
45}
46impl Communication {
47 /// Creates a new builder-style object to manufacture [`Communication`](crate::types::Communication).
48 pub fn builder() -> crate::types::builders::CommunicationBuilder {
49 crate::types::builders::CommunicationBuilder::default()
50 }
51}
52
53/// A builder for [`Communication`](crate::types::Communication).
54#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
55#[non_exhaustive]
56pub struct CommunicationBuilder {
57 pub(crate) case_id: ::std::option::Option<::std::string::String>,
58 pub(crate) body: ::std::option::Option<::std::string::String>,
59 pub(crate) submitted_by: ::std::option::Option<::std::string::String>,
60 pub(crate) time_created: ::std::option::Option<::std::string::String>,
61 pub(crate) attachment_set: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentDetails>>,
62}
63impl CommunicationBuilder {
64 /// <p>The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-<i>12345678910-2013-c4c1d2bf33c5cf47</i></p>
65 pub fn case_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
66 self.case_id = ::std::option::Option::Some(input.into());
67 self
68 }
69 /// <p>The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-<i>12345678910-2013-c4c1d2bf33c5cf47</i></p>
70 pub fn set_case_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
71 self.case_id = input;
72 self
73 }
74 /// <p>The support case ID requested or returned in the call. The case ID is an alphanumeric string formatted as shown in this example: case-<i>12345678910-2013-c4c1d2bf33c5cf47</i></p>
75 pub fn get_case_id(&self) -> &::std::option::Option<::std::string::String> {
76 &self.case_id
77 }
78 /// <p>The text of the communication between the customer and Amazon Web Services Support.</p>
79 pub fn body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
80 self.body = ::std::option::Option::Some(input.into());
81 self
82 }
83 /// <p>The text of the communication between the customer and Amazon Web Services Support.</p>
84 pub fn set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85 self.body = input;
86 self
87 }
88 /// <p>The text of the communication between the customer and Amazon Web Services Support.</p>
89 pub fn get_body(&self) -> &::std::option::Option<::std::string::String> {
90 &self.body
91 }
92 /// <p>The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM role as well as the email address (for example, "AdminRole (Role) <janedoe@example.com>
93 /// ). Entries from the Amazon Web Services Support team display "Amazon Web Services," and don't show an email address.
94 /// </janedoe@example.com></p>
95 pub fn submitted_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96 self.submitted_by = ::std::option::Option::Some(input.into());
97 self
98 }
99 /// <p>The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM role as well as the email address (for example, "AdminRole (Role) <janedoe@example.com>
100 /// ). Entries from the Amazon Web Services Support team display "Amazon Web Services," and don't show an email address.
101 /// </janedoe@example.com></p>
102 pub fn set_submitted_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
103 self.submitted_by = input;
104 self
105 }
106 /// <p>The identity of the account that submitted, or responded to, the support case. Customer entries include the IAM role as well as the email address (for example, "AdminRole (Role) <janedoe@example.com>
107 /// ). Entries from the Amazon Web Services Support team display "Amazon Web Services," and don't show an email address.
108 /// </janedoe@example.com></p>
109 pub fn get_submitted_by(&self) -> &::std::option::Option<::std::string::String> {
110 &self.submitted_by
111 }
112 /// <p>The time the communication was created.</p>
113 pub fn time_created(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.time_created = ::std::option::Option::Some(input.into());
115 self
116 }
117 /// <p>The time the communication was created.</p>
118 pub fn set_time_created(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.time_created = input;
120 self
121 }
122 /// <p>The time the communication was created.</p>
123 pub fn get_time_created(&self) -> &::std::option::Option<::std::string::String> {
124 &self.time_created
125 }
126 /// Appends an item to `attachment_set`.
127 ///
128 /// To override the contents of this collection use [`set_attachment_set`](Self::set_attachment_set).
129 ///
130 /// <p>Information about the attachments to the case communication.</p>
131 pub fn attachment_set(mut self, input: crate::types::AttachmentDetails) -> Self {
132 let mut v = self.attachment_set.unwrap_or_default();
133 v.push(input);
134 self.attachment_set = ::std::option::Option::Some(v);
135 self
136 }
137 /// <p>Information about the attachments to the case communication.</p>
138 pub fn set_attachment_set(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::AttachmentDetails>>) -> Self {
139 self.attachment_set = input;
140 self
141 }
142 /// <p>Information about the attachments to the case communication.</p>
143 pub fn get_attachment_set(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::AttachmentDetails>> {
144 &self.attachment_set
145 }
146 /// Consumes the builder and constructs a [`Communication`](crate::types::Communication).
147 pub fn build(self) -> crate::types::Communication {
148 crate::types::Communication {
149 case_id: self.case_id,
150 body: self.body,
151 submitted_by: self.submitted_by,
152 time_created: self.time_created,
153 attachment_set: self.attachment_set,
154 }
155 }
156}