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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.storagecache.models.ErrorResponse;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The status of operation. */
@Fluent
public final class AscOperationInner {
    /*
     * The operation Id.
     */
    @JsonProperty(value = "id")
    private String id;

    /*
     * The operation name.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The start time of the operation.
     */
    @JsonProperty(value = "startTime")
    private String startTime;

    /*
     * The end time of the operation.
     */
    @JsonProperty(value = "endTime")
    private String endTime;

    /*
     * The status of the operation.
     */
    @JsonProperty(value = "status")
    private String status;

    /*
     * The error detail of the operation if any.
     */
    @JsonProperty(value = "error")
    private ErrorResponse error;

    /*
     * Additional operation-specific properties
     */
    @JsonProperty(value = "properties")
    private AscOperationProperties innerProperties;

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

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

    /**
     * Set the id property: The operation Id.
     *
     * @param id the id value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withId(String id) {
        this.id = id;
        return this;
    }

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

    /**
     * Set the name property: The operation name.
     *
     * @param name the name value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withName(String name) {
        this.name = name;
        return this;
    }

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

    /**
     * Set the startTime property: The start time of the operation.
     *
     * @param startTime the startTime value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withStartTime(String startTime) {
        this.startTime = startTime;
        return this;
    }

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

    /**
     * Set the endTime property: The end time of the operation.
     *
     * @param endTime the endTime value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withEndTime(String endTime) {
        this.endTime = endTime;
        return this;
    }

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

    /**
     * Set the status property: The status of the operation.
     *
     * @param status the status value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withStatus(String status) {
        this.status = status;
        return this;
    }

    /**
     * Get the error property: The error detail of the operation if any.
     *
     * @return the error value.
     */
    public ErrorResponse error() {
        return this.error;
    }

    /**
     * Set the error property: The error detail of the operation if any.
     *
     * @param error the error value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withError(ErrorResponse error) {
        this.error = error;
        return this;
    }

    /**
     * Get the innerProperties property: Additional operation-specific properties.
     *
     * @return the innerProperties value.
     */
    private AscOperationProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the output property: Additional operation-specific output.
     *
     * @return the output value.
     */
    public Map<String, Object> output() {
        return this.innerProperties() == null ? null : this.innerProperties().output();
    }

    /**
     * Set the output property: Additional operation-specific output.
     *
     * @param output the output value to set.
     * @return the AscOperationInner object itself.
     */
    public AscOperationInner withOutput(Map<String, Object> output) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AscOperationProperties();
        }
        this.innerProperties().withOutput(output);
        return this;
    }

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