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:
@@ -56,13 +56,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_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// use taskqueue1_beta2::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use taskqueue1_beta2::Taskqueue;
|
||||
/// use taskqueue1_beta2::{Taskqueue, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
@@ -72,9 +70,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 = Taskqueue::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
|
||||
@@ -106,8 +104,8 @@ impl Default for Scope {
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct Taskqueue<> {
|
||||
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,
|
||||
@@ -121,7 +119,7 @@ impl<'a, > Taskqueue<> {
|
||||
Taskqueue {
|
||||
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://www.googleapis.com/taskqueue/v1beta2/projects/".to_string(),
|
||||
_root_url: "https://www.googleapis.com/".to_string(),
|
||||
}
|
||||
@@ -135,7 +133,7 @@ impl<'a, > Taskqueue<> {
|
||||
}
|
||||
|
||||
/// 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 {
|
||||
@@ -335,18 +333,16 @@ impl client::Part for TaskQueueStats {}
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use taskqueue1_beta2::Taskqueue;
|
||||
/// use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::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*
|
||||
@@ -398,18 +394,16 @@ impl<'a> TaskqueueMethods<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use taskqueue1_beta2::Taskqueue;
|
||||
/// use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::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*
|
||||
@@ -606,17 +600,15 @@ impl<'a> TaskMethods<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use taskqueue1_beta2::Taskqueue;
|
||||
/// # use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::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
|
||||
@@ -744,22 +736,22 @@ impl<'a> TaskqueueGetCall<'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 = {
|
||||
@@ -880,17 +872,15 @@ impl<'a> TaskqueueGetCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use taskqueue1_beta2::Taskqueue;
|
||||
/// # use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::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
|
||||
@@ -1014,22 +1004,22 @@ impl<'a> TaskDeleteCall<'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 = res;
|
||||
@@ -1143,17 +1133,15 @@ impl<'a> TaskDeleteCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use taskqueue1_beta2::Taskqueue;
|
||||
/// # use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::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
|
||||
@@ -1278,22 +1266,22 @@ impl<'a> TaskGetCall<'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 = {
|
||||
@@ -1417,18 +1405,16 @@ impl<'a> TaskGetCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// use taskqueue1_beta2::api::Task;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use taskqueue1_beta2::Taskqueue;
|
||||
/// # use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -1571,22 +1557,22 @@ impl<'a> TaskInsertCall<'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 = {
|
||||
@@ -1709,17 +1695,15 @@ impl<'a> TaskInsertCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use taskqueue1_beta2::Taskqueue;
|
||||
/// # use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::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
|
||||
@@ -1856,22 +1840,22 @@ impl<'a> TaskLeaseCall<'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 = {
|
||||
@@ -2019,17 +2003,15 @@ impl<'a> TaskLeaseCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use taskqueue1_beta2::Taskqueue;
|
||||
/// # use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::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
|
||||
@@ -2152,22 +2134,22 @@ impl<'a> TaskListCall<'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 = {
|
||||
@@ -2281,18 +2263,16 @@ impl<'a> TaskListCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// use taskqueue1_beta2::api::Task;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use taskqueue1_beta2::Taskqueue;
|
||||
/// # use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -2439,22 +2419,22 @@ impl<'a> TaskPatchCall<'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 = {
|
||||
@@ -2595,18 +2575,16 @@ impl<'a> TaskPatchCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_taskqueue1_beta2 as taskqueue1_beta2;
|
||||
/// use taskqueue1_beta2::api::Task;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use taskqueue1_beta2::Taskqueue;
|
||||
/// # use taskqueue1_beta2::{Taskqueue, 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 = Taskqueue::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -2753,22 +2731,22 @@ impl<'a> TaskUpdateCall<'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