// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.defendereasm.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.defendereasm.models.ResourceBaseProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Task properties. */
@Fluent
public final class TaskResourceProperties extends ResourceBaseProperties {
    /*
     * The time the task started
     */
    @JsonProperty(value = "startedAt")
    private String startedAt;

    /*
     * The time the task completed
     */
    @JsonProperty(value = "completedAt")
    private String completedAt;

    /*
     * The last time the task was polled
     */
    @JsonProperty(value = "lastPolledAt")
    private String lastPolledAt;

    /*
     * the state the task is in
     */
    @JsonProperty(value = "state")
    private String state;

    /*
     * the phase the task is in
     */
    @JsonProperty(value = "phase")
    private String phase;

    /*
     * The reason the task was moved into its current state, if the task wasn't completed.
     */
    @JsonProperty(value = "reason")
    private String reason;

    /*
     * The reason the task was moved into its current state, if the task wasn't completed.
     */
    @JsonProperty(value = "metadata")
    private Object metadata;

    /** Creates an instance of TaskResourceProperties class. */
    public TaskResourceProperties() {
    }

    /**
     * Get the startedAt property: The time the task started.
     *
     * @return the startedAt value.
     */
    public String startedAt() {
        return this.startedAt;
    }

    /**
     * Set the startedAt property: The time the task started.
     *
     * @param startedAt the startedAt value to set.
     * @return the TaskResourceProperties object itself.
     */
    public TaskResourceProperties withStartedAt(String startedAt) {
        this.startedAt = startedAt;
        return this;
    }

    /**
     * Get the completedAt property: The time the task completed.
     *
     * @return the completedAt value.
     */
    public String completedAt() {
        return this.completedAt;
    }

    /**
     * Set the completedAt property: The time the task completed.
     *
     * @param completedAt the completedAt value to set.
     * @return the TaskResourceProperties object itself.
     */
    public TaskResourceProperties withCompletedAt(String completedAt) {
        this.completedAt = completedAt;
        return this;
    }

    /**
     * Get the lastPolledAt property: The last time the task was polled.
     *
     * @return the lastPolledAt value.
     */
    public String lastPolledAt() {
        return this.lastPolledAt;
    }

    /**
     * Set the lastPolledAt property: The last time the task was polled.
     *
     * @param lastPolledAt the lastPolledAt value to set.
     * @return the TaskResourceProperties object itself.
     */
    public TaskResourceProperties withLastPolledAt(String lastPolledAt) {
        this.lastPolledAt = lastPolledAt;
        return this;
    }

    /**
     * Get the state property: the state the task is in.
     *
     * @return the state value.
     */
    public String state() {
        return this.state;
    }

    /**
     * Set the state property: the state the task is in.
     *
     * @param state the state value to set.
     * @return the TaskResourceProperties object itself.
     */
    public TaskResourceProperties withState(String state) {
        this.state = state;
        return this;
    }

    /**
     * Get the phase property: the phase the task is in.
     *
     * @return the phase value.
     */
    public String phase() {
        return this.phase;
    }

    /**
     * Set the phase property: the phase the task is in.
     *
     * @param phase the phase value to set.
     * @return the TaskResourceProperties object itself.
     */
    public TaskResourceProperties withPhase(String phase) {
        this.phase = phase;
        return this;
    }

    /**
     * Get the reason property: The reason the task was moved into its current state, if the task wasn't completed.
     *
     * @return the reason value.
     */
    public String reason() {
        return this.reason;
    }

    /**
     * Set the reason property: The reason the task was moved into its current state, if the task wasn't completed.
     *
     * @param reason the reason value to set.
     * @return the TaskResourceProperties object itself.
     */
    public TaskResourceProperties withReason(String reason) {
        this.reason = reason;
        return this;
    }

    /**
     * Get the metadata property: The reason the task was moved into its current state, if the task wasn't completed.
     *
     * @return the metadata value.
     */
    public Object metadata() {
        return this.metadata;
    }

    /**
     * Set the metadata property: The reason the task was moved into its current state, if the task wasn't completed.
     *
     * @param metadata the metadata value to set.
     * @return the TaskResourceProperties object itself.
     */
    public TaskResourceProperties withMetadata(Object metadata) {
        this.metadata = metadata;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
    }
}
