software.amazon.awssdk.services.connect.model.EvaluationSummary Maven / Gradle / Ivy
Show all versions of connect 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.connect.model;
import java.io.Serializable;
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.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;
/**
*
* Summary information about a contact evaluation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class EvaluationSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField EVALUATION_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EvaluationId").getter(getter(EvaluationSummary::evaluationId)).setter(setter(Builder::evaluationId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EvaluationId").build()).build();
private static final SdkField EVALUATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EvaluationArn").getter(getter(EvaluationSummary::evaluationArn)).setter(setter(Builder::evaluationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EvaluationArn").build()).build();
private static final SdkField EVALUATION_FORM_TITLE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EvaluationFormTitle").getter(getter(EvaluationSummary::evaluationFormTitle))
.setter(setter(Builder::evaluationFormTitle))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EvaluationFormTitle").build())
.build();
private static final SdkField EVALUATION_FORM_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EvaluationFormId").getter(getter(EvaluationSummary::evaluationFormId))
.setter(setter(Builder::evaluationFormId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EvaluationFormId").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(EvaluationSummary::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField EVALUATOR_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EvaluatorArn").getter(getter(EvaluationSummary::evaluatorArn)).setter(setter(Builder::evaluatorArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EvaluatorArn").build()).build();
private static final SdkField SCORE_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("Score").getter(getter(EvaluationSummary::score)).setter(setter(Builder::score))
.constructor(EvaluationScore::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Score").build()).build();
private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreatedTime").getter(getter(EvaluationSummary::createdTime)).setter(setter(Builder::createdTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedTime").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(EvaluationSummary::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EVALUATION_ID_FIELD,
EVALUATION_ARN_FIELD, EVALUATION_FORM_TITLE_FIELD, EVALUATION_FORM_ID_FIELD, STATUS_FIELD, EVALUATOR_ARN_FIELD,
SCORE_FIELD, CREATED_TIME_FIELD, LAST_MODIFIED_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String evaluationId;
private final String evaluationArn;
private final String evaluationFormTitle;
private final String evaluationFormId;
private final String status;
private final String evaluatorArn;
private final EvaluationScore score;
private final Instant createdTime;
private final Instant lastModifiedTime;
private EvaluationSummary(BuilderImpl builder) {
this.evaluationId = builder.evaluationId;
this.evaluationArn = builder.evaluationArn;
this.evaluationFormTitle = builder.evaluationFormTitle;
this.evaluationFormId = builder.evaluationFormId;
this.status = builder.status;
this.evaluatorArn = builder.evaluatorArn;
this.score = builder.score;
this.createdTime = builder.createdTime;
this.lastModifiedTime = builder.lastModifiedTime;
}
/**
*
* A unique identifier for the contact evaluation.
*
*
* @return A unique identifier for the contact evaluation.
*/
public final String evaluationId() {
return evaluationId;
}
/**
*
* The Amazon Resource Name (ARN) for the contact evaluation resource.
*
*
* @return The Amazon Resource Name (ARN) for the contact evaluation resource.
*/
public final String evaluationArn() {
return evaluationArn;
}
/**
*
* A title of the evaluation form.
*
*
* @return A title of the evaluation form.
*/
public final String evaluationFormTitle() {
return evaluationFormTitle;
}
/**
*
* The unique identifier for the evaluation form.
*
*
* @return The unique identifier for the evaluation form.
*/
public final String evaluationFormId() {
return evaluationFormId;
}
/**
*
* The status of the contact evaluation.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link EvaluationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the contact evaluation.
* @see EvaluationStatus
*/
public final EvaluationStatus status() {
return EvaluationStatus.fromValue(status);
}
/**
*
* The status of the contact evaluation.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link EvaluationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #statusAsString}.
*
*
* @return The status of the contact evaluation.
* @see EvaluationStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* The Amazon Resource Name (ARN) of the user who last updated the evaluation.
*
*
* @return The Amazon Resource Name (ARN) of the user who last updated the evaluation.
*/
public final String evaluatorArn() {
return evaluatorArn;
}
/**
*
* The overall score of the contact evaluation.
*
*
* @return The overall score of the contact evaluation.
*/
public final EvaluationScore score() {
return score;
}
/**
*
* The timestamp for when the evaluation was created.
*
*
* @return The timestamp for when the evaluation was created.
*/
public final Instant createdTime() {
return createdTime;
}
/**
*
* The timestamp for when the evaluation was last updated.
*
*
* @return The timestamp for when the evaluation was last updated.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
@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 + Objects.hashCode(evaluationId());
hashCode = 31 * hashCode + Objects.hashCode(evaluationArn());
hashCode = 31 * hashCode + Objects.hashCode(evaluationFormTitle());
hashCode = 31 * hashCode + Objects.hashCode(evaluationFormId());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(evaluatorArn());
hashCode = 31 * hashCode + Objects.hashCode(score());
hashCode = 31 * hashCode + Objects.hashCode(createdTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof EvaluationSummary)) {
return false;
}
EvaluationSummary other = (EvaluationSummary) obj;
return Objects.equals(evaluationId(), other.evaluationId()) && Objects.equals(evaluationArn(), other.evaluationArn())
&& Objects.equals(evaluationFormTitle(), other.evaluationFormTitle())
&& Objects.equals(evaluationFormId(), other.evaluationFormId())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(evaluatorArn(), other.evaluatorArn()) && Objects.equals(score(), other.score())
&& Objects.equals(createdTime(), other.createdTime())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime());
}
/**
* 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("EvaluationSummary").add("EvaluationId", evaluationId()).add("EvaluationArn", evaluationArn())
.add("EvaluationFormTitle", evaluationFormTitle()).add("EvaluationFormId", evaluationFormId())
.add("Status", statusAsString()).add("EvaluatorArn", evaluatorArn()).add("Score", score())
.add("CreatedTime", createdTime()).add("LastModifiedTime", lastModifiedTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "EvaluationId":
return Optional.ofNullable(clazz.cast(evaluationId()));
case "EvaluationArn":
return Optional.ofNullable(clazz.cast(evaluationArn()));
case "EvaluationFormTitle":
return Optional.ofNullable(clazz.cast(evaluationFormTitle()));
case "EvaluationFormId":
return Optional.ofNullable(clazz.cast(evaluationFormId()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "EvaluatorArn":
return Optional.ofNullable(clazz.cast(evaluatorArn()));
case "Score":
return Optional.ofNullable(clazz.cast(score()));
case "CreatedTime":
return Optional.ofNullable(clazz.cast(createdTime()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function