Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
software.amazon.awssdk.services.sagemaker.model.MonitoringJobDefinition 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
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package software.amazon.awssdk.services.sagemaker.model;
import java.io.Serializable;
import java.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;
/**
*
* Defines the monitoring job.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class MonitoringJobDefinition implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField BASELINE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("BaselineConfig")
.getter(getter(MonitoringJobDefinition::baselineConfig)).setter(setter(Builder::baselineConfig))
.constructor(MonitoringBaselineConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("BaselineConfig").build()).build();
private static final SdkField> MONITORING_INPUTS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("MonitoringInputs")
.getter(getter(MonitoringJobDefinition::monitoringInputs))
.setter(setter(Builder::monitoringInputs))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringInputs").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(MonitoringInput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField MONITORING_OUTPUT_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("MonitoringOutputConfig")
.getter(getter(MonitoringJobDefinition::monitoringOutputConfig)).setter(setter(Builder::monitoringOutputConfig))
.constructor(MonitoringOutputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringOutputConfig").build())
.build();
private static final SdkField MONITORING_RESOURCES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("MonitoringResources")
.getter(getter(MonitoringJobDefinition::monitoringResources)).setter(setter(Builder::monitoringResources))
.constructor(MonitoringResources::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringResources").build())
.build();
private static final SdkField MONITORING_APP_SPECIFICATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("MonitoringAppSpecification")
.getter(getter(MonitoringJobDefinition::monitoringAppSpecification))
.setter(setter(Builder::monitoringAppSpecification))
.constructor(MonitoringAppSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MonitoringAppSpecification").build())
.build();
private static final SdkField STOPPING_CONDITION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("StoppingCondition")
.getter(getter(MonitoringJobDefinition::stoppingCondition)).setter(setter(Builder::stoppingCondition))
.constructor(MonitoringStoppingCondition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StoppingCondition").build()).build();
private static final SdkField> ENVIRONMENT_FIELD = SdkField
.> builder(MarshallingType.MAP)
.memberName("Environment")
.getter(getter(MonitoringJobDefinition::environment))
.setter(setter(Builder::environment))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Environment").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 NETWORK_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("NetworkConfig")
.getter(getter(MonitoringJobDefinition::networkConfig)).setter(setter(Builder::networkConfig))
.constructor(NetworkConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NetworkConfig").build()).build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RoleArn").getter(getter(MonitoringJobDefinition::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays
.asList(BASELINE_CONFIG_FIELD, MONITORING_INPUTS_FIELD, MONITORING_OUTPUT_CONFIG_FIELD, MONITORING_RESOURCES_FIELD,
MONITORING_APP_SPECIFICATION_FIELD, STOPPING_CONDITION_FIELD, ENVIRONMENT_FIELD, NETWORK_CONFIG_FIELD,
ROLE_ARN_FIELD));
private static final long serialVersionUID = 1L;
private final MonitoringBaselineConfig baselineConfig;
private final List monitoringInputs;
private final MonitoringOutputConfig monitoringOutputConfig;
private final MonitoringResources monitoringResources;
private final MonitoringAppSpecification monitoringAppSpecification;
private final MonitoringStoppingCondition stoppingCondition;
private final Map environment;
private final NetworkConfig networkConfig;
private final String roleArn;
private MonitoringJobDefinition(BuilderImpl builder) {
this.baselineConfig = builder.baselineConfig;
this.monitoringInputs = builder.monitoringInputs;
this.monitoringOutputConfig = builder.monitoringOutputConfig;
this.monitoringResources = builder.monitoringResources;
this.monitoringAppSpecification = builder.monitoringAppSpecification;
this.stoppingCondition = builder.stoppingCondition;
this.environment = builder.environment;
this.networkConfig = builder.networkConfig;
this.roleArn = builder.roleArn;
}
/**
*
* Baseline configuration used to validate that the data conforms to the specified constraints and statistics
*
*
* @return Baseline configuration used to validate that the data conforms to the specified constraints and
* statistics
*/
public final MonitoringBaselineConfig baselineConfig() {
return baselineConfig;
}
/**
* For responses, this returns true if the service returned a value for the MonitoringInputs 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 hasMonitoringInputs() {
return monitoringInputs != null && !(monitoringInputs instanceof SdkAutoConstructList);
}
/**
*
* The array of inputs for the monitoring job. Currently we support monitoring an Amazon SageMaker Endpoint.
*
*
* 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 #hasMonitoringInputs} method.
*
*
* @return The array of inputs for the monitoring job. Currently we support monitoring an Amazon SageMaker Endpoint.
*/
public final List monitoringInputs() {
return monitoringInputs;
}
/**
*
* The array of outputs from the monitoring job to be uploaded to Amazon S3.
*
*
* @return The array of outputs from the monitoring job to be uploaded to Amazon S3.
*/
public final MonitoringOutputConfig monitoringOutputConfig() {
return monitoringOutputConfig;
}
/**
*
* Identifies the resources, ML compute instances, and ML storage volumes to deploy for a monitoring job. In
* distributed processing, you specify more than one instance.
*
*
* @return Identifies the resources, ML compute instances, and ML storage volumes to deploy for a monitoring job. In
* distributed processing, you specify more than one instance.
*/
public final MonitoringResources monitoringResources() {
return monitoringResources;
}
/**
*
* Configures the monitoring job to run a specified Docker container image.
*
*
* @return Configures the monitoring job to run a specified Docker container image.
*/
public final MonitoringAppSpecification monitoringAppSpecification() {
return monitoringAppSpecification;
}
/**
*
* Specifies a time limit for how long the monitoring job is allowed to run.
*
*
* @return Specifies a time limit for how long the monitoring job is allowed to run.
*/
public final MonitoringStoppingCondition stoppingCondition() {
return stoppingCondition;
}
/**
* For responses, this returns true if the service returned a value for the Environment 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 hasEnvironment() {
return environment != null && !(environment instanceof SdkAutoConstructMap);
}
/**
*
* Sets the environment variables in the Docker container.
*
*
* 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 #hasEnvironment} method.
*
*
* @return Sets the environment variables in the Docker container.
*/
public final Map environment() {
return environment;
}
/**
*
* Specifies networking options for an monitoring job.
*
*
* @return Specifies networking options for an monitoring job.
*/
public final NetworkConfig networkConfig() {
return networkConfig;
}
/**
*
* The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your behalf.
*
*
* @return The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your
* behalf.
*/
public final String roleArn() {
return roleArn;
}
@Override
public Builder toBuilder() {
return new BuilderImpl(this);
}
public static Builder builder() {
return new BuilderImpl();
}
public static Class serializableBuilderClass() {
return BuilderImpl.class;
}
@Override
public final int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(baselineConfig());
hashCode = 31 * hashCode + Objects.hashCode(hasMonitoringInputs() ? monitoringInputs() : null);
hashCode = 31 * hashCode + Objects.hashCode(monitoringOutputConfig());
hashCode = 31 * hashCode + Objects.hashCode(monitoringResources());
hashCode = 31 * hashCode + Objects.hashCode(monitoringAppSpecification());
hashCode = 31 * hashCode + Objects.hashCode(stoppingCondition());
hashCode = 31 * hashCode + Objects.hashCode(hasEnvironment() ? environment() : null);
hashCode = 31 * hashCode + Objects.hashCode(networkConfig());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
return hashCode;
}
@Override
public final boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public final boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof MonitoringJobDefinition)) {
return false;
}
MonitoringJobDefinition other = (MonitoringJobDefinition) obj;
return Objects.equals(baselineConfig(), other.baselineConfig()) && hasMonitoringInputs() == other.hasMonitoringInputs()
&& Objects.equals(monitoringInputs(), other.monitoringInputs())
&& Objects.equals(monitoringOutputConfig(), other.monitoringOutputConfig())
&& Objects.equals(monitoringResources(), other.monitoringResources())
&& Objects.equals(monitoringAppSpecification(), other.monitoringAppSpecification())
&& Objects.equals(stoppingCondition(), other.stoppingCondition()) && hasEnvironment() == other.hasEnvironment()
&& Objects.equals(environment(), other.environment()) && Objects.equals(networkConfig(), other.networkConfig())
&& Objects.equals(roleArn(), other.roleArn());
}
/**
* 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("MonitoringJobDefinition").add("BaselineConfig", baselineConfig())
.add("MonitoringInputs", hasMonitoringInputs() ? monitoringInputs() : null)
.add("MonitoringOutputConfig", monitoringOutputConfig()).add("MonitoringResources", monitoringResources())
.add("MonitoringAppSpecification", monitoringAppSpecification()).add("StoppingCondition", stoppingCondition())
.add("Environment", hasEnvironment() ? environment() : null).add("NetworkConfig", networkConfig())
.add("RoleArn", roleArn()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "BaselineConfig":
return Optional.ofNullable(clazz.cast(baselineConfig()));
case "MonitoringInputs":
return Optional.ofNullable(clazz.cast(monitoringInputs()));
case "MonitoringOutputConfig":
return Optional.ofNullable(clazz.cast(monitoringOutputConfig()));
case "MonitoringResources":
return Optional.ofNullable(clazz.cast(monitoringResources()));
case "MonitoringAppSpecification":
return Optional.ofNullable(clazz.cast(monitoringAppSpecification()));
case "StoppingCondition":
return Optional.ofNullable(clazz.cast(stoppingCondition()));
case "Environment":
return Optional.ofNullable(clazz.cast(environment()));
case "NetworkConfig":
return Optional.ofNullable(clazz.cast(networkConfig()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function getter(Function g) {
return obj -> g.apply((MonitoringJobDefinition) obj);
}
private static BiConsumer setter(BiConsumer s) {
return (obj, val) -> s.accept((Builder) obj, val);
}
public interface Builder extends SdkPojo, CopyableBuilder {
/**
*
* Baseline configuration used to validate that the data conforms to the specified constraints and statistics
*
*
* @param baselineConfig
* Baseline configuration used to validate that the data conforms to the specified constraints and
* statistics
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder baselineConfig(MonitoringBaselineConfig baselineConfig);
/**
*
* Baseline configuration used to validate that the data conforms to the specified constraints and statistics
*
* This is a convenience method that creates an instance of the {@link MonitoringBaselineConfig.Builder}
* avoiding the need to create one manually via {@link MonitoringBaselineConfig#builder()}.
*
*
* When the {@link Consumer} completes, {@link MonitoringBaselineConfig.Builder#build()} is called immediately
* and its result is passed to {@link #baselineConfig(MonitoringBaselineConfig)}.
*
* @param baselineConfig
* a consumer that will call methods on {@link MonitoringBaselineConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #baselineConfig(MonitoringBaselineConfig)
*/
default Builder baselineConfig(Consumer baselineConfig) {
return baselineConfig(MonitoringBaselineConfig.builder().applyMutation(baselineConfig).build());
}
/**
*
* The array of inputs for the monitoring job. Currently we support monitoring an Amazon SageMaker Endpoint.
*
*
* @param monitoringInputs
* The array of inputs for the monitoring job. Currently we support monitoring an Amazon SageMaker
* Endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder monitoringInputs(Collection monitoringInputs);
/**
*
* The array of inputs for the monitoring job. Currently we support monitoring an Amazon SageMaker Endpoint.
*
*
* @param monitoringInputs
* The array of inputs for the monitoring job. Currently we support monitoring an Amazon SageMaker
* Endpoint.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder monitoringInputs(MonitoringInput... monitoringInputs);
/**
*
* The array of inputs for the monitoring job. Currently we support monitoring an Amazon SageMaker Endpoint.
*
* This is a convenience method that creates an instance of the
* {@link software.amazon.awssdk.services.sagemaker.model.MonitoringInput.Builder} avoiding the need to create
* one manually via {@link software.amazon.awssdk.services.sagemaker.model.MonitoringInput#builder()}.
*
*
* When the {@link Consumer} completes,
* {@link software.amazon.awssdk.services.sagemaker.model.MonitoringInput.Builder#build()} is called immediately
* and its result is passed to {@link #monitoringInputs(List)}.
*
* @param monitoringInputs
* a consumer that will call methods on
* {@link software.amazon.awssdk.services.sagemaker.model.MonitoringInput.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #monitoringInputs(java.util.Collection)
*/
Builder monitoringInputs(Consumer... monitoringInputs);
/**
*
* The array of outputs from the monitoring job to be uploaded to Amazon S3.
*
*
* @param monitoringOutputConfig
* The array of outputs from the monitoring job to be uploaded to Amazon S3.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder monitoringOutputConfig(MonitoringOutputConfig monitoringOutputConfig);
/**
*
* The array of outputs from the monitoring job to be uploaded to Amazon S3.
*
* This is a convenience method that creates an instance of the {@link MonitoringOutputConfig.Builder} avoiding
* the need to create one manually via {@link MonitoringOutputConfig#builder()}.
*
*
* When the {@link Consumer} completes, {@link MonitoringOutputConfig.Builder#build()} is called immediately and
* its result is passed to {@link #monitoringOutputConfig(MonitoringOutputConfig)}.
*
* @param monitoringOutputConfig
* a consumer that will call methods on {@link MonitoringOutputConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #monitoringOutputConfig(MonitoringOutputConfig)
*/
default Builder monitoringOutputConfig(Consumer monitoringOutputConfig) {
return monitoringOutputConfig(MonitoringOutputConfig.builder().applyMutation(monitoringOutputConfig).build());
}
/**
*
* Identifies the resources, ML compute instances, and ML storage volumes to deploy for a monitoring job. In
* distributed processing, you specify more than one instance.
*
*
* @param monitoringResources
* Identifies the resources, ML compute instances, and ML storage volumes to deploy for a monitoring job.
* In distributed processing, you specify more than one instance.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder monitoringResources(MonitoringResources monitoringResources);
/**
*
* Identifies the resources, ML compute instances, and ML storage volumes to deploy for a monitoring job. In
* distributed processing, you specify more than one instance.
*
* This is a convenience method that creates an instance of the {@link MonitoringResources.Builder} avoiding the
* need to create one manually via {@link MonitoringResources#builder()}.
*
*
* When the {@link Consumer} completes, {@link MonitoringResources.Builder#build()} is called immediately and
* its result is passed to {@link #monitoringResources(MonitoringResources)}.
*
* @param monitoringResources
* a consumer that will call methods on {@link MonitoringResources.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #monitoringResources(MonitoringResources)
*/
default Builder monitoringResources(Consumer monitoringResources) {
return monitoringResources(MonitoringResources.builder().applyMutation(monitoringResources).build());
}
/**
*
* Configures the monitoring job to run a specified Docker container image.
*
*
* @param monitoringAppSpecification
* Configures the monitoring job to run a specified Docker container image.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder monitoringAppSpecification(MonitoringAppSpecification monitoringAppSpecification);
/**
*
* Configures the monitoring job to run a specified Docker container image.
*
* This is a convenience method that creates an instance of the {@link MonitoringAppSpecification.Builder}
* avoiding the need to create one manually via {@link MonitoringAppSpecification#builder()}.
*
*
* When the {@link Consumer} completes, {@link MonitoringAppSpecification.Builder#build()} is called immediately
* and its result is passed to {@link #monitoringAppSpecification(MonitoringAppSpecification)}.
*
* @param monitoringAppSpecification
* a consumer that will call methods on {@link MonitoringAppSpecification.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #monitoringAppSpecification(MonitoringAppSpecification)
*/
default Builder monitoringAppSpecification(Consumer monitoringAppSpecification) {
return monitoringAppSpecification(MonitoringAppSpecification.builder().applyMutation(monitoringAppSpecification)
.build());
}
/**
*
* Specifies a time limit for how long the monitoring job is allowed to run.
*
*
* @param stoppingCondition
* Specifies a time limit for how long the monitoring job is allowed to run.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder stoppingCondition(MonitoringStoppingCondition stoppingCondition);
/**
*
* Specifies a time limit for how long the monitoring job is allowed to run.
*
* This is a convenience method that creates an instance of the {@link MonitoringStoppingCondition.Builder}
* avoiding the need to create one manually via {@link MonitoringStoppingCondition#builder()}.
*
*
* When the {@link Consumer} completes, {@link MonitoringStoppingCondition.Builder#build()} is called
* immediately and its result is passed to {@link #stoppingCondition(MonitoringStoppingCondition)}.
*
* @param stoppingCondition
* a consumer that will call methods on {@link MonitoringStoppingCondition.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #stoppingCondition(MonitoringStoppingCondition)
*/
default Builder stoppingCondition(Consumer stoppingCondition) {
return stoppingCondition(MonitoringStoppingCondition.builder().applyMutation(stoppingCondition).build());
}
/**
*
* Sets the environment variables in the Docker container.
*
*
* @param environment
* Sets the environment variables in the Docker container.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder environment(Map environment);
/**
*
* Specifies networking options for an monitoring job.
*
*
* @param networkConfig
* Specifies networking options for an monitoring job.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder networkConfig(NetworkConfig networkConfig);
/**
*
* Specifies networking options for an monitoring job.
*
* This is a convenience method that creates an instance of the {@link NetworkConfig.Builder} avoiding the need
* to create one manually via {@link NetworkConfig#builder()}.
*
*
* When the {@link Consumer} completes, {@link NetworkConfig.Builder#build()} is called immediately and its
* result is passed to {@link #networkConfig(NetworkConfig)}.
*
* @param networkConfig
* a consumer that will call methods on {@link NetworkConfig.Builder}
* @return Returns a reference to this object so that method calls can be chained together.
* @see #networkConfig(NetworkConfig)
*/
default Builder networkConfig(Consumer networkConfig) {
return networkConfig(NetworkConfig.builder().applyMutation(networkConfig).build());
}
/**
*
* The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on your
* behalf.
*
*
* @param roleArn
* The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker can assume to perform tasks on
* your behalf.
* @return Returns a reference to this object so that method calls can be chained together.
*/
Builder roleArn(String roleArn);
}
static final class BuilderImpl implements Builder {
private MonitoringBaselineConfig baselineConfig;
private List monitoringInputs = DefaultSdkAutoConstructList.getInstance();
private MonitoringOutputConfig monitoringOutputConfig;
private MonitoringResources monitoringResources;
private MonitoringAppSpecification monitoringAppSpecification;
private MonitoringStoppingCondition stoppingCondition;
private Map environment = DefaultSdkAutoConstructMap.getInstance();
private NetworkConfig networkConfig;
private String roleArn;
private BuilderImpl() {
}
private BuilderImpl(MonitoringJobDefinition model) {
baselineConfig(model.baselineConfig);
monitoringInputs(model.monitoringInputs);
monitoringOutputConfig(model.monitoringOutputConfig);
monitoringResources(model.monitoringResources);
monitoringAppSpecification(model.monitoringAppSpecification);
stoppingCondition(model.stoppingCondition);
environment(model.environment);
networkConfig(model.networkConfig);
roleArn(model.roleArn);
}
public final MonitoringBaselineConfig.Builder getBaselineConfig() {
return baselineConfig != null ? baselineConfig.toBuilder() : null;
}
public final void setBaselineConfig(MonitoringBaselineConfig.BuilderImpl baselineConfig) {
this.baselineConfig = baselineConfig != null ? baselineConfig.build() : null;
}
@Override
public final Builder baselineConfig(MonitoringBaselineConfig baselineConfig) {
this.baselineConfig = baselineConfig;
return this;
}
public final List getMonitoringInputs() {
List result = MonitoringInputsCopier.copyToBuilder(this.monitoringInputs);
if (result instanceof SdkAutoConstructList) {
return null;
}
return result;
}
public final void setMonitoringInputs(Collection monitoringInputs) {
this.monitoringInputs = MonitoringInputsCopier.copyFromBuilder(monitoringInputs);
}
@Override
public final Builder monitoringInputs(Collection monitoringInputs) {
this.monitoringInputs = MonitoringInputsCopier.copy(monitoringInputs);
return this;
}
@Override
@SafeVarargs
public final Builder monitoringInputs(MonitoringInput... monitoringInputs) {
monitoringInputs(Arrays.asList(monitoringInputs));
return this;
}
@Override
@SafeVarargs
public final Builder monitoringInputs(Consumer... monitoringInputs) {
monitoringInputs(Stream.of(monitoringInputs).map(c -> MonitoringInput.builder().applyMutation(c).build())
.collect(Collectors.toList()));
return this;
}
public final MonitoringOutputConfig.Builder getMonitoringOutputConfig() {
return monitoringOutputConfig != null ? monitoringOutputConfig.toBuilder() : null;
}
public final void setMonitoringOutputConfig(MonitoringOutputConfig.BuilderImpl monitoringOutputConfig) {
this.monitoringOutputConfig = monitoringOutputConfig != null ? monitoringOutputConfig.build() : null;
}
@Override
public final Builder monitoringOutputConfig(MonitoringOutputConfig monitoringOutputConfig) {
this.monitoringOutputConfig = monitoringOutputConfig;
return this;
}
public final MonitoringResources.Builder getMonitoringResources() {
return monitoringResources != null ? monitoringResources.toBuilder() : null;
}
public final void setMonitoringResources(MonitoringResources.BuilderImpl monitoringResources) {
this.monitoringResources = monitoringResources != null ? monitoringResources.build() : null;
}
@Override
public final Builder monitoringResources(MonitoringResources monitoringResources) {
this.monitoringResources = monitoringResources;
return this;
}
public final MonitoringAppSpecification.Builder getMonitoringAppSpecification() {
return monitoringAppSpecification != null ? monitoringAppSpecification.toBuilder() : null;
}
public final void setMonitoringAppSpecification(MonitoringAppSpecification.BuilderImpl monitoringAppSpecification) {
this.monitoringAppSpecification = monitoringAppSpecification != null ? monitoringAppSpecification.build() : null;
}
@Override
public final Builder monitoringAppSpecification(MonitoringAppSpecification monitoringAppSpecification) {
this.monitoringAppSpecification = monitoringAppSpecification;
return this;
}
public final MonitoringStoppingCondition.Builder getStoppingCondition() {
return stoppingCondition != null ? stoppingCondition.toBuilder() : null;
}
public final void setStoppingCondition(MonitoringStoppingCondition.BuilderImpl stoppingCondition) {
this.stoppingCondition = stoppingCondition != null ? stoppingCondition.build() : null;
}
@Override
public final Builder stoppingCondition(MonitoringStoppingCondition stoppingCondition) {
this.stoppingCondition = stoppingCondition;
return this;
}
public final Map getEnvironment() {
if (environment instanceof SdkAutoConstructMap) {
return null;
}
return environment;
}
public final void setEnvironment(Map environment) {
this.environment = MonitoringEnvironmentMapCopier.copy(environment);
}
@Override
public final Builder environment(Map environment) {
this.environment = MonitoringEnvironmentMapCopier.copy(environment);
return this;
}
public final NetworkConfig.Builder getNetworkConfig() {
return networkConfig != null ? networkConfig.toBuilder() : null;
}
public final void setNetworkConfig(NetworkConfig.BuilderImpl networkConfig) {
this.networkConfig = networkConfig != null ? networkConfig.build() : null;
}
@Override
public final Builder networkConfig(NetworkConfig networkConfig) {
this.networkConfig = networkConfig;
return this;
}
public final String getRoleArn() {
return roleArn;
}
public final void setRoleArn(String roleArn) {
this.roleArn = roleArn;
}
@Override
public final Builder roleArn(String roleArn) {
this.roleArn = roleArn;
return this;
}
@Override
public MonitoringJobDefinition build() {
return new MonitoringJobDefinition(this);
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
}
}