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