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 *6.0.0+20240617*, where *20240617* is the exact revision of the *classroom:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v6.0.0*.
6//!
7//! Everything else about the *classroom* *v1* API can be found at the
8//! [official documentation site](https://developers.google.com/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 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 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), [*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) and [*update*](api::CourseUpdateCall)
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_student_submissions_get(...).doit().await
79//! let r = hub.courses().course_work_student_submissions_list(...).doit().await
80//! let r = hub.courses().course_work_student_submissions_modify_attachments(...).doit().await
81//! let r = hub.courses().course_work_student_submissions_patch(...).doit().await
82//! let r = hub.courses().course_work_student_submissions_reclaim(...).doit().await
83//! let r = hub.courses().course_work_student_submissions_return(...).doit().await
84//! let r = hub.courses().course_work_student_submissions_turn_in(...).doit().await
85//! let r = hub.courses().course_work_create(...).doit().await
86//! let r = hub.courses().course_work_delete(...).doit().await
87//! let r = hub.courses().course_work_get(...).doit().await
88//! let r = hub.courses().course_work_get_add_on_context(...).doit().await
89//! let r = hub.courses().course_work_list(...).doit().await
90//! let r = hub.courses().course_work_modify_assignees(...).doit().await
91//! let r = hub.courses().course_work_patch(...).doit().await
92//! let r = hub.courses().course_work_materials_add_on_attachments_create(...).doit().await
93//! let r = hub.courses().course_work_materials_add_on_attachments_delete(...).doit().await
94//! let r = hub.courses().course_work_materials_add_on_attachments_get(...).doit().await
95//! let r = hub.courses().course_work_materials_add_on_attachments_list(...).doit().await
96//! let r = hub.courses().course_work_materials_add_on_attachments_patch(...).doit().await
97//! let r = hub.courses().course_work_materials_create(...).doit().await
98//! let r = hub.courses().course_work_materials_delete(...).doit().await
99//! let r = hub.courses().course_work_materials_get(...).doit().await
100//! let r = hub.courses().course_work_materials_get_add_on_context(...).doit().await
101//! let r = hub.courses().course_work_materials_list(...).doit().await
102//! let r = hub.courses().course_work_materials_patch(...).doit().await
103//! let r = hub.courses().posts_add_on_attachments_student_submissions_get(...).doit().await
104//! let r = hub.courses().posts_add_on_attachments_student_submissions_patch(...).doit().await
105//! let r = hub.courses().posts_add_on_attachments_create(...).doit().await
106//! let r = hub.courses().posts_add_on_attachments_delete(...).doit().await
107//! let r = hub.courses().posts_add_on_attachments_get(...).doit().await
108//! let r = hub.courses().posts_add_on_attachments_list(...).doit().await
109//! let r = hub.courses().posts_add_on_attachments_patch(...).doit().await
110//! let r = hub.courses().posts_get_add_on_context(...).doit().await
111//! let r = hub.courses().students_create(...).doit().await
112//! let r = hub.courses().students_delete(...).doit().await
113//! let r = hub.courses().students_get(...).doit().await
114//! let r = hub.courses().students_list(...).doit().await
115//! let r = hub.courses().teachers_create(...).doit().await
116//! let r = hub.courses().teachers_delete(...).doit().await
117//! let r = hub.courses().teachers_get(...).doit().await
118//! let r = hub.courses().teachers_list(...).doit().await
119//! let r = hub.courses().topics_create(...).doit().await
120//! let r = hub.courses().topics_delete(...).doit().await
121//! let r = hub.courses().topics_get(...).doit().await
122//! let r = hub.courses().topics_list(...).doit().await
123//! let r = hub.courses().topics_patch(...).doit().await
124//! let r = hub.courses().create(...).doit().await
125//! let r = hub.courses().delete(...).doit().await
126//! let r = hub.courses().get(...).doit().await
127//! let r = hub.courses().list(...).doit().await
128//! let r = hub.courses().patch(...).doit().await
129//! let r = hub.courses().update(...).doit().await
130//! ```
131//!
132//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
133//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
134//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
135//! The `doit()` method performs the actual communication with the server and returns the respective result.
136//!
137//! # Usage
138//!
139//! ## Setting up your Project
140//!
141//! To use this library, you would put the following lines into your `Cargo.toml` file:
142//!
143//! ```toml
144//! [dependencies]
145//! google-classroom1 = "*"
146//! serde = "1"
147//! serde_json = "1"
148//! ```
149//!
150//! ## A complete example
151//!
152//! ```test_harness,no_run
153//! extern crate hyper;
154//! extern crate hyper_rustls;
155//! extern crate google_classroom1 as classroom1;
156//! use classroom1::api::AddOnAttachmentStudentSubmission;
157//! use classroom1::{Result, Error};
158//! # async fn dox() {
159//! use classroom1::{Classroom, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
160//!
161//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
162//! // `client_secret`, among other things.
163//! let secret: yup_oauth2::ApplicationSecret = Default::default();
164//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
165//! // unless you replace `None` with the desired Flow.
166//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
167//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
168//! // retrieve them from storage.
169//! let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
170//! secret,
171//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
172//! ).build().await.unwrap();
173//!
174//! let client = hyper_util::client::legacy::Client::builder(
175//! hyper_util::rt::TokioExecutor::new()
176//! )
177//! .build(
178//! hyper_rustls::HttpsConnectorBuilder::new()
179//! .with_native_roots()
180//! .unwrap()
181//! .https_or_http()
182//! .enable_http1()
183//! .build()
184//! );
185//! let mut hub = Classroom::new(client, auth);
186//! // As the method needs a request, you would usually fill it with the desired information
187//! // into the respective structure. Some of the parts shown here might not be applicable !
188//! // Values shown here are possibly random and not representative !
189//! let mut req = AddOnAttachmentStudentSubmission::default();
190//!
191//! // You can configure optional parameters by calling the respective setters at will, and
192//! // execute the final call using `doit()`.
193//! // Values shown here are possibly random and not representative !
194//! let result = hub.courses().course_work_add_on_attachments_student_submissions_patch(req, "courseId", "itemId", "attachmentId", "submissionId")
195//! .update_mask(FieldMask::new::<&str>(&[]))
196//! .post_id("takimata")
197//! .doit().await;
198//!
199//! match result {
200//! Err(e) => match e {
201//! // The Error enum provides details about what exactly happened.
202//! // You can also just use its `Debug`, `Display` or `Error` traits
203//! Error::HttpError(_)
204//! |Error::Io(_)
205//! |Error::MissingAPIKey
206//! |Error::MissingToken(_)
207//! |Error::Cancelled
208//! |Error::UploadSizeLimitExceeded(_, _)
209//! |Error::Failure(_)
210//! |Error::BadRequest(_)
211//! |Error::FieldClash(_)
212//! |Error::JsonDecodeError(_, _) => println!("{}", e),
213//! },
214//! Ok(res) => println!("Success: {:?}", res),
215//! }
216//! # }
217//! ```
218//! ## Handling Errors
219//!
220//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
221//! the doit() methods, or handed as possibly intermediate results to either the
222//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
223//!
224//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
225//! makes the system potentially resilient to all kinds of errors.
226//!
227//! ## Uploads and Downloads
228//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
229//! read by you to obtain the media.
230//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
231//! 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
232//! this call: `.param("alt", "media")`.
233//!
234//! Methods supporting uploads can do so using up to 2 different protocols:
235//! *simple* and *resumable*. The distinctiveness of each is represented by customized
236//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
237//!
238//! ## Customization and Callbacks
239//!
240//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
241//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
242//! Respective methods will be called to provide progress information, as well as determine whether the system should
243//! retry on failure.
244//!
245//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
246//!
247//! ## Optional Parts in Server-Requests
248//!
249//! All structures provided by this library are made to be [encodable](common::RequestValue) and
250//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
251//! are valid.
252//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
253//! the server to indicate either the set parts of the request or the desired parts in the response.
254//!
255//! ## Builder Arguments
256//!
257//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
258//! These will always take a single argument, for which the following statements are true.
259//!
260//! * [PODs][wiki-pod] are handed by copy
261//! * strings are passed as `&str`
262//! * [request values](common::RequestValue) are moved
263//!
264//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
265//!
266//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
267//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
268//! [google-go-api]: https://github.com/google/google-api-go-client
269//!
270//! ## Cargo Features
271//!
272//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
273//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
274//! generated `openapi` spec would be invalid.
275//!
276//!
277//!
278
279// Unused attributes happen thanks to defined, but unused structures We don't
280// warn about this, as depending on the API, some data structures or facilities
281// are never used. Instead of pre-determining this, we just disable the lint.
282// It's manually tuned to not have any unused imports in fully featured APIs.
283// Same with unused_mut.
284#![allow(unused_imports, unused_mut, dead_code)]
285
286// DO NOT EDIT !
287// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
288// DO NOT EDIT !
289
290pub extern crate hyper;
291pub extern crate hyper_rustls;
292pub extern crate hyper_util;
293#[cfg(feature = "yup-oauth2")]
294pub extern crate yup_oauth2;
295
296pub extern crate google_apis_common as common;
297pub use common::{Delegate, Error, FieldMask, Result};
298
299pub mod api;
300pub use api::Classroom;