class CoursesCourseWorkMaterials extends Resource (View source)

The "courseWorkMaterials" collection of methods.

Typical usage is:

 $classroomService = new Google\Service\Classroom(...);
 $courseWorkMaterials = $classroomService->courses_courseWorkMaterials;

Methods

create(string $courseId, CourseWorkMaterial $postBody, array $optParams = [])

Creates a course work material. This method returns the following error codes: PERMISSION_DENIED if the requesting user is not permitted to access the requested course, create course work material in the requested course, share a Drive attachment, or for access errors. INVALID_ARGUMENT if the request is malformed or if more than 20 materials are provided. NOT_FOUND if the requested course does not exist. FAILED_PRECONDITION for the following request error: AttachmentNotVisible (courseWorkMaterials.create)

delete(string $courseId, string $id, array $optParams = [])

Deletes a course work material. This request must be made by the Developer Console project of the OAuth client ID used to create the corresponding course work material item. This method returns the following error codes: PERMISSION_DENIED if the requesting developer project did not create the corresponding course work material, if the requesting user is not permitted to delete the requested course or for access errors. FAILED_PRECONDITION if the requested course work material has already been deleted. * NOT_FOUND if no course exists with the requested ID.

get(string $courseId, string $id, array $optParams = [])

Returns a course work material. This method returns the following error codes: PERMISSION_DENIED if the requesting user is not permitted to access the requested course or course work material, or for access errors. INVALID_ARGUMENT if the request is malformed. * NOT_FOUND if the requested course or course work material does not exist.

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. (courseWorkMaterials.getAddOnContext)

listCoursesCourseWorkMaterials(string $courseId, array $optParams = [])

Returns a list of course work material that the requester is permitted to view. Course students may only view PUBLISHED course work material. Course teachers and domain administrators may view all course work material. 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.

patch(string $courseId, string $id, CourseWorkMaterial $postBody, array $optParams = [])

Updates one or more fields of a course work material. This method returns the following error codes: PERMISSION_DENIED if the requesting developer project for access errors. INVALID_ARGUMENT if the request is malformed.

Details

CourseWorkMaterial create(string $courseId, CourseWorkMaterial $postBody, array $optParams = [])

Creates a course work material. This method returns the following error codes: PERMISSION_DENIED if the requesting user is not permitted to access the requested course, create course work material in the requested course, share a Drive attachment, or for access errors. INVALID_ARGUMENT if the request is malformed or if more than 20 materials are provided. NOT_FOUND if the requested course does not exist. FAILED_PRECONDITION for the following request error: AttachmentNotVisible (courseWorkMaterials.create)

Parameters

string $courseId

Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.

CourseWorkMaterial $postBody
array $optParams

Optional parameters.

Return Value

CourseWorkMaterial

Exceptions

Exception

ClassroomEmpty delete(string $courseId, string $id, array $optParams = [])

Deletes a course work material. This request must be made by the Developer Console project of the OAuth client ID used to create the corresponding course work material item. This method returns the following error codes: PERMISSION_DENIED if the requesting developer project did not create the corresponding course work material, if the requesting user is not permitted to delete the requested course or for access errors. FAILED_PRECONDITION if the requested course work material has already been deleted. * NOT_FOUND if no course exists with the requested ID.

(courseWorkMaterials.delete)

Parameters

string $courseId

Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.

string $id

Identifier of the course work material to delete. This identifier is a Classroom-assigned identifier.

array $optParams

Optional parameters.

Return Value

ClassroomEmpty

Exceptions

Exception

CourseWorkMaterial get(string $courseId, string $id, array $optParams = [])

Returns a course work material. This method returns the following error codes: PERMISSION_DENIED if the requesting user is not permitted to access the requested course or course work material, or for access errors. INVALID_ARGUMENT if the request is malformed. * NOT_FOUND if the requested course or course work material does not exist.

(courseWorkMaterials.get)

Parameters

string $courseId

Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.

string $id

Identifier of the course work material.

array $optParams

Optional parameters.

Return Value

CourseWorkMaterial

Exceptions

Exception

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. (courseWorkMaterials.getAddOnContext)

Parameters

string $courseId

Required. Identifier of the course.

string $itemId

Identifier of the announcement, courseWork, or courseWorkMaterial under which the attachment is attached. This field is required, but is not marked as such while we are migrating from post_id.

array $optParams

Optional parameters.

Return Value

AddOnContext

Exceptions

Exception

ListCourseWorkMaterialResponse listCoursesCourseWorkMaterials(string $courseId, array $optParams = [])

Returns a list of course work material that the requester is permitted to view. Course students may only view PUBLISHED course work material. Course teachers and domain administrators may view all course work material. 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.

(courseWorkMaterials.listCoursesCourseWorkMaterials)

Parameters

string $courseId

Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.

array $optParams

Optional parameters.

Return Value

ListCourseWorkMaterialResponse

Exceptions

Exception

CourseWorkMaterial patch(string $courseId, string $id, CourseWorkMaterial $postBody, array $optParams = [])

Updates one or more fields of a course work material. This method returns the following error codes: PERMISSION_DENIED if the requesting developer project for access errors. INVALID_ARGUMENT if the request is malformed.

  • FAILED_PRECONDITION if the requested course work material has already been deleted. * NOT_FOUND if the requested course or course work material does not exist (courseWorkMaterials.patch)

Parameters

string $courseId

Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias.

string $id

Identifier of the course work material.

CourseWorkMaterial $postBody
array $optParams

Optional parameters.

Return Value

CourseWorkMaterial

Exceptions

Exception