Skip to content

Commit f53d9b9

Browse files
feat: Automated regeneration of Classroom client (#13291)
Auto-created at 2025-04-03 13:18:34 +0000 using the toys pull request generator.
1 parent f00c4b0 commit f53d9b9

File tree

5 files changed

+253
-2
lines changed

5 files changed

+253
-2
lines changed

clients/classroom/lib/google_api/classroom/v1/api/courses.ex

Lines changed: 145 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,76 @@ defmodule GoogleApi.Classroom.V1.Api.Courses do
204204
|> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.Course{}])
205205
end
206206

207+
@doc """
208+
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.
209+
210+
## Parameters
211+
212+
* `connection` (*type:* `GoogleApi.Classroom.V1.Connection.t`) - Connection to server
213+
* `course_id` (*type:* `String.t`) - Required. The identifier of the course.
214+
* `optional_params` (*type:* `keyword()`) - Optional parameters
215+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
216+
* `:access_token` (*type:* `String.t`) - OAuth access token.
217+
* `:alt` (*type:* `String.t`) - Data format for response.
218+
* `:callback` (*type:* `String.t`) - JSONP
219+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
220+
* `:key` (*type:* `String.t`) - 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.
221+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
222+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
223+
* `:quotaUser` (*type:* `String.t`) - 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.
224+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
225+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
226+
* `opts` (*type:* `keyword()`) - Call options
227+
228+
## Returns
229+
230+
* `{:ok, %GoogleApi.Classroom.V1.Model.GradingPeriodSettings{}}` on success
231+
* `{:error, info}` on failure
232+
"""
233+
@spec classroom_courses_get_grading_period_settings(
234+
Tesla.Env.client(),
235+
String.t(),
236+
keyword(),
237+
keyword()
238+
) ::
239+
{:ok, GoogleApi.Classroom.V1.Model.GradingPeriodSettings.t()}
240+
| {:ok, Tesla.Env.t()}
241+
| {:ok, list()}
242+
| {:error, any()}
243+
def classroom_courses_get_grading_period_settings(
244+
connection,
245+
course_id,
246+
optional_params \\ [],
247+
opts \\ []
248+
) do
249+
optional_params_config = %{
250+
:"$.xgafv" => :query,
251+
:access_token => :query,
252+
:alt => :query,
253+
:callback => :query,
254+
:fields => :query,
255+
:key => :query,
256+
:oauth_token => :query,
257+
:prettyPrint => :query,
258+
:quotaUser => :query,
259+
:uploadType => :query,
260+
:upload_protocol => :query
261+
}
262+
263+
request =
264+
Request.new()
265+
|> Request.method(:get)
266+
|> Request.url("/v1/courses/{courseId}/gradingPeriodSettings", %{
267+
"courseId" => URI.encode(course_id, &URI.char_unreserved?/1)
268+
})
269+
|> Request.add_optional_params(optional_params_config, optional_params)
270+
|> Request.library_version(@library_version)
271+
272+
connection
273+
|> Connection.execute(request)
274+
|> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.GradingPeriodSettings{}])
275+
end
276+
207277
@doc """
208278
Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation time, with the most recently created coming first. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the query argument is malformed. * `NOT_FOUND` if any users specified in the query arguments do not exist.
209279
@@ -397,6 +467,80 @@ defmodule GoogleApi.Classroom.V1.Api.Courses do
397467
|> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.Course{}])
398468
end
399469

470+
@doc """
471+
Updates grading period settings of a course. Individual grading periods can be added, removed, or modified using this method. The requesting user and course owner must be eligible to modify Grading Periods. For details, see [licensing requirements](https://developers.google.com/classroom/grading-periods/manage-grading-periods#licensing_requirements). This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the grading period settings in a course or for access errors: * UserIneligibleToUpdateGradingPeriodSettings * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.
472+
473+
## Parameters
474+
475+
* `connection` (*type:* `GoogleApi.Classroom.V1.Connection.t`) - Connection to server
476+
* `course_id` (*type:* `String.t`) - Required. The identifier of the course.
477+
* `optional_params` (*type:* `keyword()`) - Optional parameters
478+
* `:"$.xgafv"` (*type:* `String.t`) - V1 error format.
479+
* `:access_token` (*type:* `String.t`) - OAuth access token.
480+
* `:alt` (*type:* `String.t`) - Data format for response.
481+
* `:callback` (*type:* `String.t`) - JSONP
482+
* `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response.
483+
* `:key` (*type:* `String.t`) - 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.
484+
* `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user.
485+
* `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks.
486+
* `:quotaUser` (*type:* `String.t`) - 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.
487+
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
488+
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
489+
* `:updateMask` (*type:* `String.t`) - Mask that identifies which fields in the GradingPeriodSettings to update. The GradingPeriodSettings `grading_periods` list will be fully replaced by the grading periods specified in the update request. For example: * Grading periods included in the list without an ID are considered additions, and a new ID will be assigned when the request is made. * Grading periods that currently exist, but are missing from the request will be considered deletions. * Grading periods with an existing ID and modified data are considered edits. Unmodified data will be left as is. * Grading periods included with an unknown ID will result in an error. The following fields may be specified: * `grading_periods` * `apply_to_existing_coursework`
490+
* `:body` (*type:* `GoogleApi.Classroom.V1.Model.GradingPeriodSettings.t`) -
491+
* `opts` (*type:* `keyword()`) - Call options
492+
493+
## Returns
494+
495+
* `{:ok, %GoogleApi.Classroom.V1.Model.GradingPeriodSettings{}}` on success
496+
* `{:error, info}` on failure
497+
"""
498+
@spec classroom_courses_update_grading_period_settings(
499+
Tesla.Env.client(),
500+
String.t(),
501+
keyword(),
502+
keyword()
503+
) ::
504+
{:ok, GoogleApi.Classroom.V1.Model.GradingPeriodSettings.t()}
505+
| {:ok, Tesla.Env.t()}
506+
| {:ok, list()}
507+
| {:error, any()}
508+
def classroom_courses_update_grading_period_settings(
509+
connection,
510+
course_id,
511+
optional_params \\ [],
512+
opts \\ []
513+
) do
514+
optional_params_config = %{
515+
:"$.xgafv" => :query,
516+
:access_token => :query,
517+
:alt => :query,
518+
:callback => :query,
519+
:fields => :query,
520+
:key => :query,
521+
:oauth_token => :query,
522+
:prettyPrint => :query,
523+
:quotaUser => :query,
524+
:uploadType => :query,
525+
:upload_protocol => :query,
526+
:updateMask => :query,
527+
:body => :body
528+
}
529+
530+
request =
531+
Request.new()
532+
|> Request.method(:patch)
533+
|> Request.url("/v1/courses/{courseId}/gradingPeriodSettings", %{
534+
"courseId" => URI.encode(course_id, &URI.char_unreserved?/1)
535+
})
536+
|> Request.add_optional_params(optional_params_config, optional_params)
537+
|> Request.library_version(@library_version)
538+
539+
connection
540+
|> Connection.execute(request)
541+
|> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.GradingPeriodSettings{}])
542+
end
543+
400544
@doc """
401545
Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. * `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the alias already exists. * `FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain attempts to access a domain-scoped alias).
402546
@@ -2002,7 +2146,7 @@ defmodule GoogleApi.Classroom.V1.Api.Courses do
20022146
* `:quotaUser` (*type:* `String.t`) - 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.
20032147
* `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart").
20042148
* `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart").
2005-
* `:updateMask` (*type:* `String.t`) - Mask that identifies which fields on the course work to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the `CourseWork` object. If a field that does not support empty values is included in the update mask and not set in the `CourseWork` object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `description` * `state` * `due_date` * `due_time` * `max_points` * `scheduled_time` * `submission_modification_mode` * `topic_id` * `grading_period_id` Available in [V1_20240401_PREVIEW](https://developers.google.com/classroom/reference/preview) and later.
2149+
* `:updateMask` (*type:* `String.t`) - Mask that identifies which fields on the course work to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the `CourseWork` object. If a field that does not support empty values is included in the update mask and not set in the `CourseWork` object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `title` * `description` * `state` * `due_date` * `due_time` * `max_points` * `scheduled_time` * `submission_modification_mode` * `topic_id` * `grading_period_id`
20062150
* `:body` (*type:* `GoogleApi.Classroom.V1.Model.CourseWork.t`) -
20072151
* `opts` (*type:* `keyword()`) - Call options
20082152

clients/classroom/lib/google_api/classroom/v1/metadata.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ defmodule GoogleApi.Classroom.V1 do
2020
API client metadata for GoogleApi.Classroom.V1.
2121
"""
2222

23-
@discovery_revision "20250303"
23+
@discovery_revision "20250331"
2424

2525
def discovery_revision(), do: @discovery_revision
2626
end

clients/classroom/lib/google_api/classroom/v1/model/course_work.ex

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ defmodule GoogleApi.Classroom.V1.Model.CourseWork do
3232
* `dueDate` (*type:* `GoogleApi.Classroom.V1.Model.Date.t`, *default:* `nil`) - Optional date, in UTC, that submissions for this course work are due. This must be specified if `due_time` is specified.
3333
* `dueTime` (*type:* `GoogleApi.Classroom.V1.Model.TimeOfDay.t`, *default:* `nil`) - Optional time of day, in UTC, that submissions for this course work are due. This must be specified if `due_date` is specified.
3434
* `gradeCategory` (*type:* `GoogleApi.Classroom.V1.Model.GradeCategory.t`, *default:* `nil`) - The category that this coursework's grade contributes to. Present only when a category has been chosen for the coursework. May be used in calculating the overall grade. Read-only.
35+
* `gradingPeriodId` (*type:* `String.t`, *default:* `nil`) - Identifier of the grading period associated with the coursework. * At creation, if unspecified, the grading period ID will be set based on the `dueDate` (or `scheduledTime` if no `dueDate` is set). * To indicate no association to any grading period, set this field to an empty string (""). * If specified, it must match an existing grading period ID in the course.
3536
* `id` (*type:* `String.t`, *default:* `nil`) - Classroom-assigned identifier of this course work, unique per course. Read-only.
3637
* `individualStudentsOptions` (*type:* `GoogleApi.Classroom.V1.Model.IndividualStudentsOptions.t`, *default:* `nil`) - Identifiers of students with access to the coursework. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field are assigned the coursework.
3738
* `materials` (*type:* `list(GoogleApi.Classroom.V1.Model.Material.t)`, *default:* `nil`) - Additional materials. CourseWork must have no more than 20 material items.
@@ -60,6 +61,7 @@ defmodule GoogleApi.Classroom.V1.Model.CourseWork do
6061
:dueDate => GoogleApi.Classroom.V1.Model.Date.t() | nil,
6162
:dueTime => GoogleApi.Classroom.V1.Model.TimeOfDay.t() | nil,
6263
:gradeCategory => GoogleApi.Classroom.V1.Model.GradeCategory.t() | nil,
64+
:gradingPeriodId => String.t() | nil,
6365
:id => String.t() | nil,
6466
:individualStudentsOptions =>
6567
GoogleApi.Classroom.V1.Model.IndividualStudentsOptions.t() | nil,
@@ -87,6 +89,7 @@ defmodule GoogleApi.Classroom.V1.Model.CourseWork do
8789
field(:dueDate, as: GoogleApi.Classroom.V1.Model.Date)
8890
field(:dueTime, as: GoogleApi.Classroom.V1.Model.TimeOfDay)
8991
field(:gradeCategory, as: GoogleApi.Classroom.V1.Model.GradeCategory)
92+
field(:gradingPeriodId)
9093
field(:id)
9194
field(:individualStudentsOptions, as: GoogleApi.Classroom.V1.Model.IndividualStudentsOptions)
9295
field(:materials, as: GoogleApi.Classroom.V1.Model.Material, type: :list)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Classroom.V1.Model.GradingPeriod do
19+
@moduledoc """
20+
An individual grading period. Grading periods must not have overlapping date ranges and must be listed in chronological order. For example, if the end_date of a grading period is 2024-01-25, then the start_date of the next grading period must be 2024-01-26 or later. Each grading period must have a unique title within a course.
21+
22+
## Attributes
23+
24+
* `endDate` (*type:* `GoogleApi.Classroom.V1.Model.Date.t`, *default:* `nil`) - Required. End date, in UTC, of the grading period. Inclusive.
25+
* `id` (*type:* `String.t`, *default:* `nil`) - Output only. System generated grading period ID. Read-only.
26+
* `startDate` (*type:* `GoogleApi.Classroom.V1.Model.Date.t`, *default:* `nil`) - Required. Start date, in UTC, of the grading period. Inclusive.
27+
* `title` (*type:* `String.t`, *default:* `nil`) - Required. Title of the grading period. For example, “Semester 1”.
28+
"""
29+
30+
use GoogleApi.Gax.ModelBase
31+
32+
@type t :: %__MODULE__{
33+
:endDate => GoogleApi.Classroom.V1.Model.Date.t() | nil,
34+
:id => String.t() | nil,
35+
:startDate => GoogleApi.Classroom.V1.Model.Date.t() | nil,
36+
:title => String.t() | nil
37+
}
38+
39+
field(:endDate, as: GoogleApi.Classroom.V1.Model.Date)
40+
field(:id)
41+
field(:startDate, as: GoogleApi.Classroom.V1.Model.Date)
42+
field(:title)
43+
end
44+
45+
defimpl Poison.Decoder, for: GoogleApi.Classroom.V1.Model.GradingPeriod do
46+
def decode(value, options) do
47+
GoogleApi.Classroom.V1.Model.GradingPeriod.decode(value, options)
48+
end
49+
end
50+
51+
defimpl Poison.Encoder, for: GoogleApi.Classroom.V1.Model.GradingPeriod do
52+
def encode(value, options) do
53+
GoogleApi.Gax.ModelBase.encode(value, options)
54+
end
55+
end
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Copyright 2019 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# NOTE: This file is auto generated by the elixir code generator program.
16+
# Do not edit this file manually.
17+
18+
defmodule GoogleApi.Classroom.V1.Model.GradingPeriodSettings do
19+
@moduledoc """
20+
Grading period settings that include all the individual grading periods in a course.
21+
22+
## Attributes
23+
24+
* `applyToExistingCoursework` (*type:* `boolean()`, *default:* `nil`) - Supports toggling the application of grading periods on existing stream items. Once set, this value is persisted meaning that it does not need to be set in every request to update `GradingPeriodSettings`. If not previously set, the default is False.
25+
* `gradingPeriods` (*type:* `list(GoogleApi.Classroom.V1.Model.GradingPeriod.t)`, *default:* `nil`) - The list of grading periods in a specific course. Grading periods must not have overlapping date ranges and must be listed in chronological order. Each grading period must have a unique title within a course.
26+
"""
27+
28+
use GoogleApi.Gax.ModelBase
29+
30+
@type t :: %__MODULE__{
31+
:applyToExistingCoursework => boolean() | nil,
32+
:gradingPeriods => list(GoogleApi.Classroom.V1.Model.GradingPeriod.t()) | nil
33+
}
34+
35+
field(:applyToExistingCoursework)
36+
field(:gradingPeriods, as: GoogleApi.Classroom.V1.Model.GradingPeriod, type: :list)
37+
end
38+
39+
defimpl Poison.Decoder, for: GoogleApi.Classroom.V1.Model.GradingPeriodSettings do
40+
def decode(value, options) do
41+
GoogleApi.Classroom.V1.Model.GradingPeriodSettings.decode(value, options)
42+
end
43+
end
44+
45+
defimpl Poison.Encoder, for: GoogleApi.Classroom.V1.Model.GradingPeriodSettings do
46+
def encode(value, options) do
47+
GoogleApi.Gax.ModelBase.encode(value, options)
48+
end
49+
end

0 commit comments

Comments
 (0)