Created
April 4, 2013 14:16
-
-
Save excavador/5310715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Token for access to Google API | |
* @param accessToken the token that can be sent to a Google API | |
* @param refreshToken a token that may be used to obtain a new access token. Refresh tokens are valid until the user revokes access. This field is only present if access_type=offline is included in the authorization code request. | |
* @param expiresIn the remaining lifetime on the access token | |
* @param tokenType indicates the type of token returned. At this time, this field will always have the value Bearer | |
*/ | |
case class Token(accessToken : String, | |
refreshToken : Option[String] = None, | |
expiresIn : Integer, | |
tokenType : TokenType.Value = TokenType.Bearer) extends TokenResponse{ | |
def refresh : Token= throw new NotImplementedException | |
} | |
object Token { | |
abstract class Response | |
abstract class Successfull extends Response | |
case class OneTime() extends Successfull | |
case class Refreshable() extends OneTime | |
abstract class Problem extends Response | |
case class ConnectionProblem() extends Problem | |
case class InvalidResponse() extends Problem | |
case class UnexpectedRespones() extends Problem | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment