Class: Google::Apis::ClassroomV1beta1::ClassroomService

Inherits:
Google::Apis::Core::BaseService show all
Defined in:
generated/google/apis/classroom_v1beta1/service.rb

Overview

Google Classroom API

Google Classroom API

Examples:

require 'google/apis/classroom_v1beta1'

Classroom = Google::Apis::ClassroomV1beta1 # Alias the module
service = Classroom::ClassroomService.new

See Also:

Instance Attribute Summary collapse

Attributes inherited from Google::Apis::Core::BaseService

#authorization, #base_path, #batch_path, #client, #client_options, #request_options, #root_url, #upload_path

Instance Method Summary collapse

Methods inherited from Google::Apis::Core::BaseService

#batch, #batch_upload, #fetch_all, #http

Constructor Details

#initializeClassroomService

Returns a new instance of ClassroomService.



45
46
47
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 45

def initialize
  super('https://classroom.googleapis.com/', '')
end

Instance Attribute Details

#keyString

Returns API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.

Returns:

  • (String)

    API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.



38
39
40
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 38

def key
  @key
end

#quota_userString

Returns Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

Returns:

  • (String)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.



43
44
45
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 43

def quota_user
  @quota_user
end

Instance Method Details

#create_course(course_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Course

Creates a course. The user specified as the primary teacher in primary_teacher_id is the owner of the created course and added as a teacher. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to create courses. * NOT_FOUND if the primary teacher is not a valid user. * ALREADY_EXISTS if an alias was specified and already exists.

Parameters:

  • course_object (Google::Apis::ClassroomV1beta1::Course) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



73
74
75
76
77
78
79
80
81
82
83
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 73

def create_course(course_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses'
  command =  make_simple_command(:post, path, options)
  command.request_representation = Google::Apis::ClassroomV1beta1::Course::Representation
  command.request_object = course_object
  command.response_representation = Google::Apis::ClassroomV1beta1::Course::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Course
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_course_alias(course_id, course_alias_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::CourseAlias

Creates an alias to a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to create the alias. * NOT_FOUND if the course does not exist. * ALREADY_EXISTS if the alias already exists.

Parameters:

  • course_id (String)

    The identifier of the course to alias. This may either be the Classroom- assigned identifier or an [alias][google.classroom.v1beta1.CourseAlias].

  • course_alias_object (Google::Apis::ClassroomV1beta1::CourseAlias) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



316
317
318
319
320
321
322
323
324
325
326
327
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 316

def create_course_alias(course_id, course_alias_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/aliases'
  command =  make_simple_command(:post, path, options)
  command.request_representation = Google::Apis::ClassroomV1beta1::CourseAlias::Representation
  command.request_object = course_alias_object
  command.response_representation = Google::Apis::ClassroomV1beta1::CourseAlias::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::CourseAlias
  command.params['courseId'] = course_id unless course_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_course_student(course_id, student_object = nil, enrollment_code: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Student

Adds a user as a student of a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to create students in this course. * NOT_FOUND if the requested course ID does not exist. * ALREADY_EXISTS if the user is already a student or student in the course.

Parameters:

  • course_id (String)

    Identifier of the course to create the student in. This may either be the Classroom-assigned identifier or an alias.

  • student_object (Google::Apis::ClassroomV1beta1::Student) (defaults to: nil)
  • enrollment_code (String) (defaults to: nil)

    Enrollment code of the course to create the student in. This is required if [ userId][google.classroom.v1beta1.Student.user_id] corresponds to the requesting user; this may be omitted if the requesting user has administrative permissions to create students for any user.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



609
610
611
612
613
614
615
616
617
618
619
620
621
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 609

def create_course_student(course_id, student_object = nil, enrollment_code: nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/students'
  command =  make_simple_command(:post, path, options)
  command.request_representation = Google::Apis::ClassroomV1beta1::Student::Representation
  command.request_object = student_object
  command.response_representation = Google::Apis::ClassroomV1beta1::Student::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Student
  command.params['courseId'] = course_id unless course_id.nil?
  command.query['enrollmentCode'] = enrollment_code unless enrollment_code.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#create_course_teacher(course_id, teacher_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Teacher

Creates a teacher of a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to create teachers in this course. * NOT_FOUND if the requested course ID does not exist. * ALREADY_EXISTS if the user is already a teacher or student in the course.

Parameters:

  • course_id (String)

    Unique identifier of the course. This may either be the Classroom-assigned identifier or an alias.

  • teacher_object (Google::Apis::ClassroomV1beta1::Teacher) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



440
441
442
443
444
445
446
447
448
449
450
451
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 440

def create_course_teacher(course_id, teacher_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/teachers'
  command =  make_simple_command(:post, path, options)
  command.request_representation = Google::Apis::ClassroomV1beta1::Teacher::Representation
  command.request_object = teacher_object
  command.response_representation = Google::Apis::ClassroomV1beta1::Teacher::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Teacher
  command.params['courseId'] = course_id unless course_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_course(id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Empty

Deletes a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to delete the requested course. * NOT_FOUND if no course exists with the requested ID.

Parameters:

  • id (String)

    Identifier of the course to delete. This may either be the Classroom-assigned identifier or an [alias][google.classroom.v1beta1.CourseAlias].

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



225
226
227
228
229
230
231
232
233
234
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 225

def delete_course(id, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{id}'
  command =  make_simple_command(:delete, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::Empty::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Empty
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_course_alias(course_id, alias_, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Empty

Deletes an alias of a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to remove the alias. * NOT_FOUND if the alias does not exist.

Parameters:

  • course_id (String)

    The identifier of the course whose alias should be deleted. This may either be the Classroom-assigned identifier or an [alias][google.classroom.v1beta1. CourseAlias].

  • alias_ (String)

    The alias to delete. This may not be the Classroom-assigned identifier.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



355
356
357
358
359
360
361
362
363
364
365
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 355

def delete_course_alias(course_id, alias_, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/aliases/{alias}'
  command =  make_simple_command(:delete, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::Empty::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Empty
  command.params['courseId'] = course_id unless course_id.nil?
  command.params['alias'] = alias_ unless alias_.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_course_student(course_id, user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Empty

Deletes a student of a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to delete students of this course. * NOT_FOUND if no student of this course has the requested ID or if the course does not exist.

Parameters:

  • course_id (String)

    Unique identifier of the course. This may either be the Classroom-assigned identifier or an alias.

  • user_id (String)

    Identifier of the student to delete, or an alias the identifies the user. The following aliases are supported: * the e-mail address of the user * the string literal "me", indicating that the requesting user

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



691
692
693
694
695
696
697
698
699
700
701
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 691

def delete_course_student(course_id, user_id, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/students/{userId}'
  command =  make_simple_command(:delete, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::Empty::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Empty
  command.params['courseId'] = course_id unless course_id.nil?
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#delete_course_teacher(course_id, user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Empty

Deletes a teacher of a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to delete teachers of this course. * NOT_FOUND if no teacher of this course has the requested ID or if the course does not exist. * FAILED_PRECONDITION if the requested ID belongs to the primary teacher of this course.

Parameters:

  • course_id (String)

    Unique identifier of the course. This may either be the Classroom-assigned identifier or an alias.

  • user_id (String)

    Identifier of the teacher to delete, or an alias the identifies the user. the following aliases are supported: * the e-mail address of the user * the string literal "me", indicating that the requesting user

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



522
523
524
525
526
527
528
529
530
531
532
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 522

def delete_course_teacher(course_id, user_id, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/teachers/{userId}'
  command =  make_simple_command(:delete, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::Empty::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Empty
  command.params['courseId'] = course_id unless course_id.nil?
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_course(id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Course

Returns a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to access the requested course. * NOT_FOUND if no course exists with the requested ID.

Parameters:

  • id (String)

    Identifier of the course to return. This may either be the Classroom-assigned identifier or an [alias][google.classroom.v1beta1.CourseAlias].

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



108
109
110
111
112
113
114
115
116
117
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 108

def get_course(id, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{id}'
  command =  make_simple_command(:get, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::Course::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Course
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_course_student(course_id, user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Student

Returns a student of a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to view students of this course. * NOT_FOUND if no student of this course has the requested ID or if the course does not exist.

Parameters:

  • course_id (String)

    Unique identifier of the course. This may either be the Classroom-assigned identifier or an alias.

  • user_id (String)

    Identifier of the student to return, or an alias the identifies the user. The following aliases are supported: * the e-mail address of the user * the string literal "me", indicating that the requesting user

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



651
652
653
654
655
656
657
658
659
660
661
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 651

def get_course_student(course_id, user_id, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/students/{userId}'
  command =  make_simple_command(:get, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::Student::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Student
  command.params['courseId'] = course_id unless course_id.nil?
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_course_teacher(course_id, user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Teacher

Returns a teacher of a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to view teachers of this course. * NOT_FOUND if no teacher of this course has the requested ID or if the course does not exist.

Parameters:

  • course_id (String)

    Unique identifier of the course. This may either be the Classroom-assigned identifier or an alias.

  • user_id (String)

    Identifier of the teacher to return, or an alias the identifies the user. the following aliases are supported: * the e-mail address of the user * the string literal "me", indicating that the requesting user

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



481
482
483
484
485
486
487
488
489
490
491
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 481

def get_course_teacher(course_id, user_id, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/teachers/{userId}'
  command =  make_simple_command(:get, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::Teacher::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Teacher
  command.params['courseId'] = course_id unless course_id.nil?
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#get_user_profile(user_id, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::UserProfile

Returns a user profile. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to access this user profile. * NOT_FOUND if the profile does not exist.

Parameters:

  • user_id (String)

    Identifier of the profile to return, or an alias the identifies the user. The following aliases are supported: * the e-mail address of the user * the string literal "me", indicating the requesting user

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



771
772
773
774
775
776
777
778
779
780
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 771

def (user_id, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/userProfiles/{userId}'
  command =  make_simple_command(:get, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::UserProfile::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::UserProfile
  command.params['userId'] = user_id unless user_id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_course_aliases(course_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::ListCourseAliasesResponse

Lists the aliases of a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to access the course. * NOT_FOUND if the course does not exist.

Parameters:

  • course_id (String)

    The identifier of the course. This may either be the Classroom-assigned identifier or an [alias][google.classroom.v1beta1.CourseAlias].

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.

  • page_token (String) (defaults to: nil)

    [nextPageToken][google.classroom.v1beta1.ListCourseAliasesResponse. next_page_token] value returned from a previous [list][google.classroom. v1beta1.Courses.ListCourseAliases] call, indicating that the subsequent page of results should be returned. The [list][google.classroom.v1beta1.Courses. ListCourseAliases] request must be identical to the one which resulted in this token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



401
402
403
404
405
406
407
408
409
410
411
412
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 401

def list_course_aliases(course_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/aliases'
  command =  make_simple_command(:get, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::ListCourseAliasesResponse::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::ListCourseAliasesResponse
  command.params['courseId'] = course_id unless course_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_course_students(course_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::ListStudentsResponse

Returns a list of students of this course that the requester is permitted to view. Fails with NOT_FOUND if the course does not exist.

Parameters:

  • course_id (String)

    Unique identifier of the course. This may either be the Classroom-assigned identifier or an alias.

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results.

  • page_token (String) (defaults to: nil)

    [nextPageToken][google.classroom.v1beta1.ListStudentsResponse.next_page_token] value returned from a previous [list][google.classroom.v1beta1.Users. ListStudents] call, indicating that the subsequent page of results should be returned. The [list][google.classroom.v1beta1.Users.ListStudents] request must be identical to the one which resulted in this token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



734
735
736
737
738
739
740
741
742
743
744
745
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 734

def list_course_students(course_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/students'
  command =  make_simple_command(:get, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::ListStudentsResponse::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::ListStudentsResponse
  command.params['courseId'] = course_id unless course_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_course_teachers(course_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::ListTeachersResponse

Returns a list of teachers of this course that the requester is permitted to view. Fails with NOT_FOUND if the course does not exist.

Parameters:

  • course_id (String)

    Unique identifier of the course. This may either be the Classroom-assigned identifier or an alias.

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of items to return. Zero means no maximum. The server may return fewer than the specified number of results.

  • page_token (String) (defaults to: nil)

    [nextPageToken][google.classroom.v1beta1.ListTeachersResponse.next_page_token] value returned from a previous [list][google.classroom.v1beta1.Users. ListTeachers] call, indicating that the subsequent page of results should be returned. The [list][google.classroom.v1beta1.Users.ListTeachers] request must be identical to the one which resulted in this token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



565
566
567
568
569
570
571
572
573
574
575
576
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 565

def list_course_teachers(course_id, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{courseId}/teachers'
  command =  make_simple_command(:get, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::ListTeachersResponse::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::ListTeachersResponse
  command.params['courseId'] = course_id unless course_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#list_courses(student_id: nil, teacher_id: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::ListCoursesResponse

Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. This method returns the following error codes: * INVALID_ARGUMENT if the query argument is malformed. * NOT_FOUND if any users specified in the query arguments do not exist.

Parameters:

  • student_id (String) (defaults to: nil)

    Restricts returned courses to those having a student with the specified identifier, or an alias that identifies a student. The following aliases are supported: * the e-mail address of the user * the string literal "me", indicating that the requesting user

  • teacher_id (String) (defaults to: nil)

    Restricts returned courses to those having a teacher with the specified identifier, or an alias that identifies a teacher. The following aliases are supported: * the e-mail address of the user * the string literal "me", indicating that the requesting user

  • page_size (Fixnum) (defaults to: nil)

    Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results.

  • page_token (String) (defaults to: nil)

    [nextPageToken][google.classroom.v1beta1.ListCoursesResponse.next_page_token] value returned from a previous [list][google.classroom.v1beta1.Courses. ListCourses] call, indicating that the subsequent page of results should be returned. The [list][google.classroom.v1beta1.Courses.ListCourses] request must be identical to the one which resulted in this token.

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



277
278
279
280
281
282
283
284
285
286
287
288
289
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 277

def list_courses(student_id: nil, teacher_id: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses'
  command =  make_simple_command(:get, path, options)
  command.response_representation = Google::Apis::ClassroomV1beta1::ListCoursesResponse::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::ListCoursesResponse
  command.query['studentId'] = student_id unless student_id.nil?
  command.query['teacherId'] = teacher_id unless teacher_id.nil?
  command.query['pageSize'] = page_size unless page_size.nil?
  command.query['pageToken'] = page_token unless page_token.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#patch_course(id, course_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Course

Updates one or more fields a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to modify the requested course. * NOT_FOUND if no course exists with the requested ID.

  • INVALID_ARGUMENT if invalid fields are specified in the update mask or if no update mask is supplied.

Parameters:

  • id (String)

    Identifier of the course to update. This may either be the Classroom-assigned identifier or an [alias][google.classroom.v1beta1.CourseAlias].

  • course_object (Google::Apis::ClassroomV1beta1::Course) (defaults to: nil)
  • update_mask (String) (defaults to: nil)

    Mask which identifies which fields on the course to update. This field is required to do an update. The update will fail if invalid fields are specified. Valid fields are listed below: * name * section * descriptionHeading * description * room * courseState When set in a query parameter, this should be specified as updateMask=,,...

  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



188
189
190
191
192
193
194
195
196
197
198
199
200
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 188

def patch_course(id, course_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{id}'
  command =  make_simple_command(:patch, path, options)
  command.request_representation = Google::Apis::ClassroomV1beta1::Course::Representation
  command.request_object = course_object
  command.response_representation = Google::Apis::ClassroomV1beta1::Course::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Course
  command.params['id'] = id unless id.nil?
  command.query['updateMask'] = update_mask unless update_mask.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end

#update_course(id, course_object = nil, fields: nil, quota_user: nil, options: nil) {|result, err| ... } ⇒ Google::Apis::ClassroomV1beta1::Course

Updates a course. This method returns the following error codes: * PERMISSION_DENIED if the requesting user is not permitted to modify the requested course. * NOT_FOUND if no course exists with the requested ID.

Parameters:

  • id (String)

    Identifier of the course to update. This may either be the Classroom-assigned identifier or an [alias][google.classroom.v1beta1.CourseAlias].

  • course_object (Google::Apis::ClassroomV1beta1::Course) (defaults to: nil)
  • fields (String) (defaults to: nil)

    Selector specifying which fields to include in a partial response.

  • quota_user (String) (defaults to: nil)

    Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.

  • options (Google::Apis::RequestOptions) (defaults to: nil)

    Request-specific options

Yields:

  • (result, err)

    Result & error if block supplied

Yield Parameters:

Returns:

Raises:



143
144
145
146
147
148
149
150
151
152
153
154
# File 'generated/google/apis/classroom_v1beta1/service.rb', line 143

def update_course(id, course_object = nil, fields: nil, quota_user: nil, options: nil, &block)
  path = 'v1beta1/courses/{id}'
  command =  make_simple_command(:put, path, options)
  command.request_representation = Google::Apis::ClassroomV1beta1::Course::Representation
  command.request_object = course_object
  command.response_representation = Google::Apis::ClassroomV1beta1::Course::Representation
  command.response_class = Google::Apis::ClassroomV1beta1::Course
  command.params['id'] = id unless id.nil?
  command.query['fields'] = fields unless fields.nil?
  command.query['quotaUser'] = quota_user unless quota_user.nil?
  execute_or_queue_command(command, &block)
end