software.amazon.awssdk.services.sagemaker.model.LabelingJobSummary Maven / Gradle / Ivy
Show all versions of sagemaker 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.sagemaker.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;
/**
*
* Provides summary information about a labeling job.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class LabelingJobSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField LABELING_JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LabelingJobName").getter(getter(LabelingJobSummary::labelingJobName))
.setter(setter(Builder::labelingJobName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LabelingJobName").build()).build();
private static final SdkField LABELING_JOB_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LabelingJobArn").getter(getter(LabelingJobSummary::labelingJobArn))
.setter(setter(Builder::labelingJobArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LabelingJobArn").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(LabelingJobSummary::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(LabelingJobSummary::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final SdkField LABELING_JOB_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LabelingJobStatus").getter(getter(LabelingJobSummary::labelingJobStatusAsString))
.setter(setter(Builder::labelingJobStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LabelingJobStatus").build()).build();
private static final SdkField LABEL_COUNTERS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("LabelCounters")
.getter(getter(LabelingJobSummary::labelCounters)).setter(setter(Builder::labelCounters))
.constructor(LabelCounters::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LabelCounters").build()).build();
private static final SdkField WORKTEAM_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("WorkteamArn").getter(getter(LabelingJobSummary::workteamArn)).setter(setter(Builder::workteamArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WorkteamArn").build()).build();
private static final SdkField PRE_HUMAN_TASK_LAMBDA_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PreHumanTaskLambdaArn").getter(getter(LabelingJobSummary::preHumanTaskLambdaArn))
.setter(setter(Builder::preHumanTaskLambdaArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PreHumanTaskLambdaArn").build())
.build();
private static final SdkField ANNOTATION_CONSOLIDATION_LAMBDA_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("AnnotationConsolidationLambdaArn")
.getter(getter(LabelingJobSummary::annotationConsolidationLambdaArn))
.setter(setter(Builder::annotationConsolidationLambdaArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("AnnotationConsolidationLambdaArn")
.build()).build();
private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FailureReason").getter(getter(LabelingJobSummary::failureReason)).setter(setter(Builder::failureReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FailureReason").build()).build();
private static final SdkField LABELING_JOB_OUTPUT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("LabelingJobOutput")
.getter(getter(LabelingJobSummary::labelingJobOutput)).setter(setter(Builder::labelingJobOutput))
.constructor(LabelingJobOutput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LabelingJobOutput").build()).build();
private static final SdkField INPUT_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("InputConfig")
.getter(getter(LabelingJobSummary::inputConfig)).setter(setter(Builder::inputConfig))
.constructor(LabelingJobInputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputConfig").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(LABELING_JOB_NAME_FIELD,
LABELING_JOB_ARN_FIELD, CREATION_TIME_FIELD, LAST_MODIFIED_TIME_FIELD, LABELING_JOB_STATUS_FIELD,
LABEL_COUNTERS_FIELD, WORKTEAM_ARN_FIELD, PRE_HUMAN_TASK_LAMBDA_ARN_FIELD, ANNOTATION_CONSOLIDATION_LAMBDA_ARN_FIELD,
FAILURE_REASON_FIELD, LABELING_JOB_OUTPUT_FIELD, INPUT_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final String labelingJobName;
private final String labelingJobArn;
private final Instant creationTime;
private final Instant lastModifiedTime;
private final String labelingJobStatus;
private final LabelCounters labelCounters;
private final String workteamArn;
private final String preHumanTaskLambdaArn;
private final String annotationConsolidationLambdaArn;
private final String failureReason;
private final LabelingJobOutput labelingJobOutput;
private final LabelingJobInputConfig inputConfig;
private LabelingJobSummary(BuilderImpl builder) {
this.labelingJobName = builder.labelingJobName;
this.labelingJobArn = builder.labelingJobArn;
this.creationTime = builder.creationTime;
this.lastModifiedTime = builder.lastModifiedTime;
this.labelingJobStatus = builder.labelingJobStatus;
this.labelCounters = builder.labelCounters;
this.workteamArn = builder.workteamArn;
this.preHumanTaskLambdaArn = builder.preHumanTaskLambdaArn;
this.annotationConsolidationLambdaArn = builder.annotationConsolidationLambdaArn;
this.failureReason = builder.failureReason;
this.labelingJobOutput = builder.labelingJobOutput;
this.inputConfig = builder.inputConfig;
}
/**
*
* The name of the labeling job.
*
*
* @return The name of the labeling job.
*/
public final String labelingJobName() {
return labelingJobName;
}
/**
*
* The Amazon Resource Name (ARN) assigned to the labeling job when it was created.
*
*
* @return The Amazon Resource Name (ARN) assigned to the labeling job when it was created.
*/
public final String labelingJobArn() {
return labelingJobArn;
}
/**
*
* The date and time that the job was created (timestamp).
*
*
* @return The date and time that the job was created (timestamp).
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The date and time that the job was last modified (timestamp).
*
*
* @return The date and time that the job was last modified (timestamp).
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
/**
*
* The current status of the labeling job.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #labelingJobStatus}
* will return {@link LabelingJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #labelingJobStatusAsString}.
*
*
* @return The current status of the labeling job.
* @see LabelingJobStatus
*/
public final LabelingJobStatus labelingJobStatus() {
return LabelingJobStatus.fromValue(labelingJobStatus);
}
/**
*
* The current status of the labeling job.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #labelingJobStatus}
* will return {@link LabelingJobStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #labelingJobStatusAsString}.
*
*
* @return The current status of the labeling job.
* @see LabelingJobStatus
*/
public final String labelingJobStatusAsString() {
return labelingJobStatus;
}
/**
*
* Counts showing the progress of the labeling job.
*
*
* @return Counts showing the progress of the labeling job.
*/
public final LabelCounters labelCounters() {
return labelCounters;
}
/**
*
* The Amazon Resource Name (ARN) of the work team assigned to the job.
*
*
* @return The Amazon Resource Name (ARN) of the work team assigned to the job.
*/
public final String workteamArn() {
return workteamArn;
}
/**
*
* The Amazon Resource Name (ARN) of a Lambda function. The function is run before each data object is sent to a
* worker.
*
*
* @return The Amazon Resource Name (ARN) of a Lambda function. The function is run before each data object is sent
* to a worker.
*/
public final String preHumanTaskLambdaArn() {
return preHumanTaskLambdaArn;
}
/**
*
* The Amazon Resource Name (ARN) of the Lambda function used to consolidate the annotations from individual workers
* into a label for a data object. For more information, see Annotation
* Consolidation.
*
*
* @return The Amazon Resource Name (ARN) of the Lambda function used to consolidate the annotations from individual
* workers into a label for a data object. For more information, see Annotation
* Consolidation.
*/
public final String annotationConsolidationLambdaArn() {
return annotationConsolidationLambdaArn;
}
/**
*
* If the LabelingJobStatus
field is Failed
, this field contains a description of the
* error.
*
*
* @return If the LabelingJobStatus
field is Failed
, this field contains a description of
* the error.
*/
public final String failureReason() {
return failureReason;
}
/**
*
* The location of the output produced by the labeling job.
*
*
* @return The location of the output produced by the labeling job.
*/
public final LabelingJobOutput labelingJobOutput() {
return labelingJobOutput;
}
/**
*
* Input configuration for the labeling job.
*
*
* @return Input configuration for the labeling job.
*/
public final LabelingJobInputConfig inputConfig() {
return inputConfig;
}
@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(labelingJobName());
hashCode = 31 * hashCode + Objects.hashCode(labelingJobArn());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
hashCode = 31 * hashCode + Objects.hashCode(labelingJobStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(labelCounters());
hashCode = 31 * hashCode + Objects.hashCode(workteamArn());
hashCode = 31 * hashCode + Objects.hashCode(preHumanTaskLambdaArn());
hashCode = 31 * hashCode + Objects.hashCode(annotationConsolidationLambdaArn());
hashCode = 31 * hashCode + Objects.hashCode(failureReason());
hashCode = 31 * hashCode + Objects.hashCode(labelingJobOutput());
hashCode = 31 * hashCode + Objects.hashCode(inputConfig());
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 LabelingJobSummary)) {
return false;
}
LabelingJobSummary other = (LabelingJobSummary) obj;
return Objects.equals(labelingJobName(), other.labelingJobName())
&& Objects.equals(labelingJobArn(), other.labelingJobArn())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime())
&& Objects.equals(labelingJobStatusAsString(), other.labelingJobStatusAsString())
&& Objects.equals(labelCounters(), other.labelCounters()) && Objects.equals(workteamArn(), other.workteamArn())
&& Objects.equals(preHumanTaskLambdaArn(), other.preHumanTaskLambdaArn())
&& Objects.equals(annotationConsolidationLambdaArn(), other.annotationConsolidationLambdaArn())
&& Objects.equals(failureReason(), other.failureReason())
&& Objects.equals(labelingJobOutput(), other.labelingJobOutput())
&& Objects.equals(inputConfig(), other.inputConfig());
}
/**
* 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("LabelingJobSummary").add("LabelingJobName", labelingJobName())
.add("LabelingJobArn", labelingJobArn()).add("CreationTime", creationTime())
.add("LastModifiedTime", lastModifiedTime()).add("LabelingJobStatus", labelingJobStatusAsString())
.add("LabelCounters", labelCounters()).add("WorkteamArn", workteamArn())
.add("PreHumanTaskLambdaArn", preHumanTaskLambdaArn())
.add("AnnotationConsolidationLambdaArn", annotationConsolidationLambdaArn())
.add("FailureReason", failureReason()).add("LabelingJobOutput", labelingJobOutput())
.add("InputConfig", inputConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "LabelingJobName":
return Optional.ofNullable(clazz.cast(labelingJobName()));
case "LabelingJobArn":
return Optional.ofNullable(clazz.cast(labelingJobArn()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
case "LabelingJobStatus":
return Optional.ofNullable(clazz.cast(labelingJobStatusAsString()));
case "LabelCounters":
return Optional.ofNullable(clazz.cast(labelCounters()));
case "WorkteamArn":
return Optional.ofNullable(clazz.cast(workteamArn()));
case "PreHumanTaskLambdaArn":
return Optional.ofNullable(clazz.cast(preHumanTaskLambdaArn()));
case "AnnotationConsolidationLambdaArn":
return Optional.ofNullable(clazz.cast(annotationConsolidationLambdaArn()));
case "FailureReason":
return Optional.ofNullable(clazz.cast(failureReason()));
case "LabelingJobOutput":
return Optional.ofNullable(clazz.cast(labelingJobOutput()));
case "InputConfig":
return Optional.ofNullable(clazz.cast(inputConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function