MCPcopy Index your code
hub / github.com/google/go-github / AddEmails

Method AddEmails

github/users_emails.go:49–63  ·  view source on GitHub ↗

AddEmails adds email addresses of the authenticated user. GitHub API docs: https://docs.github.com/rest/users/emails?apiVersion=2022-11-28#add-an-email-address-for-the-authenticated-user meta:operation POST /user/emails

(ctx context.Context, emails []string)

Source from the content-addressed store, hash-verified

47//
48//meta:operation POST /user/emails
49func (s *UsersService) AddEmails(ctx context.Context, emails []string) ([]*UserEmail, *Response, error) {
50 u := "user/emails"
51 req, err := s.client.NewRequest(ctx, "POST", u, emails)
52 if err != nil {
53 return nil, nil, err
54 }
55
56 var e []*UserEmail
57 resp, err := s.client.Do(req, &e)
58 if err != nil {
59 return nil, resp, err
60 }
61
62 return e, resp, nil
63}
64
65// DeleteEmails deletes email addresses from authenticated user.
66//

Callers 2

TestUsers_EmailsFunction · 0.80

Calls 2

NewRequestMethod · 0.80
DoMethod · 0.45

Tested by 2

TestUsers_EmailsFunction · 0.64