software.amazon.awssdk.services.redshiftdata.model.BatchExecuteStatementResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of redshiftdata Show documentation
Show all versions of redshiftdata Show documentation
The AWS Java SDK for Redshift Data module holds the client classes that are used for
communicating with Redshift Data.
/*
* 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 extends Builder> 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
© 2015 - 2025 Weber Informatics LLC | Privacy Policy