# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
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__ = ['FiltersArgs', 'Filters']

@pulumi.input_type
class FiltersArgs:
    def __init__(__self__, *,
                 filter_properties: pulumi.Input['FiltersFilterPropertiesArgs'],
                 identifier: pulumi.Input[_builtins.str],
                 type: pulumi.Input[_builtins.str],
                 filter_visibility: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 org_id: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a Filters resource.
        :param pulumi.Input['FiltersFilterPropertiesArgs'] filter_properties: Properties of the filter entity defined in Harness.
        :param pulumi.Input[_builtins.str] identifier: Unique identifier of the resource
        :param pulumi.Input[_builtins.str] type: Type of filter. Currently supported types are {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}
        :param pulumi.Input[_builtins.str] filter_visibility: This indicates visibility of filter. By default, everyone can view this filter. Can either be EveryOne or OnlyCreator
        :param pulumi.Input[_builtins.str] name: Name of the Filter
        :param pulumi.Input[_builtins.str] org_id: organization Identifier for the Entity
        :param pulumi.Input[_builtins.str] project_id: project Identifier for the Entity
        """
        pulumi.set(__self__, "filter_properties", filter_properties)
        pulumi.set(__self__, "identifier", identifier)
        pulumi.set(__self__, "type", type)
        if filter_visibility is not None:
            pulumi.set(__self__, "filter_visibility", filter_visibility)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if org_id is not None:
            pulumi.set(__self__, "org_id", org_id)
        if project_id is not None:
            pulumi.set(__self__, "project_id", project_id)

    @_builtins.property
    @pulumi.getter(name="filterProperties")
    def filter_properties(self) -> pulumi.Input['FiltersFilterPropertiesArgs']:
        """
        Properties of the filter entity defined in Harness.
        """
        return pulumi.get(self, "filter_properties")

    @filter_properties.setter
    def filter_properties(self, value: pulumi.Input['FiltersFilterPropertiesArgs']):
        pulumi.set(self, "filter_properties", value)

    @_builtins.property
    @pulumi.getter
    def identifier(self) -> pulumi.Input[_builtins.str]:
        """
        Unique identifier of the resource
        """
        return pulumi.get(self, "identifier")

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

    @_builtins.property
    @pulumi.getter
    def type(self) -> pulumi.Input[_builtins.str]:
        """
        Type of filter. Currently supported types are {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}
        """
        return pulumi.get(self, "type")

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

    @_builtins.property
    @pulumi.getter(name="filterVisibility")
    def filter_visibility(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        This indicates visibility of filter. By default, everyone can view this filter. Can either be EveryOne or OnlyCreator
        """
        return pulumi.get(self, "filter_visibility")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of the Filter
        """
        return pulumi.get(self, "name")

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

    @_builtins.property
    @pulumi.getter(name="orgId")
    def org_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        organization Identifier for the Entity
        """
        return pulumi.get(self, "org_id")

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

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        project Identifier for the Entity
        """
        return pulumi.get(self, "project_id")

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


@pulumi.input_type
class _FiltersState:
    def __init__(__self__, *,
                 filter_properties: Optional[pulumi.Input['FiltersFilterPropertiesArgs']] = None,
                 filter_visibility: Optional[pulumi.Input[_builtins.str]] = None,
                 identifier: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 org_id: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.str]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering Filters resources.
        :param pulumi.Input['FiltersFilterPropertiesArgs'] filter_properties: Properties of the filter entity defined in Harness.
        :param pulumi.Input[_builtins.str] filter_visibility: This indicates visibility of filter. By default, everyone can view this filter. Can either be EveryOne or OnlyCreator
        :param pulumi.Input[_builtins.str] identifier: Unique identifier of the resource
        :param pulumi.Input[_builtins.str] name: Name of the Filter
        :param pulumi.Input[_builtins.str] org_id: organization Identifier for the Entity
        :param pulumi.Input[_builtins.str] project_id: project Identifier for the Entity
        :param pulumi.Input[_builtins.str] type: Type of filter. Currently supported types are {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}
        """
        if filter_properties is not None:
            pulumi.set(__self__, "filter_properties", filter_properties)
        if filter_visibility is not None:
            pulumi.set(__self__, "filter_visibility", filter_visibility)
        if identifier is not None:
            pulumi.set(__self__, "identifier", identifier)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if org_id is not None:
            pulumi.set(__self__, "org_id", org_id)
        if project_id is not None:
            pulumi.set(__self__, "project_id", project_id)
        if type is not None:
            pulumi.set(__self__, "type", type)

    @_builtins.property
    @pulumi.getter(name="filterProperties")
    def filter_properties(self) -> Optional[pulumi.Input['FiltersFilterPropertiesArgs']]:
        """
        Properties of the filter entity defined in Harness.
        """
        return pulumi.get(self, "filter_properties")

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

    @_builtins.property
    @pulumi.getter(name="filterVisibility")
    def filter_visibility(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        This indicates visibility of filter. By default, everyone can view this filter. Can either be EveryOne or OnlyCreator
        """
        return pulumi.get(self, "filter_visibility")

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

    @_builtins.property
    @pulumi.getter
    def identifier(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Unique identifier of the resource
        """
        return pulumi.get(self, "identifier")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of the Filter
        """
        return pulumi.get(self, "name")

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

    @_builtins.property
    @pulumi.getter(name="orgId")
    def org_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        organization Identifier for the Entity
        """
        return pulumi.get(self, "org_id")

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

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        project Identifier for the Entity
        """
        return pulumi.get(self, "project_id")

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

    @_builtins.property
    @pulumi.getter
    def type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Type of filter. Currently supported types are {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}
        """
        return pulumi.get(self, "type")

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


@pulumi.type_token("harness:platform/filters:Filters")
class Filters(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 filter_properties: Optional[pulumi.Input[Union['FiltersFilterPropertiesArgs', 'FiltersFilterPropertiesArgsDict']]] = None,
                 filter_visibility: Optional[pulumi.Input[_builtins.str]] = None,
                 identifier: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 org_id: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.str]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        Resource for creating a Harness Filter. This resource support filters of types {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}

        ## Example Usage

        ```python
        import pulumi
        import pulumi_harness as harness

        test = harness.platform.Filters("test",
            identifier="identifier",
            name="name",
            org_id="org_id",
            project_id="project_id",
            type="Connector",
            filter_properties={
                "tags": ["foo:bar"],
                "filter_type": "Connector",
            },
            filter_visibility="EveryOne")
        ```

        ## Import

        The `pulumi import` command can be used, for example:

        Import account level filter

        ```sh
        $ pulumi import harness:platform/filters:Filters example <filter_id>/<type>
        ```

        Import org level filter

        ```sh
        $ pulumi import harness:platform/filters:Filters example <ord_id>/<filter_id>/<type>
        ```

        Import project level filter

        ```sh
        $ pulumi import harness:platform/filters:Filters example <org_id>/<project_id>/<filter_id>/<type>
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Union['FiltersFilterPropertiesArgs', 'FiltersFilterPropertiesArgsDict']] filter_properties: Properties of the filter entity defined in Harness.
        :param pulumi.Input[_builtins.str] filter_visibility: This indicates visibility of filter. By default, everyone can view this filter. Can either be EveryOne or OnlyCreator
        :param pulumi.Input[_builtins.str] identifier: Unique identifier of the resource
        :param pulumi.Input[_builtins.str] name: Name of the Filter
        :param pulumi.Input[_builtins.str] org_id: organization Identifier for the Entity
        :param pulumi.Input[_builtins.str] project_id: project Identifier for the Entity
        :param pulumi.Input[_builtins.str] type: Type of filter. Currently supported types are {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: FiltersArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Resource for creating a Harness Filter. This resource support filters of types {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}

        ## Example Usage

        ```python
        import pulumi
        import pulumi_harness as harness

        test = harness.platform.Filters("test",
            identifier="identifier",
            name="name",
            org_id="org_id",
            project_id="project_id",
            type="Connector",
            filter_properties={
                "tags": ["foo:bar"],
                "filter_type": "Connector",
            },
            filter_visibility="EveryOne")
        ```

        ## Import

        The `pulumi import` command can be used, for example:

        Import account level filter

        ```sh
        $ pulumi import harness:platform/filters:Filters example <filter_id>/<type>
        ```

        Import org level filter

        ```sh
        $ pulumi import harness:platform/filters:Filters example <ord_id>/<filter_id>/<type>
        ```

        Import project level filter

        ```sh
        $ pulumi import harness:platform/filters:Filters example <org_id>/<project_id>/<filter_id>/<type>
        ```

        :param str resource_name: The name of the resource.
        :param FiltersArgs 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(FiltersArgs, 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,
                 filter_properties: Optional[pulumi.Input[Union['FiltersFilterPropertiesArgs', 'FiltersFilterPropertiesArgsDict']]] = None,
                 filter_visibility: Optional[pulumi.Input[_builtins.str]] = None,
                 identifier: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 org_id: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.str]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = 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__ = FiltersArgs.__new__(FiltersArgs)

            if filter_properties is None and not opts.urn:
                raise TypeError("Missing required property 'filter_properties'")
            __props__.__dict__["filter_properties"] = filter_properties
            __props__.__dict__["filter_visibility"] = filter_visibility
            if identifier is None and not opts.urn:
                raise TypeError("Missing required property 'identifier'")
            __props__.__dict__["identifier"] = identifier
            __props__.__dict__["name"] = name
            __props__.__dict__["org_id"] = org_id
            __props__.__dict__["project_id"] = project_id
            if type is None and not opts.urn:
                raise TypeError("Missing required property 'type'")
            __props__.__dict__["type"] = type
        super(Filters, __self__).__init__(
            'harness:platform/filters:Filters',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            filter_properties: Optional[pulumi.Input[Union['FiltersFilterPropertiesArgs', 'FiltersFilterPropertiesArgsDict']]] = None,
            filter_visibility: Optional[pulumi.Input[_builtins.str]] = None,
            identifier: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            org_id: Optional[pulumi.Input[_builtins.str]] = None,
            project_id: Optional[pulumi.Input[_builtins.str]] = None,
            type: Optional[pulumi.Input[_builtins.str]] = None) -> 'Filters':
        """
        Get an existing Filters 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[Union['FiltersFilterPropertiesArgs', 'FiltersFilterPropertiesArgsDict']] filter_properties: Properties of the filter entity defined in Harness.
        :param pulumi.Input[_builtins.str] filter_visibility: This indicates visibility of filter. By default, everyone can view this filter. Can either be EveryOne or OnlyCreator
        :param pulumi.Input[_builtins.str] identifier: Unique identifier of the resource
        :param pulumi.Input[_builtins.str] name: Name of the Filter
        :param pulumi.Input[_builtins.str] org_id: organization Identifier for the Entity
        :param pulumi.Input[_builtins.str] project_id: project Identifier for the Entity
        :param pulumi.Input[_builtins.str] type: Type of filter. Currently supported types are {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _FiltersState.__new__(_FiltersState)

        __props__.__dict__["filter_properties"] = filter_properties
        __props__.__dict__["filter_visibility"] = filter_visibility
        __props__.__dict__["identifier"] = identifier
        __props__.__dict__["name"] = name
        __props__.__dict__["org_id"] = org_id
        __props__.__dict__["project_id"] = project_id
        __props__.__dict__["type"] = type
        return Filters(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="filterProperties")
    def filter_properties(self) -> pulumi.Output['outputs.FiltersFilterProperties']:
        """
        Properties of the filter entity defined in Harness.
        """
        return pulumi.get(self, "filter_properties")

    @_builtins.property
    @pulumi.getter(name="filterVisibility")
    def filter_visibility(self) -> pulumi.Output[_builtins.str]:
        """
        This indicates visibility of filter. By default, everyone can view this filter. Can either be EveryOne or OnlyCreator
        """
        return pulumi.get(self, "filter_visibility")

    @_builtins.property
    @pulumi.getter
    def identifier(self) -> pulumi.Output[_builtins.str]:
        """
        Unique identifier of the resource
        """
        return pulumi.get(self, "identifier")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        Name of the Filter
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="orgId")
    def org_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        organization Identifier for the Entity
        """
        return pulumi.get(self, "org_id")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        project Identifier for the Entity
        """
        return pulumi.get(self, "project_id")

    @_builtins.property
    @pulumi.getter
    def type(self) -> pulumi.Output[_builtins.str]:
        """
        Type of filter. Currently supported types are {Connector, DelegateProfile, Delegate, EnvironmentGroup, FileStore, Environment}
        """
        return pulumi.get(self, "type")

