# 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

__all__ = [
    'GetTokenInfoResult',
    'AwaitableGetTokenInfoResult',
    'get_token_info',
    'get_token_info_output',
]

@pulumi.output_type
class GetTokenInfoResult:
    def __init__(__self__, application=None, authorization=None):
        if application and not isinstance(application, dict):
            raise TypeError("Expected argument 'application' to be a dict")
        pulumi.set(__self__, "application", application)
        if authorization and not isinstance(authorization, dict):
            raise TypeError("Expected argument 'authorization' to be a dict")
        pulumi.set(__self__, "authorization", authorization)

    @_builtins.property
    @pulumi.getter
    def application(self) -> 'outputs.GetTokenInfoApplication':
        """
        Application details for the token owner.
        """
        return pulumi.get(self, "application")

    @_builtins.property
    @pulumi.getter
    def authorization(self) -> 'outputs.GetTokenInfoAuthorization':
        """
        Authorization details for the API token, including scopes and authorized resources.
        """
        return pulumi.get(self, "authorization")


class AwaitableGetTokenInfoResult(GetTokenInfoResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetTokenInfoResult(
            application=self.application,
            authorization=self.authorization)


def get_token_info(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetTokenInfoResult:
    """
    Retrieves information about the current Webflow API token, including authorization details, scopes, rate limits, and the authorized resources. This is useful for validating your API token configuration and understanding what resources it can access.
    """
    __args__ = dict()
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('webflow:index:getTokenInfo', __args__, opts=opts, typ=GetTokenInfoResult).value

    return AwaitableGetTokenInfoResult(
        application=pulumi.get(__ret__, 'application'),
        authorization=pulumi.get(__ret__, 'authorization'))
def get_token_info_output(opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetTokenInfoResult]:
    """
    Retrieves information about the current Webflow API token, including authorization details, scopes, rate limits, and the authorized resources. This is useful for validating your API token configuration and understanding what resources it can access.
    """
    __args__ = dict()
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('webflow:index:getTokenInfo', __args__, opts=opts, typ=GetTokenInfoResult)
    return __ret__.apply(lambda __response__: GetTokenInfoResult(
        application=pulumi.get(__response__, 'application'),
        authorization=pulumi.get(__response__, 'authorization')))
