#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CatalogSource {
pub name: ::std::string::String,
pub database: ::std::string::String,
pub table: ::std::string::String,
}
impl CatalogSource {
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn database(&self) -> &str {
use std::ops::Deref;
self.database.deref()
}
pub fn table(&self) -> &str {
use std::ops::Deref;
self.table.deref()
}
}
impl CatalogSource {
pub fn builder() -> crate::types::builders::CatalogSourceBuilder {
crate::types::builders::CatalogSourceBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct CatalogSourceBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) database: ::std::option::Option<::std::string::String>,
pub(crate) table: ::std::option::Option<::std::string::String>,
}
impl CatalogSourceBuilder {
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn database(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.database = ::std::option::Option::Some(input.into());
self
}
pub fn set_database(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.database = input;
self
}
pub fn get_database(&self) -> &::std::option::Option<::std::string::String> {
&self.database
}
pub fn table(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.table = ::std::option::Option::Some(input.into());
self
}
pub fn set_table(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.table = input;
self
}
pub fn get_table(&self) -> &::std::option::Option<::std::string::String> {
&self.table
}
pub fn build(self) -> ::std::result::Result<crate::types::CatalogSource, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::CatalogSource {
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building CatalogSource",
)
})?,
database: self.database.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"database",
"database was not specified but it is required when building CatalogSource",
)
})?,
table: self.table.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"table",
"table was not specified but it is required when building CatalogSource",
)
})?,
})
}
}