google_walletobjects1/
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 *Walletobjects* crate version *6.0.0+20240626*, where *20240626* is the exact revision of the *walletobjects:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v6.0.0*.
6//!
7//! Everything else about the *Walletobjects* *v1* API can be found at the
8//! [official documentation site](https://developers.google.com/pay/passes).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/walletobjects1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](Walletobjects) ...
13//!
14//! * eventticketclass
15//!  * [*addmessage*](api::EventticketclasAddmessageCall), [*get*](api::EventticketclasGetCall), [*insert*](api::EventticketclasInsertCall), [*list*](api::EventticketclasListCall), [*patch*](api::EventticketclasPatchCall) and [*update*](api::EventticketclasUpdateCall)
16//! * eventticketobject
17//!  * [*addmessage*](api::EventticketobjectAddmessageCall), [*get*](api::EventticketobjectGetCall), [*insert*](api::EventticketobjectInsertCall), [*list*](api::EventticketobjectListCall), [*modifylinkedofferobjects*](api::EventticketobjectModifylinkedofferobjectCall), [*patch*](api::EventticketobjectPatchCall) and [*update*](api::EventticketobjectUpdateCall)
18//! * flightclass
19//!  * [*addmessage*](api::FlightclasAddmessageCall), [*get*](api::FlightclasGetCall), [*insert*](api::FlightclasInsertCall), [*list*](api::FlightclasListCall), [*patch*](api::FlightclasPatchCall) and [*update*](api::FlightclasUpdateCall)
20//! * flightobject
21//!  * [*addmessage*](api::FlightobjectAddmessageCall), [*get*](api::FlightobjectGetCall), [*insert*](api::FlightobjectInsertCall), [*list*](api::FlightobjectListCall), [*patch*](api::FlightobjectPatchCall) and [*update*](api::FlightobjectUpdateCall)
22//! * genericclass
23//!  * [*addmessage*](api::GenericclasAddmessageCall), [*get*](api::GenericclasGetCall), [*insert*](api::GenericclasInsertCall), [*list*](api::GenericclasListCall), [*patch*](api::GenericclasPatchCall) and [*update*](api::GenericclasUpdateCall)
24//! * genericobject
25//!  * [*addmessage*](api::GenericobjectAddmessageCall), [*get*](api::GenericobjectGetCall), [*insert*](api::GenericobjectInsertCall), [*list*](api::GenericobjectListCall), [*patch*](api::GenericobjectPatchCall) and [*update*](api::GenericobjectUpdateCall)
26//! * giftcardclass
27//!  * [*addmessage*](api::GiftcardclasAddmessageCall), [*get*](api::GiftcardclasGetCall), [*insert*](api::GiftcardclasInsertCall), [*list*](api::GiftcardclasListCall), [*patch*](api::GiftcardclasPatchCall) and [*update*](api::GiftcardclasUpdateCall)
28//! * giftcardobject
29//!  * [*addmessage*](api::GiftcardobjectAddmessageCall), [*get*](api::GiftcardobjectGetCall), [*insert*](api::GiftcardobjectInsertCall), [*list*](api::GiftcardobjectListCall), [*patch*](api::GiftcardobjectPatchCall) and [*update*](api::GiftcardobjectUpdateCall)
30//! * [issuer](api::Issuer)
31//!  * [*get*](api::IssuerGetCall), [*insert*](api::IssuerInsertCall), [*list*](api::IssuerListCall), [*patch*](api::IssuerPatchCall) and [*update*](api::IssuerUpdateCall)
32//! * jwt
33//!  * [*insert*](api::JwtInsertCall)
34//! * loyaltyclass
35//!  * [*addmessage*](api::LoyaltyclasAddmessageCall), [*get*](api::LoyaltyclasGetCall), [*insert*](api::LoyaltyclasInsertCall), [*list*](api::LoyaltyclasListCall), [*patch*](api::LoyaltyclasPatchCall) and [*update*](api::LoyaltyclasUpdateCall)
36//! * loyaltyobject
37//!  * [*addmessage*](api::LoyaltyobjectAddmessageCall), [*get*](api::LoyaltyobjectGetCall), [*insert*](api::LoyaltyobjectInsertCall), [*list*](api::LoyaltyobjectListCall), [*modifylinkedofferobjects*](api::LoyaltyobjectModifylinkedofferobjectCall), [*patch*](api::LoyaltyobjectPatchCall) and [*update*](api::LoyaltyobjectUpdateCall)
38//! * [media](api::Media)
39//!  * [*download*](api::MediaDownloadCall) and [*upload*](api::MediaUploadCall)
40//! * offerclass
41//!  * [*addmessage*](api::OfferclasAddmessageCall), [*get*](api::OfferclasGetCall), [*insert*](api::OfferclasInsertCall), [*list*](api::OfferclasListCall), [*patch*](api::OfferclasPatchCall) and [*update*](api::OfferclasUpdateCall)
42//! * offerobject
43//!  * [*addmessage*](api::OfferobjectAddmessageCall), [*get*](api::OfferobjectGetCall), [*insert*](api::OfferobjectInsertCall), [*list*](api::OfferobjectListCall), [*patch*](api::OfferobjectPatchCall) and [*update*](api::OfferobjectUpdateCall)
44//! * [permissions](api::Permission)
45//!  * [*get*](api::PermissionGetCall) and [*update*](api::PermissionUpdateCall)
46//! * smarttap
47//!  * [*insert*](api::SmarttapInsertCall)
48//! * transitclass
49//!  * [*addmessage*](api::TransitclasAddmessageCall), [*get*](api::TransitclasGetCall), [*insert*](api::TransitclasInsertCall), [*list*](api::TransitclasListCall), [*patch*](api::TransitclasPatchCall) and [*update*](api::TransitclasUpdateCall)
50//! * transitobject
51//!  * [*addmessage*](api::TransitobjectAddmessageCall), [*get*](api::TransitobjectGetCall), [*insert*](api::TransitobjectInsertCall), [*list*](api::TransitobjectListCall), [*patch*](api::TransitobjectPatchCall) and [*update*](api::TransitobjectUpdateCall)
52//!
53//!
54//! Upload supported by ...
55//!
56//! * [*upload media*](api::MediaUploadCall)
57//!
58//! Download supported by ...
59//!
60//! * [*download media*](api::MediaDownloadCall)
61//!
62//!
63//!
64//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
65//!
66//! # Structure of this Library
67//!
68//! The API is structured into the following primary items:
69//!
70//! * **[Hub](Walletobjects)**
71//!     * a central object to maintain state and allow accessing all *Activities*
72//!     * creates [*Method Builders*](common::MethodsBuilder) which in turn
73//!       allow access to individual [*Call Builders*](common::CallBuilder)
74//! * **[Resources](common::Resource)**
75//!     * primary types that you can apply *Activities* to
76//!     * a collection of properties and *Parts*
77//!     * **[Parts](common::Part)**
78//!         * a collection of properties
79//!         * never directly used in *Activities*
80//! * **[Activities](common::CallBuilder)**
81//!     * operations to apply to *Resources*
82//!
83//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
84//!
85//! Generally speaking, you can invoke *Activities* like this:
86//!
87//! ```Rust,ignore
88//! let r = hub.resource().activity(...).doit().await
89//! ```
90//!
91//! Or specifically ...
92//!
93//! ```ignore
94//! let r = hub.eventticketclass().addmessage(...).doit().await
95//! let r = hub.eventticketobject().addmessage(...).doit().await
96//! let r = hub.flightclass().addmessage(...).doit().await
97//! let r = hub.flightobject().addmessage(...).doit().await
98//! let r = hub.genericclass().addmessage(...).doit().await
99//! let r = hub.genericobject().addmessage(...).doit().await
100//! let r = hub.giftcardclass().addmessage(...).doit().await
101//! let r = hub.giftcardobject().addmessage(...).doit().await
102//! let r = hub.loyaltyclass().addmessage(...).doit().await
103//! let r = hub.loyaltyobject().addmessage(...).doit().await
104//! let r = hub.offerclass().addmessage(...).doit().await
105//! let r = hub.offerobject().addmessage(...).doit().await
106//! let r = hub.transitclass().addmessage(...).doit().await
107//! let r = hub.transitobject().addmessage(...).doit().await
108//! ```
109//!
110//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
111//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
112//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
113//! The `doit()` method performs the actual communication with the server and returns the respective result.
114//!
115//! # Usage
116//!
117//! ## Setting up your Project
118//!
119//! To use this library, you would put the following lines into your `Cargo.toml` file:
120//!
121//! ```toml
122//! [dependencies]
123//! google-walletobjects1 = "*"
124//! serde = "1"
125//! serde_json = "1"
126//! ```
127//!
128//! ## A complete example
129//!
130//! ```test_harness,no_run
131//! extern crate hyper;
132//! extern crate hyper_rustls;
133//! extern crate google_walletobjects1 as walletobjects1;
134//! use walletobjects1::api::AddMessageRequest;
135//! use walletobjects1::{Result, Error};
136//! # async fn dox() {
137//! use walletobjects1::{Walletobjects, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
138//!
139//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
140//! // `client_secret`, among other things.
141//! let secret: yup_oauth2::ApplicationSecret = Default::default();
142//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
143//! // unless you replace  `None` with the desired Flow.
144//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
145//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
146//! // retrieve them from storage.
147//! let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
148//!     secret,
149//!     yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
150//! ).build().await.unwrap();
151//!
152//! let client = hyper_util::client::legacy::Client::builder(
153//!     hyper_util::rt::TokioExecutor::new()
154//! )
155//! .build(
156//!     hyper_rustls::HttpsConnectorBuilder::new()
157//!         .with_native_roots()
158//!         .unwrap()
159//!         .https_or_http()
160//!         .enable_http1()
161//!         .build()
162//! );
163//! let mut hub = Walletobjects::new(client, auth);
164//! // As the method needs a request, you would usually fill it with the desired information
165//! // into the respective structure. Some of the parts shown here might not be applicable !
166//! // Values shown here are possibly random and not representative !
167//! let mut req = AddMessageRequest::default();
168//!
169//! // You can configure optional parameters by calling the respective setters at will, and
170//! // execute the final call using `doit()`.
171//! // Values shown here are possibly random and not representative !
172//! let result = hub.eventticketclass().addmessage(req, "resourceId")
173//!              .doit().await;
174//!
175//! match result {
176//!     Err(e) => match e {
177//!         // The Error enum provides details about what exactly happened.
178//!         // You can also just use its `Debug`, `Display` or `Error` traits
179//!          Error::HttpError(_)
180//!         |Error::Io(_)
181//!         |Error::MissingAPIKey
182//!         |Error::MissingToken(_)
183//!         |Error::Cancelled
184//!         |Error::UploadSizeLimitExceeded(_, _)
185//!         |Error::Failure(_)
186//!         |Error::BadRequest(_)
187//!         |Error::FieldClash(_)
188//!         |Error::JsonDecodeError(_, _) => println!("{}", e),
189//!     },
190//!     Ok(res) => println!("Success: {:?}", res),
191//! }
192//! # }
193//! ```
194//! ## Handling Errors
195//!
196//! All errors produced by the system are provided either as [Result](common::Result) enumeration as return value of
197//! the doit() methods, or handed as possibly intermediate results to either the
198//! [Hub Delegate](common::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
199//!
200//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
201//! makes the system potentially resilient to all kinds of errors.
202//!
203//! ## Uploads and Downloads
204//! If a method supports downloads, the response body, which is part of the [Result](common::Result), should be
205//! read by you to obtain the media.
206//! If such a method also supports a [Response Result](common::ResponseResult), it will return that by default.
207//! 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
208//! this call: `.param("alt", "media")`.
209//!
210//! Methods supporting uploads can do so using up to 2 different protocols:
211//! *simple* and *resumable*. The distinctiveness of each is represented by customized
212//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
213//!
214//! ## Customization and Callbacks
215//!
216//! You may alter the way an `doit()` method is called by providing a [delegate](common::Delegate) to the
217//! [Method Builder](common::CallBuilder) before making the final `doit()` call.
218//! Respective methods will be called to provide progress information, as well as determine whether the system should
219//! retry on failure.
220//!
221//! The [delegate trait](common::Delegate) is default-implemented, allowing you to customize it with minimal effort.
222//!
223//! ## Optional Parts in Server-Requests
224//!
225//! All structures provided by this library are made to be [encodable](common::RequestValue) and
226//! [decodable](common::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
227//! are valid.
228//! Most optionals are are considered [Parts](common::Part) which are identifiable by name, which will be sent to
229//! the server to indicate either the set parts of the request or the desired parts in the response.
230//!
231//! ## Builder Arguments
232//!
233//! Using [method builders](common::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
234//! These will always take a single argument, for which the following statements are true.
235//!
236//! * [PODs][wiki-pod] are handed by copy
237//! * strings are passed as `&str`
238//! * [request values](common::RequestValue) are moved
239//!
240//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
241//!
242//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
243//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
244//! [google-go-api]: https://github.com/google/google-api-go-client
245//!
246//! ## Cargo Features
247//!
248//! * `utoipa` - Add support for [utoipa](https://crates.io/crates/utoipa) and derive `utoipa::ToSchema` on all
249//! the types. You'll have to import and register the required types in `#[openapi(schemas(...))]`, otherwise the
250//! generated `openapi` spec would be invalid.
251//!
252//!
253//!
254
255// Unused attributes happen thanks to defined, but unused structures We don't
256// warn about this, as depending on the API, some data structures or facilities
257// are never used. Instead of pre-determining this, we just disable the lint.
258// It's manually tuned to not have any unused imports in fully featured APIs.
259// Same with unused_mut.
260#![allow(unused_imports, unused_mut, dead_code)]
261
262// DO NOT EDIT !
263// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
264// DO NOT EDIT !
265
266pub extern crate hyper;
267pub extern crate hyper_rustls;
268pub extern crate hyper_util;
269#[cfg(feature = "yup-oauth2")]
270pub extern crate yup_oauth2;
271
272pub extern crate google_apis_common as common;
273pub use common::{Delegate, Error, FieldMask, Result};
274
275pub mod api;
276pub use api::Walletobjects;