software.amazon.awssdk.services.redshiftserverless.model.RestoreTableFromRecoveryPointRequest Maven / Gradle / Ivy
Show all versions of redshiftserverless Show documentation
/*
* 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.redshiftserverless.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 RestoreTableFromRecoveryPointRequest extends RedshiftServerlessRequest implements
ToCopyableBuilder {
private static final SdkField ACTIVATE_CASE_SENSITIVE_IDENTIFIER_FIELD = SdkField
. builder(MarshallingType.BOOLEAN)
.memberName("activateCaseSensitiveIdentifier")
.getter(getter(RestoreTableFromRecoveryPointRequest::activateCaseSensitiveIdentifier))
.setter(setter(Builder::activateCaseSensitiveIdentifier))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("activateCaseSensitiveIdentifier")
.build()).build();
private static final SdkField NAMESPACE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("namespaceName").getter(getter(RestoreTableFromRecoveryPointRequest::namespaceName))
.setter(setter(Builder::namespaceName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("namespaceName").build()).build();
private static final SdkField NEW_TABLE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("newTableName").getter(getter(RestoreTableFromRecoveryPointRequest::newTableName))
.setter(setter(Builder::newTableName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("newTableName").build()).build();
private static final SdkField RECOVERY_POINT_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("recoveryPointId").getter(getter(RestoreTableFromRecoveryPointRequest::recoveryPointId))
.setter(setter(Builder::recoveryPointId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("recoveryPointId").build()).build();
private static final SdkField SOURCE_DATABASE_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("sourceDatabaseName").getter(getter(RestoreTableFromRecoveryPointRequest::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(RestoreTableFromRecoveryPointRequest::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(RestoreTableFromRecoveryPointRequest::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(RestoreTableFromRecoveryPointRequest::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(RestoreTableFromRecoveryPointRequest::targetSchemaName))
.setter(setter(Builder::targetSchemaName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("targetSchemaName").build()).build();
private static final SdkField WORKGROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("workgroupName").getter(getter(RestoreTableFromRecoveryPointRequest::workgroupName))
.setter(setter(Builder::workgroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("workgroupName").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
ACTIVATE_CASE_SENSITIVE_IDENTIFIER_FIELD, NAMESPACE_NAME_FIELD, NEW_TABLE_NAME_FIELD, RECOVERY_POINT_ID_FIELD,
SOURCE_DATABASE_NAME_FIELD, SOURCE_SCHEMA_NAME_FIELD, SOURCE_TABLE_NAME_FIELD, TARGET_DATABASE_NAME_FIELD,
TARGET_SCHEMA_NAME_FIELD, WORKGROUP_NAME_FIELD));
private final Boolean activateCaseSensitiveIdentifier;
private final String namespaceName;
private final String newTableName;
private final String recoveryPointId;
private final String sourceDatabaseName;
private final String sourceSchemaName;
private final String sourceTableName;
private final String targetDatabaseName;
private final String targetSchemaName;
private final String workgroupName;
private RestoreTableFromRecoveryPointRequest(BuilderImpl builder) {
super(builder);
this.activateCaseSensitiveIdentifier = builder.activateCaseSensitiveIdentifier;
this.namespaceName = builder.namespaceName;
this.newTableName = builder.newTableName;
this.recoveryPointId = builder.recoveryPointId;
this.sourceDatabaseName = builder.sourceDatabaseName;
this.sourceSchemaName = builder.sourceSchemaName;
this.sourceTableName = builder.sourceTableName;
this.targetDatabaseName = builder.targetDatabaseName;
this.targetSchemaName = builder.targetSchemaName;
this.workgroupName = builder.workgroupName;
}
/**
*
* Indicates whether name identifiers for database, schema, and table are case sensitive. If true, the names are
* case sensitive. If false, the names are not case sensitive. The default is false.
*
*
* @return Indicates whether name identifiers for database, schema, and table are case sensitive. If true, the names
* are case sensitive. If false, the names are not case sensitive. The default is false.
*/
public final Boolean activateCaseSensitiveIdentifier() {
return activateCaseSensitiveIdentifier;
}
/**
*
* Namespace of the recovery point to restore from.
*
*
* @return Namespace of the recovery point to restore from.
*/
public final String namespaceName() {
return namespaceName;
}
/**
*
* The name of the table to create from the restore operation.
*
*
* @return The name of the table to create from the restore operation.
*/
public final String newTableName() {
return newTableName;
}
/**
*
* The ID of the recovery point to restore the table from.
*
*
* @return The ID of the recovery point to restore the table from.
*/
public final String recoveryPointId() {
return recoveryPointId;
}
/**
*
* The name of the source database that contains the table being restored.
*
*
* @return The name of the source database that contains the table being restored.
*/
public final String sourceDatabaseName() {
return sourceDatabaseName;
}
/**
*
* The name of the source schema that contains the table being restored.
*
*
* @return The name of the source schema that contains the table being restored.
*/
public final String sourceSchemaName() {
return sourceSchemaName;
}
/**
*
* The name of the source table being restored.
*
*
* @return The name of the source table being restored.
*/
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 workgroup to restore the table to.
*
*
* @return The workgroup to restore the table to.
*/
public final String workgroupName() {
return workgroupName;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(activateCaseSensitiveIdentifier());
hashCode = 31 * hashCode + Objects.hashCode(namespaceName());
hashCode = 31 * hashCode + Objects.hashCode(newTableName());
hashCode = 31 * hashCode + Objects.hashCode(recoveryPointId());
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(workgroupName());
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 RestoreTableFromRecoveryPointRequest)) {
return false;
}
RestoreTableFromRecoveryPointRequest other = (RestoreTableFromRecoveryPointRequest) obj;
return Objects.equals(activateCaseSensitiveIdentifier(), other.activateCaseSensitiveIdentifier())
&& Objects.equals(namespaceName(), other.namespaceName()) && Objects.equals(newTableName(), other.newTableName())
&& Objects.equals(recoveryPointId(), other.recoveryPointId())
&& 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(workgroupName(), other.workgroupName());
}
/**
* 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("RestoreTableFromRecoveryPointRequest")
.add("ActivateCaseSensitiveIdentifier", activateCaseSensitiveIdentifier()).add("NamespaceName", namespaceName())
.add("NewTableName", newTableName()).add("RecoveryPointId", recoveryPointId())
.add("SourceDatabaseName", sourceDatabaseName()).add("SourceSchemaName", sourceSchemaName())
.add("SourceTableName", sourceTableName()).add("TargetDatabaseName", targetDatabaseName())
.add("TargetSchemaName", targetSchemaName()).add("WorkgroupName", workgroupName()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "activateCaseSensitiveIdentifier":
return Optional.ofNullable(clazz.cast(activateCaseSensitiveIdentifier()));
case "namespaceName":
return Optional.ofNullable(clazz.cast(namespaceName()));
case "newTableName":
return Optional.ofNullable(clazz.cast(newTableName()));
case "recoveryPointId":
return Optional.ofNullable(clazz.cast(recoveryPointId()));
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 "workgroupName":
return Optional.ofNullable(clazz.cast(workgroupName()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function