software.amazon.awssdk.services.personalize.model.BatchInferenceJob Maven / Gradle / Ivy
Show all versions of personalize 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.personalize.model;
import java.io.Serializable;
import java.time.Instant;
import java.util.Arrays;
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 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.LocationTrait;
import software.amazon.awssdk.utils.ToString;
import software.amazon.awssdk.utils.builder.CopyableBuilder;
import software.amazon.awssdk.utils.builder.ToCopyableBuilder;
/**
*
* Contains information on a batch inference job.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class BatchInferenceJob implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField JOB_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("jobName").getter(getter(BatchInferenceJob::jobName)).setter(setter(Builder::jobName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobName").build()).build();
private static final SdkField BATCH_INFERENCE_JOB_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("batchInferenceJobArn").getter(getter(BatchInferenceJob::batchInferenceJobArn))
.setter(setter(Builder::batchInferenceJobArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("batchInferenceJobArn").build())
.build();
private static final SdkField FILTER_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("filterArn").getter(getter(BatchInferenceJob::filterArn)).setter(setter(Builder::filterArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("filterArn").build()).build();
private static final SdkField FAILURE_REASON_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("failureReason").getter(getter(BatchInferenceJob::failureReason)).setter(setter(Builder::failureReason))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("failureReason").build()).build();
private static final SdkField SOLUTION_VERSION_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("solutionVersionArn").getter(getter(BatchInferenceJob::solutionVersionArn))
.setter(setter(Builder::solutionVersionArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("solutionVersionArn").build())
.build();
private static final SdkField NUM_RESULTS_FIELD = SdkField. builder(MarshallingType.INTEGER)
.memberName("numResults").getter(getter(BatchInferenceJob::numResults)).setter(setter(Builder::numResults))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("numResults").build()).build();
private static final SdkField JOB_INPUT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("jobInput")
.getter(getter(BatchInferenceJob::jobInput)).setter(setter(Builder::jobInput))
.constructor(BatchInferenceJobInput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobInput").build()).build();
private static final SdkField JOB_OUTPUT_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("jobOutput")
.getter(getter(BatchInferenceJob::jobOutput)).setter(setter(Builder::jobOutput))
.constructor(BatchInferenceJobOutput::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("jobOutput").build()).build();
private static final SdkField BATCH_INFERENCE_JOB_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("batchInferenceJobConfig")
.getter(getter(BatchInferenceJob::batchInferenceJobConfig)).setter(setter(Builder::batchInferenceJobConfig))
.constructor(BatchInferenceJobConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("batchInferenceJobConfig").build())
.build();
private static final SdkField ROLE_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("roleArn").getter(getter(BatchInferenceJob::roleArn)).setter(setter(Builder::roleArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("roleArn").build()).build();
private static final SdkField BATCH_INFERENCE_JOB_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("batchInferenceJobMode").getter(getter(BatchInferenceJob::batchInferenceJobModeAsString))
.setter(setter(Builder::batchInferenceJobMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("batchInferenceJobMode").build())
.build();
private static final SdkField THEME_GENERATION_CONFIG_FIELD = SdkField
. builder(MarshallingType.SDK_POJO).memberName("themeGenerationConfig")
.getter(getter(BatchInferenceJob::themeGenerationConfig)).setter(setter(Builder::themeGenerationConfig))
.constructor(ThemeGenerationConfig::builder)
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("themeGenerationConfig").build())
.build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("status")
.getter(getter(BatchInferenceJob::status)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("status").build()).build();
private static final SdkField CREATION_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("creationDateTime").getter(getter(BatchInferenceJob::creationDateTime))
.setter(setter(Builder::creationDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("creationDateTime").build()).build();
private static final SdkField LAST_UPDATED_DATE_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("lastUpdatedDateTime").getter(getter(BatchInferenceJob::lastUpdatedDateTime))
.setter(setter(Builder::lastUpdatedDateTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("lastUpdatedDateTime").build())
.build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(JOB_NAME_FIELD,
BATCH_INFERENCE_JOB_ARN_FIELD, FILTER_ARN_FIELD, FAILURE_REASON_FIELD, SOLUTION_VERSION_ARN_FIELD, NUM_RESULTS_FIELD,
JOB_INPUT_FIELD, JOB_OUTPUT_FIELD, BATCH_INFERENCE_JOB_CONFIG_FIELD, ROLE_ARN_FIELD, BATCH_INFERENCE_JOB_MODE_FIELD,
THEME_GENERATION_CONFIG_FIELD, STATUS_FIELD, CREATION_DATE_TIME_FIELD, LAST_UPDATED_DATE_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String jobName;
private final String batchInferenceJobArn;
private final String filterArn;
private final String failureReason;
private final String solutionVersionArn;
private final Integer numResults;
private final BatchInferenceJobInput jobInput;
private final BatchInferenceJobOutput jobOutput;
private final BatchInferenceJobConfig batchInferenceJobConfig;
private final String roleArn;
private final String batchInferenceJobMode;
private final ThemeGenerationConfig themeGenerationConfig;
private final String status;
private final Instant creationDateTime;
private final Instant lastUpdatedDateTime;
private BatchInferenceJob(BuilderImpl builder) {
this.jobName = builder.jobName;
this.batchInferenceJobArn = builder.batchInferenceJobArn;
this.filterArn = builder.filterArn;
this.failureReason = builder.failureReason;
this.solutionVersionArn = builder.solutionVersionArn;
this.numResults = builder.numResults;
this.jobInput = builder.jobInput;
this.jobOutput = builder.jobOutput;
this.batchInferenceJobConfig = builder.batchInferenceJobConfig;
this.roleArn = builder.roleArn;
this.batchInferenceJobMode = builder.batchInferenceJobMode;
this.themeGenerationConfig = builder.themeGenerationConfig;
this.status = builder.status;
this.creationDateTime = builder.creationDateTime;
this.lastUpdatedDateTime = builder.lastUpdatedDateTime;
}
/**
*
* The name of the batch inference job.
*
*
* @return The name of the batch inference job.
*/
public final String jobName() {
return jobName;
}
/**
*
* The Amazon Resource Name (ARN) of the batch inference job.
*
*
* @return The Amazon Resource Name (ARN) of the batch inference job.
*/
public final String batchInferenceJobArn() {
return batchInferenceJobArn;
}
/**
*
* The ARN of the filter used on the batch inference job.
*
*
* @return The ARN of the filter used on the batch inference job.
*/
public final String filterArn() {
return filterArn;
}
/**
*
* If the batch inference job failed, the reason for the failure.
*
*
* @return If the batch inference job failed, the reason for the failure.
*/
public final String failureReason() {
return failureReason;
}
/**
*
* The Amazon Resource Name (ARN) of the solution version from which the batch inference job was created.
*
*
* @return The Amazon Resource Name (ARN) of the solution version from which the batch inference job was created.
*/
public final String solutionVersionArn() {
return solutionVersionArn;
}
/**
*
* The number of recommendations generated by the batch inference job. This number includes the error messages
* generated for failed input records.
*
*
* @return The number of recommendations generated by the batch inference job. This number includes the error
* messages generated for failed input records.
*/
public final Integer numResults() {
return numResults;
}
/**
*
* The Amazon S3 path that leads to the input data used to generate the batch inference job.
*
*
* @return The Amazon S3 path that leads to the input data used to generate the batch inference job.
*/
public final BatchInferenceJobInput jobInput() {
return jobInput;
}
/**
*
* The Amazon S3 bucket that contains the output data generated by the batch inference job.
*
*
* @return The Amazon S3 bucket that contains the output data generated by the batch inference job.
*/
public final BatchInferenceJobOutput jobOutput() {
return jobOutput;
}
/**
*
* A string to string map of the configuration details of a batch inference job.
*
*
* @return A string to string map of the configuration details of a batch inference job.
*/
public final BatchInferenceJobConfig batchInferenceJobConfig() {
return batchInferenceJobConfig;
}
/**
*
* The ARN of the Amazon Identity and Access Management (IAM) role that requested the batch inference job.
*
*
* @return The ARN of the Amazon Identity and Access Management (IAM) role that requested the batch inference job.
*/
public final String roleArn() {
return roleArn;
}
/**
*
* The job's mode.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #batchInferenceJobMode} will return {@link BatchInferenceJobMode#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #batchInferenceJobModeAsString}.
*
*
* @return The job's mode.
* @see BatchInferenceJobMode
*/
public final BatchInferenceJobMode batchInferenceJobMode() {
return BatchInferenceJobMode.fromValue(batchInferenceJobMode);
}
/**
*
* The job's mode.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #batchInferenceJobMode} will return {@link BatchInferenceJobMode#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #batchInferenceJobModeAsString}.
*
*
* @return The job's mode.
* @see BatchInferenceJobMode
*/
public final String batchInferenceJobModeAsString() {
return batchInferenceJobMode;
}
/**
*
* The job's theme generation settings.
*
*
* @return The job's theme generation settings.
*/
public final ThemeGenerationConfig themeGenerationConfig() {
return themeGenerationConfig;
}
/**
*
* The status of the batch inference job. The status is one of the following values:
*
*
* -
*
* PENDING
*
*
* -
*
* IN PROGRESS
*
*
* -
*
* ACTIVE
*
*
* -
*
* CREATE FAILED
*
*
*
*
* @return The status of the batch inference job. The status is one of the following values:
*
* -
*
* PENDING
*
*
* -
*
* IN PROGRESS
*
*
* -
*
* ACTIVE
*
*
* -
*
* CREATE FAILED
*
*
*/
public final String status() {
return status;
}
/**
*
* The time at which the batch inference job was created.
*
*
* @return The time at which the batch inference job was created.
*/
public final Instant creationDateTime() {
return creationDateTime;
}
/**
*
* The time at which the batch inference job was last updated.
*
*
* @return The time at which the batch inference job was last updated.
*/
public final Instant lastUpdatedDateTime() {
return lastUpdatedDateTime;
}
@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 + Objects.hashCode(jobName());
hashCode = 31 * hashCode + Objects.hashCode(batchInferenceJobArn());
hashCode = 31 * hashCode + Objects.hashCode(filterArn());
hashCode = 31 * hashCode + Objects.hashCode(failureReason());
hashCode = 31 * hashCode + Objects.hashCode(solutionVersionArn());
hashCode = 31 * hashCode + Objects.hashCode(numResults());
hashCode = 31 * hashCode + Objects.hashCode(jobInput());
hashCode = 31 * hashCode + Objects.hashCode(jobOutput());
hashCode = 31 * hashCode + Objects.hashCode(batchInferenceJobConfig());
hashCode = 31 * hashCode + Objects.hashCode(roleArn());
hashCode = 31 * hashCode + Objects.hashCode(batchInferenceJobModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(themeGenerationConfig());
hashCode = 31 * hashCode + Objects.hashCode(status());
hashCode = 31 * hashCode + Objects.hashCode(creationDateTime());
hashCode = 31 * hashCode + Objects.hashCode(lastUpdatedDateTime());
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 BatchInferenceJob)) {
return false;
}
BatchInferenceJob other = (BatchInferenceJob) obj;
return Objects.equals(jobName(), other.jobName()) && Objects.equals(batchInferenceJobArn(), other.batchInferenceJobArn())
&& Objects.equals(filterArn(), other.filterArn()) && Objects.equals(failureReason(), other.failureReason())
&& Objects.equals(solutionVersionArn(), other.solutionVersionArn())
&& Objects.equals(numResults(), other.numResults()) && Objects.equals(jobInput(), other.jobInput())
&& Objects.equals(jobOutput(), other.jobOutput())
&& Objects.equals(batchInferenceJobConfig(), other.batchInferenceJobConfig())
&& Objects.equals(roleArn(), other.roleArn())
&& Objects.equals(batchInferenceJobModeAsString(), other.batchInferenceJobModeAsString())
&& Objects.equals(themeGenerationConfig(), other.themeGenerationConfig())
&& Objects.equals(status(), other.status()) && Objects.equals(creationDateTime(), other.creationDateTime())
&& Objects.equals(lastUpdatedDateTime(), other.lastUpdatedDateTime());
}
/**
* 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("BatchInferenceJob").add("JobName", jobName())
.add("BatchInferenceJobArn", batchInferenceJobArn()).add("FilterArn", filterArn())
.add("FailureReason", failureReason()).add("SolutionVersionArn", solutionVersionArn())
.add("NumResults", numResults()).add("JobInput", jobInput()).add("JobOutput", jobOutput())
.add("BatchInferenceJobConfig", batchInferenceJobConfig()).add("RoleArn", roleArn())
.add("BatchInferenceJobMode", batchInferenceJobModeAsString())
.add("ThemeGenerationConfig", themeGenerationConfig()).add("Status", status())
.add("CreationDateTime", creationDateTime()).add("LastUpdatedDateTime", lastUpdatedDateTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "jobName":
return Optional.ofNullable(clazz.cast(jobName()));
case "batchInferenceJobArn":
return Optional.ofNullable(clazz.cast(batchInferenceJobArn()));
case "filterArn":
return Optional.ofNullable(clazz.cast(filterArn()));
case "failureReason":
return Optional.ofNullable(clazz.cast(failureReason()));
case "solutionVersionArn":
return Optional.ofNullable(clazz.cast(solutionVersionArn()));
case "numResults":
return Optional.ofNullable(clazz.cast(numResults()));
case "jobInput":
return Optional.ofNullable(clazz.cast(jobInput()));
case "jobOutput":
return Optional.ofNullable(clazz.cast(jobOutput()));
case "batchInferenceJobConfig":
return Optional.ofNullable(clazz.cast(batchInferenceJobConfig()));
case "roleArn":
return Optional.ofNullable(clazz.cast(roleArn()));
case "batchInferenceJobMode":
return Optional.ofNullable(clazz.cast(batchInferenceJobModeAsString()));
case "themeGenerationConfig":
return Optional.ofNullable(clazz.cast(themeGenerationConfig()));
case "status":
return Optional.ofNullable(clazz.cast(status()));
case "creationDateTime":
return Optional.ofNullable(clazz.cast(creationDateTime()));
case "lastUpdatedDateTime":
return Optional.ofNullable(clazz.cast(lastUpdatedDateTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function