# 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__ = [
    'GetAppSpaceResult',
    'AwaitableGetAppSpaceResult',
    'get_app_space',
    'get_app_space_output',
]

@pulumi.output_type
class GetAppSpaceResult:
    """
    A collection of values returned by getAppSpace.
    """
    def __init__(__self__, create_time=None, creator=None, description=None, effective_usage_policy_id=None, effective_user_api_scopes=None, id=None, name=None, provider_config=None, resources=None, service_principal_client_id=None, service_principal_id=None, service_principal_name=None, status=None, update_time=None, updater=None, usage_policy_id=None, user_api_scopes=None):
        if create_time and not isinstance(create_time, str):
            raise TypeError("Expected argument 'create_time' to be a str")
        pulumi.set(__self__, "create_time", create_time)
        if creator and not isinstance(creator, str):
            raise TypeError("Expected argument 'creator' to be a str")
        pulumi.set(__self__, "creator", creator)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if effective_usage_policy_id and not isinstance(effective_usage_policy_id, str):
            raise TypeError("Expected argument 'effective_usage_policy_id' to be a str")
        pulumi.set(__self__, "effective_usage_policy_id", effective_usage_policy_id)
        if effective_user_api_scopes and not isinstance(effective_user_api_scopes, list):
            raise TypeError("Expected argument 'effective_user_api_scopes' to be a list")
        pulumi.set(__self__, "effective_user_api_scopes", effective_user_api_scopes)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if provider_config and not isinstance(provider_config, dict):
            raise TypeError("Expected argument 'provider_config' to be a dict")
        pulumi.set(__self__, "provider_config", provider_config)
        if resources and not isinstance(resources, list):
            raise TypeError("Expected argument 'resources' to be a list")
        pulumi.set(__self__, "resources", resources)
        if service_principal_client_id and not isinstance(service_principal_client_id, str):
            raise TypeError("Expected argument 'service_principal_client_id' to be a str")
        pulumi.set(__self__, "service_principal_client_id", service_principal_client_id)
        if service_principal_id and not isinstance(service_principal_id, int):
            raise TypeError("Expected argument 'service_principal_id' to be a int")
        pulumi.set(__self__, "service_principal_id", service_principal_id)
        if service_principal_name and not isinstance(service_principal_name, str):
            raise TypeError("Expected argument 'service_principal_name' to be a str")
        pulumi.set(__self__, "service_principal_name", service_principal_name)
        if status and not isinstance(status, dict):
            raise TypeError("Expected argument 'status' to be a dict")
        pulumi.set(__self__, "status", status)
        if update_time and not isinstance(update_time, str):
            raise TypeError("Expected argument 'update_time' to be a str")
        pulumi.set(__self__, "update_time", update_time)
        if updater and not isinstance(updater, str):
            raise TypeError("Expected argument 'updater' to be a str")
        pulumi.set(__self__, "updater", updater)
        if usage_policy_id and not isinstance(usage_policy_id, str):
            raise TypeError("Expected argument 'usage_policy_id' to be a str")
        pulumi.set(__self__, "usage_policy_id", usage_policy_id)
        if user_api_scopes and not isinstance(user_api_scopes, list):
            raise TypeError("Expected argument 'user_api_scopes' to be a list")
        pulumi.set(__self__, "user_api_scopes", user_api_scopes)

    @_builtins.property
    @pulumi.getter(name="createTime")
    def create_time(self) -> _builtins.str:
        """
        (string) - The creation time of the app space. Formatted timestamp in ISO 6801
        """
        return pulumi.get(self, "create_time")

    @_builtins.property
    @pulumi.getter
    def creator(self) -> _builtins.str:
        """
        (string) - The email of the user that created the app space
        """
        return pulumi.get(self, "creator")

    @_builtins.property
    @pulumi.getter
    def description(self) -> _builtins.str:
        """
        (string) - Description of the App Resource
        """
        return pulumi.get(self, "description")

    @_builtins.property
    @pulumi.getter(name="effectiveUsagePolicyId")
    def effective_usage_policy_id(self) -> _builtins.str:
        """
        (string) - The effective usage policy ID used by apps in the space
        """
        return pulumi.get(self, "effective_usage_policy_id")

    @_builtins.property
    @pulumi.getter(name="effectiveUserApiScopes")
    def effective_user_api_scopes(self) -> Sequence[_builtins.str]:
        """
        (list of string) - The effective api scopes granted to the user access token
        """
        return pulumi.get(self, "effective_user_api_scopes")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        (string) - Id of the SQL warehouse to grant permission on
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> _builtins.str:
        """
        (string) - Name of the serving endpoint to grant permission on
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional['outputs.GetAppSpaceProviderConfigResult']:
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter
    def resources(self) -> Sequence['outputs.GetAppSpaceResourceResult']:
        """
        (list of AppResource) - Resources for the app space. Resources configured at the space level are available to all apps in the space
        """
        return pulumi.get(self, "resources")

    @_builtins.property
    @pulumi.getter(name="servicePrincipalClientId")
    def service_principal_client_id(self) -> _builtins.str:
        """
        (string) - The service principal client ID for the app space
        """
        return pulumi.get(self, "service_principal_client_id")

    @_builtins.property
    @pulumi.getter(name="servicePrincipalId")
    def service_principal_id(self) -> _builtins.int:
        """
        (integer) - The service principal ID for the app space
        """
        return pulumi.get(self, "service_principal_id")

    @_builtins.property
    @pulumi.getter(name="servicePrincipalName")
    def service_principal_name(self) -> _builtins.str:
        """
        (string) - The service principal name for the app space
        """
        return pulumi.get(self, "service_principal_name")

    @_builtins.property
    @pulumi.getter
    def status(self) -> 'outputs.GetAppSpaceStatusResult':
        """
        (SpaceStatus) - The status of the app space
        """
        return pulumi.get(self, "status")

    @_builtins.property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> _builtins.str:
        """
        (string) - The update time of the app space. Formatted timestamp in ISO 6801
        """
        return pulumi.get(self, "update_time")

    @_builtins.property
    @pulumi.getter
    def updater(self) -> _builtins.str:
        """
        (string) - The email of the user that last updated the app space
        """
        return pulumi.get(self, "updater")

    @_builtins.property
    @pulumi.getter(name="usagePolicyId")
    def usage_policy_id(self) -> _builtins.str:
        """
        (string) - The usage policy ID for managing cost at the space level
        """
        return pulumi.get(self, "usage_policy_id")

    @_builtins.property
    @pulumi.getter(name="userApiScopes")
    def user_api_scopes(self) -> Sequence[_builtins.str]:
        """
        (list of string) - OAuth scopes for apps in the space
        """
        return pulumi.get(self, "user_api_scopes")


class AwaitableGetAppSpaceResult(GetAppSpaceResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAppSpaceResult(
            create_time=self.create_time,
            creator=self.creator,
            description=self.description,
            effective_usage_policy_id=self.effective_usage_policy_id,
            effective_user_api_scopes=self.effective_user_api_scopes,
            id=self.id,
            name=self.name,
            provider_config=self.provider_config,
            resources=self.resources,
            service_principal_client_id=self.service_principal_client_id,
            service_principal_id=self.service_principal_id,
            service_principal_name=self.service_principal_name,
            status=self.status,
            update_time=self.update_time,
            updater=self.updater,
            usage_policy_id=self.usage_policy_id,
            user_api_scopes=self.user_api_scopes)


def get_app_space(name: Optional[_builtins.str] = None,
                  provider_config: Optional[Union['GetAppSpaceProviderConfigArgs', 'GetAppSpaceProviderConfigArgsDict']] = None,
                  opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAppSpaceResult:
    """
    [![Private Preview](https://img.shields.io/badge/Release_Stage-Private_Preview-blueviolet)](https://docs.databricks.com/aws/en/release-notes/release-types)


    :param _builtins.str name: The name of the app space. The name must contain only lowercase alphanumeric characters and hyphens.
           It must be unique within the workspace
    :param Union['GetAppSpaceProviderConfigArgs', 'GetAppSpaceProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getAppSpace:getAppSpace', __args__, opts=opts, typ=GetAppSpaceResult).value

    return AwaitableGetAppSpaceResult(
        create_time=pulumi.get(__ret__, 'create_time'),
        creator=pulumi.get(__ret__, 'creator'),
        description=pulumi.get(__ret__, 'description'),
        effective_usage_policy_id=pulumi.get(__ret__, 'effective_usage_policy_id'),
        effective_user_api_scopes=pulumi.get(__ret__, 'effective_user_api_scopes'),
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        provider_config=pulumi.get(__ret__, 'provider_config'),
        resources=pulumi.get(__ret__, 'resources'),
        service_principal_client_id=pulumi.get(__ret__, 'service_principal_client_id'),
        service_principal_id=pulumi.get(__ret__, 'service_principal_id'),
        service_principal_name=pulumi.get(__ret__, 'service_principal_name'),
        status=pulumi.get(__ret__, 'status'),
        update_time=pulumi.get(__ret__, 'update_time'),
        updater=pulumi.get(__ret__, 'updater'),
        usage_policy_id=pulumi.get(__ret__, 'usage_policy_id'),
        user_api_scopes=pulumi.get(__ret__, 'user_api_scopes'))
def get_app_space_output(name: Optional[pulumi.Input[_builtins.str]] = None,
                         provider_config: Optional[pulumi.Input[Optional[Union['GetAppSpaceProviderConfigArgs', 'GetAppSpaceProviderConfigArgsDict']]]] = None,
                         opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetAppSpaceResult]:
    """
    [![Private Preview](https://img.shields.io/badge/Release_Stage-Private_Preview-blueviolet)](https://docs.databricks.com/aws/en/release-notes/release-types)


    :param _builtins.str name: The name of the app space. The name must contain only lowercase alphanumeric characters and hyphens.
           It must be unique within the workspace
    :param Union['GetAppSpaceProviderConfigArgs', 'GetAppSpaceProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getAppSpace:getAppSpace', __args__, opts=opts, typ=GetAppSpaceResult)
    return __ret__.apply(lambda __response__: GetAppSpaceResult(
        create_time=pulumi.get(__response__, 'create_time'),
        creator=pulumi.get(__response__, 'creator'),
        description=pulumi.get(__response__, 'description'),
        effective_usage_policy_id=pulumi.get(__response__, 'effective_usage_policy_id'),
        effective_user_api_scopes=pulumi.get(__response__, 'effective_user_api_scopes'),
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        provider_config=pulumi.get(__response__, 'provider_config'),
        resources=pulumi.get(__response__, 'resources'),
        service_principal_client_id=pulumi.get(__response__, 'service_principal_client_id'),
        service_principal_id=pulumi.get(__response__, 'service_principal_id'),
        service_principal_name=pulumi.get(__response__, 'service_principal_name'),
        status=pulumi.get(__response__, 'status'),
        update_time=pulumi.get(__response__, 'update_time'),
        updater=pulumi.get(__response__, 'updater'),
        usage_policy_id=pulumi.get(__response__, 'usage_policy_id'),
        user_api_scopes=pulumi.get(__response__, 'user_api_scopes')))
