aws_sdk_dataexchange/operation/send_api_asset/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::send_api_asset::_send_api_asset_output::SendApiAssetOutputBuilder;
3
4pub use crate::operation::send_api_asset::_send_api_asset_input::SendApiAssetInputBuilder;
5
6impl crate::operation::send_api_asset::builders::SendApiAssetInputBuilder {
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::send_api_asset::SendApiAssetOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::send_api_asset::SendApiAssetError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.send_api_asset();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `SendApiAsset`.
24///
25/// <p>This operation invokes an API Gateway API asset. The request is proxied to the provider’s API Gateway API.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct SendApiAssetFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::send_api_asset::builders::SendApiAssetInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::send_api_asset::SendApiAssetOutput,
35        crate::operation::send_api_asset::SendApiAssetError,
36    > for SendApiAssetFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::send_api_asset::SendApiAssetOutput,
44            crate::operation::send_api_asset::SendApiAssetError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl SendApiAssetFluentBuilder {
51    /// Creates a new `SendApiAssetFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the SendApiAsset as a reference.
60    pub fn as_input(&self) -> &crate::operation::send_api_asset::builders::SendApiAssetInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::send_api_asset::SendApiAssetOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::send_api_asset::SendApiAssetError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::send_api_asset::SendApiAsset::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::send_api_asset::SendApiAsset::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::send_api_asset::SendApiAssetOutput,
97        crate::operation::send_api_asset::SendApiAssetError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The request body.</p>
112    pub fn body(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.body(input.into());
114        self
115    }
116    /// <p>The request body.</p>
117    pub fn set_body(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_body(input);
119        self
120    }
121    /// <p>The request body.</p>
122    pub fn get_body(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_body()
124    }
125    ///
126    /// Adds a key-value pair to `QueryStringParameters`.
127    ///
128    /// To override the contents of this collection use [`set_query_string_parameters`](Self::set_query_string_parameters).
129    ///
130    /// <p>Attach query string parameters to the end of the URI (for example, /v1/examplePath?exampleParam=exampleValue).</p>
131    pub fn query_string_parameters(
132        mut self,
133        k: impl ::std::convert::Into<::std::string::String>,
134        v: impl ::std::convert::Into<::std::string::String>,
135    ) -> Self {
136        self.inner = self.inner.query_string_parameters(k.into(), v.into());
137        self
138    }
139    /// <p>Attach query string parameters to the end of the URI (for example, /v1/examplePath?exampleParam=exampleValue).</p>
140    pub fn set_query_string_parameters(
141        mut self,
142        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
143    ) -> Self {
144        self.inner = self.inner.set_query_string_parameters(input);
145        self
146    }
147    /// <p>Attach query string parameters to the end of the URI (for example, /v1/examplePath?exampleParam=exampleValue).</p>
148    pub fn get_query_string_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
149        self.inner.get_query_string_parameters()
150    }
151    /// <p>Asset ID value for the API request.</p>
152    pub fn asset_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.inner = self.inner.asset_id(input.into());
154        self
155    }
156    /// <p>Asset ID value for the API request.</p>
157    pub fn set_asset_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.inner = self.inner.set_asset_id(input);
159        self
160    }
161    /// <p>Asset ID value for the API request.</p>
162    pub fn get_asset_id(&self) -> &::std::option::Option<::std::string::String> {
163        self.inner.get_asset_id()
164    }
165    /// <p>Data set ID value for the API request.</p>
166    pub fn data_set_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.data_set_id(input.into());
168        self
169    }
170    /// <p>Data set ID value for the API request.</p>
171    pub fn set_data_set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_data_set_id(input);
173        self
174    }
175    /// <p>Data set ID value for the API request.</p>
176    pub fn get_data_set_id(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_data_set_id()
178    }
179    ///
180    /// Adds a key-value pair to `RequestHeaders`.
181    ///
182    /// To override the contents of this collection use [`set_request_headers`](Self::set_request_headers).
183    ///
184    /// <p>Any header value prefixed with x-amzn-dataexchange-header- will have that stripped before sending the Asset API request. Use this when you want to override a header that AWS Data Exchange uses. Alternatively, you can use the header without a prefix to the HTTP request.</p>
185    pub fn request_headers(
186        mut self,
187        k: impl ::std::convert::Into<::std::string::String>,
188        v: impl ::std::convert::Into<::std::string::String>,
189    ) -> Self {
190        self.inner = self.inner.request_headers(k.into(), v.into());
191        self
192    }
193    /// <p>Any header value prefixed with x-amzn-dataexchange-header- will have that stripped before sending the Asset API request. Use this when you want to override a header that AWS Data Exchange uses. Alternatively, you can use the header without a prefix to the HTTP request.</p>
194    pub fn set_request_headers(
195        mut self,
196        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
197    ) -> Self {
198        self.inner = self.inner.set_request_headers(input);
199        self
200    }
201    /// <p>Any header value prefixed with x-amzn-dataexchange-header- will have that stripped before sending the Asset API request. Use this when you want to override a header that AWS Data Exchange uses. Alternatively, you can use the header without a prefix to the HTTP request.</p>
202    pub fn get_request_headers(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
203        self.inner.get_request_headers()
204    }
205    /// <p>HTTP method value for the API request. Alternatively, you can use the appropriate verb in your request.</p>
206    pub fn method(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
207        self.inner = self.inner.method(input.into());
208        self
209    }
210    /// <p>HTTP method value for the API request. Alternatively, you can use the appropriate verb in your request.</p>
211    pub fn set_method(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
212        self.inner = self.inner.set_method(input);
213        self
214    }
215    /// <p>HTTP method value for the API request. Alternatively, you can use the appropriate verb in your request.</p>
216    pub fn get_method(&self) -> &::std::option::Option<::std::string::String> {
217        self.inner.get_method()
218    }
219    /// <p>URI path value for the API request. Alternatively, you can set the URI path directly by invoking /v1/{pathValue}.</p>
220    pub fn path(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
221        self.inner = self.inner.path(input.into());
222        self
223    }
224    /// <p>URI path value for the API request. Alternatively, you can set the URI path directly by invoking /v1/{pathValue}.</p>
225    pub fn set_path(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
226        self.inner = self.inner.set_path(input);
227        self
228    }
229    /// <p>URI path value for the API request. Alternatively, you can set the URI path directly by invoking /v1/{pathValue}.</p>
230    pub fn get_path(&self) -> &::std::option::Option<::std::string::String> {
231        self.inner.get_path()
232    }
233    /// <p>Revision ID value for the API request.</p>
234    pub fn revision_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.inner = self.inner.revision_id(input.into());
236        self
237    }
238    /// <p>Revision ID value for the API request.</p>
239    pub fn set_revision_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.inner = self.inner.set_revision_id(input);
241        self
242    }
243    /// <p>Revision ID value for the API request.</p>
244    pub fn get_revision_id(&self) -> &::std::option::Option<::std::string::String> {
245        self.inner.get_revision_id()
246    }
247}