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

software.amazon.awssdk.services.cleanroomsml.model.GetAudienceModelResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Clean Rooms ML module holds the client classes that are used for communicating with Clean Rooms ML.

There is a newer version: 2.28.6
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.cleanroomsml.model;

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.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.core.traits.MapTrait;
import software.amazon.awssdk.core.traits.TimestampFormatTrait;
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;

/**
 */
@Generated("software.amazon.awssdk:codegen")
public final class GetAudienceModelResponse extends CleanRoomsMlResponse implements
        ToCopyableBuilder {
    private static final SdkField CREATE_TIME_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("createTime")
            .getter(getter(GetAudienceModelResponse::createTime))
            .setter(setter(Builder::createTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("createTime").build(),
                    TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();

    private static final SdkField UPDATE_TIME_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("updateTime")
            .getter(getter(GetAudienceModelResponse::updateTime))
            .setter(setter(Builder::updateTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("updateTime").build(),
                    TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();

    private static final SdkField TRAINING_DATA_START_TIME_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("trainingDataStartTime")
            .getter(getter(GetAudienceModelResponse::trainingDataStartTime))
            .setter(setter(Builder::trainingDataStartTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("trainingDataStartTime").build(),
                    TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();

    private static final SdkField TRAINING_DATA_END_TIME_FIELD = SdkField
            . builder(MarshallingType.INSTANT)
            .memberName("trainingDataEndTime")
            .getter(getter(GetAudienceModelResponse::trainingDataEndTime))
            .setter(setter(Builder::trainingDataEndTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("trainingDataEndTime").build(),
                    TimestampFormatTrait.create(TimestampFormatTrait.Format.ISO_8601)).build();

    private static final SdkField AUDIENCE_MODEL_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("audienceModelArn").getter(getter(GetAudienceModelResponse::audienceModelArn))
            .setter(setter(Builder::audienceModelArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("audienceModelArn").build()).build();

    private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING).memberName("name")
            .getter(getter(GetAudienceModelResponse::name)).setter(setter(Builder::name))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("name").build()).build();

    private static final SdkField TRAINING_DATASET_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("trainingDatasetArn").getter(getter(GetAudienceModelResponse::trainingDatasetArn))
            .setter(setter(Builder::trainingDatasetArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("trainingDatasetArn").build())
            .build();

    private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
            .getter(getter(GetAudienceModelResponse::statusAsString)).setter(setter(Builder::status))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();

    private static final SdkField STATUS_DETAILS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("statusDetails")
            .getter(getter(GetAudienceModelResponse::statusDetails)).setter(setter(Builder::statusDetails))
            .constructor(StatusDetails::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("statusDetails").build()).build();

    private static final SdkField KMS_KEY_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("kmsKeyArn").getter(getter(GetAudienceModelResponse::kmsKeyArn)).setter(setter(Builder::kmsKeyArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("kmsKeyArn").build()).build();

    private static final SdkField> TAGS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("tags")
            .getter(getter(GetAudienceModelResponse::tags))
            .setter(setter(Builder::tags))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("tags").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 DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("description").getter(getter(GetAudienceModelResponse::description)).setter(setter(Builder::description))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("description").build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(CREATE_TIME_FIELD,
            UPDATE_TIME_FIELD, TRAINING_DATA_START_TIME_FIELD, TRAINING_DATA_END_TIME_FIELD, AUDIENCE_MODEL_ARN_FIELD,
            NAME_FIELD, TRAINING_DATASET_ARN_FIELD, STATUS_FIELD, STATUS_DETAILS_FIELD, KMS_KEY_ARN_FIELD, TAGS_FIELD,
            DESCRIPTION_FIELD));

    private final Instant createTime;

    private final Instant updateTime;

    private final Instant trainingDataStartTime;

    private final Instant trainingDataEndTime;

    private final String audienceModelArn;

    private final String name;

    private final String trainingDatasetArn;

    private final String status;

    private final StatusDetails statusDetails;

    private final String kmsKeyArn;

    private final Map tags;

    private final String description;

    private GetAudienceModelResponse(BuilderImpl builder) {
        super(builder);
        this.createTime = builder.createTime;
        this.updateTime = builder.updateTime;
        this.trainingDataStartTime = builder.trainingDataStartTime;
        this.trainingDataEndTime = builder.trainingDataEndTime;
        this.audienceModelArn = builder.audienceModelArn;
        this.name = builder.name;
        this.trainingDatasetArn = builder.trainingDatasetArn;
        this.status = builder.status;
        this.statusDetails = builder.statusDetails;
        this.kmsKeyArn = builder.kmsKeyArn;
        this.tags = builder.tags;
        this.description = builder.description;
    }

    /**
     * 

* The time at which the audience model was created. *

* * @return The time at which the audience model was created. */ public final Instant createTime() { return createTime; } /** *

* The most recent time at which the audience model was updated. *

* * @return The most recent time at which the audience model was updated. */ public final Instant updateTime() { return updateTime; } /** *

* The start date specified for the training window. *

* * @return The start date specified for the training window. */ public final Instant trainingDataStartTime() { return trainingDataStartTime; } /** *

* The end date specified for the training window. *

* * @return The end date specified for the training window. */ public final Instant trainingDataEndTime() { return trainingDataEndTime; } /** *

* The Amazon Resource Name (ARN) of the audience model. *

* * @return The Amazon Resource Name (ARN) of the audience model. */ public final String audienceModelArn() { return audienceModelArn; } /** *

* The name of the audience model. *

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

* The Amazon Resource Name (ARN) of the training dataset that was used for this audience model. *

* * @return The Amazon Resource Name (ARN) of the training dataset that was used for this audience model. */ public final String trainingDatasetArn() { return trainingDatasetArn; } /** *

* The status of the audience model. *

*

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

* * @return The status of the audience model. * @see AudienceModelStatus */ public final AudienceModelStatus status() { return AudienceModelStatus.fromValue(status); } /** *

* The status of the audience model. *

*

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

* * @return The status of the audience model. * @see AudienceModelStatus */ public final String statusAsString() { return status; } /** *

* Details about the status of the audience model. *

* * @return Details about the status of the audience model. */ public final StatusDetails statusDetails() { return statusDetails; } /** *

* The KMS key ARN used for the audience model. *

* * @return The KMS key ARN used for the audience model. */ public final String kmsKeyArn() { return kmsKeyArn; } /** * For responses, this returns true if the service returned a value for the Tags 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 hasTags() { return tags != null && !(tags instanceof SdkAutoConstructMap); } /** *

* The tags that are assigned to the audience model. *

*

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

* * @return The tags that are assigned to the audience model. */ public final Map tags() { return tags; } /** *

* The description of the audience model. *

* * @return The description of the audience model. */ public final String description() { return description; } @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 + super.hashCode(); hashCode = 31 * hashCode + Objects.hashCode(createTime()); hashCode = 31 * hashCode + Objects.hashCode(updateTime()); hashCode = 31 * hashCode + Objects.hashCode(trainingDataStartTime()); hashCode = 31 * hashCode + Objects.hashCode(trainingDataEndTime()); hashCode = 31 * hashCode + Objects.hashCode(audienceModelArn()); hashCode = 31 * hashCode + Objects.hashCode(name()); hashCode = 31 * hashCode + Objects.hashCode(trainingDatasetArn()); hashCode = 31 * hashCode + Objects.hashCode(statusAsString()); hashCode = 31 * hashCode + Objects.hashCode(statusDetails()); hashCode = 31 * hashCode + Objects.hashCode(kmsKeyArn()); hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : null); hashCode = 31 * hashCode + Objects.hashCode(description()); return hashCode; } @Override public final boolean equals(Object obj) { return super.equals(obj) && equalsBySdkFields(obj); } @Override public final boolean equalsBySdkFields(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof GetAudienceModelResponse)) { return false; } GetAudienceModelResponse other = (GetAudienceModelResponse) obj; return Objects.equals(createTime(), other.createTime()) && Objects.equals(updateTime(), other.updateTime()) && Objects.equals(trainingDataStartTime(), other.trainingDataStartTime()) && Objects.equals(trainingDataEndTime(), other.trainingDataEndTime()) && Objects.equals(audienceModelArn(), other.audienceModelArn()) && Objects.equals(name(), other.name()) && Objects.equals(trainingDatasetArn(), other.trainingDatasetArn()) && Objects.equals(statusAsString(), other.statusAsString()) && Objects.equals(statusDetails(), other.statusDetails()) && Objects.equals(kmsKeyArn(), other.kmsKeyArn()) && hasTags() == other.hasTags() && Objects.equals(tags(), other.tags()) && Objects.equals(description(), other.description()); } /** * 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("GetAudienceModelResponse").add("CreateTime", createTime()).add("UpdateTime", updateTime()) .add("TrainingDataStartTime", trainingDataStartTime()).add("TrainingDataEndTime", trainingDataEndTime()) .add("AudienceModelArn", audienceModelArn()).add("Name", name()).add("TrainingDatasetArn", trainingDatasetArn()) .add("Status", statusAsString()).add("StatusDetails", statusDetails()).add("KmsKeyArn", kmsKeyArn()) .add("Tags", hasTags() ? tags() : null).add("Description", description()).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "createTime": return Optional.ofNullable(clazz.cast(createTime())); case "updateTime": return Optional.ofNullable(clazz.cast(updateTime())); case "trainingDataStartTime": return Optional.ofNullable(clazz.cast(trainingDataStartTime())); case "trainingDataEndTime": return Optional.ofNullable(clazz.cast(trainingDataEndTime())); case "audienceModelArn": return Optional.ofNullable(clazz.cast(audienceModelArn())); case "name": return Optional.ofNullable(clazz.cast(name())); case "trainingDatasetArn": return Optional.ofNullable(clazz.cast(trainingDatasetArn())); case "status": return Optional.ofNullable(clazz.cast(statusAsString())); case "statusDetails": return Optional.ofNullable(clazz.cast(statusDetails())); case "kmsKeyArn": return Optional.ofNullable(clazz.cast(kmsKeyArn())); case "tags": return Optional.ofNullable(clazz.cast(tags())); case "description": return Optional.ofNullable(clazz.cast(description())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((GetAudienceModelResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends CleanRoomsMlResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The time at which the audience model was created. *

* * @param createTime * The time at which the audience model was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createTime(Instant createTime); /** *

* The most recent time at which the audience model was updated. *

* * @param updateTime * The most recent time at which the audience model was updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder updateTime(Instant updateTime); /** *

* The start date specified for the training window. *

* * @param trainingDataStartTime * The start date specified for the training window. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingDataStartTime(Instant trainingDataStartTime); /** *

* The end date specified for the training window. *

* * @param trainingDataEndTime * The end date specified for the training window. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingDataEndTime(Instant trainingDataEndTime); /** *

* The Amazon Resource Name (ARN) of the audience model. *

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

* The name of the audience model. *

* * @param name * The name of the audience model. * @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 training dataset that was used for this audience model. *

* * @param trainingDatasetArn * The Amazon Resource Name (ARN) of the training dataset that was used for this audience model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder trainingDatasetArn(String trainingDatasetArn); /** *

* The status of the audience model. *

* * @param status * The status of the audience model. * @see AudienceModelStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AudienceModelStatus */ Builder status(String status); /** *

* The status of the audience model. *

* * @param status * The status of the audience model. * @see AudienceModelStatus * @return Returns a reference to this object so that method calls can be chained together. * @see AudienceModelStatus */ Builder status(AudienceModelStatus status); /** *

* Details about the status of the audience model. *

* * @param statusDetails * Details about the status of the audience model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder statusDetails(StatusDetails statusDetails); /** *

* Details about the status of the audience model. *

* This is a convenience method that creates an instance of the {@link StatusDetails.Builder} avoiding the need * to create one manually via {@link StatusDetails#builder()}. * *

* When the {@link Consumer} completes, {@link StatusDetails.Builder#build()} is called immediately and its * result is passed to {@link #statusDetails(StatusDetails)}. * * @param statusDetails * a consumer that will call methods on {@link StatusDetails.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #statusDetails(StatusDetails) */ default Builder statusDetails(Consumer statusDetails) { return statusDetails(StatusDetails.builder().applyMutation(statusDetails).build()); } /** *

* The KMS key ARN used for the audience model. *

* * @param kmsKeyArn * The KMS key ARN used for the audience model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder kmsKeyArn(String kmsKeyArn); /** *

* The tags that are assigned to the audience model. *

* * @param tags * The tags that are assigned to the audience model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder tags(Map tags); /** *

* The description of the audience model. *

* * @param description * The description of the audience model. * @return Returns a reference to this object so that method calls can be chained together. */ Builder description(String description); } static final class BuilderImpl extends CleanRoomsMlResponse.BuilderImpl implements Builder { private Instant createTime; private Instant updateTime; private Instant trainingDataStartTime; private Instant trainingDataEndTime; private String audienceModelArn; private String name; private String trainingDatasetArn; private String status; private StatusDetails statusDetails; private String kmsKeyArn; private Map tags = DefaultSdkAutoConstructMap.getInstance(); private String description; private BuilderImpl() { } private BuilderImpl(GetAudienceModelResponse model) { super(model); createTime(model.createTime); updateTime(model.updateTime); trainingDataStartTime(model.trainingDataStartTime); trainingDataEndTime(model.trainingDataEndTime); audienceModelArn(model.audienceModelArn); name(model.name); trainingDatasetArn(model.trainingDatasetArn); status(model.status); statusDetails(model.statusDetails); kmsKeyArn(model.kmsKeyArn); tags(model.tags); description(model.description); } public final Instant getCreateTime() { return createTime; } public final void setCreateTime(Instant createTime) { this.createTime = createTime; } @Override public final Builder createTime(Instant createTime) { this.createTime = createTime; return this; } public final Instant getUpdateTime() { return updateTime; } public final void setUpdateTime(Instant updateTime) { this.updateTime = updateTime; } @Override public final Builder updateTime(Instant updateTime) { this.updateTime = updateTime; return this; } public final Instant getTrainingDataStartTime() { return trainingDataStartTime; } public final void setTrainingDataStartTime(Instant trainingDataStartTime) { this.trainingDataStartTime = trainingDataStartTime; } @Override public final Builder trainingDataStartTime(Instant trainingDataStartTime) { this.trainingDataStartTime = trainingDataStartTime; return this; } public final Instant getTrainingDataEndTime() { return trainingDataEndTime; } public final void setTrainingDataEndTime(Instant trainingDataEndTime) { this.trainingDataEndTime = trainingDataEndTime; } @Override public final Builder trainingDataEndTime(Instant trainingDataEndTime) { this.trainingDataEndTime = trainingDataEndTime; return this; } public final String getAudienceModelArn() { return audienceModelArn; } public final void setAudienceModelArn(String audienceModelArn) { this.audienceModelArn = audienceModelArn; } @Override public final Builder audienceModelArn(String audienceModelArn) { this.audienceModelArn = audienceModelArn; return this; } 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 getTrainingDatasetArn() { return trainingDatasetArn; } public final void setTrainingDatasetArn(String trainingDatasetArn) { this.trainingDatasetArn = trainingDatasetArn; } @Override public final Builder trainingDatasetArn(String trainingDatasetArn) { this.trainingDatasetArn = trainingDatasetArn; 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 final Builder status(AudienceModelStatus status) { this.status(status == null ? null : status.toString()); return this; } public final StatusDetails.Builder getStatusDetails() { return statusDetails != null ? statusDetails.toBuilder() : null; } public final void setStatusDetails(StatusDetails.BuilderImpl statusDetails) { this.statusDetails = statusDetails != null ? statusDetails.build() : null; } @Override public final Builder statusDetails(StatusDetails statusDetails) { this.statusDetails = statusDetails; return this; } public final String getKmsKeyArn() { return kmsKeyArn; } public final void setKmsKeyArn(String kmsKeyArn) { this.kmsKeyArn = kmsKeyArn; } @Override public final Builder kmsKeyArn(String kmsKeyArn) { this.kmsKeyArn = kmsKeyArn; return this; } public final Map getTags() { if (tags instanceof SdkAutoConstructMap) { return null; } return tags; } public final void setTags(Map tags) { this.tags = TagMapCopier.copy(tags); } @Override public final Builder tags(Map tags) { this.tags = TagMapCopier.copy(tags); return this; } public final String getDescription() { return description; } public final void setDescription(String description) { this.description = description; } @Override public final Builder description(String description) { this.description = description; return this; } @Override public GetAudienceModelResponse build() { return new GetAudienceModelResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy