# 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__ = ['WorkspaceEntityTagAssignmentArgs', 'WorkspaceEntityTagAssignment']

@pulumi.input_type
class WorkspaceEntityTagAssignmentArgs:
    def __init__(__self__, *,
                 entity_id: pulumi.Input[_builtins.str],
                 entity_type: pulumi.Input[_builtins.str],
                 tag_key: pulumi.Input[_builtins.str],
                 provider_config: Optional[pulumi.Input['WorkspaceEntityTagAssignmentProviderConfigArgs']] = None,
                 tag_value: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a WorkspaceEntityTagAssignment resource.
        :param pulumi.Input[_builtins.str] entity_id: The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name
        :param pulumi.Input[_builtins.str] entity_type: The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks
        :param pulumi.Input[_builtins.str] tag_key: The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed
        :param pulumi.Input['WorkspaceEntityTagAssignmentProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.str] tag_value: The value of the tag
        """
        pulumi.set(__self__, "entity_id", entity_id)
        pulumi.set(__self__, "entity_type", entity_type)
        pulumi.set(__self__, "tag_key", tag_key)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if tag_value is not None:
            pulumi.set(__self__, "tag_value", tag_value)

    @_builtins.property
    @pulumi.getter(name="entityId")
    def entity_id(self) -> pulumi.Input[_builtins.str]:
        """
        The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name
        """
        return pulumi.get(self, "entity_id")

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

    @_builtins.property
    @pulumi.getter(name="entityType")
    def entity_type(self) -> pulumi.Input[_builtins.str]:
        """
        The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks
        """
        return pulumi.get(self, "entity_type")

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

    @_builtins.property
    @pulumi.getter(name="tagKey")
    def tag_key(self) -> pulumi.Input[_builtins.str]:
        """
        The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed
        """
        return pulumi.get(self, "tag_key")

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

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['WorkspaceEntityTagAssignmentProviderConfigArgs']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

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

    @_builtins.property
    @pulumi.getter(name="tagValue")
    def tag_value(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The value of the tag
        """
        return pulumi.get(self, "tag_value")

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


@pulumi.input_type
class _WorkspaceEntityTagAssignmentState:
    def __init__(__self__, *,
                 entity_id: Optional[pulumi.Input[_builtins.str]] = None,
                 entity_type: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input['WorkspaceEntityTagAssignmentProviderConfigArgs']] = None,
                 tag_key: Optional[pulumi.Input[_builtins.str]] = None,
                 tag_value: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering WorkspaceEntityTagAssignment resources.
        :param pulumi.Input[_builtins.str] entity_id: The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name
        :param pulumi.Input[_builtins.str] entity_type: The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks
        :param pulumi.Input['WorkspaceEntityTagAssignmentProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.str] tag_key: The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed
        :param pulumi.Input[_builtins.str] tag_value: The value of the tag
        """
        if entity_id is not None:
            pulumi.set(__self__, "entity_id", entity_id)
        if entity_type is not None:
            pulumi.set(__self__, "entity_type", entity_type)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if tag_key is not None:
            pulumi.set(__self__, "tag_key", tag_key)
        if tag_value is not None:
            pulumi.set(__self__, "tag_value", tag_value)

    @_builtins.property
    @pulumi.getter(name="entityId")
    def entity_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name
        """
        return pulumi.get(self, "entity_id")

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

    @_builtins.property
    @pulumi.getter(name="entityType")
    def entity_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks
        """
        return pulumi.get(self, "entity_type")

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

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['WorkspaceEntityTagAssignmentProviderConfigArgs']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

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

    @_builtins.property
    @pulumi.getter(name="tagKey")
    def tag_key(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed
        """
        return pulumi.get(self, "tag_key")

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

    @_builtins.property
    @pulumi.getter(name="tagValue")
    def tag_value(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The value of the tag
        """
        return pulumi.get(self, "tag_value")

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


@pulumi.type_token("databricks:index/workspaceEntityTagAssignment:WorkspaceEntityTagAssignment")
class WorkspaceEntityTagAssignment(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 entity_id: Optional[pulumi.Input[_builtins.str]] = None,
                 entity_type: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['WorkspaceEntityTagAssignmentProviderConfigArgs', 'WorkspaceEntityTagAssignmentProviderConfigArgsDict']]] = None,
                 tag_key: Optional[pulumi.Input[_builtins.str]] = None,
                 tag_value: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        [![Public Beta](https://img.shields.io/badge/Release_Stage-Public_Beta-orange)](https://docs.databricks.com/aws/en/release-notes/release-types)

        This resource allows you to create, update, list, and delete tag assignments for workspace scoped entities.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_databricks as databricks

        notebook_tag = databricks.WorkspaceEntityTagAssignment("notebook_tag",
            entity_type="notebooks",
            entity_id="2807324866692453",
            tag_key="sensitivity_level",
            tag_value="high")
        app_tag = databricks.WorkspaceEntityTagAssignment("app_tag",
            entity_type="apps",
            entity_id="myapp",
            tag_key="sensitivity_level",
            tag_value="high")
        dashboard_tag = databricks.WorkspaceEntityTagAssignment("dashboard_tag",
            entity_type="dashboards",
            entity_id="2807324866692453",
            tag_key="sensitivity_level",
            tag_value="high")
        geniespace_tag = databricks.WorkspaceEntityTagAssignment("geniespace_tag",
            entity_type="geniespaces",
            entity_id="2807324866692453",
            tag_key="sensitivity_level",
            tag_value="high")
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] entity_id: The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name
        :param pulumi.Input[_builtins.str] entity_type: The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks
        :param pulumi.Input[Union['WorkspaceEntityTagAssignmentProviderConfigArgs', 'WorkspaceEntityTagAssignmentProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.str] tag_key: The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed
        :param pulumi.Input[_builtins.str] tag_value: The value of the tag
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: WorkspaceEntityTagAssignmentArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        [![Public Beta](https://img.shields.io/badge/Release_Stage-Public_Beta-orange)](https://docs.databricks.com/aws/en/release-notes/release-types)

        This resource allows you to create, update, list, and delete tag assignments for workspace scoped entities.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_databricks as databricks

        notebook_tag = databricks.WorkspaceEntityTagAssignment("notebook_tag",
            entity_type="notebooks",
            entity_id="2807324866692453",
            tag_key="sensitivity_level",
            tag_value="high")
        app_tag = databricks.WorkspaceEntityTagAssignment("app_tag",
            entity_type="apps",
            entity_id="myapp",
            tag_key="sensitivity_level",
            tag_value="high")
        dashboard_tag = databricks.WorkspaceEntityTagAssignment("dashboard_tag",
            entity_type="dashboards",
            entity_id="2807324866692453",
            tag_key="sensitivity_level",
            tag_value="high")
        geniespace_tag = databricks.WorkspaceEntityTagAssignment("geniespace_tag",
            entity_type="geniespaces",
            entity_id="2807324866692453",
            tag_key="sensitivity_level",
            tag_value="high")
        ```

        :param str resource_name: The name of the resource.
        :param WorkspaceEntityTagAssignmentArgs 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(WorkspaceEntityTagAssignmentArgs, 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,
                 entity_id: Optional[pulumi.Input[_builtins.str]] = None,
                 entity_type: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['WorkspaceEntityTagAssignmentProviderConfigArgs', 'WorkspaceEntityTagAssignmentProviderConfigArgsDict']]] = None,
                 tag_key: Optional[pulumi.Input[_builtins.str]] = None,
                 tag_value: 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__ = WorkspaceEntityTagAssignmentArgs.__new__(WorkspaceEntityTagAssignmentArgs)

            if entity_id is None and not opts.urn:
                raise TypeError("Missing required property 'entity_id'")
            __props__.__dict__["entity_id"] = entity_id
            if entity_type is None and not opts.urn:
                raise TypeError("Missing required property 'entity_type'")
            __props__.__dict__["entity_type"] = entity_type
            __props__.__dict__["provider_config"] = provider_config
            if tag_key is None and not opts.urn:
                raise TypeError("Missing required property 'tag_key'")
            __props__.__dict__["tag_key"] = tag_key
            __props__.__dict__["tag_value"] = tag_value
        super(WorkspaceEntityTagAssignment, __self__).__init__(
            'databricks:index/workspaceEntityTagAssignment:WorkspaceEntityTagAssignment',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            entity_id: Optional[pulumi.Input[_builtins.str]] = None,
            entity_type: Optional[pulumi.Input[_builtins.str]] = None,
            provider_config: Optional[pulumi.Input[Union['WorkspaceEntityTagAssignmentProviderConfigArgs', 'WorkspaceEntityTagAssignmentProviderConfigArgsDict']]] = None,
            tag_key: Optional[pulumi.Input[_builtins.str]] = None,
            tag_value: Optional[pulumi.Input[_builtins.str]] = None) -> 'WorkspaceEntityTagAssignment':
        """
        Get an existing WorkspaceEntityTagAssignment 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[_builtins.str] entity_id: The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name
        :param pulumi.Input[_builtins.str] entity_type: The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks
        :param pulumi.Input[Union['WorkspaceEntityTagAssignmentProviderConfigArgs', 'WorkspaceEntityTagAssignmentProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.str] tag_key: The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed
        :param pulumi.Input[_builtins.str] tag_value: The value of the tag
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _WorkspaceEntityTagAssignmentState.__new__(_WorkspaceEntityTagAssignmentState)

        __props__.__dict__["entity_id"] = entity_id
        __props__.__dict__["entity_type"] = entity_type
        __props__.__dict__["provider_config"] = provider_config
        __props__.__dict__["tag_key"] = tag_key
        __props__.__dict__["tag_value"] = tag_value
        return WorkspaceEntityTagAssignment(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="entityId")
    def entity_id(self) -> pulumi.Output[_builtins.str]:
        """
        The identifier of the entity to which the tag is assigned. For apps, the entity_id is the app name
        """
        return pulumi.get(self, "entity_id")

    @_builtins.property
    @pulumi.getter(name="entityType")
    def entity_type(self) -> pulumi.Output[_builtins.str]:
        """
        The type of entity to which the tag is assigned. Allowed values are apps, dashboards, geniespaces, notebooks
        """
        return pulumi.get(self, "entity_type")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> pulumi.Output[Optional['outputs.WorkspaceEntityTagAssignmentProviderConfig']]:
        """
        Configure the provider for management through account provider.
        """
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter(name="tagKey")
    def tag_key(self) -> pulumi.Output[_builtins.str]:
        """
        The key of the tag. The characters , . : / - = and leading/trailing spaces are not allowed
        """
        return pulumi.get(self, "tag_key")

    @_builtins.property
    @pulumi.getter(name="tagValue")
    def tag_value(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The value of the tag
        """
        return pulumi.get(self, "tag_value")

