patch method

Future<StudentGroup> patch(
  1. StudentGroup request,
  2. String courseId,
  3. String id, {
  4. String? updateMask,
  5. String? $fields,
})

Updates one or more fields in a student group.

This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to modify the requested student group or for access errors. * NOT_FOUND if the student group does not exist or the user does not have access to the student group. * INVALID_ARGUMENT if invalid fields are specified in the update mask or if no update mask is supplied.

request - The metadata request object.

Request parameters:

courseId - Required. Identifier of the course.

id - Required. Identifier of the student group.

updateMask - Required. Mask that identifies which fields on the student group to update. This field is required to do an update. The update fails if invalid fields are specified. The following fields can be specified by teachers: * title

$fields - Selector specifying which fields to include in a partial response.

Completes with a StudentGroup.

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<StudentGroup> patch(
  StudentGroup request,
  core.String courseId,
  core.String id, {
  core.String? updateMask,
  core.String? $fields,
}) async {
  final body_ = convert.json.encode(request);
  final queryParams_ = <core.String, core.List<core.String>>{
    'updateMask': ?updateMask == null ? null : [updateMask],
    'fields': ?$fields == null ? null : [$fields],
  };

  final url_ =
      'v1/courses/' +
      commons.escapeVariable('$courseId') +
      '/studentGroups/' +
      commons.escapeVariable('$id');

  final response_ = await _requester.request(
    url_,
    'PATCH',
    body: body_,
    queryParams: queryParams_,
  );
  return StudentGroup.fromJson(
    response_ as core.Map<core.String, core.dynamic>,
  );
}