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 *6.0.0+20240626*, where *20240626* is the exact revision of the *youtube:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v6.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//! * [videos](api::Video)
71//! * [*delete*](api::VideoDeleteCall), [*get rating*](api::VideoGetRatingCall), [*insert*](api::VideoInsertCall), [*list*](api::VideoListCall), [*rate*](api::VideoRateCall), [*report abuse*](api::VideoReportAbuseCall) and [*update*](api::VideoUpdateCall)
72//! * watermarks
73//! * [*set*](api::WatermarkSetCall) and [*unset*](api::WatermarkUnsetCall)
74//! * youtube
75//! * [*v3 update comment threads*](api::YoutubeV3UpdateCommentThreadCall)
76//!
77//!
78//! Upload supported by ...
79//!
80//! * [*insert captions*](api::CaptionInsertCall)
81//! * [*update captions*](api::CaptionUpdateCall)
82//! * [*insert channel banners*](api::ChannelBannerInsertCall)
83//! * [*insert playlist images*](api::PlaylistImageInsertCall)
84//! * [*update playlist images*](api::PlaylistImageUpdateCall)
85//! * [*set thumbnails*](api::ThumbnailSetCall)
86//! * [*insert videos*](api::VideoInsertCall)
87//! * [*set watermarks*](api::WatermarkSetCall)
88//!
89//! Download supported by ...
90//!
91//! * [*download captions*](api::CaptionDownloadCall)
92//!
93//!
94//!
95//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
96//!
97//! # Structure of this Library
98//!
99//! The API is structured into the following primary items:
100//!
101//! * **[Hub](YouTube)**
102//! * a central object to maintain state and allow accessing all *Activities*
103//! * creates [*Method Builders*](common::MethodsBuilder) which in turn
104//! allow access to individual [*Call Builders*](common::CallBuilder)
105//! * **[Resources](common::Resource)**
106//! * primary types that you can apply *Activities* to
107//! * a collection of properties and *Parts*
108//! * **[Parts](common::Part)**
109//! * a collection of properties
110//! * never directly used in *Activities*
111//! * **[Activities](common::CallBuilder)**
112//! * operations to apply to *Resources*
113//!
114//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
115//!
116//! Generally speaking, you can invoke *Activities* like this:
117//!
118//! ```Rust,ignore
119//! let r = hub.resource().activity(...).doit().await
120//! ```
121//!
122//! Or specifically ...
123//!
124//! ```ignore
125//! let r = hub.videos().delete(...).doit().await
126//! let r = hub.videos().get_rating(...).doit().await
127//! let r = hub.videos().insert(...).doit().await
128//! let r = hub.videos().list(...).doit().await
129//! let r = hub.videos().rate(...).doit().await
130//! let r = hub.videos().report_abuse(...).doit().await
131//! let r = hub.videos().update(...).doit().await
132//! ```
133//!
134//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
135//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
136//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
137//! The `doit()` method performs the actual communication with the server and returns the respective result.
138//!
139//! # Usage
140//!
141//! ## Setting up your Project
142//!
143//! To use this library, you would put the following lines into your `Cargo.toml` file:
144//!
145//! ```toml
146//! [dependencies]
147//! google-youtube3 = "*"
148//! serde = "1"
149//! serde_json = "1"
150//! ```
151//!
152//! ## A complete example
153//!
154//! ```test_harness,no_run
155//! extern crate hyper;
156//! extern crate hyper_rustls;
157//! extern crate google_youtube3 as youtube3;
158//! use youtube3::{Result, Error};
159//! # async fn dox() {
160//! use youtube3::{YouTube, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
161//!
162//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
163//! // `client_secret`, among other things.
164//! let secret: yup_oauth2::ApplicationSecret = Default::default();
165//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
166//! // unless you replace `None` with the desired Flow.
167//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
168//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
169//! // retrieve them from storage.
170//! let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
171//! secret,
172//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
173//! ).build().await.unwrap();
174//!
175//! let client = hyper_util::client::legacy::Client::builder(
176//! hyper_util::rt::TokioExecutor::new()
177//! )
178//! .build(
179//! hyper_rustls::HttpsConnectorBuilder::new()
180//! .with_native_roots()
181//! .unwrap()
182//! .https_or_http()
183//! .enable_http1()
184//! .build()
185//! );
186//! let mut hub = YouTube::new(client, auth);
187//! // You can configure optional parameters by calling the respective setters at will, and
188//! // execute the final call using `doit()`.
189//! // Values shown here are possibly random and not representative !
190//! let result = hub.videos().list(&vec!["gubergren".into()])
191//! .video_category_id("Lorem")
192//! .region_code("gubergren")
193//! .page_token("eos")
194//! .on_behalf_of_content_owner("dolor")
195//! .my_rating("ea")
196//! .max_width(-55)
197//! .max_results(13)
198//! .max_height(-47)
199//! .locale("duo")
200//! .add_id("ipsum")
201//! .hl("sed")
202//! .chart("ut")
203//! .doit().await;
204//!
205//! match result {
206//! Err(e) => match e {
207//! // The Error enum provides details about what exactly happened.
208//! // You can also just use its `Debug`, `Display` or `Error` traits
209//! Error::HttpError(_)
210//! |Error::Io(_)
211//! |Error::MissingAPIKey
212//! |Error::MissingToken(_)
213//! |Error::Cancelled
214//! |Error::UploadSizeLimitExceeded(_, _)
215//! |Error::Failure(_)
216//! |Error::BadRequest(_)
217//! |Error::FieldClash(_)
218//! |Error::JsonDecodeError(_, _) => println!("{}", e),
219//! },
220//! Ok(res) => println!("Success: {:?}", res),
221//! }
222//! # }
223//! ```
224//! ## Handling Errors
225//!
226//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
227//! the doit() methods, or handed as possibly intermediate results to either the
228//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
229//!
230//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
231//! makes the system potentially resilient to all kinds of errors.
232//!
233//! ## Uploads and Downloads
234//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
235//! read by you to obtain the media.
236//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
237//! 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
238//! this call: `.param("alt", "media")`.
239//!
240//! Methods supporting uploads can do so using up to 2 different protocols:
241//! *simple* and *resumable*. The distinctiveness of each is represented by customized
242//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
243//!
244//! ## Customization and Callbacks
245//!
246//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
247//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
248//! Respective methods will be called to provide progress information, as well as determine whether the system should
249//! retry on failure.
250//!
251//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
252//!
253//! ## Optional Parts in Server-Requests
254//!
255//! All structures provided by this library are made to be [encodable](common::RequestValue) and
256//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
257//! are valid.
258//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
259//! the server to indicate either the set parts of the request or the desired parts in the response.
260//!
261//! ## Builder Arguments
262//!
263//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
264//! These will always take a single argument, for which the following statements are true.
265//!
266//! * [PODs][wiki-pod] are handed by copy
267//! * strings are passed as `&str`
268//! * [request values](common::RequestValue) are moved
269//!
270//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
271//!
272//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
273//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
274//! [google-go-api]: https://github.com/google/google-api-go-client
275//!
276//! ## Cargo Features
277//!
278//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
279//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
280//! generated `openapi` spec would be invalid.
281//!
282//!
283//!
284
285// Unused attributes happen thanks to defined, but unused structures We don't
286// warn about this, as depending on the API, some data structures or facilities
287// are never used. Instead of pre-determining this, we just disable the lint.
288// It's manually tuned to not have any unused imports in fully featured APIs.
289// Same with unused_mut.
290#![allow(unused_imports, unused_mut, dead_code)]
291
292// DO NOT EDIT !
293// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
294// DO NOT EDIT !
295
296pub extern crate hyper;
297pub extern crate hyper_rustls;
298pub extern crate hyper_util;
299#[cfg(feature = "yup-oauth2")]
300pub extern crate yup_oauth2;
301
302pub extern crate google_apis_common as common;
303pub use common::{Delegate, Error, FieldMask, Result};
304
305pub mod api;
306pub use api::YouTube;