aws_sdk_support/operation/add_attachments_to_set/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::add_attachments_to_set::_add_attachments_to_set_output::AddAttachmentsToSetOutputBuilder;
3
4pub use crate::operation::add_attachments_to_set::_add_attachments_to_set_input::AddAttachmentsToSetInputBuilder;
5
6impl crate::operation::add_attachments_to_set::builders::AddAttachmentsToSetInputBuilder {
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_attachments_to_set::AddAttachmentsToSetOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::add_attachments_to_set::AddAttachmentsToSetError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.add_attachments_to_set();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `AddAttachmentsToSet`.
24///
25/// <p>Adds one or more attachments to an attachment set.</p>
26/// <p>An attachment set is a temporary container for attachments that you add to a case or case communication. The set is available for 1 hour after it's created. The <code>expiryTime</code> returned in the response is when the set expires.</p><note>
27/// <ul>
28/// <li>
29/// <p>You must have a Business, Enterprise On-Ramp, or Enterprise Support plan to use the Amazon Web Services Support API.</p></li>
30/// <li>
31/// <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>
32/// </ul>
33/// </note>
34#[derive(::std::clone::Clone, ::std::fmt::Debug)]
35pub struct AddAttachmentsToSetFluentBuilder {
36 handle: ::std::sync::Arc<crate::client::Handle>,
37 inner: crate::operation::add_attachments_to_set::builders::AddAttachmentsToSetInputBuilder,
38 config_override: ::std::option::Option<crate::config::Builder>,
39}
40impl
41 crate::client::customize::internal::CustomizableSend<
42 crate::operation::add_attachments_to_set::AddAttachmentsToSetOutput,
43 crate::operation::add_attachments_to_set::AddAttachmentsToSetError,
44 > for AddAttachmentsToSetFluentBuilder
45{
46 fn send(
47 self,
48 config_override: crate::config::Builder,
49 ) -> crate::client::customize::internal::BoxFuture<
50 crate::client::customize::internal::SendResult<
51 crate::operation::add_attachments_to_set::AddAttachmentsToSetOutput,
52 crate::operation::add_attachments_to_set::AddAttachmentsToSetError,
53 >,
54 > {
55 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
56 }
57}
58impl AddAttachmentsToSetFluentBuilder {
59 /// Creates a new `AddAttachmentsToSetFluentBuilder`.
60 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
61 Self {
62 handle,
63 inner: ::std::default::Default::default(),
64 config_override: ::std::option::Option::None,
65 }
66 }
67 /// Access the AddAttachmentsToSet as a reference.
68 pub fn as_input(&self) -> &crate::operation::add_attachments_to_set::builders::AddAttachmentsToSetInputBuilder {
69 &self.inner
70 }
71 /// Sends the request and returns the response.
72 ///
73 /// If an error occurs, an `SdkError` will be returned with additional details that
74 /// can be matched against.
75 ///
76 /// By default, any retryable failures will be retried twice. Retry behavior
77 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
78 /// set when configuring the client.
79 pub async fn send(
80 self,
81 ) -> ::std::result::Result<
82 crate::operation::add_attachments_to_set::AddAttachmentsToSetOutput,
83 ::aws_smithy_runtime_api::client::result::SdkError<
84 crate::operation::add_attachments_to_set::AddAttachmentsToSetError,
85 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
86 >,
87 > {
88 let input = self
89 .inner
90 .build()
91 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
92 let runtime_plugins = crate::operation::add_attachments_to_set::AddAttachmentsToSet::operation_runtime_plugins(
93 self.handle.runtime_plugins.clone(),
94 &self.handle.conf,
95 self.config_override,
96 );
97 crate::operation::add_attachments_to_set::AddAttachmentsToSet::orchestrate(&runtime_plugins, input).await
98 }
99
100 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
101 pub fn customize(
102 self,
103 ) -> crate::client::customize::CustomizableOperation<
104 crate::operation::add_attachments_to_set::AddAttachmentsToSetOutput,
105 crate::operation::add_attachments_to_set::AddAttachmentsToSetError,
106 Self,
107 > {
108 crate::client::customize::CustomizableOperation::new(self)
109 }
110 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
111 self.set_config_override(::std::option::Option::Some(config_override.into()));
112 self
113 }
114
115 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
116 self.config_override = config_override;
117 self
118 }
119 /// <p>The ID of the attachment set. If an <code>attachmentSetId</code> is not specified, a new attachment set is created, and the ID of the set is returned in the response. If an <code>attachmentSetId</code> is specified, the attachments are added to the specified set, if it exists.</p>
120 pub fn attachment_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121 self.inner = self.inner.attachment_set_id(input.into());
122 self
123 }
124 /// <p>The ID of the attachment set. If an <code>attachmentSetId</code> is not specified, a new attachment set is created, and the ID of the set is returned in the response. If an <code>attachmentSetId</code> is specified, the attachments are added to the specified set, if it exists.</p>
125 pub fn set_attachment_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.inner = self.inner.set_attachment_set_id(input);
127 self
128 }
129 /// <p>The ID of the attachment set. If an <code>attachmentSetId</code> is not specified, a new attachment set is created, and the ID of the set is returned in the response. If an <code>attachmentSetId</code> is specified, the attachments are added to the specified set, if it exists.</p>
130 pub fn get_attachment_set_id(&self) -> &::std::option::Option<::std::string::String> {
131 self.inner.get_attachment_set_id()
132 }
133 ///
134 /// Appends an item to `attachments`.
135 ///
136 /// To override the contents of this collection use [`set_attachments`](Self::set_attachments).
137 ///
138 /// <p>One or more attachments to add to the set. You can add up to three attachments per set. The size limit is 5 MB per attachment.</p>
139 /// <p>In the <code>Attachment</code> object, use the <code>data</code> parameter to specify the contents of the attachment file. In the previous request syntax, the value for <code>data</code> appear as <code>blob</code>, which is represented as a base64-encoded string. The value for <code>fileName</code> is the name of the attachment, such as <code>troubleshoot-screenshot.png</code>.</p>
140 pub fn attachments(mut self, input: crate::types::Attachment) -> Self {
141 self.inner = self.inner.attachments(input);
142 self
143 }
144 /// <p>One or more attachments to add to the set. You can add up to three attachments per set. The size limit is 5 MB per attachment.</p>
145 /// <p>In the <code>Attachment</code> object, use the <code>data</code> parameter to specify the contents of the attachment file. In the previous request syntax, the value for <code>data</code> appear as <code>blob</code>, which is represented as a base64-encoded string. The value for <code>fileName</code> is the name of the attachment, such as <code>troubleshoot-screenshot.png</code>.</p>
146 pub fn set_attachments(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Attachment>>) -> Self {
147 self.inner = self.inner.set_attachments(input);
148 self
149 }
150 /// <p>One or more attachments to add to the set. You can add up to three attachments per set. The size limit is 5 MB per attachment.</p>
151 /// <p>In the <code>Attachment</code> object, use the <code>data</code> parameter to specify the contents of the attachment file. In the previous request syntax, the value for <code>data</code> appear as <code>blob</code>, which is represented as a base64-encoded string. The value for <code>fileName</code> is the name of the attachment, such as <code>troubleshoot-screenshot.png</code>.</p>
152 pub fn get_attachments(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Attachment>> {
153 self.inner.get_attachments()
154 }
155}