aws_sdk_athena/types/
_column.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct Column {
7 pub name: ::std::string::String,
9 pub r#type: ::std::option::Option<::std::string::String>,
11 pub comment: ::std::option::Option<::std::string::String>,
13}
14impl Column {
15 pub fn name(&self) -> &str {
17 use std::ops::Deref;
18 self.name.deref()
19 }
20 pub fn r#type(&self) -> ::std::option::Option<&str> {
22 self.r#type.as_deref()
23 }
24 pub fn comment(&self) -> ::std::option::Option<&str> {
26 self.comment.as_deref()
27 }
28}
29impl Column {
30 pub fn builder() -> crate::types::builders::ColumnBuilder {
32 crate::types::builders::ColumnBuilder::default()
33 }
34}
35
36#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
38#[non_exhaustive]
39pub struct ColumnBuilder {
40 pub(crate) name: ::std::option::Option<::std::string::String>,
41 pub(crate) r#type: ::std::option::Option<::std::string::String>,
42 pub(crate) comment: ::std::option::Option<::std::string::String>,
43}
44impl ColumnBuilder {
45 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
48 self.name = ::std::option::Option::Some(input.into());
49 self
50 }
51 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
53 self.name = input;
54 self
55 }
56 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
58 &self.name
59 }
60 pub fn r#type(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
62 self.r#type = ::std::option::Option::Some(input.into());
63 self
64 }
65 pub fn set_type(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
67 self.r#type = input;
68 self
69 }
70 pub fn get_type(&self) -> &::std::option::Option<::std::string::String> {
72 &self.r#type
73 }
74 pub fn comment(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
76 self.comment = ::std::option::Option::Some(input.into());
77 self
78 }
79 pub fn set_comment(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
81 self.comment = input;
82 self
83 }
84 pub fn get_comment(&self) -> &::std::option::Option<::std::string::String> {
86 &self.comment
87 }
88 pub fn build(self) -> ::std::result::Result<crate::types::Column, ::aws_smithy_types::error::operation::BuildError> {
92 ::std::result::Result::Ok(crate::types::Column {
93 name: self.name.ok_or_else(|| {
94 ::aws_smithy_types::error::operation::BuildError::missing_field(
95 "name",
96 "name was not specified but it is required when building Column",
97 )
98 })?,
99 r#type: self.r#type,
100 comment: self.comment,
101 })
102 }
103}