// 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.core.management.ProxyResource;
import com.azure.core.management.SystemData;
import com.azure.resourcemanager.elasticsan.models.IscsiTargetInfo;
import com.azure.resourcemanager.elasticsan.models.SourceCreationData;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** Response for Volume request. */
@Fluent
public final class VolumeInner extends ProxyResource {
    /*
     * Properties of Volume.
     */
    @JsonProperty(value = "properties")
    private VolumeProperties innerProperties;

    /*
     * Resource metadata required by ARM RPC
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

    /*
     * Azure resource tags.
     */
    @JsonProperty(value = "tags")
    @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS)
    private Map<String, String> tags;

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

    /**
     * Get the innerProperties property: Properties of Volume.
     *
     * @return the innerProperties value.
     */
    private VolumeProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the systemData property: Resource metadata required by ARM RPC.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /**
     * Get the tags property: Azure resource tags.
     *
     * @return the tags value.
     */
    public Map<String, String> tags() {
        return this.tags;
    }

    /**
     * Set the tags property: Azure resource tags.
     *
     * @param tags the tags value to set.
     * @return the VolumeInner object itself.
     */
    public VolumeInner withTags(Map<String, String> tags) {
        this.tags = tags;
        return this;
    }

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

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

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

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

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

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

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