// GetUserinfoEmail retrieves the user's email from the
// https://www.googleapis.com/userinfo/email endpoint.
195905
func (apiutil *ClientUtil) GetUserinfoEmail() (GoogleUserinfoEmail, error) {
	resp, err := apiutil.Client.Get(GoogleAPIEmailURL)
	if err != nil {
		return GoogleUserinfoEmail{}, err
	}

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

	// parse user query string
	return ParseGoogleUserinfoEmail(string(bodyBytes))
}
1203708
func (u *UserEmail) GetEmail() string {
	if u == nil || u.Email == nil {
		return ""
	}
	return *u.Email
}
426177
func (api *Client) GetUserByEmail(email string) (*User, error) {
	return api.GetUserByEmailContext(context.Background(), email)
}
1122954
func callGetUserIdService(email string) (rest.ResponseDTOUserInfo, apihelper.ApiErrors, int) {

	// call api
	req, err := http.NewRequest("GET", userBaseUrl+"/email/"+email, nil)

	client := &http.Client{}
	resp, err := client.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	// read response
	body, _ := ioutil.ReadAll(resp.Body)

	userInfo := rest.ResponseDTOUserInfo{}
	apiErrors := apihelper.ApiErrors{}
	json.Unmarshal(body, &userInfo)
	json.Unmarshal(body, &apiErrors)

	return userInfo, apiErrors, resp.StatusCode
}
93200
func (auth *Auth) GetUserByEmail(ctx context.Context, email string) (*UserRecord, error) {
	users, err := auth.GetUsersByEmail(ctx, []string{email})
	if err != nil {
		return nil, err
	}
	if len(users) == 0 {
		return nil, ErrUserNotFound
	}
	return users[0], nil
}
845534
func (c *CreateOrgInvitationOptions) GetEmail() string {
	if c == nil || c.Email == nil {
		return ""
	}
	return *c.Email
}
547783
func NewUserInfo(AccountId string, Email string, DisplayName string, SameTeam bool) *UserInfo {
	s := new(UserInfo)
	s.AccountId = AccountId
	s.Email = Email
	s.DisplayName = DisplayName
	s.SameTeam = SameTeam
	return s
}
880614
func GetEmailAddresses(uid int64) ([]*EmailAddress, error) {
	emails := make([]*EmailAddress, 0, 5)
	if err := x.Where("uid=?", uid).Find(&emails); err != nil {
		return nil, err
	}

	u, err := GetUserByID(uid)
	if err != nil {
		return nil, err
	}

	isPrimaryFound := false
	for _, email := range emails {
		if email.Email == u.Email {
			isPrimaryFound = true
			email.IsPrimary = true
		} else {
			email.IsPrimary = false
		}
	}

	// We alway want the primary email address displayed, even if it's not in
	// the emailaddress table (yet).
	if !isPrimaryFound {
		emails = append(emails, &EmailAddress{
			Email:       u.Email,
			IsActivated: true,
			IsPrimary:   true,
		})
	}
	return emails, nil
}
475994
func (_m *FacadeInterface) GetUser(ctx datastore.Context, userName string) (user.User, error) {
	ret := _m.Called(ctx, userName)

	var r0 user.User
	if rf, ok := ret.Get(0).(func(datastore.Context, string) user.User); ok {
		r0 = rf(ctx, userName)
	} else {
		r0 = ret.Get(0).(user.User)
	}

	var r1 error
	if rf, ok := ret.Get(1).(func(datastore.Context, string) error); ok {
		r1 = rf(ctx, userName)
	} else {
		r1 = ret.Error(1)
	}

	return r0, r1
}
1303184
func (m *UserManager) GetByEmail(email string) (user User, err error) {
	stmt := Users.Select().Where(Users.C("email").Equals(email))
	if err = m.conn.Query(stmt, &user); err != nil {
		return
	}
	if !user.Exists() {
		err = fmt.Errorf("auth: no user with email %s exists", email)
	}
	return
}
389054
func (s *UserService) GetUser(p *GetUserParams) (*GetUserResponse, error) {
	resp, err := s.cs.newRequest("getUser", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r GetUserResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
205095
func (c *Cache) GetUser(name string) (user services.User, err error) {
	u, err := c.usersCache.GetUser(name)
	if trace.IsNotFound(err) {
		return c.Users.GetUser(name)
	}
	return u, err
}
331355
func (i *Invitation) GetEmail() string {
	if i == nil || i.Email == nil {
		return ""
	}
	return *i.Email
}
742927
func (api *Client) GetUserInfo(user string) (*User, error) {
	return api.GetUserInfoContext(context.Background(), user)
}
312528
func (p *PushEventRepoOwner) GetEmail() string {
	if p == nil || p.Email == nil {
		return ""
	}
	return *p.Email
}
1133043
func (c Conn) GetUserByEmail(email string) (User, string, error) {
	r, err := c.db.Query(USER_BY_EMAIL, email)
	if err != nil {
		return User{}, "", err
	}

	if r == nil {
		return User{}, "", nil
	}

	defer r.Close()

	var user User
	var hash string
	if r.Next() {
		if err := r.Scan(&user.Uuid, &user.Email, &user.Firstname, &user.Lastname, &user.CreationTime, &user.LastLogin, &hash); err != nil {
			return User{}, "", err
		}
	}
	return user, hash, nil
}
460749
func LoadUserEmails(m MetaContext) (emails []keybase1.Email, err error) {
	uid := m.G().GetMyUID()
	res, err := m.G().API.Get(m, APIArg{
		Endpoint:    "user/lookup",
		SessionType: APISessionTypeREQUIRED,
		Args: HTTPArgs{
			"uid": UIDArg(uid),
		},
	})
	if err != nil {
		return
	}

	emailPayloads, err := jsonhelpers.JSONGetChildren(res.Body.AtKey("them").AtKey("emails").AtKey("emails"))
	if err != nil {
		return nil, err
	}
	for _, emailPayload := range emailPayloads {
		email, err := emailPayload.AtKey("email").GetString()
		if err != nil {
			return nil, err
		}
		isPrimary, err := emailPayload.AtKey("is_primary").GetInt()
		if err != nil {
			return nil, err
		}
		isVerified, err := emailPayload.AtKey("is_verified").GetInt()
		if err != nil {
			return nil, err
		}
		visibilityCode, err := emailPayload.AtKey("visibility").GetInt()
		if err != nil {
			return nil, err
		}
		emails = append(emails, keybase1.Email{
			Email:      keybase1.EmailAddress(email),
			IsVerified: isVerified == 1,
			IsPrimary:  isPrimary == 1,
			Visibility: keybase1.IdentityVisibility(visibilityCode),
		})
	}

	return
}