gws-classroom

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

classroom (v1)

classroom (v1)

PREREQUISITE: Read
../gws-shared/SKILL.md
for auth, global flags, and security rules. If missing, run
gws generate-skills
to create it.
bash
gws classroom <resource> <method> [flags]
前置要求: 阅读
../gws-shared/SKILL.md
了解认证、全局标志和安全规则。如果该文件缺失,请运行
gws generate-skills
创建它。
bash
gws classroom <resource> <method> [flags]

API Resources

API资源

courses

courses

  • create
    — Creates a course. The user specified in
    ownerId
    is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the owner. Domain admins can create courses owned by any user within their domain. This method returns the following error codes: *
    PERMISSION_DENIED
    if the requesting user is not permitted to create courses or for access errors. *
    NOT_FOUND
    if the primary teacher is not a valid user.
    • delete
      — Deletes a course. This method returns the following error codes: *
      PERMISSION_DENIED
      if the requesting user is not permitted to delete the requested course or for access errors. *
      NOT_FOUND
      if no course exists with the requested ID.
    • get
      — Returns a course. This method returns the following error codes: *
      PERMISSION_DENIED
      if the requesting user is not permitted to access the requested course or for access errors. *
      NOT_FOUND
      if no course exists with the requested ID.
    • getGradingPeriodSettings
      — Returns the grading period settings in a course. This method returns the following error codes: *
      PERMISSION_DENIED
      if the requesting user isn't permitted to access the grading period settings in the requested course or for access errors. *
      NOT_FOUND
      if the requested course does not exist.
    • list
      — Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation time, with the most recently created coming first. This method returns the following error codes: *
      PERMISSION_DENIED
      for access errors. *
      INVALID_ARGUMENT
      if the query argument is malformed. *
      NOT_FOUND
      if any users specified in the query arguments do not exist.
    • patch
      — Updates one or more fields in a course. This method returns the following error codes: *
      PERMISSION_DENIED
      if the requesting user is not permitted to modify the requested course or for access errors. *
      NOT_FOUND
      if no course exists with the requested ID. *
      INVALID_ARGUMENT
      if invalid fields are specified in the update mask or if no update mask is supplied.
    • update
      — Updates a course. This method returns the following error codes: *
      PERMISSION_DENIED
      if the requesting user is not permitted to modify the requested course or for access errors. *
      NOT_FOUND
      if no course exists with the requested ID. *
      FAILED_PRECONDITION
      for the following request errors: * CourseNotModifiable * CourseTitleCannotContainUrl
    • updateGradingPeriodSettings
      — Updates grading period settings of a course. Individual grading periods can be added, removed, or modified using this method. The requesting user and course owner must be eligible to modify Grading Periods. For details, see licensing requirements.
    • aliases
      — Operations on the 'aliases' resource
    • announcements
      — Operations on the 'announcements' resource
    • courseWork
      — Operations on the 'courseWork' resource
    • courseWorkMaterials
      — Operations on the 'courseWorkMaterials' resource
    • posts
      — Operations on the 'posts' resource
    • studentGroups
      — Operations on the 'studentGroups' resource
    • students
      — Operations on the 'students' resource
    • teachers
      — Operations on the 'teachers' resource
    • topics
      — Operations on the 'topics' resource
  • create
    — 创建一门课程。
    ownerId
    中指定的用户是创建课程的所有者,并会被添加为教师。非管理员请求用户只能创建以自己为所有者的课程。域管理员可以创建以域内任何用户为所有者的课程。此方法返回以下错误代码:*
    PERMISSION_DENIED
    (如果请求用户无权创建课程或存在访问错误)。*
    NOT_FOUND
    (如果指定的主教师不是有效用户)。
    • delete
      — 删除一门课程。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (如果请求用户无权删除指定课程或存在访问错误)。*
      NOT_FOUND
      (如果不存在具有指定ID的课程)。
    • get
      — 返回一门课程的信息。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (如果请求用户无权访问指定课程或存在访问错误)。*
      NOT_FOUND
      (如果不存在具有指定ID的课程)。
    • getGradingPeriodSettings
      — 返回课程中的评分周期设置。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (如果请求用户无权访问指定课程的评分周期设置或存在访问错误)。*
      NOT_FOUND
      (如果指定的课程不存在)。
    • list
      — 返回请求用户有权查看的课程列表,结果会根据请求条件筛选。返回的课程按创建时间排序,最新创建的排在最前面。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (存在访问错误)。*
      INVALID_ARGUMENT
      (如果查询参数格式错误)。*
      NOT_FOUND
      (如果查询参数中指定的任何用户不存在)。
    • patch
      — 更新课程中的一个或多个字段。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (如果请求用户无权修改指定课程或存在访问错误)。*
      NOT_FOUND
      (如果不存在具有指定ID的课程)。*
      INVALID_ARGUMENT
      (如果在更新掩码中指定了无效字段,或者未提供更新掩码)。
    • update
      — 更新一门课程。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (如果请求用户无权修改指定课程或存在访问错误)。*
      NOT_FOUND
      (如果不存在具有指定ID的课程)。*
      FAILED_PRECONDITION
      (以下请求错误时触发):* CourseNotModifiable(课程不可修改)* CourseTitleCannotContainUrl(课程标题不能包含链接)
    • updateGradingPeriodSettings
      — 更新课程的评分周期设置。使用此方法可以添加、删除或修改单个评分周期。请求用户和课程所有者必须有资格修改评分周期。有关详情,请参阅许可要求
    • aliases
      — 对'aliases'资源的操作
    • announcements
      — 对'announcements'资源的操作
    • courseWork
      — 对'courseWork'资源的操作
    • courseWorkMaterials
      — 对'courseWorkMaterials'资源的操作
    • posts
      — 对'posts'资源的操作
    • studentGroups
      — 对'studentGroups'资源的操作
    • students
      — 对'students'资源的操作
    • teachers
      — 对'teachers'资源的操作
    • topics
      — 对'topics'资源的操作

