@Immutable @LevelUpApi(contract=PUBLIC) public final class UserRequestFactory extends AbstractRequestFactory
Class to build requests to interact with the endpoints that deal with
User
s.
If you're looking to login, see AccessTokenRequestFactory
.
Modifier and Type | Class and Description |
---|---|
static class |
UserRequestFactory.UserInfoRequestBuilder
Builder to create a request that updates the User's information.
|
Modifier and Type | Field and Description |
---|---|
static String |
OUTER_PARAM_PERMISSION_KEYNAMES
Outer parameter name for permission keynames parameters.
|
static String |
OUTER_PARAM_USER
Outer parameter name for user parameters.
|
static String |
PARAM_BORN_AT
User Parameter for birth date.
|
static String |
PARAM_CUSTOM_ATTRIBUTES
User Parameter for custom attributes.
|
static String |
PARAM_EMAIL
User Parameter for email.
|
static String |
PARAM_FIRST_NAME
User Parameter for first name.
|
static String |
PARAM_GENDER
User Parameter for gender.
|
static String |
PARAM_LAST_NAME
User Parameter for last name.
|
static String |
PARAM_LATITUDE
User Parameter for latitude, represented as a floating point number.
|
static String |
PARAM_LONGITUDE
User Parameter for longitude, represented as a floating point number.
|
static String |
PARAM_NEW_PASSWORD
User Parameter for new password.
|
static String |
PARAM_NEW_PASSWORD_CONFIRMATION
User Parameter for new password confirmation.
|
static String |
PARAM_PASSWORD
User Parameter for password.
|
static String |
PARAM_TERMS_ACCEPTED
User Parameter for if they have accepted the terms of service.
|
Constructor and Description |
---|
UserRequestFactory(Context context,
AccessTokenRetriever retriever) |
Modifier and Type | Method and Description |
---|---|
AbstractRequest |
buildFacebookConnectRequest(String facebookAccessToken)
Builds a request to connect a user to Facebook.
|
AbstractRequest |
buildFacebookDisconnectRequest()
Builds a request to disconnect a user from Facebook.
|
AbstractRequest |
buildFacebookRegisterRequest(String facebookAccessToken)
Build a request to register a new User via a facebook access token.
|
AbstractRequest |
buildForgotPasswordRequest(String email)
Get a request that will allow the user to reset their password.
|
AbstractRequest |
buildGetUserInfoRequest()
Build a request to retrieve the User information.
|
AbstractRequest |
buildRegisterRequest(String firstName,
String lastName,
String email,
List<String> permissions)
Build a request to create a new user.
|
AbstractRequest |
buildRegisterRequest(String firstName,
String lastName,
String email,
String password,
Location location)
Build a request to create a new user.
|
getAccessTokenRetriever, getContext
public static final String OUTER_PARAM_USER
public static final String OUTER_PARAM_PERMISSION_KEYNAMES
public static final String PARAM_LONGITUDE
public static final String PARAM_LATITUDE
public static final String PARAM_PASSWORD
public static final String PARAM_NEW_PASSWORD
public static final String PARAM_NEW_PASSWORD_CONFIRMATION
public static final String PARAM_EMAIL
public static final String PARAM_LAST_NAME
public static final String PARAM_FIRST_NAME
public static final String PARAM_TERMS_ACCEPTED
public static final String PARAM_BORN_AT
public static final String PARAM_GENDER
public static final String PARAM_CUSTOM_ATTRIBUTES
public UserRequestFactory(Context context, AccessTokenRetriever retriever)
context
- the Application context.retriever
- the implementation of AccessTokenRetriever
to use to get the User's
AccessToken
if needed.@LevelUpApi(contract=ENTERPRISE) public AbstractRequest buildForgotPasswordRequest(String email)
email
- the email address they signed up with.AbstractRequest
to use to reset the password for the user.@LevelUpApi(contract=INTERNAL) @AccessTokenRequired public AbstractRequest buildFacebookConnectRequest(String facebookAccessToken)
facebookAccessToken
- the Facebook access token to use to connect the user.AbstractRequest
to use to connect the user to Facebook.@LevelUpApi(contract=INTERNAL) @AccessTokenRequired public AbstractRequest buildFacebookDisconnectRequest()
AbstractRequest
to use to disconnect the user from Facebook.@LevelUpApi(contract=ENTERPRISE) public final AbstractRequest buildRegisterRequest(String firstName, String lastName, String email, String password, Location location)
firstName
- user's first name.lastName
- user's last name.email
- user's email address.password
- user's new password.location
- Android Location for the user (or null if none was found).AbstractRequest
representing the register request.@LevelUpApi(contract=PUBLIC) public final AbstractRequest buildRegisterRequest(String firstName, String lastName, String email, List<String> permissions)
firstName
- user's first name.lastName
- user's last name.email
- user's email address.permissions
- array of permissions to grant the new userAbstractRequest
representing the register request.@LevelUpApi(contract=INTERNAL) public AbstractRequest buildFacebookRegisterRequest(String facebookAccessToken)
facebookAccessToken
- the facebook access token to use to register the new user.AbstractRequest
to use to register the new user.@AccessTokenRequired @LevelUpApi(contract=PUBLIC) @RequiresPermission(value="read_user_basic_info") public AbstractRequest buildGetUserInfoRequest()