#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Column {
pub name: ::std::string::String,
pub r#type: ::std::option::Option<::std::string::String>,
pub comment: ::std::option::Option<::std::string::String>,
pub parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl Column {
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn r#type(&self) -> ::std::option::Option<&str> {
self.r#type.as_deref()
}
pub fn comment(&self) -> ::std::option::Option<&str> {
self.comment.as_deref()
}
pub fn parameters(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
self.parameters.as_ref()
}
}
impl Column {
pub fn builder() -> crate::types::builders::ColumnBuilder {
crate::types::builders::ColumnBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ColumnBuilder {
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) r#type: ::std::option::Option<::std::string::String>,
pub(crate) comment: ::std::option::Option<::std::string::String>,
pub(crate) parameters: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
}
impl ColumnBuilder {
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 r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.r#type = ::std::option::Option::Some(input.into());
self
}
pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.r#type = input;
self
}
pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
&self.r#type
}
pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.comment = ::std::option::Option::Some(input.into());
self
}
pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.comment = input;
self
}
pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
&self.comment
}
pub fn parameters(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
let mut hash_map = self.parameters.unwrap_or_default();
hash_map.insert(k.into(), v.into());
self.parameters = ::std::option::Option::Some(hash_map);
self
}
pub fn set_parameters(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
self.parameters = input;
self
}
pub fn get_parameters(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
&self.parameters
}
pub fn build(self) -> ::std::result::Result<crate::types::Column, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::Column {
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 Column",
)
})?,
r#type: self.r#type,
comment: self.comment,
parameters: self.parameters,
})
}
}