Skip to main content

aws_sdk_glue/types/
_data_quality_target_table.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>An object representing an Glue table.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct DataQualityTargetTable {
7    /// <p>The name of the Glue table.</p>
8    pub table_name: ::std::string::String,
9    /// <p>The name of the database where the Glue table exists.</p>
10    pub database_name: ::std::string::String,
11    /// <p>The catalog id where the Glue table exists.</p>
12    pub catalog_id: ::std::option::Option<::std::string::String>,
13}
14impl DataQualityTargetTable {
15    /// <p>The name of the Glue table.</p>
16    pub fn table_name(&self) -> &str {
17        use std::ops::Deref;
18        self.table_name.deref()
19    }
20    /// <p>The name of the database where the Glue table exists.</p>
21    pub fn database_name(&self) -> &str {
22        use std::ops::Deref;
23        self.database_name.deref()
24    }
25    /// <p>The catalog id where the Glue table exists.</p>
26    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
27        self.catalog_id.as_deref()
28    }
29}
30impl DataQualityTargetTable {
31    /// Creates a new builder-style object to manufacture [`DataQualityTargetTable`](crate::types::DataQualityTargetTable).
32    pub fn builder() -> crate::types::builders::DataQualityTargetTableBuilder {
33        crate::types::builders::DataQualityTargetTableBuilder::default()
34    }
35}
36
37/// A builder for [`DataQualityTargetTable`](crate::types::DataQualityTargetTable).
38#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
39#[non_exhaustive]
40pub struct DataQualityTargetTableBuilder {
41    pub(crate) table_name: ::std::option::Option<::std::string::String>,
42    pub(crate) database_name: ::std::option::Option<::std::string::String>,
43    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
44}
45impl DataQualityTargetTableBuilder {
46    /// <p>The name of the Glue table.</p>
47    /// This field is required.
48    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
49        self.table_name = ::std::option::Option::Some(input.into());
50        self
51    }
52    /// <p>The name of the Glue table.</p>
53    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
54        self.table_name = input;
55        self
56    }
57    /// <p>The name of the Glue table.</p>
58    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
59        &self.table_name
60    }
61    /// <p>The name of the database where the Glue table exists.</p>
62    /// This field is required.
63    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
64        self.database_name = ::std::option::Option::Some(input.into());
65        self
66    }
67    /// <p>The name of the database where the Glue table exists.</p>
68    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
69        self.database_name = input;
70        self
71    }
72    /// <p>The name of the database where the Glue table exists.</p>
73    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
74        &self.database_name
75    }
76    /// <p>The catalog id where the Glue table exists.</p>
77    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.catalog_id = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The catalog id where the Glue table exists.</p>
82    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.catalog_id = input;
84        self
85    }
86    /// <p>The catalog id where the Glue table exists.</p>
87    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
88        &self.catalog_id
89    }
90    /// Consumes the builder and constructs a [`DataQualityTargetTable`](crate::types::DataQualityTargetTable).
91    /// This method will fail if any of the following fields are not set:
92    /// - [`table_name`](crate::types::builders::DataQualityTargetTableBuilder::table_name)
93    /// - [`database_name`](crate::types::builders::DataQualityTargetTableBuilder::database_name)
94    pub fn build(self) -> ::std::result::Result<crate::types::DataQualityTargetTable, ::aws_smithy_types::error::operation::BuildError> {
95        ::std::result::Result::Ok(crate::types::DataQualityTargetTable {
96            table_name: self.table_name.ok_or_else(|| {
97                ::aws_smithy_types::error::operation::BuildError::missing_field(
98                    "table_name",
99                    "table_name was not specified but it is required when building DataQualityTargetTable",
100                )
101            })?,
102            database_name: self.database_name.ok_or_else(|| {
103                ::aws_smithy_types::error::operation::BuildError::missing_field(
104                    "database_name",
105                    "database_name was not specified but it is required when building DataQualityTargetTable",
106                )
107            })?,
108            catalog_id: self.catalog_id,
109        })
110    }
111}