Liking cljdoc? Tell your friends :D

goog.workspace.classroom

Clojure wrapper for the Google Classroom API (v1).

Provides idiomatic Clojure functions for managing courses, course rosters (Students, Teachers), course work, announcements, and course aliases.

Auth: use csl/scoped-delegated-credentials or csl/user-credentials with the appropriate scope:

  • ClassroomScopes/CLASSROOM_COURSES (read/write courses)
  • ClassroomScopes/CLASSROOM_COURSES_READONLY
  • ClassroomScopes/CLASSROOM_ROSTERS (read/write rosters)
  • ClassroomScopes/CLASSROOM_ROSTERS_READONLY
  • ClassroomScopes/CLASSROOM_COURSEWORK_STUDENTS (read/write course work as teacher)
  • ClassroomScopes/CLASSROOM_COURSEWORK_ME (read/write course work as student)
  • ClassroomScopes/CLASSROOM_ANNOUNCEMENTS (read/write announcements)
  • ClassroomScopes/CLASSROOM_ANNOUNCEMENTS_READONLY
  • ClassroomScopes/CLASSROOM_PROFILE_EMAILS (read roster profile emails)

All list functions return {:data [...] :next-page-token "..."}. :next-page-token is absent when there are no further pages.

Update semantics: functions named update-* use PATCH (partial update); functions named replace-* use PUT (full replacement). The Classroom API only exposes PUT for Courses — CourseWork and Announcements are PATCH-only, so no replace-* exists for those resources.

All functions return {:data ...} on success or {:error ...} on failure.

Clojure wrapper for the Google Classroom API (v1).

Provides idiomatic Clojure functions for managing courses, course rosters
(Students, Teachers), course work, announcements, and course aliases.

Auth: use csl/scoped-delegated-credentials or csl/user-credentials with the
appropriate scope:
- ClassroomScopes/CLASSROOM_COURSES                  (read/write courses)
- ClassroomScopes/CLASSROOM_COURSES_READONLY
- ClassroomScopes/CLASSROOM_ROSTERS                  (read/write rosters)
- ClassroomScopes/CLASSROOM_ROSTERS_READONLY
- ClassroomScopes/CLASSROOM_COURSEWORK_STUDENTS      (read/write course work as teacher)
- ClassroomScopes/CLASSROOM_COURSEWORK_ME            (read/write course work as student)
- ClassroomScopes/CLASSROOM_ANNOUNCEMENTS            (read/write announcements)
- ClassroomScopes/CLASSROOM_ANNOUNCEMENTS_READONLY
- ClassroomScopes/CLASSROOM_PROFILE_EMAILS           (read roster profile emails)

All list functions return {:data [...] :next-page-token "..."}.
:next-page-token is absent when there are no further pages.

Update semantics: functions named update-* use PATCH (partial update);
functions named replace-* use PUT (full replacement). The Classroom API
only exposes PUT for Courses — CourseWork and Announcements are PATCH-only,
so no replace-* exists for those resources.

All functions return {:data ...} on success or {:error ...} on failure.
raw docstring

classroom-clientclj

(classroom-client credentials)
(classroom-client credentials opts)

Build an authenticated Classroom v1 REST client.

credentials — a com.google.auth.oauth2.GoogleCredentials instance, typically from csl/scoped-delegated-credentials or csl/user-credentials.

opts (optional):

  • :read-timeout-ms per-client default read timeout (default 120000 / 120s)
  • :connect-timeout-ms per-client default connect timeout (default 30000 / 30s)

Per-request opts on individual call sites override the client-level defaults.

Build an authenticated Classroom v1 REST client.

credentials — a com.google.auth.oauth2.GoogleCredentials instance, typically
from csl/scoped-delegated-credentials or csl/user-credentials.

opts (optional):
- :read-timeout-ms     per-client default read timeout (default 120000 / 120s)
- :connect-timeout-ms  per-client default connect timeout (default 30000 / 30s)

Per-request opts on individual call sites override the client-level defaults.
raw docstring

create-announcementclj

(create-announcement client course-id announcement & [opts])

Create an announcement on a course.

announcement — map with kebab-case keys. Required: :text — announcement body

Optional fields include :materials (vector of Material maps), :state ("PUBLISHED" default, or "DRAFT"), :scheduled-time.

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Create an announcement on a course.

announcement — map with kebab-case keys. Required:
  :text — announcement body

Optional fields include :materials (vector of Material maps),
:state ("PUBLISHED" default, or "DRAFT"), :scheduled-time.

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

create-courseclj

(create-course client course & [opts])

Create a new course.

course — map with kebab-case keys. Common fields: :name — required, the course name :section — optional section identifier :description — optional course description :room — optional room :owner-id — required, user ID of the course owner ("me" allowed)

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Create a new course.

course — map with kebab-case keys. Common fields:
  :name           — required, the course name
  :section        — optional section identifier
  :description    — optional course description
  :room           — optional room
  :owner-id       — required, user ID of the course owner ("me" allowed)

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

create-course-aliasclj

(create-course-alias client course-id course-alias & [opts])

