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

software.amazon.awssdk.services.redshiftdata.model.BatchExecuteStatementResponse Maven / Gradle / Ivy

Go to download

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

There is a newer version: 2.29.39
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.redshiftdata.model;

import java.time.Instant;
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.Function;
import software.amazon.awssdk.annotations.Generated;
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 BatchExecuteStatementResponse extends RedshiftDataResponse implements
        ToCopyableBuilder {
    private static final SdkField CLUSTER_IDENTIFIER_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("ClusterIdentifier").getter(getter(BatchExecuteStatementResponse::clusterIdentifier))
            .setter(setter(Builder::clusterIdentifier))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ClusterIdentifier").build()).build();

    private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("CreatedAt").getter(getter(BatchExecuteStatementResponse::createdAt)).setter(setter(Builder::createdAt))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build()).build();

    private static final SdkField DATABASE_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("Database").getter(getter(BatchExecuteStatementResponse::database)).setter(setter(Builder::database))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Database").build()).build();

    private static final SdkField DB_USER_FIELD = SdkField. builder(MarshallingType.STRING).memberName("DbUser")
            .getter(getter(BatchExecuteStatementResponse::dbUser)).setter(setter(Builder::dbUser))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DbUser").build()).build();

    private static final SdkField ID_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Id")
            .getter(getter(BatchExecuteStatementResponse::id)).setter(setter(Builder::id))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Id").build()).build();

    private static final SdkField SECRET_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("SecretArn").getter(getter(BatchExecuteStatementResponse::secretArn)).setter(setter(Builder::secretArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SecretArn").build()).build();

    private static final SdkField WORKGROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("WorkgroupName").getter(getter(BatchExecuteStatementResponse::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(CLUSTER_IDENTIFIER_FIELD,
            CREATED_AT_FIELD, DATABASE_FIELD, DB_USER_FIELD, ID_FIELD, SECRET_ARN_FIELD, WORKGROUP_NAME_FIELD));

    private final String clusterIdentifier;

    private final Instant createdAt;

    private final String database;

    private final String dbUser;

    private final String id;

    private final String secretArn;

    private final String workgroupName;

    private BatchExecuteStatementResponse(BuilderImpl builder) {
        super(builder);
        this.clusterIdentifier = builder.clusterIdentifier;
        this.createdAt = builder.createdAt;
        this.database = builder.database;
        this.dbUser = builder.dbUser;
        this.id = builder.id;
        this.secretArn = builder.secretArn;
        this.workgroupName = builder.workgroupName;
    }

    /**
     * 

* The cluster identifier. This element is not returned when connecting to a serverless workgroup. *

* * @return The cluster identifier. This element is not returned when connecting to a serverless workgroup. */ public final String clusterIdentifier() { return clusterIdentifier; } /** *

* The date and time (UTC) the statement was created. *

* * @return The date and time (UTC) the statement was created. */ public final Instant createdAt() { return createdAt; } /** *

* The name of the database. *

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

* The database user name. *

* * @return The database user name. */ public final String dbUser() { return dbUser; } /** *

* The identifier of the SQL statement whose results are to be fetched. This value is a universally unique * identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by * BatchExecuteStatment. *

* * @return The identifier of the SQL statement whose results are to be fetched. This value is a universally unique * identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by * BatchExecuteStatment. */ public final String id() { return id; } /** *

* The name or ARN of the secret that enables access to the database. *

* * @return The name or ARN of the secret that enables access to the database. */ public final String secretArn() { return secretArn; } /** *

* The serverless workgroup name. This element is not returned when connecting to a provisioned cluster. *

* * @return The serverless workgroup name. This element is not returned when connecting to a provisioned cluster. */ 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(clusterIdentifier()); hashCode = 31 * hashCode + Objects.hashCode(createdAt()); hashCode = 31 * hashCode + Objects.hashCode(database()); hashCode = 31 * hashCode + Objects.hashCode(dbUser()); hashCode = 31 * hashCode + Objects.hashCode(id()); hashCode = 31 * hashCode + Objects.hashCode(secretArn()); 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 BatchExecuteStatementResponse)) { return false; } BatchExecuteStatementResponse other = (BatchExecuteStatementResponse) obj; return Objects.equals(clusterIdentifier(), other.clusterIdentifier()) && Objects.equals(createdAt(), other.createdAt()) && Objects.equals(database(), other.database()) && Objects.equals(dbUser(), other.dbUser()) && Objects.equals(id(), other.id()) && Objects.equals(secretArn(), other.secretArn()) && 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("BatchExecuteStatementResponse").add("ClusterIdentifier", clusterIdentifier()) .add("CreatedAt", createdAt()).add("Database", database()).add("DbUser", dbUser()).add("Id", id()) .add("SecretArn", secretArn()).add("WorkgroupName", workgroupName()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "ClusterIdentifier": return Optional.ofNullable(clazz.cast(clusterIdentifier())); case "CreatedAt": return Optional.ofNullable(clazz.cast(createdAt())); case "Database": return Optional.ofNullable(clazz.cast(database())); case "DbUser": return Optional.ofNullable(clazz.cast(dbUser())); case "Id": return Optional.ofNullable(clazz.cast(id())); case "SecretArn": return Optional.ofNullable(clazz.cast(secretArn())); 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((BatchExecuteStatementResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends RedshiftDataResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The cluster identifier. This element is not returned when connecting to a serverless workgroup. *

* * @param clusterIdentifier * The cluster identifier. This element is not returned when connecting to a serverless workgroup. * @return Returns a reference to this object so that method calls can be chained together. */ Builder clusterIdentifier(String clusterIdentifier); /** *

* The date and time (UTC) the statement was created. *

* * @param createdAt * The date and time (UTC) the statement was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdAt(Instant createdAt); /** *

* The name of the database. *

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

* The database user name. *

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

* The identifier of the SQL statement whose results are to be fetched. This value is a universally unique * identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by * BatchExecuteStatment. *

* * @param id * The identifier of the SQL statement whose results are to be fetched. This value is a universally * unique identifier (UUID) generated by Amazon Redshift Data API. This identifier is returned by * BatchExecuteStatment. * @return Returns a reference to this object so that method calls can be chained together. */ Builder id(String id); /** *

* The name or ARN of the secret that enables access to the database. *

* * @param secretArn * The name or ARN of the secret that enables access to the database. * @return Returns a reference to this object so that method calls can be chained together. */ Builder secretArn(String secretArn); /** *

* The serverless workgroup name. This element is not returned when connecting to a provisioned cluster. *

* * @param workgroupName * The serverless workgroup name. This element is not returned when connecting to a provisioned cluster. * @return Returns a reference to this object so that method calls can be chained together. */ Builder workgroupName(String workgroupName); } static final class BuilderImpl extends RedshiftDataResponse.BuilderImpl implements Builder { private String clusterIdentifier; private Instant createdAt; private String database; private String dbUser; private String id; private String secretArn; private String workgroupName; private BuilderImpl() { } private BuilderImpl(BatchExecuteStatementResponse model) { super(model); clusterIdentifier(model.clusterIdentifier); createdAt(model.createdAt); database(model.database); dbUser(model.dbUser); id(model.id); secretArn(model.secretArn); workgroupName(model.workgroupName); } 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 Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final String getDatabase() { return database; } public final void setDatabase(String database) { this.database = database; } @Override public final Builder database(String database) { this.database = database; return this; } public final String getDbUser() { return dbUser; } public final void setDbUser(String dbUser) { this.dbUser = dbUser; } @Override public final Builder dbUser(String dbUser) { this.dbUser = dbUser; return this; } public final String getId() { return id; } public final void setId(String id) { this.id = id; } @Override public final Builder id(String id) { this.id = id; return this; } public final String getSecretArn() { return secretArn; } public final void setSecretArn(String secretArn) { this.secretArn = secretArn; } @Override public final Builder secretArn(String secretArn) { this.secretArn = secretArn; 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 BatchExecuteStatementResponse build() { return new BatchExecuteStatementResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy