// 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.models;

import com.azure.core.http.rest.Response;
import com.azure.core.management.SystemData;
import com.azure.core.util.Context;
import com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.LocalRulesResourceInner;
import java.util.List;

/** An immutable client-side representation of LocalRulesResource. */
public interface LocalRulesResource {
    /**
     * Gets the id property: Fully qualified resource Id for the resource.
     *
     * @return the id value.
     */
    String id();

    /**
     * Gets the name property: The name of the resource.
     *
     * @return the name value.
     */
    String name();

    /**
     * Gets the type property: The type of the resource.
     *
     * @return the type value.
     */
    String type();

    /**
     * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
     *
     * @return the systemData value.
     */
    SystemData systemData();

    /**
     * Gets the etag property: etag info.
     *
     * @return the etag value.
     */
    String etag();

    /**
     * Gets the ruleName property: rule name.
     *
     * @return the ruleName value.
     */
    String ruleName();

    /**
     * Gets the priority property: The priority property.
     *
     * @return the priority value.
     */
    Integer priority();

    /**
     * Gets the description property: rule description.
     *
     * @return the description value.
     */
    String description();

    /**
     * Gets the ruleState property: state of this rule.
     *
     * @return the ruleState value.
     */
    StateEnum ruleState();

    /**
     * Gets the source property: source address.
     *
     * @return the source value.
     */
    SourceAddr source();

    /**
     * Gets the negateSource property: cidr should not be 'any'.
     *
     * @return the negateSource value.
     */
    BooleanEnum negateSource();

    /**
     * Gets the destination property: destination address.
     *
     * @return the destination value.
     */
    DestinationAddr destination();

    /**
     * Gets the negateDestination property: cidr should not be 'any'.
     *
     * @return the negateDestination value.
     */
    BooleanEnum negateDestination();

    /**
     * Gets the applications property: array of rule applications.
     *
     * @return the applications value.
     */
    List<String> applications();

    /**
     * Gets the category property: rule category.
     *
     * @return the category value.
     */
    Category category();

    /**
     * Gets the protocol property: any, application-default, TCP:number, UDP:number.
     *
     * @return the protocol value.
     */
    String protocol();

    /**
     * Gets the protocolPortList property: prot port list.
     *
     * @return the protocolPortList value.
     */
    List<String> protocolPortList();

    /**
     * Gets the inboundInspectionCertificate property: inbound Inspection Certificate.
     *
     * @return the inboundInspectionCertificate value.
     */
    String inboundInspectionCertificate();

    /**
     * Gets the auditComment property: rule comment.
     *
     * @return the auditComment value.
     */
    String auditComment();

    /**
     * Gets the actionType property: rule action.
     *
     * @return the actionType value.
     */
    ActionEnum actionType();

    /**
     * Gets the enableLogging property: enable or disable logging.
     *
     * @return the enableLogging value.
     */
    StateEnum enableLogging();

    /**
     * Gets the decryptionRuleType property: enable or disable decryption.
     *
     * @return the decryptionRuleType value.
     */
    DecryptionRuleTypeEnum decryptionRuleType();

    /**
     * Gets the tags property: tag for rule.
     *
     * @return the tags value.
     */
    List<TagInfo> tags();

    /**
     * Gets the provisioningState property: Provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    ProvisioningState provisioningState();

    /**
     * Gets the name of the resource group.
     *
     * @return the name of the resource group.
     */
    String resourceGroupName();

    /**
     * Gets the inner com.azure.resourcemanager.paloaltonetworks.ngfw.fluent.models.LocalRulesResourceInner object.
     *
     * @return the inner object.
     */
    LocalRulesResourceInner innerModel();

