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

package com.azure.resourcemanager.batchai.models;

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

/** Data disks settings. */
@Fluent
public final class DataDisks {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(DataDisks.class);

    /*
     * Disk size in GB for the blank data disks.
     */
    @JsonProperty(value = "diskSizeInGB", required = true)
    private int diskSizeInGB;

    /*
     * Caching type for the disks. Available values are none (default),
     * readonly, readwrite. Caching type can be set only for VM sizes
     * supporting premium storage.
     */
    @JsonProperty(value = "cachingType")
    private CachingType cachingType;

    /*
     * Number of data disks attached to the File Server. If multiple disks
     * attached, they will be configured in RAID level 0.
     */
    @JsonProperty(value = "diskCount", required = true)
    private int diskCount;

    /*
     * Type of storage account to be used on the disk. Possible values are:
     * Standard_LRS or Premium_LRS. Premium storage account type can only be
     * used with VM sizes supporting premium storage.
     */
    @JsonProperty(value = "storageAccountType", required = true)
    private StorageAccountType storageAccountType;

    /**
     * Get the diskSizeInGB property: Disk size in GB for the blank data disks.
     *
     * @return the diskSizeInGB value.
     */
    public int diskSizeInGB() {
        return this.diskSizeInGB;
    }

    /**
     * Set the diskSizeInGB property: Disk size in GB for the blank data disks.
     *
     * @param diskSizeInGB the diskSizeInGB value to set.
     * @return the DataDisks object itself.
     */
    public DataDisks withDiskSizeInGB(int diskSizeInGB) {
        this.diskSizeInGB = diskSizeInGB;
        return this;
    }

    /**
     * Get the cachingType property: Caching type for the disks. Available values are none (default), readonly,
     * readwrite. Caching type can be set only for VM sizes supporting premium storage.
     *
     * @return the cachingType value.
     */
    public CachingType cachingType() {
        return this.cachingType;
    }

    /**
     * Set the cachingType property: Caching type for the disks. Available values are none (default), readonly,
     * readwrite. Caching type can be set only for VM sizes supporting premium storage.
     *
     * @param cachingType the cachingType value to set.
     * @return the DataDisks object itself.
     */
    public DataDisks withCachingType(CachingType cachingType) {
        this.cachingType = cachingType;
        return this;
    }

    /**
     * Get the diskCount property: Number of data disks attached to the File Server. If multiple disks attached, they
     * will be configured in RAID level 0.
     *
     * @return the diskCount value.
     */
    public int diskCount() {
        return this.diskCount;
    }

    /**
     * Set the diskCount property: Number of data disks attached to the File Server. If multiple disks attached, they
     * will be configured in RAID level 0.
     *
     * @param diskCount the diskCount value to set.
     * @return the DataDisks object itself.
     */
    public DataDisks withDiskCount(int diskCount) {
        this.diskCount = diskCount;
        return this;
    }

    /**
     * Get the storageAccountType property: Type of storage account to be used on the disk. Possible values are:
     * Standard_LRS or Premium_LRS. Premium storage account type can only be used with VM sizes supporting premium
     * storage.
     *
     * @return the storageAccountType value.
     */
    public StorageAccountType storageAccountType() {
        return this.storageAccountType;
    }

    /**
     * Set the storageAccountType property: Type of storage account to be used on the disk. Possible values are:
     * Standard_LRS or Premium_LRS. Premium storage account type can only be used with VM sizes supporting premium
     * storage.
     *
     * @param storageAccountType the storageAccountType value to set.
     * @return the DataDisks object itself.
     */
    public DataDisks withStorageAccountType(StorageAccountType storageAccountType) {
        this.storageAccountType = storageAccountType;
        return this;
    }

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