LeanCloud C# SDK
Public Member Functions | Static Public Member Functions | Public Attributes | Properties | List of all members
LeanCloud.Storage.LCUser Class Reference
Inheritance diagram for LeanCloud.Storage.LCUser:
Inheritance graph
[legend]
Collaboration diagram for LeanCloud.Storage.LCUser:
Collaboration graph
[legend]

Public Member Functions

 LCUser ()
 
 LCUser (LCObjectData objectData)
 
async Task< LCUserSignUp ()
 Signs up a new user. More...
 
Task AssociateAuthData (Dictionary< string, object > authData, string platform)
 Associates this user with a third party authData. More...
 
Task AssociateAuthDataAndUnionId (Dictionary< string, object > authData, string platform, string unionId, LCUserAuthDataLoginOption option=null)
 Associates this user with a third party authData and unionId. More...
 
Task DisassociateWithAuthData (string platform)
 Unlinks a user from a third party platform. More...
 
async Task UpdatePassword (string oldPassword, string newPassword)
 Updates newPassword safely with oldPassword. More...
 
async Task< bool > IsAuthenticated ()
 Checks whether the current sessionToken is valid. More...
 
async Task Follow (string targetId, Dictionary< string, object > attrs=null)
 Follows a user. More...
 
async Task Unfollow (string targetId)
 Unfollows a user. More...
 
LCQuery< LCObjectFollowerQuery ()
 Constructs a follower query. More...
 
LCQuery< LCObjectFolloweeQuery ()
 Constructs a followee query. More...
 
async Task< LCFollowersAndFolloweesGetFollowersAndFollowees (bool includeFollower=false, bool includeFollowee=false, bool returnCount=false)
 
- Public Member Functions inherited from LeanCloud.Storage.LCObject
 LCObject (string className)
 
void Unset (string key)
 Removes the key. More...
 
void AddRelation (string key, LCObject value)
 
void RemoveRelation (string key, LCObject value)
 
void Increment (string key, object value)
 Atomically increments the value of the given key with amount. More...
 
void Add (string key, object value)
 Atomically adds value to the end of the array key. More...
 
void AddAll (string key, IEnumerable values)
 Atomically adds values to the end of the array key. More...
 
void AddUnique (string key, object value)
 Atomically adds value to the array key, only if not already present. More...
 
void AddAllUnique (string key, IEnumerable values)
 Atomically adds values to the array key, only if not already present. More...
 
void Remove (string key, object value)
 Atomically removes all value from the array key. More...
 
void RemoveAll (string key, IEnumerable values)
 Atomically removes all values from the array key. More...
 
async Task< LCObjectSave (bool fetchWhenSave=false, LCQuery< LCObject > query=null)
 
async Task Delete ()
 
async Task< LCObjectFetch (IEnumerable< string > keys=null, IEnumerable< string > includes=null)
 
override string ToString ()
 Serializes this LCObject to a JSON string. More...
 
void Merge (LCObjectData objectData)
 

Static Public Member Functions

static Task< LCUserGetCurrent ()
 
static async Task RequestLoginSMSCode (string mobile)
 Requests sending a login sms code. More...
 
static async Task< LCUserSignUpOrLoginByMobilePhone (string mobile, string code)
 Signs up or signs in a user with their mobile number and verification code. More...
 
static Task< LCUserLogin (string username, string password)
 Signs in a user with their username and password. More...
 
static Task< LCUserLoginByEmail (string email, string password)
 Signs in a user with their email and password. More...
 
static Task< LCUserLoginByMobilePhoneNumber (string mobile, string password)
 Signs in a user with their mobile number and password. More...
 
static Task< LCUserLoginBySMSCode (string mobile, string code)
 Signs in a user with their mobile number and verification code. More...
 
static Task< LCUserLoginWithAuthData (Dictionary< string, object > authData, string platform, LCUserAuthDataLoginOption option=null)
 Signs up or signs in a user with third party authData. More...
 
static Task< LCUserLoginWithAuthDataAndUnionId (Dictionary< string, object > authData, string platform, string unionId, LCUserAuthDataLoginOption option=null)
 Signs up or signs in a user with third party authData and unionId. More...
 
static Task< LCUserLoginAnonymously ()
 Creates an anonymous user. More...
 
static async Task RequestEmailVerify (string email)
 Requests a verification email to be sent to a user's email address. More...
 
static async Task RequestMobilePhoneVerify (string mobile)
 Requests a verification SMS to be sent to a user's mobile number. More...
 
static async Task VerifyMobilePhone (string mobile, string code)
 Requests to verify a user's mobile number with sms code they received. More...
 
static async Task< LCUserBecomeWithSessionToken (string sessionToken)
 Signs in a user with a sessionToken. More...
 
static async Task RequestPasswordReset (string email)
 Requests a password reset email to be sent to a user's email address. More...
 
