import { Serializable } from '../../interfaces/serializable'; export interface UserInfoJson { email: string; email_verified: boolean; family_name: string; given_name: string; name: string; picture: string; sub: string; } export class UserInfo implements Serializable { public email: string; public email_verified: boolean; public family_name: string; public given_name: string; public name: string; public picture: string; public sub: string; constructor(grantResponse: UserInfoJson) { this.email = grantResponse.email; this.email_verified = grantResponse.email_verified; this.family_name = grantResponse.family_name; this.given_name = grantResponse.given_name; this.name = grantResponse.name; this.picture = grantResponse.picture; this.sub = grantResponse.sub; } public toJson(): UserInfoJson { return { email: this.email, email_verified: this.email_verified, family_name: this.family_name, given_name: this.given_name, name: this.name, picture: this.picture, sub: this.sub }; } }