mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
regenerate all APIs and CLIs (#357)
This commit is contained in:
@@ -2,12 +2,17 @@ use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeMap;
|
||||
use std::error::Error as StdError;
|
||||
use serde_json as json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
use std::mem;
|
||||
use std::thread::sleep;
|
||||
|
||||
use http::Uri;
|
||||
use hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tower_service;
|
||||
use crate::client;
|
||||
|
||||
// ##############
|
||||
@@ -70,7 +75,7 @@ impl Default for Scope {
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// // 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 !
|
||||
@@ -105,34 +110,34 @@ impl Default for Scope {
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct PostmasterTools<> {
|
||||
pub client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>,
|
||||
pub auth: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>,
|
||||
pub struct PostmasterTools<S> {
|
||||
pub client: hyper::Client<S, hyper::body::Body>,
|
||||
pub auth: oauth2::authenticator::Authenticator<S>,
|
||||
_user_agent: String,
|
||||
_base_url: String,
|
||||
_root_url: String,
|
||||
}
|
||||
|
||||
impl<'a, > client::Hub for PostmasterTools<> {}
|
||||
impl<'a, S> client::Hub for PostmasterTools<S> {}
|
||||
|
||||
impl<'a, > PostmasterTools<> {
|
||||
impl<'a, S> PostmasterTools<S> {
|
||||
|
||||
pub fn new(client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>, authenticator: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>) -> PostmasterTools<> {
|
||||
pub fn new(client: hyper::Client<S, hyper::body::Body>, authenticator: oauth2::authenticator::Authenticator<S>) -> PostmasterTools<S> {
|
||||
PostmasterTools {
|
||||
client,
|
||||
auth: authenticator,
|
||||
_user_agent: "google-api-rust-client/3.1.0".to_string(),
|
||||
_user_agent: "google-api-rust-client/4.0.1".to_string(),
|
||||
_base_url: "https://gmailpostmastertools.googleapis.com/".to_string(),
|
||||
_root_url: "https://gmailpostmastertools.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn domains(&'a self) -> DomainMethods<'a> {
|
||||
pub fn domains(&'a self) -> DomainMethods<'a, S> {
|
||||
DomainMethods { hub: &self }
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/3.1.0`.
|
||||
/// It defaults to `google-api-rust-client/4.0.1`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -362,22 +367,22 @@ impl client::ResponseResult for TrafficStats {}
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `get(...)`, `list(...)`, `traffic_stats_get(...)` and `traffic_stats_list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.domains();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct DomainMethods<'a>
|
||||
where {
|
||||
pub struct DomainMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
hub: &'a PostmasterTools<>,
|
||||
hub: &'a PostmasterTools<S>,
|
||||
}
|
||||
|
||||
impl<'a> client::MethodsBuilder for DomainMethods<'a> {}
|
||||
impl<'a, S> client::MethodsBuilder for DomainMethods<'a, S> {}
|
||||
|
||||
impl<'a> DomainMethods<'a> {
|
||||
impl<'a, S> DomainMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
@@ -386,7 +391,7 @@ impl<'a> DomainMethods<'a> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The resource name of the traffic statistics to get. E.g., domains/mymail.mydomain.com/trafficStats/20160807.
|
||||
pub fn traffic_stats_get(&self, name: &str) -> DomainTrafficStatGetCall<'a> {
|
||||
pub fn traffic_stats_get(&self, name: &str) -> DomainTrafficStatGetCall<'a, S> {
|
||||
DomainTrafficStatGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
@@ -403,7 +408,7 @@ impl<'a> DomainMethods<'a> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - The resource name of the domain whose traffic statistics we'd like to list. It should have the form `domains/{domain_name}`, where domain_name is the fully qualified domain name.
|
||||
pub fn traffic_stats_list(&self, parent: &str) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn traffic_stats_list(&self, parent: &str) -> DomainTrafficStatListCall<'a, S> {
|
||||
DomainTrafficStatListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
@@ -428,7 +433,7 @@ impl<'a> DomainMethods<'a> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The resource name of the domain. It should have the form `domains/{domain_name}`, where domain_name is the fully qualified domain name.
|
||||
pub fn get(&self, name: &str) -> DomainGetCall<'a> {
|
||||
pub fn get(&self, name: &str) -> DomainGetCall<'a, S> {
|
||||
DomainGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
@@ -441,7 +446,7 @@ impl<'a> DomainMethods<'a> {
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists the domains that have been registered by the client. The order of domains in the response is unspecified and non-deterministic. Newly created domains will not necessarily be added to the end of this list.
|
||||
pub fn list(&self) -> DomainListCall<'a> {
|
||||
pub fn list(&self) -> DomainListCall<'a, S> {
|
||||
DomainListCall {
|
||||
hub: self.hub,
|
||||
_page_token: Default::default(),
|
||||
@@ -483,7 +488,7 @@ impl<'a> DomainMethods<'a> {
|
||||
/// # secret,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// // 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 !
|
||||
@@ -491,19 +496,25 @@ impl<'a> DomainMethods<'a> {
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct DomainTrafficStatGetCall<'a>
|
||||
where {
|
||||
pub struct DomainTrafficStatGetCall<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
hub: &'a PostmasterTools<>,
|
||||
hub: &'a PostmasterTools<S>,
|
||||
_name: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a> client::CallBuilder for DomainTrafficStatGetCall<'a> {}
|
||||
impl<'a, S> client::CallBuilder for DomainTrafficStatGetCall<'a, S> {}
|
||||
|
||||
impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
impl<'a, S> DomainTrafficStatGetCall<'a, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
{
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -650,7 +661,7 @@ impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn name(mut self, new_value: &str) -> DomainTrafficStatGetCall<'a> {
|
||||
pub fn name(mut self, new_value: &str) -> DomainTrafficStatGetCall<'a, S> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -660,7 +671,7 @@ impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> DomainTrafficStatGetCall<'a> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> DomainTrafficStatGetCall<'a, S> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -685,7 +696,7 @@ impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
|
||||
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
|
||||
pub fn param<T>(mut self, name: T, value: T) -> DomainTrafficStatGetCall<'a>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> DomainTrafficStatGetCall<'a, S>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -705,9 +716,9 @@ impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
/// Usually there is more than one suitable scope to authorize an operation, some of which may
|
||||
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
|
||||
/// sufficient, a read-write scope will do as well.
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> DomainTrafficStatGetCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
pub fn add_scope<T, St>(mut self, scope: T) -> DomainTrafficStatGetCall<'a, S>
|
||||
where T: Into<Option<St>>,
|
||||
St: AsRef<str> {
|
||||
match scope.into() {
|
||||
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
|
||||
None => None,
|
||||
@@ -739,7 +750,7 @@ impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
/// # secret,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// // 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 !
|
||||
@@ -755,10 +766,10 @@ impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct DomainTrafficStatListCall<'a>
|
||||
where {
|
||||
pub struct DomainTrafficStatListCall<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
hub: &'a PostmasterTools<>,
|
||||
hub: &'a PostmasterTools<S>,
|
||||
_parent: String,
|
||||
_start_date_year: Option<i32>,
|
||||
_start_date_month: Option<i32>,
|
||||
@@ -773,9 +784,15 @@ pub struct DomainTrafficStatListCall<'a>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a> client::CallBuilder for DomainTrafficStatListCall<'a> {}
|
||||
impl<'a, S> client::CallBuilder for DomainTrafficStatListCall<'a, S> {}
|
||||
|
||||
impl<'a> DomainTrafficStatListCall<'a> {
|
||||
impl<'a, S> DomainTrafficStatListCall<'a, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
{
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -946,63 +963,63 @@ impl<'a> DomainTrafficStatListCall<'a> {
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn parent(mut self, new_value: &str) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn parent(mut self, new_value: &str) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._parent = new_value.to_string();
|
||||
self
|
||||
}
|
||||
/// Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
|
||||
///
|
||||
/// Sets the *start date.year* query property to the given value.
|
||||
pub fn start_date_year(mut self, new_value: i32) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn start_date_year(mut self, new_value: i32) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._start_date_year = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
|
||||
///
|
||||
/// Sets the *start date.month* query property to the given value.
|
||||
pub fn start_date_month(mut self, new_value: i32) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn start_date_month(mut self, new_value: i32) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._start_date_month = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
|
||||
///
|
||||
/// Sets the *start date.day* query property to the given value.
|
||||
pub fn start_date_day(mut self, new_value: i32) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn start_date_day(mut self, new_value: i32) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._start_date_day = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// The next_page_token value returned from a previous List request, if any. This is the value of ListTrafficStatsResponse.next_page_token returned from the previous call to `ListTrafficStats` method.
|
||||
///
|
||||
/// Sets the *page token* query property to the given value.
|
||||
pub fn page_token(mut self, new_value: &str) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn page_token(mut self, new_value: &str) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._page_token = Some(new_value.to_string());
|
||||
self
|
||||
}
|
||||
/// Requested page size. Server may return fewer TrafficStats than requested. If unspecified, server will pick an appropriate default.
|
||||
///
|
||||
/// Sets the *page size* query property to the given value.
|
||||
pub fn page_size(mut self, new_value: i32) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn page_size(mut self, new_value: i32) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._page_size = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
|
||||
///
|
||||
/// Sets the *end date.year* query property to the given value.
|
||||
pub fn end_date_year(mut self, new_value: i32) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn end_date_year(mut self, new_value: i32) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._end_date_year = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
|
||||
///
|
||||
/// Sets the *end date.month* query property to the given value.
|
||||
pub fn end_date_month(mut self, new_value: i32) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn end_date_month(mut self, new_value: i32) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._end_date_month = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn't significant.
|
||||
///
|
||||
/// Sets the *end date.day* query property to the given value.
|
||||
pub fn end_date_day(mut self, new_value: i32) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn end_date_day(mut self, new_value: i32) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._end_date_day = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1012,7 +1029,7 @@ impl<'a> DomainTrafficStatListCall<'a> {
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> DomainTrafficStatListCall<'a> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> DomainTrafficStatListCall<'a, S> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1037,7 +1054,7 @@ impl<'a> DomainTrafficStatListCall<'a> {
|
||||
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
|
||||
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
|
||||
pub fn param<T>(mut self, name: T, value: T) -> DomainTrafficStatListCall<'a>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> DomainTrafficStatListCall<'a, S>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -1057,9 +1074,9 @@ impl<'a> DomainTrafficStatListCall<'a> {
|
||||
/// Usually there is more than one suitable scope to authorize an operation, some of which may
|
||||
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
|
||||
/// sufficient, a read-write scope will do as well.
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> DomainTrafficStatListCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
pub fn add_scope<T, St>(mut self, scope: T) -> DomainTrafficStatListCall<'a, S>
|
||||
where T: Into<Option<St>>,
|
||||
St: AsRef<str> {
|
||||
match scope.into() {
|
||||
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
|
||||
None => None,
|
||||
@@ -1091,7 +1108,7 @@ impl<'a> DomainTrafficStatListCall<'a> {
|
||||
/// # secret,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// // 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 !
|
||||
@@ -1099,19 +1116,25 @@ impl<'a> DomainTrafficStatListCall<'a> {
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct DomainGetCall<'a>
|
||||
where {
|
||||
pub struct DomainGetCall<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
hub: &'a PostmasterTools<>,
|
||||
hub: &'a PostmasterTools<S>,
|
||||
_name: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a> client::CallBuilder for DomainGetCall<'a> {}
|
||||
impl<'a, S> client::CallBuilder for DomainGetCall<'a, S> {}
|
||||
|
||||
impl<'a> DomainGetCall<'a> {
|
||||
impl<'a, S> DomainGetCall<'a, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
{
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -1258,7 +1281,7 @@ impl<'a> DomainGetCall<'a> {
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn name(mut self, new_value: &str) -> DomainGetCall<'a> {
|
||||
pub fn name(mut self, new_value: &str) -> DomainGetCall<'a, S> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -1268,7 +1291,7 @@ impl<'a> DomainGetCall<'a> {
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> DomainGetCall<'a> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> DomainGetCall<'a, S> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1293,7 +1316,7 @@ impl<'a> DomainGetCall<'a> {
|
||||
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
|
||||
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
|
||||
pub fn param<T>(mut self, name: T, value: T) -> DomainGetCall<'a>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> DomainGetCall<'a, S>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -1313,9 +1336,9 @@ impl<'a> DomainGetCall<'a> {
|
||||
/// Usually there is more than one suitable scope to authorize an operation, some of which may
|
||||
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
|
||||
/// sufficient, a read-write scope will do as well.
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> DomainGetCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
pub fn add_scope<T, St>(mut self, scope: T) -> DomainGetCall<'a, S>
|
||||
where T: Into<Option<St>>,
|
||||
St: AsRef<str> {
|
||||
match scope.into() {
|
||||
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
|
||||
None => None,
|
||||
@@ -1347,7 +1370,7 @@ impl<'a> DomainGetCall<'a> {
|
||||
/// # secret,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
/// // 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 !
|
||||
@@ -1357,10 +1380,10 @@ impl<'a> DomainGetCall<'a> {
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct DomainListCall<'a>
|
||||
where {
|
||||
pub struct DomainListCall<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
hub: &'a PostmasterTools<>,
|
||||
hub: &'a PostmasterTools<S>,
|
||||
_page_token: Option<String>,
|
||||
_page_size: Option<i32>,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
@@ -1368,9 +1391,15 @@ pub struct DomainListCall<'a>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a> client::CallBuilder for DomainListCall<'a> {}
|
||||
impl<'a, S> client::CallBuilder for DomainListCall<'a, S> {}
|
||||
|
||||
impl<'a> DomainListCall<'a> {
|
||||
impl<'a, S> DomainListCall<'a, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
{
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -1494,14 +1523,14 @@ impl<'a> DomainListCall<'a> {
|
||||
/// The next_page_token value returned from a previous List request, if any. This is the value of ListDomainsResponse.next_page_token returned from the previous call to `ListDomains` method.
|
||||
///
|
||||
/// Sets the *page token* query property to the given value.
|
||||
pub fn page_token(mut self, new_value: &str) -> DomainListCall<'a> {
|
||||
pub fn page_token(mut self, new_value: &str) -> DomainListCall<'a, S> {
|
||||
self._page_token = Some(new_value.to_string());
|
||||
self
|
||||
}
|
||||
/// Requested page size. Server may return fewer domains than requested. If unspecified, server will pick an appropriate default.
|
||||
///
|
||||
/// Sets the *page size* query property to the given value.
|
||||
pub fn page_size(mut self, new_value: i32) -> DomainListCall<'a> {
|
||||
pub fn page_size(mut self, new_value: i32) -> DomainListCall<'a, S> {
|
||||
self._page_size = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1511,7 +1540,7 @@ impl<'a> DomainListCall<'a> {
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> DomainListCall<'a> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> DomainListCall<'a, S> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1536,7 +1565,7 @@ impl<'a> DomainListCall<'a> {
|
||||
/// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
|
||||
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
|
||||
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
|
||||
pub fn param<T>(mut self, name: T, value: T) -> DomainListCall<'a>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> DomainListCall<'a, S>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -1556,9 +1585,9 @@ impl<'a> DomainListCall<'a> {
|
||||
/// Usually there is more than one suitable scope to authorize an operation, some of which may
|
||||
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
|
||||
/// sufficient, a read-write scope will do as well.
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> DomainListCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
pub fn add_scope<T, St>(mut self, scope: T) -> DomainListCall<'a, S>
|
||||
where T: Into<Option<St>>,
|
||||
St: AsRef<str> {
|
||||
match scope.into() {
|
||||
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
|
||||
None => None,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
// COPY OF 'src/rust/api/client.rs'
|
||||
// DO NOT EDIT
|
||||
use std::error;
|
||||
use std::error::Error as StdError;
|
||||
use std::fmt::{self, Display};
|
||||
use std::io::{self, Cursor, Read, Seek, SeekFrom, Write};
|
||||
use std::str::FromStr;
|
||||
@@ -9,7 +10,10 @@ use std::time::Duration;
|
||||
|
||||
use itertools::Itertools;
|
||||
|
||||
use hyper::http::Uri;
|
||||
|
||||
use hyper::body::Buf;
|
||||
use hyper::client::connect;
|
||||
use hyper::header::{HeaderMap, AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, USER_AGENT};
|
||||
use hyper::Method;
|
||||
use hyper::StatusCode;
|
||||
@@ -18,6 +22,9 @@ use mime::{Attr, Mime, SubLevel, TopLevel, Value};
|
||||
|
||||
use serde_json as json;
|
||||
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tower_service;
|
||||
|
||||
const LINE_ENDING: &str = "\r\n";
|
||||
|
||||
pub enum Retry {
|
||||
@@ -566,9 +573,15 @@ impl RangeResponseHeader {
|
||||
}
|
||||
|
||||
/// A utility type to perform a resumable upload from start to end.
|
||||
pub struct ResumableUploadHelper<'a, A: 'a> {
|
||||
pub struct ResumableUploadHelper<'a, A: 'a, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
{
|
||||
pub client: &'a hyper::client::Client<
|
||||
hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>,
|
||||
S,
|
||||
hyper::body::Body,
|
||||
>,
|
||||
pub delegate: &'a mut dyn Delegate,
|
||||
@@ -582,7 +595,13 @@ pub struct ResumableUploadHelper<'a, A: 'a> {
|
||||
pub content_length: u64,
|
||||
}
|
||||
|
||||
impl<'a, A> ResumableUploadHelper<'a, A> {
|
||||
impl<'a, A, S> ResumableUploadHelper<'a, A, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
{
|
||||
async fn query_transfer_status(
|
||||
&mut self,
|
||||
) -> std::result::Result<u64, hyper::Result<hyper::Response<hyper::body::Body>>> {
|
||||
@@ -697,14 +716,11 @@ impl<'a, A> ResumableUploadHelper<'a, A> {
|
||||
}
|
||||
|
||||
let (res_parts, res_body) = res.into_parts();
|
||||
let res_body_string: String = String::from_utf8(
|
||||
hyper::body::to_bytes(res_body)
|
||||
.await
|
||||
.unwrap()
|
||||
.into_iter()
|
||||
.collect(),
|
||||
)
|
||||
.unwrap();
|
||||
let res_body = match hyper::body::to_bytes(res_body).await {
|
||||
Ok(res_body) => res_body.into_iter().collect(),
|
||||
Err(err) => return Some(Err(err)),
|
||||
};
|
||||
let res_body_string: String = String::from_utf8(res_body).unwrap();
|
||||
let reconstructed_result =
|
||||
hyper::Response::from_parts(res_parts, res_body_string.clone().into());
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// DO NOT EDIT !
|
||||
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
|
||||
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *Postmaster Tools* crate version *3.1.0+20220305*, where *20220305* is the exact revision of the *gmailpostmastertools:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v3.1.0*.
|
||||
//! This documentation was generated from *Postmaster Tools* crate version *4.0.1+20220305*, where *20220305* is the exact revision of the *gmailpostmastertools:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v4.0.1*.
|
||||
//!
|
||||
//! Everything else about the *Postmaster Tools* *v1_beta1* API can be found at the
|
||||
//! [official documentation site](https://developers.google.com/gmail/postmaster).
|
||||
@@ -94,7 +94,7 @@
|
||||
//! secret,
|
||||
//! oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
//! ).build().await.unwrap();
|
||||
//! let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
//! let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().enable_http2().build()), auth);
|
||||
//! // 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 !
|
||||
@@ -189,7 +189,7 @@
|
||||
#![allow(unused_imports, unused_mut, dead_code)]
|
||||
|
||||
// DO NOT EDIT !
|
||||
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
|
||||
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
#[macro_use]
|
||||
|
||||
Reference in New Issue
Block a user