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

package com.azure.resourcemanager.qumulo.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.qumulo.models.MarketplaceDetails;
import com.azure.resourcemanager.qumulo.models.ProvisioningState;
import com.azure.resourcemanager.qumulo.models.StorageSku;
import com.azure.resourcemanager.qumulo.models.UserDetails;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Properties specific to the Qumulo File System resource. */
@Fluent
public final class FileSystemResourceProperties {
    /*
     * Marketplace details
     */
    @JsonProperty(value = "marketplaceDetails", required = true)
    private MarketplaceDetails marketplaceDetails;

    /*
     * Provisioning State of the resource
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private ProvisioningState provisioningState;

    /*
     * Storage Sku
     */
    @JsonProperty(value = "storageSku", required = true)
    private StorageSku storageSku;

    /*
     * User Details
     */
    @JsonProperty(value = "userDetails", required = true)
    private UserDetails userDetails;

    /*
     * Delegated subnet id for Vnet injection
     */
    @JsonProperty(value = "delegatedSubnetId", required = true)
    private String delegatedSubnetId;

    /*
     * File system Id of the resource
     */
    @JsonProperty(value = "clusterLoginUrl")
    private String clusterLoginUrl;

    /*
     * Private IPs of the resource
     */
    @JsonProperty(value = "privateIPs")
    private List<String> privateIPs;

    /*
     * Initial administrator password of the resource
     */
    @JsonProperty(value = "adminPassword", required = true)
    private String adminPassword;

    /*
     * Storage capacity in TB
     */
    @JsonProperty(value = "initialCapacity", required = true)
    private int initialCapacity;

    /*
     * Availability zone
     */
    @JsonProperty(value = "availabilityZone")
    private String availabilityZone;

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

    /**
     * Get the marketplaceDetails property: Marketplace details.
     *
     * @return the marketplaceDetails value.
     */
    public MarketplaceDetails marketplaceDetails() {
        return this.marketplaceDetails;
    }

    /**
     * Set the marketplaceDetails property: Marketplace details.
     *
     * @param marketplaceDetails the marketplaceDetails value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withMarketplaceDetails(MarketplaceDetails marketplaceDetails) {
        this.marketplaceDetails = marketplaceDetails;
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning State of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the storageSku property: Storage Sku.
     *
     * @return the storageSku value.
     */
    public StorageSku storageSku() {
        return this.storageSku;
    }

    /**
     * Set the storageSku property: Storage Sku.
     *
     * @param storageSku the storageSku value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withStorageSku(StorageSku storageSku) {
        this.storageSku = storageSku;
        return this;
    }

    /**
     * Get the userDetails property: User Details.
     *
     * @return the userDetails value.
     */
    public UserDetails userDetails() {
        return this.userDetails;
    }

    /**
     * Set the userDetails property: User Details.
     *
     * @param userDetails the userDetails value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withUserDetails(UserDetails userDetails) {
        this.userDetails = userDetails;
        return this;
    }

    /**
     * Get the delegatedSubnetId property: Delegated subnet id for Vnet injection.
     *
     * @return the delegatedSubnetId value.
     */
    public String delegatedSubnetId() {
        return this.delegatedSubnetId;
    }

    /**
     * Set the delegatedSubnetId property: Delegated subnet id for Vnet injection.
     *
     * @param delegatedSubnetId the delegatedSubnetId value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withDelegatedSubnetId(String delegatedSubnetId) {
        this.delegatedSubnetId = delegatedSubnetId;
        return this;
    }

    /**
     * Get the clusterLoginUrl property: File system Id of the resource.
     *
     * @return the clusterLoginUrl value.
     */
    public String clusterLoginUrl() {
        return this.clusterLoginUrl;
    }

    /**
     * Set the clusterLoginUrl property: File system Id of the resource.
     *
     * @param clusterLoginUrl the clusterLoginUrl value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withClusterLoginUrl(String clusterLoginUrl) {
        this.clusterLoginUrl = clusterLoginUrl;
        return this;
    }

    /**
     * Get the privateIPs property: Private IPs of the resource.
     *
     * @return the privateIPs value.
     */
    public List<String> privateIPs() {
        return this.privateIPs;
    }

    /**
     * Set the privateIPs property: Private IPs of the resource.
     *
     * @param privateIPs the privateIPs value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withPrivateIPs(List<String> privateIPs) {
        this.privateIPs = privateIPs;
        return this;
    }

    /**
     * Get the adminPassword property: Initial administrator password of the resource.
     *
     * @return the adminPassword value.
     */
    public String adminPassword() {
        return this.adminPassword;
    }

    /**
     * Set the adminPassword property: Initial administrator password of the resource.
     *
     * @param adminPassword the adminPassword value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withAdminPassword(String adminPassword) {
        this.adminPassword = adminPassword;
        return this;
    }

    /**
     * Get the initialCapacity property: Storage capacity in TB.
     *
     * @return the initialCapacity value.
     */
    public int initialCapacity() {
        return this.initialCapacity;
    }

    /**
     * Set the initialCapacity property: Storage capacity in TB.
     *
     * @param initialCapacity the initialCapacity value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withInitialCapacity(int initialCapacity) {
        this.initialCapacity = initialCapacity;
        return this;
    }

    /**
     * Get the availabilityZone property: Availability zone.
     *
     * @return the availabilityZone value.
     */
    public String availabilityZone() {
        return this.availabilityZone;
    }

    /**
     * Set the availabilityZone property: Availability zone.
     *
     * @param availabilityZone the availabilityZone value to set.
     * @return the FileSystemResourceProperties object itself.
     */
    public FileSystemResourceProperties withAvailabilityZone(String availabilityZone) {
        this.availabilityZone = availabilityZone;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (marketplaceDetails() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property marketplaceDetails in model FileSystemResourceProperties"));
        } else {
            marketplaceDetails().validate();
        }
        if (storageSku() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property storageSku in model FileSystemResourceProperties"));
        }
        if (userDetails() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property userDetails in model FileSystemResourceProperties"));
        } else {
            userDetails().validate();
        }
        if (delegatedSubnetId() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property delegatedSubnetId in model FileSystemResourceProperties"));
        }
        if (adminPassword() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property adminPassword in model FileSystemResourceProperties"));
        }
    }

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