-
Notifications
You must be signed in to change notification settings - Fork 7
/
UserApi.kt
76 lines (64 loc) · 1.99 KB
/
UserApi.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
package io.embrace.android.embracesdk
/**
* The public API that is used to set user information.
*/
internal interface UserApi {
/**
* Sets the user ID. This would typically be some form of unique identifier such as a UUID or database key for the user.
* This ID will persist across app launches until it is explicitly removed using [.clearUserIdentifier]
* or otherwise cleared.
*
* @param userId the unique identifier for the user
*/
fun setUserIdentifier(userId: String?)
/**
* Clears the currently set user ID. For example, if the user logs out.
*/
fun clearUserIdentifier()
/**
* Sets the current user's email address.
*
* @param email the email address of the current user
*/
fun setUserEmail(email: String?)
/**
* Clears the currently set user's email address.
*/
fun clearUserEmail()
/**
* Sets this user as a paying user. This adds a persona to the user's identity.
*/
fun setUserAsPayer()
/**
* Clears this user as a paying user. This would typically be called if a user is no longer
* paying for the service and has reverted back to a basic user.
*/
fun clearUserAsPayer()
/**
* Adds a custom user persona. A persona is a trait associated with a given user. A maximum
* of 10 personas can be set.
*
* @param persona the persona to set
*/
fun addUserPersona(persona: String)
/**
* Clears the custom user persona, if it is set.
*
* @param persona the persona to clear
*/
fun clearUserPersona(persona: String)
/**
* Clears all custom user personas from the user.
*/
fun clearAllUserPersonas()
/**
* Sets the username of the currently logged in user.
*
* @param username the username to set
*/
fun setUsername(username: String?)
/**
* Clears the username of the currently logged in user, for example if the user has logged out.
*/
fun clearUsername()
}