Exemplo n.º 1
0
func (p *googleUserInfoResult) FromJSON(props jsonhelper.JSONObject) {
	p.id = props.GetAsObject("id").GetAsString("$t")
	authorArr := props.GetAsArray("author")
	if len(authorArr) > 0 {
		author := jsonhelper.JSONValueToObject(authorArr[0])
		p.name = author.GetAsObject("name").GetAsString("$t")
		p.email = author.GetAsObject("email").GetAsString("$t")
	}
	for _, l := range props.GetAsArray("link") {
		m := jsonhelper.JSONValueToObject(l)
		if m.GetAsString("rel") == _GOOGLE_USERINFO_FEED_REL {
			p.uri = m.GetAsString("href")
		}
	}
	p.updated = props.GetAsObject("updated").GetAsTime("$t", GOOGLE_DATETIME_FORMAT)
}