Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. * @ApiDoc(
  2. * section = "user",
  3. * resource = true,
  4. * description = "Checks the user credentials and returns an authentication & refresh token if they are correct",
  5. * input = { "class" = "AppBundleLibrariesCoreUserLoginRequest", "name" = "" },
  6. * output = { "class" = "AppBundleLibrariesCoreUserLoginResponse", "name" = "" },
  7. * statusCodes = {
  8. * 200 = "Returned when successful",
  9. * 400 = "Returned when request syntax is incorrect",
  10. * 404 = "Returned when the page is not found",
  11. * 429 = "Returned when the client sent too many requests during a time period",
  12. * 500 = "Returned when an internal server error occured",
  13. * 501 = "Returned when an unavailable request method is user (GET, POST, DELETE, PUT, ...)",
  14. * 503 = "Returned when the service is unavailable at the moment eg. due to maintenance or overload"
  15. * },
  16. *
  17. * )
  18.  
  19. class LoginRequest implements JsonSerializable
  20. {
  21. /**
  22. * The username.
  23. *
  24. * @var string
  25. *
  26. * @AssertNotBlank()
  27. * @AssertType("string")
  28. */
  29. public $username;
  30.  
  31. /**
  32. * The password.
  33. *
  34. * @var string
  35. *
  36. * @AssertNotBlank()
  37. * @AssertType("string")
  38. */
  39. public $password;
  40.  
  41. /**
  42. * Defines whether or not to save the refresh token as cooke.
  43. *
  44. * @var bool
  45. *
  46. * @AssertNotBlank()
  47. * @AssertType("bool")
  48. */
  49. public $rememberPassword;
  50.  
  51. public function getUsername()
  52. {
  53. return $this->username;
  54. }
  55.  
  56. public function setUsername($username)
  57. {
  58. $this->username = $username;
  59. }
  60.  
  61. public function getPassword()
  62. {
  63. return $this->password;
  64. }
  65.  
  66. public function setPassword($password)
  67. {
  68. $this->password = $password;
  69. }
  70.  
  71. public function getRememberPassword()
  72. {
  73. return $this->rememberPassword;
  74. }
  75.  
  76. public function setRememberPassword($rememberPassword)
  77. {
  78. $this->rememberPassword = $rememberPassword;
  79. }
  80.  
  81. public function jsonSerialize()
  82. {
  83. return [
  84. 'username' => $this->username,
  85. 'password' => $this->password,
  86. 'rememberPassword' => $this->rememberPassword
  87. ];
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement