/*
 * Copyright 2018-2023 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 com.amazonaws.services.sagemaker.model;

import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * <p>
 * Provides summary information about a training job.
 * </p>
 * 
 * @see <a href="http://docs.aws.amazon.com/goto/WebAPI/sagemaker-2017-07-24/TrainingJobSummary" target="_top">AWS API
 *      Documentation</a>
 */
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class TrainingJobSummary implements Serializable, Cloneable, StructuredPojo {

    /**
     * <p>
     * The name of the training job that you want a summary for.
     * </p>
     */
    private String trainingJobName;
    /**
     * <p>
     * The Amazon Resource Name (ARN) of the training job.
     * </p>
     */
    private String trainingJobArn;
    /**
     * <p>
     * A timestamp that shows when the training job was created.
     * </p>
     */
    private java.util.Date creationTime;
    /**
     * <p>
     * A timestamp that shows when the training job ended. This field is set only if the training job has one of the
     * terminal statuses (<code>Completed</code>, <code>Failed</code>, or <code>Stopped</code>).
     * </p>
     */
    private java.util.Date trainingEndTime;
    /**
     * <p>
     * Timestamp when the training job was last modified.
     * </p>
     */
    private java.util.Date lastModifiedTime;
    /**
     * <p>
     * The status of the training job.
     * </p>
     */
    private String trainingJobStatus;
    /**
     * <p>
     * The status of the warm pool associated with the training job.
     * </p>
     */
    private WarmPoolStatus warmPoolStatus;

    /**
     * <p>
     * The name of the training job that you want a summary for.
     * </p>
     * 
     * @param trainingJobName
     *        The name of the training job that you want a summary for.
     */

    public void setTrainingJobName(String trainingJobName) {
        this.trainingJobName = trainingJobName;
    }

    /**
     * <p>
     * The name of the training job that you want a summary for.
     * </p>
     * 
     * @return The name of the training job that you want a summary for.
     */

    public String getTrainingJobName() {
        return this.trainingJobName;
    }

    /**
     * <p>
     * The name of the training job that you want a summary for.
     * </p>
     * 
     * @param trainingJobName
     *        The name of the training job that you want a summary for.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public TrainingJobSummary withTrainingJobName(String trainingJobName) {
        setTrainingJobName(trainingJobName);
        return this;
    }

    /**
     * <p>
     * The Amazon Resource Name (ARN) of the training job.
     * </p>
     * 
     * @param trainingJobArn
     *        The Amazon Resource Name (ARN) of the training job.
     */

    public void setTrainingJobArn(String trainingJobArn) {
        this.trainingJobArn = trainingJobArn;
    }

    /**
     * <p>
     * The Amazon Resource Name (ARN) of the training job.
     * </p>
     * 
     * @return The Amazon Resource Name (ARN) of the training job.
     */

    public String getTrainingJobArn() {
        return this.trainingJobArn;
    }

    /**
     * <p>
     * The Amazon Resource Name (ARN) of the training job.
     * </p>
     * 
     * @param trainingJobArn
     *        The Amazon Resource Name (ARN) of the training job.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public TrainingJobSummary withTrainingJobArn(String trainingJobArn) {
        setTrainingJobArn(trainingJobArn);
        return this;
    }

    /**
     * <p>
     * A timestamp that shows when the training job was created.
     * </p>
     * 
     * @param creationTime
     *        A timestamp that shows when the training job was created.
     */

    public void setCreationTime(java.util.Date creationTime) {
        this.creationTime = creationTime;
    }

    /**
     * <p>
     * A timestamp that shows when the training job was created.
     * </p>
     * 
     * @return A timestamp that shows when the training job was created.
     */

    public java.util.Date getCreationTime() {
        return this.creationTime;
    }

    /**
     * <p>
     * A timestamp that shows when the training job was created.
     * </p>
     * 
     * @param creationTime
     *        A timestamp that shows when the training job was created.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public TrainingJobSummary withCreationTime(java.util.Date creationTime) {
        setCreationTime(creationTime);
        return this;
    }

    /**
     * <p>
     * A timestamp that shows when the training job ended. This field is set only if the training job has one of the
     * terminal statuses (<code>Completed</code>, <code>Failed</code>, or <code>Stopped</code>).
     * </p>
     * 
     * @param trainingEndTime
     *        A timestamp that shows when the training job ended. This field is set only if the training job has one of
     *        the terminal statuses (<code>Completed</code>, <code>Failed</code>, or <code>Stopped</code>).
     */

    public void setTrainingEndTime(java.util.Date trainingEndTime) {
        this.trainingEndTime = trainingEndTime;
    }

    /**
     * <p>
     * A timestamp that shows when the training job ended. This field is set only if the training job has one of the
     * terminal statuses (<code>Completed</code>, <code>Failed</code>, or <code>Stopped</code>).
     * </p>
     * 
     * @return A timestamp that shows when the training job ended. This field is set only if the training job has one of
     *         the terminal statuses (<code>Completed</code>, <code>Failed</code>, or <code>Stopped</code>).
     */

    public java.util.Date getTrainingEndTime() {
        return this.trainingEndTime;
    }

    /**
     * <p>
     * A timestamp that shows when the training job ended. This field is set only if the training job has one of the
     * terminal statuses (<code>Completed</code>, <code>Failed</code>, or <code>Stopped</code>).
     * </p>
     * 
     * @param trainingEndTime
     *        A timestamp that shows when the training job ended. This field is set only if the training job has one of
     *        the terminal statuses (<code>Completed</code>, <code>Failed</code>, or <code>Stopped</code>).
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public TrainingJobSummary withTrainingEndTime(java.util.Date trainingEndTime) {
        setTrainingEndTime(trainingEndTime);
        return this;
    }

    /**
     * <p>
     * Timestamp when the training job was last modified.
     * </p>
     * 
     * @param lastModifiedTime
     *        Timestamp when the training job was last modified.
     */

    public void setLastModifiedTime(java.util.Date lastModifiedTime) {
        this.lastModifiedTime = lastModifiedTime;
    }

    /**
     * <p>
     * Timestamp when the training job was last modified.
     * </p>
     * 
     * @return Timestamp when the training job was last modified.
     */

    public java.util.Date getLastModifiedTime() {
        return this.lastModifiedTime;
    }

    /**
     * <p>
     * Timestamp when the training job was last modified.
     * </p>
     * 
     * @param lastModifiedTime
     *        Timestamp when the training job was last modified.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public TrainingJobSummary withLastModifiedTime(java.util.Date lastModifiedTime) {
        setLastModifiedTime(lastModifiedTime);
        return this;
    }

    /**
     * <p>
     * The status of the training job.
     * </p>
     * 
     * @param trainingJobStatus
     *        The status of the training job.
     * @see TrainingJobStatus
     */

    public void setTrainingJobStatus(String trainingJobStatus) {
        this.trainingJobStatus = trainingJobStatus;
    }

    /**
     * <p>
     * The status of the training job.
     * </p>
     * 
     * @return The status of the training job.
     * @see TrainingJobStatus
     */

    public String getTrainingJobStatus() {
        return this.trainingJobStatus;
    }

    /**
     * <p>
     * The status of the training job.
     * </p>
     * 
     * @param trainingJobStatus
     *        The status of the training job.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see TrainingJobStatus
     */

    public TrainingJobSummary withTrainingJobStatus(String trainingJobStatus) {
        setTrainingJobStatus(trainingJobStatus);
        return this;
    }

    /**
     * <p>
     * The status of the training job.
     * </p>
     * 
     * @param trainingJobStatus
     *        The status of the training job.
     * @return Returns a reference to this object so that method calls can be chained together.
     * @see TrainingJobStatus
     */

    public TrainingJobSummary withTrainingJobStatus(TrainingJobStatus trainingJobStatus) {
        this.trainingJobStatus = trainingJobStatus.toString();
        return this;
    }

    /**
     * <p>
     * The status of the warm pool associated with the training job.
     * </p>
     * 
     * @param warmPoolStatus
     *        The status of the warm pool associated with the training job.
     */

    public void setWarmPoolStatus(WarmPoolStatus warmPoolStatus) {
        this.warmPoolStatus = warmPoolStatus;
    }

    /**
     * <p>
     * The status of the warm pool associated with the training job.
     * </p>
     * 
     * @return The status of the warm pool associated with the training job.
     */

    public WarmPoolStatus getWarmPoolStatus() {
        return this.warmPoolStatus;
    }

    /**
     * <p>
     * The status of the warm pool associated with the training job.
     * </p>
     * 
     * @param warmPoolStatus
     *        The status of the warm pool associated with the training job.
     * @return Returns a reference to this object so that method calls can be chained together.
     */

    public TrainingJobSummary withWarmPoolStatus(WarmPoolStatus warmPoolStatus) {
        setWarmPoolStatus(warmPoolStatus);
        return this;
    }

    /**
     * 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.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getTrainingJobName() != null)
            sb.append("TrainingJobName: ").append(getTrainingJobName()).append(",");
        if (getTrainingJobArn() != null)
            sb.append("TrainingJobArn: ").append(getTrainingJobArn()).append(",");
        if (getCreationTime() != null)
            sb.append("CreationTime: ").append(getCreationTime()).append(",");
        if (getTrainingEndTime() != null)
            sb.append("TrainingEndTime: ").append(getTrainingEndTime()).append(",");
        if (getLastModifiedTime() != null)
            sb.append("LastModifiedTime: ").append(getLastModifiedTime()).append(",");
        if (getTrainingJobStatus() != null)
            sb.append("TrainingJobStatus: ").append(getTrainingJobStatus()).append(",");
        if (getWarmPoolStatus() != null)
            sb.append("WarmPoolStatus: ").append(getWarmPoolStatus());
        sb.append("}");
        return sb.toString();
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;

        if (obj instanceof TrainingJobSummary == false)
            return false;
        TrainingJobSummary other = (TrainingJobSummary) obj;
        if (other.getTrainingJobName() == null ^ this.getTrainingJobName() == null)
            return false;
        if (other.getTrainingJobName() != null && other.getTrainingJobName().equals(this.getTrainingJobName()) == false)
            return false;
        if (other.getTrainingJobArn() == null ^ this.getTrainingJobArn() == null)
            return false;
        if (other.getTrainingJobArn() != null && other.getTrainingJobArn().equals(this.getTrainingJobArn()) == false)
            return false;
        if (other.getCreationTime() == null ^ this.getCreationTime() == null)
            return false;
        if (other.getCreationTime() != null && other.getCreationTime().equals(this.getCreationTime()) == false)
            return false;
        if (other.getTrainingEndTime() == null ^ this.getTrainingEndTime() == null)
            return false;
        if (other.getTrainingEndTime() != null && other.getTrainingEndTime().equals(this.getTrainingEndTime()) == false)
            return false;
        if (other.getLastModifiedTime() == null ^ this.getLastModifiedTime() == null)
            return false;
        if (other.getLastModifiedTime() != null && other.getLastModifiedTime().equals(this.getLastModifiedTime()) == false)
            return false;
        if (other.getTrainingJobStatus() == null ^ this.getTrainingJobStatus() == null)
            return false;
        if (other.getTrainingJobStatus() != null && other.getTrainingJobStatus().equals(this.getTrainingJobStatus()) == false)
            return false;
        if (other.getWarmPoolStatus() == null ^ this.getWarmPoolStatus() == null)
            return false;
        if (other.getWarmPoolStatus() != null && other.getWarmPoolStatus().equals(this.getWarmPoolStatus()) == false)
            return false;
        return true;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getTrainingJobName() == null) ? 0 : getTrainingJobName().hashCode());
        hashCode = prime * hashCode + ((getTrainingJobArn() == null) ? 0 : getTrainingJobArn().hashCode());
        hashCode = prime * hashCode + ((getCreationTime() == null) ? 0 : getCreationTime().hashCode());
        hashCode = prime * hashCode + ((getTrainingEndTime() == null) ? 0 : getTrainingEndTime().hashCode());
        hashCode = prime * hashCode + ((getLastModifiedTime() == null) ? 0 : getLastModifiedTime().hashCode());
        hashCode = prime * hashCode + ((getTrainingJobStatus() == null) ? 0 : getTrainingJobStatus().hashCode());
        hashCode = prime * hashCode + ((getWarmPoolStatus() == null) ? 0 : getWarmPoolStatus().hashCode());
        return hashCode;
    }

    @Override
    public TrainingJobSummary clone() {
        try {
            return (TrainingJobSummary) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }

    @com.amazonaws.annotation.SdkInternalApi
    @Override
    public void marshall(ProtocolMarshaller protocolMarshaller) {
        com.amazonaws.services.sagemaker.model.transform.TrainingJobSummaryMarshaller.getInstance().marshall(this, protocolMarshaller);
    }
}
