aws_sdk_glue/operation/get_mapping/
_get_mapping_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetMappingOutput {
6 pub mapping: ::std::vec::Vec<crate::types::MappingEntry>,
8 _request_id: Option<String>,
9}
10impl GetMappingOutput {
11 pub fn mapping(&self) -> &[crate::types::MappingEntry] {
13 use std::ops::Deref;
14 self.mapping.deref()
15 }
16}
17impl ::aws_types::request_id::RequestId for GetMappingOutput {
18 fn request_id(&self) -> Option<&str> {
19 self._request_id.as_deref()
20 }
21}
22impl GetMappingOutput {
23 pub fn builder() -> crate::operation::get_mapping::builders::GetMappingOutputBuilder {
25 crate::operation::get_mapping::builders::GetMappingOutputBuilder::default()
26 }
27}
28
29#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
31#[non_exhaustive]
32pub struct GetMappingOutputBuilder {
33 pub(crate) mapping: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>,
34 _request_id: Option<String>,
35}
36impl GetMappingOutputBuilder {
37 pub fn mapping(mut self, input: crate::types::MappingEntry) -> Self {
43 let mut v = self.mapping.unwrap_or_default();
44 v.push(input);
45 self.mapping = ::std::option::Option::Some(v);
46 self
47 }
48 pub fn set_mapping(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>>) -> Self {
50 self.mapping = input;
51 self
52 }
53 pub fn get_mapping(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MappingEntry>> {
55 &self.mapping
56 }
57 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
58 self._request_id = Some(request_id.into());
59 self
60 }
61
62 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
63 self._request_id = request_id;
64 self
65 }
66 pub fn build(self) -> ::std::result::Result<crate::operation::get_mapping::GetMappingOutput, ::aws_smithy_types::error::operation::BuildError> {
70 ::std::result::Result::Ok(crate::operation::get_mapping::GetMappingOutput {
71 mapping: self.mapping.ok_or_else(|| {
72 ::aws_smithy_types::error::operation::BuildError::missing_field(
73 "mapping",
74 "mapping was not specified but it is required when building GetMappingOutput",
75 )
76 })?,
77 _request_id: self._request_id,
78 })
79 }
80}