# 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

__all__ = ['GrantArgs', 'Grant']

@pulumi.input_type
class GrantArgs:
    def __init__(__self__, *,
                 principal: pulumi.Input[str],
                 privileges: pulumi.Input[Sequence[pulumi.Input[str]]],
                 catalog: Optional[pulumi.Input[str]] = None,
                 external_location: Optional[pulumi.Input[str]] = None,
                 foreign_connection: Optional[pulumi.Input[str]] = None,
                 function: Optional[pulumi.Input[str]] = None,
                 metastore: Optional[pulumi.Input[str]] = None,
                 model: Optional[pulumi.Input[str]] = None,
                 pipeline: Optional[pulumi.Input[str]] = None,
                 recipient: Optional[pulumi.Input[str]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 share: Optional[pulumi.Input[str]] = None,
                 storage_credential: Optional[pulumi.Input[str]] = None,
                 table: Optional[pulumi.Input[str]] = None,
                 volume: Optional[pulumi.Input[str]] = None):
        """
        The set of arguments for constructing a Grant resource.
        """
        pulumi.set(__self__, "principal", principal)
        pulumi.set(__self__, "privileges", privileges)
        if catalog is not None:
            pulumi.set(__self__, "catalog", catalog)
        if external_location is not None:
            pulumi.set(__self__, "external_location", external_location)
        if foreign_connection is not None:
            pulumi.set(__self__, "foreign_connection", foreign_connection)
        if function is not None:
            pulumi.set(__self__, "function", function)
        if metastore is not None:
            pulumi.set(__self__, "metastore", metastore)
        if model is not None:
            pulumi.set(__self__, "model", model)
        if pipeline is not None:
            pulumi.set(__self__, "pipeline", pipeline)
        if recipient is not None:
            pulumi.set(__self__, "recipient", recipient)
        if schema is not None:
            pulumi.set(__self__, "schema", schema)
        if share is not None:
            pulumi.set(__self__, "share", share)
        if storage_credential is not None:
            pulumi.set(__self__, "storage_credential", storage_credential)
        if table is not None:
            pulumi.set(__self__, "table", table)
        if volume is not None:
            pulumi.set(__self__, "volume", volume)

    @property
    @pulumi.getter
    def principal(self) -> pulumi.Input[str]:
        return pulumi.get(self, "principal")

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

    @property
    @pulumi.getter
    def privileges(self) -> pulumi.Input[Sequence[pulumi.Input[str]]]:
        return pulumi.get(self, "privileges")

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

    @property
    @pulumi.getter
    def catalog(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "catalog")

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

    @property
    @pulumi.getter(name="externalLocation")
    def external_location(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "external_location")

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

    @property
    @pulumi.getter(name="foreignConnection")
    def foreign_connection(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "foreign_connection")

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

    @property
    @pulumi.getter
    def function(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "function")

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

    @property
    @pulumi.getter
    def metastore(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "metastore")

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

    @property
    @pulumi.getter
    def model(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "model")

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

    @property
    @pulumi.getter
    def pipeline(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "pipeline")

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

    @property
    @pulumi.getter
    def recipient(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "recipient")

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

    @property
    @pulumi.getter
    def schema(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "schema")

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

    @property
    @pulumi.getter
    def share(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "share")

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

    @property
    @pulumi.getter(name="storageCredential")
    def storage_credential(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "storage_credential")

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

    @property
    @pulumi.getter
    def table(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "table")

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

    @property
    @pulumi.getter
    def volume(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "volume")

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


@pulumi.input_type
class _GrantState:
    def __init__(__self__, *,
                 catalog: Optional[pulumi.Input[str]] = None,
                 external_location: Optional[pulumi.Input[str]] = None,
                 foreign_connection: Optional[pulumi.Input[str]] = None,
                 function: Optional[pulumi.Input[str]] = None,
                 metastore: Optional[pulumi.Input[str]] = None,
                 model: Optional[pulumi.Input[str]] = None,
                 pipeline: Optional[pulumi.Input[str]] = None,
                 principal: Optional[pulumi.Input[str]] = None,
                 privileges: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 recipient: Optional[pulumi.Input[str]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 share: Optional[pulumi.Input[str]] = None,
                 storage_credential: Optional[pulumi.Input[str]] = None,
                 table: Optional[pulumi.Input[str]] = None,
                 volume: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering Grant resources.
        """
        if catalog is not None:
            pulumi.set(__self__, "catalog", catalog)
        if external_location is not None:
            pulumi.set(__self__, "external_location", external_location)
        if foreign_connection is not None:
            pulumi.set(__self__, "foreign_connection", foreign_connection)
        if function is not None:
            pulumi.set(__self__, "function", function)
        if metastore is not None:
            pulumi.set(__self__, "metastore", metastore)
        if model is not None:
            pulumi.set(__self__, "model", model)
        if pipeline is not None:
            pulumi.set(__self__, "pipeline", pipeline)
        if principal is not None:
            pulumi.set(__self__, "principal", principal)
        if privileges is not None:
            pulumi.set(__self__, "privileges", privileges)
        if recipient is not None:
            pulumi.set(__self__, "recipient", recipient)
        if schema is not None:
            pulumi.set(__self__, "schema", schema)
        if share is not None:
            pulumi.set(__self__, "share", share)
        if storage_credential is not None:
            pulumi.set(__self__, "storage_credential", storage_credential)
        if table is not None:
            pulumi.set(__self__, "table", table)
        if volume is not None:
            pulumi.set(__self__, "volume", volume)

    @property
    @pulumi.getter
    def catalog(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "catalog")

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

    @property
    @pulumi.getter(name="externalLocation")
    def external_location(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "external_location")

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

    @property
    @pulumi.getter(name="foreignConnection")
    def foreign_connection(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "foreign_connection")

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

    @property
    @pulumi.getter
    def function(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "function")

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

    @property
    @pulumi.getter
    def metastore(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "metastore")

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

    @property
    @pulumi.getter
    def model(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "model")

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

    @property
    @pulumi.getter
    def pipeline(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "pipeline")

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

    @property
    @pulumi.getter
    def principal(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "principal")

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

    @property
    @pulumi.getter
    def privileges(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[str]]]]:
        return pulumi.get(self, "privileges")

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

    @property
    @pulumi.getter
    def recipient(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "recipient")

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

    @property
    @pulumi.getter
    def schema(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "schema")

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

    @property
    @pulumi.getter
    def share(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "share")

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

    @property
    @pulumi.getter(name="storageCredential")
    def storage_credential(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "storage_credential")

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

    @property
    @pulumi.getter
    def table(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "table")

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

    @property
    @pulumi.getter
    def volume(self) -> Optional[pulumi.Input[str]]:
        return pulumi.get(self, "volume")

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


class Grant(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 catalog: Optional[pulumi.Input[str]] = None,
                 external_location: Optional[pulumi.Input[str]] = None,
                 foreign_connection: Optional[pulumi.Input[str]] = None,
                 function: Optional[pulumi.Input[str]] = None,
                 metastore: Optional[pulumi.Input[str]] = None,
                 model: Optional[pulumi.Input[str]] = None,
                 pipeline: Optional[pulumi.Input[str]] = None,
                 principal: Optional[pulumi.Input[str]] = None,
                 privileges: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 recipient: Optional[pulumi.Input[str]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 share: Optional[pulumi.Input[str]] = None,
                 storage_credential: Optional[pulumi.Input[str]] = None,
                 table: Optional[pulumi.Input[str]] = None,
                 volume: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        ## Import

        The resource can be imported using combination of securable type (`table`, `catalog`, `foreign_connection`, ...), it's name and `principal`:

        bash

        ```sh
        $ pulumi import databricks:index/grant:Grant this catalog/abc/user_name
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GrantArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ## Import

        The resource can be imported using combination of securable type (`table`, `catalog`, `foreign_connection`, ...), it's name and `principal`:

        bash

        ```sh
        $ pulumi import databricks:index/grant:Grant this catalog/abc/user_name
        ```

        :param str resource_name: The name of the resource.
        :param GrantArgs 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(GrantArgs, 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,
                 catalog: Optional[pulumi.Input[str]] = None,
                 external_location: Optional[pulumi.Input[str]] = None,
                 foreign_connection: Optional[pulumi.Input[str]] = None,
                 function: Optional[pulumi.Input[str]] = None,
                 metastore: Optional[pulumi.Input[str]] = None,
                 model: Optional[pulumi.Input[str]] = None,
                 pipeline: Optional[pulumi.Input[str]] = None,
                 principal: Optional[pulumi.Input[str]] = None,
                 privileges: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 recipient: Optional[pulumi.Input[str]] = None,
                 schema: Optional[pulumi.Input[str]] = None,
                 share: Optional[pulumi.Input[str]] = None,
                 storage_credential: Optional[pulumi.Input[str]] = None,
                 table: Optional[pulumi.Input[str]] = None,
                 volume: Optional[pulumi.Input[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__ = GrantArgs.__new__(GrantArgs)

            __props__.__dict__["catalog"] = catalog
            __props__.__dict__["external_location"] = external_location
            __props__.__dict__["foreign_connection"] = foreign_connection
            __props__.__dict__["function"] = function
            __props__.__dict__["metastore"] = metastore
            __props__.__dict__["model"] = model
            __props__.__dict__["pipeline"] = pipeline
            if principal is None and not opts.urn:
                raise TypeError("Missing required property 'principal'")
            __props__.__dict__["principal"] = principal
            if privileges is None and not opts.urn:
                raise TypeError("Missing required property 'privileges'")
            __props__.__dict__["privileges"] = privileges
            __props__.__dict__["recipient"] = recipient
            __props__.__dict__["schema"] = schema
            __props__.__dict__["share"] = share
            __props__.__dict__["storage_credential"] = storage_credential
            __props__.__dict__["table"] = table
            __props__.__dict__["volume"] = volume
        super(Grant, __self__).__init__(
            'databricks:index/grant:Grant',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            catalog: Optional[pulumi.Input[str]] = None,
            external_location: Optional[pulumi.Input[str]] = None,
            foreign_connection: Optional[pulumi.Input[str]] = None,
            function: Optional[pulumi.Input[str]] = None,
            metastore: Optional[pulumi.Input[str]] = None,
            model: Optional[pulumi.Input[str]] = None,
            pipeline: Optional[pulumi.Input[str]] = None,
            principal: Optional[pulumi.Input[str]] = None,
            privileges: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            recipient: Optional[pulumi.Input[str]] = None,
            schema: Optional[pulumi.Input[str]] = None,
            share: Optional[pulumi.Input[str]] = None,
            storage_credential: Optional[pulumi.Input[str]] = None,
            table: Optional[pulumi.Input[str]] = None,
            volume: Optional[pulumi.Input[str]] = None) -> 'Grant':
        """
        Get an existing Grant 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.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GrantState.__new__(_GrantState)

        __props__.__dict__["catalog"] = catalog
        __props__.__dict__["external_location"] = external_location
        __props__.__dict__["foreign_connection"] = foreign_connection
        __props__.__dict__["function"] = function
        __props__.__dict__["metastore"] = metastore
        __props__.__dict__["model"] = model
        __props__.__dict__["pipeline"] = pipeline
        __props__.__dict__["principal"] = principal
        __props__.__dict__["privileges"] = privileges
        __props__.__dict__["recipient"] = recipient
        __props__.__dict__["schema"] = schema
        __props__.__dict__["share"] = share
        __props__.__dict__["storage_credential"] = storage_credential
        __props__.__dict__["table"] = table
        __props__.__dict__["volume"] = volume
        return Grant(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter
    def catalog(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "catalog")

    @property
    @pulumi.getter(name="externalLocation")
    def external_location(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "external_location")

    @property
    @pulumi.getter(name="foreignConnection")
    def foreign_connection(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "foreign_connection")

    @property
    @pulumi.getter
    def function(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "function")

    @property
    @pulumi.getter
    def metastore(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "metastore")

    @property
    @pulumi.getter
    def model(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "model")

    @property
    @pulumi.getter
    def pipeline(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "pipeline")

    @property
    @pulumi.getter
    def principal(self) -> pulumi.Output[str]:
        return pulumi.get(self, "principal")

    @property
    @pulumi.getter
    def privileges(self) -> pulumi.Output[Sequence[str]]:
        return pulumi.get(self, "privileges")

    @property
    @pulumi.getter
    def recipient(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "recipient")

    @property
    @pulumi.getter
    def schema(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "schema")

    @property
    @pulumi.getter
    def share(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "share")

    @property
    @pulumi.getter(name="storageCredential")
    def storage_credential(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "storage_credential")

    @property
    @pulumi.getter
    def table(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "table")

    @property
    @pulumi.getter
    def volume(self) -> pulumi.Output[Optional[str]]:
        return pulumi.get(self, "volume")

