google_blogger3/
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 *Blogger* crate version *7.0.0+20251215*, where *20251215* is the exact revision of the *blogger:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *Blogger* *v3* API can be found at the
8//! [official documentation site](https://developers.google.com/blogger/docs/3.0/getting_started).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/blogger3).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](Blogger) ...
13//!
14//! * [blog user infos](api::BlogUserInfo)
15//!  * [*get*](api::BlogUserInfoGetCall)
16//! * [blogs](api::Blog)
17//!  * [*get*](api::BlogGetCall), [*get by url*](api::BlogGetByUrlCall) and [*list by user*](api::BlogListByUserCall)
18//! * [comments](api::Comment)
19//!  * [*approve*](api::CommentApproveCall), [*delete*](api::CommentDeleteCall), [*get*](api::CommentGetCall), [*list*](api::CommentListCall), [*list by blog*](api::CommentListByBlogCall), [*mark as spam*](api::CommentMarkAsSpamCall) and [*remove content*](api::CommentRemoveContentCall)
20//! * page views
21//!  * [*get*](api::PageViewGetCall)
22//! * [pages](api::Page)
23//!  * [*delete*](api::PageDeleteCall), [*get*](api::PageGetCall), [*insert*](api::PageInsertCall), [*list*](api::PageListCall), [*patch*](api::PagePatchCall), [*publish*](api::PagePublishCall), [*revert*](api::PageRevertCall) and [*update*](api::PageUpdateCall)
24//! * [post user infos](api::PostUserInfo)
25//!  * [*get*](api::PostUserInfoGetCall) and [*list*](api::PostUserInfoListCall)
26//! * [posts](api::Post)
27//!  * [*delete*](api::PostDeleteCall), [*get*](api::PostGetCall), [*get by path*](api::PostGetByPathCall), [*insert*](api::PostInsertCall), [*list*](api::PostListCall), [*patch*](api::PostPatchCall), [*publish*](api::PostPublishCall), [*revert*](api::PostRevertCall), [*search*](api::PostSearchCall) and [*update*](api::PostUpdateCall)
28//! * [users](api::User)
29//!  * [*get*](api::UserGetCall)
30//!
31//!
32//!
33//!
34//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
35//!
36//! # Structure of this Library
37//!
38//! The API is structured into the following primary items:
39//!
40//! * **[Hub](Blogger)**
41//!     * a central object to maintain state and allow accessing all *Activities*
42//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
43//!       allow access to individual [*Call Builders*](common::CallBuilder)
44//! * **[Resources](common::Resource)**
45//!     * primary types that you can apply *Activities* to
46//!     * a collection of properties and *Parts*
47//!     * **[Parts](common::Part)**
48//!         * a collection of properties
49//!         * never directly used in *Activities*
50//! * **[Activities](common::CallBuilder)**
51//!     * operations to apply to *Resources*
52//!
53//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
54//!
55//! Generally speaking, you can invoke *Activities* like this:
56//!
57//! ```Rust,ignore
58//! let r = hub.resource().activity(...).doit().await
59//! ```
60//!
61//! Or specifically ...
62//!
63//! ```ignore
64//! let r = hub.posts().delete(...).doit().await
65//! let r = hub.posts().get(...).doit().await
66//! let r = hub.posts().get_by_path(...).doit().await
67//! let r = hub.posts().insert(...).doit().await
68//! let r = hub.posts().list(...).doit().await
69//! let r = hub.posts().patch(...).doit().await
70//! let r = hub.posts().publish(...).doit().await
71//! let r = hub.posts().revert(...).doit().await
72//! let r = hub.posts().search(...).doit().await
73//! let r = hub.posts().update(...).doit().await
74//! ```
75//!
76//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
77//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
78//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
79//! The `doit()` method performs the actual communication with the server and returns the respective result.
80//!
81//! # Usage
82//!
83//! ## Setting up your Project
84//!
85//! To use this library, you would put the following lines into your `Cargo.toml` file:
86//!
87//! ```toml
88//! [dependencies]
89//! google-blogger3 = "*"
90//! serde = "1"
91//! serde_json = "1"
92//! ```
93//!
94//! ## A complete example
95//!
96//! ```test_harness,no_run
97//! extern crate hyper;
98//! extern crate hyper_rustls;
99//! extern crate google_blogger3 as blogger3;
100//! use blogger3::{Result, Error};
101//! # async fn dox() {
102//! use blogger3::{Blogger, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
103//!
104//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
105//! // `client_secret`, among other things.
106//! let secret: yup_oauth2::ApplicationSecret = Default::default();
107//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
108//! // unless you replace  `None` with the desired Flow.
109//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
110//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
111//! // retrieve them from storage.
112//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
113//!     .with_native_roots()
114//!     .unwrap()
115//!     .https_only()
116//!     .enable_http2()
117//!     .build();
118//!
119//! let executor = hyper_util::rt::TokioExecutor::new();
120//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
121//!     secret,
122//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
123//!     yup_oauth2::client::CustomHyperClientBuilder::from(
124//!         hyper_util::client::legacy::Client::builder(executor).build(connector),
125//!     ),
126//! ).build().await.unwrap();
127//!
128//! let client = hyper_util::client::legacy::Client::builder(
129//!     hyper_util::rt::TokioExecutor::new()
130//! )
131//! .build(
132//!     hyper_rustls::HttpsConnectorBuilder::new()
133//!         .with_native_roots()
134//!         .unwrap()
135//!         .https_or_http()
136//!         .enable_http2()
137//!         .build()
138//! );
139//! let mut hub = Blogger::new(client, auth);
140//! // You can configure optional parameters by calling the respective setters at will, and
141//! // execute the final call using `doit()`.
142//! // Values shown here are possibly random and not representative !
143//! let result = hub.posts().list("blogId")
144//!              .view("gubergren")
145//!              .add_status("Lorem")
146//!              .start_date("gubergren")
147//!              .sort_option("eos")
148//!              .page_token("dolor")
149//!              .order_by("ea")
150//!              .max_results(46)
151//!              .labels("invidunt")
152//!              .fetch_images(true)
153//!              .fetch_bodies(true)
154//!              .end_date("sed")
155//!              .doit().await;
156//!
157//! match result {
158//!     Err(e) => match e {
159//!         // The Error enum provides details about what exactly happened.
160//!         // You can also just use its `Debug`, `Display` or `Error` traits
161//!          Error::HttpError(_)
162//!         |Error::Io(_)
163//!         |Error::MissingAPIKey
164//!         |Error::MissingToken(_)
165//!         |Error::Cancelled
166//!         |Error::UploadSizeLimitExceeded(_, _)
167//!         |Error::Failure(_)
168//!         |Error::BadRequest(_)
169//!         |Error::FieldClash(_)
170//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
171//!     },
172//!     Ok(res) => println!("Success: {:?}", res),
173//! }
174//! # }
175//! ```
176//! ## Handling Errors
177//!
178//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
179//! the doit() methods, or handed as possibly intermediate results to either the
180//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
181//!
182//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
183//! makes the system potentially resilient to all kinds of errors.
184//!
185//! ## Uploads and Downloads
186//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
187//! read by you to obtain the media.
188//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
189//! 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
190//! this call: `.param("alt", "media")`.
191//!
192//! Methods supporting uploads can do so using up to 2 different protocols:
193//! *simple* and *resumable*. The distinctiveness of each is represented by customized
194//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
195//!
196//! ## Customization and Callbacks
197//!
198//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
199//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
200//! Respective methods will be called to provide progress information, as well as determine whether the system should
201//! retry on failure.
202//!
203//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
204//!
205//! ## Optional Parts in Server-Requests
206//!
207//! All structures provided by this library are made to be [encodable](common::RequestValue) and
208//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
209//! are valid.
210//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
211//! the server to indicate either the set parts of the request or the desired parts in the response.
212//!
213//! ## Builder Arguments
214//!
215//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
216//! These will always take a single argument, for which the following statements are true.
217//!
218//! * [PODs][wiki-pod] are handed by copy
219//! * strings are passed as `&str`
220//! * [request values](common::RequestValue) are moved
221//!
222//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
223//!
224//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
225//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
226//! [google-go-api]: https://github.com/google/google-api-go-client
227//!
228//! ## Cargo Features
229//!
230//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
231//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
232//! generated `openapi` spec would be invalid.
233//!
234//!
235//!
236
237// Unused attributes happen thanks to defined, but unused structures We don't
238// warn about this, as depending on the API, some data structures or facilities
239// are never used. Instead of pre-determining this, we just disable the lint.
240// It's manually tuned to not have any unused imports in fully featured APIs.
241// Same with unused_mut.
242#![allow(unused_imports, unused_mut, dead_code)]
243
244// DO NOT EDIT !
245// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
246// DO NOT EDIT !
247
248pub extern crate hyper;
249pub extern crate hyper_rustls;
250pub extern crate hyper_util;
251#[cfg(feature = "yup-oauth2")]
252pub extern crate yup_oauth2;
253
254pub extern crate google_apis_common as common;
255pub use common::{Delegate, Error, FieldMask, Result};
256
257pub mod api;
258pub use api::Blogger;