aws_sdk_appflow/types/
_glue_data_catalog_config.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies the configuration that Amazon AppFlow uses when it catalogs your data with the Glue Data Catalog. When Amazon AppFlow catalogs your data, it stores metadata in Data Catalog tables. This metadata represents the data that's transferred by the flow that you configure with these settings.</p><note>
4/// <p>You can configure a flow with these settings only when the flow destination is Amazon S3.</p>
5/// </note>
6#[non_exhaustive]
7#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
8pub struct GlueDataCatalogConfig {
9    /// <p>The Amazon Resource Name (ARN) of an IAM role that grants Amazon AppFlow the permissions it needs to create Data Catalog tables, databases, and partitions.</p>
10    /// <p>For an example IAM policy that has the required permissions, see <a href="https://docs.aws.amazon.com/appflow/latest/userguide/security_iam_id-based-policy-examples.html">Identity-based policy examples for Amazon AppFlow</a>.</p>
11    pub role_arn: ::std::string::String,
12    /// <p>The name of the Data Catalog database that stores the metadata tables that Amazon AppFlow creates in your Amazon Web Services account. These tables contain metadata for the data that's transferred by the flow that you configure with this parameter.</p><note>
13    /// <p>When you configure a new flow with this parameter, you must specify an existing database.</p>
14    /// </note>
15    pub database_name: ::std::string::String,
16    /// <p>A naming prefix for each Data Catalog table that Amazon AppFlow creates for the flow that you configure with this setting. Amazon AppFlow adds the prefix to the beginning of the each table name.</p>
17    pub table_prefix: ::std::string::String,
18}
19impl GlueDataCatalogConfig {
20    /// <p>The Amazon Resource Name (ARN) of an IAM role that grants Amazon AppFlow the permissions it needs to create Data Catalog tables, databases, and partitions.</p>
21    /// <p>For an example IAM policy that has the required permissions, see <a href="https://docs.aws.amazon.com/appflow/latest/userguide/security_iam_id-based-policy-examples.html">Identity-based policy examples for Amazon AppFlow</a>.</p>
22    pub fn role_arn(&self) -> &str {
23        use std::ops::Deref;
24        self.role_arn.deref()
25    }
26    /// <p>The name of the Data Catalog database that stores the metadata tables that Amazon AppFlow creates in your Amazon Web Services account. These tables contain metadata for the data that's transferred by the flow that you configure with this parameter.</p><note>
27    /// <p>When you configure a new flow with this parameter, you must specify an existing database.</p>
28    /// </note>
29    pub fn database_name(&self) -> &str {
30        use std::ops::Deref;
31        self.database_name.deref()
32    }
33    /// <p>A naming prefix for each Data Catalog table that Amazon AppFlow creates for the flow that you configure with this setting. Amazon AppFlow adds the prefix to the beginning of the each table name.</p>
34    pub fn table_prefix(&self) -> &str {
35        use std::ops::Deref;
36        self.table_prefix.deref()
37    }
38}
39impl GlueDataCatalogConfig {
40    /// Creates a new builder-style object to manufacture [`GlueDataCatalogConfig`](crate::types::GlueDataCatalogConfig).
41    pub fn builder() -> crate::types::builders::GlueDataCatalogConfigBuilder {
42        crate::types::builders::GlueDataCatalogConfigBuilder::default()
43    }
44}
45
46/// A builder for [`GlueDataCatalogConfig`](crate::types::GlueDataCatalogConfig).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct GlueDataCatalogConfigBuilder {
50    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
51    pub(crate) database_name: ::std::option::Option<::std::string::String>,
52    pub(crate) table_prefix: ::std::option::Option<::std::string::String>,
53}
54impl GlueDataCatalogConfigBuilder {
55    /// <p>The Amazon Resource Name (ARN) of an IAM role that grants Amazon AppFlow the permissions it needs to create Data Catalog tables, databases, and partitions.</p>
56    /// <p>For an example IAM policy that has the required permissions, see <a href="https://docs.aws.amazon.com/appflow/latest/userguide/security_iam_id-based-policy-examples.html">Identity-based policy examples for Amazon AppFlow</a>.</p>
57    /// This field is required.
58    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
59        self.role_arn = ::std::option::Option::Some(input.into());
60        self
61    }
62    /// <p>The Amazon Resource Name (ARN) of an IAM role that grants Amazon AppFlow the permissions it needs to create Data Catalog tables, databases, and partitions.</p>
63    /// <p>For an example IAM policy that has the required permissions, see <a href="https://docs.aws.amazon.com/appflow/latest/userguide/security_iam_id-based-policy-examples.html">Identity-based policy examples for Amazon AppFlow</a>.</p>
64    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.role_arn = input;
66        self
67    }
68    /// <p>The Amazon Resource Name (ARN) of an IAM role that grants Amazon AppFlow the permissions it needs to create Data Catalog tables, databases, and partitions.</p>
69    /// <p>For an example IAM policy that has the required permissions, see <a href="https://docs.aws.amazon.com/appflow/latest/userguide/security_iam_id-based-policy-examples.html">Identity-based policy examples for Amazon AppFlow</a>.</p>
70    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
71        &self.role_arn
72    }
73    /// <p>The name of the Data Catalog database that stores the metadata tables that Amazon AppFlow creates in your Amazon Web Services account. These tables contain metadata for the data that's transferred by the flow that you configure with this parameter.</p><note>
74    /// <p>When you configure a new flow with this parameter, you must specify an existing database.</p>
75    /// </note>
76    /// This field is required.
77    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
78        self.database_name = ::std::option::Option::Some(input.into());
79        self
80    }
81    /// <p>The name of the Data Catalog database that stores the metadata tables that Amazon AppFlow creates in your Amazon Web Services account. These tables contain metadata for the data that's transferred by the flow that you configure with this parameter.</p><note>
82    /// <p>When you configure a new flow with this parameter, you must specify an existing database.</p>
83    /// </note>
84    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
85        self.database_name = input;
86        self
87    }
88    /// <p>The name of the Data Catalog database that stores the metadata tables that Amazon AppFlow creates in your Amazon Web Services account. These tables contain metadata for the data that's transferred by the flow that you configure with this parameter.</p><note>
89    /// <p>When you configure a new flow with this parameter, you must specify an existing database.</p>
90    /// </note>
91    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.database_name
93    }
94    /// <p>A naming prefix for each Data Catalog table that Amazon AppFlow creates for the flow that you configure with this setting. Amazon AppFlow adds the prefix to the beginning of the each table name.</p>
95    /// This field is required.
96    pub fn table_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
97        self.table_prefix = ::std::option::Option::Some(input.into());
98        self
99    }
100    /// <p>A naming prefix for each Data Catalog table that Amazon AppFlow creates for the flow that you configure with this setting. Amazon AppFlow adds the prefix to the beginning of the each table name.</p>
101    pub fn set_table_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
102        self.table_prefix = input;
103        self
104    }
105    /// <p>A naming prefix for each Data Catalog table that Amazon AppFlow creates for the flow that you configure with this setting. Amazon AppFlow adds the prefix to the beginning of the each table name.</p>
106    pub fn get_table_prefix(&self) -> &::std::option::Option<::std::string::String> {
107        &self.table_prefix
108    }
109    /// Consumes the builder and constructs a [`GlueDataCatalogConfig`](crate::types::GlueDataCatalogConfig).
110    /// This method will fail if any of the following fields are not set:
111    /// - [`role_arn`](crate::types::builders::GlueDataCatalogConfigBuilder::role_arn)
112    /// - [`database_name`](crate::types::builders::GlueDataCatalogConfigBuilder::database_name)
113    /// - [`table_prefix`](crate::types::builders::GlueDataCatalogConfigBuilder::table_prefix)
114    pub fn build(self) -> ::std::result::Result<crate::types::GlueDataCatalogConfig, ::aws_smithy_types::error::operation::BuildError> {
115        ::std::result::Result::Ok(crate::types::GlueDataCatalogConfig {
116            role_arn: self.role_arn.ok_or_else(|| {
117                ::aws_smithy_types::error::operation::BuildError::missing_field(
118                    "role_arn",
119                    "role_arn was not specified but it is required when building GlueDataCatalogConfig",
120                )
121            })?,
122            database_name: self.database_name.ok_or_else(|| {
123                ::aws_smithy_types::error::operation::BuildError::missing_field(
124                    "database_name",
125                    "database_name was not specified but it is required when building GlueDataCatalogConfig",
126                )
127            })?,
128            table_prefix: self.table_prefix.ok_or_else(|| {
129                ::aws_smithy_types::error::operation::BuildError::missing_field(
130                    "table_prefix",
131                    "table_prefix was not specified but it is required when building GlueDataCatalogConfig",
132                )
133            })?,
134        })
135    }
136}