aws_sdk_glue/types/
_sql_alias.rs1#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SqlAlias {
7 pub from: ::std::string::String,
9 pub alias: ::std::string::String,
11}
12impl SqlAlias {
13 pub fn from(&self) -> &str {
15 use std::ops::Deref;
16 self.from.deref()
17 }
18 pub fn alias(&self) -> &str {
20 use std::ops::Deref;
21 self.alias.deref()
22 }
23}
24impl SqlAlias {
25 pub fn builder() -> crate::types::builders::SqlAliasBuilder {
27 crate::types::builders::SqlAliasBuilder::default()
28 }
29}
30
31#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
33#[non_exhaustive]
34pub struct SqlAliasBuilder {
35 pub(crate) from: ::std::option::Option<::std::string::String>,
36 pub(crate) alias: ::std::option::Option<::std::string::String>,
37}
38impl SqlAliasBuilder {
39 pub fn from(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
42 self.from = ::std::option::Option::Some(input.into());
43 self
44 }
45 pub fn set_from(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
47 self.from = input;
48 self
49 }
50 pub fn get_from(&self) -> &::std::option::Option<::std::string::String> {
52 &self.from
53 }
54 pub fn alias(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
57 self.alias = ::std::option::Option::Some(input.into());
58 self
59 }
60 pub fn set_alias(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
62 self.alias = input;
63 self
64 }
65 pub fn get_alias(&self) -> &::std::option::Option<::std::string::String> {
67 &self.alias
68 }
69 pub fn build(self) -> ::std::result::Result<crate::types::SqlAlias, ::aws_smithy_types::error::operation::BuildError> {
74 ::std::result::Result::Ok(crate::types::SqlAlias {
75 from: self.from.ok_or_else(|| {
76 ::aws_smithy_types::error::operation::BuildError::missing_field(
77 "from",
78 "from was not specified but it is required when building SqlAlias",
79 )
80 })?,
81 alias: self.alias.ok_or_else(|| {
82 ::aws_smithy_types::error::operation::BuildError::missing_field(
83 "alias",
84 "alias was not specified but it is required when building SqlAlias",
85 )
86 })?,
87 })
88 }
89}