invitations

邀请(invitations)

  • accept
    — Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: *
    PERMISSION_DENIED
    if the requesting user is not permitted to accept the requested invitation or for access errors.
    • create
      — Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: *
      PERMISSION_DENIED
      if the requesting user is not permitted to create invitations for this course or for access errors. *
      NOT_FOUND
      if the course or the user does not exist. *
      FAILED_PRECONDITION
      : * if the requested user's account is disabled.
    • delete
      — Deletes an invitation. This method returns the following error codes: *
      PERMISSION_DENIED
      if the requesting user is not permitted to delete the requested invitation or for access errors. *
      NOT_FOUND
      if no invitation exists with the requested ID.
    • get
      — Returns an invitation. This method returns the following error codes: *
      PERMISSION_DENIED
      if the requesting user is not permitted to view the requested invitation or for access errors. *
      NOT_FOUND
      if no invitation exists with the requested ID.
    • list
      — Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. Note: At least one of
      user_id
      or
      course_id
      must be supplied. Both fields can be supplied. This method returns the following error codes: *
      PERMISSION_DENIED
      for access errors.
  • accept
    — 接受邀请,移除该邀请并将被邀请用户添加到指定课程的教师或学生列表(根据邀请类型)。只有被邀请用户可以接受邀请。此方法返回以下错误代码:*
    PERMISSION_DENIED
    (如果请求用户无权接受指定邀请或存在访问错误)。
    • create
      — 创建一个邀请。同一用户和同一课程只能存在一个邀请。如需修改,请先删除再重新创建邀请。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (如果请求用户无权为此课程创建邀请或存在访问错误)。*
      NOT_FOUND
      (如果课程或用户不存在)。*
      FAILED_PRECONDITION
      :* 如果请求用户的账户已被禁用。
    • delete
      — 删除一个邀请。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (如果请求用户无权删除指定邀请或存在访问错误)。*
      NOT_FOUND
      (如果不存在具有指定ID的邀请)。
    • get
      — 返回一个邀请的信息。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (如果请求用户无权查看指定邀请或存在访问错误)。*
      NOT_FOUND
      (如果不存在具有指定ID的邀请)。
    • list
      — 返回请求用户有权查看的邀请列表,结果会根据请求条件筛选。注意: 必须提供
      user_id
      course_id
      中的至少一个,也可以同时提供两者。此方法返回以下错误代码:*
      PERMISSION_DENIED
      (存在访问错误)。

registrations

注册(registrations)

  • create
    — Creates a
    Registration
    , causing Classroom to start sending notifications from the provided
    feed
    to the destination provided in
    cloudPubSubTopic
    . Returns the created
    Registration
    . Currently, this will be the same as the argument, but with server-assigned fields such as
    expiry_time
    and
    id
    filled in. Note that any value specified for the
    expiry_time
    or
    id
    fields will be ignored.
    • delete
      — Deletes a
      Registration
      , causing Classroom to stop sending notifications for that
      Registration
      .
  • create
    — 创建一个
    Registration
    ,使Classroom开始从提供的
    feed
    cloudPubSubTopic
    中指定的目标发送通知。返回创建的
    Registration
    。目前,返回的内容将与参数相同,但会填充服务器分配的字段,如
    expiry_time
    id
    。请注意,为
    expiry_time
    id
    字段指定的任何值都将被忽略。
    • delete
      — 删除一个
      Registration
      ,使Classroom停止为该
      Registration
      发送通知。

userProfiles

用户资料(userProfiles)

  • get
    — Returns a user profile. This method returns the following error codes: *
    PERMISSION_DENIED
    if the requesting user is not permitted to access this user profile, if no profile exists with the requested ID, or for access errors.
    • guardianInvitations
      — Operations on the 'guardianInvitations' resource
    • guardians
      — Operations on the 'guardians' resource
  • get
    — 返回用户资料。此方法返回以下错误代码:*
    PERMISSION_DENIED
    (如果请求用户无权访问该用户资料、不存在具有指定ID的资料,或存在访问错误)。
    • guardianInvitations
      — 对'guardianInvitations'资源的操作
    • guardians
      — 对'guardians'资源的操作

Discovering Commands

命令探索

Before calling any API method, inspect it:
bash
undefined
在调用任何API方法之前,请先查看其详情:
bash
undefined

Browse resources and methods

浏览资源和方法

gws classroom --help
gws classroom --help

Inspect a method's required params, types, and defaults

查看方法的必填参数、类型和默认值

gws schema classroom.<resource>.<method>

Use `gws schema` output to build your `--params` and `--json` flags.
gws schema classroom.<resource>.<method>

使用`gws schema`的输出来构建你的`--params`和`--json`标志。