google_adsense2/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 *adsense* crate version *7.0.0+20251210*, where *20251210* is the exact revision of the *adsense:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *adsense* *v2* API can be found at the
8//! [official documentation site](https://developers.google.com/adsense/management/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/adsense2).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](Adsense) ...
13//!
14//! * [accounts](api::Account)
15//! * [*adclients adunits create*](api::AccountAdclientAdunitCreateCall), [*adclients adunits get*](api::AccountAdclientAdunitGetCall), [*adclients adunits get adcode*](api::AccountAdclientAdunitGetAdcodeCall), [*adclients adunits list*](api::AccountAdclientAdunitListCall), [*adclients adunits list linked custom channels*](api::AccountAdclientAdunitListLinkedCustomChannelCall), [*adclients adunits patch*](api::AccountAdclientAdunitPatchCall), [*adclients customchannels create*](api::AccountAdclientCustomchannelCreateCall), [*adclients customchannels delete*](api::AccountAdclientCustomchannelDeleteCall), [*adclients customchannels get*](api::AccountAdclientCustomchannelGetCall), [*adclients customchannels list*](api::AccountAdclientCustomchannelListCall), [*adclients customchannels list linked ad units*](api::AccountAdclientCustomchannelListLinkedAdUnitCall), [*adclients customchannels patch*](api::AccountAdclientCustomchannelPatchCall), [*adclients get*](api::AccountAdclientGetCall), [*adclients get adcode*](api::AccountAdclientGetAdcodeCall), [*adclients list*](api::AccountAdclientListCall), [*adclients urlchannels get*](api::AccountAdclientUrlchannelGetCall), [*adclients urlchannels list*](api::AccountAdclientUrlchannelListCall), [*alerts list*](api::AccountAlertListCall), [*get*](api::AccountGetCall), [*get ad blocking recovery tag*](api::AccountGetAdBlockingRecoveryTagCall), [*list*](api::AccountListCall), [*list child accounts*](api::AccountListChildAccountCall), [*payments list*](api::AccountPaymentListCall), [*policy issues get*](api::AccountPolicyIssueGetCall), [*policy issues list*](api::AccountPolicyIssueListCall), [*reports generate*](api::AccountReportGenerateCall), [*reports generate csv*](api::AccountReportGenerateCsvCall), [*reports get saved*](api::AccountReportGetSavedCall), [*reports saved generate*](api::AccountReportSavedGenerateCall), [*reports saved generate csv*](api::AccountReportSavedGenerateCsvCall), [*reports saved list*](api::AccountReportSavedListCall), [*sites get*](api::AccountSiteGetCall) and [*sites list*](api::AccountSiteListCall)
16//!
17//!
18//!
19//!
20//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
21//!
22//! # Structure of this Library
23//!
24//! The API is structured into the following primary items:
25//!
26//! * **[Hub](Adsense)**
27//! * a central object to maintain state and allow accessing all *Activities*
28//! * creates [*Method Builders*](common::MethodsBuilder) which in turn
29//! allow access to individual [*Call Builders*](common::CallBuilder)
30//! * **[Resources](common::Resource)**
31//! * primary types that you can apply *Activities* to
32//! * a collection of properties and *Parts*
33//! * **[Parts](common::Part)**
34//! * a collection of properties
35//! * never directly used in *Activities*
36//! * **[Activities](common::CallBuilder)**
37//! * operations to apply to *Resources*
38//!
39//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
40//!
41//! Generally speaking, you can invoke *Activities* like this:
42//!
43//! ```Rust,ignore
44//! let r = hub.resource().activity(...).doit().await
45//! ```
46//!
47//! Or specifically ...
48//!
49//! ```ignore
50//! let r = hub.accounts().adclients_adunits_create(...).doit().await
51//! let r = hub.accounts().adclients_adunits_get(...).doit().await
52//! let r = hub.accounts().adclients_adunits_get_adcode(...).doit().await
53//! let r = hub.accounts().adclients_adunits_list(...).doit().await
54//! let r = hub.accounts().adclients_adunits_list_linked_custom_channels(...).doit().await
55//! let r = hub.accounts().adclients_adunits_patch(...).doit().await
56//! let r = hub.accounts().adclients_customchannels_create(...).doit().await
57//! let r = hub.accounts().adclients_customchannels_delete(...).doit().await
58//! let r = hub.accounts().adclients_customchannels_get(...).doit().await
59//! let r = hub.accounts().adclients_customchannels_list(...).doit().await
60//! let r = hub.accounts().adclients_customchannels_list_linked_ad_units(...).doit().await
61//! let r = hub.accounts().adclients_customchannels_patch(...).doit().await
62//! let r = hub.accounts().adclients_urlchannels_get(...).doit().await
63//! let r = hub.accounts().adclients_urlchannels_list(...).doit().await
64//! let r = hub.accounts().adclients_get(...).doit().await
65//! let r = hub.accounts().adclients_get_adcode(...).doit().await
66//! let r = hub.accounts().adclients_list(...).doit().await
67//! let r = hub.accounts().alerts_list(...).doit().await
68//! let r = hub.accounts().payments_list(...).doit().await
69//! let r = hub.accounts().policy_issues_get(...).doit().await
70//! let r = hub.accounts().policy_issues_list(...).doit().await
71//! let r = hub.accounts().reports_saved_generate(...).doit().await
72//! let r = hub.accounts().reports_saved_generate_csv(...).doit().await
73//! let r = hub.accounts().reports_saved_list(...).doit().await
74//! let r = hub.accounts().reports_generate(...).doit().await
75//! let r = hub.accounts().reports_generate_csv(...).doit().await
76//! let r = hub.accounts().reports_get_saved(...).doit().await
77//! let r = hub.accounts().sites_get(...).doit().await
78//! let r = hub.accounts().sites_list(...).doit().await
79//! let r = hub.accounts().get(...).doit().await
80//! let r = hub.accounts().get_ad_blocking_recovery_tag(...).doit().await
81//! let r = hub.accounts().list(...).doit().await
82//! let r = hub.accounts().list_child_accounts(...).doit().await
83//! ```
84//!
85//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
86//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
87//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
88//! The `doit()` method performs the actual communication with the server and returns the respective result.
89//!
90//! # Usage
91//!
92//! ## Setting up your Project
93//!
94//! To use this library, you would put the following lines into your `Cargo.toml` file:
95//!
96//! ```toml
97//! [dependencies]
98//! google-adsense2 = "*"
99//! serde = "1"
100//! serde_json = "1"
101//! ```
102//!
103//! ## A complete example
104//!
105//! ```test_harness,no_run
106//! extern crate hyper;
107//! extern crate hyper_rustls;
108//! extern crate google_adsense2 as adsense2;
109//! use adsense2::{Result, Error};
110//! # async fn dox() {
111//! use adsense2::{Adsense, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
112//!
113//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
114//! // `client_secret`, among other things.
115//! let secret: yup_oauth2::ApplicationSecret = Default::default();
116//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
117//! // unless you replace `None` with the desired Flow.
118//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
119//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
120//! // retrieve them from storage.
121//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
122//! .with_native_roots()
123//! .unwrap()
124//! .https_only()
125//! .enable_http2()
126//! .build();
127//!
128//! let executor = hyper_util::rt::TokioExecutor::new();
129//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
130//! secret,
131//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
132//! yup_oauth2::client::CustomHyperClientBuilder::from(
133//! hyper_util::client::legacy::Client::builder(executor).build(connector),
134//! ),
135//! ).build().await.unwrap();
136//!
137//! let client = hyper_util::client::legacy::Client::builder(
138//! hyper_util::rt::TokioExecutor::new()
139//! )
140//! .build(
141//! hyper_rustls::HttpsConnectorBuilder::new()
142//! .with_native_roots()
143//! .unwrap()
144//! .https_or_http()
145//! .enable_http2()
146//! .build()
147//! );
148//! let mut hub = Adsense::new(client, auth);
149//! // You can configure optional parameters by calling the respective setters at will, and
150//! // execute the final call using `doit()`.
151//! // Values shown here are possibly random and not representative !
152//! let result = hub.accounts().reports_generate("account")
153//! .start_date_year(-4)
154//! .start_date_month(-17)
155//! .start_date_day(-55)
156//! .reporting_time_zone("invidunt")
157//! .add_order_by("amet")
158//! .add_metrics("duo")
159//! .limit(-50)
160//! .language_code("sed")
161//! .add_filters("ut")
162//! .end_date_year(-12)
163//! .end_date_month(-16)
164//! .end_date_day(-57)
165//! .add_dimensions("ipsum")
166//! .date_range("ipsum")
167//! .currency_code("est")
168//! .doit().await;
169//!
170//! match result {
171//! Err(e) => match e {
172//! // The Error enum provides details about what exactly happened.
173//! // You can also just use its `Debug`, `Display` or `Error` traits
174//! Error::HttpError(_)
175//! |Error::Io(_)
176//! |Error::MissingAPIKey
177//! |Error::MissingToken(_)
178//! |Error::Cancelled
179//! |Error::UploadSizeLimitExceeded(_, _)
180//! |Error::Failure(_)
181//! |Error::BadRequest(_)
182//! |Error::FieldClash(_)
183//! |Error::JsonDecodeError(_, _) => println!("{}", e),
184//! },
185//! Ok(res) => println!("Success: {:?}", res),
186//! }
187//! # }
188//! ```
189//! ## Handling Errors
190//!
191//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
192//! the doit() methods, or handed as possibly intermediate results to either the
193//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
194//!
195//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
196//! makes the system potentially resilient to all kinds of errors.
197//!
198//! ## Uploads and Downloads
199//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
200//! read by you to obtain the media.
201//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
202//! 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
203//! this call: `.param("alt", "media")`.
204//!
205//! Methods supporting uploads can do so using up to 2 different protocols:
206//! *simple* and *resumable*. The distinctiveness of each is represented by customized
207//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
208//!
209//! ## Customization and Callbacks
210//!
211//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
212//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
213//! Respective methods will be called to provide progress information, as well as determine whether the system should
214//! retry on failure.
215//!
216//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
217//!
218//! ## Optional Parts in Server-Requests
219//!
220//! All structures provided by this library are made to be [encodable](common::RequestValue) and
221//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
222//! are valid.
223//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
224//! the server to indicate either the set parts of the request or the desired parts in the response.
225//!
226//! ## Builder Arguments
227//!
228//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
229//! These will always take a single argument, for which the following statements are true.
230//!
231//! * [PODs][wiki-pod] are handed by copy
232//! * strings are passed as `&str`
233//! * [request values](common::RequestValue) are moved
234//!
235//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
236//!
237//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
238//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
239//! [google-go-api]: https://github.com/google/google-api-go-client
240//!
241//! ## Cargo Features
242//!
243//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
244//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
245//! generated `openapi` spec would be invalid.
246//!
247//!
248//!
249
250// Unused attributes happen thanks to defined, but unused structures We don't
251// warn about this, as depending on the API, some data structures or facilities
252// are never used. Instead of pre-determining this, we just disable the lint.
253// It's manually tuned to not have any unused imports in fully featured APIs.
254// Same with unused_mut.
255#![allow(unused_imports, unused_mut, dead_code)]
256
257// DO NOT EDIT !
258// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
259// DO NOT EDIT !
260
261pub extern crate hyper;
262pub extern crate hyper_rustls;
263pub extern crate hyper_util;
264#[cfg(feature = "yup-oauth2")]
265pub extern crate yup_oauth2;
266
267pub extern crate google_apis_common as common;
268pub use common::{Delegate, Error, FieldMask, Result};
269
270pub mod api;
271pub use api::Adsense;