Skip to content

Commit a370c65

Browse files
feat: Automated regeneration of classroom v1 client (googleapis#22368)
Auto-created at 2025-04-06 09:59:57 +0000 using the toys pull request generator.
1 parent 0cede7e commit a370c65

File tree

6 files changed

+239
-5
lines changed

6 files changed

+239
-5
lines changed

api_names_out.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58835,6 +58835,7 @@
5883558835
"/classroom:v1/CourseWork/dueDate": due_date
5883658836
"/classroom:v1/CourseWork/dueTime": due_time
5883758837
"/classroom:v1/CourseWork/gradeCategory": grade_category
58838+
"/classroom:v1/CourseWork/gradingPeriodId": grading_period_id
5883858839
"/classroom:v1/CourseWork/id": id
5883958840
"/classroom:v1/CourseWork/individualStudentsOptions": individual_students_options
5884058841
"/classroom:v1/CourseWork/materials": materials
@@ -58915,6 +58916,15 @@
5891558916
"/classroom:v1/GradebookSettings/displaySetting": display_setting
5891658917
"/classroom:v1/GradebookSettings/gradeCategories": grade_categories
5891758918
"/classroom:v1/GradebookSettings/gradeCategories/grade_category": grade_category
58919+
"/classroom:v1/GradingPeriod": grading_period
58920+
"/classroom:v1/GradingPeriod/endDate": end_date
58921+
"/classroom:v1/GradingPeriod/id": id
58922+
"/classroom:v1/GradingPeriod/startDate": start_date
58923+
"/classroom:v1/GradingPeriod/title": title
58924+
"/classroom:v1/GradingPeriodSettings": grading_period_settings
58925+
"/classroom:v1/GradingPeriodSettings/applyToExistingCoursework": apply_to_existing_coursework
58926+
"/classroom:v1/GradingPeriodSettings/gradingPeriods": grading_periods
58927+
"/classroom:v1/GradingPeriodSettings/gradingPeriods/grading_period": grading_period
5891858928
"/classroom:v1/Guardian": guardian
5891958929
"/classroom:v1/Guardian/guardianId": guardian_id
5892058930
"/classroom:v1/Guardian/guardianProfile": guardian_profile
@@ -59365,6 +59375,8 @@
5936559375
"/classroom:v1/classroom.courses.delete/id": id
5936659376
"/classroom:v1/classroom.courses.get": get_course
5936759377
"/classroom:v1/classroom.courses.get/id": id
59378+
"/classroom:v1/classroom.courses.getGradingPeriodSettings": get_course_grading_period_settings
59379+
"/classroom:v1/classroom.courses.getGradingPeriodSettings/courseId": course_id
5936859380
"/classroom:v1/classroom.courses.list": list_courses
5936959381
"/classroom:v1/classroom.courses.list/courseStates": course_states
5937059382
"/classroom:v1/classroom.courses.list/pageSize": page_size
@@ -59463,6 +59475,9 @@
5946359475
"/classroom:v1/classroom.courses.topics.patch/updateMask": update_mask
5946459476
"/classroom:v1/classroom.courses.update": update_course
5946559477
"/classroom:v1/classroom.courses.update/id": id
59478+
"/classroom:v1/classroom.courses.updateGradingPeriodSettings": update_course_grading_period_settings
59479+
"/classroom:v1/classroom.courses.updateGradingPeriodSettings/courseId": course_id
59480+
"/classroom:v1/classroom.courses.updateGradingPeriodSettings/updateMask": update_mask
5946659481
"/classroom:v1/classroom.invitations.accept": accept_invitation
5946759482
"/classroom:v1/classroom.invitations.accept/id": id
5946859483
"/classroom:v1/classroom.invitations.create": create_invitation

generated/google-apis-classroom_v1/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release history for google-apis-classroom_v1
22

3+
### v0.41.0 (2025-04-06)
4+
5+
* Regenerated from discovery document revision 20250331
6+
37
### v0.40.0 (2025-03-09)
48

59
* Regenerated from discovery document revision 20250303

generated/google-apis-classroom_v1/lib/google/apis/classroom_v1/classes.rb

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -781,6 +781,15 @@ class CourseWork
781781
# @return [Google::Apis::ClassroomV1::GradeCategory]
782782
attr_accessor :grade_category
783783

784+
# Identifier of the grading period associated with the coursework. * At creation,
785+
# if unspecified, the grading period ID will be set based on the `dueDate` (or `
786+
# scheduledTime` if no `dueDate` is set). * To indicate no association to any
787+
# grading period, set this field to an empty string (""). * If specified, it
788+
# must match an existing grading period ID in the course.
789+
# Corresponds to the JSON property `gradingPeriodId`
790+
# @return [String]
791+
attr_accessor :grading_period_id
792+
784793
# Classroom-assigned identifier of this course work, unique per course. Read-
785794
# only.
786795
# Corresponds to the JSON property `id`
@@ -865,6 +874,7 @@ def update!(**args)
865874
@due_date = args[:due_date] if args.key?(:due_date)
866875
@due_time = args[:due_time] if args.key?(:due_time)
867876
@grade_category = args[:grade_category] if args.key?(:grade_category)
877+
@grading_period_id = args[:grading_period_id] if args.key?(:grading_period_id)
868878
@id = args[:id] if args.key?(:id)
869879
@individual_students_options = args[:individual_students_options] if args.key?(:individual_students_options)
870880
@materials = args[:materials] if args.key?(:materials)
@@ -1396,6 +1406,93 @@ def update!(**args)
13961406
end
13971407
end
13981408

1409+
# An individual grading period. Grading periods must not have overlapping date
1410+
# ranges and must be listed in chronological order. For example, if the end_date
1411+
# of a grading period is 2024-01-25, then the start_date of the next grading
1412+
# period must be 2024-01-26 or later. Each grading period must have a unique
1413+
# title within a course.
1414+
class GradingPeriod
1415+
include Google::Apis::Core::Hashable
1416+
1417+
# Represents a whole or partial calendar date, such as a birthday. The time of
1418+
# day and time zone are either specified elsewhere or are insignificant. The
1419+
# date is relative to the Gregorian Calendar. This can represent one of the
1420+
# following: * A full date, with non-zero year, month, and day values. * A month
1421+
# and day, with a zero year (for example, an anniversary). * A year on its own,
1422+
# with a zero month and a zero day. * A year and month, with a zero day (for
1423+
# example, a credit card expiration date). Related types: * google.type.
1424+
# TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
1425+
# Corresponds to the JSON property `endDate`
1426+
# @return [Google::Apis::ClassroomV1::Date]
1427+
attr_accessor :end_date
1428+
1429+
# Output only. System generated grading period ID. Read-only.
1430+
# Corresponds to the JSON property `id`
1431+
# @return [String]
1432+
attr_accessor :id
1433+
1434+
# Represents a whole or partial calendar date, such as a birthday. The time of
1435+
# day and time zone are either specified elsewhere or are insignificant. The
1436+
# date is relative to the Gregorian Calendar. This can represent one of the
1437+
# following: * A full date, with non-zero year, month, and day values. * A month
1438+
# and day, with a zero year (for example, an anniversary). * A year on its own,
1439+
# with a zero month and a zero day. * A year and month, with a zero day (for
1440+
# example, a credit card expiration date). Related types: * google.type.
1441+
# TimeOfDay * google.type.DateTime * google.protobuf.Timestamp
1442+
# Corresponds to the JSON property `startDate`
1443+
# @return [Google::Apis::ClassroomV1::Date]
1444+
attr_accessor :start_date
1445+
1446+
# Required. Title of the grading period. For example, “Semester 1”.
1447+
# Corresponds to the JSON property `title`
1448+
# @return [String]
1449+
attr_accessor :title
1450+
1451+
def initialize(**args)
1452+
update!(**args)
1453+
end
1454+
1455+
# Update properties of this object
1456+
def update!(**args)
1457+
@end_date = args[:end_date] if args.key?(:end_date)
1458+
@id = args[:id] if args.key?(:id)
1459+
@start_date = args[:start_date] if args.key?(:start_date)
1460+
@title = args[:title] if args.key?(:title)
1461+
end
1462+
end
1463+
1464+
# Grading period settings that include all the individual grading periods in a
1465+
# course.
1466+
class GradingPeriodSettings
1467+
include Google::Apis::Core::Hashable
1468+
1469+
# Supports toggling the application of grading periods on existing stream items.
1470+
# Once set, this value is persisted meaning that it does not need to be set in
1471+
# every request to update `GradingPeriodSettings`. If not previously set, the
1472+
# default is False.
1473+
# Corresponds to the JSON property `applyToExistingCoursework`
1474+
# @return [Boolean]
1475+
attr_accessor :apply_to_existing_coursework
1476+
alias_method :apply_to_existing_coursework?, :apply_to_existing_coursework
1477+
1478+
# The list of grading periods in a specific course. Grading periods must not
1479+
# have overlapping date ranges and must be listed in chronological order. Each
1480+
# grading period must have a unique title within a course.
1481+
# Corresponds to the JSON property `gradingPeriods`
1482+
# @return [Array<Google::Apis::ClassroomV1::GradingPeriod>]
1483+
attr_accessor :grading_periods
1484+
1485+
def initialize(**args)
1486+
update!(**args)
1487+
end
1488+
1489+
# Update properties of this object
1490+
def update!(**args)
1491+
@apply_to_existing_coursework = args[:apply_to_existing_coursework] if args.key?(:apply_to_existing_coursework)
1492+
@grading_periods = args[:grading_periods] if args.key?(:grading_periods)
1493+
end
1494+
end
1495+
13991496
# Association between a student and a guardian of that student. The guardian may
14001497
# receive information about the student's course work.
14011498
class Guardian

generated/google-apis-classroom_v1/lib/google/apis/classroom_v1/gem_version.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ module Google
1616
module Apis
1717
module ClassroomV1
1818
# Version of the google-apis-classroom_v1 gem
19-
GEM_VERSION = "0.40.0"
19+
GEM_VERSION = "0.41.0"
2020

2121
# Version of the code generator used to generate this client
2222
GENERATOR_VERSION = "0.16.0"
2323

2424
# Revision of the discovery document this client was generated from
25-
REVISION = "20250303"
25+
REVISION = "20250331"
2626
end
2727
end
2828
end

generated/google-apis-classroom_v1/lib/google/apis/classroom_v1/representations.rb

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,18 @@ class Representation < Google::Apis::Core::JsonRepresentation; end
196196
include Google::Apis::Core::JsonObjectSupport
197197
end
198198

199+
class GradingPeriod
200+
class Representation < Google::Apis::Core::JsonRepresentation; end
201+
202+
include Google::Apis::Core::JsonObjectSupport
203+
end
204+
205+
class GradingPeriodSettings
206+
class Representation < Google::Apis::Core::JsonRepresentation; end
207+
208+
include Google::Apis::Core::JsonObjectSupport
209+
end
210+
199211
class Guardian
200212
class Representation < Google::Apis::Core::JsonRepresentation; end
201213

@@ -674,6 +686,7 @@ class Representation < Google::Apis::Core::JsonRepresentation
674686

675687
property :grade_category, as: 'gradeCategory', class: Google::Apis::ClassroomV1::GradeCategory, decorator: Google::Apis::ClassroomV1::GradeCategory::Representation
676688

689+
property :grading_period_id, as: 'gradingPeriodId'
677690
property :id, as: 'id'
678691
property :individual_students_options, as: 'individualStudentsOptions', class: Google::Apis::ClassroomV1::IndividualStudentsOptions, decorator: Google::Apis::ClassroomV1::IndividualStudentsOptions::Representation
679692

@@ -832,6 +845,27 @@ class Representation < Google::Apis::Core::JsonRepresentation
832845
end
833846
end
834847

848+
class GradingPeriod
849+
# @private
850+
class Representation < Google::Apis::Core::JsonRepresentation
851+
property :end_date, as: 'endDate', class: Google::Apis::ClassroomV1::Date, decorator: Google::Apis::ClassroomV1::Date::Representation
852+
853+
property :id, as: 'id'
854+
property :start_date, as: 'startDate', class: Google::Apis::ClassroomV1::Date, decorator: Google::Apis::ClassroomV1::Date::Representation
855+
856+
property :title, as: 'title'
857+
end
858+
end
859+
860+
class GradingPeriodSettings
861+
# @private
862+
class Representation < Google::Apis::Core::JsonRepresentation
863+
property :apply_to_existing_coursework, as: 'applyToExistingCoursework'
864+
collection :grading_periods, as: 'gradingPeriods', class: Google::Apis::ClassroomV1::GradingPeriod, decorator: Google::Apis::ClassroomV1::GradingPeriod::Representation
865+
866+
end
867+
end
868+
835869
class Guardian
836870
# @private
837871
class Representation < Google::Apis::Core::JsonRepresentation

generated/google-apis-classroom_v1/lib/google/apis/classroom_v1/service.rb

Lines changed: 87 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,39 @@ def get_course(id, fields: nil, quota_user: nil, options: nil, &block)
158158
execute_or_queue_command(command, &block)
159159
end
160160

161+
# Returns the grading period settings in a course. This method returns the
162+
# following error codes: * `PERMISSION_DENIED` if the requesting user isn't
163+
# permitted to access the grading period settings in the requested course or for
164+
# access errors. * `NOT_FOUND` if the requested course does not exist.
165+
# @param [String] course_id
166+
# Required. The identifier of the course.
167+
# @param [String] fields
168+
# Selector specifying which fields to include in a partial response.
169+
# @param [String] quota_user
170+
# Available to use for quota purposes for server-side applications. Can be any
171+
# arbitrary string assigned to a user, but should not exceed 40 characters.
172+
# @param [Google::Apis::RequestOptions] options
173+
# Request-specific options
174+
#
175+
# @yield [result, err] Result & error if block supplied
176+
# @yieldparam result [Google::Apis::ClassroomV1::GradingPeriodSettings] parsed result object
177+
# @yieldparam err [StandardError] error object if request failed
178+
#
179+
# @return [Google::Apis::ClassroomV1::GradingPeriodSettings]
180+
#
181+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
182+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
183+
# @raise [Google::Apis::AuthorizationError] Authorization is required
184+
def get_course_grading_period_settings(course_id, fields: nil, quota_user: nil, options: nil, &block)
185+
command = make_simple_command(:get, 'v1/courses/{courseId}/gradingPeriodSettings', options)
186+
command.response_representation = Google::Apis::ClassroomV1::GradingPeriodSettings::Representation
187+
command.response_class = Google::Apis::ClassroomV1::GradingPeriodSettings
188+
command.params['courseId'] = course_id unless course_id.nil?
189+
command.query['fields'] = fields unless fields.nil?
190+
command.query['quotaUser'] = quota_user unless quota_user.nil?
191+
execute_or_queue_command(command, &block)
192+
end
193+
161194
# Returns a list of courses that the requesting user is permitted to view,
162195
# restricted to those that match the request. Returned courses are ordered by
163196
# creation time, with the most recently created coming first. This method
@@ -303,6 +336,59 @@ def update_course(id, course_object = nil, fields: nil, quota_user: nil, options
303336
execute_or_queue_command(command, &block)
304337
end
305338

339+
# Updates grading period settings of a course. Individual grading periods can be
340+
# added, removed, or modified using this method. The requesting user and course
341+
# owner must be eligible to modify Grading Periods. For details, see [licensing
342+
# requirements](https://developers.google.com/classroom/grading-periods/manage-
343+
# grading-periods#licensing_requirements). This method returns the following
344+
# error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
345+
# modify the grading period settings in a course or for access errors: *
346+
# UserIneligibleToUpdateGradingPeriodSettings * `INVALID_ARGUMENT` if the
347+
# request is malformed. * `NOT_FOUND` if the requested course does not exist.
348+
# @param [String] course_id
349+
# Required. The identifier of the course.
350+
# @param [Google::Apis::ClassroomV1::GradingPeriodSettings] grading_period_settings_object
351+
# @param [String] update_mask
352+
# Mask that identifies which fields in the GradingPeriodSettings to update. The
353+
# GradingPeriodSettings `grading_periods` list will be fully replaced by the
354+
# grading periods specified in the update request. For example: * Grading
355+
# periods included in the list without an ID are considered additions, and a new
356+
# ID will be assigned when the request is made. * Grading periods that currently
357+
# exist, but are missing from the request will be considered deletions. *
358+
# Grading periods with an existing ID and modified data are considered edits.
359+
# Unmodified data will be left as is. * Grading periods included with an unknown
360+
# ID will result in an error. The following fields may be specified: * `
361+
# grading_periods` * `apply_to_existing_coursework`
362+
# @param [String] fields
363+
# Selector specifying which fields to include in a partial response.
364+
# @param [String] quota_user
365+
# Available to use for quota purposes for server-side applications. Can be any
366+
# arbitrary string assigned to a user, but should not exceed 40 characters.
367+
# @param [Google::Apis::RequestOptions] options
368+
# Request-specific options
369+
#
370+
# @yield [result, err] Result & error if block supplied
371+
# @yieldparam result [Google::Apis::ClassroomV1::GradingPeriodSettings] parsed result object
372+
# @yieldparam err [StandardError] error object if request failed
373+
#
374+
# @return [Google::Apis::ClassroomV1::GradingPeriodSettings]
375+
#
376+
# @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
377+
# @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
378+
# @raise [Google::Apis::AuthorizationError] Authorization is required
379+
def update_course_grading_period_settings(course_id, grading_period_settings_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
380+
command = make_simple_command(:patch, 'v1/courses/{courseId}/gradingPeriodSettings', options)
381+
command.request_representation = Google::Apis::ClassroomV1::GradingPeriodSettings::Representation
382+
command.request_object = grading_period_settings_object
383+
command.response_representation = Google::Apis::ClassroomV1::GradingPeriodSettings::Representation
384+
command.response_class = Google::Apis::ClassroomV1::GradingPeriodSettings
385+
command.params['courseId'] = course_id unless course_id.nil?
386+
command.query['updateMask'] = update_mask unless update_mask.nil?
387+
command.query['fields'] = fields unless fields.nil?
388+
command.query['quotaUser'] = quota_user unless quota_user.nil?
389+
execute_or_queue_command(command, &block)
390+
end
391+
306392
# Creates an alias for a course. This method returns the following error codes: *
307393
# `PERMISSION_DENIED` if the requesting user is not permitted to create the
308394
# alias or for access errors. * `NOT_FOUND` if the course does not exist. * `
@@ -1310,9 +1396,7 @@ def modify_course_course_work_assignees(course_id, id, modify_course_work_assign
13101396
# CourseWork` object, an `INVALID_ARGUMENT` error is returned. The following
13111397
# fields may be specified by teachers: * `title` * `description` * `state` * `
13121398
# due_date` * `due_time` * `max_points` * `scheduled_time` * `
1313-
# submission_modification_mode` * `topic_id` * `grading_period_id` Available in [
1314-
# V1_20240401_PREVIEW](https://developers.google.com/classroom/reference/preview)
1315-
# and later.
1399+
# submission_modification_mode` * `topic_id` * `grading_period_id`
13161400
# @param [String] fields
13171401
# Selector specifying which fields to include in a partial response.
13181402
# @param [String] quota_user

0 commit comments

Comments
 (0)