# 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__ = [
    'GetAuthorizedUserResult',
    'AwaitableGetAuthorizedUserResult',
    'get_authorized_user',
    'get_authorized_user_output',
]

@pulumi.output_type
class GetAuthorizedUserResult:
    def __init__(__self__, email=None, first_name=None, last_name=None, user_id=None):
        if email and not isinstance(email, str):
            raise TypeError("Expected argument 'email' to be a str")
        pulumi.set(__self__, "email", email)
        if first_name and not isinstance(first_name, str):
            raise TypeError("Expected argument 'first_name' to be a str")
        pulumi.set(__self__, "first_name", first_name)
        if last_name and not isinstance(last_name, str):
            raise TypeError("Expected argument 'last_name' to be a str")
        pulumi.set(__self__, "last_name", last_name)
        if user_id and not isinstance(user_id, str):
            raise TypeError("Expected argument 'user_id' to be a str")
        pulumi.set(__self__, "user_id", user_id)

    @_builtins.property
    @pulumi.getter
    def email(self) -> _builtins.str:
        """
        The email address of the authorized user.
        """
        return pulumi.get(self, "email")

    @_builtins.property
    @pulumi.getter(name="firstName")
    def first_name(self) -> _builtins.str:
        """
        The first name of the authorized user.
        """
        return pulumi.get(self, "first_name")

    @_builtins.property
    @pulumi.getter(name="lastName")
    def last_name(self) -> _builtins.str:
        """
        The last name of the authorized user.
        """
        return pulumi.get(self, "last_name")

    @_builtins.property
    @pulumi.getter(name="userId")
    def user_id(self) -> _builtins.str:
        """
        The unique identifier for the authorized user.
        """
        return pulumi.get(self, "user_id")


class AwaitableGetAuthorizedUserResult(GetAuthorizedUserResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAuthorizedUserResult(
            email=self.email,
            first_name=self.first_name,
            last_name=self.last_name,
            user_id=self.user_id)


def get_authorized_user(opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAuthorizedUserResult:
    """
    Retrieves information about the user who authorized the current Webflow API token. This is useful for auditing and understanding which user's credentials are being used. Requires the 'authorized_user:read' scope.
    """
    __args__ = dict()
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('webflow:index:getAuthorizedUser', __args__, opts=opts, typ=GetAuthorizedUserResult).value

    return AwaitableGetAuthorizedUserResult(
        email=pulumi.get(__ret__, 'email'),
        first_name=pulumi.get(__ret__, 'first_name'),
        last_name=pulumi.get(__ret__, 'last_name'),
        user_id=pulumi.get(__ret__, 'user_id'))
def get_authorized_user_output(opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetAuthorizedUserResult]:
    """
    Retrieves information about the user who authorized the current Webflow API token. This is useful for auditing and understanding which user's credentials are being used. Requires the 'authorized_user:read' scope.
    """
    __args__ = dict()
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('webflow:index:getAuthorizedUser', __args__, opts=opts, typ=GetAuthorizedUserResult)
    return __ret__.apply(lambda __response__: GetAuthorizedUserResult(
        email=pulumi.get(__response__, 'email'),
        first_name=pulumi.get(__response__, 'first_name'),
        last_name=pulumi.get(__response__, 'last_name'),
        user_id=pulumi.get(__response__, 'user_id')))
