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

software.amazon.awssdk.services.redshiftserverless.model.RestoreTableFromRecoveryPointRequest Maven / Gradle / Ivy

Go to download

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

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.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 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 getter(Function g) { return obj -> g.apply((RestoreTableFromRecoveryPointRequest) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends RedshiftServerlessRequest.Builder, SdkPojo, CopyableBuilder { /** *

* 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. *

* * @param activateCaseSensitiveIdentifier * 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 Returns a reference to this object so that method calls can be chained together. */ Builder activateCaseSensitiveIdentifier(Boolean activateCaseSensitiveIdentifier); /** *

* Namespace of the recovery point to restore from. *

* * @param namespaceName * Namespace of the recovery point to restore from. * @return Returns a reference to this object so that method calls can be chained together. */ Builder namespaceName(String namespaceName); /** *

* The name of the table to create from the restore operation. *

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

* The ID of the recovery point to restore the table from. *

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

* The name of the source database that contains the table being restored. *

* * @param sourceDatabaseName * The name of the source database that contains the table being restored. * @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 being restored. *

* * @param sourceSchemaName * The name of the source schema that contains the table being restored. * @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 being restored. *

* * @param sourceTableName * The name of the source table being restored. * @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 workgroup to restore the table to. *

* * @param workgroupName * The workgroup to restore the table to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder workgroupName(String workgroupName); @Override Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration); @Override Builder overrideConfiguration(Consumer builderConsumer); } static final class BuilderImpl extends RedshiftServerlessRequest.BuilderImpl implements Builder { private Boolean activateCaseSensitiveIdentifier; private String namespaceName; private String newTableName; private String recoveryPointId; private String sourceDatabaseName; private String sourceSchemaName; private String sourceTableName; private String targetDatabaseName; private String targetSchemaName; private String workgroupName; private BuilderImpl() { } private BuilderImpl(RestoreTableFromRecoveryPointRequest model) { super(model); activateCaseSensitiveIdentifier(model.activateCaseSensitiveIdentifier); namespaceName(model.namespaceName); newTableName(model.newTableName); recoveryPointId(model.recoveryPointId); sourceDatabaseName(model.sourceDatabaseName); sourceSchemaName(model.sourceSchemaName); sourceTableName(model.sourceTableName); targetDatabaseName(model.targetDatabaseName); targetSchemaName(model.targetSchemaName); workgroupName(model.workgroupName); } public final Boolean getActivateCaseSensitiveIdentifier() { return activateCaseSensitiveIdentifier; } public final void setActivateCaseSensitiveIdentifier(Boolean activateCaseSensitiveIdentifier) { this.activateCaseSensitiveIdentifier = activateCaseSensitiveIdentifier; } @Override public final Builder activateCaseSensitiveIdentifier(Boolean activateCaseSensitiveIdentifier) { this.activateCaseSensitiveIdentifier = activateCaseSensitiveIdentifier; return this; } public final String getNamespaceName() { return namespaceName; } public final void setNamespaceName(String namespaceName) { this.namespaceName = namespaceName; } @Override public final Builder namespaceName(String namespaceName) { this.namespaceName = namespaceName; 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 String getRecoveryPointId() { return recoveryPointId; } public final void setRecoveryPointId(String recoveryPointId) { this.recoveryPointId = recoveryPointId; } @Override public final Builder recoveryPointId(String recoveryPointId) { this.recoveryPointId = recoveryPointId; 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 getWorkgroupName() { return workgroupName; } public final void setWorkgroupName(String workgroupName) { this.workgroupName = workgroupName; } @Override public final Builder workgroupName(String workgroupName) { this.workgroupName = workgroupName; 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 RestoreTableFromRecoveryPointRequest build() { return new RestoreTableFromRecoveryPointRequest(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy