// 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.AvailableOperationDisplay;
import com.azure.resourcemanager.vmwarecloudsimple.models.AvailableOperationDisplayPropertyServiceSpecificationMetricsList;
import com.azure.resourcemanager.vmwarecloudsimple.models.OperationOrigin;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Resource provider available operation model. */
@Fluent
public final class AvailableOperationInner {
    /*
     * The list of operations
     */
    @JsonProperty(value = "display")
    private AvailableOperationDisplay display;

    /*
     * Indicating whether the operation is a data action or not
     */
    @JsonProperty(value = "isDataAction")
    private Boolean isDataAction;

    /*
     * {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The origin of operation
     */
    @JsonProperty(value = "origin")
    private OperationOrigin origin;

    /*
     * The list of operation properties
     */
    @JsonProperty(value = "properties")
    private AvailableOperationDisplayPropertyServiceSpecification innerProperties;

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

    /**
     * Get the display property: The list of operations.
     *
     * @return the display value.
     */
    public AvailableOperationDisplay display() {
        return this.display;
    }

    /**
     * Set the display property: The list of operations.
     *
     * @param display the display value to set.
     * @return the AvailableOperationInner object itself.
     */
    public AvailableOperationInner withDisplay(AvailableOperationDisplay display) {
        this.display = display;
        return this;
    }

    /**
     * Get the isDataAction property: Indicating whether the operation is a data action or not.
     *
     * @return the isDataAction value.
     */
    public Boolean isDataAction() {
        return this.isDataAction;
    }

    /**
     * Set the isDataAction property: Indicating whether the operation is a data action or not.
     *
     * @param isDataAction the isDataAction value to set.
     * @return the AvailableOperationInner object itself.
     */
    public AvailableOperationInner withIsDataAction(Boolean isDataAction) {
        this.isDataAction = isDataAction;
        return this;
    }

    /**
     * Get the name property: {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: {resourceProviderNamespace}/{resourceType}/{read|write|delete|action}.
     *
     * @param name the name value to set.
     * @return the AvailableOperationInner object itself.
     */
    public AvailableOperationInner withName(String name) {
        this.name = name;
        return this;
    }

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

    /**
     * Set the origin property: The origin of operation.
     *
     * @param origin the origin value to set.
     * @return the AvailableOperationInner object itself.
     */
    public AvailableOperationInner withOrigin(OperationOrigin origin) {
        this.origin = origin;
        return this;
    }

    /**
     * Get the innerProperties property: The list of operation properties.
     *
     * @return the innerProperties value.
     */
    private AvailableOperationDisplayPropertyServiceSpecification innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the serviceSpecification property: The list of specification's service metrics.
     *
     * @return the serviceSpecification value.
     */
    public AvailableOperationDisplayPropertyServiceSpecificationMetricsList serviceSpecification() {
        return this.innerProperties() == null ? null : this.innerProperties().serviceSpecification();
    }

    /**
     * Set the serviceSpecification property: The list of specification's service metrics.
     *
     * @param serviceSpecification the serviceSpecification value to set.
     * @return the AvailableOperationInner object itself.
     */
    public AvailableOperationInner withServiceSpecification(
        AvailableOperationDisplayPropertyServiceSpecificationMetricsList serviceSpecification) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AvailableOperationDisplayPropertyServiceSpecification();
        }
        this.innerProperties().withServiceSpecification(serviceSpecification);
        return this;
    }

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