aws_sdk_apigatewayv2/types/
_api.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Api {
7 pub api_endpoint: ::std::option::Option<::std::string::String>,
9 pub api_gateway_managed: ::std::option::Option<bool>,
11 pub api_id: ::std::option::Option<::std::string::String>,
13 pub api_key_selection_expression: ::std::option::Option<::std::string::String>,
15 pub cors_configuration: ::std::option::Option<crate::types::Cors>,
17 pub created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
19 pub description: ::std::option::Option<::std::string::String>,
21 pub disable_schema_validation: ::std::option::Option<bool>,
23 pub disable_execute_api_endpoint: ::std::option::Option<bool>,
25 pub import_info: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
27 pub ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
29 pub name: ::std::option::Option<::std::string::String>,
31 pub protocol_type: ::std::option::Option<crate::types::ProtocolType>,
33 pub route_selection_expression: ::std::option::Option<::std::string::String>,
35 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
37 pub version: ::std::option::Option<::std::string::String>,
39 pub warnings: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
41}
42impl Api {
43 pub fn api_endpoint(&self) -> ::std::option::Option<&str> {
45 self.api_endpoint.as_deref()
46 }
47 pub fn api_gateway_managed(&self) -> ::std::option::Option<bool> {
49 self.api_gateway_managed
50 }
51 pub fn api_id(&self) -> ::std::option::Option<&str> {
53 self.api_id.as_deref()
54 }
55 pub fn api_key_selection_expression(&self) -> ::std::option::Option<&str> {
57 self.api_key_selection_expression.as_deref()
58 }
59 pub fn cors_configuration(&self) -> ::std::option::Option<&crate::types::Cors> {
61 self.cors_configuration.as_ref()
62 }
63 pub fn created_date(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
65 self.created_date.as_ref()
66 }
67 pub fn description(&self) -> ::std::option::Option<&str> {
69 self.description.as_deref()
70 }
71 pub fn disable_schema_validation(&self) -> ::std::option::Option<bool> {
73 self.disable_schema_validation
74 }
75 pub fn disable_execute_api_endpoint(&self) -> ::std::option::Option<bool> {
77 self.disable_execute_api_endpoint
78 }
79 pub fn import_info(&self) -> &[::std::string::String] {
83 self.import_info.as_deref().unwrap_or_default()
84 }
85 pub fn ip_address_type(&self) -> ::std::option::Option<&crate::types::IpAddressType> {
87 self.ip_address_type.as_ref()
88 }
89 pub fn name(&self) -> ::std::option::Option<&str> {
91 self.name.as_deref()
92 }
93 pub fn protocol_type(&self) -> ::std::option::Option<&crate::types::ProtocolType> {
95 self.protocol_type.as_ref()
96 }
97 pub fn route_selection_expression(&self) -> ::std::option::Option<&str> {
99 self.route_selection_expression.as_deref()
100 }
101 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
103 self.tags.as_ref()
104 }
105 pub fn version(&self) -> ::std::option::Option<&str> {
107 self.version.as_deref()
108 }
109 pub fn warnings(&self) -> &[::std::string::String] {
113 self.warnings.as_deref().unwrap_or_default()
114 }
115}
116impl Api {
117 pub fn builder() -> crate::types::builders::ApiBuilder {
119 crate::types::builders::ApiBuilder::default()
120 }
121}
122
123#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
125#[non_exhaustive]
126pub struct ApiBuilder {
127 pub(crate) api_endpoint: ::std::option::Option<::std::string::String>,
128 pub(crate) api_gateway_managed: ::std::option::Option<bool>,
129 pub(crate) api_id: ::std::option::Option<::std::string::String>,
130 pub(crate) api_key_selection_expression: ::std::option::Option<::std::string::String>,
131 pub(crate) cors_configuration: ::std::option::Option<crate::types::Cors>,
132 pub(crate) created_date: ::std::option::Option<::aws_smithy_types::DateTime>,
133 pub(crate) description: ::std::option::Option<::std::string::String>,
134 pub(crate) disable_schema_validation: ::std::option::Option<bool>,
135 pub(crate) disable_execute_api_endpoint: ::std::option::Option<bool>,
136 pub(crate) import_info: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
137 pub(crate) ip_address_type: ::std::option::Option<crate::types::IpAddressType>,
138 pub(crate) name: ::std::option::Option<::std::string::String>,
139 pub(crate) protocol_type: ::std::option::Option<crate::types::ProtocolType>,
140 pub(crate) route_selection_expression: ::std::option::Option<::std::string::String>,
141 pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
142 pub(crate) version: ::std::option::Option<::std::string::String>,
143 pub(crate) warnings: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
144}
145impl ApiBuilder {
146 pub fn api_endpoint(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148 self.api_endpoint = ::std::option::Option::Some(input.into());
149 self
150 }
151 pub fn set_api_endpoint(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153 self.api_endpoint = input;
154 self
155 }
156 pub fn get_api_endpoint(&self) -> &::std::option::Option<::std::string::String> {
158 &self.api_endpoint
159 }
160 pub fn api_gateway_managed(mut self, input: bool) -> Self {
162 self.api_gateway_managed = ::std::option::Option::Some(input);
163 self
164 }
165 pub fn set_api_gateway_managed(mut self, input: ::std::option::Option<bool>) -> Self {
167 self.api_gateway_managed = input;
168 self
169 }
170 pub fn get_api_gateway_managed(&self) -> &::std::option::Option<bool> {
172 &self.api_gateway_managed
173 }
174 pub fn api_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176 self.api_id = ::std::option::Option::Some(input.into());
177 self
178 }
179 pub fn set_api_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181 self.api_id = input;
182 self
183 }
184 pub fn get_api_id(&self) -> &::std::option::Option<::std::string::String> {
186 &self.api_id
187 }
188 pub fn api_key_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
190 self.api_key_selection_expression = ::std::option::Option::Some(input.into());
191 self
192 }
193 pub fn set_api_key_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
195 self.api_key_selection_expression = input;
196 self
197 }
198 pub fn get_api_key_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
200 &self.api_key_selection_expression
201 }
202 pub fn cors_configuration(mut self, input: crate::types::Cors) -> Self {
204 self.cors_configuration = ::std::option::Option::Some(input);
205 self
206 }
207 pub fn set_cors_configuration(mut self, input: ::std::option::Option<crate::types::Cors>) -> Self {
209 self.cors_configuration = input;
210 self
211 }
212 pub fn get_cors_configuration(&self) -> &::std::option::Option<crate::types::Cors> {
214 &self.cors_configuration
215 }
216 pub fn created_date(mut self, input: ::aws_smithy_types::DateTime) -> Self {
218 self.created_date = ::std::option::Option::Some(input);
219 self
220 }
221 pub fn set_created_date(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
223 self.created_date = input;
224 self
225 }
226 pub fn get_created_date(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
228 &self.created_date
229 }
230 pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
232 self.description = ::std::option::Option::Some(input.into());
233 self
234 }
235 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
237 self.description = input;
238 self
239 }
240 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
242 &self.description
243 }
244 pub fn disable_schema_validation(mut self, input: bool) -> Self {
246 self.disable_schema_validation = ::std::option::Option::Some(input);
247 self
248 }
249 pub fn set_disable_schema_validation(mut self, input: ::std::option::Option<bool>) -> Self {
251 self.disable_schema_validation = input;
252 self
253 }
254 pub fn get_disable_schema_validation(&self) -> &::std::option::Option<bool> {
256 &self.disable_schema_validation
257 }
258 pub fn disable_execute_api_endpoint(mut self, input: bool) -> Self {
260 self.disable_execute_api_endpoint = ::std::option::Option::Some(input);
261 self
262 }
263 pub fn set_disable_execute_api_endpoint(mut self, input: ::std::option::Option<bool>) -> Self {
265 self.disable_execute_api_endpoint = input;
266 self
267 }
268 pub fn get_disable_execute_api_endpoint(&self) -> &::std::option::Option<bool> {
270 &self.disable_execute_api_endpoint
271 }
272 pub fn import_info(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
278 let mut v = self.import_info.unwrap_or_default();
279 v.push(input.into());
280 self.import_info = ::std::option::Option::Some(v);
281 self
282 }
283 pub fn set_import_info(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
285 self.import_info = input;
286 self
287 }
288 pub fn get_import_info(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
290 &self.import_info
291 }
292 pub fn ip_address_type(mut self, input: crate::types::IpAddressType) -> Self {
294 self.ip_address_type = ::std::option::Option::Some(input);
295 self
296 }
297 pub fn set_ip_address_type(mut self, input: ::std::option::Option<crate::types::IpAddressType>) -> Self {
299 self.ip_address_type = input;
300 self
301 }
302 pub fn get_ip_address_type(&self) -> &::std::option::Option<crate::types::IpAddressType> {
304 &self.ip_address_type
305 }
306 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
309 self.name = ::std::option::Option::Some(input.into());
310 self
311 }
312 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
314 self.name = input;
315 self
316 }
317 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
319 &self.name
320 }
321 pub fn protocol_type(mut self, input: crate::types::ProtocolType) -> Self {
324 self.protocol_type = ::std::option::Option::Some(input);
325 self
326 }
327 pub fn set_protocol_type(mut self, input: ::std::option::Option<crate::types::ProtocolType>) -> Self {
329 self.protocol_type = input;
330 self
331 }
332 pub fn get_protocol_type(&self) -> &::std::option::Option<crate::types::ProtocolType> {
334 &self.protocol_type
335 }
336 pub fn route_selection_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
339 self.route_selection_expression = ::std::option::Option::Some(input.into());
340 self
341 }
342 pub fn set_route_selection_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
344 self.route_selection_expression = input;
345 self
346 }
347 pub fn get_route_selection_expression(&self) -> &::std::option::Option<::std::string::String> {
349 &self.route_selection_expression
350 }
351 pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
357 let mut hash_map = self.tags.unwrap_or_default();
358 hash_map.insert(k.into(), v.into());
359 self.tags = ::std::option::Option::Some(hash_map);
360 self
361 }
362 pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
364 self.tags = input;
365 self
366 }
367 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
369 &self.tags
370 }
371 pub fn version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
373 self.version = ::std::option::Option::Some(input.into());
374 self
375 }
376 pub fn set_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
378 self.version = input;
379 self
380 }
381 pub fn get_version(&self) -> &::std::option::Option<::std::string::String> {
383 &self.version
384 }
385 pub fn warnings(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
391 let mut v = self.warnings.unwrap_or_default();
392 v.push(input.into());
393 self.warnings = ::std::option::Option::Some(v);
394 self
395 }
396 pub fn set_warnings(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
398 self.warnings = input;
399 self
400 }
401 pub fn get_warnings(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
403 &self.warnings
404 }
405 pub fn build(self) -> crate::types::Api {
407 crate::types::Api {
408 api_endpoint: self.api_endpoint,
409 api_gateway_managed: self.api_gateway_managed,
410 api_id: self.api_id,
411 api_key_selection_expression: self.api_key_selection_expression,
412 cors_configuration: self.cors_configuration,
413 created_date: self.created_date,
414 description: self.description,
415 disable_schema_validation: self.disable_schema_validation,
416 disable_execute_api_endpoint: self.disable_execute_api_endpoint,
417 import_info: self.import_info,
418 ip_address_type: self.ip_address_type,
419 name: self.name,
420 protocol_type: self.protocol_type,
421 route_selection_expression: self.route_selection_expression,
422 tags: self.tags,
423 version: self.version,
424 warnings: self.warnings,
425 }
426 }
427}