aws_sdk_glue/operation/update_partition/
_update_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 UpdatePartitionInput {
6    /// <p>The ID of the Data Catalog where the partition to be updated 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 catalog database in which the table in question resides.</p>
9    pub database_name: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the table in which the partition to be updated is located.</p>
11    pub table_name: ::std::option::Option<::std::string::String>,
12    /// <p>List of partition key values that define the partition to update.</p>
13    pub partition_value_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
14    /// <p>The new partition object to update the partition to.</p>
15    /// <p>The <code>Values</code> property can't be changed. If you want to change the partition key values for a partition, delete and recreate the partition.</p>
16    pub partition_input: ::std::option::Option<crate::types::PartitionInput>,
17}
18impl UpdatePartitionInput {
19    /// <p>The ID of the Data Catalog where the partition to be updated resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
20    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
21        self.catalog_id.as_deref()
22    }
23    /// <p>The name of the catalog database in which the table in question resides.</p>
24    pub fn database_name(&self) -> ::std::option::Option<&str> {
25        self.database_name.as_deref()
26    }
27    /// <p>The name of the table in which the partition to be updated is located.</p>
28    pub fn table_name(&self) -> ::std::option::Option<&str> {
29        self.table_name.as_deref()
30    }
31    /// <p>List of partition key values that define the partition to update.</p>
32    ///
33    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.partition_value_list.is_none()`.
34    pub fn partition_value_list(&self) -> &[::std::string::String] {
35        self.partition_value_list.as_deref().unwrap_or_default()
36    }
37    /// <p>The new partition object to update the partition to.</p>
38    /// <p>The <code>Values</code> property can't be changed. If you want to change the partition key values for a partition, delete and recreate the partition.</p>
39    pub fn partition_input(&self) -> ::std::option::Option<&crate::types::PartitionInput> {
40        self.partition_input.as_ref()
41    }
42}
43impl UpdatePartitionInput {
44    /// Creates a new builder-style object to manufacture [`UpdatePartitionInput`](crate::operation::update_partition::UpdatePartitionInput).
45    pub fn builder() -> crate::operation::update_partition::builders::UpdatePartitionInputBuilder {
46        crate::operation::update_partition::builders::UpdatePartitionInputBuilder::default()
47    }
48}
49
50/// A builder for [`UpdatePartitionInput`](crate::operation::update_partition::UpdatePartitionInput).
51#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
52#[non_exhaustive]
53pub struct UpdatePartitionInputBuilder {
54    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
55    pub(crate) database_name: ::std::option::Option<::std::string::String>,
56    pub(crate) table_name: ::std::option::Option<::std::string::String>,
57    pub(crate) partition_value_list: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
58    pub(crate) partition_input: ::std::option::Option<crate::types::PartitionInput>,
59}
60impl UpdatePartitionInputBuilder {
61    /// <p>The ID of the Data Catalog where the partition to be updated resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
62    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
63        self.catalog_id = ::std::option::Option::Some(input.into());
64        self
65    }
66    /// <p>The ID of the Data Catalog where the partition to be updated resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
67    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
68        self.catalog_id = input;
69        self
70    }
71    /// <p>The ID of the Data Catalog where the partition to be updated resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
72    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
73        &self.catalog_id
74    }
75    /// <p>The name of the catalog database in which the table in question resides.</p>
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 catalog database in which the table in question resides.</p>
82    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
83        self.database_name = input;
84        self
85    }
86    /// <p>The name of the catalog database in which the table in question resides.</p>
87    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
88        &self.database_name
89    }
90    /// <p>The name of the table in which the partition to be updated is located.</p>
91    /// This field is required.
92    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
93        self.table_name = ::std::option::Option::Some(input.into());
94        self
95    }
96    /// <p>The name of the table in which the partition to be updated is located.</p>
97    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
98        self.table_name = input;
99        self
100    }
101    /// <p>The name of the table in which the partition to be updated is located.</p>
102    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
103        &self.table_name
104    }
105    /// Appends an item to `partition_value_list`.
106    ///
107    /// To override the contents of this collection use [`set_partition_value_list`](Self::set_partition_value_list).
108    ///
109    /// <p>List of partition key values that define the partition to update.</p>
110    pub fn partition_value_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        let mut v = self.partition_value_list.unwrap_or_default();
112        v.push(input.into());
113        self.partition_value_list = ::std::option::Option::Some(v);
114        self
115    }
116    /// <p>List of partition key values that define the partition to update.</p>
117    pub fn set_partition_value_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
118        self.partition_value_list = input;
119        self
120    }
121    /// <p>List of partition key values that define the partition to update.</p>
122    pub fn get_partition_value_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
123        &self.partition_value_list
124    }
125    /// <p>The new partition object to update the partition to.</p>
126    /// <p>The <code>Values</code> property can't be changed. If you want to change the partition key values for a partition, delete and recreate the partition.</p>
127    /// This field is required.
128    pub fn partition_input(mut self, input: crate::types::PartitionInput) -> Self {
129        self.partition_input = ::std::option::Option::Some(input);
130        self
131    }
132    /// <p>The new partition object to update the partition to.</p>
133    /// <p>The <code>Values</code> property can't be changed. If you want to change the partition key values for a partition, delete and recreate the partition.</p>
134    pub fn set_partition_input(mut self, input: ::std::option::Option<crate::types::PartitionInput>) -> Self {
135        self.partition_input = input;
136        self
137    }
138    /// <p>The new partition object to update the partition to.</p>
139    /// <p>The <code>Values</code> property can't be changed. If you want to change the partition key values for a partition, delete and recreate the partition.</p>
140    pub fn get_partition_input(&self) -> &::std::option::Option<crate::types::PartitionInput> {
141        &self.partition_input
142    }
143    /// Consumes the builder and constructs a [`UpdatePartitionInput`](crate::operation::update_partition::UpdatePartitionInput).
144    pub fn build(
145        self,
146    ) -> ::std::result::Result<crate::operation::update_partition::UpdatePartitionInput, ::aws_smithy_types::error::operation::BuildError> {
147        ::std::result::Result::Ok(crate::operation::update_partition::UpdatePartitionInput {
148            catalog_id: self.catalog_id,
149            database_name: self.database_name,
150            table_name: self.table_name,
151            partition_value_list: self.partition_value_list,
152            partition_input: self.partition_input,
153        })
154    }
155}