    /** The entirety of the LocalRulesResource definition. */
    interface Definition
        extends DefinitionStages.Blank,
            DefinitionStages.WithParentResource,
            DefinitionStages.WithRuleName,
            DefinitionStages.WithCreate {
    }
    /** The LocalRulesResource definition stages. */
    interface DefinitionStages {
        /** The first stage of the LocalRulesResource definition. */
        interface Blank extends WithParentResource {
        }
        /** The stage of the LocalRulesResource definition allowing to specify parent resource. */
        interface WithParentResource {
            /**
             * Specifies resourceGroupName, localRulestackName.
             *
             * @param resourceGroupName The name of the resource group. The name is case insensitive.
             * @param localRulestackName LocalRulestack resource name.
             * @return the next definition stage.
             */
            WithRuleName withExistingLocalRulestack(String resourceGroupName, String localRulestackName);
        }
        /** The stage of the LocalRulesResource definition allowing to specify ruleName. */
        interface WithRuleName {
            /**
             * Specifies the ruleName property: rule name.
             *
             * @param ruleName rule name.
             * @return the next definition stage.
             */
            WithCreate withRuleName(String ruleName);
        }
        /**
         * The stage of the LocalRulesResource definition which contains all the minimum required properties for the
         * resource to be created, but also allows for any other optional properties to be specified.
         */
        interface WithCreate
            extends DefinitionStages.WithTags,
                DefinitionStages.WithEtag,
                DefinitionStages.WithDescription,
                DefinitionStages.WithRuleState,
                DefinitionStages.WithSource,
                DefinitionStages.WithNegateSource,
                DefinitionStages.WithDestination,
                DefinitionStages.WithNegateDestination,
                DefinitionStages.WithApplications,
                DefinitionStages.WithCategory,
                DefinitionStages.WithProtocol,
                DefinitionStages.WithProtocolPortList,
                DefinitionStages.WithInboundInspectionCertificate,
                DefinitionStages.WithAuditComment,
                DefinitionStages.WithActionType,
                DefinitionStages.WithEnableLogging,
                DefinitionStages.WithDecryptionRuleType {
            /**
             * Executes the create request.
             *
             * @return the created resource.
             */
            LocalRulesResource create();

            /**
             * Executes the create request.
             *
             * @param context The context to associate with this operation.
             * @return the created resource.
             */
            LocalRulesResource create(Context context);
        }
        /** The stage of the LocalRulesResource definition allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: tag for rule.
             *
             * @param tags tag for rule.
             * @return the next definition stage.
             */
            WithCreate withTags(List<TagInfo> tags);
        }
        /** The stage of the LocalRulesResource definition allowing to specify etag. */
        interface WithEtag {
            /**
             * Specifies the etag property: etag info.
             *
             * @param etag etag info.
             * @return the next definition stage.
             */
            WithCreate withEtag(String etag);
        }
        /** The stage of the LocalRulesResource definition allowing to specify description. */
        interface WithDescription {
            /**
             * Specifies the description property: rule description.
             *
             * @param description rule description.
             * @return the next definition stage.
             */
            WithCreate withDescription(String description);
        }
        /** The stage of the LocalRulesResource definition allowing to specify ruleState. */
        interface WithRuleState {
            /**
             * Specifies the ruleState property: state of this rule.
             *
             * @param ruleState state of this rule.
             * @return the next definition stage.
             */
            WithCreate withRuleState(StateEnum ruleState);
        }
        /** The stage of the LocalRulesResource definition allowing to specify source. */
        interface WithSource {
            /**
             * Specifies the source property: source address.
             *
             * @param source source address.
             * @return the next definition stage.
             */
            WithCreate withSource(SourceAddr source);
        }
        /** The stage of the LocalRulesResource definition allowing to specify negateSource. */
        interface WithNegateSource {
            /**
             * Specifies the negateSource property: cidr should not be 'any'.
             *
             * @param negateSource cidr should not be 'any'.
             * @return the next definition stage.
             */
            WithCreate withNegateSource(BooleanEnum negateSource);
        }
        /** The stage of the LocalRulesResource definition allowing to specify destination. */
        interface WithDestination {
            /**
             * Specifies the destination property: destination address.
             *
             * @param destination destination address.
             * @return the next definition stage.
             */
            WithCreate withDestination(DestinationAddr destination);
        }
        /** The stage of the LocalRulesResource definition allowing to specify negateDestination. */
        interface WithNegateDestination {
            /**
             * Specifies the negateDestination property: cidr should not be 'any'.
             *
             * @param negateDestination cidr should not be 'any'.
             * @return the next definition stage.
             */
            WithCreate withNegateDestination(BooleanEnum negateDestination);
        }
        /** The stage of the LocalRulesResource definition allowing to specify applications. */
        interface WithApplications {
            /**
             * Specifies the applications property: array of rule applications.
             *
             * @param applications array of rule applications.
             * @return the next definition stage.
             */
            WithCreate withApplications(List<String> applications);
        }
        /** The stage of the LocalRulesResource definition allowing to specify category. */
        interface WithCategory {
            /**
             * Specifies the category property: rule category.
             *
             * @param category rule category.
             * @return the next definition stage.
             */
            WithCreate withCategory(Category category);
        }
        /** The stage of the LocalRulesResource definition allowing to specify protocol. */
        interface WithProtocol {
            /**
             * Specifies the protocol property: any, application-default, TCP:number, UDP:number.
             *
             * @param protocol any, application-default, TCP:number, UDP:number.
             * @return the next definition stage.
             */
            WithCreate withProtocol(String protocol);
        }
        /** The stage of the LocalRulesResource definition allowing to specify protocolPortList. */
        interface WithProtocolPortList {
            /**
             * Specifies the protocolPortList property: prot port list.
             *
             * @param protocolPortList prot port list.
             * @return the next definition stage.
             */
            WithCreate withProtocolPortList(List<String> protocolPortList);
        }
        /** The stage of the LocalRulesResource definition allowing to specify inboundInspectionCertificate. */
        interface WithInboundInspectionCertificate {
            /**
             * Specifies the inboundInspectionCertificate property: inbound Inspection Certificate.
             *
             * @param inboundInspectionCertificate inbound Inspection Certificate.
             * @return the next definition stage.
             */
            WithCreate withInboundInspectionCertificate(String inboundInspectionCertificate);
        }
        /** The stage of the LocalRulesResource definition allowing to specify auditComment. */
        interface WithAuditComment {
            /**
             * Specifies the auditComment property: rule comment.
             *
             * @param auditComment rule comment.
             * @return the next definition stage.
             */
            WithCreate withAuditComment(String auditComment);
        }
        /** The stage of the LocalRulesResource definition allowing to specify actionType. */
        interface WithActionType {
            /**
             * Specifies the actionType property: rule action.
             *
             * @param actionType rule action.
             * @return the next definition stage.
             */
            WithCreate withActionType(ActionEnum actionType);
        }
        /** The stage of the LocalRulesResource definition allowing to specify enableLogging. */
        interface WithEnableLogging {
            /**
             * Specifies the enableLogging property: enable or disable logging.
             *
             * @param enableLogging enable or disable logging.
             * @return the next definition stage.
             */
            WithCreate withEnableLogging(StateEnum enableLogging);
        }
        /** The stage of the LocalRulesResource definition allowing to specify decryptionRuleType. */
        interface WithDecryptionRuleType {
            /**
             * Specifies the decryptionRuleType property: enable or disable decryption.
             *
             * @param decryptionRuleType enable or disable decryption.
             * @return the next definition stage.
             */
            WithCreate withDecryptionRuleType(DecryptionRuleTypeEnum decryptionRuleType);
        }
    }
    /**
     * Begins update for the LocalRulesResource resource.
     *
     * @return the stage of resource update.
     */
    LocalRulesResource.Update update();

    /** The template for LocalRulesResource update. */
    interface Update
        extends UpdateStages.WithTags,
            UpdateStages.WithEtag,
            UpdateStages.WithRuleName,
            UpdateStages.WithDescription,
            UpdateStages.WithRuleState,
            UpdateStages.WithSource,
            UpdateStages.WithNegateSource,
            UpdateStages.WithDestination,
            UpdateStages.WithNegateDestination,
            UpdateStages.WithApplications,
            UpdateStages.WithCategory,
            UpdateStages.WithProtocol,
            UpdateStages.WithProtocolPortList,
            UpdateStages.WithInboundInspectionCertificate,
            UpdateStages.WithAuditComment,
            UpdateStages.WithActionType,
            UpdateStages.WithEnableLogging,
            UpdateStages.WithDecryptionRuleType {
        /**
         * Executes the update request.
         *
         * @return the updated resource.
         */
        LocalRulesResource apply();

        /**
         * Executes the update request.
         *
         * @param context The context to associate with this operation.
         * @return the updated resource.
         */
        LocalRulesResource apply(Context context);
    }
    /** The LocalRulesResource update stages. */
    interface UpdateStages {
        /** The stage of the LocalRulesResource update allowing to specify tags. */
        interface WithTags {
            /**
             * Specifies the tags property: tag for rule.
             *
             * @param tags tag for rule.
             * @return the next definition stage.
             */
            Update withTags(List<TagInfo> tags);
        }
        /** The stage of the LocalRulesResource update allowing to specify etag. */
        interface WithEtag {
            /**
             * Specifies the etag property: etag info.
             *
             * @param etag etag info.
             * @return the next definition stage.
             */
            Update withEtag(String etag);
        }
        /** The stage of the LocalRulesResource update allowing to specify ruleName. */
        interface WithRuleName {
            /**
             * Specifies the ruleName property: rule name.
             *
             * @param ruleName rule name.
             * @return the next definition stage.
             */
            Update withRuleName(String ruleName);
        }
        /** The stage of the LocalRulesResource update allowing to specify description. */
        interface WithDescription {
            /**
             * Specifies the description property: rule description.
             *
             * @param description rule description.
             * @return the next definition stage.
             */
            Update withDescription(String description);
        }
        /** The stage of the LocalRulesResource update allowing to specify ruleState. */
        interface WithRuleState {
            /**
             * Specifies the ruleState property: state of this rule.
             *
             * @param ruleState state of this rule.
             * @return the next definition stage.
             */
            Update withRuleState(StateEnum ruleState);
        }
        /** The stage of the LocalRulesResource update allowing to specify source. */
        interface WithSource {
            /**
             * Specifies the source property: source address.
             *
             * @param source source address.
             * @return the next definition stage.
             */
            Update withSource(SourceAddr source);
        }
        /** The stage of the LocalRulesResource update allowing to specify negateSource. */
        interface WithNegateSource {
            /**
             * Specifies the negateSource property: cidr should not be 'any'.
             *
             * @param negateSource cidr should not be 'any'.
             * @return the next definition stage.
             */
            Update withNegateSource(BooleanEnum negateSource);
        }
        /** The stage of the LocalRulesResource update allowing to specify destination. */
        interface WithDestination {
            /**
             * Specifies the destination property: destination address.
             *
             * @param destination destination address.
             * @return the next definition stage.
             */
            Update withDestination(DestinationAddr destination);
        }
        /** The stage of the LocalRulesResource update allowing to specify negateDestination. */
        interface WithNegateDestination {
            /**
             * Specifies the negateDestination property: cidr should not be 'any'.
             *
             * @param negateDestination cidr should not be 'any'.
             * @return the next definition stage.
             */
            Update withNegateDestination(BooleanEnum negateDestination);
        }
        /** The stage of the LocalRulesResource update allowing to specify applications. */
        interface WithApplications {
            /**
             * Specifies the applications property: array of rule applications.
             *
             * @param applications array of rule applications.
             * @return the next definition stage.
             */
            Update withApplications(List<String> applications);
        }
        /** The stage of the LocalRulesResource update allowing to specify category. */
        interface WithCategory {
            /**
             * Specifies the category property: rule category.
             *
             * @param category rule category.
             * @return the next definition stage.
             */
            Update withCategory(Category category);
        }
        /** The stage of the LocalRulesResource update allowing to specify protocol. */
        interface WithProtocol {
            /**
             * Specifies the protocol property: any, application-default, TCP:number, UDP:number.
             *
             * @param protocol any, application-default, TCP:number, UDP:number.
             * @return the next definition stage.
             */
            Update withProtocol(String protocol);
        }
        /** The stage of the LocalRulesResource update allowing to specify protocolPortList. */
        interface WithProtocolPortList {
            /**
             * Specifies the protocolPortList property: prot port list.
             *
             * @param protocolPortList prot port list.
             * @return the next definition stage.
             */
            Update withProtocolPortList(List<String> protocolPortList);
        }
        /** The stage of the LocalRulesResource update allowing to specify inboundInspectionCertificate. */
        interface WithInboundInspectionCertificate {
            /**
             * Specifies the inboundInspectionCertificate property: inbound Inspection Certificate.
             *
             * @param inboundInspectionCertificate inbound Inspection Certificate.
             * @return the next definition stage.
             */
            Update withInboundInspectionCertificate(String inboundInspectionCertificate);
        }
        /** The stage of the LocalRulesResource update allowing to specify auditComment. */
        interface WithAuditComment {
            /**
             * Specifies the auditComment property: rule comment.
             *
             * @param auditComment rule comment.
             * @return the next definition stage.
             */
            Update withAuditComment(String auditComment);
        }
        /** The stage of the LocalRulesResource update allowing to specify actionType. */
        interface WithActionType {
            /**
             * Specifies the actionType property: rule action.
             *
             * @param actionType rule action.
             * @return the next definition stage.
             */
            Update withActionType(ActionEnum actionType);
        }
        /** The stage of the LocalRulesResource update allowing to specify enableLogging. */
        interface WithEnableLogging {
            /**
             * Specifies the enableLogging property: enable or disable logging.
             *
             * @param enableLogging enable or disable logging.
             * @return the next definition stage.
             */
            Update withEnableLogging(StateEnum enableLogging);
        }
        /** The stage of the LocalRulesResource update allowing to specify decryptionRuleType. */
        interface WithDecryptionRuleType {
            /**
             * Specifies the decryptionRuleType property: enable or disable decryption.
             *
             * @param decryptionRuleType enable or disable decryption.
             * @return the next definition stage.
             */
            Update withDecryptionRuleType(DecryptionRuleTypeEnum decryptionRuleType);
        }
    }
    /**
     * Refreshes the resource to sync with Azure.
     *
     * @return the refreshed resource.
     */
    LocalRulesResource refresh();

    /**
     * Refreshes the resource to sync with Azure.
     *
     * @param context The context to associate with this operation.
     * @return the refreshed resource.
     */
    LocalRulesResource refresh(Context context);

    /**
     * Get counters.
     *
     * @param firewallName The firewallName parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return counters along with {@link Response}.
     */
    Response<RuleCounter> getCountersWithResponse(String firewallName, Context context);

    /**
     * Get counters.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return counters.
     */
    RuleCounter getCounters();

    /**
     * Refresh counters.
     *
     * @param firewallName The firewallName parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return the {@link Response}.
     */
    Response<Void> refreshCountersWithResponse(String firewallName, Context context);

    /**
     * Refresh counters.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     */
    void refreshCounters();

    /**
     * Reset counters.
     *
     * @param firewallName The firewallName parameter.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return rule counter reset along with {@link Response}.
     */
    Response<RuleCounterReset> resetCountersWithResponse(String firewallName, Context context);

    /**
     * Reset counters.
     *
     * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return rule counter reset.
     */
    RuleCounterReset resetCounters();
}
