aws_sdk_apigatewayv2/operation/update_route/
_update_route_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct UpdateRouteInput {
7 pub api_id: ::std::option::Option<::std::string::String>,
9 pub api_key_required: ::std::option::Option<bool>,
11 pub authorization_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
13 pub authorization_type: ::std::option::Option<crate::types::AuthorizationType>,
15 pub authorizer_id: ::std::option::Option<::std::string::String>,
17 pub model_selection_expression: ::std::option::Option<::std::string::String>,
19 pub operation_name: ::std::option::Option<::std::string::String>,
21 pub request_models: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
23 pub request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
25 pub route_id: ::std::option::Option<::std::string::String>,
27 pub route_key: ::std::option::Option<::std::string::String>,
29 pub route_response_selection_expression: ::std::option::Option<::std::string::String>,
31 pub target: ::std::option::Option<::std::string::String>,
33}
34impl UpdateRouteInput {
35 pub fn api_id(&self) -> ::std::option::Option<&str> {
37 self.api_id.as_deref()
38 }
39 pub fn api_key_required(&self) -> ::std::option::Option<bool> {
41 self.api_key_required
42 }
43 pub fn authorization_scopes(&self) -> &[::std::string::String] {
47 self.authorization_scopes.as_deref().unwrap_or_default()
48 }
49 pub fn authorization_type(&self) -> ::std::option::Option<&crate::types::AuthorizationType> {
51 self.authorization_type.as_ref()
52 }
53 pub fn authorizer_id(&self) -> ::std::option::Option<&str> {
55 self.authorizer_id.as_deref()
56 }
57 pub fn model_selection_expression(&self) -> ::std::option::Option<&str> {
59 self.model_selection_expression.as_deref()
60 }
61 pub fn operation_name(&self) -> ::std::option::Option<&str> {
63 self.operation_name.as_deref()
64 }
65 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 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 pub fn route_id(&self) -> ::std::option::Option<&str> {
77 self.route_id.as_deref()
78 }
79 pub fn route_key(&self) -> ::std::option::Option<&str> {
81 self.route_key.as_deref()
82 }
83 pub fn route_response_selection_expression(&self) -> ::std::option::Option<&str> {
85 self.route_response_selection_expression.as_deref()
86 }
87 pub fn target(&self) -> ::std::option::Option<&str> {
89 self.target.as_deref()
90 }
91}
92impl UpdateRouteInput {
93 pub fn builder() -> crate::operation::update_route::builders::UpdateRouteInputBuilder {
95 crate::operation::update_route::builders::UpdateRouteInputBuilder::default()
96 }
97}
98
99#[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 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 pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
126 self.api_id = input;
127 self
128 }
129 pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
131 &self.api_id
132 }
133 pub fn api_key_required(mut self, input: bool) -> Self {
135 self.api_key_required = ::std::option::Option::Some(input);
136 self
137 }
138 pub fn set_api_key_required(mut self, input: ::std::option::Option<bool>) -> Self {
140 self.api_key_required = input;
141 self
142 }
143 pub fn get_api_key_required(&self) -> &::std::option::Option<bool> {
145 &self.api_key_required
146 }
147 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 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 pub fn get_authorization_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
165 &self.authorization_scopes
166 }
167 pub fn authorization_type(mut self, input: crate::types::AuthorizationType) -> Self {
169 self.authorization_type = ::std::option::Option::Some(input);
170 self
171 }
172 pub fn set_authorization_type(mut self, input: ::std::option::Option<crate::types::AuthorizationType>) -> Self {
174 self.authorization_type = input;
175 self
176 }
177 pub fn get_authorization_type(&self) -> &::std::option::Option<crate::types::AuthorizationType> {
179 &self.authorization_type
180 }
181 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 pub fn set_authorizer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
188 self.authorizer_id = input;
189 self
190 }
191 pub fn get_authorizer_id(&self) -> &::std::option::Option<::std::string::String> {
193 &self.authorizer_id
194 }
195 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 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 pub fn get_model_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
207 &self.model_selection_expression
208 }
209 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 pub fn set_operation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216 self.operation_name = input;
217 self
218 }
219 pub fn get_operation_name(&self) -> &::std::option::Option<::std::string::String> {
221 &self.operation_name
222 }
223 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 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 pub fn get_request_models(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
248 &self.request_models
249 }
250 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 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 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 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 pub fn set_route_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
283 self.route_id = input;
284 self
285 }
286 pub fn get_route_id(&self) -> &::std::option::Option<::std::string::String> {
288 &self.route_id
289 }
290 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 pub fn set_route_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
297 self.route_key = input;
298 self
299 }
300 pub fn get_route_key(&self) -> &::std::option::Option<::std::string::String> {
302 &self.route_key
303 }
304 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 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 pub fn get_route_response_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
316 &self.route_response_selection_expression
317 }
318 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 pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
325 self.target = input;
326 self
327 }
328 pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
330 &self.target
331 }
332 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}