// 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.DefaultMode;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ProvisioningState;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.ScopeType;
import com.azure.resourcemanager.paloaltonetworks.ngfw.models.SecurityServices;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

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

    /*
     * 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 LocalRulestackResourceInner class. */
    public LocalRulestackResourceInner() {
    }

    /**
     * Get the innerProperties property: The resource-specific properties for this resource.
     *
     * @return the innerProperties value.
     */
    private RulestackProperties 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 LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner 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 LocalRulestackResourceInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public LocalRulestackResourceInner 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 LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner withPanEtag(String panEtag) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RulestackProperties();
        }
        this.innerProperties().withPanEtag(panEtag);
        return this;
    }

    /**
     * Get the panLocation property: Rulestack Location, Required for GlobalRulestacks, Not for LocalRulestacks.
     *
     * @return the panLocation value.
     */
    public String panLocation() {
        return this.innerProperties() == null ? null : this.innerProperties().panLocation();
    }

    /**
     * Set the panLocation property: Rulestack Location, Required for GlobalRulestacks, Not for LocalRulestacks.
     *
     * @param panLocation the panLocation value to set.
     * @return the LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner withPanLocation(String panLocation) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RulestackProperties();
        }
        this.innerProperties().withPanLocation(panLocation);
        return this;
    }

    /**
     * Get the scope property: Rulestack Type.
     *
     * @return the scope value.
     */
    public ScopeType scope() {
        return this.innerProperties() == null ? null : this.innerProperties().scope();
    }

    /**
     * Set the scope property: Rulestack Type.
     *
     * @param scope the scope value to set.
     * @return the LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner withScope(ScopeType scope) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RulestackProperties();
        }
        this.innerProperties().withScope(scope);
        return this;
    }

    /**
     * Get the associatedSubscriptions property: subscription scope of global rulestack.
     *
     * @return the associatedSubscriptions value.
     */
    public List<String> associatedSubscriptions() {
        return this.innerProperties() == null ? null : this.innerProperties().associatedSubscriptions();
    }

    /**
     * Set the associatedSubscriptions property: subscription scope of global rulestack.
     *
     * @param associatedSubscriptions the associatedSubscriptions value to set.
     * @return the LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner withAssociatedSubscriptions(List<String> associatedSubscriptions) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RulestackProperties();
        }
        this.innerProperties().withAssociatedSubscriptions(associatedSubscriptions);
        return this;
    }

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

    /**
     * Set the description property: rulestack description.
     *
     * @param description the description value to set.
     * @return the LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RulestackProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the defaultMode property: Mode for default rules creation.
     *
     * @return the defaultMode value.
     */
    public DefaultMode defaultMode() {
        return this.innerProperties() == null ? null : this.innerProperties().defaultMode();
    }

    /**
     * Set the defaultMode property: Mode for default rules creation.
     *
     * @param defaultMode the defaultMode value to set.
     * @return the LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner withDefaultMode(DefaultMode defaultMode) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RulestackProperties();
        }
        this.innerProperties().withDefaultMode(defaultMode);
        return this;
    }

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

    /**
     * Set the minAppIdVersion property: minimum version.
     *
     * @param minAppIdVersion the minAppIdVersion value to set.
     * @return the LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner withMinAppIdVersion(String minAppIdVersion) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RulestackProperties();
        }
        this.innerProperties().withMinAppIdVersion(minAppIdVersion);
        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 securityServices property: Security Profile.
     *
     * @return the securityServices value.
     */
    public SecurityServices securityServices() {
        return this.innerProperties() == null ? null : this.innerProperties().securityServices();
    }

    /**
     * Set the securityServices property: Security Profile.
     *
     * @param securityServices the securityServices value to set.
     * @return the LocalRulestackResourceInner object itself.
     */
    public LocalRulestackResourceInner withSecurityServices(SecurityServices securityServices) {
        if (this.innerProperties() == null) {
            this.innerProperties = new RulestackProperties();
        }
        this.innerProperties().withSecurityServices(securityServices);
        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 LocalRulestackResourceInner"));
        } else {
            innerProperties().validate();
        }
        if (identity() != null) {
            identity().validate();
        }
    }

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