mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
regen all APIs and validate them
This commit is contained in:
@@ -52,13 +52,11 @@ impl Default for Scope {
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_gmailpostmastertools1_beta1 as gmailpostmastertools1_beta1;
|
||||
/// use gmailpostmastertools1_beta1::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use gmailpostmastertools1_beta1::PostmasterTools;
|
||||
/// use gmailpostmastertools1_beta1::{PostmasterTools, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
@@ -68,9 +66,9 @@ impl Default for Scope {
|
||||
/// // 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 = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -108,8 +106,8 @@ impl Default for Scope {
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct PostmasterTools<> {
|
||||
client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>,
|
||||
auth: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>,
|
||||
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>>,
|
||||
_user_agent: String,
|
||||
_base_url: String,
|
||||
_root_url: String,
|
||||
@@ -123,7 +121,7 @@ impl<'a, > PostmasterTools<> {
|
||||
PostmasterTools {
|
||||
client,
|
||||
auth: authenticator,
|
||||
_user_agent: "google-api-rust-client/2.0.8".to_string(),
|
||||
_user_agent: "google-api-rust-client/3.0.0".to_string(),
|
||||
_base_url: "https://gmailpostmastertools.googleapis.com/".to_string(),
|
||||
_root_url: "https://gmailpostmastertools.googleapis.com/".to_string(),
|
||||
}
|
||||
@@ -134,7 +132,7 @@ impl<'a, > PostmasterTools<> {
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/2.0.8`.
|
||||
/// It defaults to `google-api-rust-client/3.0.0`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -353,18 +351,16 @@ impl client::ResponseResult for TrafficStats {}
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_gmailpostmastertools1_beta1 as gmailpostmastertools1_beta1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use gmailpostmastertools1_beta1::PostmasterTools;
|
||||
/// use gmailpostmastertools1_beta1::{PostmasterTools, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
@@ -477,17 +473,15 @@ impl<'a> DomainMethods<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_gmailpostmastertools1_beta1 as gmailpostmastertools1_beta1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use gmailpostmastertools1_beta1::PostmasterTools;
|
||||
/// # use gmailpostmastertools1_beta1::{PostmasterTools, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -612,22 +606,22 @@ impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
Ok(mut res) => {
|
||||
if !res.status().is_success() {
|
||||
let res_body_string = client::get_body_as_string(res.body_mut()).await;
|
||||
let (parts, _) = res.into_parts();
|
||||
let body = hyper::Body::from(res_body_string.clone());
|
||||
let restored_response = hyper::Response::from_parts(parts, body);
|
||||
|
||||
let json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -735,17 +729,15 @@ impl<'a> DomainTrafficStatGetCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_gmailpostmastertools1_beta1 as gmailpostmastertools1_beta1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use gmailpostmastertools1_beta1::PostmasterTools;
|
||||
/// # use gmailpostmastertools1_beta1::{PostmasterTools, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -910,22 +902,22 @@ impl<'a> DomainTrafficStatListCall<'a> {
|
||||
Ok(mut res) => {
|
||||
if !res.status().is_success() {
|
||||
let res_body_string = client::get_body_as_string(res.body_mut()).await;
|
||||
let (parts, _) = res.into_parts();
|
||||
let body = hyper::Body::from(res_body_string.clone());
|
||||
let restored_response = hyper::Response::from_parts(parts, body);
|
||||
|
||||
let json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -1089,17 +1081,15 @@ impl<'a> DomainTrafficStatListCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_gmailpostmastertools1_beta1 as gmailpostmastertools1_beta1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use gmailpostmastertools1_beta1::PostmasterTools;
|
||||
/// # use gmailpostmastertools1_beta1::{PostmasterTools, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -1224,22 +1214,22 @@ impl<'a> DomainGetCall<'a> {
|
||||
Ok(mut res) => {
|
||||
if !res.status().is_success() {
|
||||
let res_body_string = client::get_body_as_string(res.body_mut()).await;
|
||||
let (parts, _) = res.into_parts();
|
||||
let body = hyper::Body::from(res_body_string.clone());
|
||||
let restored_response = hyper::Response::from_parts(parts, body);
|
||||
|
||||
let json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -1347,17 +1337,15 @@ impl<'a> DomainGetCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_gmailpostmastertools1_beta1 as gmailpostmastertools1_beta1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use gmailpostmastertools1_beta1::PostmasterTools;
|
||||
/// # use gmailpostmastertools1_beta1::{PostmasterTools, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = PostmasterTools::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
@@ -1465,22 +1453,22 @@ impl<'a> DomainListCall<'a> {
|
||||
Ok(mut res) => {
|
||||
if !res.status().is_success() {
|
||||
let res_body_string = client::get_body_as_string(res.body_mut()).await;
|
||||
let (parts, _) = res.into_parts();
|
||||
let body = hyper::Body::from(res_body_string.clone());
|
||||
let restored_response = hyper::Response::from_parts(parts, body);
|
||||
|
||||
let json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
|
||||
Reference in New Issue
Block a user