
software.amazon.awssdk.services.glue.model.MLTransform 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.glue.model;
import java.io.Serializable;
import java.time.Instant;
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.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;
/**
*
* A structure for a machine learning transform.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class MLTransform implements SdkPojo, Serializable, ToCopyableBuilder {
private static final SdkField TRANSFORM_ID_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MLTransform::transformId)).setter(setter(Builder::transformId))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("TransformId").build()).build();
private static final SdkField NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MLTransform::name)).setter(setter(Builder::name))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Name").build()).build();
private static final SdkField DESCRIPTION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MLTransform::description)).setter(setter(Builder::description))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Description").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MLTransform::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField CREATED_ON_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(MLTransform::createdOn)).setter(setter(Builder::createdOn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedOn").build()).build();
private static final SdkField LAST_MODIFIED_ON_FIELD = SdkField. builder(MarshallingType.INSTANT)
.getter(getter(MLTransform::lastModifiedOn)).setter(setter(Builder::lastModifiedOn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedOn").build()).build();
private static final SdkField> INPUT_RECORD_TABLES_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(MLTransform::inputRecordTables))
.setter(setter(Builder::inputRecordTables))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("InputRecordTables").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(GlueTable::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField PARAMETERS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(MLTransform::parameters))
.setter(setter(Builder::parameters)).constructor(TransformParameters::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Parameters").build()).build();
private static final SdkField EVALUATION_METRICS_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).getter(getter(MLTransform::evaluationMetrics))
.setter(setter(Builder::evaluationMetrics)).constructor(EvaluationMetrics::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("EvaluationMetrics").build()).build();
private static final SdkField LABEL_COUNT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(MLTransform::labelCount)).setter(setter(Builder::labelCount))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LabelCount").build()).build();
private static final SdkField> SCHEMA_FIELD = SdkField
.> builder(MarshallingType.LIST)
.getter(getter(MLTransform::schema))
.setter(setter(Builder::schema))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Schema").build(),
ListTrait
.builder()
.memberLocationName(null)
.memberFieldInfo(
SdkField. builder(MarshallingType.SDK_POJO)
.constructor(SchemaColumn::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD)
.locationName("member").build()).build()).build()).build();
private static final SdkField ROLE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MLTransform::role)).setter(setter(Builder::role))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Role").build()).build();
private static final SdkField GLUE_VERSION_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MLTransform::glueVersion)).setter(setter(Builder::glueVersion))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("GlueVersion").build()).build();
private static final SdkField MAX_CAPACITY_FIELD = SdkField. builder(MarshallingType.DOUBLE)
.getter(getter(MLTransform::maxCapacity)).setter(setter(Builder::maxCapacity))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxCapacity").build()).build();
private static final SdkField WORKER_TYPE_FIELD = SdkField. builder(MarshallingType.STRING)
.getter(getter(MLTransform::workerTypeAsString)).setter(setter(Builder::workerType))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("WorkerType").build()).build();
private static final SdkField NUMBER_OF_WORKERS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(MLTransform::numberOfWorkers)).setter(setter(Builder::numberOfWorkers))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("NumberOfWorkers").build()).build();
private static final SdkField TIMEOUT_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(MLTransform::timeout)).setter(setter(Builder::timeout))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Timeout").build()).build();
private static final SdkField MAX_RETRIES_FIELD = SdkField. builder(MarshallingType.INTEGER)
.getter(getter(MLTransform::maxRetries)).setter(setter(Builder::maxRetries))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("MaxRetries").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(TRANSFORM_ID_FIELD,
NAME_FIELD, DESCRIPTION_FIELD, STATUS_FIELD, CREATED_ON_FIELD, LAST_MODIFIED_ON_FIELD, INPUT_RECORD_TABLES_FIELD,
PARAMETERS_FIELD, EVALUATION_METRICS_FIELD, LABEL_COUNT_FIELD, SCHEMA_FIELD, ROLE_FIELD, GLUE_VERSION_FIELD,
MAX_CAPACITY_FIELD, WORKER_TYPE_FIELD, NUMBER_OF_WORKERS_FIELD, TIMEOUT_FIELD, MAX_RETRIES_FIELD));
private static final long serialVersionUID = 1L;
private final String transformId;
private final String name;
private final String description;
private final String status;
private final Instant createdOn;
private final Instant lastModifiedOn;
private final List inputRecordTables;
private final TransformParameters parameters;
private final EvaluationMetrics evaluationMetrics;
private final Integer labelCount;
private final List schema;
private final String role;
private final String glueVersion;
private final Double maxCapacity;
private final String workerType;
private final Integer numberOfWorkers;
private final Integer timeout;
private final Integer maxRetries;
private MLTransform(BuilderImpl builder) {
this.transformId = builder.transformId;
this.name = builder.name;
this.description = builder.description;
this.status = builder.status;
this.createdOn = builder.createdOn;
this.lastModifiedOn = builder.lastModifiedOn;
this.inputRecordTables = builder.inputRecordTables;
this.parameters = builder.parameters;
this.evaluationMetrics = builder.evaluationMetrics;
this.labelCount = builder.labelCount;
this.schema = builder.schema;
this.role = builder.role;
this.glueVersion = builder.glueVersion;
this.maxCapacity = builder.maxCapacity;
this.workerType = builder.workerType;
this.numberOfWorkers = builder.numberOfWorkers;
this.timeout = builder.timeout;
this.maxRetries = builder.maxRetries;
}
/**
*
* The unique transform ID that is generated for the machine learning transform. The ID is guaranteed to be unique
* and does not change.
*
*
* @return The unique transform ID that is generated for the machine learning transform. The ID is guaranteed to be
* unique and does not change.
*/
public String transformId() {
return transformId;
}
/**
*
* A user-defined name for the machine learning transform. Names are not guaranteed unique and can be changed at any
* time.
*
*
* @return A user-defined name for the machine learning transform. Names are not guaranteed unique and can be
* changed at any time.
*/
public String name() {
return name;
}
/**
*
* A user-defined, long-form description text for the machine learning transform. Descriptions are not guaranteed to
* be unique and can be changed at any time.
*
*
* @return A user-defined, long-form description text for the machine learning transform. Descriptions are not
* guaranteed to be unique and can be changed at any time.
*/
public String description() {
return description;
}
/**
*
* The current status of the machine learning transform.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link TransformStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #statusAsString}.
*
*
* @return The current status of the machine learning transform.
* @see TransformStatusType
*/
public TransformStatusType status() {
return TransformStatusType.fromValue(status);
}
/**
*
* The current status of the machine learning transform.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link TransformStatusType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available
* from {@link #statusAsString}.
*
*
* @return The current status of the machine learning transform.
* @see TransformStatusType
*/
public String statusAsString() {
return status;
}
/**
*
* A timestamp. The time and date that this machine learning transform was created.
*
*
* @return A timestamp. The time and date that this machine learning transform was created.
*/
public Instant createdOn() {
return createdOn;
}
/**
*
* A timestamp. The last point in time when this machine learning transform was modified.
*
*
* @return A timestamp. The last point in time when this machine learning transform was modified.
*/
public Instant lastModifiedOn() {
return lastModifiedOn;
}
/**
* Returns true if the InputRecordTables property was specified by the sender (it may be empty), or false if the
* sender did not specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS
* service.
*/
public boolean hasInputRecordTables() {
return inputRecordTables != null && !(inputRecordTables instanceof SdkAutoConstructList);
}
/**
*
* A list of AWS Glue table definitions used by the transform.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasInputRecordTables()} to see if a value was sent in this field.
*
*
* @return A list of AWS Glue table definitions used by the transform.
*/
public List inputRecordTables() {
return inputRecordTables;
}
/**
*
* A TransformParameters
object. You can use parameters to tune (customize) the behavior of the machine
* learning transform by specifying what data it learns from and your preference on various tradeoffs (such as
* precious vs. recall, or accuracy vs. cost).
*
*
* @return A TransformParameters
object. You can use parameters to tune (customize) the behavior of the
* machine learning transform by specifying what data it learns from and your preference on various
* tradeoffs (such as precious vs. recall, or accuracy vs. cost).
*/
public TransformParameters parameters() {
return parameters;
}
/**
*
* An EvaluationMetrics
object. Evaluation metrics provide an estimate of the quality of your machine
* learning transform.
*
*
* @return An EvaluationMetrics
object. Evaluation metrics provide an estimate of the quality of your
* machine learning transform.
*/
public EvaluationMetrics evaluationMetrics() {
return evaluationMetrics;
}
/**
*
* A count identifier for the labeling files generated by AWS Glue for this transform. As you create a better
* transform, you can iteratively download, label, and upload the labeling file.
*
*
* @return A count identifier for the labeling files generated by AWS Glue for this transform. As you create a
* better transform, you can iteratively download, label, and upload the labeling file.
*/
public Integer labelCount() {
return labelCount;
}
/**
* Returns true if the Schema property was specified by the sender (it may be empty), or false if the sender did not
* specify the value (it will be empty). For responses returned by the SDK, the sender is the AWS service.
*/
public boolean hasSchema() {
return schema != null && !(schema instanceof SdkAutoConstructList);
}
/**
*
* A map of key-value pairs representing the columns and data types that this transform can run against. Has an
* upper bound of 100 columns.
*
*
* Attempts to modify the collection returned by this method will result in an UnsupportedOperationException.
*
*
* You can use {@link #hasSchema()} to see if a value was sent in this field.
*
*
* @return A map of key-value pairs representing the columns and data types that this transform can run against. Has
* an upper bound of 100 columns.
*/
public List schema() {
return schema;
}
/**
*
* The name or Amazon Resource Name (ARN) of the IAM role with the required permissions. The required permissions
* include both AWS Glue service role permissions to AWS Glue resources, and Amazon S3 permissions required by the
* transform.
*
*
* -
*
* This role needs AWS Glue service role permissions to allow access to resources in AWS Glue. See Attach a Policy to IAM Users That
* Access AWS Glue.
*
*
* -
*
* This role needs permission to your Amazon Simple Storage Service (Amazon S3) sources, targets, temporary
* directory, scripts, and any libraries used by the task run for this transform.
*
*
*
*
* @return The name or Amazon Resource Name (ARN) of the IAM role with the required permissions. The required
* permissions include both AWS Glue service role permissions to AWS Glue resources, and Amazon S3
* permissions required by the transform.
*
* -
*
* This role needs AWS Glue service role permissions to allow access to resources in AWS Glue. See Attach a Policy to IAM
* Users That Access AWS Glue.
*
*
* -
*
* This role needs permission to your Amazon Simple Storage Service (Amazon S3) sources, targets, temporary
* directory, scripts, and any libraries used by the task run for this transform.
*
*
*/
public String role() {
return role;
}
/**
*
* This value determines which version of AWS Glue this machine learning transform is compatible with. Glue 1.0 is
* recommended for most customers. If the value is not set, the Glue compatibility defaults to Glue 0.9. For more
* information, see AWS Glue Versions
* in the developer guide.
*
*
* @return This value determines which version of AWS Glue this machine learning transform is compatible with. Glue
* 1.0 is recommended for most customers. If the value is not set, the Glue compatibility defaults to Glue
* 0.9. For more information, see AWS Glue
* Versions in the developer guide.
*/
public String glueVersion() {
return glueVersion;
}
/**
*
* The number of AWS Glue data processing units (DPUs) that are allocated to task runs for this transform. You can
* allocate from 2 to 100 DPUs; the default is 10. A DPU is a relative measure of processing power that consists of
* 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the AWS Glue pricing page.
*
*
* MaxCapacity
is a mutually exclusive option with NumberOfWorkers
and
* WorkerType
.
*
*
* -
*
* If either NumberOfWorkers
or WorkerType
is set, then MaxCapacity
cannot be
* set.
*
*
* -
*
* If MaxCapacity
is set then neither NumberOfWorkers
or WorkerType
can be
* set.
*
*
* -
*
* If WorkerType
is set, then NumberOfWorkers
is required (and vice versa).
*
*
* -
*
* MaxCapacity
and NumberOfWorkers
must both be at least 1.
*
*
*
*
* When the WorkerType
field is set to a value other than Standard
, the
* MaxCapacity
field is set automatically and becomes read-only.
*
*
* @return The number of AWS Glue data processing units (DPUs) that are allocated to task runs for this transform.
* You can allocate from 2 to 100 DPUs; the default is 10. A DPU is a relative measure of processing power
* that consists of 4 vCPUs of compute capacity and 16 GB of memory. For more information, see the AWS Glue pricing page.
*
* MaxCapacity
is a mutually exclusive option with NumberOfWorkers
and
* WorkerType
.
*
*
* -
*
* If either NumberOfWorkers
or WorkerType
is set, then MaxCapacity
* cannot be set.
*
*
* -
*
* If MaxCapacity
is set then neither NumberOfWorkers
or WorkerType
* can be set.
*
*
* -
*
* If WorkerType
is set, then NumberOfWorkers
is required (and vice versa).
*
*
* -
*
* MaxCapacity
and NumberOfWorkers
must both be at least 1.
*
*
*
*
* When the WorkerType
field is set to a value other than Standard
, the
* MaxCapacity
field is set automatically and becomes read-only.
*/
public Double maxCapacity() {
return maxCapacity;
}
/**
*
* The type of predefined worker that is allocated when a task of this transform runs. Accepts a value of Standard,
* G.1X, or G.2X.
*
*
* -
*
* For the Standard
worker type, each worker provides 4 vCPU, 16 GB of memory and a 50GB disk, and 2
* executors per worker.
*
*
* -
*
* For the G.1X
worker type, each worker provides 4 vCPU, 16 GB of memory and a 64GB disk, and 1
* executor per worker.
*
*
* -
*
* For the G.2X
worker type, each worker provides 8 vCPU, 32 GB of memory and a 128GB disk, and 1
* executor per worker.
*
*
*
*
* MaxCapacity
is a mutually exclusive option with NumberOfWorkers
and
* WorkerType
.
*
*
* -
*
* If either NumberOfWorkers
or WorkerType
is set, then MaxCapacity
cannot be
* set.
*
*
* -
*
* If MaxCapacity
is set then neither NumberOfWorkers
or WorkerType
can be
* set.
*
*
* -
*
* If WorkerType
is set, then NumberOfWorkers
is required (and vice versa).
*
*
* -
*
* MaxCapacity
and NumberOfWorkers
must both be at least 1.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #workerType} will
* return {@link WorkerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #workerTypeAsString}.
*
*
* @return The type of predefined worker that is allocated when a task of this transform runs. Accepts a value of
* Standard, G.1X, or G.2X.
*
* -
*
* For the Standard
worker type, each worker provides 4 vCPU, 16 GB of memory and a 50GB disk,
* and 2 executors per worker.
*
*
* -
*
* For the G.1X
worker type, each worker provides 4 vCPU, 16 GB of memory and a 64GB disk, and
* 1 executor per worker.
*
*
* -
*
* For the G.2X
worker type, each worker provides 8 vCPU, 32 GB of memory and a 128GB disk, and
* 1 executor per worker.
*
*
*
*
* MaxCapacity
is a mutually exclusive option with NumberOfWorkers
and
* WorkerType
.
*
*
* -
*
* If either NumberOfWorkers
or WorkerType
is set, then MaxCapacity
* cannot be set.
*
*
* -
*
* If MaxCapacity
is set then neither NumberOfWorkers
or WorkerType
* can be set.
*
*
* -
*
* If WorkerType
is set, then NumberOfWorkers
is required (and vice versa).
*
*
* -
*
* MaxCapacity
and NumberOfWorkers
must both be at least 1.
*
*
* @see WorkerType
*/
public WorkerType workerType() {
return WorkerType.fromValue(workerType);
}
/**
*
* The type of predefined worker that is allocated when a task of this transform runs. Accepts a value of Standard,
* G.1X, or G.2X.
*
*
* -
*
* For the Standard
worker type, each worker provides 4 vCPU, 16 GB of memory and a 50GB disk, and 2
* executors per worker.
*
*
* -
*
* For the G.1X
worker type, each worker provides 4 vCPU, 16 GB of memory and a 64GB disk, and 1
* executor per worker.
*
*
* -
*
* For the G.2X
worker type, each worker provides 8 vCPU, 32 GB of memory and a 128GB disk, and 1
* executor per worker.
*
*
*
*
* MaxCapacity
is a mutually exclusive option with NumberOfWorkers
and
* WorkerType
.
*
*
* -
*
* If either NumberOfWorkers
or WorkerType
is set, then MaxCapacity
cannot be
* set.
*
*
* -
*
* If MaxCapacity
is set then neither NumberOfWorkers
or WorkerType
can be
* set.
*
*
* -
*
* If WorkerType
is set, then NumberOfWorkers
is required (and vice versa).
*
*
* -
*
* MaxCapacity
and NumberOfWorkers
must both be at least 1.
*
*
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #workerType} will
* return {@link WorkerType#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #workerTypeAsString}.
*
*
* @return The type of predefined worker that is allocated when a task of this transform runs. Accepts a value of
* Standard, G.1X, or G.2X.
*
* -
*
* For the Standard
worker type, each worker provides 4 vCPU, 16 GB of memory and a 50GB disk,
* and 2 executors per worker.
*
*
* -
*
* For the G.1X
worker type, each worker provides 4 vCPU, 16 GB of memory and a 64GB disk, and
* 1 executor per worker.
*
*
* -
*
* For the G.2X
worker type, each worker provides 8 vCPU, 32 GB of memory and a 128GB disk, and
* 1 executor per worker.
*
*
*
*
* MaxCapacity
is a mutually exclusive option with NumberOfWorkers
and
* WorkerType
.
*
*
* -
*
* If either NumberOfWorkers
or WorkerType
is set, then MaxCapacity
* cannot be set.
*
*
* -
*
* If MaxCapacity
is set then neither NumberOfWorkers
or WorkerType
* can be set.
*
*
* -
*
* If WorkerType
is set, then NumberOfWorkers
is required (and vice versa).
*
*
* -
*
* MaxCapacity
and NumberOfWorkers
must both be at least 1.
*
*
* @see WorkerType
*/
public String workerTypeAsString() {
return workerType;
}
/**
*
* The number of workers of a defined workerType
that are allocated when a task of the transform runs.
*
*
* If WorkerType
is set, then NumberOfWorkers
is required (and vice versa).
*
*
* @return The number of workers of a defined workerType
that are allocated when a task of the
* transform runs.
*
* If WorkerType
is set, then NumberOfWorkers
is required (and vice versa).
*/
public Integer numberOfWorkers() {
return numberOfWorkers;
}
/**
*
* The timeout in minutes of the machine learning transform.
*
*
* @return The timeout in minutes of the machine learning transform.
*/
public Integer timeout() {
return timeout;
}
/**
*
* The maximum number of times to retry after an MLTaskRun
of the machine learning transform fails.
*
*
* @return The maximum number of times to retry after an MLTaskRun
of the machine learning transform
* fails.
*/
public Integer maxRetries() {
return maxRetries;
}
@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 int hashCode() {
int hashCode = 1;
hashCode = 31 * hashCode + Objects.hashCode(transformId());
hashCode = 31 * hashCode + Objects.hashCode(name());
hashCode = 31 * hashCode + Objects.hashCode(description());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(createdOn());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedOn());
hashCode = 31 * hashCode + Objects.hashCode(inputRecordTables());
hashCode = 31 * hashCode + Objects.hashCode(parameters());
hashCode = 31 * hashCode + Objects.hashCode(evaluationMetrics());
hashCode = 31 * hashCode + Objects.hashCode(labelCount());
hashCode = 31 * hashCode + Objects.hashCode(schema());
hashCode = 31 * hashCode + Objects.hashCode(role());
hashCode = 31 * hashCode + Objects.hashCode(glueVersion());
hashCode = 31 * hashCode + Objects.hashCode(maxCapacity());
hashCode = 31 * hashCode + Objects.hashCode(workerTypeAsString());
hashCode = 31 * hashCode + Objects.hashCode(numberOfWorkers());
hashCode = 31 * hashCode + Objects.hashCode(timeout());
hashCode = 31 * hashCode + Objects.hashCode(maxRetries());
return hashCode;
}
@Override
public boolean equals(Object obj) {
return equalsBySdkFields(obj);
}
@Override
public boolean equalsBySdkFields(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (!(obj instanceof MLTransform)) {
return false;
}
MLTransform other = (MLTransform) obj;
return Objects.equals(transformId(), other.transformId()) && Objects.equals(name(), other.name())
&& Objects.equals(description(), other.description()) && Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(createdOn(), other.createdOn()) && Objects.equals(lastModifiedOn(), other.lastModifiedOn())
&& Objects.equals(inputRecordTables(), other.inputRecordTables())
&& Objects.equals(parameters(), other.parameters())
&& Objects.equals(evaluationMetrics(), other.evaluationMetrics())
&& Objects.equals(labelCount(), other.labelCount()) && Objects.equals(schema(), other.schema())
&& Objects.equals(role(), other.role()) && Objects.equals(glueVersion(), other.glueVersion())
&& Objects.equals(maxCapacity(), other.maxCapacity())
&& Objects.equals(workerTypeAsString(), other.workerTypeAsString())
&& Objects.equals(numberOfWorkers(), other.numberOfWorkers()) && Objects.equals(timeout(), other.timeout())
&& Objects.equals(maxRetries(), other.maxRetries());
}
/**
* 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 String toString() {
return ToString.builder("MLTransform").add("TransformId", transformId()).add("Name", name())
.add("Description", description()).add("Status", statusAsString()).add("CreatedOn", createdOn())
.add("LastModifiedOn", lastModifiedOn()).add("InputRecordTables", inputRecordTables())
.add("Parameters", parameters()).add("EvaluationMetrics", evaluationMetrics()).add("LabelCount", labelCount())
.add("Schema", schema()).add("Role", role()).add("GlueVersion", glueVersion()).add("MaxCapacity", maxCapacity())
.add("WorkerType", workerTypeAsString()).add("NumberOfWorkers", numberOfWorkers()).add("Timeout", timeout())
.add("MaxRetries", maxRetries()).build();
}
public Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "TransformId":
return Optional.ofNullable(clazz.cast(transformId()));
case "Name":
return Optional.ofNullable(clazz.cast(name()));
case "Description":
return Optional.ofNullable(clazz.cast(description()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "CreatedOn":
return Optional.ofNullable(clazz.cast(createdOn()));
case "LastModifiedOn":
return Optional.ofNullable(clazz.cast(lastModifiedOn()));
case "InputRecordTables":
return Optional.ofNullable(clazz.cast(inputRecordTables()));
case "Parameters":
return Optional.ofNullable(clazz.cast(parameters()));
case "EvaluationMetrics":
return Optional.ofNullable(clazz.cast(evaluationMetrics()));
case "LabelCount":
return Optional.ofNullable(clazz.cast(labelCount()));
case "Schema":
return Optional.ofNullable(clazz.cast(schema()));
case "Role":
return Optional.ofNullable(clazz.cast(role()));
case "GlueVersion":
return Optional.ofNullable(clazz.cast(glueVersion()));
case "MaxCapacity":
return Optional.ofNullable(clazz.cast(maxCapacity()));
case "WorkerType":
return Optional.ofNullable(clazz.cast(workerTypeAsString()));
case "NumberOfWorkers":
return Optional.ofNullable(clazz.cast(numberOfWorkers()));
case "Timeout":
return Optional.ofNullable(clazz.cast(timeout()));
case "MaxRetries":
return Optional.ofNullable(clazz.cast(maxRetries()));
default:
return Optional.empty();
}
}
@Override
public List> sdkFields() {
return SDK_FIELDS;
}
private static Function