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

software.amazon.awssdk.services.sagemaker.model.SharingSettings 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.28.4
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.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;

/**
 * 

* Specifies options for sharing Amazon SageMaker Studio notebooks. These settings are specified as part of * DefaultUserSettings when the CreateDomain API is called, and as part of * UserSettings when the CreateUserProfile API is called. When SharingSettings is * not specified, notebook sharing isn't allowed. *

*/ @Generated("software.amazon.awssdk:codegen") public final class SharingSettings implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NOTEBOOK_OUTPUT_OPTION_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("NotebookOutputOption").getter(getter(SharingSettings::notebookOutputOptionAsString)) .setter(setter(Builder::notebookOutputOption)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NotebookOutputOption").build()) .build(); private static final SdkField S3_OUTPUT_PATH_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("S3OutputPath").getter(getter(SharingSettings::s3OutputPath)).setter(setter(Builder::s3OutputPath)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3OutputPath").build()).build(); private static final SdkField S3_KMS_KEY_ID_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("S3KmsKeyId").getter(getter(SharingSettings::s3KmsKeyId)).setter(setter(Builder::s3KmsKeyId)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3KmsKeyId").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NOTEBOOK_OUTPUT_OPTION_FIELD, S3_OUTPUT_PATH_FIELD, S3_KMS_KEY_ID_FIELD)); private static final long serialVersionUID = 1L; private final String notebookOutputOption; private final String s3OutputPath; private final String s3KmsKeyId; private SharingSettings(BuilderImpl builder) { this.notebookOutputOption = builder.notebookOutputOption; this.s3OutputPath = builder.s3OutputPath; this.s3KmsKeyId = builder.s3KmsKeyId; } /** *

* Whether to include the notebook cell output when sharing the notebook. The default is Disabled. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #notebookOutputOption} will return {@link NotebookOutputOption#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #notebookOutputOptionAsString}. *

* * @return Whether to include the notebook cell output when sharing the notebook. The default is * Disabled. * @see NotebookOutputOption */ public final NotebookOutputOption notebookOutputOption() { return NotebookOutputOption.fromValue(notebookOutputOption); } /** *

* Whether to include the notebook cell output when sharing the notebook. The default is Disabled. *

*

* If the service returns an enum value that is not available in the current SDK version, * {@link #notebookOutputOption} will return {@link NotebookOutputOption#UNKNOWN_TO_SDK_VERSION}. The raw value * returned by the service is available from {@link #notebookOutputOptionAsString}. *

* * @return Whether to include the notebook cell output when sharing the notebook. The default is * Disabled. * @see NotebookOutputOption */ public final String notebookOutputOptionAsString() { return notebookOutputOption; } /** *

* When NotebookOutputOption is Allowed, the Amazon S3 bucket used to store the shared * notebook snapshots. *

* * @return When NotebookOutputOption is Allowed, the Amazon S3 bucket used to store the * shared notebook snapshots. */ public final String s3OutputPath() { return s3OutputPath; } /** *

* When NotebookOutputOption is Allowed, the Amazon Web Services Key Management Service * (KMS) encryption key ID used to encrypt the notebook cell output in the Amazon S3 bucket. *

* * @return When NotebookOutputOption is Allowed, the Amazon Web Services Key Management * Service (KMS) encryption key ID used to encrypt the notebook cell output in the Amazon S3 bucket. */ public final String s3KmsKeyId() { return s3KmsKeyId; } @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(notebookOutputOptionAsString()); hashCode = 31 * hashCode + Objects.hashCode(s3OutputPath()); hashCode = 31 * hashCode + Objects.hashCode(s3KmsKeyId()); 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 SharingSettings)) { return false; } SharingSettings other = (SharingSettings) obj; return Objects.equals(notebookOutputOptionAsString(), other.notebookOutputOptionAsString()) && Objects.equals(s3OutputPath(), other.s3OutputPath()) && Objects.equals(s3KmsKeyId(), other.s3KmsKeyId()); } /** * 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("SharingSettings").add("NotebookOutputOption", notebookOutputOptionAsString()) .add("S3OutputPath", s3OutputPath()).add("S3KmsKeyId", s3KmsKeyId()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "NotebookOutputOption": return Optional.ofNullable(clazz.cast(notebookOutputOptionAsString())); case "S3OutputPath": return Optional.ofNullable(clazz.cast(s3OutputPath())); case "S3KmsKeyId": return Optional.ofNullable(clazz.cast(s3KmsKeyId())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((SharingSettings) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

* Whether to include the notebook cell output when sharing the notebook. The default is Disabled. *

* * @param notebookOutputOption * Whether to include the notebook cell output when sharing the notebook. The default is * Disabled. * @see NotebookOutputOption * @return Returns a reference to this object so that method calls can be chained together. * @see NotebookOutputOption */ Builder notebookOutputOption(String notebookOutputOption); /** *

* Whether to include the notebook cell output when sharing the notebook. The default is Disabled. *

* * @param notebookOutputOption * Whether to include the notebook cell output when sharing the notebook. The default is * Disabled. * @see NotebookOutputOption * @return Returns a reference to this object so that method calls can be chained together. * @see NotebookOutputOption */ Builder notebookOutputOption(NotebookOutputOption notebookOutputOption); /** *

* When NotebookOutputOption is Allowed, the Amazon S3 bucket used to store the shared * notebook snapshots. *

* * @param s3OutputPath * When NotebookOutputOption is Allowed, the Amazon S3 bucket used to store the * shared notebook snapshots. * @return Returns a reference to this object so that method calls can be chained together. */ Builder s3OutputPath(String s3OutputPath); /** *

* When NotebookOutputOption is Allowed, the Amazon Web Services Key Management * Service (KMS) encryption key ID used to encrypt the notebook cell output in the Amazon S3 bucket. *

* * @param s3KmsKeyId * When NotebookOutputOption is Allowed, the Amazon Web Services Key Management * Service (KMS) encryption key ID used to encrypt the notebook cell output in the Amazon S3 bucket. * @return Returns a reference to this object so that method calls can be chained together. */ Builder s3KmsKeyId(String s3KmsKeyId); } static final class BuilderImpl implements Builder { private String notebookOutputOption; private String s3OutputPath; private String s3KmsKeyId; private BuilderImpl() { } private BuilderImpl(SharingSettings model) { notebookOutputOption(model.notebookOutputOption); s3OutputPath(model.s3OutputPath); s3KmsKeyId(model.s3KmsKeyId); } public final String getNotebookOutputOption() { return notebookOutputOption; } public final void setNotebookOutputOption(String notebookOutputOption) { this.notebookOutputOption = notebookOutputOption; } @Override public final Builder notebookOutputOption(String notebookOutputOption) { this.notebookOutputOption = notebookOutputOption; return this; } @Override public final Builder notebookOutputOption(NotebookOutputOption notebookOutputOption) { this.notebookOutputOption(notebookOutputOption == null ? null : notebookOutputOption.toString()); return this; } public final String getS3OutputPath() { return s3OutputPath; } public final void setS3OutputPath(String s3OutputPath) { this.s3OutputPath = s3OutputPath; } @Override public final Builder s3OutputPath(String s3OutputPath) { this.s3OutputPath = s3OutputPath; return this; } public final String getS3KmsKeyId() { return s3KmsKeyId; } public final void setS3KmsKeyId(String s3KmsKeyId) { this.s3KmsKeyId = s3KmsKeyId; } @Override public final Builder s3KmsKeyId(String s3KmsKeyId) { this.s3KmsKeyId = s3KmsKeyId; return this; } @Override public SharingSettings build() { return new SharingSettings(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy