google_youtube3/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 *YouTube* crate version *7.0.0+20251222*, where *20251222* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *YouTube* *v3* API can be found at the
8//! [official documentation site](https://developers.google.com/youtube/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/youtube3).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](YouTube) ...
13//!
14//! * [abuse reports](api::AbuseReport)
15//! * [*insert*](api::AbuseReportInsertCall)
16//! * [activities](api::Activity)
17//! * [*list*](api::ActivityListCall)
18//! * [captions](api::Caption)
19//! * [*delete*](api::CaptionDeleteCall), [*download*](api::CaptionDownloadCall), [*insert*](api::CaptionInsertCall), [*list*](api::CaptionListCall) and [*update*](api::CaptionUpdateCall)
20//! * channel banners
21//! * [*insert*](api::ChannelBannerInsertCall)
22//! * [channel sections](api::ChannelSection)
23//! * [*delete*](api::ChannelSectionDeleteCall), [*insert*](api::ChannelSectionInsertCall), [*list*](api::ChannelSectionListCall) and [*update*](api::ChannelSectionUpdateCall)
24//! * [channels](api::Channel)
25//! * [*list*](api::ChannelListCall) and [*update*](api::ChannelUpdateCall)
26//! * [comment threads](api::CommentThread)
27//! * [*insert*](api::CommentThreadInsertCall) and [*list*](api::CommentThreadListCall)
28//! * [comments](api::Comment)
29//! * [*delete*](api::CommentDeleteCall), [*insert*](api::CommentInsertCall), [*list*](api::CommentListCall), [*mark as spam*](api::CommentMarkAsSpamCall), [*set moderation status*](api::CommentSetModerationStatuCall) and [*update*](api::CommentUpdateCall)
30//! * [i18n languages](api::I18nLanguage)
31//! * [*list*](api::I18nLanguageListCall)
32//! * [i18n regions](api::I18nRegion)
33//! * [*list*](api::I18nRegionListCall)
34//! * [live broadcasts](api::LiveBroadcast)
35//! * [*bind*](api::LiveBroadcastBindCall), [*delete*](api::LiveBroadcastDeleteCall), [*insert*](api::LiveBroadcastInsertCall), [*insert cuepoint*](api::LiveBroadcastInsertCuepointCall), [*list*](api::LiveBroadcastListCall), [*transition*](api::LiveBroadcastTransitionCall) and [*update*](api::LiveBroadcastUpdateCall)
36//! * [live chat bans](api::LiveChatBan)
37//! * [*delete*](api::LiveChatBanDeleteCall) and [*insert*](api::LiveChatBanInsertCall)
38//! * [live chat messages](api::LiveChatMessage)
39//! * [*delete*](api::LiveChatMessageDeleteCall), [*insert*](api::LiveChatMessageInsertCall), [*list*](api::LiveChatMessageListCall) and [*transition*](api::LiveChatMessageTransitionCall)
40//! * [live chat moderators](api::LiveChatModerator)
41//! * [*delete*](api::LiveChatModeratorDeleteCall), [*insert*](api::LiveChatModeratorInsertCall) and [*list*](api::LiveChatModeratorListCall)
42//! * [live streams](api::LiveStream)
43//! * [*delete*](api::LiveStreamDeleteCall), [*insert*](api::LiveStreamInsertCall), [*list*](api::LiveStreamListCall) and [*update*](api::LiveStreamUpdateCall)
44//! * [members](api::Member)
45//! * [*list*](api::MemberListCall)
46//! * [memberships levels](api::MembershipsLevel)
47//! * [*list*](api::MembershipsLevelListCall)
48//! * [playlist images](api::PlaylistImage)
49//! * [*delete*](api::PlaylistImageDeleteCall), [*insert*](api::PlaylistImageInsertCall), [*list*](api::PlaylistImageListCall) and [*update*](api::PlaylistImageUpdateCall)
50//! * [playlist items](api::PlaylistItem)
51//! * [*delete*](api::PlaylistItemDeleteCall), [*insert*](api::PlaylistItemInsertCall), [*list*](api::PlaylistItemListCall) and [*update*](api::PlaylistItemUpdateCall)
52//! * [playlists](api::Playlist)
53//! * [*delete*](api::PlaylistDeleteCall), [*insert*](api::PlaylistInsertCall), [*list*](api::PlaylistListCall) and [*update*](api::PlaylistUpdateCall)
54//! * search
55//! * [*list*](api::SearchListCall)
56//! * [subscriptions](api::Subscription)
57//! * [*delete*](api::SubscriptionDeleteCall), [*insert*](api::SubscriptionInsertCall) and [*list*](api::SubscriptionListCall)
58//! * [super chat events](api::SuperChatEvent)
59//! * [*list*](api::SuperChatEventListCall)
60//! * tests
61//! * [*insert*](api::TestInsertCall)
62//! * [third party links](api::ThirdPartyLink)
63//! * [*delete*](api::ThirdPartyLinkDeleteCall), [*insert*](api::ThirdPartyLinkInsertCall), [*list*](api::ThirdPartyLinkListCall) and [*update*](api::ThirdPartyLinkUpdateCall)
64//! * [thumbnails](api::Thumbnail)
65//! * [*set*](api::ThumbnailSetCall)
66//! * [video abuse report reasons](api::VideoAbuseReportReason)
67//! * [*list*](api::VideoAbuseReportReasonListCall)
68//! * [video categories](api::VideoCategory)
69//! * [*list*](api::VideoCategoryListCall)
70//! * [video trainability](api::VideoTrainability)
71//! * [*get*](api::VideoTrainabilityGetCall)
72//! * [videos](api::Video)
73//! * [*delete*](api::VideoDeleteCall), [*get rating*](api::VideoGetRatingCall), [*insert*](api::VideoInsertCall), [*list*](api::VideoListCall), [*rate*](api::VideoRateCall), [*report abuse*](api::VideoReportAbuseCall) and [*update*](api::VideoUpdateCall)
74//! * watermarks
75//! * [*set*](api::WatermarkSetCall) and [*unset*](api::WatermarkUnsetCall)
76//! * youtube
77//! * [*v3 live chat messages stream*](api::YoutubeV3LiveChatMessageStreamCall), [*v3 update comment threads*](api::YoutubeV3UpdateCommentThreadCall) and [*v3 videos batch get stats*](api::YoutubeV3VideoBatchGetStatCall)
78//!
79//!
80//! Upload supported by ...
81//!
82//! * [*insert captions*](api::CaptionInsertCall)
83//! * [*update captions*](api::CaptionUpdateCall)
84//! * [*insert channel banners*](api::ChannelBannerInsertCall)
85//! * [*insert playlist images*](api::PlaylistImageInsertCall)
86//! * [*update playlist images*](api::PlaylistImageUpdateCall)
87//! * [*set thumbnails*](api::ThumbnailSetCall)
88//! * [*insert videos*](api::VideoInsertCall)
89//! * [*set watermarks*](api::WatermarkSetCall)
90//!
91//! Download supported by ...
92//!
93//! * [*download captions*](api::CaptionDownloadCall)
94//!
95//!
96//!
97//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
98//!
99//! # Structure of this Library
100//!
101//! The API is structured into the following primary items:
102//!
103//! * **[Hub](YouTube)**
104//! * a central object to maintain state and allow accessing all *Activities*
105//! * creates [*Method Builders*](common::MethodsBuilder) which in turn
106//! allow access to individual [*Call Builders*](common::CallBuilder)
107//! * **[Resources](common::Resource)**
108//! * primary types that you can apply *Activities* to
109//! * a collection of properties and *Parts*
110//! * **[Parts](common::Part)**
111//! * a collection of properties
112//! * never directly used in *Activities*
113//! * **[Activities](common::CallBuilder)**
114//! * operations to apply to *Resources*
115//!
116//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
117//!
118//! Generally speaking, you can invoke *Activities* like this:
119//!
120//! ```Rust,ignore
121//! let r = hub.resource().activity(...).doit().await
122//! ```
123//!
124//! Or specifically ...
125//!
126//! ```ignore
127//! let r = hub.videos().delete(...).doit().await
128//! let r = hub.videos().get_rating(...).doit().await
129//! let r = hub.videos().insert(...).doit().await
130//! let r = hub.videos().list(...).doit().await
131//! let r = hub.videos().rate(...).doit().await
132//! let r = hub.videos().report_abuse(...).doit().await
133//! let r = hub.videos().update(...).doit().await
134//! ```
135//!
136//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
137//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
138//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
139//! The `doit()` method performs the actual communication with the server and returns the respective result.
140//!
141//! # Usage
142//!
143//! ## Setting up your Project
144//!
145//! To use this library, you would put the following lines into your `Cargo.toml` file:
146//!
147//! ```toml
148//! [dependencies]
149//! google-youtube3 = "*"
150//! serde = "1"
151//! serde_json = "1"
152//! ```
153//!
154//! ## A complete example
155//!
156//! ```test_harness,no_run
157//! extern crate hyper;
158//! extern crate hyper_rustls;
159//! extern crate google_youtube3 as youtube3;
160//! use youtube3::{Result, Error};
161//! # async fn dox() {
162//! use youtube3::{YouTube, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
163//!
164//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
165//! // `client_secret`, among other things.
166//! let secret: yup_oauth2::ApplicationSecret = Default::default();
167//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
168//! // unless you replace `None` with the desired Flow.
169//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
170//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
171//! // retrieve them from storage.
172//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
173//! .with_native_roots()
174//! .unwrap()
175//! .https_only()
176//! .enable_http2()
177//! .build();
178//!
179//! let executor = hyper_util::rt::TokioExecutor::new();
180//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
181//! secret,
182//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
183//! yup_oauth2::client::CustomHyperClientBuilder::from(
184//! hyper_util::client::legacy::Client::builder(executor).build(connector),
185//! ),
186//! ).build().await.unwrap();
187//!
188//! let client = hyper_util::client::legacy::Client::builder(
189//! hyper_util::rt::TokioExecutor::new()
190//! )
191//! .build(
192//! hyper_rustls::HttpsConnectorBuilder::new()
193//! .with_native_roots()
194//! .unwrap()
195//! .https_or_http()
196//! .enable_http2()
197//! .build()
198//! );
199//! let mut hub = YouTube::new(client, auth);
200//! // You can configure optional parameters by calling the respective setters at will, and
201//! // execute the final call using `doit()`.
202//! // Values shown here are possibly random and not representative !
203//! let result = hub.videos().list(&vec!["gubergren".into()])
204//! .video_category_id("Lorem")
205//! .region_code("gubergren")
206//! .page_token("eos")
207//! .on_behalf_of_content_owner("dolor")
208//! .my_rating("ea")
209//! .max_width(-55)
210//! .max_results(13)
211//! .max_height(-47)
212//! .locale("duo")
213//! .add_id("ipsum")
214//! .hl("sed")
215//! .chart("ut")
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::YouTube;