All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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 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 getter(Function g) { return obj -> g.apply((DescribeRetrainingSchedulerResponse) obj); } private static BiConsumer setter(BiConsumer s) { return (obj, val) -> s.accept((Builder) obj, val); } public interface Builder extends LookoutEquipmentResponse.Builder, SdkPojo, CopyableBuilder { /** *

* The name of the model that the retraining scheduler is attached to. *

* * @param modelName * The name of the model that the retraining scheduler is attached to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelName(String modelName); /** *

* The ARN of the model that the retraining scheduler is attached to. *

* * @param modelArn * The ARN of the model that the retraining scheduler is attached to. * @return Returns a reference to this object so that method calls can be chained together. */ Builder modelArn(String modelArn); /** *

* The start date for the retraining scheduler. Lookout for Equipment truncates the time you provide to the * nearest UTC day. *

* * @param retrainingStartDate * The start date for the retraining scheduler. Lookout for Equipment truncates the time you provide to * the nearest UTC day. * @return Returns a reference to this object so that method calls can be chained together. */ Builder retrainingStartDate(Instant retrainingStartDate); /** *

* The frequency at which the model retraining is set. This follows the ISO 8601 guidelines. *

* * @param retrainingFrequency * The frequency at which the model retraining is set. This follows the ISO 8601 guidelines. * @return Returns a reference to this object so that method calls can be chained together. */ Builder retrainingFrequency(String retrainingFrequency); /** *

* The number of past days of data used for retraining. *

* * @param lookbackWindow * The number of past days of data used for retraining. * @return Returns a reference to this object so that method calls can be chained together. */ Builder lookbackWindow(String lookbackWindow); /** *

* The status of the retraining scheduler. *

* * @param status * The status of the retraining scheduler. * @see RetrainingSchedulerStatus * @return Returns a reference to this object so that method calls can be chained together. * @see RetrainingSchedulerStatus */ Builder status(String status); /** *

* The status of the retraining scheduler. *

* * @param status * The status of the retraining scheduler. * @see RetrainingSchedulerStatus * @return Returns a reference to this object so that method calls can be chained together. * @see RetrainingSchedulerStatus */ Builder status(RetrainingSchedulerStatus 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. *

* * @param 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. * @see ModelPromoteMode * @return Returns a reference to this object so that method calls can be chained together. * @see ModelPromoteMode */ Builder promoteMode(String 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. *

* * @param 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. * @see ModelPromoteMode * @return Returns a reference to this object so that method calls can be chained together. * @see ModelPromoteMode */ Builder promoteMode(ModelPromoteMode promoteMode); /** *

* Indicates the time and date at which the retraining scheduler was created. *

* * @param createdAt * Indicates the time and date at which the retraining scheduler was created. * @return Returns a reference to this object so that method calls can be chained together. */ Builder createdAt(Instant createdAt); /** *

* Indicates the time and date at which the retraining scheduler was updated. *

* * @param updatedAt * Indicates the time and date at which the retraining scheduler was updated. * @return Returns a reference to this object so that method calls can be chained together. */ Builder updatedAt(Instant updatedAt); } static final class BuilderImpl extends LookoutEquipmentResponse.BuilderImpl implements Builder { private String modelName; private String modelArn; private Instant retrainingStartDate; private String retrainingFrequency; private String lookbackWindow; private String status; private String promoteMode; private Instant createdAt; private Instant updatedAt; private BuilderImpl() { } private BuilderImpl(DescribeRetrainingSchedulerResponse model) { super(model); modelName(model.modelName); modelArn(model.modelArn); retrainingStartDate(model.retrainingStartDate); retrainingFrequency(model.retrainingFrequency); lookbackWindow(model.lookbackWindow); status(model.status); promoteMode(model.promoteMode); createdAt(model.createdAt); updatedAt(model.updatedAt); } public final String getModelName() { return modelName; } public final void setModelName(String modelName) { this.modelName = modelName; } @Override public final Builder modelName(String modelName) { this.modelName = modelName; return this; } public final String getModelArn() { return modelArn; } public final void setModelArn(String modelArn) { this.modelArn = modelArn; } @Override public final Builder modelArn(String modelArn) { this.modelArn = modelArn; return this; } public final Instant getRetrainingStartDate() { return retrainingStartDate; } public final void setRetrainingStartDate(Instant retrainingStartDate) { this.retrainingStartDate = retrainingStartDate; } @Override public final Builder retrainingStartDate(Instant retrainingStartDate) { this.retrainingStartDate = retrainingStartDate; return this; } public final String getRetrainingFrequency() { return retrainingFrequency; } public final void setRetrainingFrequency(String retrainingFrequency) { this.retrainingFrequency = retrainingFrequency; } @Override public final Builder retrainingFrequency(String retrainingFrequency) { this.retrainingFrequency = retrainingFrequency; return this; } public final String getLookbackWindow() { return lookbackWindow; } public final void setLookbackWindow(String lookbackWindow) { this.lookbackWindow = lookbackWindow; } @Override public final Builder lookbackWindow(String lookbackWindow) { this.lookbackWindow = lookbackWindow; return this; } public final String getStatus() { return status; } public final void setStatus(String status) { this.status = status; } @Override public final Builder status(String status) { this.status = status; return this; } @Override public final Builder status(RetrainingSchedulerStatus status) { this.status(status == null ? null : status.toString()); return this; } public final String getPromoteMode() { return promoteMode; } public final void setPromoteMode(String promoteMode) { this.promoteMode = promoteMode; } @Override public final Builder promoteMode(String promoteMode) { this.promoteMode = promoteMode; return this; } @Override public final Builder promoteMode(ModelPromoteMode promoteMode) { this.promoteMode(promoteMode == null ? null : promoteMode.toString()); return this; } public final Instant getCreatedAt() { return createdAt; } public final void setCreatedAt(Instant createdAt) { this.createdAt = createdAt; } @Override public final Builder createdAt(Instant createdAt) { this.createdAt = createdAt; return this; } public final Instant getUpdatedAt() { return updatedAt; } public final void setUpdatedAt(Instant updatedAt) { this.updatedAt = updatedAt; } @Override public final Builder updatedAt(Instant updatedAt) { this.updatedAt = updatedAt; return this; } @Override public DescribeRetrainingSchedulerResponse build() { return new DescribeRetrainingSchedulerResponse(this); } @Override public List> sdkFields() { return SDK_FIELDS; } @Override public Map> sdkFieldNameToField() { return SDK_NAME_TO_FIELD; } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy