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

package com.azure.resourcemanager.elasticsan.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Metadata about an operation. */
@Fluent
public final class ElasticSanOperationDisplay {
    /*
     * Localized friendly form of the resource provider name.
     */
    @JsonProperty(value = "provider", required = true)
    private String provider;

    /*
     * Localized friendly form of the resource type related to this action/operation.
     */
    @JsonProperty(value = "resource", required = true)
    private String resource;

    /*
     * Localized friendly name for the operation, as it should be shown to the user.
     */
    @JsonProperty(value = "operation", required = true)
    private String operation;

    /*
     * Localized friendly description for the operation, as it should be shown to the user.
     */
    @JsonProperty(value = "description", required = true)
    private String description;

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

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

    /**
     * Set the provider property: Localized friendly form of the resource provider name.
     *
     * @param provider the provider value to set.
     * @return the ElasticSanOperationDisplay object itself.
     */
    public ElasticSanOperationDisplay withProvider(String provider) {
        this.provider = provider;
        return this;
    }

    /**
     * Get the resource property: Localized friendly form of the resource type related to this action/operation.
     *
     * @return the resource value.
     */
    public String resource() {
        return this.resource;
    }

    /**
     * Set the resource property: Localized friendly form of the resource type related to this action/operation.
     *
     * @param resource the resource value to set.
     * @return the ElasticSanOperationDisplay object itself.
     */
    public ElasticSanOperationDisplay withResource(String resource) {
        this.resource = resource;
        return this;
    }

    /**
     * Get the operation property: Localized friendly name for the operation, as it should be shown to the user.
     *
     * @return the operation value.
     */
    public String operation() {
        return this.operation;
    }

    /**
     * Set the operation property: Localized friendly name for the operation, as it should be shown to the user.
     *
     * @param operation the operation value to set.
     * @return the ElasticSanOperationDisplay object itself.
     */
    public ElasticSanOperationDisplay withOperation(String operation) {
        this.operation = operation;
        return this;
    }

    /**
     * Get the description property: Localized friendly description for the operation, as it should be shown to the
     * user.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: Localized friendly description for the operation, as it should be shown to the
     * user.
     *
     * @param description the description value to set.
     * @return the ElasticSanOperationDisplay object itself.
     */
    public ElasticSanOperationDisplay withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (provider() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property provider in model ElasticSanOperationDisplay"));
        }
        if (resource() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property resource in model ElasticSanOperationDisplay"));
        }
        if (operation() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property operation in model ElasticSanOperationDisplay"));
        }
        if (description() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property description in model ElasticSanOperationDisplay"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ElasticSanOperationDisplay.class);
}
