Example #1
0
func (p *yahooUserInfoResult) FromJSON(props jsonhelper.JSONObject) {
	p.guid = props.GetAsString("guid")
	p.uri = props.GetAsString("uri")
	p.birthYear = props.GetAsInt("birthYear")
	p.birthdate = props.GetAsString("birthdate")
	p.created = props.GetAsTime("created", YAHOO_DATETIME_FORMAT)
	p.displayAge = props.GetAsInt("displayAge")
	emails := props.GetAsArray("emails")
	p.emails = make([]YahooUserInfoEmail, len(emails))
	for i, email := range emails {
		v := new(yahooUserInfoEmail)
		v.FromJSON(jsonhelper.JSONValueToObject(email))
		p.emails[i] = v
	}
	p.familyName = props.GetAsString("familyName")
	p.givenName = props.GetAsString("givenName")
	p.gender = props.GetAsString("gender")
	ims := props.GetAsArray("ims")
	p.ims = make([]YahooUserInfoIm, len(ims))
	for i, im := range ims {
		v := new(yahooUserInfoIm)
		v.FromJSON(jsonhelper.JSONValueToObject(im))
		p.ims[i] = v
	}
	p.lang = props.GetAsString("lang")
	p.location = props.GetAsString("location")
	p.memberSince = props.GetAsTime("memberSince", YAHOO_DATETIME_FORMAT)
	p.nickname = props.GetAsString("nickname")
	p.profileUrl = props.GetAsString("profileUrl")
	p.searchable = props.GetAsBool("searchable")
	p.timeZone = props.GetAsString("timeZone")
	p.updated = props.GetAsTime("updated", YAHOO_DATETIME_FORMAT)
	p.isConnected = props.GetAsBool("isConnected")
}
Example #2
0
func (p *smugMugUserInfoResult) FromJSON(props jsonhelper.JSONObject) {
	LogDebug("user info result from json: ", props)
	p.id = props.GetAsInt64("id")
	p.accountStatus = props.GetAsString("AccountStatus")
	p.accountType = props.GetAsString("AccountType")
	p.fileSizeLimit = props.GetAsInt64("FileSizeLimit")
	p.name = props.GetAsString("Name")
	p.nickname = props.GetAsString("NickName")
	p.smugVault = props.GetAsBool("SmugVault")
	p.url = props.GetAsString("URL")
}
Example #3
0
func (p *User) InitFromJSONObject(obj jsonhelper.JSONObject) {
	p.PersistableModel.InitFromJSONObject(obj)
	p.Role = obj.GetAsInt32("role")
	p.Name = obj.GetAsString("name")
	p.Username = obj.GetAsString("username")
	p.Email = obj.GetAsString("email")
	p.PhoneNumber = obj.GetAsString("phone_number")
	p.Address = obj.GetAsString("address")
	p.ContactId = obj.GetAsString("contact_id")
	p.AllowLogin = obj.GetAsBool("allow_login")
	p.IsPayingUser = obj.GetAsBool("is_paying_user")
	p.Notes = obj.GetAsString("notes")
	p.DisableLoginAt = obj.GetAsInt64("disable_login_at")
}
Example #4
0
func (p *Consumer) InitFromJSONObject(obj jsonhelper.JSONObject) {
	p.PersistableModel.InitFromJSONObject(obj)
	p.DomainName = obj.GetAsString("domain_name")
	p.HomePage = obj.GetAsString("home_page")
	p.AuthorizationPage = obj.GetAsString("authorization_page")
	p.ShortName = obj.GetAsString("short_name")
	p.Name = obj.GetAsString("name")
	p.Email = obj.GetAsString("email")
	p.PhoneNumber = obj.GetAsString("phone_number")
	p.IsTrusted = obj.GetAsBool("is_trusted")
	p.IsSuggested = obj.GetAsBool("is_suggested")
	p.AllowLogin = obj.GetAsBool("allow_login")
	p.DisableLoginAt = obj.GetAsInt64("disable_login_at")
}
Example #5
0
func (p *yahooUserInfoEmail) FromJSON(props jsonhelper.JSONObject) {
	p.yahooUserInfoIm.FromJSON(props)
	p.isPrimary = props.GetAsBool("primary")
}