// GetUserinfo retrieves the userinfo from the
// https://graph.facebook.com/v2.9/{user-id}
// endpoint.
507123
func (apiutil *ClientUtil) GetUserinfo() (*AhaUserinfo, error) {
	resp, err := apiutil.Client.Get(APIMeURL)
	if err != nil {
		return nil, err
	} else if resp.StatusCode >= 300 {
		return nil, fmt.Errorf("Aha.io API returned Status Code %v", resp.StatusCode)
	}

	bodyBytes, err := hum.ResponseBody(resp)
	if err != nil {
		return nil, err
	}

	userinfo := AhaUserinfoWrap{}
	err = json.Unmarshal(bodyBytes, &userinfo)
	if err == nil {
		apiutil.User = userinfo.User
	}
	return userinfo.User, err
}
1008945
func GetUsersInfo(users []*nerdz.User) (usersInfo []*UserInfo) {
	for _, u := range users {
		usersInfo = append(usersInfo, GetUserInfo(u))
	}
	return
}
98324
func (c *ApiController) GetAccountInfo() {
	fmt.Println("Start get account info")

	//user := GithubOauthUser{Name:"tobe", HTMLURL: "https://github.com/tobegit3hub", Company: "UnitedStack Inc"}

	client := github.NewClient(oauthCfg.Client(oauth2.NoContext, tkn))

	user, _, err := client.Users.Get("")
	if err != nil {
		fmt.Println("error getting name")
		//return
	}

	/*
		{
		"login": "tobegit3hub",
		"id": 2715000,
		"avatar_url": "https://avatars.githubusercontent.com/u/2715000?v=3",
		"html_url": "https://github.com/tobegit3hub",
		"gravatar_id": "",
		"name": "tobe",
		"company": "UnitedStack Inc",
		"blog": "http://chendihao.cn",
		"location": "Beijing",
		"email": "tobeg3oogle@gmail.com",
		"hireable": false,
		"public_repos": 161,
		"public_gists": 1,
		"followers": 155,
		"following": 68,
		"created_at": "2012-11-03T13:17:18Z",
		"updated_at": "2015-08-04T19:01:39Z",
		"type": "User",
		"site_admin": false,
		"url": "https://api.github.com/users/tobegit3hub",
		"events_url": "https://api.github.com/users/tobegit3hub/events{/privacy}",
		"following_url": "https://api.github.com/users/tobegit3hub/following{/other_user}",
		"followers_url": "https://api.github.com/users/tobegit3hub/followers",
		"gists_url": "https://api.github.com/users/tobegit3hub/gists{/gist_id}",
		"organizations_url": "https://api.github.com/users/tobegit3hub/orgs",
		"received_events_url": "https://api.github.com/users/tobegit3hub/received_events",
		"repos_url": "https://api.github.com/users/tobegit3hub/repos",
		"starred_url": "https://api.github.com/users/tobegit3hub/starred{/owner}{/repo}",
		"subscriptions_url": "https://api.github.com/users/tobegit3hub/subscriptions"
		}
	*/

	c.Data["json"] = user
	c.ServeJson()

}
925785
func (c *Client) GetInfo() (*Info, error) {
	r := c.NewRequest("GET", "/v2/info")
	resp, err := c.DoRequest(r)
	if err != nil {
		return nil, errors.Wrap(err, "Error requesting info")
	}
	defer resp.Body.Close()
	var i Info
	err = json.NewDecoder(resp.Body).Decode(&i)
	if err != nil {
		return nil, errors.Wrap(err, "Error unmarshalling info")
	}
	return &i, nil
}
99026
func UserInfo(user, password string) Option {
	return func(o *Options) error {
		o.User = user
		o.Password = password
		return nil
	}
}
1077598
func (l *Client) GetUsers() ([]*AccountUser, error) {
	res := ApiResp{}
	data := []*AccountUser{}

	acct, err := l.GetAccount("current")
	if err != nil {
		// hm......
		return data, err
	}

	// make the request
	err = l.Get(userListEndpoint, nil, nil, &res, &data)
	if err != nil {
		return data, err
	}

	for _, user := range data {
		user.setup(&acct)
	}

	return data, nil
}
13996
func (apiutil *ClientUtil) GetUserinfo() (RingCentralExtensionInfo, error) {
	resp, err := apiutil.Client.Get(
		urlutil.JoinAbsolute(
			fmt.Sprintf("%v://", httputilmore.SchemeHTTPS), Hostname, MeURL))

	if err != nil {
		return RingCentralExtensionInfo{}, err
	}

	bodyBytes, err := httputilmore.ResponseBody(resp)
	if err != nil {
		return RingCentralExtensionInfo{}, err
	}

	userinfo := RingCentralExtensionInfo{}
	err = json.Unmarshal(bodyBytes, &userinfo)
	if err == nil {
		apiutil.User = userinfo
	}
	return userinfo, err
}
389279
func (auth *Auth) GetUsers(ctx context.Context, userIDs []string) ([]*UserRecord, error) {
	resp, err := auth.client.GetAccountInfo(&identitytoolkit.IdentitytoolkitRelyingpartyGetAccountInfoRequest{
		LocalId: userIDs,
	}).Context(ctx).Do()
	if err != nil {
		return nil, err
	}
	return toUserRecords(resp.Users), nil
}
892438
func (s *UsersService) Info(user string) *UsersInfoCall {
	var call UsersInfoCall
	call.service = s
	call.user = user
	return &call
}
451085
func (oauth *Oauth) GetUserInfo(accessToken, openID string) (result UserInfo, err error) {
	urlStr := fmt.Sprintf(userInfoURL, accessToken, openID)
	var response []byte
	response, err = util.HTTPGet(urlStr)
	if err != nil {
		return
	}
	err = json.Unmarshal(response, &result)
	if err != nil {
		return
	}
	if result.ErrCode != 0 {
		err = fmt.Errorf("GetUserInfo error : errcode=%v , errmsg=%v", result.ErrCode, result.ErrMsg)
		return
	}
	return
}
347463
func (c *Client) GetUserID(userID string, opts ...interface{}) (res UserID, err error) {
	path := fmt.Sprintf("/1/clusters/mapping/%s", userID)
	err = c.transport.Request(&res, http.MethodGet, path, nil, call.Read, opts...)
	return
}
989304
func (s *service) RetrieveUserInfoByUserId(userId uint) (resDTO rest.ResponseDTOUserInfo, error *servicehelper.Error) {
	entity, err := s.repo.FindByID(userId)
	if err != nil {
		return rest.ResponseDTOUserInfo{}, &servicehelper.Error{Detail: errors.New("no result found"), Code: servicehelper.NotFound}
	}
	return rest.ResponseDTOUserInfo{
		UserId: entity.ID,
		Email:  entity.Email,
	}, nil
}
366735
func (provider *GoogleProvider) GetUser(creds *common.Credentials) (common.User, error) {

	profileData, err := provider.Get(creds, googleEndpointProfile)

	if err != nil {
		return nil, err
	}

	// build user
	user := NewUser(profileData, creds, provider)

	return user, nil
}
562877
func (user *User) PersonalInfo() *PersonalInfo {
	return &PersonalInfo{
		Username:  user.Username,
		IsOnline:  user.Viewonline && user.Last.Add(time.Duration(5)*time.Minute).After(time.Now()),
		Nation:    user.Lang,
		Timezone:  user.Timezone,
		Name:      user.Name,
		Surname:   user.Surname,
		Gender:    user.Gender,
		Birthday:  user.BirthDate,
		Gravatar:  utils.Gravatar(user.Email),
		Interests: user.Interests(),
		Quotes:    strings.Split(user.Profile.Quotes, "\n"),
		Biography: user.Profile.Biography}
}
274629
func (conn *Connection) GetUser(username string, userData interface{},
	auth Auth) (string, error) {
	userDb := conn.SelectDB("_users", auth)
	namestring := "org.couchdb.user:" + username
	return userDb.Read(namestring, &userData, nil)
}
1222670
func extractUserInfo(ctx context.Context) (*raven.User, error) {
	m, err := token.ReadManagerFromContext(ctx)
	if err != nil {
		return nil, err
	}

	q := *m
	token := goajwt.ContextJWT(ctx)
	if token == nil {
		return nil, fmt.Errorf("no token found in context")
	}
	t, err := q.ParseToken(ctx, token.Raw)
	if err != nil {
		return nil, err
	}

	return &raven.User{
		Username: t.Username,
		Email:    t.Email,
		ID:       t.Subject,
	}, nil
}
602705
func (c *Client) GetUserInfo(schema string) (*UserInfo, error) {
	u := UserInfo{}

	req, err := http.NewRequest("GET", fmt.Sprintf("%s%s%s", c.APIBase, "/v1/identity/openidconnect/userinfo/?schema=", schema), nil)
	if err != nil {
		return &u, err
	}

	if err = c.SendWithAuth(req, &u); err != nil {
		return &u, err
	}

	return &u, nil
}