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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.vmwarecloudsimple.models.OperationError;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Operation status response. */
@Fluent
public final class OperationResourceInner {
    /*
     * End time of the operation
     */
    @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime endTime;

    /*
     * Error Message if operation failed
     */
    @JsonProperty(value = "error")
    private OperationError error;

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

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

    /*
     * Start time of the operation
     */
    @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime startTime;

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

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

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

    /**
     * Get the error property: Error Message if operation failed.
     *
     * @return the error value.
     */
    public OperationError error() {
        return this.error;
    }

    /**
     * Set the error property: Error Message if operation failed.
     *
     * @param error the error value to set.
     * @return the OperationResourceInner object itself.
     */
    public OperationResourceInner withError(OperationError error) {
        this.error = error;
        return this;
    }

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

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

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

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

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