
software.amazon.awssdk.services.sagemaker.model.OfflineStoreConfig 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;
/**
*
* The configuration of an OfflineStore
.
*
*
* Provide an OfflineStoreConfig
in a request to CreateFeatureGroup
to create an
* OfflineStore
.
*
*
* To encrypt an OfflineStore
using at rest data encryption, specify Amazon Web Services Key Management
* Service (KMS) key ID, or KMSKeyId
, in S3StorageConfig
.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class OfflineStoreConfig implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField S3_STORAGE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("S3StorageConfig")
.getter(getter(OfflineStoreConfig::s3StorageConfig)).setter(setter(Builder::s3StorageConfig))
.constructor(S3StorageConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("S3StorageConfig").build()).build();
private static final SdkField DISABLE_GLUE_TABLE_CREATION_FIELD = SdkField
. builder(MarshallingType.BOOLEAN).memberName("DisableGlueTableCreation")
.getter(getter(OfflineStoreConfig::disableGlueTableCreation)).setter(setter(Builder::disableGlueTableCreation))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisableGlueTableCreation").build())
.build();
private static final SdkField DATA_CATALOG_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DataCatalogConfig")
.getter(getter(OfflineStoreConfig::dataCatalogConfig)).setter(setter(Builder::dataCatalogConfig))
.constructor(DataCatalogConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataCatalogConfig").build()).build();
private static final SdkField TABLE_FORMAT_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("TableFormat").getter(getter(OfflineStoreConfig::tableFormatAsString))
.setter(setter(Builder::tableFormat))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TableFormat").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(S3_STORAGE_CONFIG_FIELD,
DISABLE_GLUE_TABLE_CREATION_FIELD, DATA_CATALOG_CONFIG_FIELD, TABLE_FORMAT_FIELD));
private static final long serialVersionUID = 1L;
private final S3StorageConfig s3StorageConfig;
private final Boolean disableGlueTableCreation;
private final DataCatalogConfig dataCatalogConfig;
private final String tableFormat;
private OfflineStoreConfig(BuilderImpl builder) {
this.s3StorageConfig = builder.s3StorageConfig;
this.disableGlueTableCreation = builder.disableGlueTableCreation;
this.dataCatalogConfig = builder.dataCatalogConfig;
this.tableFormat = builder.tableFormat;
}
/**
*
* The Amazon Simple Storage (Amazon S3) location of OfflineStore
.
*
*
* @return The Amazon Simple Storage (Amazon S3) location of OfflineStore
.
*/
public final S3StorageConfig s3StorageConfig() {
return s3StorageConfig;
}
/**
*
* Set to True
to disable the automatic creation of an Amazon Web Services Glue table when configuring
* an OfflineStore
. If set to False
, Feature Store will name the OfflineStore
* Glue table following Athena's naming
* recommendations.
*
*
* The default value is False
.
*
*
* @return Set to True
to disable the automatic creation of an Amazon Web Services Glue table when
* configuring an OfflineStore
. If set to False
, Feature Store will name the
* OfflineStore
Glue table following Athena's naming
* recommendations.
*
* The default value is False
.
*/
public final Boolean disableGlueTableCreation() {
return disableGlueTableCreation;
}
/**
*
* The meta data of the Glue table that is autogenerated when an OfflineStore
is created.
*
*
* @return The meta data of the Glue table that is autogenerated when an OfflineStore
is created.
*/
public final DataCatalogConfig dataCatalogConfig() {
return dataCatalogConfig;
}
/**
*
* Format for the offline store table. Supported formats are Glue (Default) and Apache Iceberg.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #tableFormat} will
* return {@link TableFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #tableFormatAsString}.
*
*
* @return Format for the offline store table. Supported formats are Glue (Default) and Apache Iceberg.
* @see TableFormat
*/
public final TableFormat tableFormat() {
return TableFormat.fromValue(tableFormat);
}
/**
*
* Format for the offline store table. Supported formats are Glue (Default) and Apache Iceberg.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #tableFormat} will
* return {@link TableFormat#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #tableFormatAsString}.
*
*
* @return Format for the offline store table. Supported formats are Glue (Default) and Apache Iceberg.
* @see TableFormat
*/
public final String tableFormatAsString() {
return tableFormat;
}
@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(s3StorageConfig());
hashCode = 31 * hashCode + Objects.hashCode(disableGlueTableCreation());
hashCode = 31 * hashCode + Objects.hashCode(dataCatalogConfig());
hashCode = 31 * hashCode + Objects.hashCode(tableFormatAsString());
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 OfflineStoreConfig)) {
return false;
}
OfflineStoreConfig other = (OfflineStoreConfig) obj;
return Objects.equals(s3StorageConfig(), other.s3StorageConfig())
&& Objects.equals(disableGlueTableCreation(), other.disableGlueTableCreation())
&& Objects.equals(dataCatalogConfig(), other.dataCatalogConfig())
&& Objects.equals(tableFormatAsString(), other.tableFormatAsString());
}
/**
* 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("OfflineStoreConfig").add("S3StorageConfig", s3StorageConfig())
.add("DisableGlueTableCreation", disableGlueTableCreation()).add("DataCatalogConfig", dataCatalogConfig())
.add("TableFormat", tableFormatAsString()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "S3StorageConfig":
return Optional.ofNullable(clazz.cast(s3StorageConfig()));
case "DisableGlueTableCreation":
return Optional.ofNullable(clazz.cast(disableGlueTableCreation()));
case "DataCatalogConfig":
return Optional.ofNullable(clazz.cast(dataCatalogConfig()));
case "TableFormat":
return Optional.ofNullable(clazz.cast(tableFormatAsString()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function