All Downloads are FREE. Search and download functionalities are using the official Maven repository.

software.amazon.awssdk.services.sagemaker.model.LabelingJobResourceConfig Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SageMaker module holds the client classes that are used for communicating with Amazon SageMaker Service

There is a newer version: 2.29.39
Show newest version
/*
 * 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 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 getter(Function g) { return obj -> g.apply((LabelingJobResourceConfig) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * 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" *

      *
    • *
    * * @param volumeKmsKeyId * 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 Returns a reference to this object so that method calls can be chained together. */ Builder volumeKmsKeyId(String volumeKmsKeyId); /** * Sets the value of the VpcConfig property for this object. * * @param vpcConfig * The new value for the VpcConfig property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder vpcConfig(VpcConfig vpcConfig); /** * Sets the value of the VpcConfig property for this object. * * This is a convenience method that creates an instance of the {@link VpcConfig.Builder} avoiding the need to * create one manually via {@link VpcConfig#builder()}. * *

      * When the {@link Consumer} completes, {@link VpcConfig.Builder#build()} is called immediately and its result * is passed to {@link #vpcConfig(VpcConfig)}. * * @param vpcConfig * a consumer that will call methods on {@link VpcConfig.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #vpcConfig(VpcConfig) */ default Builder vpcConfig(Consumer vpcConfig) { return vpcConfig(VpcConfig.builder().applyMutation(vpcConfig).build()); } } static final class BuilderImpl implements Builder { private String volumeKmsKeyId; private VpcConfig vpcConfig; private BuilderImpl() { } private BuilderImpl(LabelingJobResourceConfig model) { volumeKmsKeyId(model.volumeKmsKeyId); vpcConfig(model.vpcConfig); } public final String getVolumeKmsKeyId() { return volumeKmsKeyId; } public final void setVolumeKmsKeyId(String volumeKmsKeyId) { this.volumeKmsKeyId = volumeKmsKeyId; } @Override public final Builder volumeKmsKeyId(String volumeKmsKeyId) { this.volumeKmsKeyId = volumeKmsKeyId; return this; } public final VpcConfig.Builder getVpcConfig() { return vpcConfig != null ? vpcConfig.toBuilder() : null; } public final void setVpcConfig(VpcConfig.BuilderImpl vpcConfig) { this.vpcConfig = vpcConfig != null ? vpcConfig.build() : null; } @Override public final Builder vpcConfig(VpcConfig vpcConfig) { this.vpcConfig = vpcConfig; return this; } @Override public LabelingJobResourceConfig build() { return new LabelingJobResourceConfig(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy