All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.redshift.model.RestoreTableFromClusterSnapshotRequest Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Redshift module holds the client classes that are used for communicating with Amazon Redshift Service

There is a newer version: 2.29.15
Show newest version
/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
 * the License. A copy of the License is located at
 * 
 * http://aws.amazon.com/apache2.0
 * 
 * or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
 * and limitations under the License.
 */

package software.amazon.awssdk.services.redshift.model;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
import software.amazon.awssdk.core.SdkField;
import software.amazon.awssdk.core.SdkPojo;
import software.amazon.awssdk.core.protocol.MarshallLocation;
import software.amazon.awssdk.core.protocol.MarshallingType;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

*/ @Generated("software.amazon.awssdk:codegen") public final class RestoreTableFromClusterSnapshotRequest extends RedshiftRequest implements ToCopyableBuilder { private static final SdkField CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("ClusterIdentifier").getter(getter(RestoreTableFromClusterSnapshotRequest::clusterIdentifier)) .setter(setter(Builder::clusterIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterIdentifier").build()).build(); private static final SdkField SNAPSHOT_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SnapshotIdentifier").getter(getter(RestoreTableFromClusterSnapshotRequest::snapshotIdentifier)) .setter(setter(Builder::snapshotIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SnapshotIdentifier").build()) .build(); private static final SdkField SOURCE_DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceDatabaseName").getter(getter(RestoreTableFromClusterSnapshotRequest::sourceDatabaseName)) .setter(setter(Builder::sourceDatabaseName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceDatabaseName").build()) .build(); private static final SdkField SOURCE_SCHEMA_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceSchemaName").getter(getter(RestoreTableFromClusterSnapshotRequest::sourceSchemaName)) .setter(setter(Builder::sourceSchemaName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceSchemaName").build()).build(); private static final SdkField SOURCE_TABLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("SourceTableName").getter(getter(RestoreTableFromClusterSnapshotRequest::sourceTableName)) .setter(setter(Builder::sourceTableName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SourceTableName").build()).build(); private static final SdkField TARGET_DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TargetDatabaseName").getter(getter(RestoreTableFromClusterSnapshotRequest::targetDatabaseName)) .setter(setter(Builder::targetDatabaseName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetDatabaseName").build()) .build(); private static final SdkField TARGET_SCHEMA_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("TargetSchemaName").getter(getter(RestoreTableFromClusterSnapshotRequest::targetSchemaName)) .setter(setter(Builder::targetSchemaName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TargetSchemaName").build()).build(); private static final SdkField NEW_TABLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("NewTableName").getter(getter(RestoreTableFromClusterSnapshotRequest::newTableName)) .setter(setter(Builder::newTableName)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NewTableName").build()).build(); private static final SdkField ENABLE_CASE_SENSITIVE_IDENTIFIER_FIELD = SdkField . builder(MarshallingType.BOOLEAN) .memberName("EnableCaseSensitiveIdentifier") .getter(getter(RestoreTableFromClusterSnapshotRequest::enableCaseSensitiveIdentifier)) .setter(setter(Builder::enableCaseSensitiveIdentifier)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EnableCaseSensitiveIdentifier") .build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CLUSTER_IDENTIFIER_FIELD, SNAPSHOT_IDENTIFIER_FIELD, SOURCE_DATABASE_NAME_FIELD, SOURCE_SCHEMA_NAME_FIELD, SOURCE_TABLE_NAME_FIELD, TARGET_DATABASE_NAME_FIELD, TARGET_SCHEMA_NAME_FIELD, NEW_TABLE_NAME_FIELD, ENABLE_CASE_SENSITIVE_IDENTIFIER_FIELD)); private final String clusterIdentifier; private final String snapshotIdentifier; private final String sourceDatabaseName; private final String sourceSchemaName; private final String sourceTableName; private final String targetDatabaseName; private final String targetSchemaName; private final String newTableName; private final Boolean enableCaseSensitiveIdentifier; private RestoreTableFromClusterSnapshotRequest(BuilderImpl builder) { super(builder); this.clusterIdentifier = builder.clusterIdentifier; this.snapshotIdentifier = builder.snapshotIdentifier; this.sourceDatabaseName = builder.sourceDatabaseName; this.sourceSchemaName = builder.sourceSchemaName; this.sourceTableName = builder.sourceTableName; this.targetDatabaseName = builder.targetDatabaseName; this.targetSchemaName = builder.targetSchemaName; this.newTableName = builder.newTableName; this.enableCaseSensitiveIdentifier = builder.enableCaseSensitiveIdentifier; } /** *

* The identifier of the Amazon Redshift cluster to restore the table to. *

* * @return The identifier of the Amazon Redshift cluster to restore the table to. */ public final String clusterIdentifier() { return clusterIdentifier; } /** *

* The identifier of the snapshot to restore the table from. This snapshot must have been created from the Amazon * Redshift cluster specified by the ClusterIdentifier parameter. *

* * @return The identifier of the snapshot to restore the table from. This snapshot must have been created from the * Amazon Redshift cluster specified by the ClusterIdentifier parameter. */ public final String snapshotIdentifier() { return snapshotIdentifier; } /** *

* The name of the source database that contains the table to restore from. *

* * @return The name of the source database that contains the table to restore from. */ public final String sourceDatabaseName() { return sourceDatabaseName; } /** *

* The name of the source schema that contains the table to restore from. If you do not specify a * SourceSchemaName value, the default is public. *

* * @return The name of the source schema that contains the table to restore from. If you do not specify a * SourceSchemaName value, the default is public. */ public final String sourceSchemaName() { return sourceSchemaName; } /** *

* The name of the source table to restore from. *

* * @return The name of the source table to restore from. */ public final String sourceTableName() { return sourceTableName; } /** *

* The name of the database to restore the table to. *

* * @return The name of the database to restore the table to. */ public final String targetDatabaseName() { return targetDatabaseName; } /** *

* The name of the schema to restore the table to. *

* * @return The name of the schema to restore the table to. */ public final String targetSchemaName() { return targetSchemaName; } /** *

* The name of the table to create as a result of the current request. *

* * @return The name of the table to create as a result of the current request. */ public final String newTableName() { return newTableName; } /** *

* Indicates whether name identifiers for database, schema, and table are case sensitive. If true, the * names are case sensitive. If false (default), the names are not case sensitive. *

* * @return Indicates whether name identifiers for database, schema, and table are case sensitive. If * true, the names are case sensitive. If false (default), the names are not case * sensitive. */ public final Boolean enableCaseSensitiveIdentifier() { return enableCaseSensitiveIdentifier; } @Override public Builder toBuilder() { return new BuilderImpl(this); } public static Builder builder() { return new BuilderImpl(); } public static Class serializableBuilderClass() { return BuilderImpl.class; } @Override public final int hashCode() { int hashCode = 1; hashCode = 31 * hashCode + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(clusterIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(snapshotIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(sourceDatabaseName()); hashCode = 31 * hashCode + Objects.hashCode(sourceSchemaName()); hashCode = 31 * hashCode + Objects.hashCode(sourceTableName()); hashCode = 31 * hashCode + Objects.hashCode(targetDatabaseName()); hashCode = 31 * hashCode + Objects.hashCode(targetSchemaName()); hashCode = 31 * hashCode + Objects.hashCode(newTableName()); hashCode = 31 * hashCode + Objects.hashCode(enableCaseSensitiveIdentifier()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof RestoreTableFromClusterSnapshotRequest)) { return false; } RestoreTableFromClusterSnapshotRequest other = (RestoreTableFromClusterSnapshotRequest) obj; return Objects.equals(clusterIdentifier(), other.clusterIdentifier()) && Objects.equals(snapshotIdentifier(), other.snapshotIdentifier()) && Objects.equals(sourceDatabaseName(), other.sourceDatabaseName()) && Objects.equals(sourceSchemaName(), other.sourceSchemaName()) && Objects.equals(sourceTableName(), other.sourceTableName()) && Objects.equals(targetDatabaseName(), other.targetDatabaseName()) && Objects.equals(targetSchemaName(), other.targetSchemaName()) && Objects.equals(newTableName(), other.newTableName()) && Objects.equals(enableCaseSensitiveIdentifier(), other.enableCaseSensitiveIdentifier()); } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. */ @Override public final String toString() { return ToString.builder("RestoreTableFromClusterSnapshotRequest").add("ClusterIdentifier", clusterIdentifier()) .add("SnapshotIdentifier", snapshotIdentifier()).add("SourceDatabaseName", sourceDatabaseName()) .add("SourceSchemaName", sourceSchemaName()).add("SourceTableName", sourceTableName()) .add("TargetDatabaseName", targetDatabaseName()).add("TargetSchemaName", targetSchemaName()) .add("NewTableName", newTableName()).add("EnableCaseSensitiveIdentifier", enableCaseSensitiveIdentifier()) .build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ClusterIdentifier": return Optional.ofNullable(clazz.cast(clusterIdentifier())); case "SnapshotIdentifier": return Optional.ofNullable(clazz.cast(snapshotIdentifier())); case "SourceDatabaseName": return Optional.ofNullable(clazz.cast(sourceDatabaseName())); case "SourceSchemaName": return Optional.ofNullable(clazz.cast(sourceSchemaName())); case "SourceTableName": return Optional.ofNullable(clazz.cast(sourceTableName())); case "TargetDatabaseName": return Optional.ofNullable(clazz.cast(targetDatabaseName())); case "TargetSchemaName": return Optional.ofNullable(clazz.cast(targetSchemaName())); case "NewTableName": return Optional.ofNullable(clazz.cast(newTableName())); case "EnableCaseSensitiveIdentifier": return Optional.ofNullable(clazz.cast(enableCaseSensitiveIdentifier())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((RestoreTableFromClusterSnapshotRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends RedshiftRequest.Builder, SdkPojo, CopyableBuilder { /** *

* The identifier of the Amazon Redshift cluster to restore the table to. *

* * @param clusterIdentifier * The identifier of the Amazon Redshift cluster to restore the table to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clusterIdentifier(String clusterIdentifier); /** *

* The identifier of the snapshot to restore the table from. This snapshot must have been created from the * Amazon Redshift cluster specified by the ClusterIdentifier parameter. *

* * @param snapshotIdentifier * The identifier of the snapshot to restore the table from. This snapshot must have been created from * the Amazon Redshift cluster specified by the ClusterIdentifier parameter. * @return Returns a reference to this object so that method calls can be chained together. */ Builder snapshotIdentifier(String snapshotIdentifier); /** *

* The name of the source database that contains the table to restore from. *

* * @param sourceDatabaseName * The name of the source database that contains the table to restore from. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceDatabaseName(String sourceDatabaseName); /** *

* The name of the source schema that contains the table to restore from. If you do not specify a * SourceSchemaName value, the default is public. *

* * @param sourceSchemaName * The name of the source schema that contains the table to restore from. If you do not specify a * SourceSchemaName value, the default is public. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceSchemaName(String sourceSchemaName); /** *

* The name of the source table to restore from. *

* * @param sourceTableName * The name of the source table to restore from. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sourceTableName(String sourceTableName); /** *

* The name of the database to restore the table to. *

* * @param targetDatabaseName * The name of the database to restore the table to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetDatabaseName(String targetDatabaseName); /** *

* The name of the schema to restore the table to. *

* * @param targetSchemaName * The name of the schema to restore the table to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder targetSchemaName(String targetSchemaName); /** *

* The name of the table to create as a result of the current request. *

* * @param newTableName * The name of the table to create as a result of the current request. * @return Returns a reference to this object so that method calls can be chained together. */ Builder newTableName(String newTableName); /** *

* Indicates whether name identifiers for database, schema, and table are case sensitive. If true, * the names are case sensitive. If false (default), the names are not case sensitive. *

* * @param enableCaseSensitiveIdentifier * Indicates whether name identifiers for database, schema, and table are case sensitive. If * true, the names are case sensitive. If false (default), the names are not * case sensitive. * @return Returns a reference to this object so that method calls can be chained together. */ Builder enableCaseSensitiveIdentifier(Boolean enableCaseSensitiveIdentifier); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends RedshiftRequest.BuilderImpl implements Builder { private String clusterIdentifier; private String snapshotIdentifier; private String sourceDatabaseName; private String sourceSchemaName; private String sourceTableName; private String targetDatabaseName; private String targetSchemaName; private String newTableName; private Boolean enableCaseSensitiveIdentifier; private BuilderImpl() { } private BuilderImpl(RestoreTableFromClusterSnapshotRequest model) { super(model); clusterIdentifier(model.clusterIdentifier); snapshotIdentifier(model.snapshotIdentifier); sourceDatabaseName(model.sourceDatabaseName); sourceSchemaName(model.sourceSchemaName); sourceTableName(model.sourceTableName); targetDatabaseName(model.targetDatabaseName); targetSchemaName(model.targetSchemaName); newTableName(model.newTableName); enableCaseSensitiveIdentifier(model.enableCaseSensitiveIdentifier); } public final String getClusterIdentifier() { return clusterIdentifier; } public final void setClusterIdentifier(String clusterIdentifier) { this.clusterIdentifier = clusterIdentifier; } @Override public final Builder clusterIdentifier(String clusterIdentifier) { this.clusterIdentifier = clusterIdentifier; return this; } public final String getSnapshotIdentifier() { return snapshotIdentifier; } public final void setSnapshotIdentifier(String snapshotIdentifier) { this.snapshotIdentifier = snapshotIdentifier; } @Override public final Builder snapshotIdentifier(String snapshotIdentifier) { this.snapshotIdentifier = snapshotIdentifier; return this; } public final String getSourceDatabaseName() { return sourceDatabaseName; } public final void setSourceDatabaseName(String sourceDatabaseName) { this.sourceDatabaseName = sourceDatabaseName; } @Override public final Builder sourceDatabaseName(String sourceDatabaseName) { this.sourceDatabaseName = sourceDatabaseName; return this; } public final String getSourceSchemaName() { return sourceSchemaName; } public final void setSourceSchemaName(String sourceSchemaName) { this.sourceSchemaName = sourceSchemaName; } @Override public final Builder sourceSchemaName(String sourceSchemaName) { this.sourceSchemaName = sourceSchemaName; return this; } public final String getSourceTableName() { return sourceTableName; } public final void setSourceTableName(String sourceTableName) { this.sourceTableName = sourceTableName; } @Override public final Builder sourceTableName(String sourceTableName) { this.sourceTableName = sourceTableName; return this; } public final String getTargetDatabaseName() { return targetDatabaseName; } public final void setTargetDatabaseName(String targetDatabaseName) { this.targetDatabaseName = targetDatabaseName; } @Override public final Builder targetDatabaseName(String targetDatabaseName) { this.targetDatabaseName = targetDatabaseName; return this; } public final String getTargetSchemaName() { return targetSchemaName; } public final void setTargetSchemaName(String targetSchemaName) { this.targetSchemaName = targetSchemaName; } @Override public final Builder targetSchemaName(String targetSchemaName) { this.targetSchemaName = targetSchemaName; return this; } public final String getNewTableName() { return newTableName; } public final void setNewTableName(String newTableName) { this.newTableName = newTableName; } @Override public final Builder newTableName(String newTableName) { this.newTableName = newTableName; return this; } public final Boolean getEnableCaseSensitiveIdentifier() { return enableCaseSensitiveIdentifier; } public final void setEnableCaseSensitiveIdentifier(Boolean enableCaseSensitiveIdentifier) { this.enableCaseSensitiveIdentifier = enableCaseSensitiveIdentifier; } @Override public final Builder enableCaseSensitiveIdentifier(Boolean enableCaseSensitiveIdentifier) { this.enableCaseSensitiveIdentifier = enableCaseSensitiveIdentifier; return this; } @Override public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) { super.overrideConfiguration(overrideConfiguration); return this; } @Override public Builder overrideConfiguration(Consumer builderConsumer) { super.overrideConfiguration(builderConsumer); return this; } @Override public RestoreTableFromClusterSnapshotRequest build() { return new RestoreTableFromClusterSnapshotRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy