getGradingPeriodSettings method

Future<GradingPeriodSettings> getGradingPeriodSettings(
  1. String courseId, {
  2. String? $fields,
})

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.

Request parameters:

courseId - Required. The identifier of the course.

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

Completes with a GradingPeriodSettings.

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<GradingPeriodSettings> getGradingPeriodSettings(
  core.String courseId, {
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if ($fields != null) 'fields': [$fields],
  };

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

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