aws_sdk_glue/operation/update_database/
_update_database_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateDatabaseInput {
6    /// <p>The ID of the Data Catalog in which the metadata database resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
7    pub catalog_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the database to update in the catalog. For Hive compatibility, this is folded to lowercase.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>A <code>DatabaseInput</code> object specifying the new definition of the metadata database in the catalog.</p>
11    pub database_input: ::std::option::Option<crate::types::DatabaseInput>,
12}
13impl UpdateDatabaseInput {
14    /// <p>The ID of the Data Catalog in which the metadata database resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
15    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
16        self.catalog_id.as_deref()
17    }
18    /// <p>The name of the database to update in the catalog. For Hive compatibility, this is folded to lowercase.</p>
19    pub fn name(&self) -> ::std::option::Option<&str> {
20        self.name.as_deref()
21    }
22    /// <p>A <code>DatabaseInput</code> object specifying the new definition of the metadata database in the catalog.</p>
23    pub fn database_input(&self) -> ::std::option::Option<&crate::types::DatabaseInput> {
24        self.database_input.as_ref()
25    }
26}
27impl UpdateDatabaseInput {
28    /// Creates a new builder-style object to manufacture [`UpdateDatabaseInput`](crate::operation::update_database::UpdateDatabaseInput).
29    pub fn builder() -> crate::operation::update_database::builders::UpdateDatabaseInputBuilder {
30        crate::operation::update_database::builders::UpdateDatabaseInputBuilder::default()
31    }
32}
33
34/// A builder for [`UpdateDatabaseInput`](crate::operation::update_database::UpdateDatabaseInput).
35#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
36#[non_exhaustive]
37pub struct UpdateDatabaseInputBuilder {
38    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
39    pub(crate) name: ::std::option::Option<::std::string::String>,
40    pub(crate) database_input: ::std::option::Option<crate::types::DatabaseInput>,
41}
42impl UpdateDatabaseInputBuilder {
43    /// <p>The ID of the Data Catalog in which the metadata database resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
44    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
45        self.catalog_id = ::std::option::Option::Some(input.into());
46        self
47    }
48    /// <p>The ID of the Data Catalog in which the metadata database resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
49    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
50        self.catalog_id = input;
51        self
52    }
53    /// <p>The ID of the Data Catalog in which the metadata database resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
54    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
55        &self.catalog_id
56    }
57    /// <p>The name of the database to update in the catalog. For Hive compatibility, this is folded to lowercase.</p>
58    /// This field is required.
59    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.name = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name of the database to update in the catalog. For Hive compatibility, this is folded to lowercase.</p>
64    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.name = input;
66        self
67    }
68    /// <p>The name of the database to update in the catalog. For Hive compatibility, this is folded to lowercase.</p>
69    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
70        &self.name
71    }
72    /// <p>A <code>DatabaseInput</code> object specifying the new definition of the metadata database in the catalog.</p>
73    /// This field is required.
74    pub fn database_input(mut self, input: crate::types::DatabaseInput) -> Self {
75        self.database_input = ::std::option::Option::Some(input);
76        self
77    }
78    /// <p>A <code>DatabaseInput</code> object specifying the new definition of the metadata database in the catalog.</p>
79    pub fn set_database_input(mut self, input: ::std::option::Option<crate::types::DatabaseInput>) -> Self {
80        self.database_input = input;
81        self
82    }
83    /// <p>A <code>DatabaseInput</code> object specifying the new definition of the metadata database in the catalog.</p>
84    pub fn get_database_input(&self) -> &::std::option::Option<crate::types::DatabaseInput> {
85        &self.database_input
86    }
87    /// Consumes the builder and constructs a [`UpdateDatabaseInput`](crate::operation::update_database::UpdateDatabaseInput).
88    pub fn build(
89        self,
90    ) -> ::std::result::Result<crate::operation::update_database::UpdateDatabaseInput, ::aws_smithy_types::error::operation::BuildError> {
91        ::std::result::Result::Ok(crate::operation::update_database::UpdateDatabaseInput {
92            catalog_id: self.catalog_id,
93            name: self.name,
94            database_input: self.database_input,
95        })
96    }
97}