aws_sdk_apigatewayv2/operation/create_integration_response/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_integration_response::_create_integration_response_output::CreateIntegrationResponseOutputBuilder;
3
4pub use crate::operation::create_integration_response::_create_integration_response_input::CreateIntegrationResponseInputBuilder;
5
6impl crate::operation::create_integration_response::builders::CreateIntegrationResponseInputBuilder {
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::create_integration_response::CreateIntegrationResponseOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_integration_response::CreateIntegrationResponseError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_integration_response();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateIntegrationResponse`.
24///
25/// <p>Creates an IntegrationResponses.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateIntegrationResponseFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_integration_response::builders::CreateIntegrationResponseInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_integration_response::CreateIntegrationResponseOutput,
35        crate::operation::create_integration_response::CreateIntegrationResponseError,
36    > for CreateIntegrationResponseFluentBuilder
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::create_integration_response::CreateIntegrationResponseOutput,
44            crate::operation::create_integration_response::CreateIntegrationResponseError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateIntegrationResponseFluentBuilder {
51    /// Creates a new `CreateIntegrationResponseFluentBuilder`.
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 CreateIntegrationResponse as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_integration_response::builders::CreateIntegrationResponseInputBuilder {
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::create_integration_response::CreateIntegrationResponseOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_integration_response::CreateIntegrationResponseError,
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::create_integration_response::CreateIntegrationResponse::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_integration_response::CreateIntegrationResponse::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::create_integration_response::CreateIntegrationResponseOutput,
97        crate::operation::create_integration_response::CreateIntegrationResponseError,
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 API identifier.</p>
112    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.api_id(input.into());
114        self
115    }
116    /// <p>The API identifier.</p>
117    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_api_id(input);
119        self
120    }
121    /// <p>The API identifier.</p>
122    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_api_id()
124    }
125    /// <p>Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p>
126    /// <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p>
127    /// <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p>
128    /// <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>
129    pub fn content_handling_strategy(mut self, input: crate::types::ContentHandlingStrategy) -> Self {
130        self.inner = self.inner.content_handling_strategy(input);
131        self
132    }
133    /// <p>Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p>
134    /// <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p>
135    /// <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p>
136    /// <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>
137    pub fn set_content_handling_strategy(mut self, input: ::std::option::Option<crate::types::ContentHandlingStrategy>) -> Self {
138        self.inner = self.inner.set_content_handling_strategy(input);
139        self
140    }
141    /// <p>Specifies how to handle response payload content type conversions. Supported values are CONVERT_TO_BINARY and CONVERT_TO_TEXT, with the following behaviors:</p>
142    /// <p>CONVERT_TO_BINARY: Converts a response payload from a Base64-encoded string to the corresponding binary blob.</p>
143    /// <p>CONVERT_TO_TEXT: Converts a response payload from a binary blob to a Base64-encoded string.</p>
144    /// <p>If this property is not defined, the response payload will be passed through from the integration response to the route response or method response without modification.</p>
145    pub fn get_content_handling_strategy(&self) -> &::std::option::Option<crate::types::ContentHandlingStrategy> {
146        self.inner.get_content_handling_strategy()
147    }
148    /// <p>The integration ID.</p>
149    pub fn integration_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.integration_id(input.into());
151        self
152    }
153    /// <p>The integration ID.</p>
154    pub fn set_integration_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_integration_id(input);
156        self
157    }
158    /// <p>The integration ID.</p>
159    pub fn get_integration_id(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_integration_id()
161    }
162    /// <p>The integration response key.</p>
163    pub fn integration_response_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.integration_response_key(input.into());
165        self
166    }
167    /// <p>The integration response key.</p>
168    pub fn set_integration_response_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.inner = self.inner.set_integration_response_key(input);
170        self
171    }
172    /// <p>The integration response key.</p>
173    pub fn get_integration_response_key(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_integration_response_key()
175    }
176    ///
177    /// Adds a key-value pair to `ResponseParameters`.
178    ///
179    /// To override the contents of this collection use [`set_response_parameters`](Self::set_response_parameters).
180    ///
181    /// <p>A key-value map specifying response parameters that are passed to the method response from the backend. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}, where {name} is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name} or integration.response.body.{JSON-expression}, where {name} is a valid and unique response header name and {JSON-expression} is a valid JSON expression without the $ prefix.</p>
182    pub fn response_parameters(
183        mut self,
184        k: impl ::std::convert::Into<::std::string::String>,
185        v: impl ::std::convert::Into<::std::string::String>,
186    ) -> Self {
187        self.inner = self.inner.response_parameters(k.into(), v.into());
188        self
189    }
190    /// <p>A key-value map specifying response parameters that are passed to the method response from the backend. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}, where {name} is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name} or integration.response.body.{JSON-expression}, where {name} is a valid and unique response header name and {JSON-expression} is a valid JSON expression without the $ prefix.</p>
191    pub fn set_response_parameters(
192        mut self,
193        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
194    ) -> Self {
195        self.inner = self.inner.set_response_parameters(input);
196        self
197    }
198    /// <p>A key-value map specifying response parameters that are passed to the method response from the backend. The key is a method response header parameter name and the mapped value is an integration response header value, a static value enclosed within a pair of single quotes, or a JSON expression from the integration response body. The mapping key must match the pattern of method.response.header.{name}, where {name} is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.{name} or integration.response.body.{JSON-expression}, where {name} is a valid and unique response header name and {JSON-expression} is a valid JSON expression without the $ prefix.</p>
199    pub fn get_response_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
200        self.inner.get_response_parameters()
201    }
202    ///
203    /// Adds a key-value pair to `ResponseTemplates`.
204    ///
205    /// To override the contents of this collection use [`set_response_templates`](Self::set_response_templates).
206    ///
207    /// <p>The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.</p>
208    pub fn response_templates(
209        mut self,
210        k: impl ::std::convert::Into<::std::string::String>,
211        v: impl ::std::convert::Into<::std::string::String>,
212    ) -> Self {
213        self.inner = self.inner.response_templates(k.into(), v.into());
214        self
215    }
216    /// <p>The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.</p>
217    pub fn set_response_templates(
218        mut self,
219        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
220    ) -> Self {
221        self.inner = self.inner.set_response_templates(input);
222        self
223    }
224    /// <p>The collection of response templates for the integration response as a string-to-string map of key-value pairs. Response templates are represented as a key/value map, with a content-type as the key and a template as the value.</p>
225    pub fn get_response_templates(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
226        self.inner.get_response_templates()
227    }
228    /// <p>The template selection expression for the integration response. Supported only for WebSocket APIs.</p>
229    pub fn template_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
230        self.inner = self.inner.template_selection_expression(input.into());
231        self
232    }
233    /// <p>The template selection expression for the integration response. Supported only for WebSocket APIs.</p>
234    pub fn set_template_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
235        self.inner = self.inner.set_template_selection_expression(input);
236        self
237    }
238    /// <p>The template selection expression for the integration response. Supported only for WebSocket APIs.</p>
239    pub fn get_template_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
240        self.inner.get_template_selection_expression()
241    }
242}