software.amazon.awssdk.services.lookoutequipment.model.DescribeRetrainingSchedulerResponse 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.lookoutequipment.model;
import java.time.Instant;
import java.util.Arrays;
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.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;
/**
*/
@Generated("software.amazon.awssdk:codegen")
public final class DescribeRetrainingSchedulerResponse extends LookoutEquipmentResponse implements
ToCopyableBuilder {
private static final SdkField MODEL_NAME_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ModelName").getter(getter(DescribeRetrainingSchedulerResponse::modelName))
.setter(setter(Builder::modelName))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelName").build()).build();
private static final SdkField MODEL_ARN_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("ModelArn").getter(getter(DescribeRetrainingSchedulerResponse::modelArn))
.setter(setter(Builder::modelArn))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("ModelArn").build()).build();
private static final SdkField RETRAINING_START_DATE_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("RetrainingStartDate").getter(getter(DescribeRetrainingSchedulerResponse::retrainingStartDate))
.setter(setter(Builder::retrainingStartDate))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetrainingStartDate").build())
.build();
private static final SdkField RETRAINING_FREQUENCY_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("RetrainingFrequency").getter(getter(DescribeRetrainingSchedulerResponse::retrainingFrequency))
.setter(setter(Builder::retrainingFrequency))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("RetrainingFrequency").build())
.build();
private static final SdkField LOOKBACK_WINDOW_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("LookbackWindow").getter(getter(DescribeRetrainingSchedulerResponse::lookbackWindow))
.setter(setter(Builder::lookbackWindow))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("LookbackWindow").build()).build();
private static final SdkField STATUS_FIELD = SdkField. builder(MarshallingType.STRING).memberName("Status")
.getter(getter(DescribeRetrainingSchedulerResponse::statusAsString)).setter(setter(Builder::status))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("Status").build()).build();
private static final SdkField PROMOTE_MODE_FIELD = SdkField. builder(MarshallingType.STRING)
.memberName("PromoteMode").getter(getter(DescribeRetrainingSchedulerResponse::promoteModeAsString))
.setter(setter(Builder::promoteMode))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("PromoteMode").build()).build();
private static final SdkField CREATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("CreatedAt").getter(getter(DescribeRetrainingSchedulerResponse::createdAt))
.setter(setter(Builder::createdAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("CreatedAt").build()).build();
private static final SdkField UPDATED_AT_FIELD = SdkField. builder(MarshallingType.INSTANT)
.memberName("UpdatedAt").getter(getter(DescribeRetrainingSchedulerResponse::updatedAt))
.setter(setter(Builder::updatedAt))
.traits(LocationTrait.builder().location(MarshallLocation.PAYLOAD).locationName("UpdatedAt").build()).build();
private static final List> SDK_FIELDS = Collections.unmodifiableList(Arrays.asList(MODEL_NAME_FIELD,
MODEL_ARN_FIELD, RETRAINING_START_DATE_FIELD, RETRAINING_FREQUENCY_FIELD, LOOKBACK_WINDOW_FIELD, STATUS_FIELD,
PROMOTE_MODE_FIELD, CREATED_AT_FIELD, UPDATED_AT_FIELD));
private static final Map> SDK_NAME_TO_FIELD = Collections
.unmodifiableMap(new HashMap>() {
{
put("ModelName", MODEL_NAME_FIELD);
put("ModelArn", MODEL_ARN_FIELD);
put("RetrainingStartDate", RETRAINING_START_DATE_FIELD);
put("RetrainingFrequency", RETRAINING_FREQUENCY_FIELD);
put("LookbackWindow", LOOKBACK_WINDOW_FIELD);
put("Status", STATUS_FIELD);
put("PromoteMode", PROMOTE_MODE_FIELD);
put("CreatedAt", CREATED_AT_FIELD);
put("UpdatedAt", UPDATED_AT_FIELD);
}
});
private final String modelName;
private final String modelArn;
private final Instant retrainingStartDate;
private final String retrainingFrequency;
private final String lookbackWindow;
private final String status;
private final String promoteMode;
private final Instant createdAt;
private final Instant updatedAt;
private DescribeRetrainingSchedulerResponse(BuilderImpl builder) {
super(builder);
this.modelName = builder.modelName;
this.modelArn = builder.modelArn;
this.retrainingStartDate = builder.retrainingStartDate;
this.retrainingFrequency = builder.retrainingFrequency;
this.lookbackWindow = builder.lookbackWindow;
this.status = builder.status;
this.promoteMode = builder.promoteMode;
this.createdAt = builder.createdAt;
this.updatedAt = builder.updatedAt;
}
/**
*
* The name of the model that the retraining scheduler is attached to.
*
*
* @return The name of the model that the retraining scheduler is attached to.
*/
public final String modelName() {
return modelName;
}
/**
*
* The ARN of the model that the retraining scheduler is attached to.
*
*
* @return The ARN of the model that the retraining scheduler is attached to.
*/
public final String modelArn() {
return modelArn;
}
/**
*
* The start date for the retraining scheduler. Lookout for Equipment truncates the time you provide to the nearest
* UTC day.
*
*
* @return The start date for the retraining scheduler. Lookout for Equipment truncates the time you provide to the
* nearest UTC day.
*/
public final Instant retrainingStartDate() {
return retrainingStartDate;
}
/**
*
* The frequency at which the model retraining is set. This follows the ISO 8601 guidelines.
*
*
* @return The frequency at which the model retraining is set. This follows the ISO 8601 guidelines.
*/
public final String retrainingFrequency() {
return retrainingFrequency;
}
/**
*
* The number of past days of data used for retraining.
*
*
* @return The number of past days of data used for retraining.
*/
public final String lookbackWindow() {
return lookbackWindow;
}
/**
*
* The status of the retraining scheduler.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link RetrainingSchedulerStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The status of the retraining scheduler.
* @see RetrainingSchedulerStatus
*/
public final RetrainingSchedulerStatus status() {
return RetrainingSchedulerStatus.fromValue(status);
}
/**
*
* The status of the retraining scheduler.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #status} will
* return {@link RetrainingSchedulerStatus#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is
* available from {@link #statusAsString}.
*
*
* @return The status of the retraining scheduler.
* @see RetrainingSchedulerStatus
*/
public final String statusAsString() {
return status;
}
/**
*
* Indicates how the service uses new models. In MANAGED
mode, new models are used for inference if
* they have better performance than the current model. In MANUAL
mode, the new models are not used
* until they are manually activated.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #promoteMode} will
* return {@link ModelPromoteMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #promoteModeAsString}.
*
*
* @return Indicates how the service uses new models. In MANAGED
mode, new models are used for
* inference if they have better performance than the current model. In MANUAL
mode, the new
* models are not used until they are manually activated.
* @see ModelPromoteMode
*/
public final ModelPromoteMode promoteMode() {
return ModelPromoteMode.fromValue(promoteMode);
}
/**
*
* Indicates how the service uses new models. In MANAGED
mode, new models are used for inference if
* they have better performance than the current model. In MANUAL
mode, the new models are not used
* until they are manually activated.
*
*
* If the service returns an enum value that is not available in the current SDK version, {@link #promoteMode} will
* return {@link ModelPromoteMode#UNKNOWN_TO_SDK_VERSION}. The raw value returned by the service is available from
* {@link #promoteModeAsString}.
*
*
* @return Indicates how the service uses new models. In MANAGED
mode, new models are used for
* inference if they have better performance than the current model. In MANUAL
mode, the new
* models are not used until they are manually activated.
* @see ModelPromoteMode
*/
public final String promoteModeAsString() {
return promoteMode;
}
/**
*
* Indicates the time and date at which the retraining scheduler was created.
*
*
* @return Indicates the time and date at which the retraining scheduler was created.
*/
public final Instant createdAt() {
return createdAt;
}
/**
*
* Indicates the time and date at which the retraining scheduler was updated.
*
*
* @return Indicates the time and date at which the retraining scheduler was updated.
*/
public final Instant updatedAt() {
return updatedAt;
}
@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(modelName());
hashCode = 31 * hashCode + Objects.hashCode(modelArn());
hashCode = 31 * hashCode + Objects.hashCode(retrainingStartDate());
hashCode = 31 * hashCode + Objects.hashCode(retrainingFrequency());
hashCode = 31 * hashCode + Objects.hashCode(lookbackWindow());
hashCode = 31 * hashCode + Objects.hashCode(statusAsString());
hashCode = 31 * hashCode + Objects.hashCode(promoteModeAsString());
hashCode = 31 * hashCode + Objects.hashCode(createdAt());
hashCode = 31 * hashCode + Objects.hashCode(updatedAt());
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 DescribeRetrainingSchedulerResponse)) {
return false;
}
DescribeRetrainingSchedulerResponse other = (DescribeRetrainingSchedulerResponse) obj;
return Objects.equals(modelName(), other.modelName()) && Objects.equals(modelArn(), other.modelArn())
&& Objects.equals(retrainingStartDate(), other.retrainingStartDate())
&& Objects.equals(retrainingFrequency(), other.retrainingFrequency())
&& Objects.equals(lookbackWindow(), other.lookbackWindow())
&& Objects.equals(statusAsString(), other.statusAsString())
&& Objects.equals(promoteModeAsString(), other.promoteModeAsString())
&& Objects.equals(createdAt(), other.createdAt()) && Objects.equals(updatedAt(), other.updatedAt());
}
/**
* 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("DescribeRetrainingSchedulerResponse").add("ModelName", modelName()).add("ModelArn", modelArn())
.add("RetrainingStartDate", retrainingStartDate()).add("RetrainingFrequency", retrainingFrequency())
.add("LookbackWindow", lookbackWindow()).add("Status", statusAsString())
.add("PromoteMode", promoteModeAsString()).add("CreatedAt", createdAt()).add("UpdatedAt", updatedAt()).build();
}
public final Optional getValueForField(String fieldName, Class clazz) {
switch (fieldName) {
case "ModelName":
return Optional.ofNullable(clazz.cast(modelName()));
case "ModelArn":
return Optional.ofNullable(clazz.cast(modelArn()));
case "RetrainingStartDate":
return Optional.ofNullable(clazz.cast(retrainingStartDate()));
case "RetrainingFrequency":
return Optional.ofNullable(clazz.cast(retrainingFrequency()));
case "LookbackWindow":
return Optional.ofNullable(clazz.cast(lookbackWindow()));
case "Status":
return Optional.ofNullable(clazz.cast(statusAsString()));
case "PromoteMode":
return Optional.ofNullable(clazz.cast(promoteModeAsString()));
case "CreatedAt":
return Optional.ofNullable(clazz.cast(createdAt()));
case "UpdatedAt":
return Optional.ofNullable(clazz.cast(updatedAt()));
default:
return Optional.empty();
}
}
@Override
public final List> sdkFields() {
return SDK_FIELDS;
}
@Override
public final Map> sdkFieldNameToField() {
return SDK_NAME_TO_FIELD;
}
private static Function