software.amazon.awssdk.services.sagemaker.model.LabelingJobResourceConfig 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.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;
/**
*
* Configure encryption on the storage volume attached to the ML compute instance used to run automated data labeling
* model training and inference.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class LabelingJobResourceConfig implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField VOLUME_KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("VolumeKmsKeyId").getter(getter(LabelingJobResourceConfig::volumeKmsKeyId))
.setter(setter(Builder::volumeKmsKeyId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VolumeKmsKeyId").build()).build();
private static final SdkField VPC_CONFIG_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
.memberName("VpcConfig").getter(getter(LabelingJobResourceConfig::vpcConfig)).setter(setter(Builder::vpcConfig))
.constructor(VpcConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("VpcConfig").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(VOLUME_KMS_KEY_ID_FIELD,
VPC_CONFIG_FIELD));
private static final long serialVersionUID = 1L;
private final String volumeKmsKeyId;
private final VpcConfig vpcConfig;
private LabelingJobResourceConfig(BuilderImpl builder) {
this.volumeKmsKeyId = builder.volumeKmsKeyId;
this.vpcConfig = builder.vpcConfig;
}
/**
*
* The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker uses to
* encrypt data on the storage volume attached to the ML compute instance(s) that run the training and inference
* jobs used for automated data labeling.
*
*
* You can only specify a VolumeKmsKeyId
when you create a labeling job with automated data labeling
* enabled using the API operation CreateLabelingJob
. You cannot specify an Amazon Web Services KMS key
* to encrypt the storage volume used for automated data labeling model training and inference when you create a
* labeling job using the console. To learn more, see Output Data and Storage Volume
* Encryption.
*
*
* The VolumeKmsKeyId
can be any of the following formats:
*
*
* -
*
* KMS Key ID
*
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
*
* -
*
* Amazon Resource Name (ARN) of a KMS Key
*
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
*
*
*
* @return The Amazon Web Services Key Management Service (Amazon Web Services KMS) key that Amazon SageMaker uses
* to encrypt data on the storage volume attached to the ML compute instance(s) that run the training and
* inference jobs used for automated data labeling.
*
* You can only specify a VolumeKmsKeyId
when you create a labeling job with automated data
* labeling enabled using the API operation CreateLabelingJob
. You cannot specify an Amazon Web
* Services KMS key to encrypt the storage volume used for automated data labeling model training and
* inference when you create a labeling job using the console. To learn more, see Output Data and Storage Volume
* Encryption.
*
*
* The VolumeKmsKeyId
can be any of the following formats:
*
*
* -
*
* KMS Key ID
*
*
* "1234abcd-12ab-34cd-56ef-1234567890ab"
*
*
* -
*
* Amazon Resource Name (ARN) of a KMS Key
*
*
* "arn:aws:kms:us-west-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab"
*
*
*/
public final String volumeKmsKeyId() {
return volumeKmsKeyId;
}
/**
* Returns the value of the VpcConfig property for this object.
*
* @return The value of the VpcConfig property for this object.
*/
public final VpcConfig vpcConfig() {
return vpcConfig;
}
@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(volumeKmsKeyId());
hashCode = 31 * hashCode + Objects.hashCode(vpcConfig());
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 LabelingJobResourceConfig)) {
return false;
}
LabelingJobResourceConfig other = (LabelingJobResourceConfig) obj;
return Objects.equals(volumeKmsKeyId(), other.volumeKmsKeyId()) && Objects.equals(vpcConfig(), other.vpcConfig());
}
/**
* 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("LabelingJobResourceConfig").add("VolumeKmsKeyId", volumeKmsKeyId())
.add("VpcConfig", vpcConfig()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "VolumeKmsKeyId":
return Optional.ofNullable(clazz.cast(volumeKmsKeyId()));
case "VpcConfig":
return Optional.ofNullable(clazz.cast(vpcConfig()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function