Create an alias for a course.

course-alias — map with kebab-case keys. Required: :alias — alias string (must be prefixed with 'p:' for project-scoped, 'd:' for domain-scoped)

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Create an alias for a course.

course-alias — map with kebab-case keys. Required:
  :alias — alias string (must be prefixed with 'p:' for project-scoped,
           'd:' for domain-scoped)

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

create-course-workclj

(create-course-work client course-id course-work & [opts])

Create a course work item.

course-work — map with kebab-case keys. Common fields: :title — required :description — optional description / instructions :state — "PUBLISHED" (default) or "DRAFT" :work-type — "ASSIGNMENT" (default), "SHORT_ANSWER_QUESTION", "MULTIPLE_CHOICE_QUESTION" :due-date — {:year :month :day} (Date model) :due-time — {:hours :minutes :seconds :nanos} (TimeOfDay model) :materials — vector of Material maps (Drive files, links, YouTube videos) :max-points — numeric points for the assignment

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Create a course work item.

course-work — map with kebab-case keys. Common fields:
  :title         — required
  :description   — optional description / instructions
  :state         — "PUBLISHED" (default) or "DRAFT"
  :work-type     — "ASSIGNMENT" (default), "SHORT_ANSWER_QUESTION",
                   "MULTIPLE_CHOICE_QUESTION"
  :due-date      — {:year :month :day} (Date model)
  :due-time      — {:hours :minutes :seconds :nanos} (TimeOfDay model)
  :materials     — vector of Material maps (Drive files, links, YouTube videos)
  :max-points    — numeric points for the assignment

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

create-studentclj

(create-student client course-id student & [opts])

Enroll a student in a course.

student — map with kebab-case keys. Required: :user-id — user ID of the student to enroll ("me" for the authenticated user)

opts:

  • :enrollment-code — course enrollment code (required when calling as a student joining a course)
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Enroll a student in a course.

student — map with kebab-case keys. Required:
  :user-id — user ID of the student to enroll ("me" for the authenticated user)

opts:
- :enrollment-code — course enrollment code (required when calling as a student
                     joining a course)
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

create-teacherclj

(create-teacher client course-id teacher & [opts])

Add a teacher to a course.

teacher — map with kebab-case keys. Required: :user-id — user ID of the teacher

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Add a teacher to a course.

teacher — map with kebab-case keys. Required:
  :user-id — user ID of the teacher

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

delete-announcementclj

(delete-announcement client course-id announcement-id & [opts])

Delete an announcement.

opts:

  • :read-timeout-ms — int, override the HTTP client's default read timeout
Delete an announcement.

opts:
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

delete-courseclj

(delete-course client course-id & [opts])

Delete a course.

opts:

  • :read-timeout-ms — int, override the HTTP client's default read timeout
Delete a course.

opts:
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

delete-course-aliasclj

(delete-course-alias client course-id alias & [opts])

Delete an alias for a course.

opts:

  • :read-timeout-ms — int, override the HTTP client's default read timeout
Delete an alias for a course.

opts:
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

delete-course-workclj

(delete-course-work client course-id course-work-id & [opts])

Delete a course work item.

opts:

  • :read-timeout-ms — int, override the HTTP client's default read timeout
Delete a course work item.

opts:
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

delete-studentclj

(delete-student client course-id user-id & [opts])

Remove a student from a course.

opts:

  • :read-timeout-ms — int, override the HTTP client's default read timeout
Remove a student from a course.

opts:
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

delete-teacherclj

(delete-teacher client course-id user-id & [opts])

Remove a teacher from a course.

opts:

  • :read-timeout-ms — int, override the HTTP client's default read timeout
Remove a teacher from a course.

opts:
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

get-announcementclj

(get-announcement client course-id announcement-id & [opts])

Get a single announcement.

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Get a single announcement.

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

get-courseclj

(get-course client course-id & [opts])

Get a course by ID (or alias).

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Get a course by ID (or alias).

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

get-course-workclj

(get-course-work client course-id course-work-id & [opts])

Get a single course work item.

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Get a single course work item.

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

get-studentclj

(get-student client course-id user-id & [opts])

Get a student enrollment.

user-id — student's user ID ("me" for the authenticated user)

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Get a student enrollment.

user-id — student's user ID ("me" for the authenticated user)

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

get-teacherclj

(get-teacher client course-id user-id & [opts])

Get a teacher's record in a course.

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Get a teacher's record in a course.

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

list-announcementsclj

(list-announcements client course-id & [opts])

List announcements for a course.

opts:

  • :announcement-states — vector of state filters; keywords (:published, :draft, :deleted) coerce to SCREAMING_SNAKE; strings pass through
  • :order-by — sort expression (e.g. "updateTime desc")
  • :page-token — token from a previous response
  • :page-size — max items per page
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
List announcements for a course.

opts:
- :announcement-states — vector of state filters; keywords (:published, :draft,
                         :deleted) coerce to SCREAMING_SNAKE; strings pass through
