google_calendar3/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 *calendar* crate version *7.0.0+20251214*, where *20251214* is the exact revision of the *calendar:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *calendar* *v3* API can be found at the
8//! [official documentation site](https://developers.google.com/workspace/calendar/firstapp).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/calendar3).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](CalendarHub) ...
13//!
14//! * [acl](api::Acl)
15//! * [*delete*](api::AclDeleteCall), [*get*](api::AclGetCall), [*insert*](api::AclInsertCall), [*list*](api::AclListCall), [*patch*](api::AclPatchCall), [*update*](api::AclUpdateCall) and [*watch*](api::AclWatchCall)
16//! * [calendar list](api::CalendarList)
17//! * [*delete*](api::CalendarListDeleteCall), [*get*](api::CalendarListGetCall), [*insert*](api::CalendarListInsertCall), [*list*](api::CalendarListListCall), [*patch*](api::CalendarListPatchCall), [*update*](api::CalendarListUpdateCall) and [*watch*](api::CalendarListWatchCall)
18//! * [calendars](api::Calendar)
19//! * [*clear*](api::CalendarClearCall), [*delete*](api::CalendarDeleteCall), [*get*](api::CalendarGetCall), [*insert*](api::CalendarInsertCall), [*patch*](api::CalendarPatchCall) and [*update*](api::CalendarUpdateCall)
20//! * [channels](api::Channel)
21//! * [*stop*](api::ChannelStopCall)
22//! * colors
23//! * [*get*](api::ColorGetCall)
24//! * [events](api::Event)
25//! * [*delete*](api::EventDeleteCall), [*get*](api::EventGetCall), [*import*](api::EventImportCall), [*insert*](api::EventInsertCall), [*instances*](api::EventInstanceCall), [*list*](api::EventListCall), [*move*](api::EventMoveCall), [*patch*](api::EventPatchCall), [*quick add*](api::EventQuickAddCall), [*update*](api::EventUpdateCall) and [*watch*](api::EventWatchCall)
26//! * freebusy
27//! * [*query*](api::FreebusyQueryCall)
28//! * [settings](api::Setting)
29//! * [*get*](api::SettingGetCall), [*list*](api::SettingListCall) and [*watch*](api::SettingWatchCall)
30//!
31//!
32//! Subscription supported by ...
33//!
34//! * [*list acl*](api::AclListCall)
35//! * [*watch acl*](api::AclWatchCall)
36//! * [*list calendar list*](api::CalendarListListCall)
37//! * [*watch calendar list*](api::CalendarListWatchCall)
38//! * [*instances events*](api::EventInstanceCall)
39//! * [*list events*](api::EventListCall)
40//! * [*watch events*](api::EventWatchCall)
41//! * [*list settings*](api::SettingListCall)
42//! * [*watch settings*](api::SettingWatchCall)
43//!
44//!
45//!
46//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
47//!
48//! # Structure of this Library
49//!
50//! The API is structured into the following primary items:
51//!
52//! * **[Hub](CalendarHub)**
53//! * a central object to maintain state and allow accessing all *Activities*
54//! * creates [*Method Builders*](common::MethodsBuilder) which in turn
55//! allow access to individual [*Call Builders*](common::CallBuilder)
56//! * **[Resources](common::Resource)**
57//! * primary types that you can apply *Activities* to
58//! * a collection of properties and *Parts*
59//! * **[Parts](common::Part)**
60//! * a collection of properties
61//! * never directly used in *Activities*
62//! * **[Activities](common::CallBuilder)**
63//! * operations to apply to *Resources*
64//!
65//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
66//!
67//! Generally speaking, you can invoke *Activities* like this:
68//!
69//! ```Rust,ignore
70//! let r = hub.resource().activity(...).doit().await
71//! ```
72//!
73//! Or specifically ...
74//!
75//! ```ignore
76//! let r = hub.events().delete(...).doit().await
77//! let r = hub.events().get(...).doit().await
78//! let r = hub.events().import(...).doit().await
79//! let r = hub.events().insert(...).doit().await
80//! let r = hub.events().instances(...).doit().await
81//! let r = hub.events().list(...).doit().await
82//! let r = hub.events().move_(...).doit().await
83//! let r = hub.events().patch(...).doit().await
84//! let r = hub.events().quick_add(...).doit().await
85//! let r = hub.events().update(...).doit().await
86//! let r = hub.events().watch(...).doit().await
87//! ```
88//!
89//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
90//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
91//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
92//! The `doit()` method performs the actual communication with the server and returns the respective result.
93//!
94//! # Usage
95//!
96//! ## Setting up your Project
97//!
98//! To use this library, you would put the following lines into your `Cargo.toml` file:
99//!
100//! ```toml
101//! [dependencies]
102//! google-calendar3 = "*"
103//! serde = "1"
104//! serde_json = "1"
105//! ```
106//!
107//! ## A complete example
108//!
109//! ```test_harness,no_run
110//! extern crate hyper;
111//! extern crate hyper_rustls;
112//! extern crate google_calendar3 as calendar3;
113//! use calendar3::api::Channel;
114//! use calendar3::{Result, Error};
115//! # async fn dox() {
116//! use calendar3::{CalendarHub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
117//!
118//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
119//! // `client_secret`, among other things.
120//! let secret: yup_oauth2::ApplicationSecret = Default::default();
121//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
122//! // unless you replace `None` with the desired Flow.
123//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
124//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
125//! // retrieve them from storage.
126//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
127//! .with_native_roots()
128//! .unwrap()
129//! .https_only()
130//! .enable_http2()
131//! .build();
132//!
133//! let executor = hyper_util::rt::TokioExecutor::new();
134//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
135//! secret,
136//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
137//! yup_oauth2::client::CustomHyperClientBuilder::from(
138//! hyper_util::client::legacy::Client::builder(executor).build(connector),
139//! ),
140//! ).build().await.unwrap();
141//!
142//! let client = hyper_util::client::legacy::Client::builder(
143//! hyper_util::rt::TokioExecutor::new()
144//! )
145//! .build(
146//! hyper_rustls::HttpsConnectorBuilder::new()
147//! .with_native_roots()
148//! .unwrap()
149//! .https_or_http()
150//! .enable_http2()
151//! .build()
152//! );
153//! let mut hub = CalendarHub::new(client, auth);
154//! // As the method needs a request, you would usually fill it with the desired information
155//! // into the respective structure. Some of the parts shown here might not be applicable !
156//! // Values shown here are possibly random and not representative !
157//! let mut req = Channel::default();
158//!
159//! // You can configure optional parameters by calling the respective setters at will, and
160//! // execute the final call using `doit()`.
161//! // Values shown here are possibly random and not representative !
162//! let result = hub.events().watch(req, "calendarId")
163//! .updated_min(chrono::Utc::now())
164//! .time_zone("amet")
165//! .time_min(chrono::Utc::now())
166//! .time_max(chrono::Utc::now())
167//! .sync_token("duo")
168//! .single_events(true)
169//! .show_hidden_invitations(false)
170//! .show_deleted(true)
171//! .add_shared_extended_property("ipsum")
172//! .q("ipsum")
173//! .add_private_extended_property("est")
174//! .page_token("gubergren")
175//! .order_by("ea")
176//! .max_results(-99)
177//! .max_attendees(-56)
178//! .i_cal_uid("eos")
179//! .add_event_types("labore")
180//! .always_include_email(true)
181//! .doit().await;
182//!
183//! match result {
184//! Err(e) => match e {
185//! // The Error enum provides details about what exactly happened.
186//! // You can also just use its `Debug`, `Display` or `Error` traits
187//! Error::HttpError(_)
188//! |Error::Io(_)
189//! |Error::MissingAPIKey
190//! |Error::MissingToken(_)
191//! |Error::Cancelled
192//! |Error::UploadSizeLimitExceeded(_, _)
193//! |Error::Failure(_)
194//! |Error::BadRequest(_)
195//! |Error::FieldClash(_)
196//! |Error::JsonDecodeError(_, _) => println!("{}", e),
197//! },
198//! Ok(res) => println!("Success: {:?}", res),
199//! }
200//! # }
201//! ```
202//! ## Handling Errors
203//!
204//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
205//! the doit() methods, or handed as possibly intermediate results to either the
206//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
207//!
208//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
209//! makes the system potentially resilient to all kinds of errors.
210//!
211//! ## Uploads and Downloads
212//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
213//! read by you to obtain the media.
214//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
215//! 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
216//! this call: `.param("alt", "media")`.
217//!
218//! Methods supporting uploads can do so using up to 2 different protocols:
219//! *simple* and *resumable*. The distinctiveness of each is represented by customized
220//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
221//!
222//! ## Customization and Callbacks
223//!
224//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
225//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
226//! Respective methods will be called to provide progress information, as well as determine whether the system should
227//! retry on failure.
228//!
229//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
230//!
231//! ## Optional Parts in Server-Requests
232//!
233//! All structures provided by this library are made to be [encodable](common::RequestValue) and
234//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
235//! are valid.
236//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
237//! the server to indicate either the set parts of the request or the desired parts in the response.
238//!
239//! ## Builder Arguments
240//!
241//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
242//! These will always take a single argument, for which the following statements are true.
243//!
244//! * [PODs][wiki-pod] are handed by copy
245//! * strings are passed as `&str`
246//! * [request values](common::RequestValue) are moved
247//!
248//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
249//!
250//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
251//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
252//! [google-go-api]: https://github.com/google/google-api-go-client
253//!
254//! ## Cargo Features
255//!
256//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
257//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
258//! generated `openapi` spec would be invalid.
259//!
260//!
261//!
262
263// Unused attributes happen thanks to defined, but unused structures We don't
264// warn about this, as depending on the API, some data structures or facilities
265// are never used. Instead of pre-determining this, we just disable the lint.
266// It's manually tuned to not have any unused imports in fully featured APIs.
267// Same with unused_mut.
268#![allow(unused_imports, unused_mut, dead_code)]
269
270// DO NOT EDIT !
271// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
272// DO NOT EDIT !
273
274pub extern crate hyper;
275pub extern crate hyper_rustls;
276pub extern crate hyper_util;
277#[cfg(feature = "yup-oauth2")]
278pub extern crate yup_oauth2;
279
280pub extern crate google_apis_common as common;
281pub use common::{Delegate, Error, FieldMask, Result};
282
283pub mod api;
284pub use api::CalendarHub;