aws_sdk_apigatewayv2/operation/update_route/
_update_route_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Updates a Route.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateRouteInput {
7    /// <p>The API identifier.</p>
8    pub api_id: ::std::option::Option<::std::string::String>,
9    /// <p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>
10    pub api_key_required: ::std::option::Option<bool>,
11    /// <p>The authorization scopes supported by this route.</p>
12    pub authorization_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13    /// <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>
14    pub authorization_type: ::std::option::Option<crate::types::AuthorizationType>,
15    /// <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>
16    pub authorizer_id: ::std::option::Option<::std::string::String>,
17    /// <p>The model selection expression for the route. Supported only for WebSocket APIs.</p>
18    pub model_selection_expression: ::std::option::Option<::std::string::String>,
19    /// <p>The operation name for the route.</p>
20    pub operation_name: ::std::option::Option<::std::string::String>,
21    /// <p>The request models for the route. Supported only for WebSocket APIs.</p>
22    pub request_models: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
23    /// <p>The request parameters for the route. Supported only for WebSocket APIs.</p>
24    pub request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
25    /// <p>The route ID.</p>
26    pub route_id: ::std::option::Option<::std::string::String>,
27    /// <p>The route key for the route.</p>
28    pub route_key: ::std::option::Option<::std::string::String>,
29    /// <p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>
30    pub route_response_selection_expression: ::std::option::Option<::std::string::String>,
31    /// <p>The target for the route.</p>
32    pub target: ::std::option::Option<::std::string::String>,
33}
34impl UpdateRouteInput {
35    /// <p>The API identifier.</p>
36    pub fn api_id(&self) -> ::std::option::Option<&str> {
37        self.api_id.as_deref()
38    }
39    /// <p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>
40    pub fn api_key_required(&self) -> ::std::option::Option<bool> {
41        self.api_key_required
42    }
43    /// <p>The authorization scopes supported by this route.</p>
44    ///
45    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.authorization_scopes.is_none()`.
46    pub fn authorization_scopes(&self) -> &[::std::string::String] {
47        self.authorization_scopes.as_deref().unwrap_or_default()
48    }
49    /// <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>
50    pub fn authorization_type(&self) -> ::std::option::Option<&crate::types::AuthorizationType> {
51        self.authorization_type.as_ref()
52    }
53    /// <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>
54    pub fn authorizer_id(&self) -> ::std::option::Option<&str> {
55        self.authorizer_id.as_deref()
56    }
57    /// <p>The model selection expression for the route. Supported only for WebSocket APIs.</p>
58    pub fn model_selection_expression(&self) -> ::std::option::Option<&str> {
59        self.model_selection_expression.as_deref()
60    }
61    /// <p>The operation name for the route.</p>
62    pub fn operation_name(&self) -> ::std::option::Option<&str> {
63        self.operation_name.as_deref()
64    }
65    /// <p>The request models for the route. Supported only for WebSocket APIs.</p>
66    pub fn request_models(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
67        self.request_models.as_ref()
68    }
69    /// <p>The request parameters for the route. Supported only for WebSocket APIs.</p>
70    pub fn request_parameters(
71        &self,
72    ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>> {
73        self.request_parameters.as_ref()
74    }
75    /// <p>The route ID.</p>
76    pub fn route_id(&self) -> ::std::option::Option<&str> {
77        self.route_id.as_deref()
78    }
79    /// <p>The route key for the route.</p>
80    pub fn route_key(&self) -> ::std::option::Option<&str> {
81        self.route_key.as_deref()
82    }
83    /// <p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>
84    pub fn route_response_selection_expression(&self) -> ::std::option::Option<&str> {
85        self.route_response_selection_expression.as_deref()
86    }
87    /// <p>The target for the route.</p>
88    pub fn target(&self) -> ::std::option::Option<&str> {
89        self.target.as_deref()
90    }
91}
92impl UpdateRouteInput {
93    /// Creates a new builder-style object to manufacture [`UpdateRouteInput`](crate::operation::update_route::UpdateRouteInput).
94    pub fn builder() -> crate::operation::update_route::builders::UpdateRouteInputBuilder {
95        crate::operation::update_route::builders::UpdateRouteInputBuilder::default()
96    }
97}
98
99/// A builder for [`UpdateRouteInput`](crate::operation::update_route::UpdateRouteInput).
100#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
101#[non_exhaustive]
102pub struct UpdateRouteInputBuilder {
103    pub(crate) api_id: ::std::option::Option<::std::string::String>,
104    pub(crate) api_key_required: ::std::option::Option<bool>,
105    pub(crate) authorization_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
106    pub(crate) authorization_type: ::std::option::Option<crate::types::AuthorizationType>,
107    pub(crate) authorizer_id: ::std::option::Option<::std::string::String>,
108    pub(crate) model_selection_expression: ::std::option::Option<::std::string::String>,
109    pub(crate) operation_name: ::std::option::Option<::std::string::String>,
110    pub(crate) request_models: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
111    pub(crate) request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
112    pub(crate) route_id: ::std::option::Option<::std::string::String>,
113    pub(crate) route_key: ::std::option::Option<::std::string::String>,
114    pub(crate) route_response_selection_expression: ::std::option::Option<::std::string::String>,
115    pub(crate) target: ::std::option::Option<::std::string::String>,
116}
117impl UpdateRouteInputBuilder {
118    /// <p>The API identifier.</p>
119    /// This field is required.
120    pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.api_id = ::std::option::Option::Some(input.into());
122        self
123    }
124    /// <p>The API identifier.</p>
125    pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126        self.api_id = input;
127        self
128    }
129    /// <p>The API identifier.</p>
130    pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
131        &self.api_id
132    }
133    /// <p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>
134    pub fn api_key_required(mut self, input: bool) -> Self {
135        self.api_key_required = ::std::option::Option::Some(input);
136        self
137    }
138    /// <p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>
139    pub fn set_api_key_required(mut self, input: ::std::option::Option<bool>) -> Self {
140        self.api_key_required = input;
141        self
142    }
143    /// <p>Specifies whether an API key is required for the route. Supported only for WebSocket APIs.</p>
144    pub fn get_api_key_required(&self) -> &::std::option::Option<bool> {
145        &self.api_key_required
146    }
147    /// Appends an item to `authorization_scopes`.
148    ///
149    /// To override the contents of this collection use [`set_authorization_scopes`](Self::set_authorization_scopes).
150    ///
151    /// <p>The authorization scopes supported by this route.</p>
152    pub fn authorization_scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        let mut v = self.authorization_scopes.unwrap_or_default();
154        v.push(input.into());
155        self.authorization_scopes = ::std::option::Option::Some(v);
156        self
157    }
158    /// <p>The authorization scopes supported by this route.</p>
159    pub fn set_authorization_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
160        self.authorization_scopes = input;
161        self
162    }
163    /// <p>The authorization scopes supported by this route.</p>
164    pub fn get_authorization_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
165        &self.authorization_scopes
166    }
167    /// <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>
168    pub fn authorization_type(mut self, input: crate::types::AuthorizationType) -> Self {
169        self.authorization_type = ::std::option::Option::Some(input);
170        self
171    }
172    /// <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>
173    pub fn set_authorization_type(mut self, input: ::std::option::Option<crate::types::AuthorizationType>) -> Self {
174        self.authorization_type = input;
175        self
176    }
177    /// <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>
178    pub fn get_authorization_type(&self) -> &::std::option::Option<crate::types::AuthorizationType> {
179        &self.authorization_type
180    }
181    /// <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>
182    pub fn authorizer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
183        self.authorizer_id = ::std::option::Option::Some(input.into());
184        self
185    }
186    /// <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>
187    pub fn set_authorizer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188        self.authorizer_id = input;
189        self
190    }
191    /// <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>
192    pub fn get_authorizer_id(&self) -> &::std::option::Option<::std::string::String> {
193        &self.authorizer_id
194    }
195    /// <p>The model selection expression for the route. Supported only for WebSocket APIs.</p>
196    pub fn model_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
197        self.model_selection_expression = ::std::option::Option::Some(input.into());
198        self
199    }
200    /// <p>The model selection expression for the route. Supported only for WebSocket APIs.</p>
201    pub fn set_model_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
202        self.model_selection_expression = input;
203        self
204    }
205    /// <p>The model selection expression for the route. Supported only for WebSocket APIs.</p>
206    pub fn get_model_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
207        &self.model_selection_expression
208    }
209    /// <p>The operation name for the route.</p>
210    pub fn operation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.operation_name = ::std::option::Option::Some(input.into());
212        self
213    }
214    /// <p>The operation name for the route.</p>
215    pub fn set_operation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.operation_name = input;
217        self
218    }
219    /// <p>The operation name for the route.</p>
220    pub fn get_operation_name(&self) -> &::std::option::Option<::std::string::String> {
221        &self.operation_name
222    }
223    /// Adds a key-value pair to `request_models`.
224    ///
225    /// To override the contents of this collection use [`set_request_models`](Self::set_request_models).
226    ///
227    /// <p>The request models for the route. Supported only for WebSocket APIs.</p>
228    pub fn request_models(
229        mut self,
230        k: impl ::std::convert::Into<::std::string::String>,
231        v: impl ::std::convert::Into<::std::string::String>,
232    ) -> Self {
233        let mut hash_map = self.request_models.unwrap_or_default();
234        hash_map.insert(k.into(), v.into());
235        self.request_models = ::std::option::Option::Some(hash_map);
236        self
237    }
238    /// <p>The request models for the route. Supported only for WebSocket APIs.</p>
239    pub fn set_request_models(
240        mut self,
241        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
242    ) -> Self {
243        self.request_models = input;
244        self
245    }
246    /// <p>The request models for the route. Supported only for WebSocket APIs.</p>
247    pub fn get_request_models(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
248        &self.request_models
249    }
250    /// Adds a key-value pair to `request_parameters`.
251    ///
252    /// To override the contents of this collection use [`set_request_parameters`](Self::set_request_parameters).
253    ///
254    /// <p>The request parameters for the route. Supported only for WebSocket APIs.</p>
255    pub fn request_parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ParameterConstraints) -> Self {
256        let mut hash_map = self.request_parameters.unwrap_or_default();
257        hash_map.insert(k.into(), v);
258        self.request_parameters = ::std::option::Option::Some(hash_map);
259        self
260    }
261    /// <p>The request parameters for the route. Supported only for WebSocket APIs.</p>
262    pub fn set_request_parameters(
263        mut self,
264        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
265    ) -> Self {
266        self.request_parameters = input;
267        self
268    }
269    /// <p>The request parameters for the route. Supported only for WebSocket APIs.</p>
270    pub fn get_request_parameters(
271        &self,
272    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>> {
273        &self.request_parameters
274    }
275    /// <p>The route ID.</p>
276    /// This field is required.
277    pub fn route_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278        self.route_id = ::std::option::Option::Some(input.into());
279        self
280    }
281    /// <p>The route ID.</p>
282    pub fn set_route_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283        self.route_id = input;
284        self
285    }
286    /// <p>The route ID.</p>
287    pub fn get_route_id(&self) -> &::std::option::Option<::std::string::String> {
288        &self.route_id
289    }
290    /// <p>The route key for the route.</p>
291    pub fn route_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
292        self.route_key = ::std::option::Option::Some(input.into());
293        self
294    }
295    /// <p>The route key for the route.</p>
296    pub fn set_route_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
297        self.route_key = input;
298        self
299    }
300    /// <p>The route key for the route.</p>
301    pub fn get_route_key(&self) -> &::std::option::Option<::std::string::String> {
302        &self.route_key
303    }
304    /// <p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>
305    pub fn route_response_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
306        self.route_response_selection_expression = ::std::option::Option::Some(input.into());
307        self
308    }
309    /// <p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>
310    pub fn set_route_response_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
311        self.route_response_selection_expression = input;
312        self
313    }
314    /// <p>The route response selection expression for the route. Supported only for WebSocket APIs.</p>
315    pub fn get_route_response_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
316        &self.route_response_selection_expression
317    }
318    /// <p>The target for the route.</p>
319    pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
320        self.target = ::std::option::Option::Some(input.into());
321        self
322    }
323    /// <p>The target for the route.</p>
324    pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
325        self.target = input;
326        self
327    }
328    /// <p>The target for the route.</p>
329    pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
330        &self.target
331    }
332    /// Consumes the builder and constructs a [`UpdateRouteInput`](crate::operation::update_route::UpdateRouteInput).
333    pub fn build(self) -> ::std::result::Result<crate::operation::update_route::UpdateRouteInput, ::aws_smithy_types::error::operation::BuildError> {
334        ::std::result::Result::Ok(crate::operation::update_route::UpdateRouteInput {
335            api_id: self.api_id,
336            api_key_required: self.api_key_required,
337            authorization_scopes: self.authorization_scopes,
338            authorization_type: self.authorization_type,
339            authorizer_id: self.authorizer_id,
340            model_selection_expression: self.model_selection_expression,
341            operation_name: self.operation_name,
342            request_models: self.request_models,
343            request_parameters: self.request_parameters,
344            route_id: self.route_id,
345            route_key: self.route_key,
346            route_response_selection_expression: self.route_response_selection_expression,
347            target: self.target,
348        })
349    }
350}