aws_sdk_support/operation/add_communication_to_case/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::add_communication_to_case::_add_communication_to_case_output::AddCommunicationToCaseOutputBuilder;
3
4pub use crate::operation::add_communication_to_case::_add_communication_to_case_input::AddCommunicationToCaseInputBuilder;
5
6impl crate::operation::add_communication_to_case::builders::AddCommunicationToCaseInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::add_communication_to_case::AddCommunicationToCaseOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::add_communication_to_case::AddCommunicationToCaseError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.add_communication_to_case();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `AddCommunicationToCase`.
24///
25/// <p>Adds additional customer communication to an Amazon Web Services Support case. Use the <code>caseId</code> parameter to identify the case to which to add communication. You can list a set of email addresses to copy on the communication by using the <code>ccEmailAddresses</code> parameter. The <code>communicationBody</code> value contains the text of the communication.</p><note>
26/// <ul>
27/// <li>
28/// <p>You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support API.</p></li>
29/// <li>
30/// <p>If you call the Amazon Web Services Support API from an account that doesn't have a Business, Enterprise On-Ramp, or Enterprise Support plan, the <code>SubscriptionRequiredException</code> error message appears. For information about changing your support plan, see <a href="http://aws.amazon.com/premiumsupport/">Amazon Web Services Support</a>.</p></li>
31/// </ul>
32/// </note>
33#[derive(::std::clone::Clone, ::std::fmt::Debug)]
34pub struct AddCommunicationToCaseFluentBuilder {
35    handle: ::std::sync::Arc<crate::client::Handle>,
36    inner: crate::operation::add_communication_to_case::builders::AddCommunicationToCaseInputBuilder,
37    config_override: ::std::option::Option<crate::config::Builder>,
38}
39impl
40    crate::client::customize::internal::CustomizableSend<
41        crate::operation::add_communication_to_case::AddCommunicationToCaseOutput,
42        crate::operation::add_communication_to_case::AddCommunicationToCaseError,
43    > for AddCommunicationToCaseFluentBuilder
44{
45    fn send(
46        self,
47        config_override: crate::config::Builder,
48    ) -> crate::client::customize::internal::BoxFuture<
49        crate::client::customize::internal::SendResult<
50            crate::operation::add_communication_to_case::AddCommunicationToCaseOutput,
51            crate::operation::add_communication_to_case::AddCommunicationToCaseError,
52        >,
53    > {
54        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
55    }
56}
57impl AddCommunicationToCaseFluentBuilder {
58    /// Creates a new `AddCommunicationToCaseFluentBuilder`.
59    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
60        Self {
61            handle,
62            inner: ::std::default::Default::default(),
63            config_override: ::std::option::Option::None,
64        }
65    }
66    /// Access the AddCommunicationToCase as a reference.
67    pub fn as_input(&self) -> &crate::operation::add_communication_to_case::builders::AddCommunicationToCaseInputBuilder {
68        &self.inner
69    }
70    /// Sends the request and returns the response.
71    ///
72    /// If an error occurs, an `SdkError` will be returned with additional details that
73    /// can be matched against.
74    ///
75    /// By default, any retryable failures will be retried twice. Retry behavior
76    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
77    /// set when configuring the client.
78    pub async fn send(
79        self,
80    ) -> ::std::result::Result<
81        crate::operation::add_communication_to_case::AddCommunicationToCaseOutput,
82        ::aws_smithy_runtime_api::client::result::SdkError<
83            crate::operation::add_communication_to_case::AddCommunicationToCaseError,
84            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
85        >,
86    > {
87        let input = self
88            .inner
89            .build()
90            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
91        let runtime_plugins = crate::operation::add_communication_to_case::AddCommunicationToCase::operation_runtime_plugins(
92            self.handle.runtime_plugins.clone(),
93            &self.handle.conf,
94            self.config_override,
95        );
96        crate::operation::add_communication_to_case::AddCommunicationToCase::orchestrate(&runtime_plugins, input).await
97    }
98
99    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
100    pub fn customize(
101        self,
102    ) -> crate::client::customize::CustomizableOperation<
103        crate::operation::add_communication_to_case::AddCommunicationToCaseOutput,
104        crate::operation::add_communication_to_case::AddCommunicationToCaseError,
105        Self,
106    > {
107        crate::client::customize::CustomizableOperation::new(self)
108    }
109    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
110        self.set_config_override(::std::option::Option::Some(config_override.into()));
111        self
112    }
113
114    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
115        self.config_override = config_override;
116        self
117    }
118    /// <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>
119    pub fn case_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
120        self.inner = self.inner.case_id(input.into());
121        self
122    }
123    /// <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>
124    pub fn set_case_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
125        self.inner = self.inner.set_case_id(input);
126        self
127    }
128    /// <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>
129    pub fn get_case_id(&self) -> &::std::option::Option<::std::string::String> {
130        self.inner.get_case_id()
131    }
132    /// <p>The body of an email communication to add to the support case.</p>
133    pub fn communication_body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.inner = self.inner.communication_body(input.into());
135        self
136    }
137    /// <p>The body of an email communication to add to the support case.</p>
138    pub fn set_communication_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_communication_body(input);
140        self
141    }
142    /// <p>The body of an email communication to add to the support case.</p>
143    pub fn get_communication_body(&self) -> &::std::option::Option<::std::string::String> {
144        self.inner.get_communication_body()
145    }
146    ///
147    /// Appends an item to `ccEmailAddresses`.
148    ///
149    /// To override the contents of this collection use [`set_cc_email_addresses`](Self::set_cc_email_addresses).
150    ///
151    /// <p>The email addresses in the CC line of an email to be added to the support case.</p>
152    pub fn cc_email_addresses(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.cc_email_addresses(input.into());
154        self
155    }
156    /// <p>The email addresses in the CC line of an email to be added to the support case.</p>
157    pub fn set_cc_email_addresses(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
158        self.inner = self.inner.set_cc_email_addresses(input);
159        self
160    }
161    /// <p>The email addresses in the CC line of an email to be added to the support case.</p>
162    pub fn get_cc_email_addresses(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
163        self.inner.get_cc_email_addresses()
164    }
165    /// <p>The ID of a set of one or more attachments for the communication to add to the case. Create the set by calling <code>AddAttachmentsToSet</code></p>
166    pub fn attachment_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.attachment_set_id(input.into());
168        self
169    }
170    /// <p>The ID of a set of one or more attachments for the communication to add to the case. Create the set by calling <code>AddAttachmentsToSet</code></p>
171    pub fn set_attachment_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_attachment_set_id(input);
173        self
174    }
175    /// <p>The ID of a set of one or more attachments for the communication to add to the case. Create the set by calling <code>AddAttachmentsToSet</code></p>
176    pub fn get_attachment_set_id(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_attachment_set_id()
178    }
179}