# 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 sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from .. import _utilities
from . import outputs
from ._inputs import *

__all__ = ['LogzTagRuleArgs', 'LogzTagRule']

@pulumi.input_type
class LogzTagRuleArgs:
    def __init__(__self__, *,
                 logz_monitor_id: pulumi.Input[str],
                 send_aad_logs: Optional[pulumi.Input[bool]] = None,
                 send_activity_logs: Optional[pulumi.Input[bool]] = None,
                 send_subscription_logs: Optional[pulumi.Input[bool]] = None,
                 tag_filters: Optional[pulumi.Input[Sequence[pulumi.Input['LogzTagRuleTagFilterArgs']]]] = None):
        """
        The set of arguments for constructing a LogzTagRule resource.
        :param pulumi.Input[str] logz_monitor_id: The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.
        :param pulumi.Input[bool] send_aad_logs: Whether AAD logs should be sent to the Monitor resource?
        :param pulumi.Input[bool] send_activity_logs: Whether activity logs from Azure resources should be sent to the Monitor resource?
        :param pulumi.Input[bool] send_subscription_logs: Whether subscription logs should be sent to the Monitor resource?
        :param pulumi.Input[Sequence[pulumi.Input['LogzTagRuleTagFilterArgs']]] tag_filters: One or more (up to 10) `tag_filter` blocks as defined below.
        """
        pulumi.set(__self__, "logz_monitor_id", logz_monitor_id)
        if send_aad_logs is not None:
            pulumi.set(__self__, "send_aad_logs", send_aad_logs)
        if send_activity_logs is not None:
            pulumi.set(__self__, "send_activity_logs", send_activity_logs)
        if send_subscription_logs is not None:
            pulumi.set(__self__, "send_subscription_logs", send_subscription_logs)
        if tag_filters is not None:
            pulumi.set(__self__, "tag_filters", tag_filters)

    @property
    @pulumi.getter(name="logzMonitorId")
    def logz_monitor_id(self) -> pulumi.Input[str]:
        """
        The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.
        """
        return pulumi.get(self, "logz_monitor_id")

    @logz_monitor_id.setter
    def logz_monitor_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "logz_monitor_id", value)

    @property
    @pulumi.getter(name="sendAadLogs")
    def send_aad_logs(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether AAD logs should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_aad_logs")

    @send_aad_logs.setter
    def send_aad_logs(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "send_aad_logs", value)

    @property
    @pulumi.getter(name="sendActivityLogs")
    def send_activity_logs(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether activity logs from Azure resources should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_activity_logs")

    @send_activity_logs.setter
    def send_activity_logs(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "send_activity_logs", value)

    @property
    @pulumi.getter(name="sendSubscriptionLogs")
    def send_subscription_logs(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether subscription logs should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_subscription_logs")

    @send_subscription_logs.setter
    def send_subscription_logs(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "send_subscription_logs", value)

    @property
    @pulumi.getter(name="tagFilters")
    def tag_filters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['LogzTagRuleTagFilterArgs']]]]:
        """
        One or more (up to 10) `tag_filter` blocks as defined below.
        """
        return pulumi.get(self, "tag_filters")

    @tag_filters.setter
    def tag_filters(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['LogzTagRuleTagFilterArgs']]]]):
        pulumi.set(self, "tag_filters", value)


