software.amazon.awssdk.services.sagemaker.model.CreateDataQualityJobDefinitionRequest Maven / Gradle / Ivy
Show all versions of sagemaker Show documentation
/*
* 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.HashMap;
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.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 CreateDataQualityJobDefinitionRequest extends SageMakerRequest implements
ToCopyableBuilder {
private static final SdkField JOB_DEFINITION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("JobDefinitionName").getter(getter(CreateDataQualityJobDefinitionRequest::jobDefinitionName))
.setter(setter(Builder::jobDefinitionName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobDefinitionName").build()).build();
private static final SdkField DATA_QUALITY_BASELINE_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DataQualityBaselineConfig")
.getter(getter(CreateDataQualityJobDefinitionRequest::dataQualityBaselineConfig))
.setter(setter(Builder::dataQualityBaselineConfig)).constructor(DataQualityBaselineConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataQualityBaselineConfig").build())
.build();
private static final SdkField DATA_QUALITY_APP_SPECIFICATION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("DataQualityAppSpecification")
.getter(getter(CreateDataQualityJobDefinitionRequest::dataQualityAppSpecification))
.setter(setter(Builder::dataQualityAppSpecification))
.constructor(DataQualityAppSpecification::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataQualityAppSpecification")
.build()).build();
private static final SdkField DATA_QUALITY_JOB_INPUT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("DataQualityJobInput")
.getter(getter(CreateDataQualityJobDefinitionRequest::dataQualityJobInput))
.setter(setter(Builder::dataQualityJobInput)).constructor(DataQualityJobInput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataQualityJobInput").build())
.build();
private static final SdkField DATA_QUALITY_JOB_OUTPUT_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO)
.memberName("DataQualityJobOutputConfig")
.getter(getter(CreateDataQualityJobDefinitionRequest::dataQualityJobOutputConfig))
.setter(setter(Builder::dataQualityJobOutputConfig))
.constructor(MonitoringOutputConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("DataQualityJobOutputConfig").build())
.build();
private static final SdkField JOB_RESOURCES_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("JobResources")
.getter(getter(CreateDataQualityJobDefinitionRequest::jobResources)).setter(setter(Builder::jobResources))
.constructor(MonitoringResources::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("JobResources").build()).build();
private static final SdkField NETWORK_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("NetworkConfig")
.getter(getter(CreateDataQualityJobDefinitionRequest::networkConfig)).setter(setter(Builder::networkConfig))
.constructor(MonitoringNetworkConfig::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(CreateDataQualityJobDefinitionRequest::roleArn))
.setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RoleArn").build()).build();
private static final SdkField STOPPING_CONDITION_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("StoppingCondition")
.getter(getter(CreateDataQualityJobDefinitionRequest::stoppingCondition)).setter(setter(Builder::stoppingCondition))
.constructor(MonitoringStoppingCondition::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StoppingCondition").build()).build();
private static final SdkField> TAGS_FIELD = SdkField
.> builder(MarshallingType.LIST)
.memberName("Tags")
.getter(getter(CreateDataQualityJobDefinitionRequest::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(JOB_DEFINITION_NAME_FIELD,
DATA_QUALITY_BASELINE_CONFIG_FIELD, DATA_QUALITY_APP_SPECIFICATION_FIELD, DATA_QUALITY_JOB_INPUT_FIELD,
DATA_QUALITY_JOB_OUTPUT_CONFIG_FIELD, JOB_RESOURCES_FIELD, NETWORK_CONFIG_FIELD, ROLE_ARN_FIELD,
STOPPING_CONDITION_FIELD, TAGS_FIELD));
private static final Map> SDK_NAME_TO_FIELD = memberNameToFieldInitializer();
private final String jobDefinitionName;
private final DataQualityBaselineConfig dataQualityBaselineConfig;
private final DataQualityAppSpecification dataQualityAppSpecification;
private final DataQualityJobInput dataQualityJobInput;
private final MonitoringOutputConfig dataQualityJobOutputConfig;
private final MonitoringResources jobResources;
private final MonitoringNetworkConfig networkConfig;
private final String roleArn;
private final MonitoringStoppingCondition stoppingCondition;
private final List tags;
private CreateDataQualityJobDefinitionRequest(BuilderImpl builder) {
super(builder);
this.jobDefinitionName = builder.jobDefinitionName;
this.dataQualityBaselineConfig = builder.dataQualityBaselineConfig;
this.dataQualityAppSpecification = builder.dataQualityAppSpecification;
this.dataQualityJobInput = builder.dataQualityJobInput;
this.dataQualityJobOutputConfig = builder.dataQualityJobOutputConfig;
this.jobResources = builder.jobResources;
this.networkConfig = builder.networkConfig;
this.roleArn = builder.roleArn;
this.stoppingCondition = builder.stoppingCondition;
this.tags = builder.tags;
}
/**
*
* The name for the monitoring job definition.
*
*
* @return The name for the monitoring job definition.
*/
public final String jobDefinitionName() {
return jobDefinitionName;
}
/**
*
* Configures the constraints and baselines for the monitoring job.
*
*
* @return Configures the constraints and baselines for the monitoring job.
*/
public final DataQualityBaselineConfig dataQualityBaselineConfig() {
return dataQualityBaselineConfig;
}
/**
*
* Specifies the container that runs the monitoring job.
*
*
* @return Specifies the container that runs the monitoring job.
*/
public final DataQualityAppSpecification dataQualityAppSpecification() {
return dataQualityAppSpecification;
}
/**
*
* A list of inputs for the monitoring job. Currently endpoints are supported as monitoring inputs.
*
*
* @return A list of inputs for the monitoring job. Currently endpoints are supported as monitoring inputs.
*/
public final DataQualityJobInput dataQualityJobInput() {
return dataQualityJobInput;
}
/**
* Returns the value of the DataQualityJobOutputConfig property for this object.
*
* @return The value of the DataQualityJobOutputConfig property for this object.
*/
public final MonitoringOutputConfig dataQualityJobOutputConfig() {
return dataQualityJobOutputConfig;
}
/**
* Returns the value of the JobResources property for this object.
*
* @return The value of the JobResources property for this object.
*/
public final MonitoringResources jobResources() {
return jobResources;
}
/**
*
* Specifies networking configuration for the monitoring job.
*
*
* @return Specifies networking configuration for the monitoring job.
*/
public final MonitoringNetworkConfig networkConfig() {
return networkConfig;
}
/**
*
* The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on your
* behalf.
*
*
* @return The Amazon Resource Name (ARN) of an IAM role that Amazon SageMaker AI can assume to perform tasks on
* your behalf.
*/
public final String roleArn() {
return roleArn;
}
/**
* Returns the value of the StoppingCondition property for this object.
*
* @return The value of the StoppingCondition property for this object.
*/
public final MonitoringStoppingCondition stoppingCondition() {
return stoppingCondition;
}
/**
* 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);
}
/**
*
* (Optional) An array of key-value pairs. For more information, see
* Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User Guide.
*
*
* 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 (Optional) An array of key-value pairs. For more information, see Using Cost Allocation Tags in the Amazon Web Services Billing and Cost Management User
* Guide.
*/
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(jobDefinitionName());
hashCode = 31 * hashCode + Objects.hashCode(dataQualityBaselineConfig());
hashCode = 31 * hashCode + Objects.hashCode(dataQualityAppSpecification());
hashCode = 31 * hashCode + Objects.hashCode(dataQualityJobInput());
hashCode = 31 * hashCode + Objects.hashCode(dataQualityJobOutputConfig());
hashCode = 31 * hashCode + Objects.hashCode(jobResources());
hashCode = 31 * hashCode + Objects.hashCode(networkConfig());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(stoppingCondition());
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 CreateDataQualityJobDefinitionRequest)) {
return false;
}
CreateDataQualityJobDefinitionRequest other = (CreateDataQualityJobDefinitionRequest) obj;
return Objects.equals(jobDefinitionName(), other.jobDefinitionName())
&& Objects.equals(dataQualityBaselineConfig(), other.dataQualityBaselineConfig())
&& Objects.equals(dataQualityAppSpecification(), other.dataQualityAppSpecification())
&& Objects.equals(dataQualityJobInput(), other.dataQualityJobInput())
&& Objects.equals(dataQualityJobOutputConfig(), other.dataQualityJobOutputConfig())
&& Objects.equals(jobResources(), other.jobResources()) && Objects.equals(networkConfig(), other.networkConfig())
&& Objects.equals(roleArn(), other.roleArn()) && Objects.equals(stoppingCondition(), other.stoppingCondition())
&& 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("CreateDataQualityJobDefinitionRequest").add("JobDefinitionName", jobDefinitionName())
.add("DataQualityBaselineConfig", dataQualityBaselineConfig())
.add("DataQualityAppSpecification", dataQualityAppSpecification())
.add("DataQualityJobInput", dataQualityJobInput())
.add("DataQualityJobOutputConfig", dataQualityJobOutputConfig()).add("JobResources", jobResources())
.add("NetworkConfig", networkConfig()).add("RoleArn", roleArn()).add("StoppingCondition", stoppingCondition())
.add("Tags", hasTags() ? tags() : null).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "JobDefinitionName":
return Optional.ofNullable(clazz.cast(jobDefinitionName()));
case "DataQualityBaselineConfig":
return Optional.ofNullable(clazz.cast(dataQualityBaselineConfig()));
case "DataQualityAppSpecification":
return Optional.ofNullable(clazz.cast(dataQualityAppSpecification()));
case "DataQualityJobInput":
return Optional.ofNullable(clazz.cast(dataQualityJobInput()));
case "DataQualityJobOutputConfig":
return Optional.ofNullable(clazz.cast(dataQualityJobOutputConfig()));
case "JobResources":
return Optional.ofNullable(clazz.cast(jobResources()));
case "NetworkConfig":
return Optional.ofNullable(clazz.cast(networkConfig()));
case "RoleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "StoppingCondition":
return Optional.ofNullable(clazz.cast(stoppingCondition()));
case "Tags":
return Optional.ofNullable(clazz.cast(tags()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Map> memberNameToFieldInitializer() {
Map> map = new HashMap<>();
map.put("JobDefinitionName", JOB_DEFINITION_NAME_FIELD);
map.put("DataQualityBaselineConfig", DATA_QUALITY_BASELINE_CONFIG_FIELD);
map.put("DataQualityAppSpecification", DATA_QUALITY_APP_SPECIFICATION_FIELD);
map.put("DataQualityJobInput", DATA_QUALITY_JOB_INPUT_FIELD);
map.put("DataQualityJobOutputConfig", DATA_QUALITY_JOB_OUTPUT_CONFIG_FIELD);
map.put("JobResources", JOB_RESOURCES_FIELD);
map.put("NetworkConfig", NETWORK_CONFIG_FIELD);
map.put("RoleArn", ROLE_ARN_FIELD);
map.put("StoppingCondition", STOPPING_CONDITION_FIELD);
map.put("Tags", TAGS_FIELD);
return Collections.unmodifiableMap(map);
}
private static Function