# 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__ = ['AccountFilterArgs', 'AccountFilter']

@pulumi.input_type
class AccountFilterArgs:
    def __init__(__self__, *,
                 media_services_account_name: pulumi.Input[str],
                 resource_group_name: pulumi.Input[str],
                 first_quality_bitrate: Optional[pulumi.Input[int]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 presentation_time_range: Optional[pulumi.Input['AccountFilterPresentationTimeRangeArgs']] = None,
                 track_selections: Optional[pulumi.Input[Sequence[pulumi.Input['AccountFilterTrackSelectionArgs']]]] = None):
        """
        The set of arguments for constructing a AccountFilter resource.
        :param pulumi.Input[str] media_services_account_name: The Media Services account name. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[str] resource_group_name: The name of the Resource Group where the Account Filter should exist. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[int] first_quality_bitrate: The first quality bitrate. Sets the first video track to appear in the Live Streaming playlist to allow HLS native players to start downloading from this quality level at the beginning.
        :param pulumi.Input[str] name: The name which should be used for this Account Filter. Changing this forces a new Account Filter to be created.
        :param pulumi.Input['AccountFilterPresentationTimeRangeArgs'] presentation_time_range: A `presentation_time_range` block as defined below.
        :param pulumi.Input[Sequence[pulumi.Input['AccountFilterTrackSelectionArgs']]] track_selections: One or more `track_selection` blocks as defined below.
        """
        pulumi.set(__self__, "media_services_account_name", media_services_account_name)
        pulumi.set(__self__, "resource_group_name", resource_group_name)
        if first_quality_bitrate is not None:
            pulumi.set(__self__, "first_quality_bitrate", first_quality_bitrate)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if presentation_time_range is not None:
            pulumi.set(__self__, "presentation_time_range", presentation_time_range)
        if track_selections is not None:
            pulumi.set(__self__, "track_selections", track_selections)

    @property
    @pulumi.getter(name="mediaServicesAccountName")
    def media_services_account_name(self) -> pulumi.Input[str]:
        """
        The Media Services account name. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "media_services_account_name")

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

    @property
    @pulumi.getter(name="resourceGroupName")
    def resource_group_name(self) -> pulumi.Input[str]:
        """
        The name of the Resource Group where the Account Filter should exist. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "resource_group_name")

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

    @property
    @pulumi.getter(name="firstQualityBitrate")
    def first_quality_bitrate(self) -> Optional[pulumi.Input[int]]:
        """
        The first quality bitrate. Sets the first video track to appear in the Live Streaming playlist to allow HLS native players to start downloading from this quality level at the beginning.
        """
        return pulumi.get(self, "first_quality_bitrate")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The name which should be used for this Account Filter. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="presentationTimeRange")
    def presentation_time_range(self) -> Optional[pulumi.Input['AccountFilterPresentationTimeRangeArgs']]:
        """
        A `presentation_time_range` block as defined below.
        """
        return pulumi.get(self, "presentation_time_range")

    @presentation_time_range.setter
    def presentation_time_range(self, value: Optional[pulumi.Input['AccountFilterPresentationTimeRangeArgs']]):
        pulumi.set(self, "presentation_time_range", value)

    @property
    @pulumi.getter(name="trackSelections")
    def track_selections(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccountFilterTrackSelectionArgs']]]]:
        """
        One or more `track_selection` blocks as defined below.
        """
        return pulumi.get(self, "track_selections")

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


@pulumi.input_type
class _AccountFilterState:
    def __init__(__self__, *,
                 first_quality_bitrate: Optional[pulumi.Input[int]] = None,
                 media_services_account_name: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 presentation_time_range: Optional[pulumi.Input['AccountFilterPresentationTimeRangeArgs']] = None,
                 resource_group_name: Optional[pulumi.Input[str]] = None,
                 track_selections: Optional[pulumi.Input[Sequence[pulumi.Input['AccountFilterTrackSelectionArgs']]]] = None):
        """
        Input properties used for looking up and filtering AccountFilter resources.
        :param pulumi.Input[int] first_quality_bitrate: The first quality bitrate. Sets the first video track to appear in the Live Streaming playlist to allow HLS native players to start downloading from this quality level at the beginning.
        :param pulumi.Input[str] media_services_account_name: The Media Services account name. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[str] name: The name which should be used for this Account Filter. Changing this forces a new Account Filter to be created.
        :param pulumi.Input['AccountFilterPresentationTimeRangeArgs'] presentation_time_range: A `presentation_time_range` block as defined below.
        :param pulumi.Input[str] resource_group_name: The name of the Resource Group where the Account Filter should exist. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[Sequence[pulumi.Input['AccountFilterTrackSelectionArgs']]] track_selections: One or more `track_selection` blocks as defined below.
        """
        if first_quality_bitrate is not None:
            pulumi.set(__self__, "first_quality_bitrate", first_quality_bitrate)
        if media_services_account_name is not None:
            pulumi.set(__self__, "media_services_account_name", media_services_account_name)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if presentation_time_range is not None:
            pulumi.set(__self__, "presentation_time_range", presentation_time_range)
        if resource_group_name is not None:
            pulumi.set(__self__, "resource_group_name", resource_group_name)
        if track_selections is not None:
            pulumi.set(__self__, "track_selections", track_selections)

    @property
    @pulumi.getter(name="firstQualityBitrate")
    def first_quality_bitrate(self) -> Optional[pulumi.Input[int]]:
        """
        The first quality bitrate. Sets the first video track to appear in the Live Streaming playlist to allow HLS native players to start downloading from this quality level at the beginning.
        """
        return pulumi.get(self, "first_quality_bitrate")

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

    @property
    @pulumi.getter(name="mediaServicesAccountName")
    def media_services_account_name(self) -> Optional[pulumi.Input[str]]:
        """
        The Media Services account name. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "media_services_account_name")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[str]]:
        """
        The name which should be used for this Account Filter. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter(name="presentationTimeRange")
    def presentation_time_range(self) -> Optional[pulumi.Input['AccountFilterPresentationTimeRangeArgs']]:
        """
        A `presentation_time_range` block as defined below.
        """
        return pulumi.get(self, "presentation_time_range")

    @presentation_time_range.setter
    def presentation_time_range(self, value: Optional[pulumi.Input['AccountFilterPresentationTimeRangeArgs']]):
        pulumi.set(self, "presentation_time_range", value)

    @property
    @pulumi.getter(name="resourceGroupName")
    def resource_group_name(self) -> Optional[pulumi.Input[str]]:
        """
        The name of the Resource Group where the Account Filter should exist. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "resource_group_name")

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

    @property
    @pulumi.getter(name="trackSelections")
    def track_selections(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['AccountFilterTrackSelectionArgs']]]]:
        """
        One or more `track_selection` blocks as defined below.
        """
        return pulumi.get(self, "track_selections")

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


class AccountFilter(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 first_quality_bitrate: Optional[pulumi.Input[int]] = None,
                 media_services_account_name: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 presentation_time_range: Optional[pulumi.Input[pulumi.InputType['AccountFilterPresentationTimeRangeArgs']]] = None,
                 resource_group_name: Optional[pulumi.Input[str]] = None,
                 track_selections: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccountFilterTrackSelectionArgs']]]]] = None,
                 __props__=None):
        """
        Manages a Media Services Account Filter.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
        example_account = azure.storage.Account("exampleAccount",
            resource_group_name=example_resource_group.name,
            location=example_resource_group.location,
            account_tier="Standard",
            account_replication_type="GRS")
        example_service_account = azure.media.ServiceAccount("exampleServiceAccount",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            storage_accounts=[azure.media.ServiceAccountStorageAccountArgs(
                id=example_account.id,
                is_primary=True,
            )])
        example_account_filter = azure.media.AccountFilter("exampleAccountFilter",
            resource_group_name=azurerm_resource_group["test"]["name"],
            media_services_account_name=azurerm_media_services_account["test"]["name"],
            first_quality_bitrate=128000,
            presentation_time_range=azure.media.AccountFilterPresentationTimeRangeArgs(
                start_in_units=0,
                end_in_units=15,
                presentation_window_in_units=90,
                live_backoff_in_units=0,
                unit_timescale_in_milliseconds=1000,
                force_end=False,
            ),
            track_selections=[
                azure.media.AccountFilterTrackSelectionArgs(
                    conditions=[
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="Type",
                            operation="Equal",
                            value="Audio",
                        ),
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="Language",
                            operation="NotEqual",
                            value="en",
                        ),
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="FourCC",
                            operation="NotEqual",
                            value="EC-3",
                        ),
                    ],
                ),
                azure.media.AccountFilterTrackSelectionArgs(
                    conditions=[
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="Type",
                            operation="Equal",
                            value="Video",
                        ),
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="Bitrate",
                            operation="Equal",
                            value="3000000-5000000",
                        ),
                    ],
                ),
            ])
        ```

        ## Import

        Account Filters can be imported using the `resource id`, e.g.

        ```sh
         $ pulumi import azure:media/accountFilter:AccountFilter example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Media/mediaServices/account1/accountFilters/filter1
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] first_quality_bitrate: The first quality bitrate. Sets the first video track to appear in the Live Streaming playlist to allow HLS native players to start downloading from this quality level at the beginning.
        :param pulumi.Input[str] media_services_account_name: The Media Services account name. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[str] name: The name which should be used for this Account Filter. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[pulumi.InputType['AccountFilterPresentationTimeRangeArgs']] presentation_time_range: A `presentation_time_range` block as defined below.
        :param pulumi.Input[str] resource_group_name: The name of the Resource Group where the Account Filter should exist. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccountFilterTrackSelectionArgs']]]] track_selections: One or more `track_selection` blocks as defined below.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: AccountFilterArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Manages a Media Services Account Filter.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_azure as azure

        example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
        example_account = azure.storage.Account("exampleAccount",
            resource_group_name=example_resource_group.name,
            location=example_resource_group.location,
            account_tier="Standard",
            account_replication_type="GRS")
        example_service_account = azure.media.ServiceAccount("exampleServiceAccount",
            location=example_resource_group.location,
            resource_group_name=example_resource_group.name,
            storage_accounts=[azure.media.ServiceAccountStorageAccountArgs(
                id=example_account.id,
                is_primary=True,
            )])
        example_account_filter = azure.media.AccountFilter("exampleAccountFilter",
            resource_group_name=azurerm_resource_group["test"]["name"],
            media_services_account_name=azurerm_media_services_account["test"]["name"],
            first_quality_bitrate=128000,
            presentation_time_range=azure.media.AccountFilterPresentationTimeRangeArgs(
                start_in_units=0,
                end_in_units=15,
                presentation_window_in_units=90,
                live_backoff_in_units=0,
                unit_timescale_in_milliseconds=1000,
                force_end=False,
            ),
            track_selections=[
                azure.media.AccountFilterTrackSelectionArgs(
                    conditions=[
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="Type",
                            operation="Equal",
                            value="Audio",
                        ),
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="Language",
                            operation="NotEqual",
                            value="en",
                        ),
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="FourCC",
                            operation="NotEqual",
                            value="EC-3",
                        ),
                    ],
                ),
                azure.media.AccountFilterTrackSelectionArgs(
                    conditions=[
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="Type",
                            operation="Equal",
                            value="Video",
                        ),
                        azure.media.AccountFilterTrackSelectionConditionArgs(
                            property="Bitrate",
                            operation="Equal",
                            value="3000000-5000000",
                        ),
                    ],
                ),
            ])
        ```

        ## Import

        Account Filters can be imported using the `resource id`, e.g.

        ```sh
         $ pulumi import azure:media/accountFilter:AccountFilter example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Media/mediaServices/account1/accountFilters/filter1
        ```

        :param str resource_name: The name of the resource.
        :param AccountFilterArgs 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(AccountFilterArgs, 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,
                 first_quality_bitrate: Optional[pulumi.Input[int]] = None,
                 media_services_account_name: Optional[pulumi.Input[str]] = None,
                 name: Optional[pulumi.Input[str]] = None,
                 presentation_time_range: Optional[pulumi.Input[pulumi.InputType['AccountFilterPresentationTimeRangeArgs']]] = None,
                 resource_group_name: Optional[pulumi.Input[str]] = None,
                 track_selections: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccountFilterTrackSelectionArgs']]]]] = 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__ = AccountFilterArgs.__new__(AccountFilterArgs)

            __props__.__dict__["first_quality_bitrate"] = first_quality_bitrate
            if media_services_account_name is None and not opts.urn:
                raise TypeError("Missing required property 'media_services_account_name'")
            __props__.__dict__["media_services_account_name"] = media_services_account_name
            __props__.__dict__["name"] = name
            __props__.__dict__["presentation_time_range"] = presentation_time_range
            if resource_group_name is None and not opts.urn:
                raise TypeError("Missing required property 'resource_group_name'")
            __props__.__dict__["resource_group_name"] = resource_group_name
            __props__.__dict__["track_selections"] = track_selections
        super(AccountFilter, __self__).__init__(
            'azure:media/accountFilter:AccountFilter',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            first_quality_bitrate: Optional[pulumi.Input[int]] = None,
            media_services_account_name: Optional[pulumi.Input[str]] = None,
            name: Optional[pulumi.Input[str]] = None,
            presentation_time_range: Optional[pulumi.Input[pulumi.InputType['AccountFilterPresentationTimeRangeArgs']]] = None,
            resource_group_name: Optional[pulumi.Input[str]] = None,
            track_selections: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccountFilterTrackSelectionArgs']]]]] = None) -> 'AccountFilter':
        """
        Get an existing AccountFilter 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[int] first_quality_bitrate: The first quality bitrate. Sets the first video track to appear in the Live Streaming playlist to allow HLS native players to start downloading from this quality level at the beginning.
        :param pulumi.Input[str] media_services_account_name: The Media Services account name. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[str] name: The name which should be used for this Account Filter. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[pulumi.InputType['AccountFilterPresentationTimeRangeArgs']] presentation_time_range: A `presentation_time_range` block as defined below.
        :param pulumi.Input[str] resource_group_name: The name of the Resource Group where the Account Filter should exist. Changing this forces a new Account Filter to be created.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['AccountFilterTrackSelectionArgs']]]] track_selections: One or more `track_selection` blocks as defined below.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _AccountFilterState.__new__(_AccountFilterState)

        __props__.__dict__["first_quality_bitrate"] = first_quality_bitrate
        __props__.__dict__["media_services_account_name"] = media_services_account_name
        __props__.__dict__["name"] = name
        __props__.__dict__["presentation_time_range"] = presentation_time_range
        __props__.__dict__["resource_group_name"] = resource_group_name
        __props__.__dict__["track_selections"] = track_selections
        return AccountFilter(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="firstQualityBitrate")
    def first_quality_bitrate(self) -> pulumi.Output[Optional[int]]:
        """
        The first quality bitrate. Sets the first video track to appear in the Live Streaming playlist to allow HLS native players to start downloading from this quality level at the beginning.
        """
        return pulumi.get(self, "first_quality_bitrate")

    @property
    @pulumi.getter(name="mediaServicesAccountName")
    def media_services_account_name(self) -> pulumi.Output[str]:
        """
        The Media Services account name. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "media_services_account_name")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[str]:
        """
        The name which should be used for this Account Filter. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter(name="presentationTimeRange")
    def presentation_time_range(self) -> pulumi.Output[Optional['outputs.AccountFilterPresentationTimeRange']]:
        """
        A `presentation_time_range` block as defined below.
        """
        return pulumi.get(self, "presentation_time_range")

    @property
    @pulumi.getter(name="resourceGroupName")
    def resource_group_name(self) -> pulumi.Output[str]:
        """
        The name of the Resource Group where the Account Filter should exist. Changing this forces a new Account Filter to be created.
        """
        return pulumi.get(self, "resource_group_name")

    @property
    @pulumi.getter(name="trackSelections")
    def track_selections(self) -> pulumi.Output[Optional[Sequence['outputs.AccountFilterTrackSelection']]]:
        """
        One or more `track_selection` blocks as defined below.
        """
        return pulumi.get(self, "track_selections")

