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

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

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.datalakestore.models.FirewallAllowAzureIpsState;
import com.azure.resourcemanager.datalakestore.models.FirewallState;
import com.azure.resourcemanager.datalakestore.models.TierType;
import com.azure.resourcemanager.datalakestore.models.TrustedIdProviderState;
import com.azure.resourcemanager.datalakestore.models.UpdateEncryptionConfig;
import com.azure.resourcemanager.datalakestore.models.UpdateFirewallRuleWithAccountParameters;
import com.azure.resourcemanager.datalakestore.models.UpdateTrustedIdProviderWithAccountParameters;
import com.azure.resourcemanager.datalakestore.models.UpdateVirtualNetworkRuleWithAccountParameters;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Data Lake Store account properties information to be updated. */
@Fluent
public final class UpdateDataLakeStoreAccountProperties {
    /*
     * The default owner group for all new folders and files created in the Data Lake Store account.
     */
    @JsonProperty(value = "defaultGroup")
    private String defaultGroup;

    /*
     * Used for rotation of user managed Key Vault keys. Can only be used to rotate a user managed encryption Key Vault
     * key.
     */
    @JsonProperty(value = "encryptionConfig")
    private UpdateEncryptionConfig encryptionConfig;

    /*
     * The list of firewall rules associated with this Data Lake Store account.
     */
    @JsonProperty(value = "firewallRules")
    private List<UpdateFirewallRuleWithAccountParameters> firewallRules;

    /*
     * The list of virtual network rules associated with this Data Lake Store account.
     */
    @JsonProperty(value = "virtualNetworkRules")
    private List<UpdateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules;

    /*
     * The current state of the IP address firewall for this Data Lake Store account. Disabling the firewall does not
     * remove existing rules, they will just be ignored until the firewall is re-enabled.
     */
    @JsonProperty(value = "firewallState")
    private FirewallState firewallState;

    /*
     * The current state of allowing or disallowing IPs originating within Azure through the firewall. If the firewall
     * is disabled, this is not enforced.
     */
    @JsonProperty(value = "firewallAllowAzureIps")
    private FirewallAllowAzureIpsState firewallAllowAzureIps;

    /*
     * The list of trusted identity providers associated with this Data Lake Store account.
     */
    @JsonProperty(value = "trustedIdProviders")
    private List<UpdateTrustedIdProviderWithAccountParameters> trustedIdProviders;

    /*
     * The current state of the trusted identity provider feature for this Data Lake Store account. Disabling trusted
     * identity provider functionality does not remove the providers, they will just be ignored until this feature is
     * re-enabled.
     */
    @JsonProperty(value = "trustedIdProviderState")
    private TrustedIdProviderState trustedIdProviderState;

    /*
     * The commitment tier to use for next month.
     */
    @JsonProperty(value = "newTier")
    private TierType newTier;

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

    /**
     * Get the defaultGroup property: The default owner group for all new folders and files created in the Data Lake
     * Store account.
     *
     * @return the defaultGroup value.
     */
    public String defaultGroup() {
        return this.defaultGroup;
    }

    /**
     * Set the defaultGroup property: The default owner group for all new folders and files created in the Data Lake
     * Store account.
     *
     * @param defaultGroup the defaultGroup value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withDefaultGroup(String defaultGroup) {
        this.defaultGroup = defaultGroup;
        return this;
    }

    /**
     * Get the encryptionConfig property: Used for rotation of user managed Key Vault keys. Can only be used to rotate a
     * user managed encryption Key Vault key.
     *
     * @return the encryptionConfig value.
     */
    public UpdateEncryptionConfig encryptionConfig() {
        return this.encryptionConfig;
    }

    /**
     * Set the encryptionConfig property: Used for rotation of user managed Key Vault keys. Can only be used to rotate a
     * user managed encryption Key Vault key.
     *
     * @param encryptionConfig the encryptionConfig value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withEncryptionConfig(UpdateEncryptionConfig encryptionConfig) {
        this.encryptionConfig = encryptionConfig;
        return this;
    }

    /**
     * Get the firewallRules property: The list of firewall rules associated with this Data Lake Store account.
     *
     * @return the firewallRules value.
     */
    public List<UpdateFirewallRuleWithAccountParameters> firewallRules() {
        return this.firewallRules;
    }

