# 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

__all__ = ['WorkspaceBindingArgs', 'WorkspaceBinding']

@pulumi.input_type
class WorkspaceBindingArgs:
    def __init__(__self__, *,
                 workspace_id: pulumi.Input[_builtins.str],
                 binding_type: Optional[pulumi.Input[_builtins.str]] = None,
                 catalog_name: Optional[pulumi.Input[_builtins.str]] = None,
                 securable_name: Optional[pulumi.Input[_builtins.str]] = None,
                 securable_type: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a WorkspaceBinding resource.
        :param pulumi.Input[_builtins.str] workspace_id: ID of the workspace. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] binding_type: Binding mode. Default to `BINDING_TYPE_READ_WRITE`. Possible values are `BINDING_TYPE_READ_ONLY`, `BINDING_TYPE_READ_WRITE`.
        :param pulumi.Input[_builtins.str] securable_name: Name of securable. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] securable_type: Type of securable. Can be `catalog`, `external_location`, `storage_credential` or `credential`. Default to `catalog`. Change forces creation of a new resource.
        """
        pulumi.set(__self__, "workspace_id", workspace_id)
        if binding_type is not None:
            pulumi.set(__self__, "binding_type", binding_type)
        if catalog_name is not None:
            warnings.warn("""Please use 'securable_name' and 'securable_type instead.""", DeprecationWarning)
            pulumi.log.warn("""catalog_name is deprecated: Please use 'securable_name' and 'securable_type instead.""")
        if catalog_name is not None:
            pulumi.set(__self__, "catalog_name", catalog_name)
        if securable_name is not None:
            pulumi.set(__self__, "securable_name", securable_name)
        if securable_type is not None:
            pulumi.set(__self__, "securable_type", securable_type)

    @_builtins.property
    @pulumi.getter(name="workspaceId")
    def workspace_id(self) -> pulumi.Input[_builtins.str]:
        """
        ID of the workspace. Change forces creation of a new resource.
        """
        return pulumi.get(self, "workspace_id")

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

    @_builtins.property
    @pulumi.getter(name="bindingType")
    def binding_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Binding mode. Default to `BINDING_TYPE_READ_WRITE`. Possible values are `BINDING_TYPE_READ_ONLY`, `BINDING_TYPE_READ_WRITE`.
        """
        return pulumi.get(self, "binding_type")

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

    @_builtins.property
    @pulumi.getter(name="catalogName")
    @_utilities.deprecated("""Please use 'securable_name' and 'securable_type instead.""")
    def catalog_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        return pulumi.get(self, "catalog_name")

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

    @_builtins.property
    @pulumi.getter(name="securableName")
    def securable_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of securable. Change forces creation of a new resource.
        """
        return pulumi.get(self, "securable_name")

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

    @_builtins.property
    @pulumi.getter(name="securableType")
    def securable_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Type of securable. Can be `catalog`, `external_location`, `storage_credential` or `credential`. Default to `catalog`. Change forces creation of a new resource.
        """
        return pulumi.get(self, "securable_type")

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