static async Task RequestPasswordResetBySmsCode (string mobile)
 Requests a reset password sms code to be sent to a user's mobile number. More...
 
static async Task ResetPasswordBySmsCode (string mobile, string code, string newPassword)
 Resets a user's password via mobile phone. More...
 
static Task Logout ()
 Logs out the currently logged in user session. More...
 
static LCQuery< LCUserGetQuery ()
 Constructs a LCQuery for LCUser. More...
 
static async Task RequestSMSCodeForUpdatingPhoneNumber (string mobile, int ttl=360, string captchaToken=null)
 Requests an SMS code for updating phone number. More...
 
static async Task VerifyCodeForUpdatingPhoneNumber (string mobile, string code)
 Verify code for updating phone number. More...
 
- Static Public Member Functions inherited from LeanCloud.Storage.LCObject
static LCObject CreateWithoutData (string className, string objectId)
 
static LCObject Create (string className)
 
static async Task< List< LCObject > > SaveAll (List< LCObject > objectList)
 
static async Task DeleteAll (List< LCObject > objectList)
 
static async Task< IEnumerable< LCObject > > FetchAll (IEnumerable< LCObject > objects)
 
static void RegisterSubclass< T > (string className, Func< T > constructor)
 
static LCObject ParseObject (string json)
 Deserializes a JSON string to a LCObject. More...
 

Public Attributes

const string CLASS_NAME = "_User"
 
bool IsAnonymous
 Checks whether this user is anonymous. More...
 

Properties

string Username [get, set]
 
string Password [get, set]
 
string Email [get, set]
 
string Mobile [get, set]
 
string SessionToken [get, set]
 
bool EmailVerified [get]
 
bool MobileVerified [get]
 
Dictionary< string, object > AuthData [get, set]
 
- Properties inherited from LeanCloud.Storage.LCObject
string ClassName [get]
 
string ObjectId [get]
 
DateTime CreatedAt [get]
 
DateTime UpdatedAt [get]
 
LCACL ACL [get, set]
 
object this[string key] [get, set]
 

Constructor & Destructor Documentation

LeanCloud.Storage.LCUser.LCUser ( )
inline
LeanCloud.Storage.LCUser.LCUser ( LCObjectData  objectData)
inline

Member Function Documentation

Task LeanCloud.Storage.LCUser.AssociateAuthData ( Dictionary< string, object >  authData,
string  platform 
)
inline

Associates this user with a third party authData.

Parameters
authData
platform
Returns
Task LeanCloud.Storage.LCUser.AssociateAuthDataAndUnionId ( Dictionary< string, object >  authData,
string  platform,
string  unionId,
LCUserAuthDataLoginOption  option = null 
)
inline

Associates this user with a third party authData and unionId.

Parameters
authData
platform
unionId
option
Returns
static async Task<LCUser> LeanCloud.Storage.LCUser.BecomeWithSessionToken ( string  sessionToken)
inlinestatic

Signs in a user with a sessionToken.

Parameters
sessionToken
Returns
Task LeanCloud.Storage.LCUser.DisassociateWithAuthData ( string  platform)
inline

Unlinks a user from a third party platform.

Parameters
platform
Returns
async Task LeanCloud.Storage.LCUser.Follow ( string  targetId,
Dictionary< string, object >  attrs = null 
)
inline

Follows a user.

Parameters
targetId
attrs
Returns
LCQuery<LCObject> LeanCloud.Storage.LCUser.FolloweeQuery ( )
inline

Constructs a followee query.

Returns
LCQuery<LCObject> LeanCloud.Storage.LCUser.FollowerQuery ( )
inline

Constructs a follower query.

Returns
static Task<LCUser> LeanCloud.Storage.LCUser.GetCurrent ( )
inlinestatic
async Task<LCFollowersAndFollowees> LeanCloud.Storage.LCUser.GetFollowersAndFollowees ( bool  includeFollower = false,
bool  includeFollowee = false,
bool  returnCount = false 
)
inline
static LCQuery<LCUser> LeanCloud.Storage.LCUser.GetQuery ( )
inlinestatic

Constructs a LCQuery for LCUser.

Returns
async Task<bool> LeanCloud.Storage.LCUser.IsAuthenticated ( )
inline

Checks whether the current sessionToken is valid.

Returns
static Task<LCUser> LeanCloud.Storage.LCUser.Login ( string  username,
string  password 
)
inlinestatic

Signs in a user with their username and password.

Parameters
username
password
Returns
static Task<LCUser> LeanCloud.Storage.LCUser.LoginAnonymously ( )
inlinestatic

Creates an anonymous user.

Returns
static Task<LCUser> LeanCloud.Storage.LCUser.LoginByEmail ( string  email,
string  password 
)
inlinestatic

Signs in a user with their email and password.