- :order-by            — sort expression (e.g. "updateTime desc")
- :page-token          — token from a previous response
- :page-size           — max items per page
- :fields              — partial response field mask
- :read-timeout-ms     — int, override the HTTP client's default read timeout
raw docstring

list-course-aliasesclj

(list-course-aliases client course-id & [opts])

List aliases for a course. Aliases are alternative identifiers (e.g. a school district course number) that can be used in place of the numeric course ID.

opts:

  • :page-token — token from a previous response
  • :page-size — max aliases per page
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
List aliases for a course. Aliases are alternative identifiers (e.g. a school
district course number) that can be used in place of the numeric course ID.

opts:
- :page-token      — token from a previous response
- :page-size       — max aliases per page
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

list-course-workclj

(list-course-work client course-id & [opts])

List course work items for a course.

opts:

  • :course-work-states — vector of state filters; keywords (:published, :draft, :deleted) coerce to SCREAMING_SNAKE; strings pass through
  • :order-by — sort expression (e.g. "dueDate desc" or "updateTime")
  • :page-token — token from a previous response
  • :page-size — max items per page
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
List course work items for a course.

opts:
- :course-work-states — vector of state filters; keywords (:published, :draft,
                         :deleted) coerce to SCREAMING_SNAKE; strings pass through
- :order-by           — sort expression (e.g. "dueDate desc" or "updateTime")
- :page-token         — token from a previous response
- :page-size          — max items per page
- :fields             — partial response field mask
- :read-timeout-ms    — int, override the HTTP client's default read timeout
raw docstring

list-coursesclj

(list-courses client & [opts])

List courses visible to the authenticated user.

opts:

  • :teacher-id — restrict to courses where this user is a teacher
  • :student-id — restrict to courses where this user is a student
  • :course-states — vector of state filters; keywords (:active, :archived, :provisioned, :declined, :suspended) coerce to SCREAMING_SNAKE; strings pass through
  • :page-token — token from a previous response
  • :page-size — max courses per page
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
List courses visible to the authenticated user.

opts:
- :teacher-id      — restrict to courses where this user is a teacher
- :student-id      — restrict to courses where this user is a student
- :course-states   — vector of state filters; keywords (:active, :archived,
                     :provisioned, :declined, :suspended) coerce to
                     SCREAMING_SNAKE; strings pass through
- :page-token      — token from a previous response
- :page-size       — max courses per page
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

list-studentsclj

(list-students client course-id & [opts])

List students enrolled in a course.

opts:

  • :page-token — token from a previous response
  • :page-size — max students per page
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
List students enrolled in a course.

opts:
- :page-token      — token from a previous response
- :page-size       — max students per page
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

list-teachersclj

(list-teachers client course-id & [opts])

List teachers of a course.

opts:

  • :page-token — token from a previous response
  • :page-size — max teachers per page
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
List teachers of a course.

opts:
- :page-token      — token from a previous response
- :page-size       — max teachers per page
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

replace-courseclj

(replace-course client course-id course & [opts])

Fully replace a course (PUT semantics). The entire course resource is replaced with the provided data; omitted fields are cleared.

opts:

  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Fully replace a course (PUT semantics). The entire course resource is
replaced with the provided data; omitted fields are cleared.

opts:
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

update-announcementclj

(update-announcement client course-id announcement-id announcement & [opts])

Partially update an announcement (PATCH semantics). The Classroom API does not expose PUT for Announcement — there is no replace-announcement.

opts:

  • :update-mask — comma-separated list of field paths to update (allowed: text, state, scheduled_time)
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Partially update an announcement (PATCH semantics). The Classroom API does
not expose PUT for Announcement — there is no replace-announcement.

opts:
- :update-mask     — comma-separated list of field paths to update
                     (allowed: text, state, scheduled_time)
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

update-courseclj

(update-course client course-id course & [opts])

Partially update a course (PATCH semantics). Only the fields listed in :update-mask (or, if omitted, the fields present in the course map) are modified.

opts:

  • :update-mask — comma-separated list of field paths to update (FieldMask)
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Partially update a course (PATCH semantics). Only the fields listed in
:update-mask (or, if omitted, the fields present in the course map) are
modified.

opts:
- :update-mask     — comma-separated list of field paths to update (FieldMask)
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

update-course-workclj

(update-course-work client course-id course-work-id course-work & [opts])

Partially update a course work item (PATCH semantics). The Classroom API does not expose PUT for CourseWork — there is no replace-course-work.

opts:

  • :update-mask — comma-separated list of field paths to update (allowed: title, description, state, due_date, due_time, max_points, scheduled_time, submission_modification_mode, topic_id)
  • :fields — partial response field mask
  • :read-timeout-ms — int, override the HTTP client's default read timeout
Partially update a course work item (PATCH semantics). The Classroom API
does not expose PUT for CourseWork — there is no replace-course-work.

opts:
- :update-mask     — comma-separated list of field paths to update
                     (allowed: title, description, state, due_date, due_time,
                     max_points, scheduled_time, submission_modification_mode,
                     topic_id)
- :fields          — partial response field mask
- :read-timeout-ms — int, override the HTTP client's default read timeout
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close