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

Method IsBlocked

github/users_blocking.go:46–59  ·  view source on GitHub ↗

IsBlocked reports whether specified user is blocked by the authenticated user. GitHub API docs: https://docs.github.com/rest/users/blocking?apiVersion=2022-11-28#check-if-a-user-is-blocked-by-the-authenticated-user meta:operation GET /user/blocks/{username}

(ctx context.Context, user string)

Source from the content-addressed store, hash-verified

44//
45//meta:operation GET /user/blocks/{username}
46func (s *UsersService) IsBlocked(ctx context.Context, user string) (bool, *Response, error) {
47 u := fmt.Sprintf("user/blocks/%v", user)
48
49 req, err := s.client.NewRequest(ctx, "GET", u, nil)
50 if err != nil {
51 return false, nil, err
52 }
53
54 req.Header.Set("Accept", mediaTypeBlockUsersPreview)
55
56 resp, err := s.client.Do(req, nil)
57 isBlocked, err := parseBoolResponse(err)
58 return isBlocked, resp, err
59}
60
61// BlockUser blocks specified user for the authenticated user.
62//

Callers 2

Calls 3

parseBoolResponseFunction · 0.85
NewRequestMethod · 0.80
DoMethod · 0.45

Tested by 2