aws_sdk_glue/operation/get_mapping/
_get_mapping_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct GetMappingInput {
6    /// <p>Specifies the source table.</p>
7    pub source: ::std::option::Option<crate::types::CatalogEntry>,
8    /// <p>A list of target tables.</p>
9    pub sinks: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>,
10    /// <p>Parameters for the mapping.</p>
11    pub location: ::std::option::Option<crate::types::Location>,
12}
13impl GetMappingInput {
14    /// <p>Specifies the source table.</p>
15    pub fn source(&self) -> ::std::option::Option<&crate::types::CatalogEntry> {
16        self.source.as_ref()
17    }
18    /// <p>A list of target tables.</p>
19    ///
20    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.sinks.is_none()`.
21    pub fn sinks(&self) -> &[crate::types::CatalogEntry] {
22        self.sinks.as_deref().unwrap_or_default()
23    }
24    /// <p>Parameters for the mapping.</p>
25    pub fn location(&self) -> ::std::option::Option<&crate::types::Location> {
26        self.location.as_ref()
27    }
28}
29impl GetMappingInput {
30    /// Creates a new builder-style object to manufacture [`GetMappingInput`](crate::operation::get_mapping::GetMappingInput).
31    pub fn builder() -> crate::operation::get_mapping::builders::GetMappingInputBuilder {
32        crate::operation::get_mapping::builders::GetMappingInputBuilder::default()
33    }
34}
35
36/// A builder for [`GetMappingInput`](crate::operation::get_mapping::GetMappingInput).
37#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct GetMappingInputBuilder {
40    pub(crate) source: ::std::option::Option<crate::types::CatalogEntry>,
41    pub(crate) sinks: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>,
42    pub(crate) location: ::std::option::Option<crate::types::Location>,
43}
44impl GetMappingInputBuilder {
45    /// <p>Specifies the source table.</p>
46    /// This field is required.
47    pub fn source(mut self, input: crate::types::CatalogEntry) -> Self {
48        self.source = ::std::option::Option::Some(input);
49        self
50    }
51    /// <p>Specifies the source table.</p>
52    pub fn set_source(mut self, input: ::std::option::Option<crate::types::CatalogEntry>) -> Self {
53        self.source = input;
54        self
55    }
56    /// <p>Specifies the source table.</p>
57    pub fn get_source(&self) -> &::std::option::Option<crate::types::CatalogEntry> {
58        &self.source
59    }
60    /// Appends an item to `sinks`.
61    ///
62    /// To override the contents of this collection use [`set_sinks`](Self::set_sinks).
63    ///
64    /// <p>A list of target tables.</p>
65    pub fn sinks(mut self, input: crate::types::CatalogEntry) -> Self {
66        let mut v = self.sinks.unwrap_or_default();
67        v.push(input);
68        self.sinks = ::std::option::Option::Some(v);
69        self
70    }
71    /// <p>A list of target tables.</p>
72    pub fn set_sinks(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>>) -> Self {
73        self.sinks = input;
74        self
75    }
76    /// <p>A list of target tables.</p>
77    pub fn get_sinks(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CatalogEntry>> {
78        &self.sinks
79    }
80    /// <p>Parameters for the mapping.</p>
81    pub fn location(mut self, input: crate::types::Location) -> Self {
82        self.location = ::std::option::Option::Some(input);
83        self
84    }
85    /// <p>Parameters for the mapping.</p>
86    pub fn set_location(mut self, input: ::std::option::Option<crate::types::Location>) -> Self {
87        self.location = input;
88        self
89    }
90    /// <p>Parameters for the mapping.</p>
91    pub fn get_location(&self) -> &::std::option::Option<crate::types::Location> {
92        &self.location
93    }
94    /// Consumes the builder and constructs a [`GetMappingInput`](crate::operation::get_mapping::GetMappingInput).
95    pub fn build(self) -> ::std::result::Result<crate::operation::get_mapping::GetMappingInput, ::aws_smithy_types::error::operation::BuildError> {
96        ::std::result::Result::Ok(crate::operation::get_mapping::GetMappingInput {
97            source: self.source,
98            sinks: self.sinks,
99            location: self.location,
100        })
101    }
102}