# 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__ = ['WarehousesDefaultWarehouseOverrideArgs', 'WarehousesDefaultWarehouseOverride']

@pulumi.input_type
class WarehousesDefaultWarehouseOverrideArgs:
    def __init__(__self__, *,
                 default_warehouse_override_id: pulumi.Input[_builtins.str],
                 type: pulumi.Input[_builtins.str],
                 provider_config: Optional[pulumi.Input['WarehousesDefaultWarehouseOverrideProviderConfigArgs']] = None,
                 warehouse_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a WarehousesDefaultWarehouseOverride resource.
        :param pulumi.Input[_builtins.str] default_warehouse_override_id: The ID component of the resource name (user ID)
        :param pulumi.Input[_builtins.str] type: The type of override behavior. Possible values are: `CUSTOM`, `LAST_SELECTED`
        :param pulumi.Input['WarehousesDefaultWarehouseOverrideProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.str] warehouse_id: The specific warehouse ID when type is CUSTOM.
               Not set for LAST_SELECTED type
        """
        pulumi.set(__self__, "default_warehouse_override_id", default_warehouse_override_id)
        pulumi.set(__self__, "type", type)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if warehouse_id is not None:
            pulumi.set(__self__, "warehouse_id", warehouse_id)

    @_builtins.property
    @pulumi.getter(name="defaultWarehouseOverrideId")
    def default_warehouse_override_id(self) -> pulumi.Input[_builtins.str]:
        """
        The ID component of the resource name (user ID)
        """
        return pulumi.get(self, "default_warehouse_override_id")

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

    @_builtins.property
    @pulumi.getter
    def type(self) -> pulumi.Input[_builtins.str]:
        """
        The type of override behavior. Possible values are: `CUSTOM`, `LAST_SELECTED`
        """
        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="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['WarehousesDefaultWarehouseOverrideProviderConfigArgs']]:
        """
        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['WarehousesDefaultWarehouseOverrideProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter(name="warehouseId")
    def warehouse_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The specific warehouse ID when type is CUSTOM.
        Not set for LAST_SELECTED type
        """
        return pulumi.get(self, "warehouse_id")

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


@pulumi.input_type
class _WarehousesDefaultWarehouseOverrideState:
    def __init__(__self__, *,
                 default_warehouse_override_id: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input['WarehousesDefaultWarehouseOverrideProviderConfigArgs']] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None,
                 warehouse_id: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering WarehousesDefaultWarehouseOverride resources.
        :param pulumi.Input[_builtins.str] default_warehouse_override_id: The ID component of the resource name (user ID)
        :param pulumi.Input[_builtins.str] name: (string) - The resource name of the default warehouse override.
               Format: default-warehouse-overrides/{default_warehouse_override_id}
        :param pulumi.Input['WarehousesDefaultWarehouseOverrideProviderConfigArgs'] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.str] type: The type of override behavior. Possible values are: `CUSTOM`, `LAST_SELECTED`
        :param pulumi.Input[_builtins.str] warehouse_id: The specific warehouse ID when type is CUSTOM.
               Not set for LAST_SELECTED type
        """
        if default_warehouse_override_id is not None:
            pulumi.set(__self__, "default_warehouse_override_id", default_warehouse_override_id)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if provider_config is not None:
            pulumi.set(__self__, "provider_config", provider_config)
        if type is not None:
            pulumi.set(__self__, "type", type)
        if warehouse_id is not None:
            pulumi.set(__self__, "warehouse_id", warehouse_id)

    @_builtins.property
    @pulumi.getter(name="defaultWarehouseOverrideId")
    def default_warehouse_override_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The ID component of the resource name (user ID)
        """
        return pulumi.get(self, "default_warehouse_override_id")

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

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        (string) - The resource name of the default warehouse override.
        Format: default-warehouse-overrides/{default_warehouse_override_id}
        """
        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="providerConfig")
    def provider_config(self) -> Optional[pulumi.Input['WarehousesDefaultWarehouseOverrideProviderConfigArgs']]:
        """
        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['WarehousesDefaultWarehouseOverrideProviderConfigArgs']]):
        pulumi.set(self, "provider_config", value)

    @_builtins.property
    @pulumi.getter
    def type(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The type of override behavior. Possible values are: `CUSTOM`, `LAST_SELECTED`
        """
        return pulumi.get(self, "type")

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

    @_builtins.property
    @pulumi.getter(name="warehouseId")
    def warehouse_id(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The specific warehouse ID when type is CUSTOM.
        Not set for LAST_SELECTED type
        """
        return pulumi.get(self, "warehouse_id")

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


@pulumi.type_token("databricks:index/warehousesDefaultWarehouseOverride:WarehousesDefaultWarehouseOverride")
class WarehousesDefaultWarehouseOverride(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 default_warehouse_override_id: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['WarehousesDefaultWarehouseOverrideProviderConfigArgs', 'WarehousesDefaultWarehouseOverrideProviderConfigArgsDict']]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None,
                 warehouse_id: 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)

        The Default Warehouse Override resource allows you to configure a user's default warehouse selection behavior in Databricks SQL. This resource enables customization of how a user's default warehouse is selected for SQL operations.

        Users can configure their default warehouse to either:
        - Remember their last-selected warehouse (`LAST_SELECTED` type)
        - Use a specific warehouse (`CUSTOM` type with a warehouse ID)

        > **Note** The `default_warehouse_override_id` field represents the **user ID** of the user whose default warehouse behavior is being configured.

        ## Example Usage

        ### Basic Example with Last Selected Type
        This example creates a default warehouse override that remembers the user's last-selected warehouse.
        The `default_warehouse_override_id` represents the user ID of the target user:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        last_selected = databricks.index.DefaultWarehouseOverride("last_selected",
            default_warehouse_override_id=example.id,
            type=LAST_SELECTED)
        ```

        ### Custom Warehouse Example
        This example creates a default warehouse override that always uses a specific warehouse:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        custom = databricks.index.DefaultWarehouseOverride("custom",
            default_warehouse_override_id=example.id,
            type=CUSTOM,
            warehouse_id=example_databricks_sql_endpoint.id)
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] default_warehouse_override_id: The ID component of the resource name (user ID)
        :param pulumi.Input[Union['WarehousesDefaultWarehouseOverrideProviderConfigArgs', 'WarehousesDefaultWarehouseOverrideProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.str] type: The type of override behavior. Possible values are: `CUSTOM`, `LAST_SELECTED`
        :param pulumi.Input[_builtins.str] warehouse_id: The specific warehouse ID when type is CUSTOM.
               Not set for LAST_SELECTED type
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: WarehousesDefaultWarehouseOverrideArgs,
                 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)

        The Default Warehouse Override resource allows you to configure a user's default warehouse selection behavior in Databricks SQL. This resource enables customization of how a user's default warehouse is selected for SQL operations.

        Users can configure their default warehouse to either:
        - Remember their last-selected warehouse (`LAST_SELECTED` type)
        - Use a specific warehouse (`CUSTOM` type with a warehouse ID)

        > **Note** The `default_warehouse_override_id` field represents the **user ID** of the user whose default warehouse behavior is being configured.

        ## Example Usage

        ### Basic Example with Last Selected Type
        This example creates a default warehouse override that remembers the user's last-selected warehouse.
        The `default_warehouse_override_id` represents the user ID of the target user:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        last_selected = databricks.index.DefaultWarehouseOverride("last_selected",
            default_warehouse_override_id=example.id,
            type=LAST_SELECTED)
        ```

        ### Custom Warehouse Example
        This example creates a default warehouse override that always uses a specific warehouse:

        ```python
        import pulumi
        import pulumi_databricks as databricks

        custom = databricks.index.DefaultWarehouseOverride("custom",
            default_warehouse_override_id=example.id,
            type=CUSTOM,
            warehouse_id=example_databricks_sql_endpoint.id)
        ```

        :param str resource_name: The name of the resource.
        :param WarehousesDefaultWarehouseOverrideArgs 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(WarehousesDefaultWarehouseOverrideArgs, 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,
                 default_warehouse_override_id: Optional[pulumi.Input[_builtins.str]] = None,
                 provider_config: Optional[pulumi.Input[Union['WarehousesDefaultWarehouseOverrideProviderConfigArgs', 'WarehousesDefaultWarehouseOverrideProviderConfigArgsDict']]] = None,
                 type: Optional[pulumi.Input[_builtins.str]] = None,
                 warehouse_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__ = WarehousesDefaultWarehouseOverrideArgs.__new__(WarehousesDefaultWarehouseOverrideArgs)

            if default_warehouse_override_id is None and not opts.urn:
                raise TypeError("Missing required property 'default_warehouse_override_id'")
            __props__.__dict__["default_warehouse_override_id"] = default_warehouse_override_id
            __props__.__dict__["provider_config"] = provider_config
            if type is None and not opts.urn:
                raise TypeError("Missing required property 'type'")
            __props__.__dict__["type"] = type
            __props__.__dict__["warehouse_id"] = warehouse_id
            __props__.__dict__["name"] = None
        super(WarehousesDefaultWarehouseOverride, __self__).__init__(
            'databricks:index/warehousesDefaultWarehouseOverride:WarehousesDefaultWarehouseOverride',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            default_warehouse_override_id: Optional[pulumi.Input[_builtins.str]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            provider_config: Optional[pulumi.Input[Union['WarehousesDefaultWarehouseOverrideProviderConfigArgs', 'WarehousesDefaultWarehouseOverrideProviderConfigArgsDict']]] = None,
            type: Optional[pulumi.Input[_builtins.str]] = None,
            warehouse_id: Optional[pulumi.Input[_builtins.str]] = None) -> 'WarehousesDefaultWarehouseOverride':
        """
        Get an existing WarehousesDefaultWarehouseOverride 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] default_warehouse_override_id: The ID component of the resource name (user ID)
        :param pulumi.Input[_builtins.str] name: (string) - The resource name of the default warehouse override.
               Format: default-warehouse-overrides/{default_warehouse_override_id}
        :param pulumi.Input[Union['WarehousesDefaultWarehouseOverrideProviderConfigArgs', 'WarehousesDefaultWarehouseOverrideProviderConfigArgsDict']] provider_config: Configure the provider for management through account provider.
        :param pulumi.Input[_builtins.str] type: The type of override behavior. Possible values are: `CUSTOM`, `LAST_SELECTED`
        :param pulumi.Input[_builtins.str] warehouse_id: The specific warehouse ID when type is CUSTOM.
               Not set for LAST_SELECTED type
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _WarehousesDefaultWarehouseOverrideState.__new__(_WarehousesDefaultWarehouseOverrideState)

        __props__.__dict__["default_warehouse_override_id"] = default_warehouse_override_id
        __props__.__dict__["name"] = name
        __props__.__dict__["provider_config"] = provider_config
        __props__.__dict__["type"] = type
        __props__.__dict__["warehouse_id"] = warehouse_id
        return WarehousesDefaultWarehouseOverride(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="defaultWarehouseOverrideId")
    def default_warehouse_override_id(self) -> pulumi.Output[_builtins.str]:
        """
        The ID component of the resource name (user ID)
        """
        return pulumi.get(self, "default_warehouse_override_id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        (string) - The resource name of the default warehouse override.
        Format: default-warehouse-overrides/{default_warehouse_override_id}
        """
        return pulumi.get(self, "name")

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

    @_builtins.property
    @pulumi.getter
    def type(self) -> pulumi.Output[_builtins.str]:
        """
        The type of override behavior. Possible values are: `CUSTOM`, `LAST_SELECTED`
        """
        return pulumi.get(self, "type")

    @_builtins.property
    @pulumi.getter(name="warehouseId")
    def warehouse_id(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The specific warehouse ID when type is CUSTOM.
        Not set for LAST_SELECTED type
        """
        return pulumi.get(self, "warehouse_id")

