# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'GetListenerRulesResult',
    'AwaitableGetListenerRulesResult',
    'get_listener_rules',
    'get_listener_rules_output',
]

@pulumi.output_type
class GetListenerRulesResult:
    """
    A collection of values returned by getListenerRules.
    """
    def __init__(__self__, filters=None, id=None, listener_name=None, listener_rules=None, load_balancer_id=None):
        if filters and not isinstance(filters, list):
            raise TypeError("Expected argument 'filters' to be a list")
        pulumi.set(__self__, "filters", filters)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if listener_name and not isinstance(listener_name, str):
            raise TypeError("Expected argument 'listener_name' to be a str")
        pulumi.set(__self__, "listener_name", listener_name)
        if listener_rules and not isinstance(listener_rules, list):
            raise TypeError("Expected argument 'listener_rules' to be a list")
        pulumi.set(__self__, "listener_rules", listener_rules)
        if load_balancer_id and not isinstance(load_balancer_id, str):
            raise TypeError("Expected argument 'load_balancer_id' to be a str")
        pulumi.set(__self__, "load_balancer_id", load_balancer_id)

    @property
    @pulumi.getter
    def filters(self) -> Optional[Sequence['outputs.GetListenerRulesFilterResult']]:
        return pulumi.get(self, "filters")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="listenerName")
    def listener_name(self) -> str:
        return pulumi.get(self, "listener_name")

    @property
    @pulumi.getter(name="listenerRules")
    def listener_rules(self) -> Sequence['outputs.GetListenerRulesListenerRuleResult']:
        """
        The list of listener_rules.
        """
        return pulumi.get(self, "listener_rules")

    @property
    @pulumi.getter(name="loadBalancerId")
    def load_balancer_id(self) -> str:
        return pulumi.get(self, "load_balancer_id")


class AwaitableGetListenerRulesResult(GetListenerRulesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetListenerRulesResult(
            filters=self.filters,
            id=self.id,
            listener_name=self.listener_name,
            listener_rules=self.listener_rules,
            load_balancer_id=self.load_balancer_id)


def get_listener_rules(filters: Optional[Sequence[pulumi.InputType['GetListenerRulesFilterArgs']]] = None,
                       listener_name: Optional[str] = None,
                       load_balancer_id: Optional[str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetListenerRulesResult:
    """
    This data source provides the list of Listener Rules in Oracle Cloud Infrastructure Load Balancer service.

    Lists all of the rules from all of the rule sets associated with the specified listener. The response organizes
    the rules in the following order:

    *  Access control rules
    *  Allow method rules
    *  Request header rules
    *  Response header rules

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_listener_rules = oci.LoadBalancer.get_listener_rules(listener_name=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        load_balancer_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str listener_name: The name of the listener the rules are associated with.
    :param str load_balancer_id: The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the load balancer associated with the listener.
    """
    __args__ = dict()
    __args__['filters'] = filters
    __args__['listenerName'] = listener_name
    __args__['loadBalancerId'] = load_balancer_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:LoadBalancer/getListenerRules:getListenerRules', __args__, opts=opts, typ=GetListenerRulesResult).value

    return AwaitableGetListenerRulesResult(
        filters=__ret__.filters,
        id=__ret__.id,
        listener_name=__ret__.listener_name,
        listener_rules=__ret__.listener_rules,
        load_balancer_id=__ret__.load_balancer_id)


@_utilities.lift_output_func(get_listener_rules)
def get_listener_rules_output(filters: Optional[pulumi.Input[Optional[Sequence[pulumi.InputType['GetListenerRulesFilterArgs']]]]] = None,
                              listener_name: Optional[pulumi.Input[str]] = None,
                              load_balancer_id: Optional[pulumi.Input[str]] = None,
                              opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetListenerRulesResult]:
    """
    This data source provides the list of Listener Rules in Oracle Cloud Infrastructure Load Balancer service.

    Lists all of the rules from all of the rule sets associated with the specified listener. The response organizes
    the rules in the following order:

    *  Access control rules
    *  Allow method rules
    *  Request header rules
    *  Response header rules

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_listener_rules = oci.LoadBalancer.get_listener_rules(listener_name=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference),
        load_balancer_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str listener_name: The name of the listener the rules are associated with.
    :param str load_balancer_id: The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the load balancer associated with the listener.
    """
    ...
