Package com.spotify.sdk.android.auth
Class AuthorizationResponse
- java.lang.Object
-
- com.spotify.sdk.android.auth.AuthorizationResponse
-
- All Implemented Interfaces:
android.os.Parcelable
public class AuthorizationResponse extends java.lang.Object implements android.os.Parcelable
An object that contains the parsed response from the Spotify authorization service. To create one useAuthorizationResponse.Builder
or parse fromUri
withfromUri(android.net.Uri)
- See Also:
- Web API Authorization guide
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AuthorizationResponse.Builder
Use this builder to create anAuthorizationResponse
static class
AuthorizationResponse.Type
The type of the authorization response.
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<AuthorizationResponse>
CREATOR
-
Constructor Summary
Constructors Constructor Description AuthorizationResponse(android.os.Parcel source)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
describeContents()
static AuthorizationResponse
fromUri(android.net.Uri uri)
Parses the URI returned from the Spotify accounts service.java.lang.String
getAccessToken()
java.lang.String
getCode()
java.lang.String
getError()
int
getExpiresIn()
java.lang.String
getRefreshToken()
java.lang.String
getState()
AuthorizationResponse.Type
getType()
void
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<AuthorizationResponse> CREATOR
-
-
Method Detail
-
fromUri
@NonNull public static AuthorizationResponse fromUri(@Nullable android.net.Uri uri)
Parses the URI returned from the Spotify accounts service.- Parameters:
uri
- URI- Returns:
- Authorization response. If parsing failed, this object will be populated with the given error codes.
-
getType
@NonNull public AuthorizationResponse.Type getType()
-
getCode
@Nullable public java.lang.String getCode()
-
getAccessToken
@Nullable public java.lang.String getAccessToken()
-
getState
@Nullable public java.lang.String getState()
-
getError
@Nullable public java.lang.String getError()
-
getExpiresIn
public int getExpiresIn()
-
getRefreshToken
@Nullable public java.lang.String getRefreshToken()
-
describeContents
public int describeContents()
- Specified by:
describeContents
in interfaceandroid.os.Parcelable
-
writeToParcel
public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
-
-