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

Method ListClassrooms

github/classroom.go:159–177  ·  view source on GitHub ↗

ListClassrooms lists GitHub Classrooms for the current user. Classrooms will only be returned if the current user is an administrator of one or more GitHub Classrooms. GitHub API docs: https://docs.github.com/rest/classroom/classroom?apiVersion=2022-11-28#list-classrooms meta:operation GET /classr

(ctx context.Context, opts *ListOptions)

Source from the content-addressed store, hash-verified

157//
158//meta:operation GET /classrooms
159func (s *ClassroomService) ListClassrooms(ctx context.Context, opts *ListOptions) ([]*Classroom, *Response, error) {
160 u, err := addOptions("classrooms", opts)
161 if err != nil {
162 return nil, nil, err
163 }
164
165 req, err := s.client.NewRequest(ctx, "GET", u, nil)
166 if err != nil {
167 return nil, nil, err
168 }
169
170 var classrooms []*Classroom
171 resp, err := s.client.Do(req, &classrooms)
172 if err != nil {
173 return nil, resp, err
174 }
175
176 return classrooms, resp, nil
177}
178
179// ListClassroomAssignments lists GitHub Classroom assignments for a classroom. Assignments will only be
180// returned if the current user is an administrator of the GitHub Classroom.

Callers 2

ListClassroomsIterMethod · 0.95

Calls 3

addOptionsFunction · 0.85
NewRequestMethod · 0.80
DoMethod · 0.45

Tested by 1