aws_sdk_glue/operation/create_partition/
_create_partition_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 CreatePartitionInput {
6    /// <p>The Amazon Web Services account ID of the catalog in which the partition is to be created.</p>
7    pub catalog_id: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the metadata database in which the partition is to be created.</p>
9    pub database_name: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the metadata table in which the partition is to be created.</p>
11    pub table_name: ::std::option::Option<::std::string::String>,
12    /// <p>A <code>PartitionInput</code> structure defining the partition to be created.</p>
13    pub partition_input: ::std::option::Option<crate::types::PartitionInput>,
14}
15impl CreatePartitionInput {
16    /// <p>The Amazon Web Services account ID of the catalog in which the partition is to be created.</p>
17    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
18        self.catalog_id.as_deref()
19    }
20    /// <p>The name of the metadata database in which the partition is to be created.</p>
21    pub fn database_name(&self) -> ::std::option::Option<&str> {
22        self.database_name.as_deref()
23    }
24    /// <p>The name of the metadata table in which the partition is to be created.</p>
25    pub fn table_name(&self) -> ::std::option::Option<&str> {
26        self.table_name.as_deref()
27    }
28    /// <p>A <code>PartitionInput</code> structure defining the partition to be created.</p>
29    pub fn partition_input(&self) -> ::std::option::Option<&crate::types::PartitionInput> {
30        self.partition_input.as_ref()
31    }
32}
33impl CreatePartitionInput {
34    /// Creates a new builder-style object to manufacture [`CreatePartitionInput`](crate::operation::create_partition::CreatePartitionInput).
35    pub fn builder() -> crate::operation::create_partition::builders::CreatePartitionInputBuilder {
36        crate::operation::create_partition::builders::CreatePartitionInputBuilder::default()
37    }
38}
39
40/// A builder for [`CreatePartitionInput`](crate::operation::create_partition::CreatePartitionInput).
41#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
42#[non_exhaustive]
43pub struct CreatePartitionInputBuilder {
44    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
45    pub(crate) database_name: ::std::option::Option<::std::string::String>,
46    pub(crate) table_name: ::std::option::Option<::std::string::String>,
47    pub(crate) partition_input: ::std::option::Option<crate::types::PartitionInput>,
48}
49impl CreatePartitionInputBuilder {
50    /// <p>The Amazon Web Services account ID of the catalog in which the partition is to be created.</p>
51    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
52        self.catalog_id = ::std::option::Option::Some(input.into());
53        self
54    }
55    /// <p>The Amazon Web Services account ID of the catalog in which the partition is to be created.</p>
56    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
57        self.catalog_id = input;
58        self
59    }
60    /// <p>The Amazon Web Services account ID of the catalog in which the partition is to be created.</p>
61    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
62        &self.catalog_id
63    }
64    /// <p>The name of the metadata database in which the partition is to be created.</p>
65    /// This field is required.
66    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.database_name = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The name of the metadata database in which the partition is to be created.</p>
71    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.database_name = input;
73        self
74    }
75    /// <p>The name of the metadata database in which the partition is to be created.</p>
76    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
77        &self.database_name
78    }
79    /// <p>The name of the metadata table in which the partition is to be created.</p>
80    /// This field is required.
81    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
82        self.table_name = ::std::option::Option::Some(input.into());
83        self
84    }
85    /// <p>The name of the metadata table in which the partition is to be created.</p>
86    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
87        self.table_name = input;
88        self
89    }
90    /// <p>The name of the metadata table in which the partition is to be created.</p>
91    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
92        &self.table_name
93    }
94    /// <p>A <code>PartitionInput</code> structure defining the partition to be created.</p>
95    /// This field is required.
96    pub fn partition_input(mut self, input: crate::types::PartitionInput) -> Self {
97        self.partition_input = ::std::option::Option::Some(input);
98        self
99    }
100    /// <p>A <code>PartitionInput</code> structure defining the partition to be created.</p>
101    pub fn set_partition_input(mut self, input: ::std::option::Option<crate::types::PartitionInput>) -> Self {
102        self.partition_input = input;
103        self
104    }
105    /// <p>A <code>PartitionInput</code> structure defining the partition to be created.</p>
106    pub fn get_partition_input(&self) -> &::std::option::Option<crate::types::PartitionInput> {
107        &self.partition_input
108    }
109    /// Consumes the builder and constructs a [`CreatePartitionInput`](crate::operation::create_partition::CreatePartitionInput).
110    pub fn build(
111        self,
112    ) -> ::std::result::Result<crate::operation::create_partition::CreatePartitionInput, ::aws_smithy_types::error::operation::BuildError> {
113        ::std::result::Result::Ok(crate::operation::create_partition::CreatePartitionInput {
114            catalog_id: self.catalog_id,
115            database_name: self.database_name,
116            table_name: self.table_name,
117            partition_input: self.partition_input,
118        })
119    }
120}