@pulumi.input_type
class _LogzTagRuleState:
    def __init__(__self__, *,
                 logz_monitor_id: Optional[pulumi.Input[str]] = None,
                 send_aad_logs: Optional[pulumi.Input[bool]] = None,
                 send_activity_logs: Optional[pulumi.Input[bool]] = None,
                 send_subscription_logs: Optional[pulumi.Input[bool]] = None,
                 tag_filters: Optional[pulumi.Input[Sequence[pulumi.Input['LogzTagRuleTagFilterArgs']]]] = None):
        """
        Input properties used for looking up and filtering LogzTagRule resources.
        :param pulumi.Input[str] logz_monitor_id: The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.
        :param pulumi.Input[bool] send_aad_logs: Whether AAD logs should be sent to the Monitor resource?
        :param pulumi.Input[bool] send_activity_logs: Whether activity logs from Azure resources should be sent to the Monitor resource?
        :param pulumi.Input[bool] send_subscription_logs: Whether subscription logs should be sent to the Monitor resource?
        :param pulumi.Input[Sequence[pulumi.Input['LogzTagRuleTagFilterArgs']]] tag_filters: One or more (up to 10) `tag_filter` blocks as defined below.
        """
        if logz_monitor_id is not None:
            pulumi.set(__self__, "logz_monitor_id", logz_monitor_id)
        if send_aad_logs is not None:
            pulumi.set(__self__, "send_aad_logs", send_aad_logs)
        if send_activity_logs is not None:
            pulumi.set(__self__, "send_activity_logs", send_activity_logs)
        if send_subscription_logs is not None:
            pulumi.set(__self__, "send_subscription_logs", send_subscription_logs)
        if tag_filters is not None:
            pulumi.set(__self__, "tag_filters", tag_filters)

    @property
    @pulumi.getter(name="logzMonitorId")
    def logz_monitor_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.
        """
        return pulumi.get(self, "logz_monitor_id")

    @logz_monitor_id.setter
    def logz_monitor_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "logz_monitor_id", value)

    @property
    @pulumi.getter(name="sendAadLogs")
    def send_aad_logs(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether AAD logs should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_aad_logs")

    @send_aad_logs.setter
    def send_aad_logs(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "send_aad_logs", value)

    @property
    @pulumi.getter(name="sendActivityLogs")
    def send_activity_logs(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether activity logs from Azure resources should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_activity_logs")

    @send_activity_logs.setter
    def send_activity_logs(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "send_activity_logs", value)

    @property
    @pulumi.getter(name="sendSubscriptionLogs")
    def send_subscription_logs(self) -> Optional[pulumi.Input[bool]]:
        """
        Whether subscription logs should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_subscription_logs")

    @send_subscription_logs.setter
    def send_subscription_logs(self, value: Optional[pulumi.Input[bool]]):
        pulumi.set(self, "send_subscription_logs", value)

    @property
    @pulumi.getter(name="tagFilters")
    def tag_filters(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['LogzTagRuleTagFilterArgs']]]]:
        """
        One or more (up to 10) `tag_filter` blocks as defined below.
        """
        return pulumi.get(self, "tag_filters")

    @tag_filters.setter
    def tag_filters(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['LogzTagRuleTagFilterArgs']]]]):
        pulumi.set(self, "tag_filters", value)


