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

software.amazon.awssdk.services.personalize.model.FeatureTransformation 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.personalize.model;

import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
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.core.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructMap;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;

/**
 * 

* Provides feature transformation information. Feature transformation is the process of modifying raw input data into a * form more suitable for model training. *

*/ @Generated("software.amazon.awssdk:codegen") public final class FeatureTransformation implements SdkPojo, Serializable, ToCopyableBuilder { private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name") .getter(getter(FeatureTransformation::name)).setter(setter(Builder::name)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build(); private static final SdkField FEATURE_TRANSFORMATION_ARN_FIELD = SdkField. builder(MarshallingType.STRING) .memberName("featureTransformationArn").getter(getter(FeatureTransformation::featureTransformationArn)) .setter(setter(Builder::featureTransformationArn)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("featureTransformationArn").build()) .build(); private static final SdkField> DEFAULT_PARAMETERS_FIELD = SdkField .> builder(MarshallingType.MAP) .memberName("defaultParameters") .getter(getter(FeatureTransformation::defaultParameters)) .setter(setter(Builder::defaultParameters)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("defaultParameters").build(), MapTrait.builder() .keyLocationName("key") .valueLocationName("value") .valueFieldInfo( SdkField. builder(MarshallingType.STRING) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD) .locationName("value").build()).build()).build()).build(); private static final SdkField CREATION_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("creationDateTime").getter(getter(FeatureTransformation::creationDateTime)) .setter(setter(Builder::creationDateTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationDateTime").build()).build(); private static final SdkField LAST_UPDATED_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT) .memberName("lastUpdatedDateTime").getter(getter(FeatureTransformation::lastUpdatedDateTime)) .setter(setter(Builder::lastUpdatedDateTime)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedDateTime").build()) .build(); private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status") .getter(getter(FeatureTransformation::status)).setter(setter(Builder::status)) .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build(); private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(NAME_FIELD, FEATURE_TRANSFORMATION_ARN_FIELD, DEFAULT_PARAMETERS_FIELD, CREATION_DATE_TIME_FIELD, LAST_UPDATED_DATE_TIME_FIELD, STATUS_FIELD)); private static final long serialVersionUID = 1L; private final String name; private final String featureTransformationArn; private final Map defaultParameters; private final Instant creationDateTime; private final Instant lastUpdatedDateTime; private final String status; private FeatureTransformation(BuilderImpl builder) { this.name = builder.name; this.featureTransformationArn = builder.featureTransformationArn; this.defaultParameters = builder.defaultParameters; this.creationDateTime = builder.creationDateTime; this.lastUpdatedDateTime = builder.lastUpdatedDateTime; this.status = builder.status; } /** *

* The name of the feature transformation. *

* * @return The name of the feature transformation. */ public final String name() { return name; } /** *

* The Amazon Resource Name (ARN) of the FeatureTransformation object. *

* * @return The Amazon Resource Name (ARN) of the FeatureTransformation object. */ public final String featureTransformationArn() { return featureTransformationArn; } /** * For responses, this returns true if the service returned a value for the DefaultParameters 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 hasDefaultParameters() { return defaultParameters != null && !(defaultParameters instanceof SdkAutoConstructMap); } /** *

* Provides the default parameters for feature transformation. *

*

* 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 #hasDefaultParameters} method. *

* * @return Provides the default parameters for feature transformation. */ public final Map defaultParameters() { return defaultParameters; } /** *

* The creation date and time (in Unix time) of the feature transformation. *

* * @return The creation date and time (in Unix time) of the feature transformation. */ public final Instant creationDateTime() { return creationDateTime; } /** *

* The last update date and time (in Unix time) of the feature transformation. *

* * @return The last update date and time (in Unix time) of the feature transformation. */ public final Instant lastUpdatedDateTime() { return lastUpdatedDateTime; } /** *

* The status of the feature transformation. *

*

* A feature transformation can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • *
* * @return The status of the feature transformation.

*

* A feature transformation can be in one of the following states: *

*
    *
  • *

    * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

    *
  • */ public final String status() { return status; } @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(name()); hashCode = 31 * hashCode + Objects.hashCode(featureTransformationArn()); hashCode = 31 * hashCode + Objects.hashCode(hasDefaultParameters() ? defaultParameters() : null); hashCode = 31 * hashCode + Objects.hashCode(creationDateTime()); hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedDateTime()); hashCode = 31 * hashCode + Objects.hashCode(status()); 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 FeatureTransformation)) { return false; } FeatureTransformation other = (FeatureTransformation) obj; return Objects.equals(name(), other.name()) && Objects.equals(featureTransformationArn(), other.featureTransformationArn()) && hasDefaultParameters() == other.hasDefaultParameters() && Objects.equals(defaultParameters(), other.defaultParameters()) && Objects.equals(creationDateTime(), other.creationDateTime()) && Objects.equals(lastUpdatedDateTime(), other.lastUpdatedDateTime()) && Objects.equals(status(), other.status()); } /** * 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("FeatureTransformation").add("Name", name()) .add("FeatureTransformationArn", featureTransformationArn()) .add("DefaultParameters", hasDefaultParameters() ? defaultParameters() : null) .add("CreationDateTime", creationDateTime()).add("LastUpdatedDateTime", lastUpdatedDateTime()) .add("Status", status()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "name": return Optional.ofNullable(clazz.cast(name())); case "featureTransformationArn": return Optional.ofNullable(clazz.cast(featureTransformationArn())); case "defaultParameters": return Optional.ofNullable(clazz.cast(defaultParameters())); case "creationDateTime": return Optional.ofNullable(clazz.cast(creationDateTime())); case "lastUpdatedDateTime": return Optional.ofNullable(clazz.cast(lastUpdatedDateTime())); case "status": return Optional.ofNullable(clazz.cast(status())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((FeatureTransformation) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SdkPojo, CopyableBuilder { /** *

    * The name of the feature transformation. *

    * * @param name * The name of the feature transformation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder name(String name); /** *

    * The Amazon Resource Name (ARN) of the FeatureTransformation object. *

    * * @param featureTransformationArn * The Amazon Resource Name (ARN) of the FeatureTransformation object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder featureTransformationArn(String featureTransformationArn); /** *

    * Provides the default parameters for feature transformation. *

    * * @param defaultParameters * Provides the default parameters for feature transformation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder defaultParameters(Map defaultParameters); /** *

    * The creation date and time (in Unix time) of the feature transformation. *

    * * @param creationDateTime * The creation date and time (in Unix time) of the feature transformation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationDateTime(Instant creationDateTime); /** *

    * The last update date and time (in Unix time) of the feature transformation. *

    * * @param lastUpdatedDateTime * The last update date and time (in Unix time) of the feature transformation. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastUpdatedDateTime(Instant lastUpdatedDateTime); /** *

    * The status of the feature transformation. *

    *

    * A feature transformation can be in one of the following states: *

    *
      *
    • *

      * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

      *
    • *
    * * @param status * The status of the feature transformation.

    *

    * A feature transformation can be in one of the following states: *

    *
      *
    • *

      * CREATE PENDING > CREATE IN_PROGRESS > ACTIVE -or- CREATE FAILED *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(String status); } static final class BuilderImpl implements Builder { private String name; private String featureTransformationArn; private Map defaultParameters = DefaultSdkAutoConstructMap.getInstance(); private Instant creationDateTime; private Instant lastUpdatedDateTime; private String status; private BuilderImpl() { } private BuilderImpl(FeatureTransformation model) { name(model.name); featureTransformationArn(model.featureTransformationArn); defaultParameters(model.defaultParameters); creationDateTime(model.creationDateTime); lastUpdatedDateTime(model.lastUpdatedDateTime); status(model.status); } public final String getName() { return name; } public final void setName(String name) { this.name = name; } @Override public final Builder name(String name) { this.name = name; return this; } public final String getFeatureTransformationArn() { return featureTransformationArn; } public final void setFeatureTransformationArn(String featureTransformationArn) { this.featureTransformationArn = featureTransformationArn; } @Override public final Builder featureTransformationArn(String featureTransformationArn) { this.featureTransformationArn = featureTransformationArn; return this; } public final Map getDefaultParameters() { if (defaultParameters instanceof SdkAutoConstructMap) { return null; } return defaultParameters; } public final void setDefaultParameters(Map defaultParameters) { this.defaultParameters = FeaturizationParametersCopier.copy(defaultParameters); } @Override public final Builder defaultParameters(Map defaultParameters) { this.defaultParameters = FeaturizationParametersCopier.copy(defaultParameters); return this; } public final Instant getCreationDateTime() { return creationDateTime; } public final void setCreationDateTime(Instant creationDateTime) { this.creationDateTime = creationDateTime; } @Override public final Builder creationDateTime(Instant creationDateTime) { this.creationDateTime = creationDateTime; return this; } public final Instant getLastUpdatedDateTime() { return lastUpdatedDateTime; } public final void setLastUpdatedDateTime(Instant lastUpdatedDateTime) { this.lastUpdatedDateTime = lastUpdatedDateTime; } @Override public final Builder lastUpdatedDateTime(Instant lastUpdatedDateTime) { this.lastUpdatedDateTime = lastUpdatedDateTime; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public FeatureTransformation build() { return new FeatureTransformation(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy