mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
make regen-apis
This commit is contained in:
File diff suppressed because it is too large
Load Diff
137
gen/coordinate1/src/api/hub.rs
Normal file
137
gen/coordinate1/src/api/hub.rs
Normal file
@@ -0,0 +1,137 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all Coordinate related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_coordinate1 as coordinate1;
|
||||
/// use coordinate1::api::Job;
|
||||
/// use coordinate1::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use coordinate1::{Coordinate, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
/// // unless you replace `None` with the desired Flow.
|
||||
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
|
||||
/// // retrieve them from storage.
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Coordinate::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
/// // into the respective structure. Some of the parts shown here might not be applicable !
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let mut req = Job::default();
|
||||
///
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.jobs().patch(req, "teamId", 85)
|
||||
/// .title("est")
|
||||
/// .progress("ipsum")
|
||||
/// .note("ipsum")
|
||||
/// .lng(0.8016125465746553)
|
||||
/// .lat(0.8000651323113592)
|
||||
/// .customer_phone_number("ea")
|
||||
/// .customer_name("dolor")
|
||||
/// .add_custom_field("Lorem")
|
||||
/// .assignee("eos")
|
||||
/// .address("labore")
|
||||
/// .doit().await;
|
||||
///
|
||||
/// match result {
|
||||
/// Err(e) => match e {
|
||||
/// // The Error enum provides details about what exactly happened.
|
||||
/// // You can also just use its `Debug`, `Display` or `Error` traits
|
||||
/// Error::HttpError(_)
|
||||
/// |Error::Io(_)
|
||||
/// |Error::MissingAPIKey
|
||||
/// |Error::MissingToken(_)
|
||||
/// |Error::Cancelled
|
||||
/// |Error::UploadSizeLimitExceeded(_, _)
|
||||
/// |Error::Failure(_)
|
||||
/// |Error::BadRequest(_)
|
||||
/// |Error::FieldClash(_)
|
||||
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
|
||||
/// },
|
||||
/// Ok(res) => println!("Success: {:?}", res),
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct Coordinate<S> {
|
||||
pub client: hyper::Client<S, hyper::body::Body>,
|
||||
pub auth: Box<dyn client::GetToken>,
|
||||
pub(super) _user_agent: String,
|
||||
pub(super) _base_url: String,
|
||||
pub(super) _root_url: String,
|
||||
}
|
||||
|
||||
impl<'a, S> client::Hub for Coordinate<S> {}
|
||||
|
||||
impl<'a, S> Coordinate<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> Coordinate<S> {
|
||||
Coordinate {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.3".to_string(),
|
||||
_base_url: "https://www.googleapis.com/coordinate/v1/".to_string(),
|
||||
_root_url: "https://www.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn custom_field_def(&'a self) -> CustomFieldDefMethods<'a, S> {
|
||||
CustomFieldDefMethods { hub: &self }
|
||||
}
|
||||
pub fn jobs(&'a self) -> JobMethods<'a, S> {
|
||||
JobMethods { hub: &self }
|
||||
}
|
||||
pub fn location(&'a self) -> LocationMethods<'a, S> {
|
||||
LocationMethods { hub: &self }
|
||||
}
|
||||
pub fn schedule(&'a self) -> ScheduleMethods<'a, S> {
|
||||
ScheduleMethods { hub: &self }
|
||||
}
|
||||
pub fn team(&'a self) -> TeamMethods<'a, S> {
|
||||
TeamMethods { hub: &self }
|
||||
}
|
||||
pub fn worker(&'a self) -> WorkerMethods<'a, S> {
|
||||
WorkerMethods { hub: &self }
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/5.0.3`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
mem::replace(&mut self._user_agent, agent_name)
|
||||
}
|
||||
|
||||
/// Set the base url to use in all requests to the server.
|
||||
/// It defaults to `https://www.googleapis.com/coordinate/v1/`.
|
||||
///
|
||||
/// Returns the previously set base url.
|
||||
pub fn base_url(&mut self, new_base_url: String) -> String {
|
||||
mem::replace(&mut self._base_url, new_base_url)
|
||||
}
|
||||
|
||||
/// Set the root url to use in all requests to the server.
|
||||
/// It defaults to `https://www.googleapis.com/`.
|
||||
///
|
||||
/// Returns the previously set root url.
|
||||
pub fn root_url(&mut self, new_root_url: String) -> String {
|
||||
mem::replace(&mut self._root_url, new_root_url)
|
||||
}
|
||||
}
|
||||
522
gen/coordinate1/src/api/method_builders.rs
Normal file
522
gen/coordinate1/src/api/method_builders.rs
Normal file
@@ -0,0 +1,522 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *customFieldDef* resources.
|
||||
/// It is not used directly, but through the [`Coordinate`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_coordinate1 as coordinate1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use coordinate1::{Coordinate, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Coordinate::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.custom_field_def();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct CustomFieldDefMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Coordinate<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for CustomFieldDefMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> CustomFieldDefMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves a list of custom field definitions for a team.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `teamId` - Team ID
|
||||
pub fn list(&self, team_id: &str) -> CustomFieldDefListCall<'a, S> {
|
||||
CustomFieldDefListCall {
|
||||
hub: self.hub,
|
||||
_team_id: team_id.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *job* resources.
|
||||
/// It is not used directly, but through the [`Coordinate`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_coordinate1 as coordinate1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use coordinate1::{Coordinate, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Coordinate::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `get(...)`, `insert(...)`, `list(...)`, `patch(...)` and `update(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.jobs();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct JobMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Coordinate<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for JobMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> JobMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves a job, including all the changes made to the job.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `teamId` - Team ID
|
||||
/// * `jobId` - Job number
|
||||
pub fn get(&self, team_id: &str, job_id: u64) -> JobGetCall<'a, S> {
|
||||
JobGetCall {
|
||||
hub: self.hub,
|
||||
_team_id: team_id.to_string(),
|
||||
_job_id: job_id,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Inserts a new job. Only the state field of the job should be set.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `teamId` - Team ID
|
||||
/// * `address` - Job address as newline (Unix) separated string
|
||||
/// * `lat` - The latitude coordinate of this job's location.
|
||||
/// * `lng` - The longitude coordinate of this job's location.
|
||||
/// * `title` - Job title
|
||||
pub fn insert(&self, request: Job, team_id: &str, address: &str, lat: f64, lng: f64, title: &str) -> JobInsertCall<'a, S> {
|
||||
JobInsertCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_team_id: team_id.to_string(),
|
||||
_address: address.to_string(),
|
||||
_lat: lat,
|
||||
_lng: lng,
|
||||
_title: title.to_string(),
|
||||
_note: Default::default(),
|
||||
_customer_phone_number: Default::default(),
|
||||
_customer_name: Default::default(),
|
||||
_custom_field: Default::default(),
|
||||
_assignee: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves jobs created or modified since the given timestamp.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `teamId` - Team ID
|
||||
pub fn list(&self, team_id: &str) -> JobListCall<'a, S> {
|
||||
JobListCall {
|
||||
hub: self.hub,
|
||||
_team_id: team_id.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_omit_job_changes: Default::default(),
|
||||
_min_modified_timestamp_ms: Default::default(),
|
||||
_max_results: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates a job. Fields that are set in the job state will be updated. This method supports patch semantics.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `teamId` - Team ID
|
||||
/// * `jobId` - Job number
|
||||
pub fn patch(&self, request: Job, team_id: &str, job_id: u64) -> JobPatchCall<'a, S> {
|
||||
JobPatchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_team_id: team_id.to_string(),
|
||||
_job_id: job_id,
|
||||
_title: Default::default(),
|
||||
_progress: Default::default(),
|
||||
_note: Default::default(),
|
||||
_lng: Default::default(),
|
||||
_lat: Default::default(),
|
||||
_customer_phone_number: Default::default(),
|
||||
_customer_name: Default::default(),
|
||||
_custom_field: Default::default(),
|
||||
_assignee: Default::default(),
|
||||
_address: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates a job. Fields that are set in the job state will be updated.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `teamId` - Team ID
|
||||
/// * `jobId` - Job number
|
||||
pub fn update(&self, request: Job, team_id: &str, job_id: u64) -> JobUpdateCall<'a, S> {
|
||||
JobUpdateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_team_id: team_id.to_string(),
|
||||
_job_id: job_id,
|
||||
_title: Default::default(),
|
||||
_progress: Default::default(),
|
||||
_note: Default::default(),
|
||||
_lng: Default::default(),
|
||||
_lat: Default::default(),
|
||||
_customer_phone_number: Default::default(),
|
||||
_customer_name: Default::default(),
|
||||
_custom_field: Default::default(),
|
||||
_assignee: Default::default(),
|
||||
_address: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *location* resources.
|
||||
/// It is not used directly, but through the [`Coordinate`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_coordinate1 as coordinate1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use coordinate1::{Coordinate, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Coordinate::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.location();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct LocationMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Coordinate<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for LocationMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> LocationMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves a list of locations for a worker.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `teamId` - Team ID
|
||||
/// * `workerEmail` - Worker email address.
|
||||
/// * `startTimestampMs` - Start timestamp in milliseconds since the epoch.
|
||||
pub fn list(&self, team_id: &str, worker_email: &str, start_timestamp_ms: u64) -> LocationListCall<'a, S> {
|
||||
LocationListCall {
|
||||
hub: self.hub,
|
||||
_team_id: team_id.to_string(),
|
||||
_worker_email: worker_email.to_string(),
|
||||
_start_timestamp_ms: start_timestamp_ms,
|
||||
_page_token: Default::default(),
|
||||
_max_results: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *schedule* resources.
|
||||
/// It is not used directly, but through the [`Coordinate`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_coordinate1 as coordinate1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use coordinate1::{Coordinate, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Coordinate::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `get(...)`, `patch(...)` and `update(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.schedule();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ScheduleMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Coordinate<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for ScheduleMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> ScheduleMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves the schedule for a job.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `teamId` - Team ID
|
||||
/// * `jobId` - Job number
|
||||
pub fn get(&self, team_id: &str, job_id: u64) -> ScheduleGetCall<'a, S> {
|
||||
ScheduleGetCall {
|
||||
hub: self.hub,
|
||||
_team_id: team_id.to_string(),
|
||||
_job_id: job_id,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Replaces the schedule of a job with the provided schedule. This method supports patch semantics.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `teamId` - Team ID
|
||||
/// * `jobId` - Job number
|
||||
pub fn patch(&self, request: Schedule, team_id: &str, job_id: u64) -> SchedulePatchCall<'a, S> {
|
||||
SchedulePatchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_team_id: team_id.to_string(),
|
||||
_job_id: job_id,
|
||||
_start_time: Default::default(),
|
||||
_end_time: Default::default(),
|
||||
_duration: Default::default(),
|
||||
_all_day: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Replaces the schedule of a job with the provided schedule.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `teamId` - Team ID
|
||||
/// * `jobId` - Job number
|
||||
pub fn update(&self, request: Schedule, team_id: &str, job_id: u64) -> ScheduleUpdateCall<'a, S> {
|
||||
ScheduleUpdateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_team_id: team_id.to_string(),
|
||||
_job_id: job_id,
|
||||
_start_time: Default::default(),
|
||||
_end_time: Default::default(),
|
||||
_duration: Default::default(),
|
||||
_all_day: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *team* resources.
|
||||
/// It is not used directly, but through the [`Coordinate`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_coordinate1 as coordinate1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use coordinate1::{Coordinate, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Coordinate::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.team();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct TeamMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Coordinate<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for TeamMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> TeamMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves a list of teams for a user.
|
||||
pub fn list(&self) -> TeamListCall<'a, S> {
|
||||
TeamListCall {
|
||||
hub: self.hub,
|
||||
_worker: Default::default(),
|
||||
_dispatcher: Default::default(),
|
||||
_admin: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *worker* resources.
|
||||
/// It is not used directly, but through the [`Coordinate`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_coordinate1 as coordinate1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use coordinate1::{Coordinate, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = Coordinate::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.worker();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct WorkerMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a Coordinate<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for WorkerMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> WorkerMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves a list of workers in a team.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `teamId` - Team ID
|
||||
pub fn list(&self, team_id: &str) -> WorkerListCall<'a, S> {
|
||||
WorkerListCall {
|
||||
hub: self.hub,
|
||||
_team_id: team_id.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
32
gen/coordinate1/src/api/mod.rs
Normal file
32
gen/coordinate1/src/api/mod.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeSet;
|
||||
use std::error::Error as StdError;
|
||||
use serde_json as json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
use std::mem;
|
||||
|
||||
use hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::time::sleep;
|
||||
use tower_service;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::{client, client::GetToken, client::serde_with};
|
||||
|
||||
mod utilities;
|
||||
pub use utilities::*;
|
||||
|
||||
mod hub;
|
||||
pub use hub::*;
|
||||
|
||||
mod schemas;
|
||||
pub use schemas::*;
|
||||
|
||||
mod method_builders;
|
||||
pub use method_builders::*;
|
||||
|
||||
mod call_builders;
|
||||
pub use call_builders::*;
|
||||
479
gen/coordinate1/src/api/schemas.rs
Normal file
479
gen/coordinate1/src/api/schemas.rs
Normal file
@@ -0,0 +1,479 @@
|
||||
use super::*;
|
||||
/// Custom field.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct CustomField {
|
||||
/// Custom field id.
|
||||
#[serde(rename="customFieldId")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub custom_field_id: Option<i64>,
|
||||
/// Identifies this object as a custom field.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Custom field value.
|
||||
|
||||
pub value: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for CustomField {}
|
||||
|
||||
|
||||
/// Custom field definition.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct CustomFieldDef {
|
||||
/// Whether the field is enabled.
|
||||
|
||||
pub enabled: Option<bool>,
|
||||
/// List of enum items for this custom field. Populated only if the field type is enum. Enum fields appear as 'lists' in the Coordinate web and mobile UI.
|
||||
|
||||
pub enumitems: Option<Vec<EnumItemDef>>,
|
||||
/// Custom field id.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub id: Option<i64>,
|
||||
/// Identifies this object as a custom field definition.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Custom field name.
|
||||
|
||||
pub name: Option<String>,
|
||||
/// Whether the field is required for checkout.
|
||||
#[serde(rename="requiredForCheckout")]
|
||||
|
||||
pub required_for_checkout: Option<bool>,
|
||||
/// Custom field type.
|
||||
#[serde(rename="type")]
|
||||
|
||||
pub type_: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for CustomFieldDef {}
|
||||
|
||||
|
||||
/// Collection of custom field definitions for a team.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list custom field def](CustomFieldDefListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct CustomFieldDefListResponse {
|
||||
/// Collection of custom field definitions in a team.
|
||||
|
||||
pub items: Option<Vec<CustomFieldDef>>,
|
||||
/// Identifies this object as a collection of custom field definitions in a team.
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for CustomFieldDefListResponse {}
|
||||
|
||||
|
||||
/// Collection of custom fields.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct CustomFields {
|
||||
/// Collection of custom fields.
|
||||
#[serde(rename="customField")]
|
||||
|
||||
pub custom_field: Option<Vec<CustomField>>,
|
||||
/// Identifies this object as a collection of custom fields.
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for CustomFields {}
|
||||
|
||||
|
||||
/// Enum Item definition.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct EnumItemDef {
|
||||
/// Whether the enum item is active. Jobs may contain inactive enum values; however, setting an enum to an inactive value when creating or updating a job will result in a 500 error.
|
||||
|
||||
pub active: Option<bool>,
|
||||
/// Identifies this object as an enum item definition.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Custom field value.
|
||||
|
||||
pub value: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for EnumItemDef {}
|
||||
|
||||
|
||||
/// A job.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [get jobs](JobGetCall) (response)
|
||||
/// * [insert jobs](JobInsertCall) (request|response)
|
||||
/// * [list jobs](JobListCall) (none)
|
||||
/// * [patch jobs](JobPatchCall) (request|response)
|
||||
/// * [update jobs](JobUpdateCall) (request|response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Job {
|
||||
/// Job id.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub id: Option<u64>,
|
||||
/// List of job changes since it was created. The first change corresponds to the state of the job when it was created.
|
||||
#[serde(rename="jobChange")]
|
||||
|
||||
pub job_change: Option<Vec<JobChange>>,
|
||||
/// Identifies this object as a job.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Current job state.
|
||||
|
||||
pub state: Option<JobState>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for Job {}
|
||||
impl client::Resource for Job {}
|
||||
impl client::ResponseResult for Job {}
|
||||
|
||||
|
||||
/// Change to a job. For example assigning the job to a different worker.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct JobChange {
|
||||
/// Identifies this object as a job change.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Change applied to the job. Only the fields that were changed are set.
|
||||
|
||||
pub state: Option<JobState>,
|
||||
/// Time at which this change was applied.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub timestamp: Option<u64>,
|
||||
}
|
||||
|
||||
impl client::Part for JobChange {}
|
||||
|
||||
|
||||
/// Response from a List Jobs request.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list jobs](JobListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct JobListResponse {
|
||||
/// Jobs in the collection.
|
||||
|
||||
pub items: Option<Vec<Job>>,
|
||||
/// Identifies this object as a list of jobs.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// A token to provide to get the next page of results.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for JobListResponse {}
|
||||
|
||||
|
||||
/// Current state of a job.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct JobState {
|
||||
/// Email address of the assignee, or the string "DELETED_USER" if the account is no longer available.
|
||||
|
||||
pub assignee: Option<String>,
|
||||
/// Custom fields.
|
||||
#[serde(rename="customFields")]
|
||||
|
||||
pub custom_fields: Option<CustomFields>,
|
||||
/// Customer name.
|
||||
#[serde(rename="customerName")]
|
||||
|
||||
pub customer_name: Option<String>,
|
||||
/// Customer phone number.
|
||||
#[serde(rename="customerPhoneNumber")]
|
||||
|
||||
pub customer_phone_number: Option<String>,
|
||||
/// Identifies this object as a job state.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Job location.
|
||||
|
||||
pub location: Option<Location>,
|
||||
/// Note added to the job.
|
||||
|
||||
pub note: Option<Vec<String>>,
|
||||
/// Job progress.
|
||||
|
||||
pub progress: Option<String>,
|
||||
/// Job title.
|
||||
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for JobState {}
|
||||
|
||||
|
||||
/// Location of a job.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Location {
|
||||
/// Address.
|
||||
#[serde(rename="addressLine")]
|
||||
|
||||
pub address_line: Option<Vec<String>>,
|
||||
/// Identifies this object as a location.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Latitude.
|
||||
|
||||
pub lat: Option<f64>,
|
||||
/// Longitude.
|
||||
|
||||
pub lng: Option<f64>,
|
||||
}
|
||||
|
||||
impl client::Part for Location {}
|
||||
|
||||
|
||||
/// Response from a List Locations request.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list location](LocationListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct LocationListResponse {
|
||||
/// Locations in the collection.
|
||||
|
||||
pub items: Option<Vec<LocationRecord>>,
|
||||
/// Identifies this object as a list of locations.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// A token to provide to get the next page of results.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
/// Pagination information for token pagination.
|
||||
#[serde(rename="tokenPagination")]
|
||||
|
||||
pub token_pagination: Option<TokenPagination>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for LocationListResponse {}
|
||||
|
||||
|
||||
/// Recorded location of a worker.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct LocationRecord {
|
||||
/// The collection time in milliseconds since the epoch.
|
||||
#[serde(rename="collectionTime")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub collection_time: Option<i64>,
|
||||
/// The location accuracy in meters. This is the radius of a 95% confidence interval around the location measurement.
|
||||
#[serde(rename="confidenceRadius")]
|
||||
|
||||
pub confidence_radius: Option<f64>,
|
||||
/// Identifies this object as a location.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Latitude.
|
||||
|
||||
pub latitude: Option<f64>,
|
||||
/// Longitude.
|
||||
|
||||
pub longitude: Option<f64>,
|
||||
}
|
||||
|
||||
impl client::Part for LocationRecord {}
|
||||
|
||||
|
||||
/// Job schedule.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [get schedule](ScheduleGetCall) (response)
|
||||
/// * [patch schedule](SchedulePatchCall) (request|response)
|
||||
/// * [update schedule](ScheduleUpdateCall) (request|response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Schedule {
|
||||
/// Whether the job is scheduled for the whole day. Time of day in start/end times is ignored if this is true.
|
||||
#[serde(rename="allDay")]
|
||||
|
||||
pub all_day: Option<bool>,
|
||||
/// Job duration in milliseconds.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub duration: Option<u64>,
|
||||
/// Scheduled end time in milliseconds since epoch.
|
||||
#[serde(rename="endTime")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub end_time: Option<u64>,
|
||||
/// Identifies this object as a job schedule.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Scheduled start time in milliseconds since epoch.
|
||||
#[serde(rename="startTime")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub start_time: Option<u64>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for Schedule {}
|
||||
impl client::ResponseResult for Schedule {}
|
||||
|
||||
|
||||
/// A Coordinate team.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Team {
|
||||
/// Team id, as found in a coordinate team url e.g. https://coordinate.google.com/f/xyz where "xyz" is the team id.
|
||||
|
||||
pub id: Option<String>,
|
||||
/// Identifies this object as a team.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Team name
|
||||
|
||||
pub name: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for Team {}
|
||||
|
||||
|
||||
/// Response from a List Teams request.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list team](TeamListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct TeamListResponse {
|
||||
/// Teams in the collection.
|
||||
|
||||
pub items: Option<Vec<Team>>,
|
||||
/// Identifies this object as a list of teams.
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for TeamListResponse {}
|
||||
|
||||
|
||||
/// Pagination information.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct TokenPagination {
|
||||
/// Identifies this object as pagination information.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// A token to provide to get the next page of results.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
/// A token to provide to get the previous page of results.
|
||||
#[serde(rename="previousPageToken")]
|
||||
|
||||
pub previous_page_token: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for TokenPagination {}
|
||||
|
||||
|
||||
/// A worker in a Coordinate team.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Worker {
|
||||
/// Worker email address. If a worker has been deleted from your team, the email address will appear as DELETED_USER.
|
||||
|
||||
pub id: Option<String>,
|
||||
/// Identifies this object as a worker.
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for Worker {}
|
||||
|
||||
|
||||
/// Response from a List Workers request.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list worker](WorkerListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct WorkerListResponse {
|
||||
/// Workers in the collection.
|
||||
|
||||
pub items: Option<Vec<Worker>>,
|
||||
/// Identifies this object as a list of workers.
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for WorkerListResponse {}
|
||||
|
||||
|
||||
28
gen/coordinate1/src/api/utilities.rs
Normal file
28
gen/coordinate1/src/api/utilities.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use super::*;
|
||||
/// Identifies the an OAuth2 authorization scope.
|
||||
/// A scope is needed when requesting an
|
||||
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
|
||||
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
|
||||
pub enum Scope {
|
||||
/// View and manage your Google Maps Coordinate jobs
|
||||
Full,
|
||||
|
||||
/// View your Google Coordinate jobs
|
||||
Readonly,
|
||||
}
|
||||
|
||||
impl AsRef<str> for Scope {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
Scope::Full => "https://www.googleapis.com/auth/coordinate",
|
||||
Scope::Readonly => "https://www.googleapis.com/auth/coordinate.readonly",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Scope {
|
||||
fn default() -> Scope {
|
||||
Scope::Readonly
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user