google_classroom1/
lib.rs

1// DO NOT EDIT !
2// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
3// DO NOT EDIT !
4
5//! This documentation was generated from *classroom* crate version *7.0.0+20251217*, where *20251217* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *classroom* *v1* API can be found at the
8//! [official documentation site](https://developers.google.com/workspace/classroom/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/classroom1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](Classroom) ...
13//!
14//! * [courses](api::Course)
15//!  * [*aliases create*](api::CourseAliasCreateCall), [*aliases delete*](api::CourseAliasDeleteCall), [*aliases list*](api::CourseAliasListCall), [*announcements add on attachments create*](api::CourseAnnouncementAddOnAttachmentCreateCall), [*announcements add on attachments delete*](api::CourseAnnouncementAddOnAttachmentDeleteCall), [*announcements add on attachments get*](api::CourseAnnouncementAddOnAttachmentGetCall), [*announcements add on attachments list*](api::CourseAnnouncementAddOnAttachmentListCall), [*announcements add on attachments patch*](api::CourseAnnouncementAddOnAttachmentPatchCall), [*announcements create*](api::CourseAnnouncementCreateCall), [*announcements delete*](api::CourseAnnouncementDeleteCall), [*announcements get*](api::CourseAnnouncementGetCall), [*announcements get add on context*](api::CourseAnnouncementGetAddOnContextCall), [*announcements list*](api::CourseAnnouncementListCall), [*announcements modify assignees*](api::CourseAnnouncementModifyAssigneeCall), [*announcements patch*](api::CourseAnnouncementPatchCall), [*course work add on attachments create*](api::CourseCourseWorkAddOnAttachmentCreateCall), [*course work add on attachments delete*](api::CourseCourseWorkAddOnAttachmentDeleteCall), [*course work add on attachments get*](api::CourseCourseWorkAddOnAttachmentGetCall), [*course work add on attachments list*](api::CourseCourseWorkAddOnAttachmentListCall), [*course work add on attachments patch*](api::CourseCourseWorkAddOnAttachmentPatchCall), [*course work add on attachments student submissions get*](api::CourseCourseWorkAddOnAttachmentStudentSubmissionGetCall), [*course work add on attachments student submissions patch*](api::CourseCourseWorkAddOnAttachmentStudentSubmissionPatchCall), [*course work create*](api::CourseCourseWorkCreateCall), [*course work delete*](api::CourseCourseWorkDeleteCall), [*course work get*](api::CourseCourseWorkGetCall), [*course work get add on context*](api::CourseCourseWorkGetAddOnContextCall), [*course work list*](api::CourseCourseWorkListCall), [*course work modify assignees*](api::CourseCourseWorkModifyAssigneeCall), [*course work patch*](api::CourseCourseWorkPatchCall), [*course work rubrics create*](api::CourseCourseWorkRubricCreateCall), [*course work rubrics delete*](api::CourseCourseWorkRubricDeleteCall), [*course work rubrics get*](api::CourseCourseWorkRubricGetCall), [*course work rubrics list*](api::CourseCourseWorkRubricListCall), [*course work rubrics patch*](api::CourseCourseWorkRubricPatchCall), [*course work student submissions get*](api::CourseCourseWorkStudentSubmissionGetCall), [*course work student submissions list*](api::CourseCourseWorkStudentSubmissionListCall), [*course work student submissions modify attachments*](api::CourseCourseWorkStudentSubmissionModifyAttachmentCall), [*course work student submissions patch*](api::CourseCourseWorkStudentSubmissionPatchCall), [*course work student submissions reclaim*](api::CourseCourseWorkStudentSubmissionReclaimCall), [*course work student submissions return*](api::CourseCourseWorkStudentSubmissionReturnCall), [*course work student submissions turn in*](api::CourseCourseWorkStudentSubmissionTurnInCall), [*course work update rubric*](api::CourseCourseWorkUpdateRubricCall), [*course work materials add on attachments create*](api::CourseCourseWorkMaterialAddOnAttachmentCreateCall), [*course work materials add on attachments delete*](api::CourseCourseWorkMaterialAddOnAttachmentDeleteCall), [*course work materials add on attachments get*](api::CourseCourseWorkMaterialAddOnAttachmentGetCall), [*course work materials add on attachments list*](api::CourseCourseWorkMaterialAddOnAttachmentListCall), [*course work materials add on attachments patch*](api::CourseCourseWorkMaterialAddOnAttachmentPatchCall), [*course work materials create*](api::CourseCourseWorkMaterialCreateCall), [*course work materials delete*](api::CourseCourseWorkMaterialDeleteCall), [*course work materials get*](api::CourseCourseWorkMaterialGetCall), [*course work materials get add on context*](api::CourseCourseWorkMaterialGetAddOnContextCall), [*course work materials list*](api::CourseCourseWorkMaterialListCall), [*course work materials patch*](api::CourseCourseWorkMaterialPatchCall), [*create*](api::CourseCreateCall), [*delete*](api::CourseDeleteCall), [*get*](api::CourseGetCall), [*get grading period settings*](api::CourseGetGradingPeriodSettingCall), [*list*](api::CourseListCall), [*patch*](api::CoursePatchCall), [*posts add on attachments create*](api::CoursePostAddOnAttachmentCreateCall), [*posts add on attachments delete*](api::CoursePostAddOnAttachmentDeleteCall), [*posts add on attachments get*](api::CoursePostAddOnAttachmentGetCall), [*posts add on attachments list*](api::CoursePostAddOnAttachmentListCall), [*posts add on attachments patch*](api::CoursePostAddOnAttachmentPatchCall), [*posts add on attachments student submissions get*](api::CoursePostAddOnAttachmentStudentSubmissionGetCall), [*posts add on attachments student submissions patch*](api::CoursePostAddOnAttachmentStudentSubmissionPatchCall), [*posts get add on context*](api::CoursePostGetAddOnContextCall), [*students create*](api::CourseStudentCreateCall), [*students delete*](api::CourseStudentDeleteCall), [*students get*](api::CourseStudentGetCall), [*students list*](api::CourseStudentListCall), [*teachers create*](api::CourseTeacherCreateCall), [*teachers delete*](api::CourseTeacherDeleteCall), [*teachers get*](api::CourseTeacherGetCall), [*teachers list*](api::CourseTeacherListCall), [*topics create*](api::CourseTopicCreateCall), [*topics delete*](api::CourseTopicDeleteCall), [*topics get*](api::CourseTopicGetCall), [*topics list*](api::CourseTopicListCall), [*topics patch*](api::CourseTopicPatchCall), [*update*](api::CourseUpdateCall) and [*update grading period settings*](api::CourseUpdateGradingPeriodSettingCall)
16//! * [invitations](api::Invitation)
17//!  * [*accept*](api::InvitationAcceptCall), [*create*](api::InvitationCreateCall), [*delete*](api::InvitationDeleteCall), [*get*](api::InvitationGetCall) and [*list*](api::InvitationListCall)
18//! * [registrations](api::Registration)
19//!  * [*create*](api::RegistrationCreateCall) and [*delete*](api::RegistrationDeleteCall)
20//! * [user profiles](api::UserProfile)
21//!  * [*get*](api::UserProfileGetCall), [*guardian invitations create*](api::UserProfileGuardianInvitationCreateCall), [*guardian invitations get*](api::UserProfileGuardianInvitationGetCall), [*guardian invitations list*](api::UserProfileGuardianInvitationListCall), [*guardian invitations patch*](api::UserProfileGuardianInvitationPatchCall), [*guardians delete*](api::UserProfileGuardianDeleteCall), [*guardians get*](api::UserProfileGuardianGetCall) and [*guardians list*](api::UserProfileGuardianListCall)
22//!
23//!
24//!
25//!
26//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
27//!
28//! # Structure of this Library
29//!
30//! The API is structured into the following primary items:
31//!
32//! * **[Hub](Classroom)**
33//!     * a central object to maintain state and allow accessing all *Activities*
34//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
35//!       allow access to individual [*Call Builders*](common::CallBuilder)
36//! * **[Resources](common::Resource)**
37//!     * primary types that you can apply *Activities* to
38//!     * a collection of properties and *Parts*
39//!     * **[Parts](common::Part)**
40//!         * a collection of properties
41//!         * never directly used in *Activities*
42//! * **[Activities](common::CallBuilder)**
43//!     * operations to apply to *Resources*
44//!
45//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
46//!
47//! Generally speaking, you can invoke *Activities* like this:
48//!
49//! ```Rust,ignore
50//! let r = hub.resource().activity(...).doit().await
51//! ```
52//!
53//! Or specifically ...
54//!
55//! ```ignore
56//! let r = hub.courses().aliases_create(...).doit().await
57//! let r = hub.courses().aliases_delete(...).doit().await
58//! let r = hub.courses().aliases_list(...).doit().await
59//! let r = hub.courses().announcements_add_on_attachments_create(...).doit().await
60//! let r = hub.courses().announcements_add_on_attachments_delete(...).doit().await
61//! let r = hub.courses().announcements_add_on_attachments_get(...).doit().await
62//! let r = hub.courses().announcements_add_on_attachments_list(...).doit().await
63//! let r = hub.courses().announcements_add_on_attachments_patch(...).doit().await
64//! let r = hub.courses().announcements_create(...).doit().await
65//! let r = hub.courses().announcements_delete(...).doit().await
66//! let r = hub.courses().announcements_get(...).doit().await
67//! let r = hub.courses().announcements_get_add_on_context(...).doit().await
68//! let r = hub.courses().announcements_list(...).doit().await
69//! let r = hub.courses().announcements_modify_assignees(...).doit().await
70//! let r = hub.courses().announcements_patch(...).doit().await
71//! let r = hub.courses().course_work_add_on_attachments_student_submissions_get(...).doit().await
72//! let r = hub.courses().course_work_add_on_attachments_student_submissions_patch(...).doit().await
73//! let r = hub.courses().course_work_add_on_attachments_create(...).doit().await
74//! let r = hub.courses().course_work_add_on_attachments_delete(...).doit().await
75//! let r = hub.courses().course_work_add_on_attachments_get(...).doit().await
76//! let r = hub.courses().course_work_add_on_attachments_list(...).doit().await
77//! let r = hub.courses().course_work_add_on_attachments_patch(...).doit().await
78//! let r = hub.courses().course_work_rubrics_create(...).doit().await
79//! let r = hub.courses().course_work_rubrics_delete(...).doit().await
80//! let r = hub.courses().course_work_rubrics_get(...).doit().await
81//! let r = hub.courses().course_work_rubrics_list(...).doit().await
82//! let r = hub.courses().course_work_rubrics_patch(...).doit().await
83//! let r = hub.courses().course_work_student_submissions_get(...).doit().await
84//! let r = hub.courses().course_work_student_submissions_list(...).doit().await
85//! let r = hub.courses().course_work_student_submissions_modify_attachments(...).doit().await
86//! let r = hub.courses().course_work_student_submissions_patch(...).doit().await
87//! let r = hub.courses().course_work_student_submissions_reclaim(...).doit().await
88//! let r = hub.courses().course_work_student_submissions_return(...).doit().await
89//! let r = hub.courses().course_work_student_submissions_turn_in(...).doit().await
90//! let r = hub.courses().course_work_create(...).doit().await
91//! let r = hub.courses().course_work_delete(...).doit().await
92//! let r = hub.courses().course_work_get(...).doit().await
93//! let r = hub.courses().course_work_get_add_on_context(...).doit().await
94//! let r = hub.courses().course_work_list(...).doit().await
95//! let r = hub.courses().course_work_modify_assignees(...).doit().await
96//! let r = hub.courses().course_work_patch(...).doit().await
97//! let r = hub.courses().course_work_update_rubric(...).doit().await
98//! let r = hub.courses().course_work_materials_add_on_attachments_create(...).doit().await
99//! let r = hub.courses().course_work_materials_add_on_attachments_delete(...).doit().await
100//! let r = hub.courses().course_work_materials_add_on_attachments_get(...).doit().await
101//! let r = hub.courses().course_work_materials_add_on_attachments_list(...).doit().await
102//! let r = hub.courses().course_work_materials_add_on_attachments_patch(...).doit().await
103//! let r = hub.courses().course_work_materials_create(...).doit().await
104//! let r = hub.courses().course_work_materials_delete(...).doit().await
105//! let r = hub.courses().course_work_materials_get(...).doit().await
106//! let r = hub.courses().course_work_materials_get_add_on_context(...).doit().await
107//! let r = hub.courses().course_work_materials_list(...).doit().await
108//! let r = hub.courses().course_work_materials_patch(...).doit().await
109//! let r = hub.courses().posts_add_on_attachments_student_submissions_get(...).doit().await
110//! let r = hub.courses().posts_add_on_attachments_student_submissions_patch(...).doit().await
111//! let r = hub.courses().posts_add_on_attachments_create(...).doit().await
112//! let r = hub.courses().posts_add_on_attachments_delete(...).doit().await
113//! let r = hub.courses().posts_add_on_attachments_get(...).doit().await
114//! let r = hub.courses().posts_add_on_attachments_list(...).doit().await
115//! let r = hub.courses().posts_add_on_attachments_patch(...).doit().await
116//! let r = hub.courses().posts_get_add_on_context(...).doit().await
117//! let r = hub.courses().students_create(...).doit().await
118//! let r = hub.courses().students_delete(...).doit().await
119//! let r = hub.courses().students_get(...).doit().await
120//! let r = hub.courses().students_list(...).doit().await
121//! let r = hub.courses().teachers_create(...).doit().await
122//! let r = hub.courses().teachers_delete(...).doit().await
123//! let r = hub.courses().teachers_get(...).doit().await
124//! let r = hub.courses().teachers_list(...).doit().await
125//! let r = hub.courses().topics_create(...).doit().await
126//! let r = hub.courses().topics_delete(...).doit().await
127//! let r = hub.courses().topics_get(...).doit().await
128//! let r = hub.courses().topics_list(...).doit().await
129//! let r = hub.courses().topics_patch(...).doit().await
130//! let r = hub.courses().create(...).doit().await
131//! let r = hub.courses().delete(...).doit().await
132//! let r = hub.courses().get(...).doit().await
133//! let r = hub.courses().get_grading_period_settings(...).doit().await
134//! let r = hub.courses().list(...).doit().await
135//! let r = hub.courses().patch(...).doit().await
136//! let r = hub.courses().update(...).doit().await
137//! let r = hub.courses().update_grading_period_settings(...).doit().await
138//! ```
139//!
140//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
141//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
142//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
143//! The `doit()` method performs the actual communication with the server and returns the respective result.
144//!
145//! # Usage
146//!
147//! ## Setting up your Project
148//!
149//! To use this library, you would put the following lines into your `Cargo.toml` file:
150//!
151//! ```toml
152//! [dependencies]
153//! google-classroom1 = "*"
154//! serde = "1"
155//! serde_json = "1"
156//! ```
157//!
158//! ## A complete example
159//!
160//! ```test_harness,no_run
161//! extern crate hyper;
162//! extern crate hyper_rustls;
163//! extern crate google_classroom1 as classroom1;
164//! use classroom1::api::AddOnAttachmentStudentSubmission;
165//! use classroom1::{Result, Error};
166//! # async fn dox() {
167//! use classroom1::{Classroom, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
168//!
169//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
170//! // `client_secret`, among other things.
171//! let secret: yup_oauth2::ApplicationSecret = Default::default();
172//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
173//! // unless you replace  `None` with the desired Flow.
174//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
175//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
176//! // retrieve them from storage.
177//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
178//!     .with_native_roots()
179//!     .unwrap()
180//!     .https_only()
181//!     .enable_http2()
182//!     .build();
183//!
184//! let executor = hyper_util::rt::TokioExecutor::new();
185//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
186//!     secret,
187//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
188//!     yup_oauth2::client::CustomHyperClientBuilder::from(
189//!         hyper_util::client::legacy::Client::builder(executor).build(connector),
190//!     ),
191//! ).build().await.unwrap();
192//!
193//! let client = hyper_util::client::legacy::Client::builder(
194//!     hyper_util::rt::TokioExecutor::new()
195//! )
196//! .build(
197//!     hyper_rustls::HttpsConnectorBuilder::new()
198//!         .with_native_roots()
199//!         .unwrap()
200//!         .https_or_http()
201//!         .enable_http2()
202//!         .build()
203//! );
204//! let mut hub = Classroom::new(client, auth);
205//! // As the method needs a request, you would usually fill it with the desired information
206//! // into the respective structure. Some of the parts shown here might not be applicable !
207//! // Values shown here are possibly random and not representative !
208//! let mut req = AddOnAttachmentStudentSubmission::default();
209//!
210//! // You can configure optional parameters by calling the respective setters at will, and
211//! // execute the final call using `doit()`.
212//! // Values shown here are possibly random and not representative !
213//! let result = hub.courses().course_work_add_on_attachments_student_submissions_patch(req, "courseId", "itemId", "attachmentId", "submissionId")
214//!              .update_mask(FieldMask::new::<&str>(&[]))
215//!              .post_id("takimata")
216//!              .doit().await;
217//!
218//! match result {
219//!     Err(e) => match e {
220//!         // The Error enum provides details about what exactly happened.
221//!         // You can also just use its `Debug`, `Display` or `Error` traits
222//!          Error::HttpError(_)
223//!         |Error::Io(_)
224//!         |Error::MissingAPIKey
225//!         |Error::MissingToken(_)
226//!         |Error::Cancelled
227//!         |Error::UploadSizeLimitExceeded(_, _)
228//!         |Error::Failure(_)
229//!         |Error::BadRequest(_)
230//!         |Error::FieldClash(_)
231//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
232//!     },
233//!     Ok(res) => println!("Success: {:?}", res),
234//! }
235//! # }
236//! ```
237//! ## Handling Errors
238//!
239//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
240//! the doit() methods, or handed as possibly intermediate results to either the
241//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
242//!
243//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
244//! makes the system potentially resilient to all kinds of errors.
245//!
246//! ## Uploads and Downloads
247//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
248//! read by you to obtain the media.
249//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
250//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
251//! this call: `.param("alt", "media")`.
252//!
253//! Methods supporting uploads can do so using up to 2 different protocols:
254//! *simple* and *resumable*. The distinctiveness of each is represented by customized
255//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
256//!
257//! ## Customization and Callbacks
258//!
259//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
260//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
261//! Respective methods will be called to provide progress information, as well as determine whether the system should
262//! retry on failure.
263//!
264//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
265//!
266//! ## Optional Parts in Server-Requests
267//!
268//! All structures provided by this library are made to be [encodable](common::RequestValue) and
269//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
270//! are valid.
271//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
272//! the server to indicate either the set parts of the request or the desired parts in the response.
273//!
274//! ## Builder Arguments
275//!
276//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
277//! These will always take a single argument, for which the following statements are true.
278//!
279//! * [PODs][wiki-pod] are handed by copy
280//! * strings are passed as `&str`
281//! * [request values](common::RequestValue) are moved
282//!
283//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
284//!
285//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
286//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
287//! [google-go-api]: https://github.com/google/google-api-go-client
288//!
289//! ## Cargo Features
290//!
291//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
292//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
293//! generated `openapi` spec would be invalid.
294//!
295//!
296//!
297
298// Unused attributes happen thanks to defined, but unused structures We don't
299// warn about this, as depending on the API, some data structures or facilities
300// are never used. Instead of pre-determining this, we just disable the lint.
301// It's manually tuned to not have any unused imports in fully featured APIs.
302// Same with unused_mut.
303#![allow(unused_imports, unused_mut, dead_code)]
304
305// DO NOT EDIT !
306// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
307// DO NOT EDIT !
308
309pub extern crate hyper;
310pub extern crate hyper_rustls;
311pub extern crate hyper_util;
312#[cfg(feature = "yup-oauth2")]
313pub extern crate yup_oauth2;
314
315pub extern crate google_apis_common as common;
316pub use common::{Delegate, Error, FieldMask, Result};
317
318pub mod api;
319pub use api::Classroom;