Guest User

Untitled

a guest
Oct 29th, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. enum TokenType: String, Codable{
  2. case password = "password"
  3. case refresh = "refresh_token"
  4.  
  5. var value: String{
  6. return rawValue
  7. }
  8.  
  9. }
  10.  
  11. struct TokenRequestModel: Codable {
  12. let username: String
  13. let password: String
  14. let grantType: TokenType = .password
  15.  
  16. enum CodingKeys: String, CodingKey {
  17. case username = "username"
  18. case password
  19. case grantType = "grant_type"
  20. }
  21.  
  22. }
  23.  
  24. struct RefreshTokenRequestModel: Codable {
  25.  
  26. let refreshToken: String
  27. let grantType: TokenType = .refresh
  28.  
  29. enum CodingKeys: String, CodingKey {
  30. case refreshToken = "refresh_token"
  31. case grantType = "grant_type"
  32. }
  33.  
  34. }
Add Comment
Please, Sign In to add comment