google_content2/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 *Shopping Content* crate version *7.0.0+20220303*, where *20220303* is the exact revision of the *content:v2* schema built by the [mako](http://www.makotemplates.org/) code generator *v7.0.0*.
6//!
7//! Everything else about the *Shopping Content* *v2* API can be found at the
8//! [official documentation site](https://developers.google.com/shopping-content/v2/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/content2).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](ShoppingContent) ...
13//!
14//! * [accounts](api::Account)
15//! * [*authinfo*](api::AccountAuthinfoCall), [*claimwebsite*](api::AccountClaimwebsiteCall), [*custombatch*](api::AccountCustombatchCall), [*delete*](api::AccountDeleteCall), [*get*](api::AccountGetCall), [*insert*](api::AccountInsertCall), [*link*](api::AccountLinkCall), [*list*](api::AccountListCall) and [*update*](api::AccountUpdateCall)
16//! * accountstatuses
17//! * [*custombatch*](api::AccountstatusCustombatchCall), [*get*](api::AccountstatusGetCall) and [*list*](api::AccountstatusListCall)
18//! * accounttax
19//! * [*custombatch*](api::AccounttaxCustombatchCall), [*get*](api::AccounttaxGetCall), [*list*](api::AccounttaxListCall) and [*update*](api::AccounttaxUpdateCall)
20//! * [datafeeds](api::Datafeed)
21//! * [*custombatch*](api::DatafeedCustombatchCall), [*delete*](api::DatafeedDeleteCall), [*fetchnow*](api::DatafeedFetchnowCall), [*get*](api::DatafeedGetCall), [*insert*](api::DatafeedInsertCall), [*list*](api::DatafeedListCall) and [*update*](api::DatafeedUpdateCall)
22//! * datafeedstatuses
23//! * [*custombatch*](api::DatafeedstatusCustombatchCall), [*get*](api::DatafeedstatusGetCall) and [*list*](api::DatafeedstatusListCall)
24//! * [inventory](api::Inventory)
25//! * [*custombatch*](api::InventoryCustombatchCall) and [*set*](api::InventorySetCall)
26//! * liasettings
27//! * [*custombatch*](api::LiasettingCustombatchCall), [*get*](api::LiasettingGetCall), [*getaccessiblegmbaccounts*](api::LiasettingGetaccessiblegmbaccountCall), [*list*](api::LiasettingListCall), [*listposdataproviders*](api::LiasettingListposdataproviderCall), [*requestgmbaccess*](api::LiasettingRequestgmbaccesCall), [*requestinventoryverification*](api::LiasettingRequestinventoryverificationCall), [*setinventoryverificationcontact*](api::LiasettingSetinventoryverificationcontactCall), [*setposdataprovider*](api::LiasettingSetposdataproviderCall) and [*update*](api::LiasettingUpdateCall)
28//! * orderinvoices
29//! * [*createchargeinvoice*](api::OrderinvoiceCreatechargeinvoiceCall) and [*createrefundinvoice*](api::OrderinvoiceCreaterefundinvoiceCall)
30//! * orderreports
31//! * [*listdisbursements*](api::OrderreportListdisbursementCall) and [*listtransactions*](api::OrderreportListtransactionCall)
32//! * orderreturns
33//! * [*get*](api::OrderreturnGetCall) and [*list*](api::OrderreturnListCall)
34//! * [orders](api::Order)
35//! * [*acknowledge*](api::OrderAcknowledgeCall), [*advancetestorder*](api::OrderAdvancetestorderCall), [*cancel*](api::OrderCancelCall), [*cancellineitem*](api::OrderCancellineitemCall), [*canceltestorderbycustomer*](api::OrderCanceltestorderbycustomerCall), [*createtestorder*](api::OrderCreatetestorderCall), [*createtestreturn*](api::OrderCreatetestreturnCall), [*custombatch*](api::OrderCustombatchCall), [*get*](api::OrderGetCall), [*getbymerchantorderid*](api::OrderGetbymerchantorderidCall), [*gettestordertemplate*](api::OrderGettestordertemplateCall), [*instorerefundlineitem*](api::OrderInstorerefundlineitemCall), [*list*](api::OrderListCall), [*refund*](api::OrderRefundCall), [*rejectreturnlineitem*](api::OrderRejectreturnlineitemCall), [*returnlineitem*](api::OrderReturnlineitemCall), [*returnrefundlineitem*](api::OrderReturnrefundlineitemCall), [*setlineitemmetadata*](api::OrderSetlineitemmetadataCall), [*shiplineitems*](api::OrderShiplineitemCall), [*updatelineitemshippingdetails*](api::OrderUpdatelineitemshippingdetailCall), [*updatemerchantorderid*](api::OrderUpdatemerchantorderidCall) and [*updateshipment*](api::OrderUpdateshipmentCall)
36//! * pos
37//! * [*custombatch*](api::PoCustombatchCall), [*delete*](api::PoDeleteCall), [*get*](api::PoGetCall), [*insert*](api::PoInsertCall), [*inventory*](api::PoInventoryCall), [*list*](api::PoListCall) and [*sale*](api::PoSaleCall)
38//! * [products](api::Product)
39//! * [*custombatch*](api::ProductCustombatchCall), [*delete*](api::ProductDeleteCall), [*get*](api::ProductGetCall), [*insert*](api::ProductInsertCall) and [*list*](api::ProductListCall)
40//! * productstatuses
41//! * [*custombatch*](api::ProductstatusCustombatchCall), [*get*](api::ProductstatusGetCall) and [*list*](api::ProductstatusListCall)
42//! * shippingsettings
43//! * [*custombatch*](api::ShippingsettingCustombatchCall), [*get*](api::ShippingsettingGetCall), [*getsupportedcarriers*](api::ShippingsettingGetsupportedcarrierCall), [*getsupportedholidays*](api::ShippingsettingGetsupportedholidayCall), [*getsupportedpickupservices*](api::ShippingsettingGetsupportedpickupserviceCall), [*list*](api::ShippingsettingListCall) and [*update*](api::ShippingsettingUpdateCall)
44//!
45//!
46//!
47//!
48//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
49//!
50//! # Structure of this Library
51//!
52//! The API is structured into the following primary items:
53//!
54//! * **[Hub](ShoppingContent)**
55//! * a central object to maintain state and allow accessing all *Activities*
56//! * creates [*Method Builders*](common::MethodsBuilder) which in turn
57//! allow access to individual [*Call Builders*](common::CallBuilder)
58//! * **[Resources](common::Resource)**
59//! * primary types that you can apply *Activities* to
60//! * a collection of properties and *Parts*
61//! * **[Parts](common::Part)**
62//! * a collection of properties
63//! * never directly used in *Activities*
64//! * **[Activities](common::CallBuilder)**
65//! * operations to apply to *Resources*
66//!
67//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
68//!
69//! Generally speaking, you can invoke *Activities* like this:
70//!
71//! ```Rust,ignore
72//! let r = hub.resource().activity(...).doit().await
73//! ```
74//!
75//! Or specifically ...
76//!
77//! ```ignore
78//! let r = hub.orders().acknowledge(...).doit().await
79//! let r = hub.orders().advancetestorder(...).doit().await
80//! let r = hub.orders().cancel(...).doit().await
81//! let r = hub.orders().cancellineitem(...).doit().await
82//! let r = hub.orders().canceltestorderbycustomer(...).doit().await
83//! let r = hub.orders().createtestorder(...).doit().await
84//! let r = hub.orders().createtestreturn(...).doit().await
85//! let r = hub.orders().custombatch(...).doit().await
86//! let r = hub.orders().get(...).doit().await
87//! let r = hub.orders().getbymerchantorderid(...).doit().await
88//! let r = hub.orders().gettestordertemplate(...).doit().await
89//! let r = hub.orders().instorerefundlineitem(...).doit().await
90//! let r = hub.orders().list(...).doit().await
91//! let r = hub.orders().refund(...).doit().await
92//! let r = hub.orders().rejectreturnlineitem(...).doit().await
93//! let r = hub.orders().returnlineitem(...).doit().await
94//! let r = hub.orders().returnrefundlineitem(...).doit().await
95//! let r = hub.orders().setlineitemmetadata(...).doit().await
96//! let r = hub.orders().shiplineitems(...).doit().await
97//! let r = hub.orders().updatelineitemshippingdetails(...).doit().await
98//! let r = hub.orders().updatemerchantorderid(...).doit().await
99//! let r = hub.orders().updateshipment(...).doit().await
100//! ```
101//!
102//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
103//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
104//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
105//! The `doit()` method performs the actual communication with the server and returns the respective result.
106//!
107//! # Usage
108//!
109//! ## Setting up your Project
110//!
111//! To use this library, you would put the following lines into your `Cargo.toml` file:
112//!
113//! ```toml
114//! [dependencies]
115//! google-content2 = "*"
116//! serde = "1"
117//! serde_json = "1"
118//! ```
119//!
120//! ## A complete example
121//!
122//! ```test_harness,no_run
123//! extern crate hyper;
124//! extern crate hyper_rustls;
125//! extern crate google_content2 as content2;
126//! use content2::{Result, Error};
127//! # async fn dox() {
128//! use content2::{ShoppingContent, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
129//!
130//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
131//! // `client_secret`, among other things.
132//! let secret: yup_oauth2::ApplicationSecret = Default::default();
133//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
134//! // unless you replace `None` with the desired Flow.
135//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
136//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
137//! // retrieve them from storage.
138//! let connector = hyper_rustls::HttpsConnectorBuilder::new()
139//! .with_native_roots()
140//! .unwrap()
141//! .https_only()
142//! .enable_http2()
143//! .build();
144//!
145//! let executor = hyper_util::rt::TokioExecutor::new();
146//! let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
147//! secret,
148//! yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
149//! yup_oauth2::client::CustomHyperClientBuilder::from(
150//! hyper_util::client::legacy::Client::builder(executor).build(connector),
151//! ),
152//! ).build().await.unwrap();
153//!
154//! let client = hyper_util::client::legacy::Client::builder(
155//! hyper_util::rt::TokioExecutor::new()
156//! )
157//! .build(
158//! hyper_rustls::HttpsConnectorBuilder::new()
159//! .with_native_roots()
160//! .unwrap()
161//! .https_or_http()
162//! .enable_http2()
163//! .build()
164//! );
165//! let mut hub = ShoppingContent::new(client, auth);
166//! // You can configure optional parameters by calling the respective setters at will, and
167//! // execute the final call using `doit()`.
168//! // Values shown here are possibly random and not representative !
169//! let result = hub.orders().list(99)
170//! .add_statuses("takimata")
171//! .placed_date_start("amet.")
172//! .placed_date_end("duo")
173//! .page_token("ipsum")
174//! .order_by("gubergren")
175//! .max_results(50)
176//! .acknowledged(false)
177//! .doit().await;
178//!
179//! match result {
180//! Err(e) => match e {
181//! // The Error enum provides details about what exactly happened.
182//! // You can also just use its `Debug`, `Display` or `Error` traits
183//! Error::HttpError(_)
184//! |Error::Io(_)
185//! |Error::MissingAPIKey
186//! |Error::MissingToken(_)
187//! |Error::Cancelled
188//! |Error::UploadSizeLimitExceeded(_, _)
189//! |Error::Failure(_)
190//! |Error::BadRequest(_)
191//! |Error::FieldClash(_)
192//! |Error::JsonDecodeError(_, _) => println!("{}", e),
193//! },
194//! Ok(res) => println!("Success: {:?}", res),
195//! }
196//! # }
197//! ```
198//! ## Handling Errors
199//!
200//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
201//! the doit() methods, or handed as possibly intermediate results to either the
202//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
203//!
204//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
205//! makes the system potentially resilient to all kinds of errors.
206//!
207//! ## Uploads and Downloads
208//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
209//! read by you to obtain the media.
210//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
211//! 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
212//! this call: `.param("alt", "media")`.
213//!
214//! Methods supporting uploads can do so using up to 2 different protocols:
215//! *simple* and *resumable*. The distinctiveness of each is represented by customized
216//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
217//!
218//! ## Customization and Callbacks
219//!
220//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
221//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
222//! Respective methods will be called to provide progress information, as well as determine whether the system should
223//! retry on failure.
224//!
225//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
226//!
227//! ## Optional Parts in Server-Requests
228//!
229//! All structures provided by this library are made to be [encodable](common::RequestValue) and
230//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
231//! are valid.
232//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
233//! the server to indicate either the set parts of the request or the desired parts in the response.
234//!
235//! ## Builder Arguments
236//!
237//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
238//! These will always take a single argument, for which the following statements are true.
239//!
240//! * [PODs][wiki-pod] are handed by copy
241//! * strings are passed as `&str`
242//! * [request values](common::RequestValue) are moved
243//!
244//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
245//!
246//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
247//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
248//! [google-go-api]: https://github.com/google/google-api-go-client
249//!
250//! ## Cargo Features
251//!
252//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
253//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
254//! generated `openapi` spec would be invalid.
255//!
256//!
257//!
258
259// Unused attributes happen thanks to defined, but unused structures We don't
260// warn about this, as depending on the API, some data structures or facilities
261// are never used. Instead of pre-determining this, we just disable the lint.
262// It's manually tuned to not have any unused imports in fully featured APIs.
263// Same with unused_mut.
264#![allow(unused_imports, unused_mut, dead_code)]
265
266// DO NOT EDIT !
267// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
268// DO NOT EDIT !
269
270pub extern crate hyper;
271pub extern crate hyper_rustls;
272pub extern crate hyper_util;
273#[cfg(feature = "yup-oauth2")]
274pub extern crate yup_oauth2;
275
276pub extern crate google_apis_common as common;
277pub use common::{Delegate, Error, FieldMask, Result};
278
279pub mod api;
280pub use api::ShoppingContent;