# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import json
import warnings
import pulumi
import pulumi.runtime
from typing import Union
from . import utilities, tables

class GetUserResult:
    """
    A collection of values returned by getUser.
    """
    def __init__(__self__, account_enabled=None, display_name=None, mail=None, mail_nickname=None, object_id=None, user_principal_name=None, id=None):
        if account_enabled and not isinstance(account_enabled, bool):
            raise TypeError("Expected argument 'account_enabled' to be a bool")
        __self__.account_enabled = account_enabled
        """
        `True` if the account is enabled; otherwise `False`.
        """
        if display_name and not isinstance(display_name, str):
            raise TypeError("Expected argument 'display_name' to be a str")
        __self__.display_name = display_name
        """
        The Display Name of the Azure AD User.
        """
        if mail and not isinstance(mail, str):
            raise TypeError("Expected argument 'mail' to be a str")
        __self__.mail = mail
        """
        The primary email address of the Azure AD User.
        """
        if mail_nickname and not isinstance(mail_nickname, str):
            raise TypeError("Expected argument 'mail_nickname' to be a str")
        __self__.mail_nickname = mail_nickname
        """
        The email alias of the Azure AD User.
        """
        if object_id and not isinstance(object_id, str):
            raise TypeError("Expected argument 'object_id' to be a str")
        __self__.object_id = object_id
        if user_principal_name and not isinstance(user_principal_name, str):
            raise TypeError("Expected argument 'user_principal_name' to be a str")
        __self__.user_principal_name = user_principal_name
        """
        The User Principal Name of the Azure AD User.
        """
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        __self__.id = id
        """
        id is the provider-assigned unique ID for this managed resource.
        """
class AwaitableGetUserResult(GetUserResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetUserResult(
            account_enabled=self.account_enabled,
            display_name=self.display_name,
            mail=self.mail,
            mail_nickname=self.mail_nickname,
            object_id=self.object_id,
            user_principal_name=self.user_principal_name,
            id=self.id)

def get_user(object_id=None,user_principal_name=None,opts=None):
    """
    Gets information about an Azure Active Directory user.
    
    > **NOTE:** If you're authenticating using a Service Principal then it must have permissions to `Read directory data` within the `Windows Azure Active Directory` API.
    
    :param str object_id: Specifies the Object ID of the Application within Azure Active Directory.
    :param str user_principal_name: The User Principal Name of the Azure AD User.

    > This content is derived from https://github.com/terraform-providers/terraform-provider-azuread/blob/master/website/docs/d/user.html.markdown.
    """
    __args__ = dict()

    __args__['objectId'] = object_id
    __args__['userPrincipalName'] = user_principal_name
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = utilities.get_version()
    __ret__ = pulumi.runtime.invoke('azuread:index/getUser:getUser', __args__, opts=opts).value

    return AwaitableGetUserResult(
        account_enabled=__ret__.get('accountEnabled'),
        display_name=__ret__.get('displayName'),
        mail=__ret__.get('mail'),
        mail_nickname=__ret__.get('mailNickname'),
        object_id=__ret__.get('objectId'),
        user_principal_name=__ret__.get('userPrincipalName'),
        id=__ret__.get('id'))
