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

package com.azure.resourcemanager.avs.models;

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

/** An iSCSI volume from Microsoft.StoragePool provider. */
@Fluent
public final class DiskPoolVolume {
    /*
     * Azure resource ID of the iSCSI target
     */
    @JsonProperty(value = "targetId", required = true)
    private String targetId;

    /*
     * Name of the LUN to be used for datastore
     */
    @JsonProperty(value = "lunName", required = true)
    private String lunName;

    /*
     * Mode that describes whether the LUN has to be mounted as a datastore or attached as a LUN
     */
    @JsonProperty(value = "mountOption")
    private MountOptionEnum mountOption;

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

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

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

    /**
     * Set the targetId property: Azure resource ID of the iSCSI target.
     *
     * @param targetId the targetId value to set.
     * @return the DiskPoolVolume object itself.
     */
    public DiskPoolVolume withTargetId(String targetId) {
        this.targetId = targetId;
        return this;
    }

    /**
     * Get the lunName property: Name of the LUN to be used for datastore.
     *
     * @return the lunName value.
     */
    public String lunName() {
        return this.lunName;
    }

    /**
     * Set the lunName property: Name of the LUN to be used for datastore.
     *
     * @param lunName the lunName value to set.
     * @return the DiskPoolVolume object itself.
     */
    public DiskPoolVolume withLunName(String lunName) {
        this.lunName = lunName;
        return this;
    }

    /**
     * Get the mountOption property: Mode that describes whether the LUN has to be mounted as a datastore or attached as
     * a LUN.
     *
     * @return the mountOption value.
     */
    public MountOptionEnum mountOption() {
        return this.mountOption;
    }

    /**
     * Set the mountOption property: Mode that describes whether the LUN has to be mounted as a datastore or attached as
     * a LUN.
     *
     * @param mountOption the mountOption value to set.
     * @return the DiskPoolVolume object itself.
     */
    public DiskPoolVolume withMountOption(MountOptionEnum mountOption) {
        this.mountOption = mountOption;
        return this;
    }

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

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

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