Guest User

Untitled

a guest
Oct 23rd, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. export class User {
  2. id: string
  3. country: string
  4. email: string
  5. name: string
  6. tags: string[]
  7. verified: boolean
  8. active: boolean
  9. locale: string
  10. openIds: any
  11. parentalControl: boolean
  12. parentalControlPinCode: string
  13. zipCode: string
  14. mobilePhone: string
  15. createdTimestamp: string
  16.  
  17. static fromJson(json: any): User {
  18. let user = new User()
  19. user.id = json.userId
  20. user.country = json.country
  21. user.email = json.email
  22. user.name = json.name
  23. user.tags = json.tags
  24. user.verified = json.verified
  25. user.active = json.active
  26. user.locale = json.locale
  27. user.openIds = json.openIds
  28. user.parentalControl = json.parentalControl
  29. user.mobilePhone = json.mobilePhone
  30. user.zipCode = json.zipCode
  31. user.parentalControlPinCode = json.parentalControlPinCode
  32. user.createdTimestamp = json.createdTimestamp
  33.  
  34. console.log(json)
  35. return user
  36. }
  37.  
  38. toJson(): any {
  39. let json = {}
  40. json['userId'] = this.id
  41. json['name'] = this.name
  42. json['email'] = this.email
  43. json['country'] = this.country
  44. json['tags'] = this.tags
  45. json['verified'] = this.verified
  46. json['active'] = this.active
  47. json['locale'] = this.locale
  48. json['openIds'] = this.openIds
  49. json['parentalControl'] = this.parentalControl
  50. json['mobilePhone'] = this.mobilePhone
  51. json['zipCode'] = this.zipCode
  52. json['parentalControlPinCode'] = this.parentalControlPinCode
  53. json['createdTimestamp'] = this.createdTimestamp
  54. return json
  55. }
  56. }
Add Comment
Please, Sign In to add comment