aws_sdk_apigatewayv2/operation/update_integration_response/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_integration_response::_update_integration_response_output::UpdateIntegrationResponseOutputBuilder;
3
4pub use crate::operation::update_integration_response::_update_integration_response_input::UpdateIntegrationResponseInputBuilder;
5
6impl crate::operation::update_integration_response::builders::UpdateIntegrationResponseInputBuilder {
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::update_integration_response::UpdateIntegrationResponseOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::update_integration_response::UpdateIntegrationResponseError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.update_integration_response();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `UpdateIntegrationResponse`.
24///
25/// <p>Updates an IntegrationResponses.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct UpdateIntegrationResponseFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::update_integration_response::builders::UpdateIntegrationResponseInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::update_integration_response::UpdateIntegrationResponseOutput,
35 crate::operation::update_integration_response::UpdateIntegrationResponseError,
36 > for UpdateIntegrationResponseFluentBuilder
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::update_integration_response::UpdateIntegrationResponseOutput,
44 crate::operation::update_integration_response::UpdateIntegrationResponseError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl UpdateIntegrationResponseFluentBuilder {
51 /// Creates a new `UpdateIntegrationResponseFluentBuilder`.
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 UpdateIntegrationResponse as a reference.
60 pub fn as_input(&self) -> &crate::operation::update_integration_response::builders::UpdateIntegrationResponseInputBuilder {
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::update_integration_response::UpdateIntegrationResponseOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::update_integration_response::UpdateIntegrationResponseError,
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::update_integration_response::UpdateIntegrationResponse::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::update_integration_response::UpdateIntegrationResponse::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::update_integration_response::UpdateIntegrationResponseOutput,
97 crate::operation::update_integration_response::UpdateIntegrationResponseError,
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>Supported only for WebSocket APIs. 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>Supported only for WebSocket APIs. 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>Supported only for WebSocket APIs. 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 ID.</p>
163 pub fn integration_response_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164 self.inner = self.inner.integration_response_id(input.into());
165 self
166 }
167 /// <p>The integration response ID.</p>
168 pub fn set_integration_response_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169 self.inner = self.inner.set_integration_response_id(input);
170 self
171 }
172 /// <p>The integration response ID.</p>
173 pub fn get_integration_response_id(&self) -> &::std::option::Option<::std::string::String> {
174 self.inner.get_integration_response_id()
175 }
176 /// <p>The integration response key.</p>
177 pub fn integration_response_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178 self.inner = self.inner.integration_response_key(input.into());
179 self
180 }
181 /// <p>The integration response key.</p>
182 pub fn set_integration_response_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183 self.inner = self.inner.set_integration_response_key(input);
184 self
185 }
186 /// <p>The integration response key.</p>
187 pub fn get_integration_response_key(&self) -> &::std::option::Option<::std::string::String> {
188 self.inner.get_integration_response_key()
189 }
190 ///
191 /// Adds a key-value pair to `ResponseParameters`.
192 ///
193 /// To override the contents of this collection use [`set_response_parameters`](Self::set_response_parameters).
194 ///
195 /// <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.<replaceable>
196 /// {name}
197 /// </replaceable> , where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.<replaceable>
198 /// {name}
199 /// </replaceable> or integration.response.body.<replaceable>
200 /// {JSON-expression}
201 /// </replaceable> , where <replaceable>
202 /// {name}
203 /// </replaceable> is a valid and unique response header name and <replaceable>
204 /// {JSON-expression}
205 /// </replaceable> is a valid JSON expression without the $ prefix.</p>
206 pub fn response_parameters(
207 mut self,
208 k: impl ::std::convert::Into<::std::string::String>,
209 v: impl ::std::convert::Into<::std::string::String>,
210 ) -> Self {
211 self.inner = self.inner.response_parameters(k.into(), v.into());
212 self
213 }
214 /// <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.<replaceable>
215 /// {name}
216 /// </replaceable> , where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.<replaceable>
217 /// {name}
218 /// </replaceable> or integration.response.body.<replaceable>
219 /// {JSON-expression}
220 /// </replaceable> , where <replaceable>
221 /// {name}
222 /// </replaceable> is a valid and unique response header name and <replaceable>
223 /// {JSON-expression}
224 /// </replaceable> is a valid JSON expression without the $ prefix.</p>
225 pub fn set_response_parameters(
226 mut self,
227 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
228 ) -> Self {
229 self.inner = self.inner.set_response_parameters(input);
230 self
231 }
232 /// <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.<replaceable>
233 /// {name}
234 /// </replaceable> , where name is a valid and unique header name. The mapped non-static value must match the pattern of integration.response.header.<replaceable>
235 /// {name}
236 /// </replaceable> or integration.response.body.<replaceable>
237 /// {JSON-expression}
238 /// </replaceable> , where <replaceable>
239 /// {name}
240 /// </replaceable> is a valid and unique response header name and <replaceable>
241 /// {JSON-expression}
242 /// </replaceable> is a valid JSON expression without the $ prefix.</p>
243 pub fn get_response_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
244 self.inner.get_response_parameters()
245 }
246 ///
247 /// Adds a key-value pair to `ResponseTemplates`.
248 ///
249 /// To override the contents of this collection use [`set_response_templates`](Self::set_response_templates).
250 ///
251 /// <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>
252 pub fn response_templates(
253 mut self,
254 k: impl ::std::convert::Into<::std::string::String>,
255 v: impl ::std::convert::Into<::std::string::String>,
256 ) -> Self {
257 self.inner = self.inner.response_templates(k.into(), v.into());
258 self
259 }
260 /// <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>
261 pub fn set_response_templates(
262 mut self,
263 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
264 ) -> Self {
265 self.inner = self.inner.set_response_templates(input);
266 self
267 }
268 /// <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>
269 pub fn get_response_templates(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
270 self.inner.get_response_templates()
271 }
272 /// <p>The template selection expression for the integration response. Supported only for WebSocket APIs.</p>
273 pub fn template_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
274 self.inner = self.inner.template_selection_expression(input.into());
275 self
276 }
277 /// <p>The template selection expression for the integration response. Supported only for WebSocket APIs.</p>
278 pub fn set_template_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
279 self.inner = self.inner.set_template_selection_expression(input);
280 self
281 }
282 /// <p>The template selection expression for the integration response. Supported only for WebSocket APIs.</p>
283 pub fn get_template_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
284 self.inner.get_template_selection_expression()
285 }
286}