aws_sdk_apigatewayv2/operation/create_route/
_create_route_input.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateRouteInput {
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_key: ::std::option::Option<::std::string::String>,
27 pub route_response_selection_expression: ::std::option::Option<::std::string::String>,
29 pub target: ::std::option::Option<::std::string::String>,
31}
32impl CreateRouteInput {
33 pub fn api_id(&self) -> ::std::option::Option<&str> {
35 self.api_id.as_deref()
36 }
37 pub fn api_key_required(&self) -> ::std::option::Option<bool> {
39 self.api_key_required
40 }
41 pub fn authorization_scopes(&self) -> &[::std::string::String] {
45 self.authorization_scopes.as_deref().unwrap_or_default()
46 }
47 pub fn authorization_type(&self) -> ::std::option::Option<&crate::types::AuthorizationType> {
49 self.authorization_type.as_ref()
50 }
51 pub fn authorizer_id(&self) -> ::std::option::Option<&str> {
53 self.authorizer_id.as_deref()
54 }
55 pub fn model_selection_expression(&self) -> ::std::option::Option<&str> {
57 self.model_selection_expression.as_deref()
58 }
59 pub fn operation_name(&self) -> ::std::option::Option<&str> {
61 self.operation_name.as_deref()
62 }
63 pub fn request_models(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
65 self.request_models.as_ref()
66 }
67 pub fn request_parameters(
69 &self,
70 ) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>> {
71 self.request_parameters.as_ref()
72 }
73 pub fn route_key(&self) -> ::std::option::Option<&str> {
75 self.route_key.as_deref()
76 }
77 pub fn route_response_selection_expression(&self) -> ::std::option::Option<&str> {
79 self.route_response_selection_expression.as_deref()
80 }
81 pub fn target(&self) -> ::std::option::Option<&str> {
83 self.target.as_deref()
84 }
85}
86impl CreateRouteInput {
87 pub fn builder() -> crate::operation::create_route::builders::CreateRouteInputBuilder {
89 crate::operation::create_route::builders::CreateRouteInputBuilder::default()
90 }
91}
92
93#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
95#[non_exhaustive]
96pub struct CreateRouteInputBuilder {
97 pub(crate) api_id: ::std::option::Option<::std::string::String>,
98 pub(crate) api_key_required: ::std::option::Option<bool>,
99 pub(crate) authorization_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
100 pub(crate) authorization_type: ::std::option::Option<crate::types::AuthorizationType>,
101 pub(crate) authorizer_id: ::std::option::Option<::std::string::String>,
102 pub(crate) model_selection_expression: ::std::option::Option<::std::string::String>,
103 pub(crate) operation_name: ::std::option::Option<::std::string::String>,
104 pub(crate) request_models: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
105 pub(crate) request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
106 pub(crate) route_key: ::std::option::Option<::std::string::String>,
107 pub(crate) route_response_selection_expression: ::std::option::Option<::std::string::String>,
108 pub(crate) target: ::std::option::Option<::std::string::String>,
109}
110impl CreateRouteInputBuilder {
111 pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114 self.api_id = ::std::option::Option::Some(input.into());
115 self
116 }
117 pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119 self.api_id = input;
120 self
121 }
122 pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
124 &self.api_id
125 }
126 pub fn api_key_required(mut self, input: bool) -> Self {
128 self.api_key_required = ::std::option::Option::Some(input);
129 self
130 }
131 pub fn set_api_key_required(mut self, input: ::std::option::Option<bool>) -> Self {
133 self.api_key_required = input;
134 self
135 }
136 pub fn get_api_key_required(&self) -> &::std::option::Option<bool> {
138 &self.api_key_required
139 }
140 pub fn authorization_scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 let mut v = self.authorization_scopes.unwrap_or_default();
147 v.push(input.into());
148 self.authorization_scopes = ::std::option::Option::Some(v);
149 self
150 }
151 pub fn set_authorization_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
153 self.authorization_scopes = input;
154 self
155 }
156 pub fn get_authorization_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
158 &self.authorization_scopes
159 }
160 pub fn authorization_type(mut self, input: crate::types::AuthorizationType) -> Self {
162 self.authorization_type = ::std::option::Option::Some(input);
163 self
164 }
165 pub fn set_authorization_type(mut self, input: ::std::option::Option<crate::types::AuthorizationType>) -> Self {
167 self.authorization_type = input;
168 self
169 }
170 pub fn get_authorization_type(&self) -> &::std::option::Option<crate::types::AuthorizationType> {
172 &self.authorization_type
173 }
174 pub fn authorizer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176 self.authorizer_id = ::std::option::Option::Some(input.into());
177 self
178 }
179 pub fn set_authorizer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181 self.authorizer_id = input;
182 self
183 }
184 pub fn get_authorizer_id(&self) -> &::std::option::Option<::std::string::String> {
186 &self.authorizer_id
187 }
188 pub fn model_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190 self.model_selection_expression = ::std::option::Option::Some(input.into());
191 self
192 }
193 pub fn set_model_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195 self.model_selection_expression = input;
196 self
197 }
198 pub fn get_model_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
200 &self.model_selection_expression
201 }
202 pub fn operation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
204 self.operation_name = ::std::option::Option::Some(input.into());
205 self
206 }
207 pub fn set_operation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
209 self.operation_name = input;
210 self
211 }
212 pub fn get_operation_name(&self) -> &::std::option::Option<::std::string::String> {
214 &self.operation_name
215 }
216 pub fn request_models(
222 mut self,
223 k: impl ::std::convert::Into<::std::string::String>,
224 v: impl ::std::convert::Into<::std::string::String>,
225 ) -> Self {
226 let mut hash_map = self.request_models.unwrap_or_default();
227 hash_map.insert(k.into(), v.into());
228 self.request_models = ::std::option::Option::Some(hash_map);
229 self
230 }
231 pub fn set_request_models(
233 mut self,
234 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
235 ) -> Self {
236 self.request_models = input;
237 self
238 }
239 pub fn get_request_models(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
241 &self.request_models
242 }
243 pub fn request_parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ParameterConstraints) -> Self {
249 let mut hash_map = self.request_parameters.unwrap_or_default();
250 hash_map.insert(k.into(), v);
251 self.request_parameters = ::std::option::Option::Some(hash_map);
252 self
253 }
254 pub fn set_request_parameters(
256 mut self,
257 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
258 ) -> Self {
259 self.request_parameters = input;
260 self
261 }
262 pub fn get_request_parameters(
264 &self,
265 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>> {
266 &self.request_parameters
267 }
268 pub fn route_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
271 self.route_key = ::std::option::Option::Some(input.into());
272 self
273 }
274 pub fn set_route_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
276 self.route_key = input;
277 self
278 }
279 pub fn get_route_key(&self) -> &::std::option::Option<::std::string::String> {
281 &self.route_key
282 }
283 pub fn route_response_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
285 self.route_response_selection_expression = ::std::option::Option::Some(input.into());
286 self
287 }
288 pub fn set_route_response_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
290 self.route_response_selection_expression = input;
291 self
292 }
293 pub fn get_route_response_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
295 &self.route_response_selection_expression
296 }
297 pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
299 self.target = ::std::option::Option::Some(input.into());
300 self
301 }
302 pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
304 self.target = input;
305 self
306 }
307 pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
309 &self.target
310 }
311 pub fn build(self) -> ::std::result::Result<crate::operation::create_route::CreateRouteInput, ::aws_smithy_types::error::operation::BuildError> {
313 ::std::result::Result::Ok(crate::operation::create_route::CreateRouteInput {
314 api_id: self.api_id,
315 api_key_required: self.api_key_required,
316 authorization_scopes: self.authorization_scopes,
317 authorization_type: self.authorization_type,
318 authorizer_id: self.authorizer_id,
319 model_selection_expression: self.model_selection_expression,
320 operation_name: self.operation_name,
321 request_models: self.request_models,
322 request_parameters: self.request_parameters,
323 route_key: self.route_key,
324 route_response_selection_expression: self.route_response_selection_expression,
325 target: self.target,
326 })
327 }
328}