# coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities

__all__ = [
    'GetClientTokenResult',
    'AwaitableGetClientTokenResult',
    'get_client_token',
    'get_client_token_output',
]

@pulumi.output_type
class GetClientTokenResult:
    """
    Configuration values returned by getClientToken.
    """
    def __init__(__self__, token=None):
        if token and not isinstance(token, str):
            raise TypeError("Expected argument 'token' to be a str")
        pulumi.set(__self__, "token", token)

    @property
    @pulumi.getter
    def token(self) -> str:
        """
        OAuth token for Azure Management API and SDK authentication.
        """
        return pulumi.get(self, "token")


class AwaitableGetClientTokenResult(GetClientTokenResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetClientTokenResult(
            token=self.token)


def get_client_token(endpoint: Optional[str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetClientTokenResult:
    """
    Use this function to get an Azure authentication token for the current login context.


    :param str endpoint: Optional authentication endpoint. Defaults to the endpoint of Azure Resource Manager.
    """
    __args__ = dict()
    __args__['endpoint'] = endpoint
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('azure-native:authorization:getClientToken', __args__, opts=opts, typ=GetClientTokenResult).value

    return AwaitableGetClientTokenResult(
        token=__ret__.token)


@_utilities.lift_output_func(get_client_token)
def get_client_token_output(endpoint: Optional[pulumi.Input[Optional[str]]] = None,
                            opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetClientTokenResult]:
    """
    Use this function to get an Azure authentication token for the current login context.


    :param str endpoint: Optional authentication endpoint. Defaults to the endpoint of Azure Resource Manager.
    """
    ...