    /**
     * Set the firewallRules property: The list of firewall rules associated with this Data Lake Store account.
     *
     * @param firewallRules the firewallRules value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withFirewallRules(
        List<UpdateFirewallRuleWithAccountParameters> firewallRules) {
        this.firewallRules = firewallRules;
        return this;
    }

    /**
     * Get the virtualNetworkRules property: The list of virtual network rules associated with this Data Lake Store
     * account.
     *
     * @return the virtualNetworkRules value.
     */
    public List<UpdateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules() {
        return this.virtualNetworkRules;
    }

    /**
     * Set the virtualNetworkRules property: The list of virtual network rules associated with this Data Lake Store
     * account.
     *
     * @param virtualNetworkRules the virtualNetworkRules value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withVirtualNetworkRules(
        List<UpdateVirtualNetworkRuleWithAccountParameters> virtualNetworkRules) {
        this.virtualNetworkRules = virtualNetworkRules;
        return this;
    }

    /**
     * Get the firewallState property: The current state of the IP address firewall for this Data Lake Store account.
     * Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is
     * re-enabled.
     *
     * @return the firewallState value.
     */
    public FirewallState firewallState() {
        return this.firewallState;
    }

    /**
     * Set the firewallState property: The current state of the IP address firewall for this Data Lake Store account.
     * Disabling the firewall does not remove existing rules, they will just be ignored until the firewall is
     * re-enabled.
     *
     * @param firewallState the firewallState value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withFirewallState(FirewallState firewallState) {
        this.firewallState = firewallState;
        return this;
    }

    /**
     * Get the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure
     * through the firewall. If the firewall is disabled, this is not enforced.
     *
     * @return the firewallAllowAzureIps value.
     */
    public FirewallAllowAzureIpsState firewallAllowAzureIps() {
        return this.firewallAllowAzureIps;
    }

    /**
     * Set the firewallAllowAzureIps property: The current state of allowing or disallowing IPs originating within Azure
     * through the firewall. If the firewall is disabled, this is not enforced.
     *
     * @param firewallAllowAzureIps the firewallAllowAzureIps value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withFirewallAllowAzureIps(
        FirewallAllowAzureIpsState firewallAllowAzureIps) {
        this.firewallAllowAzureIps = firewallAllowAzureIps;
        return this;
    }

    /**
     * Get the trustedIdProviders property: The list of trusted identity providers associated with this Data Lake Store
     * account.
     *
     * @return the trustedIdProviders value.
     */
    public List<UpdateTrustedIdProviderWithAccountParameters> trustedIdProviders() {
        return this.trustedIdProviders;
    }

    /**
     * Set the trustedIdProviders property: The list of trusted identity providers associated with this Data Lake Store
     * account.
     *
     * @param trustedIdProviders the trustedIdProviders value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withTrustedIdProviders(
        List<UpdateTrustedIdProviderWithAccountParameters> trustedIdProviders) {
        this.trustedIdProviders = trustedIdProviders;
        return this;
    }

    /**
     * Get the trustedIdProviderState property: The current state of the trusted identity provider feature for this Data
     * Lake Store account. Disabling trusted identity provider functionality does not remove the providers, they will
     * just be ignored until this feature is re-enabled.
     *
     * @return the trustedIdProviderState value.
     */
    public TrustedIdProviderState trustedIdProviderState() {
        return this.trustedIdProviderState;
    }

    /**
     * Set the trustedIdProviderState property: The current state of the trusted identity provider feature for this Data
     * Lake Store account. Disabling trusted identity provider functionality does not remove the providers, they will
     * just be ignored until this feature is re-enabled.
     *
     * @param trustedIdProviderState the trustedIdProviderState value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withTrustedIdProviderState(
        TrustedIdProviderState trustedIdProviderState) {
        this.trustedIdProviderState = trustedIdProviderState;
        return this;
    }

    /**
     * Get the newTier property: The commitment tier to use for next month.
     *
     * @return the newTier value.
     */
    public TierType newTier() {
        return this.newTier;
    }

    /**
     * Set the newTier property: The commitment tier to use for next month.
     *
     * @param newTier the newTier value to set.
     * @return the UpdateDataLakeStoreAccountProperties object itself.
     */
    public UpdateDataLakeStoreAccountProperties withNewTier(TierType newTier) {
        this.newTier = newTier;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (encryptionConfig() != null) {
            encryptionConfig().validate();
        }
        if (firewallRules() != null) {
            firewallRules().forEach(e -> e.validate());
        }
        if (virtualNetworkRules() != null) {
            virtualNetworkRules().forEach(e -> e.validate());
        }
        if (trustedIdProviders() != null) {
            trustedIdProviders().forEach(e -> e.validate());
        }
    }
}