@pulumi.input_type
class _WorkspaceBindingState:
    def __init__(__self__, *,
                 binding_type: Optional[pulumi.Input[_builtins.str]] = None,
                 catalog_name: Optional[pulumi.Input[_builtins.str]] = None,
                 securable_name: Optional[pulumi.Input[_builtins.str]] = None,
                 securable_type: Optional[pulumi.Input[_builtins.str]] = None,
                 workspace_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering WorkspaceBinding resources.
        :param pulumi.Input[_builtins.str] binding_type: Binding mode. Default to `BINDING_TYPE_READ_WRITE`. Possible values are `BINDING_TYPE_READ_ONLY`, `BINDING_TYPE_READ_WRITE`.
        :param pulumi.Input[_builtins.str] securable_name: Name of securable. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] securable_type: Type of securable. Can be `catalog`, `external_location`, `storage_credential` or `credential`. Default to `catalog`. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] workspace_id: ID of the workspace. Change forces creation of a new resource.
        """
        if binding_type is not None:
            pulumi.set(__self__, "binding_type", binding_type)
        if catalog_name is not None:
            warnings.warn("""Please use 'securable_name' and 'securable_type instead.""", DeprecationWarning)
            pulumi.log.warn("""catalog_name is deprecated: Please use 'securable_name' and 'securable_type instead.""")
        if catalog_name is not None:
            pulumi.set(__self__, "catalog_name", catalog_name)
        if securable_name is not None:
            pulumi.set(__self__, "securable_name", securable_name)
        if securable_type is not None:
            pulumi.set(__self__, "securable_type", securable_type)
        if workspace_id is not None:
            pulumi.set(__self__, "workspace_id", workspace_id)

    @_builtins.property
    @pulumi.getter(name="bindingType")
    def binding_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Binding mode. Default to `BINDING_TYPE_READ_WRITE`. Possible values are `BINDING_TYPE_READ_ONLY`, `BINDING_TYPE_READ_WRITE`.
        """
        return pulumi.get(self, "binding_type")

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

    @_builtins.property
    @pulumi.getter(name="catalogName")
    @_utilities.deprecated("""Please use 'securable_name' and 'securable_type instead.""")
    def catalog_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        return pulumi.get(self, "catalog_name")

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

    @_builtins.property
    @pulumi.getter(name="securableName")
    def securable_name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Name of securable. Change forces creation of a new resource.
        """
        return pulumi.get(self, "securable_name")

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

    @_builtins.property
    @pulumi.getter(name="securableType")
    def securable_type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Type of securable. Can be `catalog`, `external_location`, `storage_credential` or `credential`. Default to `catalog`. Change forces creation of a new resource.
        """
        return pulumi.get(self, "securable_type")

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

    @_builtins.property
    @pulumi.getter(name="workspaceId")
    def workspace_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        ID of the workspace. Change forces creation of a new resource.
        """
        return pulumi.get(self, "workspace_id")

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


@pulumi.type_token("databricks:index/workspaceBinding:WorkspaceBinding")
class WorkspaceBinding(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 binding_type: Optional[pulumi.Input[_builtins.str]] = None,
                 catalog_name: Optional[pulumi.Input[_builtins.str]] = None,
                 securable_name: Optional[pulumi.Input[_builtins.str]] = None,
                 securable_type: Optional[pulumi.Input[_builtins.str]] = None,
                 workspace_id: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        ## Import

        This resource can be imported by using combination of workspace ID, securable type and name:

        hcl

        import {

          to = databricks_workspace_binding.this

          id = "<workspace_id>|<securable_type>|<securable_name>"

        }

        Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:

        bash

        ```sh
        $ pulumi import databricks:index/workspaceBinding:WorkspaceBinding this "<workspace_id>|<securable_type>|<securable_name>"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] binding_type: Binding mode. Default to `BINDING_TYPE_READ_WRITE`. Possible values are `BINDING_TYPE_READ_ONLY`, `BINDING_TYPE_READ_WRITE`.
        :param pulumi.Input[_builtins.str] securable_name: Name of securable. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] securable_type: Type of securable. Can be `catalog`, `external_location`, `storage_credential` or `credential`. Default to `catalog`. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] workspace_id: ID of the workspace. Change forces creation of a new resource.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: WorkspaceBindingArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ## Import

        This resource can be imported by using combination of workspace ID, securable type and name:

        hcl

        import {

          to = databricks_workspace_binding.this

          id = "<workspace_id>|<securable_type>|<securable_name>"

        }

        Alternatively, when using `terraform` version 1.4 or earlier, import using the `pulumi import` command:

        bash

        ```sh
        $ pulumi import databricks:index/workspaceBinding:WorkspaceBinding this "<workspace_id>|<securable_type>|<securable_name>"
        ```

        :param str resource_name: The name of the resource.
        :param WorkspaceBindingArgs 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(WorkspaceBindingArgs, 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,
                 binding_type: Optional[pulumi.Input[_builtins.str]] = None,
                 catalog_name: Optional[pulumi.Input[_builtins.str]] = None,
                 securable_name: Optional[pulumi.Input[_builtins.str]] = None,
                 securable_type: Optional[pulumi.Input[_builtins.str]] = None,
                 workspace_id: 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__ = WorkspaceBindingArgs.__new__(WorkspaceBindingArgs)

            __props__.__dict__["binding_type"] = binding_type
            __props__.__dict__["catalog_name"] = catalog_name
            __props__.__dict__["securable_name"] = securable_name
            __props__.__dict__["securable_type"] = securable_type
            if workspace_id is None and not opts.urn:
                raise TypeError("Missing required property 'workspace_id'")
            __props__.__dict__["workspace_id"] = workspace_id
        super(WorkspaceBinding, __self__).__init__(
            'databricks:index/workspaceBinding:WorkspaceBinding',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            binding_type: Optional[pulumi.Input[_builtins.str]] = None,
            catalog_name: Optional[pulumi.Input[_builtins.str]] = None,
            securable_name: Optional[pulumi.Input[_builtins.str]] = None,
            securable_type: Optional[pulumi.Input[_builtins.str]] = None,
            workspace_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'WorkspaceBinding':
        """
        Get an existing WorkspaceBinding 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] binding_type: Binding mode. Default to `BINDING_TYPE_READ_WRITE`. Possible values are `BINDING_TYPE_READ_ONLY`, `BINDING_TYPE_READ_WRITE`.
        :param pulumi.Input[_builtins.str] securable_name: Name of securable. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] securable_type: Type of securable. Can be `catalog`, `external_location`, `storage_credential` or `credential`. Default to `catalog`. Change forces creation of a new resource.
        :param pulumi.Input[_builtins.str] workspace_id: ID of the workspace. Change forces creation of a new resource.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _WorkspaceBindingState.__new__(_WorkspaceBindingState)

        __props__.__dict__["binding_type"] = binding_type
        __props__.__dict__["catalog_name"] = catalog_name
        __props__.__dict__["securable_name"] = securable_name
        __props__.__dict__["securable_type"] = securable_type
        __props__.__dict__["workspace_id"] = workspace_id
        return WorkspaceBinding(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="bindingType")
    def binding_type(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Binding mode. Default to `BINDING_TYPE_READ_WRITE`. Possible values are `BINDING_TYPE_READ_ONLY`, `BINDING_TYPE_READ_WRITE`.
        """
        return pulumi.get(self, "binding_type")

    @_builtins.property
    @pulumi.getter(name="catalogName")
    @_utilities.deprecated("""Please use 'securable_name' and 'securable_type instead.""")
    def catalog_name(self) -> pulumi.Output[Optional[_builtins.str]]:
        return pulumi.get(self, "catalog_name")

    @_builtins.property
    @pulumi.getter(name="securableName")
    def securable_name(self) -> pulumi.Output[_builtins.str]:
        """
        Name of securable. Change forces creation of a new resource.
        """
        return pulumi.get(self, "securable_name")

    @_builtins.property
    @pulumi.getter(name="securableType")
    def securable_type(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Type of securable. Can be `catalog`, `external_location`, `storage_credential` or `credential`. Default to `catalog`. Change forces creation of a new resource.
        """
        return pulumi.get(self, "securable_type")

    @_builtins.property
    @pulumi.getter(name="workspaceId")
    def workspace_id(self) -> pulumi.Output[_builtins.str]:
        """
        ID of the workspace. Change forces creation of a new resource.
        """
        return pulumi.get(self, "workspace_id")

