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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.orbital.models.OperationResultErrorProperties;
import com.azure.resourcemanager.orbital.models.Status;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Operation Result Entity. */
@Fluent
public final class OperationResultInner {
    /*
     * ID of the resource.
     */
    @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
    private String id;

    /*
     * Name of the resource.
     */
    @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
    private String name;

    /*
     * The status of operation.
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private Status status;

    /*
     * The operation start time (ISO 8601 UTC standard).
     */
    @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime startTime;

    /*
     * The operation end time (ISO 8601 UTC standard).
     */
    @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime endTime;

    /*
     * Percentage completed.
     */
    @JsonProperty(value = "percentComplete", access = JsonProperty.Access.WRITE_ONLY)
    private Double percentComplete;

    /*
     * A list of results when the operation returns multiple results.
     */
    @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY)
    private List<Object> value;

    /*
     * The URL to get the next set of results.
     */
    @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY)
    private String nextLink;

    /*
     * Operation result properties.
     */
    @JsonProperty(value = "properties")
    private Object properties;

    /*
     * Operation result error properties.
     */
    @JsonProperty(value = "error")
    private OperationResultErrorProperties error;

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

    /**
     * Get the id property: ID of the resource.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

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

    /**
     * Get the status property: The status of operation.
     *
     * @return the status value.
     */
    public Status status() {
        return this.status;
    }

    /**
     * Get the startTime property: The operation start time (ISO 8601 UTC standard).
     *
     * @return the startTime value.
     */
    public OffsetDateTime startTime() {
        return this.startTime;
    }

    /**
     * Get the endTime property: The operation end time (ISO 8601 UTC standard).
     *
     * @return the endTime value.
     */
    public OffsetDateTime endTime() {
        return this.endTime;
    }

    /**
     * Get the percentComplete property: Percentage completed.
     *
     * @return the percentComplete value.
     */
    public Double percentComplete() {
        return this.percentComplete;
    }

    /**
     * Get the value property: A list of results when the operation returns multiple results.
     *
     * @return the value value.
     */
    public List<Object> value() {
        return this.value;
    }

    /**
     * Get the nextLink property: The URL to get the next set of results.
     *
     * @return the nextLink value.
     */
    public String nextLink() {
        return this.nextLink;
    }

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

    /**
     * Set the properties property: Operation result properties.
     *
     * @param properties the properties value to set.
     * @return the OperationResultInner object itself.
     */
    public OperationResultInner withProperties(Object properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Get the error property: Operation result error properties.
     *
     * @return the error value.
     */
    public OperationResultErrorProperties error() {
        return this.error;
    }

    /**
     * Set the error property: Operation result error properties.
     *
     * @param error the error value to set.
     * @return the OperationResultInner object itself.
     */
    public OperationResultInner withError(OperationResultErrorProperties error) {
        this.error = error;
        return this;
    }

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