CoursesAnnouncements
class CoursesAnnouncements extends Resource (View source)
The "announcements" collection of methods.
Typical usage is:
$classroomService = new Google\Service\Classroom(...);
$announcements = $classroomService->courses_announcements;
Methods
Creates an announcement. This method returns the following error codes:
PERMISSION_DENIED
if the requesting user is not permitted to access the
requested course, create announcements in the requested course, share a Drive
attachment, or for access errors. INVALID_ARGUMENT
if the request is
malformed. NOT_FOUND
if the requested course does not exist.
FAILED_PRECONDITION
for the following request error: * AttachmentNotVisible
(announcements.create)
Deletes an announcement. This request must be made by the Developer Console
project of the OAuth client
ID used to create the
corresponding announcement item. This method returns the following error
codes: PERMISSION_DENIED
if the requesting developer project did not
create the corresponding announcement, if the requesting user is not
permitted to delete the requested course or for access errors.
FAILED_PRECONDITION
if the requested announcement has already been deleted.
Returns an announcement. This method returns the following error codes:
PERMISSION_DENIED
if the requesting user is not permitted to access the
requested course or announcement, or for access errors. INVALID_ARGUMENT
if the request is malformed. * NOT_FOUND
if the requested course or
announcement does not exist. (announcements.get)
Gets metadata for Classroom add-ons in the context of a specific post. To
maintain the integrity of its own data and permissions model, an add-on
should call this to validate query parameters and the requesting user's role
whenever the add-on is opened in an
iframe. This method returns the following error
codes: PERMISSION_DENIED
for access errors. INVALID_ARGUMENT
if the
request is malformed. * NOT_FOUND
if one of the identified resources does
not exist. (announcements.getAddOnContext)
Returns a list of announcements that the requester is permitted to view.
Modifies assignee mode and options of an announcement. Only a teacher of the
course that contains the announcement may call this method. This method
returns the following error codes: PERMISSION_DENIED
if the requesting
user is not permitted to access the requested course or course work or for
access errors. INVALID_ARGUMENT
if the request is malformed. *
NOT_FOUND
if the requested course or course work does not exist.
Updates one or more fields of an announcement. This method returns the
following error codes: PERMISSION_DENIED
if the requesting developer
project did not create the corresponding announcement or for access errors.
INVALID_ARGUMENT
if the request is malformed. FAILED_PRECONDITION
if
the requested announcement has already been deleted. NOT_FOUND
if the
requested course or announcement does not exist (announcements.patch)
Details
Announcement
create(string $courseId, Announcement $postBody, array $optParams = [])
Creates an announcement. This method returns the following error codes:
PERMISSION_DENIED
if the requesting user is not permitted to access the
requested course, create announcements in the requested course, share a Drive
attachment, or for access errors. INVALID_ARGUMENT
if the request is
malformed. NOT_FOUND
if the requested course does not exist.
FAILED_PRECONDITION
for the following request error: * AttachmentNotVisible
(announcements.create)
ClassroomEmpty
delete(string $courseId, string $id, array $optParams = [])
Deletes an announcement. This request must be made by the Developer Console
project of the OAuth client
ID used to create the
corresponding announcement item. This method returns the following error
codes: PERMISSION_DENIED
if the requesting developer project did not
create the corresponding announcement, if the requesting user is not
permitted to delete the requested course or for access errors.
FAILED_PRECONDITION
if the requested announcement has already been deleted.
NOT_FOUND
if no course exists with the requested ID. (announcements.delete)
Announcement
get(string $courseId, string $id, array $optParams = [])
Returns an announcement. This method returns the following error codes:
PERMISSION_DENIED
if the requesting user is not permitted to access the
requested course or announcement, or for access errors. INVALID_ARGUMENT
if the request is malformed. * NOT_FOUND
if the requested course or
announcement does not exist. (announcements.get)
AddOnContext
getAddOnContext(string $courseId, string $itemId, array $optParams = [])
Gets metadata for Classroom add-ons in the context of a specific post. To
maintain the integrity of its own data and permissions model, an add-on
should call this to validate query parameters and the requesting user's role
whenever the add-on is opened in an
iframe. This method returns the following error
codes: PERMISSION_DENIED
for access errors. INVALID_ARGUMENT
if the
request is malformed. * NOT_FOUND
if one of the identified resources does
not exist. (announcements.getAddOnContext)
ListAnnouncementsResponse
listCoursesAnnouncements(string $courseId, array $optParams = [])
Returns a list of announcements that the requester is permitted to view.
Course students may only view PUBLISHED
announcements. Course teachers and
domain administrators may view all announcements. 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.
INVALID_ARGUMENT
if the request is malformed. * NOT_FOUND
if the
requested course does not exist. (announcements.listCoursesAnnouncements)
Announcement
modifyAssignees(string $courseId, string $id, ModifyAnnouncementAssigneesRequest $postBody, array $optParams = [])
Modifies assignee mode and options of an announcement. Only a teacher of the
course that contains the announcement may call this method. This method
returns the following error codes: PERMISSION_DENIED
if the requesting
user is not permitted to access the requested course or course work or for
access errors. INVALID_ARGUMENT
if the request is malformed. *
NOT_FOUND
if the requested course or course work does not exist.
(announcements.modifyAssignees)
Announcement
patch(string $courseId, string $id, Announcement $postBody, array $optParams = [])
Updates one or more fields of an announcement. This method returns the
following error codes: PERMISSION_DENIED
if the requesting developer
project did not create the corresponding announcement or for access errors.
INVALID_ARGUMENT
if the request is malformed. FAILED_PRECONDITION
if
the requested announcement has already been deleted. NOT_FOUND
if the
requested course or announcement does not exist (announcements.patch)