software.amazon.awssdk.services.sagemaker.model.FeatureGroupSummary 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.time.Instant;
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 name, ARN, CreationTime
, FeatureGroup
values, LastUpdatedTime
and
* EnableOnlineStorage
status of a FeatureGroup
.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class FeatureGroupSummary implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField FEATURE_GROUP_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FeatureGroupName").getter(getter(FeatureGroupSummary::featureGroupName))
.setter(setter(Builder::featureGroupName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FeatureGroupName").build()).build();
private static final SdkField FEATURE_GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FeatureGroupArn").getter(getter(FeatureGroupSummary::featureGroupArn))
.setter(setter(Builder::featureGroupArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FeatureGroupArn").build()).build();
private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreationTime").getter(getter(FeatureGroupSummary::creationTime)).setter(setter(Builder::creationTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();
private static final SdkField FEATURE_GROUP_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("FeatureGroupStatus").getter(getter(FeatureGroupSummary::featureGroupStatusAsString))
.setter(setter(Builder::featureGroupStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("FeatureGroupStatus").build())
.build();
private static final SdkField OFFLINE_STORE_STATUS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("OfflineStoreStatus")
.getter(getter(FeatureGroupSummary::offlineStoreStatus)).setter(setter(Builder::offlineStoreStatus))
.constructor(OfflineStoreStatus::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OfflineStoreStatus").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(FEATURE_GROUP_NAME_FIELD,
FEATURE_GROUP_ARN_FIELD, CREATION_TIME_FIELD, FEATURE_GROUP_STATUS_FIELD, OFFLINE_STORE_STATUS_FIELD));
private static final long serialVersionUID = 1L;
private final String featureGroupName;
private final String featureGroupArn;
private final Instant creationTime;
private final String featureGroupStatus;
private final OfflineStoreStatus offlineStoreStatus;
private FeatureGroupSummary(BuilderImpl builder) {
this.featureGroupName = builder.featureGroupName;
this.featureGroupArn = builder.featureGroupArn;
this.creationTime = builder.creationTime;
this.featureGroupStatus = builder.featureGroupStatus;
this.offlineStoreStatus = builder.offlineStoreStatus;
}
/**
*
* The name of FeatureGroup
.
*
*
* @return The name of FeatureGroup
.
*/
public final String featureGroupName() {
return featureGroupName;
}
/**
*
* Unique identifier for the FeatureGroup
.
*
*
* @return Unique identifier for the FeatureGroup
.
*/
public final String featureGroupArn() {
return featureGroupArn;
}
/**
*
* A timestamp indicating the time of creation time of the FeatureGroup
.
*
*
* @return A timestamp indicating the time of creation time of the FeatureGroup
.
*/
public final Instant creationTime() {
return creationTime;
}
/**
*
* The status of a FeatureGroup. The status can be any of the following: Creating
, Created
, CreateFail
, Deleting
or DetailFail
.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #featureGroupStatus} will return {@link FeatureGroupStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #featureGroupStatusAsString}.
*
*
* @return The status of a FeatureGroup. The status can be any of the following: Creating
,
* Created
, CreateFail
, Deleting
or DetailFail
.
* @see FeatureGroupStatus
*/
public final FeatureGroupStatus featureGroupStatus() {
return FeatureGroupStatus.fromValue(featureGroupStatus);
}
/**
*
* The status of a FeatureGroup. The status can be any of the following: Creating
, Created
, CreateFail
, Deleting
or DetailFail
.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #featureGroupStatus} will return {@link FeatureGroupStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned
* by the service is available from {@link #featureGroupStatusAsString}.
*
*
* @return The status of a FeatureGroup. The status can be any of the following: Creating
,
* Created
, CreateFail
, Deleting
or DetailFail
.
* @see FeatureGroupStatus
*/
public final String featureGroupStatusAsString() {
return featureGroupStatus;
}
/**
*
* Notifies you if replicating data into the OfflineStore
has failed. Returns either:
* Active
or Blocked
.
*
*
* @return Notifies you if replicating data into the OfflineStore
has failed. Returns either:
* Active
or Blocked
.
*/
public final OfflineStoreStatus offlineStoreStatus() {
return offlineStoreStatus;
}
@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(featureGroupName());
hashCode = 31 * hashCode + Objects.hashCode(featureGroupArn());
hashCode = 31 * hashCode + Objects.hashCode(creationTime());
hashCode = 31 * hashCode + Objects.hashCode(featureGroupStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(offlineStoreStatus());
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 FeatureGroupSummary)) {
return false;
}
FeatureGroupSummary other = (FeatureGroupSummary) obj;
return Objects.equals(featureGroupName(), other.featureGroupName())
&& Objects.equals(featureGroupArn(), other.featureGroupArn())
&& Objects.equals(creationTime(), other.creationTime())
&& Objects.equals(featureGroupStatusAsString(), other.featureGroupStatusAsString())
&& Objects.equals(offlineStoreStatus(), other.offlineStoreStatus());
}
/**
* 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("FeatureGroupSummary").add("FeatureGroupName", featureGroupName())
.add("FeatureGroupArn", featureGroupArn()).add("CreationTime", creationTime())
.add("FeatureGroupStatus", featureGroupStatusAsString()).add("OfflineStoreStatus", offlineStoreStatus()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "FeatureGroupName":
return Optional.ofNullable(clazz.cast(featureGroupName()));
case "FeatureGroupArn":
return Optional.ofNullable(clazz.cast(featureGroupArn()));
case "CreationTime":
return Optional.ofNullable(clazz.cast(creationTime()));
case "FeatureGroupStatus":
return Optional.ofNullable(clazz.cast(featureGroupStatusAsString()));
case "OfflineStoreStatus":
return Optional.ofNullable(clazz.cast(offlineStoreStatus()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function