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

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

import com.azure.core.annotation.Immutable;
import com.azure.resourcemanager.resourcemover.models.OperationStatusError;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Operation status REST resource. */
@Immutable
public final class OperationStatusInner {
    /*
     * Resource Id.
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /*
     * Operation name.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * Status of the operation. ARM expects the terminal status to be one of Succeeded/ Failed/ Canceled. All other
     * values imply that the operation is still running.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private String status;

    /*
     * Start time.
     */
    @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY)
    private String startTime;

    /*
     * End time.
     */
    @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY)
    private String endTime;

    /*
     * Error stating all error details for the operation.
     */
    @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY)
    private OperationStatusError error;

    /*
     * Custom data.
     */
    @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY)
    private Object properties;

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

    /**
     * Get the id property: Resource Id.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Get the name property: Operation name.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Get the status property: Status of the operation. ARM expects the terminal status to be one of Succeeded/ Failed/
     * Canceled. All other values imply that the operation is still running.
     *
     * @return the status value.
     */
    public String status() {
        return this.status;
    }

    /**
     * Get the startTime property: Start time.
     *
     * @return the startTime value.
     */
    public String startTime() {
        return this.startTime;
    }

    /**
     * Get the endTime property: End time.
     *
     * @return the endTime value.
     */
    public String endTime() {
        return this.endTime;
    }

    /**
     * Get the error property: Error stating all error details for the operation.
     *
     * @return the error value.
     */
    public OperationStatusError error() {
        return this.error;
    }

    /**
     * Get the properties property: Custom data.
     *
     * @return the properties value.
     */
    public Object properties() {
        return this.properties;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (error() != null) {
            error().validate();
        }
    }
}