Parameters
email
password
Returns
static Task<LCUser> LeanCloud.Storage.LCUser.LoginByMobilePhoneNumber ( string  mobile,
string  password 
)
inlinestatic

Signs in a user with their mobile number and password.

Parameters
mobile
password
Returns
static Task<LCUser> LeanCloud.Storage.LCUser.LoginBySMSCode ( string  mobile,
string  code 
)
inlinestatic

Signs in a user with their mobile number and verification code.

Parameters
mobile
code
Returns
static Task<LCUser> LeanCloud.Storage.LCUser.LoginWithAuthData ( Dictionary< string, object >  authData,
string  platform,
LCUserAuthDataLoginOption  option = null 
)
inlinestatic

Signs up or signs in a user with third party authData.

Parameters
authData
platform
option
Returns
static Task<LCUser> LeanCloud.Storage.LCUser.LoginWithAuthDataAndUnionId ( Dictionary< string, object >  authData,
string  platform,
string  unionId,
LCUserAuthDataLoginOption  option = null 
)
inlinestatic

Signs up or signs in a user with third party authData and unionId.

Parameters
authData
platform
unionId
option
Returns
static Task LeanCloud.Storage.LCUser.Logout ( )
inlinestatic

Logs out the currently logged in user session.

static async Task LeanCloud.Storage.LCUser.RequestEmailVerify ( string  email)
inlinestatic

Requests a verification email to be sent to a user's email address.

Parameters
email
Returns
static async Task LeanCloud.Storage.LCUser.RequestLoginSMSCode ( string  mobile)
inlinestatic

Requests sending a login sms code.

Parameters
mobileThe mobile number of an existing user
Returns
static async Task LeanCloud.Storage.LCUser.RequestMobilePhoneVerify ( string  mobile)
inlinestatic

Requests a verification SMS to be sent to a user's mobile number.

Parameters
mobile
Returns
static async Task LeanCloud.Storage.LCUser.RequestPasswordReset ( string  email)
inlinestatic

Requests a password reset email to be sent to a user's email address.

Parameters
email
Returns
static async Task LeanCloud.Storage.LCUser.RequestPasswordResetBySmsCode ( string  mobile)
inlinestatic

Requests a reset password sms code to be sent to a user's mobile number.

Parameters
email
Returns
static async Task LeanCloud.Storage.LCUser.RequestSMSCodeForUpdatingPhoneNumber ( string  mobile,
int  ttl = 360,
string  captchaToken = null 
)
inlinestatic

Requests an SMS code for updating phone number.

Parameters
mobile
ttl
captchaToken
Returns
static async Task LeanCloud.Storage.LCUser.ResetPasswordBySmsCode ( string  mobile,
string  code,
string  newPassword 
)
inlinestatic

Resets a user's password via mobile phone.

Parameters
mobile
code
newPassword
Returns
async Task<LCUser> LeanCloud.Storage.LCUser.SignUp ( )
inline

Signs up a new user.

Returns
static async Task<LCUser> LeanCloud.Storage.LCUser.SignUpOrLoginByMobilePhone ( string  mobile,
string  code 
)
inlinestatic

Signs up or signs in a user with their mobile number and verification code.

Parameters
mobile
code
Returns
async Task LeanCloud.Storage.LCUser.Unfollow ( string  targetId)
inline

Unfollows a user.

Parameters
targetId
Returns
async Task LeanCloud.Storage.LCUser.UpdatePassword ( string  oldPassword,
string  newPassword 
)
inline

Updates newPassword safely with oldPassword.

Parameters
oldPassword
newPassword
Returns
static async Task LeanCloud.Storage.LCUser.VerifyCodeForUpdatingPhoneNumber ( string  mobile,
string  code 
)
inlinestatic

Verify code for updating phone number.

Parameters
mobile
code
Returns
static async Task LeanCloud.Storage.LCUser.VerifyMobilePhone ( string  mobile,
string  code 
)
inlinestatic

Requests to verify a user's mobile number with sms code they received.

Parameters
mobile
code
Returns

Member Data Documentation

const string LeanCloud.Storage.LCUser.CLASS_NAME = "_User"
bool LeanCloud.Storage.LCUser.IsAnonymous
Initial value:
=> AuthData != null &&
AuthData.ContainsKey("anonymous")

Checks whether this user is anonymous.

Property Documentation

Dictionary<string, object> LeanCloud.Storage.LCUser.AuthData
getset
string LeanCloud.Storage.LCUser.Email
getset
bool LeanCloud.Storage.LCUser.EmailVerified
get
string LeanCloud.Storage.LCUser.Mobile
getset
bool LeanCloud.Storage.LCUser.MobileVerified
get
string LeanCloud.Storage.LCUser.Password
getset
string LeanCloud.Storage.LCUser.SessionToken
getset
string LeanCloud.Storage.LCUser.Username
getset

The documentation for this class was generated from the following file: