software.amazon.awssdk.services.sagemaker.model.CreateHyperParameterTuningJobRequest Maven / Gradle / Ivy
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.sagemaker.model;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
import java.util.function.BiConsumer;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import software.amazon.awssdk.annotations.Generated;
import software.amazon.awssdk.awscore.AwsRequestOverrideConfiguration;
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.util.DefaultSdkAutoConstructList;
import software.amazon.awssdk.core.util.SdkAutoConstructList;
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 CreateHyperParameterTuningJobRequest extends SageMakerRequest implements
ToCopyableBuilder {
private static final SdkField HYPER_PARAMETER_TUNING_JOB_NAME_FIELD = SdkField
. builder(MarshallingType.STRING)
.memberName("HyperParameterTuningJobName")
.getter(getter(CreateHyperParameterTuningJobRequest::hyperParameterTuningJobName))
.setter(setter(Builder::hyperParameterTuningJobName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HyperParameterTuningJobName")
.build()).build();
private static final SdkField HYPER_PARAMETER_TUNING_JOB_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("HyperParameterTuningJobConfig")
.getter(getter(CreateHyperParameterTuningJobRequest::hyperParameterTuningJobConfig))
.setter(setter(Builder::hyperParameterTuningJobConfig))
.constructor(HyperParameterTuningJobConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("HyperParameterTuningJobConfig")
.build()).build();
private static final SdkField TRAINING_JOB_DEFINITION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("TrainingJobDefinition")
.getter(getter(CreateHyperParameterTuningJobRequest::trainingJobDefinition))
.setter(setter(Builder::trainingJobDefinition)).constructor(HyperParameterTrainingJobDefinition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobDefinition").build())
.build();
private static final SdkField> TRAINING_JOB_DEFINITIONS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("TrainingJobDefinitions")
.getter(getter(CreateHyperParameterTuningJobRequest::trainingJobDefinitions))
.setter(setter(Builder::trainingJobDefinitions))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TrainingJobDefinitions").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(HyperParameterTrainingJobDefinition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField WARM_START_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("WarmStartConfig")
.getter(getter(CreateHyperParameterTuningJobRequest::warmStartConfig)).setter(setter(Builder::warmStartConfig))
.constructor(HyperParameterTuningJobWarmStartConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WarmStartConfig").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(CreateHyperParameterTuningJobRequest::tags))
.setter(setter(Builder::tags))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Tags").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(Tag::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(
HYPER_PARAMETER_TUNING_JOB_NAME_FIELD, HYPER_PARAMETER_TUNING_JOB_CONFIG_FIELD, TRAINING_JOB_DEFINITION_FIELD,
TRAINING_JOB_DEFINITIONS_FIELD, WARM_START_CONFIG_FIELD, TAGS_FIELD));
private final String hyperParameterTuningJobName;
private final HyperParameterTuningJobConfig hyperParameterTuningJobConfig;
private final HyperParameterTrainingJobDefinition trainingJobDefinition;
private final List trainingJobDefinitions;
private final HyperParameterTuningJobWarmStartConfig warmStartConfig;
private final List tags;
private CreateHyperParameterTuningJobRequest(BuilderImpl builder) {
super(builder);
this.hyperParameterTuningJobName = builder.hyperParameterTuningJobName;
this.hyperParameterTuningJobConfig = builder.hyperParameterTuningJobConfig;
this.trainingJobDefinition = builder.trainingJobDefinition;
this.trainingJobDefinitions = builder.trainingJobDefinitions;
this.warmStartConfig = builder.warmStartConfig;
this.tags = builder.tags;
}
/**
*
* The name of the tuning job. This name is the prefix for the names of all training jobs that this tuning job
* launches. The name must be unique within the same Amazon Web Services account and Amazon Web Services Region. The
* name must have 1 to 32 characters. Valid characters are a-z, A-Z, 0-9, and : + = @ _ % - (hyphen). The name is
* not case sensitive.
*
*
* @return The name of the tuning job. This name is the prefix for the names of all training jobs that this tuning
* job launches. The name must be unique within the same Amazon Web Services account and Amazon Web Services
* Region. The name must have 1 to 32 characters. Valid characters are a-z, A-Z, 0-9, and : + = @ _ % -
* (hyphen). The name is not case sensitive.
*/
public final String hyperParameterTuningJobName() {
return hyperParameterTuningJobName;
}
/**
*
* The HyperParameterTuningJobConfig object that describes the tuning job, including the search strategy, the
* objective metric used to evaluate training jobs, ranges of parameters to search, and resource limits for the
* tuning job. For more information, see How
* Hyperparameter Tuning Works.
*
*
* @return The HyperParameterTuningJobConfig object that describes the tuning job, including the search
* strategy, the objective metric used to evaluate training jobs, ranges of parameters to search, and
* resource limits for the tuning job. For more information, see How
* Hyperparameter Tuning Works.
*/
public final HyperParameterTuningJobConfig hyperParameterTuningJobConfig() {
return hyperParameterTuningJobConfig;
}
/**
*
* The HyperParameterTrainingJobDefinition object that describes the training jobs that this tuning job
* launches, including static hyperparameters, input data configuration, output data configuration, resource
* configuration, and stopping condition.
*
*
* @return The HyperParameterTrainingJobDefinition object that describes the training jobs that this tuning
* job launches, including static hyperparameters, input data configuration, output data configuration,
* resource configuration, and stopping condition.
*/
public final HyperParameterTrainingJobDefinition trainingJobDefinition() {
return trainingJobDefinition;
}
/**
* For responses, this returns true if the service returned a value for the TrainingJobDefinitions 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 hasTrainingJobDefinitions() {
return trainingJobDefinitions != null && !(trainingJobDefinitions instanceof SdkAutoConstructList);
}
/**
*
* A list of the HyperParameterTrainingJobDefinition objects launched for this tuning job.
*
*
* 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 #hasTrainingJobDefinitions} method.
*
*
* @return A list of the HyperParameterTrainingJobDefinition objects launched for this tuning job.
*/
public final List trainingJobDefinitions() {
return trainingJobDefinitions;
}
/**
*
* Specifies the configuration for starting the hyperparameter tuning job using one or more previous tuning jobs as
* a starting point. The results of previous tuning jobs are used to inform which combinations of hyperparameters to
* search over in the new tuning job.
*
*
* All training jobs launched by the new hyperparameter tuning job are evaluated by using the objective metric. If
* you specify IDENTICAL_DATA_AND_ALGORITHM
as the WarmStartType
value for the warm start
* configuration, the training job that performs the best in the new tuning job is compared to the best training
* jobs from the parent tuning jobs. From these, the training job that performs the best as measured by the
* objective metric is returned as the overall best training job.
*
*
*
* All training jobs launched by parent hyperparameter tuning jobs and the new hyperparameter tuning jobs count
* against the limit of training jobs for the tuning job.
*
*
*
* @return Specifies the configuration for starting the hyperparameter tuning job using one or more previous tuning
* jobs as a starting point. The results of previous tuning jobs are used to inform which combinations of
* hyperparameters to search over in the new tuning job.
*
* All training jobs launched by the new hyperparameter tuning job are evaluated by using the objective
* metric. If you specify IDENTICAL_DATA_AND_ALGORITHM
as the WarmStartType
value
* for the warm start configuration, the training job that performs the best in the new tuning job is
* compared to the best training jobs from the parent tuning jobs. From these, the training job that
* performs the best as measured by the objective metric is returned as the overall best training job.
*
*
*
* All training jobs launched by parent hyperparameter tuning jobs and the new hyperparameter tuning jobs
* count against the limit of training jobs for the tuning job.
*
*/
public final HyperParameterTuningJobWarmStartConfig warmStartConfig() {
return warmStartConfig;
}
/**
* 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 SdkAutoConstructList);
}
/**
*
* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different ways,
* for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services Resources.
*
*
* Tags that you specify for the tuning job are also added to all training jobs that the tuning job launches.
*
*
* 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 An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in
* different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services
* Resources.
*
* Tags that you specify for the tuning job are also added to all training jobs that the tuning job
* launches.
*/
public final List tags() {
return tags;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class extends Builder> serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + super.hashCode();
hashCode = 31 * hashCode + Objects.hashCode(hyperParameterTuningJobName());
hashCode = 31 * hashCode + Objects.hashCode(hyperParameterTuningJobConfig());
hashCode = 31 * hashCode + Objects.hashCode(trainingJobDefinition());
hashCode = 31 * hashCode + Objects.hashCode(hasTrainingJobDefinitions() ? trainingJobDefinitions() : null);
hashCode = 31 * hashCode + Objects.hashCode(warmStartConfig());
hashCode = 31 * hashCode + Objects.hashCode(hasTags() ? tags() : 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 CreateHyperParameterTuningJobRequest)) {
return false;
}
CreateHyperParameterTuningJobRequest other = (CreateHyperParameterTuningJobRequest) obj;
return Objects.equals(hyperParameterTuningJobName(), other.hyperParameterTuningJobName())
&& Objects.equals(hyperParameterTuningJobConfig(), other.hyperParameterTuningJobConfig())
&& Objects.equals(trainingJobDefinition(), other.trainingJobDefinition())
&& hasTrainingJobDefinitions() == other.hasTrainingJobDefinitions()
&& Objects.equals(trainingJobDefinitions(), other.trainingJobDefinitions())
&& Objects.equals(warmStartConfig(), other.warmStartConfig()) && hasTags() == other.hasTags()
&& Objects.equals(tags(), other.tags());
}
/**
* 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("CreateHyperParameterTuningJobRequest")
.add("HyperParameterTuningJobName", hyperParameterTuningJobName())
.add("HyperParameterTuningJobConfig", hyperParameterTuningJobConfig())
.add("TrainingJobDefinition", trainingJobDefinition())
.add("TrainingJobDefinitions", hasTrainingJobDefinitions() ? trainingJobDefinitions() : null)
.add("WarmStartConfig", warmStartConfig()).add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "HyperParameterTuningJobName":
return Optional.ofNullable(clazz.cast(hyperParameterTuningJobName()));
case "HyperParameterTuningJobConfig":
return Optional.ofNullable(clazz.cast(hyperParameterTuningJobConfig()));
case "TrainingJobDefinition":
return Optional.ofNullable(clazz.cast(trainingJobDefinition()));
case "TrainingJobDefinitions":
return Optional.ofNullable(clazz.cast(trainingJobDefinitions()));
case "WarmStartConfig":
return Optional.ofNullable(clazz.cast(warmStartConfig()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function
*
* All training jobs launched by the new hyperparameter tuning job are evaluated by using the objective
* metric. If you specify IDENTICAL_DATA_AND_ALGORITHM
as the WarmStartType
* value for the warm start configuration, the training job that performs the best in the new tuning job
* is compared to the best training jobs from the parent tuning jobs. From these, the training job that
* performs the best as measured by the objective metric is returned as the overall best training job.
*
*
*
* All training jobs launched by parent hyperparameter tuning jobs and the new hyperparameter tuning jobs
* count against the limit of training jobs for the tuning job.
*
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder warmStartConfig(HyperParameterTuningJobWarmStartConfig warmStartConfig);
/**
*
* Specifies the configuration for starting the hyperparameter tuning job using one or more previous tuning jobs
* as a starting point. The results of previous tuning jobs are used to inform which combinations of
* hyperparameters to search over in the new tuning job.
*
*
* All training jobs launched by the new hyperparameter tuning job are evaluated by using the objective metric.
* If you specify IDENTICAL_DATA_AND_ALGORITHM
as the WarmStartType
value for the warm
* start configuration, the training job that performs the best in the new tuning job is compared to the best
* training jobs from the parent tuning jobs. From these, the training job that performs the best as measured by
* the objective metric is returned as the overall best training job.
*
*
*
* All training jobs launched by parent hyperparameter tuning jobs and the new hyperparameter tuning jobs count
* against the limit of training jobs for the tuning job.
*
* This is a convenience method that creates an instance of the
* {@link HyperParameterTuningJobWarmStartConfig.Builder} avoiding the need to create one manually via
* {@link HyperParameterTuningJobWarmStartConfig#builder()}.
*
* When the {@link Consumer} completes, {@link HyperParameterTuningJobWarmStartConfig.Builder#build()} is called
* immediately and its result is passed to {@link #warmStartConfig(HyperParameterTuningJobWarmStartConfig)}.
*
* @param warmStartConfig
* a consumer that will call methods on {@link HyperParameterTuningJobWarmStartConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #warmStartConfig(HyperParameterTuningJobWarmStartConfig)
*/
default Builder warmStartConfig(Consumer warmStartConfig) {
return warmStartConfig(HyperParameterTuningJobWarmStartConfig.builder().applyMutation(warmStartConfig).build());
}
/**
*
* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different
* ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services
* Resources.
*
*
* Tags that you specify for the tuning job are also added to all training jobs that the tuning job launches.
*
*
* @param tags
* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in
* different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services
* Resources.
*
* Tags that you specify for the tuning job are also added to all training jobs that the tuning job
* launches.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Collection tags);
/**
*
* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different
* ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services
* Resources.
*
*
* Tags that you specify for the tuning job are also added to all training jobs that the tuning job launches.
*
*
* @param tags
* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in
* different ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services
* Resources.
*
* Tags that you specify for the tuning job are also added to all training jobs that the tuning job
* launches.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder tags(Tag... tags);
/**
*
* An array of key-value pairs. You can use tags to categorize your Amazon Web Services resources in different
* ways, for example, by purpose, owner, or environment. For more information, see Tagging Amazon Web Services
* Resources.
*
*
* Tags that you specify for the tuning job are also added to all training jobs that the tuning job launches.
*
* This is a convenience method that creates an instance of the {@link List.Builder} avoiding the need to
* create one manually via {@link List#builder()}.
*
* When the {@link Consumer} completes, {@link List.Builder#build()} is called immediately and its result
* is passed to {@link #tags(List)}.
*
* @param tags
* a consumer that will call methods on {@link List.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #tags(List)
*/
Builder tags(Consumer... tags);
@Override
Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration);
@Override
Builder overrideConfiguration(Consumer builderConsumer);
}
static final class BuilderImpl extends SageMakerRequest.BuilderImpl implements Builder {
private String hyperParameterTuningJobName;
private HyperParameterTuningJobConfig hyperParameterTuningJobConfig;
private HyperParameterTrainingJobDefinition trainingJobDefinition;
private List trainingJobDefinitions = DefaultSdkAutoConstructList.getInstance();
private HyperParameterTuningJobWarmStartConfig warmStartConfig;
private List tags = DefaultSdkAutoConstructList.getInstance();
private BuilderImpl() {
}
private BuilderImpl(CreateHyperParameterTuningJobRequest model) {
super(model);
hyperParameterTuningJobName(model.hyperParameterTuningJobName);
hyperParameterTuningJobConfig(model.hyperParameterTuningJobConfig);
trainingJobDefinition(model.trainingJobDefinition);
trainingJobDefinitions(model.trainingJobDefinitions);
warmStartConfig(model.warmStartConfig);
tags(model.tags);
}
public final String getHyperParameterTuningJobName() {
return hyperParameterTuningJobName;
}
public final void setHyperParameterTuningJobName(String hyperParameterTuningJobName) {
this.hyperParameterTuningJobName = hyperParameterTuningJobName;
}
@Override
public final Builder hyperParameterTuningJobName(String hyperParameterTuningJobName) {
this.hyperParameterTuningJobName = hyperParameterTuningJobName;
return this;
}
public final HyperParameterTuningJobConfig.Builder getHyperParameterTuningJobConfig() {
return hyperParameterTuningJobConfig != null ? hyperParameterTuningJobConfig.toBuilder() : null;
}
public final void setHyperParameterTuningJobConfig(HyperParameterTuningJobConfig.BuilderImpl hyperParameterTuningJobConfig) {
this.hyperParameterTuningJobConfig = hyperParameterTuningJobConfig != null ? hyperParameterTuningJobConfig.build()
: null;
}
@Override
public final Builder hyperParameterTuningJobConfig(HyperParameterTuningJobConfig hyperParameterTuningJobConfig) {
this.hyperParameterTuningJobConfig = hyperParameterTuningJobConfig;
return this;
}
public final HyperParameterTrainingJobDefinition.Builder getTrainingJobDefinition() {
return trainingJobDefinition != null ? trainingJobDefinition.toBuilder() : null;
}
public final void setTrainingJobDefinition(HyperParameterTrainingJobDefinition.BuilderImpl trainingJobDefinition) {
this.trainingJobDefinition = trainingJobDefinition != null ? trainingJobDefinition.build() : null;
}
@Override
public final Builder trainingJobDefinition(HyperParameterTrainingJobDefinition trainingJobDefinition) {
this.trainingJobDefinition = trainingJobDefinition;
return this;
}
public final List getTrainingJobDefinitions() {
List result = HyperParameterTrainingJobDefinitionsCopier
.copyToBuilder(this.trainingJobDefinitions);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setTrainingJobDefinitions(
Collection trainingJobDefinitions) {
this.trainingJobDefinitions = HyperParameterTrainingJobDefinitionsCopier.copyFromBuilder(trainingJobDefinitions);
}
@Override
public final Builder trainingJobDefinitions(Collection trainingJobDefinitions) {
this.trainingJobDefinitions = HyperParameterTrainingJobDefinitionsCopier.copy(trainingJobDefinitions);
return this;
}
@Override
@SafeVarargs
public final Builder trainingJobDefinitions(HyperParameterTrainingJobDefinition... trainingJobDefinitions) {
trainingJobDefinitions(Arrays.asList(trainingJobDefinitions));
return this;
}
@Override
@SafeVarargs
public final Builder trainingJobDefinitions(
Consumer... trainingJobDefinitions) {
trainingJobDefinitions(Stream.of(trainingJobDefinitions)
.map(c -> HyperParameterTrainingJobDefinition.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final HyperParameterTuningJobWarmStartConfig.Builder getWarmStartConfig() {
return warmStartConfig != null ? warmStartConfig.toBuilder() : null;
}
public final void setWarmStartConfig(HyperParameterTuningJobWarmStartConfig.BuilderImpl warmStartConfig) {
this.warmStartConfig = warmStartConfig != null ? warmStartConfig.build() : null;
}
@Override
public final Builder warmStartConfig(HyperParameterTuningJobWarmStartConfig warmStartConfig) {
this.warmStartConfig = warmStartConfig;
return this;
}
public final List getTags() {
List result = TagListCopier.copyToBuilder(this.tags);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setTags(Collection tags) {
this.tags = TagListCopier.copyFromBuilder(tags);
}
@Override
public final Builder tags(Collection tags) {
this.tags = TagListCopier.copy(tags);
return this;
}
@Override
@SafeVarargs
public final Builder tags(Tag... tags) {
tags(Arrays.asList(tags));
return this;
}
@Override
@SafeVarargs
public final Builder tags(Consumer... tags) {
tags(Stream.of(tags).map(c -> Tag.builder().applyMutation(c).build()).collect(Collectors.toList()));
return this;
}
@Override
public Builder overrideConfiguration(AwsRequestOverrideConfiguration overrideConfiguration) {
super.overrideConfiguration(overrideConfiguration);
return this;
}
@Override
public Builder overrideConfiguration(Consumer builderConsumer) {
super.overrideConfiguration(builderConsumer);
return this;
}
@Override
public CreateHyperParameterTuningJobRequest build() {
return new CreateHyperParameterTuningJobRequest(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}