software.amazon.awssdk.services.sagemaker.model.CanvasAppSettings 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.Collection;
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 java.util.stream.Collectors;
import java.util.stream.Stream;
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.ListTrait;
import software.amazon.awssdk.core.traits.LocationTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* The SageMaker Canvas application settings.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class CanvasAppSettings implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField TIME_SERIES_FORECASTING_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("TimeSeriesForecastingSettings")
.getter(getter(CanvasAppSettings::timeSeriesForecastingSettings))
.setter(setter(Builder::timeSeriesForecastingSettings))
.constructor(TimeSeriesForecastingSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TimeSeriesForecastingSettings")
.build()).build();
private static final SdkField MODEL_REGISTER_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("ModelRegisterSettings")
.getter(getter(CanvasAppSettings::modelRegisterSettings)).setter(setter(Builder::modelRegisterSettings))
.constructor(ModelRegisterSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelRegisterSettings").build())
.build();
private static final SdkField WORKSPACE_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("WorkspaceSettings")
.getter(getter(CanvasAppSettings::workspaceSettings)).setter(setter(Builder::workspaceSettings))
.constructor(WorkspaceSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WorkspaceSettings").build()).build();
private static final SdkField> IDENTITY_PROVIDER_O_AUTH_SETTINGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("IdentityProviderOAuthSettings")
.getter(getter(CanvasAppSettings::identityProviderOAuthSettings))
.setter(setter(Builder::identityProviderOAuthSettings))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("IdentityProviderOAuthSettings")
.build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(IdentityProviderOAuthSetting::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField DIRECT_DEPLOY_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DirectDeploySettings")
.getter(getter(CanvasAppSettings::directDeploySettings)).setter(setter(Builder::directDeploySettings))
.constructor(DirectDeploySettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DirectDeploySettings").build())
.build();
private static final SdkField KENDRA_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("KendraSettings")
.getter(getter(CanvasAppSettings::kendraSettings)).setter(setter(Builder::kendraSettings))
.constructor(KendraSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("KendraSettings").build()).build();
private static final SdkField GENERATIVE_AI_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("GenerativeAiSettings")
.getter(getter(CanvasAppSettings::generativeAiSettings)).setter(setter(Builder::generativeAiSettings))
.constructor(GenerativeAiSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GenerativeAiSettings").build())
.build();
private static final SdkField EMR_SERVERLESS_SETTINGS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("EmrServerlessSettings")
.getter(getter(CanvasAppSettings::emrServerlessSettings)).setter(setter(Builder::emrServerlessSettings))
.constructor(EmrServerlessSettings::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EmrServerlessSettings").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
TIME_SERIES_FORECASTING_SETTINGS_FIELD, MODEL_REGISTER_SETTINGS_FIELD, WORKSPACE_SETTINGS_FIELD,
IDENTITY_PROVIDER_O_AUTH_SETTINGS_FIELD, DIRECT_DEPLOY_SETTINGS_FIELD, KENDRA_SETTINGS_FIELD,
GENERATIVE_AI_SETTINGS_FIELD, EMR_SERVERLESS_SETTINGS_FIELD));
private static final long serialVersionUID = 1L;
private final TimeSeriesForecastingSettings timeSeriesForecastingSettings;
private final ModelRegisterSettings modelRegisterSettings;
private final WorkspaceSettings workspaceSettings;
private final List identityProviderOAuthSettings;
private final DirectDeploySettings directDeploySettings;
private final KendraSettings kendraSettings;
private final GenerativeAiSettings generativeAiSettings;
private final EmrServerlessSettings emrServerlessSettings;
private CanvasAppSettings(BuilderImpl builder) {
this.timeSeriesForecastingSettings = builder.timeSeriesForecastingSettings;
this.modelRegisterSettings = builder.modelRegisterSettings;
this.workspaceSettings = builder.workspaceSettings;
this.identityProviderOAuthSettings = builder.identityProviderOAuthSettings;
this.directDeploySettings = builder.directDeploySettings;
this.kendraSettings = builder.kendraSettings;
this.generativeAiSettings = builder.generativeAiSettings;
this.emrServerlessSettings = builder.emrServerlessSettings;
}
/**
*
* Time series forecast settings for the SageMaker Canvas application.
*
*
* @return Time series forecast settings for the SageMaker Canvas application.
*/
public final TimeSeriesForecastingSettings timeSeriesForecastingSettings() {
return timeSeriesForecastingSettings;
}
/**
*
* The model registry settings for the SageMaker Canvas application.
*
*
* @return The model registry settings for the SageMaker Canvas application.
*/
public final ModelRegisterSettings modelRegisterSettings() {
return modelRegisterSettings;
}
/**
*
* The workspace settings for the SageMaker Canvas application.
*
*
* @return The workspace settings for the SageMaker Canvas application.
*/
public final WorkspaceSettings workspaceSettings() {
return workspaceSettings;
}
/**
* For responses, this returns true if the service returned a value for the IdentityProviderOAuthSettings property.
* This DOES NOT check that the value is non-empty (for which, you should check the {@code isEmpty()} method on the
* property). This is useful because the SDK will never return a null collection or map, but you may need to
* differentiate between the service returning nothing (or null) and the service returning an empty collection or
* map. For requests, this returns true if a value for the property was specified in the request builder, and false
* if a value was not specified.
*/
public final boolean hasIdentityProviderOAuthSettings() {
return identityProviderOAuthSettings != null && !(identityProviderOAuthSettings instanceof SdkAutoConstructList);
}
/**
*
* The settings for connecting to an external data source with OAuth.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* This method will never return null. If you would like to know whether the service returned this field (so that
* you can differentiate between null and empty), you can use the {@link #hasIdentityProviderOAuthSettings} method.
*
*
* @return The settings for connecting to an external data source with OAuth.
*/
public final List identityProviderOAuthSettings() {
return identityProviderOAuthSettings;
}
/**
*
* The model deployment settings for the SageMaker Canvas application.
*
*
* @return The model deployment settings for the SageMaker Canvas application.
*/
public final DirectDeploySettings directDeploySettings() {
return directDeploySettings;
}
/**
*
* The settings for document querying.
*
*
* @return The settings for document querying.
*/
public final KendraSettings kendraSettings() {
return kendraSettings;
}
/**
*
* The generative AI settings for the SageMaker Canvas application.
*
*
* @return The generative AI settings for the SageMaker Canvas application.
*/
public final GenerativeAiSettings generativeAiSettings() {
return generativeAiSettings;
}
/**
*
* The settings for running Amazon EMR Serverless data processing jobs in SageMaker Canvas.
*
*
* @return The settings for running Amazon EMR Serverless data processing jobs in SageMaker Canvas.
*/
public final EmrServerlessSettings emrServerlessSettings() {
return emrServerlessSettings;
}
@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(timeSeriesForecastingSettings());
hashCode = 31 * hashCode + Objects.hashCode(modelRegisterSettings());
hashCode = 31 * hashCode + Objects.hashCode(workspaceSettings());
hashCode = 31 * hashCode + Objects.hashCode(hasIdentityProviderOAuthSettings() ? identityProviderOAuthSettings() : null);
hashCode = 31 * hashCode + Objects.hashCode(directDeploySettings());
hashCode = 31 * hashCode + Objects.hashCode(kendraSettings());
hashCode = 31 * hashCode + Objects.hashCode(generativeAiSettings());
hashCode = 31 * hashCode + Objects.hashCode(emrServerlessSettings());
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 CanvasAppSettings)) {
return false;
}
CanvasAppSettings other = (CanvasAppSettings) obj;
return Objects.equals(timeSeriesForecastingSettings(), other.timeSeriesForecastingSettings())
&& Objects.equals(modelRegisterSettings(), other.modelRegisterSettings())
&& Objects.equals(workspaceSettings(), other.workspaceSettings())
&& hasIdentityProviderOAuthSettings() == other.hasIdentityProviderOAuthSettings()
&& Objects.equals(identityProviderOAuthSettings(), other.identityProviderOAuthSettings())
&& Objects.equals(directDeploySettings(), other.directDeploySettings())
&& Objects.equals(kendraSettings(), other.kendraSettings())
&& Objects.equals(generativeAiSettings(), other.generativeAiSettings())
&& Objects.equals(emrServerlessSettings(), other.emrServerlessSettings());
}
/**
* 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("CanvasAppSettings")
.add("TimeSeriesForecastingSettings", timeSeriesForecastingSettings())
.add("ModelRegisterSettings", modelRegisterSettings())
.add("WorkspaceSettings", workspaceSettings())
.add("IdentityProviderOAuthSettings", hasIdentityProviderOAuthSettings() ? identityProviderOAuthSettings() : null)
.add("DirectDeploySettings", directDeploySettings()).add("KendraSettings", kendraSettings())
.add("GenerativeAiSettings", generativeAiSettings()).add("EmrServerlessSettings", emrServerlessSettings())
.build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TimeSeriesForecastingSettings":
return Optional.ofNullable(clazz.cast(timeSeriesForecastingSettings()));
case "ModelRegisterSettings":
return Optional.ofNullable(clazz.cast(modelRegisterSettings()));
case "WorkspaceSettings":
return Optional.ofNullable(clazz.cast(workspaceSettings()));
case "IdentityProviderOAuthSettings":
return Optional.ofNullable(clazz.cast(identityProviderOAuthSettings()));
case "DirectDeploySettings":
return Optional.ofNullable(clazz.cast(directDeploySettings()));
case "KendraSettings":
return Optional.ofNullable(clazz.cast(kendraSettings()));
case "GenerativeAiSettings":
return Optional.ofNullable(clazz.cast(generativeAiSettings()));
case "EmrServerlessSettings":
return Optional.ofNullable(clazz.cast(emrServerlessSettings()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function