software.amazon.awssdk.services.sagemaker.model.LabelingJobAlgorithmsConfig Maven / Gradle / Ivy
/*
* 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.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 configuration information for auto-labeling of your data objects. A LabelingJobAlgorithmsConfig
* object must be supplied in order to use auto-labeling.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class LabelingJobAlgorithmsConfig implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField LABELING_JOB_ALGORITHM_SPECIFICATION_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("LabelingJobAlgorithmSpecificationArn")
.getter(getter(LabelingJobAlgorithmsConfig::labelingJobAlgorithmSpecificationArn))
.setter(setter(Builder::labelingJobAlgorithmSpecificationArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("LabelingJobAlgorithmSpecificationArn").build()).build();
private static final SdkField INITIAL_ACTIVE_LEARNING_MODEL_ARN_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("InitialActiveLearningModelArn")
.getter(getter(LabelingJobAlgorithmsConfig::initialActiveLearningModelArn))
.setter(setter(Builder::initialActiveLearningModelArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InitialActiveLearningModelArn")
.build()).build();
private static final SdkField LABELING_JOB_RESOURCE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("LabelingJobResourceConfig")
.getter(getter(LabelingJobAlgorithmsConfig::labelingJobResourceConfig))
.setter(setter(Builder::labelingJobResourceConfig)).constructor(LabelingJobResourceConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LabelingJobResourceConfig").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
LABELING_JOB_ALGORITHM_SPECIFICATION_ARN_FIELD, INITIAL_ACTIVE_LEARNING_MODEL_ARN_FIELD,
LABELING_JOB_RESOURCE_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final String labelingJobAlgorithmSpecificationArn;
private final String initialActiveLearningModelArn;
private final LabelingJobResourceConfig labelingJobResourceConfig;
private LabelingJobAlgorithmsConfig(BuilderImpl builder) {
this.labelingJobAlgorithmSpecificationArn = builder.labelingJobAlgorithmSpecificationArn;
this.initialActiveLearningModelArn = builder.initialActiveLearningModelArn;
this.labelingJobResourceConfig = builder.labelingJobResourceConfig;
}
/**
*
* Specifies the Amazon Resource Name (ARN) of the algorithm used for auto-labeling. You must select one of the
* following ARNs:
*
*
* -
*
* Image classification
*
*
* arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/image-classification
*
*
* -
*
* Text classification
*
*
* arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/text-classification
*
*
* -
*
* Object detection
*
*
* arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/object-detection
*
*
* -
*
* Semantic Segmentation
*
*
* arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/semantic-segmentation
*
*
*
*
* @return Specifies the Amazon Resource Name (ARN) of the algorithm used for auto-labeling. You must select one of
* the following ARNs:
*
* -
*
* Image classification
*
*
* arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/image-classification
*
*
* -
*
* Text classification
*
*
* arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/text-classification
*
*
* -
*
* Object detection
*
*
* arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/object-detection
*
*
* -
*
* Semantic Segmentation
*
*
* arn:aws:sagemaker:region:027400017018:labeling-job-algorithm-specification/semantic-segmentation
*
*
*/
public final String labelingJobAlgorithmSpecificationArn() {
return labelingJobAlgorithmSpecificationArn;
}
/**
*
* At the end of an auto-label job Ground Truth sends the Amazon Resource Name (ARN) of the final model used for
* auto-labeling. You can use this model as the starting point for subsequent similar jobs by providing the ARN of
* the model here.
*
*
* @return At the end of an auto-label job Ground Truth sends the Amazon Resource Name (ARN) of the final model used
* for auto-labeling. You can use this model as the starting point for subsequent similar jobs by providing
* the ARN of the model here.
*/
public final String initialActiveLearningModelArn() {
return initialActiveLearningModelArn;
}
/**
*
* Provides configuration information for a labeling job.
*
*
* @return Provides configuration information for a labeling job.
*/
public final LabelingJobResourceConfig labelingJobResourceConfig() {
return labelingJobResourceConfig;
}
@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(labelingJobAlgorithmSpecificationArn());
hashCode = 31 * hashCode + Objects.hashCode(initialActiveLearningModelArn());
hashCode = 31 * hashCode + Objects.hashCode(labelingJobResourceConfig());
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 LabelingJobAlgorithmsConfig)) {
return false;
}
LabelingJobAlgorithmsConfig other = (LabelingJobAlgorithmsConfig) obj;
return Objects.equals(labelingJobAlgorithmSpecificationArn(), other.labelingJobAlgorithmSpecificationArn())
&& Objects.equals(initialActiveLearningModelArn(), other.initialActiveLearningModelArn())
&& Objects.equals(labelingJobResourceConfig(), other.labelingJobResourceConfig());
}
/**
* 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("LabelingJobAlgorithmsConfig")
.add("LabelingJobAlgorithmSpecificationArn", labelingJobAlgorithmSpecificationArn())
.add("InitialActiveLearningModelArn", initialActiveLearningModelArn())
.add("LabelingJobResourceConfig", labelingJobResourceConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "LabelingJobAlgorithmSpecificationArn":
return Optional.ofNullable(clazz.cast(labelingJobAlgorithmSpecificationArn()));
case "InitialActiveLearningModelArn":
return Optional.ofNullable(clazz.cast(initialActiveLearningModelArn()));
case "LabelingJobResourceConfig":
return Optional.ofNullable(clazz.cast(labelingJobResourceConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function