diff --git a/clients/classroom/README.md b/clients/classroom/README.md index b5d7c9dbc3..df1ac98f89 100644 --- a/clients/classroom/README.md +++ b/clients/classroom/README.md @@ -11,7 +11,7 @@ Install this package from [Hex](https://hex.pm) by adding ```elixir def deps do - [{:google_api_classroom, "~> 0.21"}] + [{:google_api_classroom, "~> 0.22"}] end ``` diff --git a/clients/classroom/lib/google_api/classroom/v1/api/courses.ex b/clients/classroom/lib/google_api/classroom/v1/api/courses.ex index 3e8c41c998..3000478dd4 100644 --- a/clients/classroom/lib/google_api/classroom/v1/api/courses.ex +++ b/clients/classroom/lib/google_api/classroom/v1/api/courses.ex @@ -2060,6 +2060,86 @@ defmodule GoogleApi.Classroom.V1.Api.Courses do |> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.CourseWork{}]) end + @doc """ + Updates a rubric. See google.classroom.v1.Rubric for details of which fields can be updated. Rubric update capabilities are [limited](/classroom/rubrics/limitations) once grading has started. This request must be made by the Google Cloud console of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the parent course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project didn't create the corresponding course work, if the user isn't permitted to make the requested modification to the rubric, or for access errors. This error code is also returned if grading has already started on the rubric. * `INVALID_ARGUMENT` if the request is malformed and for the following request error: * `RubricCriteriaInvalidFormat` * `NOT_FOUND` if the requested course, course work, or rubric doesn't exist or if the user doesn't have access to the corresponding course work. * `INTERNAL` if grading has already started on the rubric. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Classroom.V1.Connection.t`) - Connection to server + * `course_id` (*type:* `String.t`) - Required. Identifier of the course. + * `course_work_id` (*type:* `String.t`) - Required. Identifier of the course work. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `: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. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `: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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:id` (*type:* `String.t`) - Optional. Identifier of the rubric. + * `:updateMask` (*type:* `String.t`) - Optional. Mask that identifies which fields on the rubric to update. This field is required to do an update. The update fails if invalid fields are specified. There are multiple options to define the criteria of a rubric: the `source_spreadsheet_id` and the `criteria` list. Only one of these can be used at a time to define a rubric. The rubric `criteria` list is fully replaced by the rubric criteria specified in the update request. For example, if a criterion or level is missing from the request, it is deleted. New criteria and levels are added and an ID is assigned. Existing criteria and levels retain the previously assigned ID if the ID is specified in the request. The following fields can be specified by teachers: * `criteria` * `source_spreadsheet_id` + * `:body` (*type:* `GoogleApi.Classroom.V1.Model.Rubric.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Classroom.V1.Model.Rubric{}}` on success + * `{:error, info}` on failure + """ + @spec classroom_courses_course_work_update_rubric( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Classroom.V1.Model.Rubric.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def classroom_courses_course_work_update_rubric( + connection, + course_id, + course_work_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :id => :query, + :updateMask => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:patch) + |> Request.url("/v1/courses/{courseId}/courseWork/{courseWorkId}/rubric", %{ + "courseId" => URI.encode(course_id, &URI.char_unreserved?/1), + "courseWorkId" => URI.encode(course_work_id, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.Rubric{}]) + end + @doc """ Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if one of the identified resources does not exist. @@ -2657,6 +2737,398 @@ defmodule GoogleApi.Classroom.V1.Api.Courses do ) end + @doc """ + Creates a rubric. This request must be made by the Google Cloud console of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the parent course work item. For further details, see [Rubrics structure and known limitations](/classroom/rubrics/limitations). This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user isn't permitted to create rubrics for course work in the requested course. * `INTERNAL` if the request has insufficient OAuth scopes. * `INVALID_ARGUMENT` if the request is malformed and for the following request error: * `RubricCriteriaInvalidFormat` * `NOT_FOUND` if the requested course or course work don't exist or the user doesn't have access to the course or course work. * `FAILED_PRECONDITION` for the following request error: * `AttachmentNotVisible` + + ## Parameters + + * `connection` (*type:* `GoogleApi.Classroom.V1.Connection.t`) - Connection to server + * `course_id` (*type:* `String.t`) - Required. Identifier of the course. + * `course_work_id` (*type:* `String.t`) - Required. Identifier of the course work. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `: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. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `: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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:body` (*type:* `GoogleApi.Classroom.V1.Model.Rubric.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Classroom.V1.Model.Rubric{}}` on success + * `{:error, info}` on failure + """ + @spec classroom_courses_course_work_rubrics_create( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Classroom.V1.Model.Rubric.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def classroom_courses_course_work_rubrics_create( + connection, + course_id, + course_work_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:post) + |> Request.url("/v1/courses/{courseId}/courseWork/{courseWorkId}/rubrics", %{ + "courseId" => URI.encode(course_id, &URI.char_unreserved?/1), + "courseWorkId" => URI.encode(course_work_id, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.Rubric{}]) + end + + @doc """ + Deletes a rubric. This request must be made by the Google Cloud console of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding rubric. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project didn't create the corresponding rubric, or if the requesting user isn't permitted to delete the requested rubric. * `NOT_FOUND` if no rubric exists with the requested ID or the user does not have access to the course, course work, or rubric. * `INVALID_ARGUMENT` if grading has already started on the rubric. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Classroom.V1.Connection.t`) - Connection to server + * `course_id` (*type:* `String.t`) - Required. Identifier of the course. + * `course_work_id` (*type:* `String.t`) - Required. Identifier of the course work. + * `id` (*type:* `String.t`) - Required. Identifier of the rubric. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `: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. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `: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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Classroom.V1.Model.Empty{}}` on success + * `{:error, info}` on failure + """ + @spec classroom_courses_course_work_rubrics_delete( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Classroom.V1.Model.Empty.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def classroom_courses_course_work_rubrics_delete( + connection, + course_id, + course_work_id, + id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query + } + + request = + Request.new() + |> Request.method(:delete) + |> Request.url("/v1/courses/{courseId}/courseWork/{courseWorkId}/rubrics/{id}", %{ + "courseId" => URI.encode(course_id, &URI.char_unreserved?/1), + "courseWorkId" => URI.encode(course_work_id, &URI.char_unreserved?/1), + "id" => URI.encode(id, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.Empty{}]) + end + + @doc """ + Returns a rubric. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or rubric doesn't exist or if the user doesn't have access to the corresponding course work. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Classroom.V1.Connection.t`) - Connection to server + * `course_id` (*type:* `String.t`) - Required. Identifier of the course. + * `course_work_id` (*type:* `String.t`) - Required. Identifier of the course work. + * `id` (*type:* `String.t`) - Required. Identifier of the rubric. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `: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. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `: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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Classroom.V1.Model.Rubric{}}` on success + * `{:error, info}` on failure + """ + @spec classroom_courses_course_work_rubrics_get( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Classroom.V1.Model.Rubric.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def classroom_courses_course_work_rubrics_get( + connection, + course_id, + course_work_id, + id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/courses/{courseId}/courseWork/{courseWorkId}/rubrics/{id}", %{ + "courseId" => URI.encode(course_id, &URI.char_unreserved?/1), + "courseWorkId" => URI.encode(course_work_id, &URI.char_unreserved?/1), + "id" => URI.encode(id, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.Rubric{}]) + end + + @doc """ + Returns a list of rubrics that the requester is permitted to view. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work doesn't exist or if the user doesn't have access to the corresponding course work. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Classroom.V1.Connection.t`) - Connection to server + * `course_id` (*type:* `String.t`) - Required. Identifier of the course. + * `course_work_id` (*type:* `String.t`) - Required. Identifier of the course work. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `: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. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `: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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:pageSize` (*type:* `integer()`) - The maximum number of rubrics to return. If unspecified, at most 1 rubric is returned. The maximum value is 1; values above 1 are coerced to 1. + * `:pageToken` (*type:* `String.t`) - nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Classroom.V1.Model.ListRubricsResponse{}}` on success + * `{:error, info}` on failure + """ + @spec classroom_courses_course_work_rubrics_list( + Tesla.Env.client(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Classroom.V1.Model.ListRubricsResponse.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def classroom_courses_course_work_rubrics_list( + connection, + course_id, + course_work_id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :pageSize => :query, + :pageToken => :query + } + + request = + Request.new() + |> Request.method(:get) + |> Request.url("/v1/courses/{courseId}/courseWork/{courseWorkId}/rubrics", %{ + "courseId" => URI.encode(course_id, &URI.char_unreserved?/1), + "courseWorkId" => URI.encode(course_work_id, &URI.char_unreserved?/1) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.ListRubricsResponse{}]) + end + + @doc """ + Updates a rubric. See google.classroom.v1.Rubric for details of which fields can be updated. Rubric update capabilities are [limited](/classroom/rubrics/limitations) once grading has started. This request must be made by the Google Cloud console of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the parent course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project didn't create the corresponding course work, if the user isn't permitted to make the requested modification to the rubric, or for access errors. This error code is also returned if grading has already started on the rubric. * `INVALID_ARGUMENT` if the request is malformed and for the following request error: * `RubricCriteriaInvalidFormat` * `NOT_FOUND` if the requested course, course work, or rubric doesn't exist or if the user doesn't have access to the corresponding course work. * `INTERNAL` if grading has already started on the rubric. + + ## Parameters + + * `connection` (*type:* `GoogleApi.Classroom.V1.Connection.t`) - Connection to server + * `course_id` (*type:* `String.t`) - Required. Identifier of the course. + * `course_work_id` (*type:* `String.t`) - Required. Identifier of the course work. + * `id` (*type:* `String.t`) - Optional. Identifier of the rubric. + * `optional_params` (*type:* `keyword()`) - Optional parameters + * `:"$.xgafv"` (*type:* `String.t`) - V1 error format. + * `:access_token` (*type:* `String.t`) - OAuth access token. + * `:alt` (*type:* `String.t`) - Data format for response. + * `:callback` (*type:* `String.t`) - JSONP + * `:fields` (*type:* `String.t`) - Selector specifying which fields to include in a partial response. + * `: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. + * `:oauth_token` (*type:* `String.t`) - OAuth 2.0 token for the current user. + * `:prettyPrint` (*type:* `boolean()`) - Returns response with indentations and line breaks. + * `: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. + * `:uploadType` (*type:* `String.t`) - Legacy upload protocol for media (e.g. "media", "multipart"). + * `:upload_protocol` (*type:* `String.t`) - Upload protocol for media (e.g. "raw", "multipart"). + * `:updateMask` (*type:* `String.t`) - Optional. Mask that identifies which fields on the rubric to update. This field is required to do an update. The update fails if invalid fields are specified. There are multiple options to define the criteria of a rubric: the `source_spreadsheet_id` and the `criteria` list. Only one of these can be used at a time to define a rubric. The rubric `criteria` list is fully replaced by the rubric criteria specified in the update request. For example, if a criterion or level is missing from the request, it is deleted. New criteria and levels are added and an ID is assigned. Existing criteria and levels retain the previously assigned ID if the ID is specified in the request. The following fields can be specified by teachers: * `criteria` * `source_spreadsheet_id` + * `:body` (*type:* `GoogleApi.Classroom.V1.Model.Rubric.t`) - + * `opts` (*type:* `keyword()`) - Call options + + ## Returns + + * `{:ok, %GoogleApi.Classroom.V1.Model.Rubric{}}` on success + * `{:error, info}` on failure + """ + @spec classroom_courses_course_work_rubrics_patch( + Tesla.Env.client(), + String.t(), + String.t(), + String.t(), + keyword(), + keyword() + ) :: + {:ok, GoogleApi.Classroom.V1.Model.Rubric.t()} + | {:ok, Tesla.Env.t()} + | {:ok, list()} + | {:error, any()} + def classroom_courses_course_work_rubrics_patch( + connection, + course_id, + course_work_id, + id, + optional_params \\ [], + opts \\ [] + ) do + optional_params_config = %{ + :"$.xgafv" => :query, + :access_token => :query, + :alt => :query, + :callback => :query, + :fields => :query, + :key => :query, + :oauth_token => :query, + :prettyPrint => :query, + :quotaUser => :query, + :uploadType => :query, + :upload_protocol => :query, + :updateMask => :query, + :body => :body + } + + request = + Request.new() + |> Request.method(:patch) + |> Request.url("/v1/courses/{courseId}/courseWork/{courseWorkId}/rubrics/{id}", %{ + "courseId" => URI.encode(course_id, &URI.char_unreserved?/1), + "courseWorkId" => URI.encode(course_work_id, &URI.char_unreserved?/1), + "id" => URI.encode(id, &(URI.char_unreserved?(&1) || &1 == ?/)) + }) + |> Request.add_optional_params(optional_params_config, optional_params) + |> Request.library_version(@library_version) + + connection + |> Connection.execute(request) + |> Response.decode(opts ++ [struct: %GoogleApi.Classroom.V1.Model.Rubric{}]) + end + @doc """ Returns a student submission. * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist. diff --git a/clients/classroom/lib/google_api/classroom/v1/metadata.ex b/clients/classroom/lib/google_api/classroom/v1/metadata.ex index 84f7493f18..2c2d257728 100644 --- a/clients/classroom/lib/google_api/classroom/v1/metadata.ex +++ b/clients/classroom/lib/google_api/classroom/v1/metadata.ex @@ -20,7 +20,7 @@ defmodule GoogleApi.Classroom.V1 do API client metadata for GoogleApi.Classroom.V1. """ - @discovery_revision "20241007" + @discovery_revision "20241119" def discovery_revision(), do: @discovery_revision end diff --git a/clients/classroom/lib/google_api/classroom/v1/model/criterion.ex b/clients/classroom/lib/google_api/classroom/v1/model/criterion.ex new file mode 100644 index 0000000000..411751415a --- /dev/null +++ b/clients/classroom/lib/google_api/classroom/v1/model/criterion.ex @@ -0,0 +1,55 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Classroom.V1.Model.Criterion do + @moduledoc """ + A rubric criterion. Each criterion is a dimension on which performance is rated. + + ## Attributes + + * `description` (*type:* `String.t`, *default:* `nil`) - The description of the criterion. + * `id` (*type:* `String.t`, *default:* `nil`) - The criterion ID. On creation, an ID is assigned. + * `levels` (*type:* `list(GoogleApi.Classroom.V1.Model.Level.t)`, *default:* `nil`) - The list of levels within this criterion. + * `title` (*type:* `String.t`, *default:* `nil`) - The title of the criterion. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :description => String.t() | nil, + :id => String.t() | nil, + :levels => list(GoogleApi.Classroom.V1.Model.Level.t()) | nil, + :title => String.t() | nil + } + + field(:description) + field(:id) + field(:levels, as: GoogleApi.Classroom.V1.Model.Level, type: :list) + field(:title) +end + +defimpl Poison.Decoder, for: GoogleApi.Classroom.V1.Model.Criterion do + def decode(value, options) do + GoogleApi.Classroom.V1.Model.Criterion.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Classroom.V1.Model.Criterion do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/classroom/lib/google_api/classroom/v1/model/level.ex b/clients/classroom/lib/google_api/classroom/v1/model/level.ex new file mode 100644 index 0000000000..f73325c252 --- /dev/null +++ b/clients/classroom/lib/google_api/classroom/v1/model/level.ex @@ -0,0 +1,55 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Classroom.V1.Model.Level do + @moduledoc """ + A level of the criterion. + + ## Attributes + + * `description` (*type:* `String.t`, *default:* `nil`) - The description of the level. + * `id` (*type:* `String.t`, *default:* `nil`) - The level ID. On creation, an ID is assigned. + * `points` (*type:* `float()`, *default:* `nil`) - Optional points associated with this level. If set, all levels within the rubric must specify points and the value must be distinct across all levels within a single criterion. 0 is distinct from no points. + * `title` (*type:* `String.t`, *default:* `nil`) - The title of the level. If the level has no points set, title must be set. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :description => String.t() | nil, + :id => String.t() | nil, + :points => float() | nil, + :title => String.t() | nil + } + + field(:description) + field(:id) + field(:points) + field(:title) +end + +defimpl Poison.Decoder, for: GoogleApi.Classroom.V1.Model.Level do + def decode(value, options) do + GoogleApi.Classroom.V1.Model.Level.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Classroom.V1.Model.Level do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/classroom/lib/google_api/classroom/v1/model/list_rubrics_response.ex b/clients/classroom/lib/google_api/classroom/v1/model/list_rubrics_response.ex new file mode 100644 index 0000000000..57ec95e765 --- /dev/null +++ b/clients/classroom/lib/google_api/classroom/v1/model/list_rubrics_response.ex @@ -0,0 +1,49 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Classroom.V1.Model.ListRubricsResponse do + @moduledoc """ + Response when listing rubrics. + + ## Attributes + + * `nextPageToken` (*type:* `String.t`, *default:* `nil`) - Token identifying the next page of results to return. If empty, no further results are available. + * `rubrics` (*type:* `list(GoogleApi.Classroom.V1.Model.Rubric.t)`, *default:* `nil`) - Rubrics that match the request. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :nextPageToken => String.t() | nil, + :rubrics => list(GoogleApi.Classroom.V1.Model.Rubric.t()) | nil + } + + field(:nextPageToken) + field(:rubrics, as: GoogleApi.Classroom.V1.Model.Rubric, type: :list) +end + +defimpl Poison.Decoder, for: GoogleApi.Classroom.V1.Model.ListRubricsResponse do + def decode(value, options) do + GoogleApi.Classroom.V1.Model.ListRubricsResponse.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Classroom.V1.Model.ListRubricsResponse do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/classroom/lib/google_api/classroom/v1/model/rubric.ex b/clients/classroom/lib/google_api/classroom/v1/model/rubric.ex new file mode 100644 index 0000000000..3fdf6e948e --- /dev/null +++ b/clients/classroom/lib/google_api/classroom/v1/model/rubric.ex @@ -0,0 +1,64 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Classroom.V1.Model.Rubric do + @moduledoc """ + The rubric of the course work. A rubric is a scoring guide used to evaluate student work and give feedback. For further details, see [Rubrics structure and known limitations](/classroom/rubrics/limitations). + + ## Attributes + + * `courseId` (*type:* `String.t`, *default:* `nil`) - Identifier of the course. Read-only. + * `courseWorkId` (*type:* `String.t`, *default:* `nil`) - Identifier for the course work this corresponds to. Read-only. + * `creationTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp when this rubric was created. Read-only. + * `criteria` (*type:* `list(GoogleApi.Classroom.V1.Model.Criterion.t)`, *default:* `nil`) - List of criteria. Each criterion is a dimension on which performance is rated. + * `id` (*type:* `String.t`, *default:* `nil`) - Classroom-assigned identifier for the rubric. This is unique among rubrics for the relevant course work. Read-only. + * `sourceSpreadsheetId` (*type:* `String.t`, *default:* `nil`) - Input only. Immutable. Google Sheets ID of the spreadsheet. This spreadsheet must contain formatted rubric settings. See [Create or reuse a rubric for an assignment](https://support.google.com/edu/classroom/answer/9335069). Use of this field requires the `https://www.googleapis.com/auth/spreadsheets.readonly` or `https://www.googleapis.com/auth/spreadsheets` scope. + * `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Timestamp of the most recent change to this rubric. Read-only. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :courseId => String.t() | nil, + :courseWorkId => String.t() | nil, + :creationTime => DateTime.t() | nil, + :criteria => list(GoogleApi.Classroom.V1.Model.Criterion.t()) | nil, + :id => String.t() | nil, + :sourceSpreadsheetId => String.t() | nil, + :updateTime => DateTime.t() | nil + } + + field(:courseId) + field(:courseWorkId) + field(:creationTime, as: DateTime) + field(:criteria, as: GoogleApi.Classroom.V1.Model.Criterion, type: :list) + field(:id) + field(:sourceSpreadsheetId) + field(:updateTime, as: DateTime) +end + +defimpl Poison.Decoder, for: GoogleApi.Classroom.V1.Model.Rubric do + def decode(value, options) do + GoogleApi.Classroom.V1.Model.Rubric.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Classroom.V1.Model.Rubric do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/classroom/lib/google_api/classroom/v1/model/rubric_grade.ex b/clients/classroom/lib/google_api/classroom/v1/model/rubric_grade.ex new file mode 100644 index 0000000000..f3c4137362 --- /dev/null +++ b/clients/classroom/lib/google_api/classroom/v1/model/rubric_grade.ex @@ -0,0 +1,52 @@ +# Copyright 2019 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# NOTE: This file is auto generated by the elixir code generator program. +# Do not edit this file manually. + +defmodule GoogleApi.Classroom.V1.Model.RubricGrade do + @moduledoc """ + A rubric grade set for the student submission. There is at most one entry per rubric criterion. + + ## Attributes + + * `criterionId` (*type:* `String.t`, *default:* `nil`) - Optional. Criterion ID. + * `levelId` (*type:* `String.t`, *default:* `nil`) - Optional. Optional level ID of the selected level. If empty, no level was selected. + * `points` (*type:* `float()`, *default:* `nil`) - Optional. Optional points assigned for this criterion, typically based on the level. Levels might or might not have points. If unset, no points were set for this criterion. + """ + + use GoogleApi.Gax.ModelBase + + @type t :: %__MODULE__{ + :criterionId => String.t() | nil, + :levelId => String.t() | nil, + :points => float() | nil + } + + field(:criterionId) + field(:levelId) + field(:points) +end + +defimpl Poison.Decoder, for: GoogleApi.Classroom.V1.Model.RubricGrade do + def decode(value, options) do + GoogleApi.Classroom.V1.Model.RubricGrade.decode(value, options) + end +end + +defimpl Poison.Encoder, for: GoogleApi.Classroom.V1.Model.RubricGrade do + def encode(value, options) do + GoogleApi.Gax.ModelBase.encode(value, options) + end +end diff --git a/clients/classroom/lib/google_api/classroom/v1/model/student_submission.ex b/clients/classroom/lib/google_api/classroom/v1/model/student_submission.ex index 28425913ca..1a8f7e0234 100644 --- a/clients/classroom/lib/google_api/classroom/v1/model/student_submission.ex +++ b/clients/classroom/lib/google_api/classroom/v1/model/student_submission.ex @@ -23,6 +23,7 @@ defmodule GoogleApi.Classroom.V1.Model.StudentSubmission do * `alternateLink` (*type:* `String.t`, *default:* `nil`) - Absolute link to the submission in the Classroom web UI. Read-only. * `assignedGrade` (*type:* `float()`, *default:* `nil`) - Optional grade. If unset, no grade was set. This value must be non-negative. Decimal (that is, non-integer) values are allowed, but are rounded to two decimal places. This may be modified only by course teachers. + * `assignedRubricGrades` (*type:* `%{optional(String.t) => GoogleApi.Classroom.V1.Model.RubricGrade.t}`, *default:* `nil`) - Assigned rubric grades based on the rubric's Criteria. This map is empty if there is no rubric attached to this course work or if a rubric is attached, but no grades have been set on any Criteria. Entries are only populated for grades that have been set. Key: The rubric's criterion ID. Read-only. * `assignmentSubmission` (*type:* `GoogleApi.Classroom.V1.Model.AssignmentSubmission.t`, *default:* `nil`) - Submission content when course_work_type is ASSIGNMENT. Students can modify this content using ModifyAttachments. * `associatedWithDeveloper` (*type:* `boolean()`, *default:* `nil`) - Whether this student submission is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only. * `courseId` (*type:* `String.t`, *default:* `nil`) - Identifier of the course. Read-only. @@ -30,6 +31,7 @@ defmodule GoogleApi.Classroom.V1.Model.StudentSubmission do * `courseWorkType` (*type:* `String.t`, *default:* `nil`) - Type of course work this submission is for. Read-only. * `creationTime` (*type:* `DateTime.t`, *default:* `nil`) - Creation time of this submission. This may be unset if the student has not accessed this item. Read-only. * `draftGrade` (*type:* `float()`, *default:* `nil`) - Optional pending grade. If unset, no grade was set. This value must be non-negative. Decimal (that is, non-integer) values are allowed, but are rounded to two decimal places. This is only visible to and modifiable by course teachers. + * `draftRubricGrades` (*type:* `%{optional(String.t) => GoogleApi.Classroom.V1.Model.RubricGrade.t}`, *default:* `nil`) - Pending rubric grades based on the rubric's criteria. This map is empty if there is no rubric attached to this course work or if a rubric is attached, but no grades have been set on any criteria. Entries are only populated for grades that have been set. Key: The rubric's criterion ID. Read-only. * `id` (*type:* `String.t`, *default:* `nil`) - Classroom-assigned Identifier for the student submission. This is unique among submissions for the relevant course work. Read-only. * `late` (*type:* `boolean()`, *default:* `nil`) - Whether this submission is late. Read-only. * `multipleChoiceSubmission` (*type:* `GoogleApi.Classroom.V1.Model.MultipleChoiceSubmission.t`, *default:* `nil`) - Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. @@ -45,6 +47,8 @@ defmodule GoogleApi.Classroom.V1.Model.StudentSubmission do @type t :: %__MODULE__{ :alternateLink => String.t() | nil, :assignedGrade => float() | nil, + :assignedRubricGrades => + %{optional(String.t()) => GoogleApi.Classroom.V1.Model.RubricGrade.t()} | nil, :assignmentSubmission => GoogleApi.Classroom.V1.Model.AssignmentSubmission.t() | nil, :associatedWithDeveloper => boolean() | nil, :courseId => String.t() | nil, @@ -52,6 +56,8 @@ defmodule GoogleApi.Classroom.V1.Model.StudentSubmission do :courseWorkType => String.t() | nil, :creationTime => DateTime.t() | nil, :draftGrade => float() | nil, + :draftRubricGrades => + %{optional(String.t()) => GoogleApi.Classroom.V1.Model.RubricGrade.t()} | nil, :id => String.t() | nil, :late => boolean() | nil, :multipleChoiceSubmission => @@ -65,6 +71,7 @@ defmodule GoogleApi.Classroom.V1.Model.StudentSubmission do field(:alternateLink) field(:assignedGrade) + field(:assignedRubricGrades, as: GoogleApi.Classroom.V1.Model.RubricGrade, type: :map) field(:assignmentSubmission, as: GoogleApi.Classroom.V1.Model.AssignmentSubmission) field(:associatedWithDeveloper) field(:courseId) @@ -72,6 +79,7 @@ defmodule GoogleApi.Classroom.V1.Model.StudentSubmission do field(:courseWorkType) field(:creationTime, as: DateTime) field(:draftGrade) + field(:draftRubricGrades, as: GoogleApi.Classroom.V1.Model.RubricGrade, type: :map) field(:id) field(:late) field(:multipleChoiceSubmission, as: GoogleApi.Classroom.V1.Model.MultipleChoiceSubmission) diff --git a/clients/classroom/mix.exs b/clients/classroom/mix.exs index 4c0a77c335..e1dd48a2dd 100644 --- a/clients/classroom/mix.exs +++ b/clients/classroom/mix.exs @@ -18,7 +18,7 @@ defmodule GoogleApi.Classroom.Mixfile do use Mix.Project - @version "0.21.2" + @version "0.22.0" def project() do [