software.amazon.awssdk.services.sagemaker.model.ProfilerRuleEvaluationStatus 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.beans.Transient;
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.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;
/**
*
* Information about the status of the rule evaluation.
*
*/
@Generated("software.amazon.awssdk:codegen")
public final class ProfilerRuleEvaluationStatus implements SdkPojo, Serializable,
ToCopyableBuilder {
private static final SdkField RULE_CONFIGURATION_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RuleConfigurationName").getter(getter(ProfilerRuleEvaluationStatus::ruleConfigurationName))
.setter(setter(Builder::ruleConfigurationName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleConfigurationName").build())
.build();
private static final SdkField RULE_EVALUATION_JOB_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RuleEvaluationJobArn").getter(getter(ProfilerRuleEvaluationStatus::ruleEvaluationJobArn))
.setter(setter(Builder::ruleEvaluationJobArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleEvaluationJobArn").build())
.build();
private static final SdkField RULE_EVALUATION_STATUS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RuleEvaluationStatus").getter(getter(ProfilerRuleEvaluationStatus::ruleEvaluationStatusAsString))
.setter(setter(Builder::ruleEvaluationStatus))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RuleEvaluationStatus").build())
.build();
private static final SdkField STATUS_DETAILS_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("StatusDetails").getter(getter(ProfilerRuleEvaluationStatus::statusDetails))
.setter(setter(Builder::statusDetails))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("StatusDetails").build()).build();
private static final SdkField LAST_MODIFIED_TIME_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("LastModifiedTime").getter(getter(ProfilerRuleEvaluationStatus::lastModifiedTime))
.setter(setter(Builder::lastModifiedTime))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LastModifiedTime").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(RULE_CONFIGURATION_NAME_FIELD,
RULE_EVALUATION_JOB_ARN_FIELD, RULE_EVALUATION_STATUS_FIELD, STATUS_DETAILS_FIELD, LAST_MODIFIED_TIME_FIELD));
private static final long serialVersionUID = 1L;
private final String ruleConfigurationName;
private final String ruleEvaluationJobArn;
private final String ruleEvaluationStatus;
private final String statusDetails;
private final Instant lastModifiedTime;
private ProfilerRuleEvaluationStatus(BuilderImpl builder) {
this.ruleConfigurationName = builder.ruleConfigurationName;
this.ruleEvaluationJobArn = builder.ruleEvaluationJobArn;
this.ruleEvaluationStatus = builder.ruleEvaluationStatus;
this.statusDetails = builder.statusDetails;
this.lastModifiedTime = builder.lastModifiedTime;
}
/**
*
* The name of the rule configuration.
*
*
* @return The name of the rule configuration.
*/
public final String ruleConfigurationName() {
return ruleConfigurationName;
}
/**
*
* The Amazon Resource Name (ARN) of the rule evaluation job.
*
*
* @return The Amazon Resource Name (ARN) of the rule evaluation job.
*/
public final String ruleEvaluationJobArn() {
return ruleEvaluationJobArn;
}
/**
*
* Status of the rule evaluation.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #ruleEvaluationStatus} will return {@link RuleEvaluationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #ruleEvaluationStatusAsString}.
*
*
* @return Status of the rule evaluation.
* @see RuleEvaluationStatus
*/
public final RuleEvaluationStatus ruleEvaluationStatus() {
return RuleEvaluationStatus.fromValue(ruleEvaluationStatus);
}
/**
*
* Status of the rule evaluation.
*
*
* If the service returns an enum value that is not available in the current SDK version,
* {@link #ruleEvaluationStatus} will return {@link RuleEvaluationStatus#UNKNOWN_TO_SDK_VERSION}. The raw value
* returned by the service is available from {@link #ruleEvaluationStatusAsString}.
*
*
* @return Status of the rule evaluation.
* @see RuleEvaluationStatus
*/
public final String ruleEvaluationStatusAsString() {
return ruleEvaluationStatus;
}
/**
*
* Details from the rule evaluation.
*
*
* @return Details from the rule evaluation.
*/
public final String statusDetails() {
return statusDetails;
}
/**
*
* Timestamp when the rule evaluation status was last modified.
*
*
* @return Timestamp when the rule evaluation status was last modified.
*/
public final Instant lastModifiedTime() {
return lastModifiedTime;
}
@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(ruleConfigurationName());
hashCode = 31 * hashCode + Objects.hashCode(ruleEvaluationJobArn());
hashCode = 31 * hashCode + Objects.hashCode(ruleEvaluationStatusAsString());
hashCode = 31 * hashCode + Objects.hashCode(statusDetails());
hashCode = 31 * hashCode + Objects.hashCode(lastModifiedTime());
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 ProfilerRuleEvaluationStatus)) {
return false;
}
ProfilerRuleEvaluationStatus other = (ProfilerRuleEvaluationStatus) obj;
return Objects.equals(ruleConfigurationName(), other.ruleConfigurationName())
&& Objects.equals(ruleEvaluationJobArn(), other.ruleEvaluationJobArn())
&& Objects.equals(ruleEvaluationStatusAsString(), other.ruleEvaluationStatusAsString())
&& Objects.equals(statusDetails(), other.statusDetails())
&& Objects.equals(lastModifiedTime(), other.lastModifiedTime());
}
/**
* 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("ProfilerRuleEvaluationStatus").add("RuleConfigurationName", ruleConfigurationName())
.add("RuleEvaluationJobArn", ruleEvaluationJobArn()).add("RuleEvaluationStatus", ruleEvaluationStatusAsString())
.add("StatusDetails", statusDetails()).add("LastModifiedTime", lastModifiedTime()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "RuleConfigurationName":
return Optional.ofNullable(clazz.cast(ruleConfigurationName()));
case "RuleEvaluationJobArn":
return Optional.ofNullable(clazz.cast(ruleEvaluationJobArn()));
case "RuleEvaluationStatus":
return Optional.ofNullable(clazz.cast(ruleEvaluationStatusAsString()));
case "StatusDetails":
return Optional.ofNullable(clazz.cast(statusDetails()));
case "LastModifiedTime":
return Optional.ofNullable(clazz.cast(lastModifiedTime()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
private static Function