list method
Returns a list of student submissions that the requester is permitted to view.
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.
Request parameters:
courseId - Required. Identifier of the course.
itemId - Required. Identifier of the CourseWork under which the
attachment is attached.
attachmentId - Required. Identifier of the add-on attachment.
pageSize - Optional. Maximum number of submissions to return. Zero or
unspecified indicates that the server may assign a maximum. The server may
return fewer than the specified number of results.
pageToken - Optional. A page token, received from a previous
ListAddOnAttachmentStudentSubmissions call. Provide this to retrieve the
subsequent page. When paginating, all other parameters provided to
ListAddOnAttachmentStudentSubmissions must match the call that provided
the page token.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ListAddOnAttachmentStudentSubmissionsResponse.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<ListAddOnAttachmentStudentSubmissionsResponse> list(
core.String courseId,
core.String itemId,
core.String attachmentId, {
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v1/courses/' +
commons.escapeVariable('$courseId') +
'/courseWork/' +
commons.escapeVariable('$itemId') +
'/addOnAttachments/' +
commons.escapeVariable('$attachmentId') +
'/studentSubmissions';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ListAddOnAttachmentStudentSubmissionsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}