software.amazon.awssdk.services.connect.model.EvaluationFormSummary 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.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 an evaluation form.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class EvaluationFormSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField EVALUATION_FORM_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EvaluationFormId").getter(getter(EvaluationFormSummary::evaluationFormId))
.setter(setter(Builder::evaluationFormId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EvaluationFormId").build()).build();
private static final SdkField EVALUATION_FORM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("EvaluationFormArn").getter(getter(EvaluationFormSummary::evaluationFormArn))
.setter(setter(Builder::evaluationFormArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EvaluationFormArn").build()).build();
private static final SdkField TITLE_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Title")
.getter(getter(EvaluationFormSummary::title)).setter(setter(Builder::title))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Title").build()).build();
private static final SdkField CREATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreatedTime").getter(getter(EvaluationFormSummary::createdTime)).setter(setter(Builder::createdTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedTime").build()).build();
private static final SdkField CREATED_BY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("CreatedBy").getter(getter(EvaluationFormSummary::createdBy)).setter(setter(Builder::createdBy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedBy").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(EvaluationFormSummary::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final SdkField LAST_MODIFIED_BY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LastModifiedBy").getter(getter(EvaluationFormSummary::lastModifiedBy))
.setter(setter(Builder::lastModifiedBy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedBy").build()).build();
private static final SdkField LAST_ACTIVATED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastActivatedTime").getter(getter(EvaluationFormSummary::lastActivatedTime))
.setter(setter(Builder::lastActivatedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastActivatedTime").build()).build();
private static final SdkField LAST_ACTIVATED_BY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LastActivatedBy").getter(getter(EvaluationFormSummary::lastActivatedBy))
.setter(setter(Builder::lastActivatedBy))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastActivatedBy").build()).build();
private static final SdkField LATEST_VERSION_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("LatestVersion").getter(getter(EvaluationFormSummary::latestVersion))
.setter(setter(Builder::latestVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LatestVersion").build()).build();
private static final SdkField ACTIVE_VERSION_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("ActiveVersion").getter(getter(EvaluationFormSummary::activeVersion))
.setter(setter(Builder::activeVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ActiveVersion").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(EVALUATION_FORM_ID_FIELD,
EVALUATION_FORM_ARN_FIELD, TITLE_FIELD, CREATED_TIME_FIELD, CREATED_BY_FIELD, LAST_MODIFIED_TIME_FIELD,
LAST_MODIFIED_BY_FIELD, LAST_ACTIVATED_TIME_FIELD, LAST_ACTIVATED_BY_FIELD, LATEST_VERSION_FIELD,
ACTIVE_VERSION_FIELD));
private static final long serialVersionUID = 1L;
private final String evaluationFormId;
private final String evaluationFormArn;
private final String title;
private final Instant createdTime;
private final String createdBy;
private final Instant lastModifiedTime;
private final String lastModifiedBy;
private final Instant lastActivatedTime;
private final String lastActivatedBy;
private final Integer latestVersion;
private final Integer activeVersion;
private EvaluationFormSummary(BuilderImpl builder) {
this.evaluationFormId = builder.evaluationFormId;
this.evaluationFormArn = builder.evaluationFormArn;
this.title = builder.title;
this.createdTime = builder.createdTime;
this.createdBy = builder.createdBy;
this.lastModifiedTime = builder.lastModifiedTime;
this.lastModifiedBy = builder.lastModifiedBy;
this.lastActivatedTime = builder.lastActivatedTime;
this.lastActivatedBy = builder.lastActivatedBy;
this.latestVersion = builder.latestVersion;
this.activeVersion = builder.activeVersion;
}
/**
*
* The unique identifier for the evaluation form.
*
*
* @return The unique identifier for the evaluation form.
*/
public final String evaluationFormId() {
return evaluationFormId;
}
/**
*
* The Amazon Resource Name (ARN) for the evaluation form resource.
*
*
* @return The Amazon Resource Name (ARN) for the evaluation form resource.
*/
public final String evaluationFormArn() {
return evaluationFormArn;
}
/**
*
* A title of the evaluation form.
*
*
* @return A title of the evaluation form.
*/
public final String title() {
return title;
}
/**
*
* The timestamp for when the evaluation form was created.
*
*
* @return The timestamp for when the evaluation form was created.
*/
public final Instant createdTime() {
return createdTime;
}
/**
*
* The Amazon Resource Name (ARN) of the user who created the evaluation form.
*
*
* @return The Amazon Resource Name (ARN) of the user who created the evaluation form.
*/
public final String createdBy() {
return createdBy;
}
/**
*
* The timestamp for when the evaluation form was last updated.
*
*
* @return The timestamp for when the evaluation form was last updated.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
*
* The Amazon Resource Name (ARN) of the user who last updated the evaluation form.
*
*
* @return The Amazon Resource Name (ARN) of the user who last updated the evaluation form.
*/
public final String lastModifiedBy() {
return lastModifiedBy;
}
/**
*
* The timestamp for when the evaluation form was last activated.
*
*
* @return The timestamp for when the evaluation form was last activated.
*/
public final Instant lastActivatedTime() {
return lastActivatedTime;
}
/**
*
* The Amazon Resource Name (ARN) of the user who last activated the evaluation form.
*
*
* @return The Amazon Resource Name (ARN) of the user who last activated the evaluation form.
*/
public final String lastActivatedBy() {
return lastActivatedBy;
}
/**
*
* The version number of the latest evaluation form version.
*
*
* @return The version number of the latest evaluation form version.
*/
public final Integer latestVersion() {
return latestVersion;
}
/**
*
* The version of the active evaluation form version.
*
*
* @return The version of the active evaluation form version.
*/
public final Integer activeVersion() {
return activeVersion;
}
@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(evaluationFormId());
hashCode = 31 * hashCode + Objects.hashCode(evaluationFormArn());
hashCode = 31 * hashCode + Objects.hashCode(title());
hashCode = 31 * hashCode + Objects.hashCode(createdTime());
hashCode = 31 * hashCode + Objects.hashCode(createdBy());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedBy());
hashCode = 31 * hashCode + Objects.hashCode(lastActivatedTime());
hashCode = 31 * hashCode + Objects.hashCode(lastActivatedBy());
hashCode = 31 * hashCode + Objects.hashCode(latestVersion());
hashCode = 31 * hashCode + Objects.hashCode(activeVersion());
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 EvaluationFormSummary)) {
return false;
}
EvaluationFormSummary other = (EvaluationFormSummary) obj;
return Objects.equals(evaluationFormId(), other.evaluationFormId())
&& Objects.equals(evaluationFormArn(), other.evaluationFormArn()) && Objects.equals(title(), other.title())
&& Objects.equals(createdTime(), other.createdTime()) && Objects.equals(createdBy(), other.createdBy())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime())
&& Objects.equals(lastModifiedBy(), other.lastModifiedBy())
&& Objects.equals(lastActivatedTime(), other.lastActivatedTime())
&& Objects.equals(lastActivatedBy(), other.lastActivatedBy())
&& Objects.equals(latestVersion(), other.latestVersion())
&& Objects.equals(activeVersion(), other.activeVersion());
}
/**
* 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("EvaluationFormSummary").add("EvaluationFormId", evaluationFormId())
.add("EvaluationFormArn", evaluationFormArn()).add("Title", title()).add("CreatedTime", createdTime())
.add("CreatedBy", createdBy()).add("LastModifiedTime", lastModifiedTime())
.add("LastModifiedBy", lastModifiedBy()).add("LastActivatedTime", lastActivatedTime())
.add("LastActivatedBy", lastActivatedBy()).add("LatestVersion", latestVersion())
.add("ActiveVersion", activeVersion()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "EvaluationFormId":
return Optional.ofNullable(clazz.cast(evaluationFormId()));
case "EvaluationFormArn":
return Optional.ofNullable(clazz.cast(evaluationFormArn()));
case "Title":
return Optional.ofNullable(clazz.cast(title()));
case "CreatedTime":
return Optional.ofNullable(clazz.cast(createdTime()));
case "CreatedBy":
return Optional.ofNullable(clazz.cast(createdBy()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "LastModifiedBy":
return Optional.ofNullable(clazz.cast(lastModifiedBy()));
case "LastActivatedTime":
return Optional.ofNullable(clazz.cast(lastActivatedTime()));
case "LastActivatedBy":
return Optional.ofNullable(clazz.cast(lastActivatedBy()));
case "LatestVersion":
return Optional.ofNullable(clazz.cast(latestVersion()));
case "ActiveVersion":
return Optional.ofNullable(clazz.cast(activeVersion()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function