software.amazon.awssdk.services.athena.model.GetCalculationExecutionResponse Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of athena Show documentation
Show all versions of athena Show documentation
The AWS Java SDK for Amazon Athena module holds the client classes that are used for communicating
with Amazon Athena Service
/*
* 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.athena.model;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
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.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 GetCalculationExecutionResponse extends AthenaResponse implements
ToCopyableBuilder {
private static final SdkField CALCULATION_EXECUTION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CalculationExecutionId").getter(getter(GetCalculationExecutionResponse::calculationExecutionId))
.setter(setter(Builder::calculationExecutionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CalculationExecutionId").build())
.build();
private static final SdkField SESSION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("SessionId").getter(getter(GetCalculationExecutionResponse::sessionId))
.setter(setter(Builder::sessionId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("SessionId").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("Description").getter(getter(GetCalculationExecutionResponse::description))
.setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField WORKING_DIRECTORY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("WorkingDirectory").getter(getter(GetCalculationExecutionResponse::workingDirectory))
.setter(setter(Builder::workingDirectory))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WorkingDirectory").build()).build();
private static final SdkField STATUS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Status")
.getter(getter(GetCalculationExecutionResponse::status)).setter(setter(Builder::status))
.constructor(CalculationStatus::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField STATISTICS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Statistics")
.getter(getter(GetCalculationExecutionResponse::statistics)).setter(setter(Builder::statistics))
.constructor(CalculationStatistics::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Statistics").build()).build();
private static final SdkField RESULT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("Result")
.getter(getter(GetCalculationExecutionResponse::result)).setter(setter(Builder::result))
.constructor(CalculationResult::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Result").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
CALCULATION_EXECUTION_ID_FIELD, SESSION_ID_FIELD, DESCRIPTION_FIELD, WORKING_DIRECTORY_FIELD, STATUS_FIELD,
STATISTICS_FIELD, RESULT_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("CalculationExecutionId", CALCULATION_EXECUTION_ID_FIELD);
put("SessionId", SESSION_ID_FIELD);
put("Description", DESCRIPTION_FIELD);
put("WorkingDirectory", WORKING_DIRECTORY_FIELD);
put("Status", STATUS_FIELD);
put("Statistics", STATISTICS_FIELD);
put("Result", RESULT_FIELD);
}
});
private final String calculationExecutionId;
private final String sessionId;
private final String description;
private final String workingDirectory;
private final CalculationStatus status;
private final CalculationStatistics statistics;
private final CalculationResult result;
private GetCalculationExecutionResponse(BuilderImpl builder) {
super(builder);
this.calculationExecutionId = builder.calculationExecutionId;
this.sessionId = builder.sessionId;
this.description = builder.description;
this.workingDirectory = builder.workingDirectory;
this.status = builder.status;
this.statistics = builder.statistics;
this.result = builder.result;
}
/**
*
* The calculation execution UUID.
*
*
* @return The calculation execution UUID.
*/
public final String calculationExecutionId() {
return calculationExecutionId;
}
/**
*
* The session ID that the calculation ran in.
*
*
* @return The session ID that the calculation ran in.
*/
public final String sessionId() {
return sessionId;
}
/**
*
* The description of the calculation execution.
*
*
* @return The description of the calculation execution.
*/
public final String description() {
return description;
}
/**
*
* The Amazon S3 location in which calculation results are stored.
*
*
* @return The Amazon S3 location in which calculation results are stored.
*/
public final String workingDirectory() {
return workingDirectory;
}
/**
*
* Contains information about the status of the calculation.
*
*
* @return Contains information about the status of the calculation.
*/
public final CalculationStatus status() {
return status;
}
/**
*
* Contains information about the data processing unit (DPU) execution time and progress. This field is populated
* only when statistics are available.
*
*
* @return Contains information about the data processing unit (DPU) execution time and progress. This field is
* populated only when statistics are available.
*/
public final CalculationStatistics statistics() {
return statistics;
}
/**
*
* Contains result information. This field is populated only if the calculation is completed.
*
*
* @return Contains result information. This field is populated only if the calculation is completed.
*/
public final CalculationResult result() {
return result;
}
@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(calculationExecutionId());
hashCode = 31 * hashCode + Objects.hashCode(sessionId());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(workingDirectory());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(statistics());
hashCode = 31 * hashCode + Objects.hashCode(result());
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 GetCalculationExecutionResponse)) {
return false;
}
GetCalculationExecutionResponse other = (GetCalculationExecutionResponse) obj;
return Objects.equals(calculationExecutionId(), other.calculationExecutionId())
&& Objects.equals(sessionId(), other.sessionId()) && Objects.equals(description(), other.description())
&& Objects.equals(workingDirectory(), other.workingDirectory()) && Objects.equals(status(), other.status())
&& Objects.equals(statistics(), other.statistics()) && Objects.equals(result(), other.result());
}
/**
* 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("GetCalculationExecutionResponse").add("CalculationExecutionId", calculationExecutionId())
.add("SessionId", sessionId()).add("Description", description()).add("WorkingDirectory", workingDirectory())
.add("Status", status()).add("Statistics", statistics()).add("Result", result()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "CalculationExecutionId":
return Optional.ofNullable(clazz.cast(calculationExecutionId()));
case "SessionId":
return Optional.ofNullable(clazz.cast(sessionId()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "WorkingDirectory":
return Optional.ofNullable(clazz.cast(workingDirectory()));
case "Status":
return Optional.ofNullable(clazz.cast(status()));
case "Statistics":
return Optional.ofNullable(clazz.cast(statistics()));
case "Result":
return Optional.ofNullable(clazz.cast(result()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function