// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::restore_table_from_cluster_snapshot::_restore_table_from_cluster_snapshot_input::RestoreTableFromClusterSnapshotInputBuilder;
pub use crate::operation::restore_table_from_cluster_snapshot::_restore_table_from_cluster_snapshot_output::RestoreTableFromClusterSnapshotOutputBuilder;
impl crate::operation::restore_table_from_cluster_snapshot::builders::RestoreTableFromClusterSnapshotInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.restore_table_from_cluster_snapshot();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `RestoreTableFromClusterSnapshot`.
///
/// <p>Creates a new table from a table in an Amazon Redshift cluster snapshot. You must create the new table within the Amazon Redshift cluster that the snapshot was taken from.</p>
/// <p>You cannot use <code>RestoreTableFromClusterSnapshot</code> to restore a table with the same name as an existing table in an Amazon Redshift cluster. That is, you cannot overwrite an existing table in a cluster with a restored table. If you want to replace your original table with a new, restored table, then rename or drop your original table before you call <code>RestoreTableFromClusterSnapshot</code>. When you have renamed your original table, then you can pass the original name of the table as the <code>NewTableName</code> parameter value in the call to <code>RestoreTableFromClusterSnapshot</code>. This way, you can replace the original table with the table created from the snapshot.</p>
/// <p>You can't use this operation to restore tables with <a href="https://docs.aws.amazon.com/redshift/latest/dg/t_Sorting_data.html#t_Sorting_data-interleaved">interleaved sort keys</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct RestoreTableFromClusterSnapshotFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::restore_table_from_cluster_snapshot::builders::RestoreTableFromClusterSnapshotInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotOutput,
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotError,
> for RestoreTableFromClusterSnapshotFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotOutput,
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl RestoreTableFromClusterSnapshotFluentBuilder {
/// Creates a new `RestoreTableFromClusterSnapshotFluentBuilder`.
pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
Self {
handle,
inner: ::std::default::Default::default(),
config_override: ::std::option::Option::None,
}
}
/// Access the RestoreTableFromClusterSnapshot as a reference.
pub fn as_input(&self) -> &crate::operation::restore_table_from_cluster_snapshot::builders::RestoreTableFromClusterSnapshotInputBuilder {
&self.inner
}
/// Sends the request and returns the response.
///
/// If an error occurs, an `SdkError` will be returned with additional details that
/// can be matched against.
///
/// By default, any retryable failures will be retried twice. Retry behavior
/// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
/// set when configuring the client.
pub async fn send(
self,
) -> ::std::result::Result<
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let input = self
.inner
.build()
.map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
let runtime_plugins = crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshot::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshot::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotOutput,
crate::operation::restore_table_from_cluster_snapshot::RestoreTableFromClusterSnapshotError,
Self,
> {
crate::client::customize::CustomizableOperation::new(self)
}
pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
self.set_config_override(::std::option::Option::Some(config_override.into()));
self
}
pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
self.config_override = config_override;
self
}
/// <p>The identifier of the Amazon Redshift cluster to restore the table to.</p>
pub fn cluster_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.cluster_identifier(input.into());
self
}
/// <p>The identifier of the Amazon Redshift cluster to restore the table to.</p>
pub fn set_cluster_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_cluster_identifier(input);
self
}
/// <p>The identifier of the Amazon Redshift cluster to restore the table to.</p>
pub fn get_cluster_identifier(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_cluster_identifier()
}
/// <p>The identifier of the snapshot to restore the table from. This snapshot must have been created from the Amazon Redshift cluster specified by the <code>ClusterIdentifier</code> parameter.</p>
pub fn snapshot_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.snapshot_identifier(input.into());
self
}
/// <p>The identifier of the snapshot to restore the table from. This snapshot must have been created from the Amazon Redshift cluster specified by the <code>ClusterIdentifier</code> parameter.</p>
pub fn set_snapshot_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_snapshot_identifier(input);
self
}
/// <p>The identifier of the snapshot to restore the table from. This snapshot must have been created from the Amazon Redshift cluster specified by the <code>ClusterIdentifier</code> parameter.</p>
pub fn get_snapshot_identifier(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_snapshot_identifier()
}
/// <p>The name of the source database that contains the table to restore from.</p>
pub fn source_database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.source_database_name(input.into());
self
}
/// <p>The name of the source database that contains the table to restore from.</p>
pub fn set_source_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_source_database_name(input);
self
}
/// <p>The name of the source database that contains the table to restore from.</p>
pub fn get_source_database_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_source_database_name()
}
/// <p>The name of the source schema that contains the table to restore from. If you do not specify a <code>SourceSchemaName</code> value, the default is <code>public</code>.</p>
pub fn source_schema_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.source_schema_name(input.into());
self
}
/// <p>The name of the source schema that contains the table to restore from. If you do not specify a <code>SourceSchemaName</code> value, the default is <code>public</code>.</p>
pub fn set_source_schema_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_source_schema_name(input);
self
}
/// <p>The name of the source schema that contains the table to restore from. If you do not specify a <code>SourceSchemaName</code> value, the default is <code>public</code>.</p>
pub fn get_source_schema_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_source_schema_name()
}
/// <p>The name of the source table to restore from.</p>
pub fn source_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.source_table_name(input.into());
self
}
/// <p>The name of the source table to restore from.</p>
pub fn set_source_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_source_table_name(input);
self
}
/// <p>The name of the source table to restore from.</p>
pub fn get_source_table_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_source_table_name()
}
/// <p>The name of the database to restore the table to.</p>
pub fn target_database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.target_database_name(input.into());
self
}
/// <p>The name of the database to restore the table to.</p>
pub fn set_target_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_target_database_name(input);
self
}
/// <p>The name of the database to restore the table to.</p>
pub fn get_target_database_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_target_database_name()
}
/// <p>The name of the schema to restore the table to.</p>
pub fn target_schema_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.target_schema_name(input.into());
self
}
/// <p>The name of the schema to restore the table to.</p>
pub fn set_target_schema_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_target_schema_name(input);
self
}
/// <p>The name of the schema to restore the table to.</p>
pub fn get_target_schema_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_target_schema_name()
}
/// <p>The name of the table to create as a result of the current request.</p>
pub fn new_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.new_table_name(input.into());
self
}
/// <p>The name of the table to create as a result of the current request.</p>
pub fn set_new_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_new_table_name(input);
self
}
/// <p>The name of the table to create as a result of the current request.</p>
pub fn get_new_table_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_new_table_name()
}
/// <p>Indicates whether name identifiers for database, schema, and table are case sensitive. If <code>true</code>, the names are case sensitive. If <code>false</code> (default), the names are not case sensitive.</p>
pub fn enable_case_sensitive_identifier(mut self, input: bool) -> Self {
self.inner = self.inner.enable_case_sensitive_identifier(input);
self
}
/// <p>Indicates whether name identifiers for database, schema, and table are case sensitive. If <code>true</code>, the names are case sensitive. If <code>false</code> (default), the names are not case sensitive.</p>
pub fn set_enable_case_sensitive_identifier(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_case_sensitive_identifier(input);
self
}
/// <p>Indicates whether name identifiers for database, schema, and table are case sensitive. If <code>true</code>, the names are case sensitive. If <code>false</code> (default), the names are not case sensitive.</p>
pub fn get_enable_case_sensitive_identifier(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_case_sensitive_identifier()
}
}