// 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.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo;
import com.azure.resourcemanager.elasticsan.models.SourceCreationData;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Volume response properties. */
@Fluent
public final class VolumeProperties {
    /*
     * Unique Id of the volume in GUID format
     */
    @JsonProperty(value = "volumeId", access = JsonProperty.Access.WRITE_ONLY)
    private String volumeId;

    /*
     * State of the operation on the resource.
     */
    @JsonProperty(value = "creationData")
    private SourceCreationData creationData;

    /*
     * Volume size.
     */
    @JsonProperty(value = "sizeGiB")
    private Long sizeGiB;

    /*
     * Storage target information
     */
    @JsonProperty(value = "storageTarget", access = JsonProperty.Access.WRITE_ONLY)
    private IscsiTargetInfo storageTarget;

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

    /**
     * Get the volumeId property: Unique Id of the volume in GUID format.
     *
     * @return the volumeId value.
     */
    public String volumeId() {
        return this.volumeId;
    }

    /**
     * Get the creationData property: State of the operation on the resource.
     *
     * @return the creationData value.
     */
    public SourceCreationData creationData() {
        return this.creationData;
    }

    /**
     * Set the creationData property: State of the operation on the resource.
     *
     * @param creationData the creationData value to set.
     * @return the VolumeProperties object itself.
     */
    public VolumeProperties withCreationData(SourceCreationData creationData) {
        this.creationData = creationData;
        return this;
    }

    /**
     * Get the sizeGiB property: Volume size.
     *
     * @return the sizeGiB value.
     */
    public Long sizeGiB() {
        return this.sizeGiB;
    }

    /**
     * Set the sizeGiB property: Volume size.
     *
     * @param sizeGiB the sizeGiB value to set.
     * @return the VolumeProperties object itself.
     */
    public VolumeProperties withSizeGiB(Long sizeGiB) {
        this.sizeGiB = sizeGiB;
        return this;
    }

    /**
     * Get the storageTarget property: Storage target information.
     *
     * @return the storageTarget value.
     */
    public IscsiTargetInfo storageTarget() {
        return this.storageTarget;
    }

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