class LogzTagRule(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 logz_monitor_id: Optional[pulumi.Input[str]] = None,
                 send_aad_logs: Optional[pulumi.Input[bool]] = None,
                 send_activity_logs: Optional[pulumi.Input[bool]] = None,
                 send_subscription_logs: Optional[pulumi.Input[bool]] = None,
                 tag_filters: Optional[pulumi.Input[Sequence[pulumi.Input[Union['LogzTagRuleTagFilterArgs', 'LogzTagRuleTagFilterArgsDict']]]]] = None,
                 __props__=None):
        """
        Manages a logz Tag Rule.

        !> **Note:** Logz REST API is being deprecated by Azure and new resources cannot be created. This resource will be removed in version 4.0 of the provider.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example = azure.core.ResourceGroup("example",
            name="example-logz",
            location="West Europe")
        example_logz_monitor = azure.monitoring.LogzMonitor("example",
            name="example-monitor",
            resource_group_name=example.name,
            location=example.location,
            plan={
                "billing_cycle": "MONTHLY",
                "effective_date": "2022-06-06T00:00:00Z",
                "usage_type": "COMMITTED",
            },
            user={
                "email": "user@example.com",
                "first_name": "Example",
                "last_name": "User",
                "phone_number": "+12313803556",
            })
        example_logz_tag_rule = azure.monitoring.LogzTagRule("example",
            logz_monitor_id=example_logz_monitor.id,
            tag_filters=[
                {
                    "name": "name1",
                    "action": "Include",
                    "value": "value1",
                },
                {
                    "name": "name2",
                    "action": "Exclude",
                    "value": "value2",
                },
            ],
            send_aad_logs=True,
            send_activity_logs=True,
            send_subscription_logs=True)
        ```

        ## Import

        logz Tag Rules can be imported using the `resource id`, e.g.

        ```sh
        $ pulumi import azure:monitoring/logzTagRule:LogzTagRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Logz/monitors/monitor1/tagRules/ruleSet1
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] logz_monitor_id: The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.
        :param pulumi.Input[bool] send_aad_logs: Whether AAD logs should be sent to the Monitor resource?
        :param pulumi.Input[bool] send_activity_logs: Whether activity logs from Azure resources should be sent to the Monitor resource?
        :param pulumi.Input[bool] send_subscription_logs: Whether subscription logs should be sent to the Monitor resource?
        :param pulumi.Input[Sequence[pulumi.Input[Union['LogzTagRuleTagFilterArgs', 'LogzTagRuleTagFilterArgsDict']]]] tag_filters: One or more (up to 10) `tag_filter` blocks as defined below.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: LogzTagRuleArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages a logz Tag Rule.

        !> **Note:** Logz REST API is being deprecated by Azure and new resources cannot be created. This resource will be removed in version 4.0 of the provider.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example = azure.core.ResourceGroup("example",
            name="example-logz",
            location="West Europe")
        example_logz_monitor = azure.monitoring.LogzMonitor("example",
            name="example-monitor",
            resource_group_name=example.name,
            location=example.location,
            plan={
                "billing_cycle": "MONTHLY",
                "effective_date": "2022-06-06T00:00:00Z",
                "usage_type": "COMMITTED",
            },
            user={
                "email": "user@example.com",
                "first_name": "Example",
                "last_name": "User",
                "phone_number": "+12313803556",
            })
        example_logz_tag_rule = azure.monitoring.LogzTagRule("example",
            logz_monitor_id=example_logz_monitor.id,
            tag_filters=[
                {
                    "name": "name1",
                    "action": "Include",
                    "value": "value1",
                },
                {
                    "name": "name2",
                    "action": "Exclude",
                    "value": "value2",
                },
            ],
            send_aad_logs=True,
            send_activity_logs=True,
            send_subscription_logs=True)
        ```

        ## Import

        logz Tag Rules can be imported using the `resource id`, e.g.

        ```sh
        $ pulumi import azure:monitoring/logzTagRule:LogzTagRule example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Logz/monitors/monitor1/tagRules/ruleSet1
        ```

        :param str resource_name: The name of the resource.
        :param LogzTagRuleArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(LogzTagRuleArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 logz_monitor_id: Optional[pulumi.Input[str]] = None,
                 send_aad_logs: Optional[pulumi.Input[bool]] = None,
                 send_activity_logs: Optional[pulumi.Input[bool]] = None,
                 send_subscription_logs: Optional[pulumi.Input[bool]] = None,
                 tag_filters: Optional[pulumi.Input[Sequence[pulumi.Input[Union['LogzTagRuleTagFilterArgs', 'LogzTagRuleTagFilterArgsDict']]]]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = LogzTagRuleArgs.__new__(LogzTagRuleArgs)

            if logz_monitor_id is None and not opts.urn:
                raise TypeError("Missing required property 'logz_monitor_id'")
            __props__.__dict__["logz_monitor_id"] = logz_monitor_id
            __props__.__dict__["send_aad_logs"] = send_aad_logs
            __props__.__dict__["send_activity_logs"] = send_activity_logs
            __props__.__dict__["send_subscription_logs"] = send_subscription_logs
            __props__.__dict__["tag_filters"] = tag_filters
        super(LogzTagRule, __self__).__init__(
            'azure:monitoring/logzTagRule:LogzTagRule',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            logz_monitor_id: Optional[pulumi.Input[str]] = None,
            send_aad_logs: Optional[pulumi.Input[bool]] = None,
            send_activity_logs: Optional[pulumi.Input[bool]] = None,
            send_subscription_logs: Optional[pulumi.Input[bool]] = None,
            tag_filters: Optional[pulumi.Input[Sequence[pulumi.Input[Union['LogzTagRuleTagFilterArgs', 'LogzTagRuleTagFilterArgsDict']]]]] = None) -> 'LogzTagRule':
        """
        Get an existing LogzTagRule resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] logz_monitor_id: The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.
        :param pulumi.Input[bool] send_aad_logs: Whether AAD logs should be sent to the Monitor resource?
        :param pulumi.Input[bool] send_activity_logs: Whether activity logs from Azure resources should be sent to the Monitor resource?
        :param pulumi.Input[bool] send_subscription_logs: Whether subscription logs should be sent to the Monitor resource?
        :param pulumi.Input[Sequence[pulumi.Input[Union['LogzTagRuleTagFilterArgs', 'LogzTagRuleTagFilterArgsDict']]]] tag_filters: One or more (up to 10) `tag_filter` blocks as defined below.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _LogzTagRuleState.__new__(_LogzTagRuleState)

        __props__.__dict__["logz_monitor_id"] = logz_monitor_id
        __props__.__dict__["send_aad_logs"] = send_aad_logs
        __props__.__dict__["send_activity_logs"] = send_activity_logs
        __props__.__dict__["send_subscription_logs"] = send_subscription_logs
        __props__.__dict__["tag_filters"] = tag_filters
        return LogzTagRule(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="logzMonitorId")
    def logz_monitor_id(self) -> pulumi.Output[str]:
        """
        The ID of the Logz Monitor. Changing this forces a new logz Tag Rule to be created.
        """
        return pulumi.get(self, "logz_monitor_id")

    @property
    @pulumi.getter(name="sendAadLogs")
    def send_aad_logs(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether AAD logs should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_aad_logs")

    @property
    @pulumi.getter(name="sendActivityLogs")
    def send_activity_logs(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether activity logs from Azure resources should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_activity_logs")

    @property
    @pulumi.getter(name="sendSubscriptionLogs")
    def send_subscription_logs(self) -> pulumi.Output[Optional[bool]]:
        """
        Whether subscription logs should be sent to the Monitor resource?
        """
        return pulumi.get(self, "send_subscription_logs")

    @property
    @pulumi.getter(name="tagFilters")
    def tag_filters(self) -> pulumi.Output[Optional[Sequence['outputs.LogzTagRuleTagFilter']]]:
        """
        One or more (up to 10) `tag_filter` blocks as defined below.
        """
        return pulumi.get(self, "tag_filters")

