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

package com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SystemData;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.AzureResourceManagerManagedIdentityProperties;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.BooleanEnum;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.DnsSettings;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.FrontendSetting;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.MarketplaceDetails;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.NetworkProfile;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PanoramaConfig;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.PlanData;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.RulestackDetails;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** PaloAltoNetworks Firewall. */
@Fluent
public final class FirewallResourceInner extends Resource {
    /*
     * The resource-specific properties for this resource.
     */
    @JsonProperty(value = "properties", required = true)
    private FirewallDeploymentProperties innerProperties = new FirewallDeploymentProperties();

    /*
     * The managed service identities assigned to this resource.
     */
    @JsonProperty(value = "identity")
    private AzureResourceManagerManagedIdentityProperties identity;

    /*
     * Azure Resource Manager metadata containing createdBy and modifiedBy information.
     */
    @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY)
    private SystemData systemData;

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

    /**
     * Get the innerProperties property: The resource-specific properties for this resource.
     *
     * @return the innerProperties value.
     */
    private FirewallDeploymentProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the identity property: The managed service identities assigned to this resource.
     *
     * @return the identity value.
     */
    public AzureResourceManagerManagedIdentityProperties identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The managed service identities assigned to this resource.
     *
     * @param identity the identity value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withIdentity(AzureResourceManagerManagedIdentityProperties identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    public SystemData systemData() {
        return this.systemData;
    }

    /** {@inheritDoc} */
    @Override
    public FirewallResourceInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public FirewallResourceInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the panEtag property: panEtag info.
     *
     * @return the panEtag value.
     */
    public String panEtag() {
        return this.innerProperties() == null ? null : this.innerProperties().panEtag();
    }

    /**
     * Set the panEtag property: panEtag info.
     *
     * @param panEtag the panEtag value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withPanEtag(String panEtag) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FirewallDeploymentProperties();
        }
        this.innerProperties().withPanEtag(panEtag);
        return this;
    }

    /**
     * Get the networkProfile property: Network settings.
     *
     * @return the networkProfile value.
     */
    public NetworkProfile networkProfile() {
        return this.innerProperties() == null ? null : this.innerProperties().networkProfile();
    }

    /**
     * Set the networkProfile property: Network settings.
     *
     * @param networkProfile the networkProfile value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withNetworkProfile(NetworkProfile networkProfile) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FirewallDeploymentProperties();
        }
        this.innerProperties().withNetworkProfile(networkProfile);
        return this;
    }

    /**
     * Get the isPanoramaManaged property: Panorama Managed: Default is False. Default will be CloudSec managed.
     *
     * @return the isPanoramaManaged value.
     */
    public BooleanEnum isPanoramaManaged() {
        return this.innerProperties() == null ? null : this.innerProperties().isPanoramaManaged();
    }

    /**
     * Set the isPanoramaManaged property: Panorama Managed: Default is False. Default will be CloudSec managed.
     *
     * @param isPanoramaManaged the isPanoramaManaged value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withIsPanoramaManaged(BooleanEnum isPanoramaManaged) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FirewallDeploymentProperties();
        }
        this.innerProperties().withIsPanoramaManaged(isPanoramaManaged);
        return this;
    }

    /**
     * Get the panoramaConfig property: Panorama Configuration.
     *
     * @return the panoramaConfig value.
     */
    public PanoramaConfig panoramaConfig() {
        return this.innerProperties() == null ? null : this.innerProperties().panoramaConfig();
    }

    /**
     * Set the panoramaConfig property: Panorama Configuration.
     *
     * @param panoramaConfig the panoramaConfig value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withPanoramaConfig(PanoramaConfig panoramaConfig) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FirewallDeploymentProperties();
        }
        this.innerProperties().withPanoramaConfig(panoramaConfig);
        return this;
    }

    /**
     * Get the associatedRulestack property: Associated Rulestack.
     *
     * @return the associatedRulestack value.
     */
    public RulestackDetails associatedRulestack() {
        return this.innerProperties() == null ? null : this.innerProperties().associatedRulestack();
    }

    /**
     * Set the associatedRulestack property: Associated Rulestack.
     *
     * @param associatedRulestack the associatedRulestack value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withAssociatedRulestack(RulestackDetails associatedRulestack) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FirewallDeploymentProperties();
        }
        this.innerProperties().withAssociatedRulestack(associatedRulestack);
        return this;
    }

    /**
     * Get the dnsSettings property: DNS settings for Firewall.
     *
     * @return the dnsSettings value.
     */
    public DnsSettings dnsSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().dnsSettings();
    }

    /**
     * Set the dnsSettings property: DNS settings for Firewall.
     *
     * @param dnsSettings the dnsSettings value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withDnsSettings(DnsSettings dnsSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FirewallDeploymentProperties();
        }
        this.innerProperties().withDnsSettings(dnsSettings);
        return this;
    }

    /**
     * Get the frontEndSettings property: Frontend settings for Firewall.
     *
     * @return the frontEndSettings value.
     */
    public List<FrontendSetting> frontEndSettings() {
        return this.innerProperties() == null ? null : this.innerProperties().frontEndSettings();
    }

    /**
     * Set the frontEndSettings property: Frontend settings for Firewall.
     *
     * @param frontEndSettings the frontEndSettings value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withFrontEndSettings(List<FrontendSetting> frontEndSettings) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FirewallDeploymentProperties();
        }
        this.innerProperties().withFrontEndSettings(frontEndSettings);
        return this;
    }

    /**
     * Get the provisioningState property: Provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Get the planData property: Billing plan information.
     *
     * @return the planData value.
     */
    public PlanData planData() {
        return this.innerProperties() == null ? null : this.innerProperties().planData();
    }

    /**
     * Set the planData property: Billing plan information.
     *
     * @param planData the planData value to set.
     * @return the FirewallResourceInner object itself.
     */
    public FirewallResourceInner withPlanData(PlanData planData) {
        if (this.innerProperties() == null) {
            this.innerProperties = new FirewallDeploymentProperties();
        }
        this.innerProperties().withPlanData(planData);
        return this;
    }

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

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

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property innerProperties in model FirewallResourceInner"));
        } else {
            innerProperties().validate();
        }
        if (identity() != null) {
            identity().validate();
        }
    }

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