aws_sdk_apigatewayv2/operation/create_route/
_create_route_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateRouteOutput {
6 pub api_gateway_managed: ::std::option::Option<bool>,
8 pub api_key_required: ::std::option::Option<bool>,
10 pub authorization_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
12 pub authorization_type: ::std::option::Option<crate::types::AuthorizationType>,
14 pub authorizer_id: ::std::option::Option<::std::string::String>,
16 pub model_selection_expression: ::std::option::Option<::std::string::String>,
18 pub operation_name: ::std::option::Option<::std::string::String>,
20 pub request_models: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
22 pub request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
24 pub route_id: ::std::option::Option<::std::string::String>,
26 pub route_key: ::std::option::Option<::std::string::String>,
28 pub route_response_selection_expression: ::std::option::Option<::std::string::String>,
30 pub target: ::std::option::Option<::std::string::String>,
32 _request_id: Option<String>,
33}
34impl CreateRouteOutput {
35 pub fn api_gateway_managed(&self) -> ::std::option::Option<bool> {
37 self.api_gateway_managed
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 ::aws_types::request_id::RequestId for CreateRouteOutput {
93 fn request_id(&self) -> Option<&str> {
94 self._request_id.as_deref()
95 }
96}
97impl CreateRouteOutput {
98 pub fn builder() -> crate::operation::create_route::builders::CreateRouteOutputBuilder {
100 crate::operation::create_route::builders::CreateRouteOutputBuilder::default()
101 }
102}
103
104#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
106#[non_exhaustive]
107pub struct CreateRouteOutputBuilder {
108 pub(crate) api_gateway_managed: ::std::option::Option<bool>,
109 pub(crate) api_key_required: ::std::option::Option<bool>,
110 pub(crate) authorization_scopes: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
111 pub(crate) authorization_type: ::std::option::Option<crate::types::AuthorizationType>,
112 pub(crate) authorizer_id: ::std::option::Option<::std::string::String>,
113 pub(crate) model_selection_expression: ::std::option::Option<::std::string::String>,
114 pub(crate) operation_name: ::std::option::Option<::std::string::String>,
115 pub(crate) request_models: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
116 pub(crate) request_parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
117 pub(crate) route_id: ::std::option::Option<::std::string::String>,
118 pub(crate) route_key: ::std::option::Option<::std::string::String>,
119 pub(crate) route_response_selection_expression: ::std::option::Option<::std::string::String>,
120 pub(crate) target: ::std::option::Option<::std::string::String>,
121 _request_id: Option<String>,
122}
123impl CreateRouteOutputBuilder {
124 pub fn api_gateway_managed(mut self, input: bool) -> Self {
126 self.api_gateway_managed = ::std::option::Option::Some(input);
127 self
128 }
129 pub fn set_api_gateway_managed(mut self, input: ::std::option::Option<bool>) -> Self {
131 self.api_gateway_managed = input;
132 self
133 }
134 pub fn get_api_gateway_managed(&self) -> &::std::option::Option<bool> {
136 &self.api_gateway_managed
137 }
138 pub fn api_key_required(mut self, input: bool) -> Self {
140 self.api_key_required = ::std::option::Option::Some(input);
141 self
142 }
143 pub fn set_api_key_required(mut self, input: ::std::option::Option<bool>) -> Self {
145 self.api_key_required = input;
146 self
147 }
148 pub fn get_api_key_required(&self) -> &::std::option::Option<bool> {
150 &self.api_key_required
151 }
152 pub fn authorization_scopes(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
158 let mut v = self.authorization_scopes.unwrap_or_default();
159 v.push(input.into());
160 self.authorization_scopes = ::std::option::Option::Some(v);
161 self
162 }
163 pub fn set_authorization_scopes(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
165 self.authorization_scopes = input;
166 self
167 }
168 pub fn get_authorization_scopes(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
170 &self.authorization_scopes
171 }
172 pub fn authorization_type(mut self, input: crate::types::AuthorizationType) -> Self {
174 self.authorization_type = ::std::option::Option::Some(input);
175 self
176 }
177 pub fn set_authorization_type(mut self, input: ::std::option::Option<crate::types::AuthorizationType>) -> Self {
179 self.authorization_type = input;
180 self
181 }
182 pub fn get_authorization_type(&self) -> &::std::option::Option<crate::types::AuthorizationType> {
184 &self.authorization_type
185 }
186 pub fn authorizer_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
188 self.authorizer_id = ::std::option::Option::Some(input.into());
189 self
190 }
191 pub fn set_authorizer_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
193 self.authorizer_id = input;
194 self
195 }
196 pub fn get_authorizer_id(&self) -> &::std::option::Option<::std::string::String> {
198 &self.authorizer_id
199 }
200 pub fn model_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
202 self.model_selection_expression = ::std::option::Option::Some(input.into());
203 self
204 }
205 pub fn set_model_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
207 self.model_selection_expression = input;
208 self
209 }
210 pub fn get_model_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
212 &self.model_selection_expression
213 }
214 pub fn operation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
216 self.operation_name = ::std::option::Option::Some(input.into());
217 self
218 }
219 pub fn set_operation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
221 self.operation_name = input;
222 self
223 }
224 pub fn get_operation_name(&self) -> &::std::option::Option<::std::string::String> {
226 &self.operation_name
227 }
228 pub fn request_models(
234 mut self,
235 k: impl ::std::convert::Into<::std::string::String>,
236 v: impl ::std::convert::Into<::std::string::String>,
237 ) -> Self {
238 let mut hash_map = self.request_models.unwrap_or_default();
239 hash_map.insert(k.into(), v.into());
240 self.request_models = ::std::option::Option::Some(hash_map);
241 self
242 }
243 pub fn set_request_models(
245 mut self,
246 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
247 ) -> Self {
248 self.request_models = input;
249 self
250 }
251 pub fn get_request_models(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
253 &self.request_models
254 }
255 pub fn request_parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: crate::types::ParameterConstraints) -> Self {
261 let mut hash_map = self.request_parameters.unwrap_or_default();
262 hash_map.insert(k.into(), v);
263 self.request_parameters = ::std::option::Option::Some(hash_map);
264 self
265 }
266 pub fn set_request_parameters(
268 mut self,
269 input: ::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>>,
270 ) -> Self {
271 self.request_parameters = input;
272 self
273 }
274 pub fn get_request_parameters(
276 &self,
277 ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, crate::types::ParameterConstraints>> {
278 &self.request_parameters
279 }
280 pub fn route_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
282 self.route_id = ::std::option::Option::Some(input.into());
283 self
284 }
285 pub fn set_route_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
287 self.route_id = input;
288 self
289 }
290 pub fn get_route_id(&self) -> &::std::option::Option<::std::string::String> {
292 &self.route_id
293 }
294 pub fn route_key(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
296 self.route_key = ::std::option::Option::Some(input.into());
297 self
298 }
299 pub fn set_route_key(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
301 self.route_key = input;
302 self
303 }
304 pub fn get_route_key(&self) -> &::std::option::Option<::std::string::String> {
306 &self.route_key
307 }
308 pub fn route_response_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
310 self.route_response_selection_expression = ::std::option::Option::Some(input.into());
311 self
312 }
313 pub fn set_route_response_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
315 self.route_response_selection_expression = input;
316 self
317 }
318 pub fn get_route_response_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
320 &self.route_response_selection_expression
321 }
322 pub fn target(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
324 self.target = ::std::option::Option::Some(input.into());
325 self
326 }
327 pub fn set_target(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
329 self.target = input;
330 self
331 }
332 pub fn get_target(&self) -> &::std::option::Option<::std::string::String> {
334 &self.target
335 }
336 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
337 self._request_id = Some(request_id.into());
338 self
339 }
340
341 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
342 self._request_id = request_id;
343 self
344 }
345 pub fn build(self) -> crate::operation::create_route::CreateRouteOutput {
347 crate::operation::create_route::CreateRouteOutput {
348 api_gateway_managed: self.api_gateway_managed,
349 api_key_required: self.api_key_required,
350 authorization_scopes: self.authorization_scopes,
351 authorization_type: self.authorization_type,
352 authorizer_id: self.authorizer_id,
353 model_selection_expression: self.model_selection_expression,
354 operation_name: self.operation_name,
355 request_models: self.request_models,
356 request_parameters: self.request_parameters,
357 route_id: self.route_id,
358 route_key: self.route_key,
359 route_response_selection_expression: self.route_response_selection_expression,
360 target: self.target,
361 _request_id: self._request_id,
362 }
363 }
364}