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