public final class

User

extends Object
implements Parcelable
java.lang.Object
   ↳ com.amazon.identity.auth.device.api.authorization.User

Class Overview

User encapsulates the general profile information of an Amazon customer. It can be retrieved in two ways:

{@since 3.0 }

Summary

[Expand]
Inherited Constants
From interface android.os.Parcelable
Fields
public static final Creator<User> CREATOR
Public Methods
int describeContents()
boolean equals(Object obj)
static void fetch(Context context, Listener<UserAuthError> listener)
Retrieves basic profile information for a user (using OAuth 2.0) for the scopes requested in the last call to authorize(AuthorizeRequest).
String getUserEmail()
The email address of the customer's Amazon account.
String getUserId()
The user's Amazon account ID.
Map<StringString> getUserInfo()
Generic map of the profile data returned when scopes with profile permissions are requested.
String getUserName()
The user's name as set in their Amazon customer profile.
String getUserPostalCode()
The zip/postal code that is associated with the customer's account.
int hashCode()
String toString()
void writeToParcel(Parcel dest, int flags)
[Expand]
Inherited Methods
From class java.lang.Object
From interface android.os.Parcelable

Fields

public static final Creator<User> CREATOR

Public Methods

public int describeContents ()

public boolean equals (Object obj)

public static void fetch (Context context, Listener<UserAuthError> listener)

Retrieves basic profile information for a user (using OAuth 2.0) for the scopes requested in the last call to authorize(AuthorizeRequest). The authorize method must have been called once prior to this call so that a user can authorize the app. If the app has restarted since the last authorize call, fetch may still succeed using the cached profile data and/or credentials.

Parameters
context Required.
listener Callback that returns an User on success, or AuthError upon failure. The listener will be called on a non-UI thread. onError(U) will be called for the following OAuth-related errors: If the APIKey is incorrect, ERROR_ACCESS_DENIED will be returned.

Any other possible OAuth-related errors will be encapsulated in a ERROR_SERVER_REPSONSE.

public String getUserEmail ()

The email address of the customer's Amazon account.

Returns
  • The email of the customer as a string.

public String getUserId ()

The user's Amazon account ID. This identifier is unique to your application.

Returns
  • The account ID of the customer as a string.

public Map<StringString> getUserInfo ()

Generic map of the profile data returned when scopes with profile permissions are requested. This should be used when User does not define a method to retrieve the desired profile data returned.

Returns
  • The map of user profile data.

public String getUserName ()

The user's name as set in their Amazon customer profile.

Returns
  • The name of the customer as a string.

public String getUserPostalCode ()

The zip/postal code that is associated with the customer's account.

Returns
  • The zip/postal code of the customer as a string.

public int hashCode ()

public String toString ()

public void writeToParcel (Parcel dest, int flags)