aws_sdk_apigatewayv2/operation/create_route/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_route::_create_route_output::CreateRouteOutputBuilder;
3
4pub use crate::operation::create_route::_create_route_input::CreateRouteInputBuilder;
5
6impl crate::operation::create_route::builders::CreateRouteInputBuilder {
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_route::CreateRouteOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_route::CreateRouteError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_route();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateRoute`.
24///
25/// <p>Creates a Route for an API.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateRouteFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_route::builders::CreateRouteInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_route::CreateRouteOutput,
35        crate::operation::create_route::CreateRouteError,
36    > for CreateRouteFluentBuilder
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_route::CreateRouteOutput,
44            crate::operation::create_route::CreateRouteError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateRouteFluentBuilder {
51    /// Creates a new `CreateRouteFluentBuilder`.
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 CreateRoute as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_route::builders::CreateRouteInputBuilder {
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_route::CreateRouteOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_route::CreateRouteError,
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_route::CreateRoute::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_route::CreateRoute::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_route::CreateRouteOutput,
97        crate::operation::create_route::CreateRouteError,
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 whether an API key is required for the route. Supported only for WebSocket APIs.</p>
126    pub fn api_key_required(mut self, input: bool) -> Self {
127        self.inner = self.inner.api_key_required(input);
128        self
129    }
130    /// <p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>
131    pub fn set_api_key_required(mut self, input: ::std::option::Option<bool>) -> Self {
132        self.inner = self.inner.set_api_key_required(input);
133        self
134    }
135    /// <p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>
136    pub fn get_api_key_required(&self) -> &::std::option::Option<bool> {
137        self.inner.get_api_key_required()
138    }
139    ///
140    /// Appends an item to `AuthorizationScopes`.
141    ///
142    /// To override the contents of this collection use [`set_authorization_scopes`](Self::set_authorization_scopes).
143    ///
144    /// <p>The authorization scopes supported by this route.</p>
145    pub fn authorization_scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.inner = self.inner.authorization_scopes(input.into());
147        self
148    }
149    /// <p>The authorization scopes supported by this route.</p>
150    pub fn set_authorization_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
151        self.inner = self.inner.set_authorization_scopes(input);
152        self
153    }
154    /// <p>The authorization scopes supported by this route.</p>
155    pub fn get_authorization_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
156        self.inner.get_authorization_scopes()
157    }
158    /// <p>The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.</p>
159    pub fn authorization_type(mut self, input: crate::types::AuthorizationType) -> Self {
160        self.inner = self.inner.authorization_type(input);
161        self
162    }
163    /// <p>The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.</p>
164    pub fn set_authorization_type(mut self, input: ::std::option::Option<crate::types::AuthorizationType>) -> Self {
165        self.inner = self.inner.set_authorization_type(input);
166        self
167    }
168    /// <p>The authorization type for the route. For WebSocket APIs, valid values are NONE for open access, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer For HTTP APIs, valid values are NONE for open access, JWT for using JSON Web Tokens, AWS_IAM for using AWS IAM permissions, and CUSTOM for using a Lambda authorizer.</p>
169    pub fn get_authorization_type(&self) -> &::std::option::Option<crate::types::AuthorizationType> {
170        self.inner.get_authorization_type()
171    }
172    /// <p>The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.</p>
173    pub fn authorizer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
174        self.inner = self.inner.authorizer_id(input.into());
175        self
176    }
177    /// <p>The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.</p>
178    pub fn set_authorizer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
179        self.inner = self.inner.set_authorizer_id(input);
180        self
181    }
182    /// <p>The identifier of the Authorizer resource to be associated with this route. The authorizer identifier is generated by API Gateway when you created the authorizer.</p>
183    pub fn get_authorizer_id(&self) -> &::std::option::Option<::std::string::String> {
184        self.inner.get_authorizer_id()
185    }
186    /// <p>The model selection expression for the route. Supported only for WebSocket APIs.</p>
187    pub fn model_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188        self.inner = self.inner.model_selection_expression(input.into());
189        self
190    }
191    /// <p>The model selection expression for the route. Supported only for WebSocket APIs.</p>
192    pub fn set_model_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193        self.inner = self.inner.set_model_selection_expression(input);
194        self
195    }
196    /// <p>The model selection expression for the route. Supported only for WebSocket APIs.</p>
197    pub fn get_model_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
198        self.inner.get_model_selection_expression()
199    }
200    /// <p>The operation name for the route.</p>
201    pub fn operation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202        self.inner = self.inner.operation_name(input.into());
203        self
204    }
205    /// <p>The operation name for the route.</p>
206    pub fn set_operation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207        self.inner = self.inner.set_operation_name(input);
208        self
209    }
210    /// <p>The operation name for the route.</p>
211    pub fn get_operation_name(&self) -> &::std::option::Option<::std::string::String> {
212        self.inner.get_operation_name()
213    }
214    ///
215    /// Adds a key-value pair to `RequestModels`.
216    ///
217    /// To override the contents of this collection use [`set_request_models`](Self::set_request_models).
218    ///
219    /// <p>The request models for the route. Supported only for WebSocket APIs.</p>
220    pub fn request_models(
221        mut self,
222        k: impl ::std::convert::Into<::std::string::String>,
223        v: impl ::std::convert::Into<::std::string::String>,
224    ) -> Self {
225        self.inner = self.inner.request_models(k.into(), v.into());
226        self
227    }
228    /// <p>The request models for the route. Supported only for WebSocket APIs.</p>
229    pub fn set_request_models(
230        mut self,
231        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
232    ) -> Self {
233        self.inner = self.inner.set_request_models(input);
234        self
235    }
236    /// <p>The request models for the route. Supported only for WebSocket APIs.</p>
237    pub fn get_request_models(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
238        self.inner.get_request_models()
239    }
240    ///
241    /// Adds a key-value pair to `RequestParameters`.
242    ///
243    /// To override the contents of this collection use [`set_request_parameters`](Self::set_request_parameters).
244    ///
245    /// <p>The request parameters for the route. Supported only for WebSocket APIs.</p>
246    pub fn request_parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ParameterConstraints) -> Self {
247        self.inner = self.inner.request_parameters(k.into(), v);
248        self
249    }
250    /// <p>The request parameters for the route. Supported only for WebSocket APIs.</p>
251    pub fn set_request_parameters(
252        mut self,
253        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
254    ) -> Self {
255        self.inner = self.inner.set_request_parameters(input);
256        self
257    }
258    /// <p>The request parameters for the route. Supported only for WebSocket APIs.</p>
259    pub fn get_request_parameters(
260        &self,
261    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>> {
262        self.inner.get_request_parameters()
263    }
264    /// <p>The route key for the route.</p>
265    pub fn route_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
266        self.inner = self.inner.route_key(input.into());
267        self
268    }
269    /// <p>The route key for the route.</p>
270    pub fn set_route_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
271        self.inner = self.inner.set_route_key(input);
272        self
273    }
274    /// <p>The route key for the route.</p>
275    pub fn get_route_key(&self) -> &::std::option::Option<::std::string::String> {
276        self.inner.get_route_key()
277    }
278    /// <p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>
279    pub fn route_response_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
280        self.inner = self.inner.route_response_selection_expression(input.into());
281        self
282    }
283    /// <p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>
284    pub fn set_route_response_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
285        self.inner = self.inner.set_route_response_selection_expression(input);
286        self
287    }
288    /// <p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>
289    pub fn get_route_response_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
290        self.inner.get_route_response_selection_expression()
291    }
292    /// <p>The target for the route.</p>
293    pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
294        self.inner = self.inner.target(input.into());
295        self
296    }
297    /// <p>The target for the route.</p>
298    pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
299        self.inner = self.inner.set_target(input);
300        self
301    }
302    /// <p>The target for the route.</p>
303    pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
304        self.inner.get_target()
305    }
306}