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

software.amazon.awssdk.services.sagemaker.model.DescribeTrialComponentResponse Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon SageMaker module holds the client classes that are used for communicating with Amazon SageMaker Service

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

import java.time.Instant;
import java.util.Arrays;
import java.util.Collection;
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 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.traits.MapTrait;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.DefaultSdkAutoConstructMap;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 DescribeTrialComponentResponse extends SageMakerResponse implements
        ToCopyableBuilder {
    private static final SdkField TRIAL_COMPONENT_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("TrialComponentName").getter(getter(DescribeTrialComponentResponse::trialComponentName))
            .setter(setter(Builder::trialComponentName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrialComponentName").build())
            .build();

    private static final SdkField TRIAL_COMPONENT_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("TrialComponentArn").getter(getter(DescribeTrialComponentResponse::trialComponentArn))
            .setter(setter(Builder::trialComponentArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrialComponentArn").build()).build();

    private static final SdkField DISPLAY_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("DisplayName").getter(getter(DescribeTrialComponentResponse::displayName))
            .setter(setter(Builder::displayName))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DisplayName").build()).build();

    private static final SdkField SOURCE_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("Source")
            .getter(getter(DescribeTrialComponentResponse::source)).setter(setter(Builder::source))
            .constructor(TrialComponentSource::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Source").build()).build();

    private static final SdkField STATUS_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("Status")
            .getter(getter(DescribeTrialComponentResponse::status)).setter(setter(Builder::status))
            .constructor(TrialComponentStatus::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();

    private static final SdkField START_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("StartTime").getter(getter(DescribeTrialComponentResponse::startTime)).setter(setter(Builder::startTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StartTime").build()).build();

    private static final SdkField END_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("EndTime").getter(getter(DescribeTrialComponentResponse::endTime)).setter(setter(Builder::endTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EndTime").build()).build();

    private static final SdkField CREATION_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("CreationTime").getter(getter(DescribeTrialComponentResponse::creationTime))
            .setter(setter(Builder::creationTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreationTime").build()).build();

    private static final SdkField CREATED_BY_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("CreatedBy").getter(getter(DescribeTrialComponentResponse::createdBy)).setter(setter(Builder::createdBy))
            .constructor(UserContext::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedBy").build()).build();

    private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
            .memberName("LastModifiedTime").getter(getter(DescribeTrialComponentResponse::lastModifiedTime))
            .setter(setter(Builder::lastModifiedTime))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();

    private static final SdkField LAST_MODIFIED_BY_FIELD = SdkField. builder(MarshallingType.SDK_POJO)
            .memberName("LastModifiedBy").getter(getter(DescribeTrialComponentResponse::lastModifiedBy))
            .setter(setter(Builder::lastModifiedBy)).constructor(UserContext::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedBy").build()).build();

    private static final SdkField> PARAMETERS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("Parameters")
            .getter(getter(DescribeTrialComponentResponse::parameters))
            .setter(setter(Builder::parameters))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Parameters").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(TrialComponentParameterValue::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField> INPUT_ARTIFACTS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("InputArtifacts")
            .getter(getter(DescribeTrialComponentResponse::inputArtifacts))
            .setter(setter(Builder::inputArtifacts))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputArtifacts").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(TrialComponentArtifact::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField> OUTPUT_ARTIFACTS_FIELD = SdkField
            .> builder(MarshallingType.MAP)
            .memberName("OutputArtifacts")
            .getter(getter(DescribeTrialComponentResponse::outputArtifacts))
            .setter(setter(Builder::outputArtifacts))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("OutputArtifacts").build(),
                    MapTrait.builder()
                            .keyLocationName("key")
                            .valueLocationName("value")
                            .valueFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(TrialComponentArtifact::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("value").build()).build()).build()).build();

    private static final SdkField METADATA_PROPERTIES_FIELD = SdkField
            . builder(MarshallingType.SDK_POJO).memberName("MetadataProperties")
            .getter(getter(DescribeTrialComponentResponse::metadataProperties)).setter(setter(Builder::metadataProperties))
            .constructor(MetadataProperties::builder)
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MetadataProperties").build())
            .build();

    private static final SdkField> METRICS_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Metrics")
            .getter(getter(DescribeTrialComponentResponse::metrics))
            .setter(setter(Builder::metrics))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Metrics").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(TrialComponentMetricSummary::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final SdkField LINEAGE_GROUP_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
            .memberName("LineageGroupArn").getter(getter(DescribeTrialComponentResponse::lineageGroupArn))
            .setter(setter(Builder::lineageGroupArn))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LineageGroupArn").build()).build();

    private static final SdkField> SOURCES_FIELD = SdkField
            .> builder(MarshallingType.LIST)
            .memberName("Sources")
            .getter(getter(DescribeTrialComponentResponse::sources))
            .setter(setter(Builder::sources))
            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Sources").build(),
                    ListTrait
                            .builder()
                            .memberLocationName(null)
                            .memberFieldInfo(
                                    SdkField. builder(MarshallingType.SDK_POJO)
                                            .constructor(TrialComponentSource::builder)
                                            .traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
                                                    .locationName("member").build()).build()).build()).build();

    private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TRIAL_COMPONENT_NAME_FIELD,
            TRIAL_COMPONENT_ARN_FIELD, DISPLAY_NAME_FIELD, SOURCE_FIELD, STATUS_FIELD, START_TIME_FIELD, END_TIME_FIELD,
            CREATION_TIME_FIELD, CREATED_BY_FIELD, LAST_MODIFIED_TIME_FIELD, LAST_MODIFIED_BY_FIELD, PARAMETERS_FIELD,
            INPUT_ARTIFACTS_FIELD, OUTPUT_ARTIFACTS_FIELD, METADATA_PROPERTIES_FIELD, METRICS_FIELD, LINEAGE_GROUP_ARN_FIELD,
            SOURCES_FIELD));

    private final String trialComponentName;

    private final String trialComponentArn;

    private final String displayName;

    private final TrialComponentSource source;

    private final TrialComponentStatus status;

    private final Instant startTime;

    private final Instant endTime;

    private final Instant creationTime;

    private final UserContext createdBy;

    private final Instant lastModifiedTime;

    private final UserContext lastModifiedBy;

    private final Map parameters;

    private final Map inputArtifacts;

    private final Map outputArtifacts;

    private final MetadataProperties metadataProperties;

    private final List metrics;

    private final String lineageGroupArn;

    private final List sources;

    private DescribeTrialComponentResponse(BuilderImpl builder) {
        super(builder);
        this.trialComponentName = builder.trialComponentName;
        this.trialComponentArn = builder.trialComponentArn;
        this.displayName = builder.displayName;
        this.source = builder.source;
        this.status = builder.status;
        this.startTime = builder.startTime;
        this.endTime = builder.endTime;
        this.creationTime = builder.creationTime;
        this.createdBy = builder.createdBy;
        this.lastModifiedTime = builder.lastModifiedTime;
        this.lastModifiedBy = builder.lastModifiedBy;
        this.parameters = builder.parameters;
        this.inputArtifacts = builder.inputArtifacts;
        this.outputArtifacts = builder.outputArtifacts;
        this.metadataProperties = builder.metadataProperties;
        this.metrics = builder.metrics;
        this.lineageGroupArn = builder.lineageGroupArn;
        this.sources = builder.sources;
    }

    /**
     * 

* The name of the trial component. *

* * @return The name of the trial component. */ public final String trialComponentName() { return trialComponentName; } /** *

* The Amazon Resource Name (ARN) of the trial component. *

* * @return The Amazon Resource Name (ARN) of the trial component. */ public final String trialComponentArn() { return trialComponentArn; } /** *

* The name of the component as displayed. If DisplayName isn't specified, * TrialComponentName is displayed. *

* * @return The name of the component as displayed. If DisplayName isn't specified, * TrialComponentName is displayed. */ public final String displayName() { return displayName; } /** *

* The Amazon Resource Name (ARN) of the source and, optionally, the job type. *

* * @return The Amazon Resource Name (ARN) of the source and, optionally, the job type. */ public final TrialComponentSource source() { return source; } /** *

* The status of the component. States include: *

*
    *
  • *

    * InProgress *

    *
  • *
  • *

    * Completed *

    *
  • *
  • *

    * Failed *

    *
  • *
* * @return The status of the component. States include:

*
    *
  • *

    * InProgress *

    *
  • *
  • *

    * Completed *

    *
  • *
  • *

    * Failed *

    *
  • */ public final TrialComponentStatus status() { return status; } /** *

    * When the component started. *

    * * @return When the component started. */ public final Instant startTime() { return startTime; } /** *

    * When the component ended. *

    * * @return When the component ended. */ public final Instant endTime() { return endTime; } /** *

    * When the component was created. *

    * * @return When the component was created. */ public final Instant creationTime() { return creationTime; } /** *

    * Who created the trial component. *

    * * @return Who created the trial component. */ public final UserContext createdBy() { return createdBy; } /** *

    * When the component was last modified. *

    * * @return When the component was last modified. */ public final Instant lastModifiedTime() { return lastModifiedTime; } /** *

    * Who last modified the component. *

    * * @return Who last modified the component. */ public final UserContext lastModifiedBy() { return lastModifiedBy; } /** * For responses, this returns true if the service returned a value for the Parameters 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 hasParameters() { return parameters != null && !(parameters instanceof SdkAutoConstructMap); } /** *

    * The hyperparameters of the component. *

    *

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

    * * @return The hyperparameters of the component. */ public final Map parameters() { return parameters; } /** * For responses, this returns true if the service returned a value for the InputArtifacts 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 hasInputArtifacts() { return inputArtifacts != null && !(inputArtifacts instanceof SdkAutoConstructMap); } /** *

    * The input artifacts of the component. *

    *

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

    * * @return The input artifacts of the component. */ public final Map inputArtifacts() { return inputArtifacts; } /** * For responses, this returns true if the service returned a value for the OutputArtifacts 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 hasOutputArtifacts() { return outputArtifacts != null && !(outputArtifacts instanceof SdkAutoConstructMap); } /** *

    * The output artifacts of the component. *

    *

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

    * * @return The output artifacts of the component. */ public final Map outputArtifacts() { return outputArtifacts; } /** * Returns the value of the MetadataProperties property for this object. * * @return The value of the MetadataProperties property for this object. */ public final MetadataProperties metadataProperties() { return metadataProperties; } /** * For responses, this returns true if the service returned a value for the Metrics 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 hasMetrics() { return metrics != null && !(metrics instanceof SdkAutoConstructList); } /** *

    * The metrics for the component. *

    *

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

    * * @return The metrics for the component. */ public final List metrics() { return metrics; } /** *

    * The Amazon Resource Name (ARN) of the lineage group. *

    * * @return The Amazon Resource Name (ARN) of the lineage group. */ public final String lineageGroupArn() { return lineageGroupArn; } /** * For responses, this returns true if the service returned a value for the Sources 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 hasSources() { return sources != null && !(sources instanceof SdkAutoConstructList); } /** *

    * A list of ARNs and, if applicable, job types for multiple sources of an experiment run. *

    *

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

    * * @return A list of ARNs and, if applicable, job types for multiple sources of an experiment run. */ public final List sources() { return sources; } @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(trialComponentName()); hashCode = 31 * hashCode + Objects.hashCode(trialComponentArn()); hashCode = 31 * hashCode + Objects.hashCode(displayName()); hashCode = 31 * hashCode + Objects.hashCode(source()); hashCode = 31 * hashCode + Objects.hashCode(status()); hashCode = 31 * hashCode + Objects.hashCode(startTime()); hashCode = 31 * hashCode + Objects.hashCode(endTime()); hashCode = 31 * hashCode + Objects.hashCode(creationTime()); hashCode = 31 * hashCode + Objects.hashCode(createdBy()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime()); hashCode = 31 * hashCode + Objects.hashCode(lastModifiedBy()); hashCode = 31 * hashCode + Objects.hashCode(hasParameters() ? parameters() : null); hashCode = 31 * hashCode + Objects.hashCode(hasInputArtifacts() ? inputArtifacts() : null); hashCode = 31 * hashCode + Objects.hashCode(hasOutputArtifacts() ? outputArtifacts() : null); hashCode = 31 * hashCode + Objects.hashCode(metadataProperties()); hashCode = 31 * hashCode + Objects.hashCode(hasMetrics() ? metrics() : null); hashCode = 31 * hashCode + Objects.hashCode(lineageGroupArn()); hashCode = 31 * hashCode + Objects.hashCode(hasSources() ? sources() : null); 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 DescribeTrialComponentResponse)) { return false; } DescribeTrialComponentResponse other = (DescribeTrialComponentResponse) obj; return Objects.equals(trialComponentName(), other.trialComponentName()) && Objects.equals(trialComponentArn(), other.trialComponentArn()) && Objects.equals(displayName(), other.displayName()) && Objects.equals(source(), other.source()) && Objects.equals(status(), other.status()) && Objects.equals(startTime(), other.startTime()) && Objects.equals(endTime(), other.endTime()) && Objects.equals(creationTime(), other.creationTime()) && Objects.equals(createdBy(), other.createdBy()) && Objects.equals(lastModifiedTime(), other.lastModifiedTime()) && Objects.equals(lastModifiedBy(), other.lastModifiedBy()) && hasParameters() == other.hasParameters() && Objects.equals(parameters(), other.parameters()) && hasInputArtifacts() == other.hasInputArtifacts() && Objects.equals(inputArtifacts(), other.inputArtifacts()) && hasOutputArtifacts() == other.hasOutputArtifacts() && Objects.equals(outputArtifacts(), other.outputArtifacts()) && Objects.equals(metadataProperties(), other.metadataProperties()) && hasMetrics() == other.hasMetrics() && Objects.equals(metrics(), other.metrics()) && Objects.equals(lineageGroupArn(), other.lineageGroupArn()) && hasSources() == other.hasSources() && Objects.equals(sources(), other.sources()); } /** * 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("DescribeTrialComponentResponse").add("TrialComponentName", trialComponentName()) .add("TrialComponentArn", trialComponentArn()).add("DisplayName", displayName()).add("Source", source()) .add("Status", status()).add("StartTime", startTime()).add("EndTime", endTime()) .add("CreationTime", creationTime()).add("CreatedBy", createdBy()).add("LastModifiedTime", lastModifiedTime()) .add("LastModifiedBy", lastModifiedBy()).add("Parameters", hasParameters() ? parameters() : null) .add("InputArtifacts", hasInputArtifacts() ? inputArtifacts() : null) .add("OutputArtifacts", hasOutputArtifacts() ? outputArtifacts() : null) .add("MetadataProperties", metadataProperties()).add("Metrics", hasMetrics() ? metrics() : null) .add("LineageGroupArn", lineageGroupArn()).add("Sources", hasSources() ? sources() : null).build(); } public final Optional getValueForField(String fieldName, Class clazz) { switch (fieldName) { case "TrialComponentName": return Optional.ofNullable(clazz.cast(trialComponentName())); case "TrialComponentArn": return Optional.ofNullable(clazz.cast(trialComponentArn())); case "DisplayName": return Optional.ofNullable(clazz.cast(displayName())); case "Source": return Optional.ofNullable(clazz.cast(source())); case "Status": return Optional.ofNullable(clazz.cast(status())); case "StartTime": return Optional.ofNullable(clazz.cast(startTime())); case "EndTime": return Optional.ofNullable(clazz.cast(endTime())); case "CreationTime": return Optional.ofNullable(clazz.cast(creationTime())); case "CreatedBy": return Optional.ofNullable(clazz.cast(createdBy())); case "LastModifiedTime": return Optional.ofNullable(clazz.cast(lastModifiedTime())); case "LastModifiedBy": return Optional.ofNullable(clazz.cast(lastModifiedBy())); case "Parameters": return Optional.ofNullable(clazz.cast(parameters())); case "InputArtifacts": return Optional.ofNullable(clazz.cast(inputArtifacts())); case "OutputArtifacts": return Optional.ofNullable(clazz.cast(outputArtifacts())); case "MetadataProperties": return Optional.ofNullable(clazz.cast(metadataProperties())); case "Metrics": return Optional.ofNullable(clazz.cast(metrics())); case "LineageGroupArn": return Optional.ofNullable(clazz.cast(lineageGroupArn())); case "Sources": return Optional.ofNullable(clazz.cast(sources())); default: return Optional.empty(); } } @Override public final List> sdkFields() { return SDK_FIELDS; } private static Function getter(Function g) { return obj -> g.apply((DescribeTrialComponentResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends SageMakerResponse.Builder, SdkPojo, CopyableBuilder { /** *

    * The name of the trial component. *

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

    * The Amazon Resource Name (ARN) of the trial component. *

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

    * The name of the component as displayed. If DisplayName isn't specified, * TrialComponentName is displayed. *

    * * @param displayName * The name of the component as displayed. If DisplayName isn't specified, * TrialComponentName is displayed. * @return Returns a reference to this object so that method calls can be chained together. */ Builder displayName(String displayName); /** *

    * The Amazon Resource Name (ARN) of the source and, optionally, the job type. *

    * * @param source * The Amazon Resource Name (ARN) of the source and, optionally, the job type. * @return Returns a reference to this object so that method calls can be chained together. */ Builder source(TrialComponentSource source); /** *

    * The Amazon Resource Name (ARN) of the source and, optionally, the job type. *

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

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

    * The status of the component. States include: *

    *
      *
    • *

      * InProgress *

      *
    • *
    • *

      * Completed *

      *
    • *
    • *

      * Failed *

      *
    • *
    * * @param status * The status of the component. States include:

    *
      *
    • *

      * InProgress *

      *
    • *
    • *

      * Completed *

      *
    • *
    • *

      * Failed *

      *
    • * @return Returns a reference to this object so that method calls can be chained together. */ Builder status(TrialComponentStatus status); /** *

      * The status of the component. States include: *

      *
        *
      • *

        * InProgress *

        *
      • *
      • *

        * Completed *

        *
      • *
      • *

        * Failed *

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

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

      * When the component started. *

      * * @param startTime * When the component started. * @return Returns a reference to this object so that method calls can be chained together. */ Builder startTime(Instant startTime); /** *

      * When the component ended. *

      * * @param endTime * When the component ended. * @return Returns a reference to this object so that method calls can be chained together. */ Builder endTime(Instant endTime); /** *

      * When the component was created. *

      * * @param creationTime * When the component was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder creationTime(Instant creationTime); /** *

      * Who created the trial component. *

      * * @param createdBy * Who created the trial component. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdBy(UserContext createdBy); /** *

      * Who created the trial component. *

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

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

      * When the component was last modified. *

      * * @param lastModifiedTime * When the component was last modified. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedTime(Instant lastModifiedTime); /** *

      * Who last modified the component. *

      * * @param lastModifiedBy * Who last modified the component. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lastModifiedBy(UserContext lastModifiedBy); /** *

      * Who last modified the component. *

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

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

      * The hyperparameters of the component. *

      * * @param parameters * The hyperparameters of the component. * @return Returns a reference to this object so that method calls can be chained together. */ Builder parameters(Map parameters); /** *

      * The input artifacts of the component. *

      * * @param inputArtifacts * The input artifacts of the component. * @return Returns a reference to this object so that method calls can be chained together. */ Builder inputArtifacts(Map inputArtifacts); /** *

      * The output artifacts of the component. *

      * * @param outputArtifacts * The output artifacts of the component. * @return Returns a reference to this object so that method calls can be chained together. */ Builder outputArtifacts(Map outputArtifacts); /** * Sets the value of the MetadataProperties property for this object. * * @param metadataProperties * The new value for the MetadataProperties property for this object. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metadataProperties(MetadataProperties metadataProperties); /** * Sets the value of the MetadataProperties property for this object. * * This is a convenience method that creates an instance of the {@link MetadataProperties.Builder} avoiding the * need to create one manually via {@link MetadataProperties#builder()}. * *

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

      * The metrics for the component. *

      * * @param metrics * The metrics for the component. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metrics(Collection metrics); /** *

      * The metrics for the component. *

      * * @param metrics * The metrics for the component. * @return Returns a reference to this object so that method calls can be chained together. */ Builder metrics(TrialComponentMetricSummary... metrics); /** *

      * The metrics for the component. *

      * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemaker.model.TrialComponentMetricSummary.Builder} avoiding the need * to create one manually via * {@link software.amazon.awssdk.services.sagemaker.model.TrialComponentMetricSummary#builder()}. * *

      * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemaker.model.TrialComponentMetricSummary.Builder#build()} is called * immediately and its result is passed to {@link #metrics(List)}. * * @param metrics * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemaker.model.TrialComponentMetricSummary.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #metrics(java.util.Collection) */ Builder metrics(Consumer... metrics); /** *

      * The Amazon Resource Name (ARN) of the lineage group. *

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

      * A list of ARNs and, if applicable, job types for multiple sources of an experiment run. *

      * * @param sources * A list of ARNs and, if applicable, job types for multiple sources of an experiment run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sources(Collection sources); /** *

      * A list of ARNs and, if applicable, job types for multiple sources of an experiment run. *

      * * @param sources * A list of ARNs and, if applicable, job types for multiple sources of an experiment run. * @return Returns a reference to this object so that method calls can be chained together. */ Builder sources(TrialComponentSource... sources); /** *

      * A list of ARNs and, if applicable, job types for multiple sources of an experiment run. *

      * This is a convenience method that creates an instance of the * {@link software.amazon.awssdk.services.sagemaker.model.TrialComponentSource.Builder} avoiding the need to * create one manually via * {@link software.amazon.awssdk.services.sagemaker.model.TrialComponentSource#builder()}. * *

      * When the {@link Consumer} completes, * {@link software.amazon.awssdk.services.sagemaker.model.TrialComponentSource.Builder#build()} is called * immediately and its result is passed to {@link #sources(List)}. * * @param sources * a consumer that will call methods on * {@link software.amazon.awssdk.services.sagemaker.model.TrialComponentSource.Builder} * @return Returns a reference to this object so that method calls can be chained together. * @see #sources(java.util.Collection) */ Builder sources(Consumer... sources); } static final class BuilderImpl extends SageMakerResponse.BuilderImpl implements Builder { private String trialComponentName; private String trialComponentArn; private String displayName; private TrialComponentSource source; private TrialComponentStatus status; private Instant startTime; private Instant endTime; private Instant creationTime; private UserContext createdBy; private Instant lastModifiedTime; private UserContext lastModifiedBy; private Map parameters = DefaultSdkAutoConstructMap.getInstance(); private Map inputArtifacts = DefaultSdkAutoConstructMap.getInstance(); private Map outputArtifacts = DefaultSdkAutoConstructMap.getInstance(); private MetadataProperties metadataProperties; private List metrics = DefaultSdkAutoConstructList.getInstance(); private String lineageGroupArn; private List sources = DefaultSdkAutoConstructList.getInstance(); private BuilderImpl() { } private BuilderImpl(DescribeTrialComponentResponse model) { super(model); trialComponentName(model.trialComponentName); trialComponentArn(model.trialComponentArn); displayName(model.displayName); source(model.source); status(model.status); startTime(model.startTime); endTime(model.endTime); creationTime(model.creationTime); createdBy(model.createdBy); lastModifiedTime(model.lastModifiedTime); lastModifiedBy(model.lastModifiedBy); parameters(model.parameters); inputArtifacts(model.inputArtifacts); outputArtifacts(model.outputArtifacts); metadataProperties(model.metadataProperties); metrics(model.metrics); lineageGroupArn(model.lineageGroupArn); sources(model.sources); } public final String getTrialComponentName() { return trialComponentName; } public final void setTrialComponentName(String trialComponentName) { this.trialComponentName = trialComponentName; } @Override public final Builder trialComponentName(String trialComponentName) { this.trialComponentName = trialComponentName; return this; } public final String getTrialComponentArn() { return trialComponentArn; } public final void setTrialComponentArn(String trialComponentArn) { this.trialComponentArn = trialComponentArn; } @Override public final Builder trialComponentArn(String trialComponentArn) { this.trialComponentArn = trialComponentArn; return this; } public final String getDisplayName() { return displayName; } public final void setDisplayName(String displayName) { this.displayName = displayName; } @Override public final Builder displayName(String displayName) { this.displayName = displayName; return this; } public final TrialComponentSource.Builder getSource() { return source != null ? source.toBuilder() : null; } public final void setSource(TrialComponentSource.BuilderImpl source) { this.source = source != null ? source.build() : null; } @Override public final Builder source(TrialComponentSource source) { this.source = source; return this; } public final TrialComponentStatus.Builder getStatus() { return status != null ? status.toBuilder() : null; } public final void setStatus(TrialComponentStatus.BuilderImpl status) { this.status = status != null ? status.build() : null; } @Override public final Builder status(TrialComponentStatus status) { this.status = status; return this; } public final Instant getStartTime() { return startTime; } public final void setStartTime(Instant startTime) { this.startTime = startTime; } @Override public final Builder startTime(Instant startTime) { this.startTime = startTime; return this; } public final Instant getEndTime() { return endTime; } public final void setEndTime(Instant endTime) { this.endTime = endTime; } @Override public final Builder endTime(Instant endTime) { this.endTime = endTime; return this; } public final Instant getCreationTime() { return creationTime; } public final void setCreationTime(Instant creationTime) { this.creationTime = creationTime; } @Override public final Builder creationTime(Instant creationTime) { this.creationTime = creationTime; return this; } public final UserContext.Builder getCreatedBy() { return createdBy != null ? createdBy.toBuilder() : null; } public final void setCreatedBy(UserContext.BuilderImpl createdBy) { this.createdBy = createdBy != null ? createdBy.build() : null; } @Override public final Builder createdBy(UserContext createdBy) { this.createdBy = createdBy; return this; } public final Instant getLastModifiedTime() { return lastModifiedTime; } public final void setLastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; } @Override public final Builder lastModifiedTime(Instant lastModifiedTime) { this.lastModifiedTime = lastModifiedTime; return this; } public final UserContext.Builder getLastModifiedBy() { return lastModifiedBy != null ? lastModifiedBy.toBuilder() : null; } public final void setLastModifiedBy(UserContext.BuilderImpl lastModifiedBy) { this.lastModifiedBy = lastModifiedBy != null ? lastModifiedBy.build() : null; } @Override public final Builder lastModifiedBy(UserContext lastModifiedBy) { this.lastModifiedBy = lastModifiedBy; return this; } public final Map getParameters() { Map result = TrialComponentParametersCopier .copyToBuilder(this.parameters); if (result instanceof SdkAutoConstructMap) { return null; } return result; } public final void setParameters(Map parameters) { this.parameters = TrialComponentParametersCopier.copyFromBuilder(parameters); } @Override public final Builder parameters(Map parameters) { this.parameters = TrialComponentParametersCopier.copy(parameters); return this; } public final Map getInputArtifacts() { Map result = TrialComponentArtifactsCopier.copyToBuilder(this.inputArtifacts); if (result instanceof SdkAutoConstructMap) { return null; } return result; } public final void setInputArtifacts(Map inputArtifacts) { this.inputArtifacts = TrialComponentArtifactsCopier.copyFromBuilder(inputArtifacts); } @Override public final Builder inputArtifacts(Map inputArtifacts) { this.inputArtifacts = TrialComponentArtifactsCopier.copy(inputArtifacts); return this; } public final Map getOutputArtifacts() { Map result = TrialComponentArtifactsCopier .copyToBuilder(this.outputArtifacts); if (result instanceof SdkAutoConstructMap) { return null; } return result; } public final void setOutputArtifacts(Map outputArtifacts) { this.outputArtifacts = TrialComponentArtifactsCopier.copyFromBuilder(outputArtifacts); } @Override public final Builder outputArtifacts(Map outputArtifacts) { this.outputArtifacts = TrialComponentArtifactsCopier.copy(outputArtifacts); return this; } public final MetadataProperties.Builder getMetadataProperties() { return metadataProperties != null ? metadataProperties.toBuilder() : null; } public final void setMetadataProperties(MetadataProperties.BuilderImpl metadataProperties) { this.metadataProperties = metadataProperties != null ? metadataProperties.build() : null; } @Override public final Builder metadataProperties(MetadataProperties metadataProperties) { this.metadataProperties = metadataProperties; return this; } public final List getMetrics() { List result = TrialComponentMetricSummariesCopier.copyToBuilder(this.metrics); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setMetrics(Collection metrics) { this.metrics = TrialComponentMetricSummariesCopier.copyFromBuilder(metrics); } @Override public final Builder metrics(Collection metrics) { this.metrics = TrialComponentMetricSummariesCopier.copy(metrics); return this; } @Override @SafeVarargs public final Builder metrics(TrialComponentMetricSummary... metrics) { metrics(Arrays.asList(metrics)); return this; } @Override @SafeVarargs public final Builder metrics(Consumer... metrics) { metrics(Stream.of(metrics).map(c -> TrialComponentMetricSummary.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } public final String getLineageGroupArn() { return lineageGroupArn; } public final void setLineageGroupArn(String lineageGroupArn) { this.lineageGroupArn = lineageGroupArn; } @Override public final Builder lineageGroupArn(String lineageGroupArn) { this.lineageGroupArn = lineageGroupArn; return this; } public final List getSources() { List result = TrialComponentSourcesCopier.copyToBuilder(this.sources); if (result instanceof SdkAutoConstructList) { return null; } return result; } public final void setSources(Collection sources) { this.sources = TrialComponentSourcesCopier.copyFromBuilder(sources); } @Override public final Builder sources(Collection sources) { this.sources = TrialComponentSourcesCopier.copy(sources); return this; } @Override @SafeVarargs public final Builder sources(TrialComponentSource... sources) { sources(Arrays.asList(sources)); return this; } @Override @SafeVarargs public final Builder sources(Consumer... sources) { sources(Stream.of(sources).map(c -> TrialComponentSource.builder().applyMutation(c).build()) .collect(Collectors.toList())); return this; } @Override public DescribeTrialComponentResponse build() { return new DescribeTrialComponentResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy