fix(version-up): code updated to v0.1.6, latest CLI

* also includes publishing tag files
This commit is contained in:
Sebastian Thiel
2015-04-26 13:42:31 +02:00
parent 4e275eaadd
commit c2dd9c7a02
770 changed files with 63340 additions and 31427 deletions

View File

@@ -60,7 +60,6 @@ pub trait ToParts {
fn to_parts(&self) -> String;
}
/// A utility type which can decode a server response that indicates error
#[derive(Deserialize)]
pub struct JsonServerError {
@@ -68,6 +67,30 @@ pub struct JsonServerError {
pub error_description: Option<String>
}
/// A utility to represent detailed errors we might see in case there are BadRequests.
/// The latter happen if the sent parameters or request structures are unsound
#[derive(Deserialize, Serialize, Debug)]
pub struct ErrorResponse {
error: ServerError,
}
#[derive(Deserialize, Serialize, Debug)]
pub struct ServerError {
errors: Vec<ServerMessage>,
code: u16,
message: String,
}
#[derive(Deserialize, Serialize, Debug)]
pub struct ServerMessage {
domain: String,
reason: String,
message: String,
#[serde(rename="locationType")]
location_type: Option<String>,
location: Option<String>
}
#[derive(Copy, Clone)]
pub struct DummyNetworkStream;
@@ -175,7 +198,7 @@ pub trait Delegate {
///
/// If you choose to retry after a duration, the duration should be chosen using the
/// [exponential backoff algorithm](http://en.wikipedia.org/wiki/Exponential_backoff).
fn http_failure(&mut self, _: &hyper::client::Response, Option<JsonServerError>) -> Retry {
fn http_failure(&mut self, _: &hyper::client::Response, Option<JsonServerError>, _: Option<ServerError>) -> Retry {
Retry::Abort
}
@@ -230,6 +253,10 @@ pub enum Error {
/// even though the maximum upload size is what is stored in field `.1`.
UploadSizeLimitExceeded(u64, u64),
/// Represents information about a request that was not understood by the server.
/// Details are included.
BadRequest(ErrorResponse),
/// We needed an API key for authentication, but didn't obtain one.
/// Neither through the authenticator, nor through the Delegate.
MissingAPIKey,
@@ -245,7 +272,7 @@ pub enum Error {
/// Shows that we failed to decode the server response.
/// This can happen if the protocol changes in conjunction with strict json decoding.
JsonDecodeError(serde::json::Error),
JsonDecodeError(String, serde::json::Error),
/// Indicates an HTTP repsonse with a non-success status code
Failure(hyper::client::Response),
@@ -263,13 +290,16 @@ impl Display for Error {
writeln!(f, "The application's API key was not found in the configuration").ok();
writeln!(f, "It is used as there are no Scopes defined for this method.")
},
Error::BadRequest(ref err)
=> writeln!(f, "Bad Requst ({}): {}", err.error.code, err.error.message),
Error::MissingToken(ref err) =>
writeln!(f, "Token retrieval failed with error: {}", err),
Error::Cancelled =>
writeln!(f, "Operation cancelled by delegate"),
Error::FieldClash(field) =>
writeln!(f, "The custom parameter '{}' is already provided natively by the CallBuilder.", field),
Error::JsonDecodeError(ref err) => err.fmt(f),
Error::JsonDecodeError(ref json_str, ref err)
=> writeln!(f, "{}: {}", err, json_str),
Error::Failure(ref response) =>
writeln!(f, "Http status indicates failure: {:?}", response),
}
@@ -280,7 +310,7 @@ impl error::Error for Error {
fn description(&self) -> &str {
match *self {
Error::HttpError(ref err) => err.description(),
Error::JsonDecodeError(ref err) => err.description(),
Error::JsonDecodeError(_, ref err) => err.description(),
_ => "NO DESCRIPTION POSSIBLE - use `Display.fmt()` instead"
}
}
@@ -288,7 +318,7 @@ impl error::Error for Error {
fn cause(&self) -> Option<&error::Error> {
match *self {
Error::HttpError(ref err) => err.cause(),
Error::JsonDecodeError(ref err) => err.cause(),
Error::JsonDecodeError(_, ref err) => err.cause(),
_ => None
}
}
@@ -401,7 +431,7 @@ impl<'a> Read for MultiPartReader<'a> {
// before clearing the last part, we will add the boundary that
// will be written last
self.last_part_boundary = Some(Cursor::new(
format!("{}--{}", LINE_ENDING, BOUNDARY).into_bytes()))
format!("{}--{}--", LINE_ENDING, BOUNDARY).into_bytes()))
}
// We are depleted - this can trigger the next part to come in
self.current_part = None;
@@ -489,7 +519,7 @@ impl Header for ContentRange {
impl HeaderFormat for ContentRange {
fn fmt_header(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
try!(fmt.write_str("bytes="));
try!(fmt.write_str("bytes "));
match self.range {
Some(ref c) => try!(c.fmt(fmt)),
None => try!(fmt.write_str("*"))
@@ -510,7 +540,7 @@ impl Header for RangeResponseHeader {
fn parse_header(raw: &[Vec<u8>]) -> Option<RangeResponseHeader> {
if let [ref v] = raw {
if let Ok(s) = std::str::from_utf8(v) {
const PREFIX: &'static str = "bytes=";
const PREFIX: &'static str = "bytes ";
if s.starts_with(PREFIX) {
if let Ok(c) = <Chunk as FromStr>::from_str(&s[PREFIX.len()..]) {
return Some(RangeResponseHeader(c))
@@ -559,7 +589,7 @@ impl<'a, A> ResumableUploadHelper<'a, A>
let h: &RangeResponseHeader = match headers.get() {
Some(hh) if r.status == StatusCode::PermanentRedirect => hh,
None|Some(_) => {
if let Retry::After(d) = self.delegate.http_failure(&r, None) {
if let Retry::After(d) = self.delegate.http_failure(&r, None, None) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
@@ -626,7 +656,9 @@ impl<'a, A> ResumableUploadHelper<'a, A>
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let Retry::After(d) = self.delegate.http_failure(&res, serde::json::from_str(&json_err).ok()) {
if let Retry::After(d) = self.delegate.http_failure(&res,
serde::json::from_str(&json_err).ok(),
serde::json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}

View File

@@ -2,7 +2,7 @@
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
// DO NOT EDIT !
//! This documentation was generated from *Identity Toolkit* crate version *0.1.5+20150406*, where *20150406* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.5*.
//! This documentation was generated from *Identity Toolkit* crate version *0.1.6+20150406*, where *20150406* is the exact revision of the *identitytoolkit:v3* schema built by the [mako](http://www.makotemplates.org/) code generator *v0.1.6*.
//!
//! Everything else about the *Identity Toolkit* *v3* API can be found at the
//! [official documentation site](https://developers.google.com/identity-toolkit/v3/).
@@ -99,21 +99,22 @@
//! // 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.relyingparty().verify_assertion(&req)
//! let result = hub.relyingparty().verify_assertion(req)
//! .doit();
//!
//! 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::HttpError(_)
//! |Error::MissingAPIKey
//! |Error::MissingToken
//! |Error::MissingToken(_)
//! |Error::Cancelled
//! |Error::UploadSizeLimitExceeded(_, _)
//! |Error::Failure(_)
//! |Error::BadRequest(_)
//! |Error::FieldClash(_)
//! |Error::JsonDecodeError(_) => println!("{}", e),
//! |Error::JsonDecodeError(_, _) => println!("{}", e),
//! },
//! Ok(res) => println!("Success: {:?}", res),
//! }
@@ -201,7 +202,7 @@ use std::io;
use std::fs;
use std::thread::sleep_ms;
pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, Resource, JsonServerError};
pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part, ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder, Resource, ErrorResponse};
// ##############
@@ -252,21 +253,22 @@ pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder,
/// // 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.relyingparty().verify_assertion(&req)
/// let result = hub.relyingparty().verify_assertion(req)
/// .doit();
///
/// 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::HttpError(_)
/// |Error::MissingAPIKey
/// |Error::MissingToken
/// |Error::MissingToken(_)
/// |Error::Cancelled
/// |Error::UploadSizeLimitExceeded(_, _)
/// |Error::Failure(_)
/// |Error::BadRequest(_)
/// |Error::FieldClash(_)
/// |Error::JsonDecodeError(_) => println!("{}", e),
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
/// },
/// Ok(res) => println!("Success: {:?}", res),
/// }
@@ -287,7 +289,7 @@ impl<'a, C, A> IdentityToolkit<C, A>
IdentityToolkit {
client: RefCell::new(client),
auth: RefCell::new(authenticator),
_user_agent: "google-api-rust-client/0.1.5".to_string(),
_user_agent: "google-api-rust-client/0.1.6".to_string(),
}
}
@@ -296,7 +298,7 @@ impl<'a, C, A> IdentityToolkit<C, A>
}
/// Set the user-agent header field to use in all requests to the server.
/// It defaults to `google-api-rust-client/0.1.5`.
/// It defaults to `google-api-rust-client/0.1.6`.
///
/// Returns the previously set user-agent.
pub fn user_agent(&mut self, agent_name: String) -> String {
@@ -1124,10 +1126,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn get_oob_confirmation_code(&self, request: &Relyingparty) -> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> {
pub fn get_oob_confirmation_code(&self, request: Relyingparty) -> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> {
RelyingpartyGetOobConfirmationCodeCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1151,10 +1153,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn create_auth_uri(&self, request: &IdentitytoolkitRelyingpartyCreateAuthUriRequest) -> RelyingpartyCreateAuthUriCall<'a, C, A> {
pub fn create_auth_uri(&self, request: IdentitytoolkitRelyingpartyCreateAuthUriRequest) -> RelyingpartyCreateAuthUriCall<'a, C, A> {
RelyingpartyCreateAuthUriCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1167,10 +1169,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn verify_assertion(&self, request: &IdentitytoolkitRelyingpartyVerifyAssertionRequest) -> RelyingpartyVerifyAssertionCall<'a, C, A> {
pub fn verify_assertion(&self, request: IdentitytoolkitRelyingpartyVerifyAssertionRequest) -> RelyingpartyVerifyAssertionCall<'a, C, A> {
RelyingpartyVerifyAssertionCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1183,10 +1185,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn upload_account(&self, request: &IdentitytoolkitRelyingpartyUploadAccountRequest) -> RelyingpartyUploadAccountCall<'a, C, A> {
pub fn upload_account(&self, request: IdentitytoolkitRelyingpartyUploadAccountRequest) -> RelyingpartyUploadAccountCall<'a, C, A> {
RelyingpartyUploadAccountCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1199,10 +1201,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn get_account_info(&self, request: &IdentitytoolkitRelyingpartyGetAccountInfoRequest) -> RelyingpartyGetAccountInfoCall<'a, C, A> {
pub fn get_account_info(&self, request: IdentitytoolkitRelyingpartyGetAccountInfoRequest) -> RelyingpartyGetAccountInfoCall<'a, C, A> {
RelyingpartyGetAccountInfoCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1215,10 +1217,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn reset_password(&self, request: &IdentitytoolkitRelyingpartyResetPasswordRequest) -> RelyingpartyResetPasswordCall<'a, C, A> {
pub fn reset_password(&self, request: IdentitytoolkitRelyingpartyResetPasswordRequest) -> RelyingpartyResetPasswordCall<'a, C, A> {
RelyingpartyResetPasswordCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1231,10 +1233,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn download_account(&self, request: &IdentitytoolkitRelyingpartyDownloadAccountRequest) -> RelyingpartyDownloadAccountCall<'a, C, A> {
pub fn download_account(&self, request: IdentitytoolkitRelyingpartyDownloadAccountRequest) -> RelyingpartyDownloadAccountCall<'a, C, A> {
RelyingpartyDownloadAccountCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1247,10 +1249,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn set_account_info(&self, request: &IdentitytoolkitRelyingpartySetAccountInfoRequest) -> RelyingpartySetAccountInfoCall<'a, C, A> {
pub fn set_account_info(&self, request: IdentitytoolkitRelyingpartySetAccountInfoRequest) -> RelyingpartySetAccountInfoCall<'a, C, A> {
RelyingpartySetAccountInfoCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1263,10 +1265,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn delete_account(&self, request: &IdentitytoolkitRelyingpartyDeleteAccountRequest) -> RelyingpartyDeleteAccountCall<'a, C, A> {
pub fn delete_account(&self, request: IdentitytoolkitRelyingpartyDeleteAccountRequest) -> RelyingpartyDeleteAccountCall<'a, C, A> {
RelyingpartyDeleteAccountCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1290,10 +1292,10 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// # Arguments
///
/// * `request` - No description provided.
pub fn verify_password(&self, request: &IdentitytoolkitRelyingpartyVerifyPasswordRequest) -> RelyingpartyVerifyPasswordCall<'a, C, A> {
pub fn verify_password(&self, request: IdentitytoolkitRelyingpartyVerifyPasswordRequest) -> RelyingpartyVerifyPasswordCall<'a, C, A> {
RelyingpartyVerifyPasswordCall {
hub: self.hub,
_request: request.clone(),
_request: request,
_delegate: Default::default(),
_additional_params: Default::default(),
}
@@ -1340,7 +1342,7 @@ impl<'a, C, A> RelyingpartyMethods<'a, C, A> {
/// // 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.relyingparty().get_oob_confirmation_code(&req)
/// let result = hub.relyingparty().get_oob_confirmation_code(req)
/// .doit();
/// # }
/// ```
@@ -1435,12 +1437,17 @@ impl<'a, C, A> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> where C: BorrowM
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -1449,7 +1456,7 @@ impl<'a, C, A> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> where C: BorrowM
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -1467,8 +1474,8 @@ impl<'a, C, A> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> where C: BorrowM
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &Relyingparty) -> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: Relyingparty) -> RelyingpartyGetOobConfirmationCodeCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -1619,12 +1626,17 @@ impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut<hyper::
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -1633,7 +1645,7 @@ impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut<hyper::
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -1714,7 +1726,7 @@ impl<'a, C, A> RelyingpartyGetPublicKeyCall<'a, C, A> where C: BorrowMut<hyper::
/// // 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.relyingparty().create_auth_uri(&req)
/// let result = hub.relyingparty().create_auth_uri(req)
/// .doit();
/// # }
/// ```
@@ -1809,12 +1821,17 @@ impl<'a, C, A> RelyingpartyCreateAuthUriCall<'a, C, A> where C: BorrowMut<hyper:
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -1823,7 +1840,7 @@ impl<'a, C, A> RelyingpartyCreateAuthUriCall<'a, C, A> where C: BorrowMut<hyper:
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -1841,8 +1858,8 @@ impl<'a, C, A> RelyingpartyCreateAuthUriCall<'a, C, A> where C: BorrowMut<hyper:
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartyCreateAuthUriRequest) -> RelyingpartyCreateAuthUriCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartyCreateAuthUriRequest) -> RelyingpartyCreateAuthUriCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -1913,7 +1930,7 @@ impl<'a, C, A> RelyingpartyCreateAuthUriCall<'a, C, A> where C: BorrowMut<hyper:
/// // 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.relyingparty().verify_assertion(&req)
/// let result = hub.relyingparty().verify_assertion(req)
/// .doit();
/// # }
/// ```
@@ -2008,12 +2025,17 @@ impl<'a, C, A> RelyingpartyVerifyAssertionCall<'a, C, A> where C: BorrowMut<hype
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -2022,7 +2044,7 @@ impl<'a, C, A> RelyingpartyVerifyAssertionCall<'a, C, A> where C: BorrowMut<hype
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -2040,8 +2062,8 @@ impl<'a, C, A> RelyingpartyVerifyAssertionCall<'a, C, A> where C: BorrowMut<hype
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartyVerifyAssertionRequest) -> RelyingpartyVerifyAssertionCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartyVerifyAssertionRequest) -> RelyingpartyVerifyAssertionCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -2112,7 +2134,7 @@ impl<'a, C, A> RelyingpartyVerifyAssertionCall<'a, C, A> where C: BorrowMut<hype
/// // 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.relyingparty().upload_account(&req)
/// let result = hub.relyingparty().upload_account(req)
/// .doit();
/// # }
/// ```
@@ -2207,12 +2229,17 @@ impl<'a, C, A> RelyingpartyUploadAccountCall<'a, C, A> where C: BorrowMut<hyper:
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -2221,7 +2248,7 @@ impl<'a, C, A> RelyingpartyUploadAccountCall<'a, C, A> where C: BorrowMut<hyper:
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -2239,8 +2266,8 @@ impl<'a, C, A> RelyingpartyUploadAccountCall<'a, C, A> where C: BorrowMut<hyper:
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartyUploadAccountRequest) -> RelyingpartyUploadAccountCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartyUploadAccountRequest) -> RelyingpartyUploadAccountCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -2311,7 +2338,7 @@ impl<'a, C, A> RelyingpartyUploadAccountCall<'a, C, A> where C: BorrowMut<hyper:
/// // 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.relyingparty().get_account_info(&req)
/// let result = hub.relyingparty().get_account_info(req)
/// .doit();
/// # }
/// ```
@@ -2406,12 +2433,17 @@ impl<'a, C, A> RelyingpartyGetAccountInfoCall<'a, C, A> where C: BorrowMut<hyper
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -2420,7 +2452,7 @@ impl<'a, C, A> RelyingpartyGetAccountInfoCall<'a, C, A> where C: BorrowMut<hyper
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -2438,8 +2470,8 @@ impl<'a, C, A> RelyingpartyGetAccountInfoCall<'a, C, A> where C: BorrowMut<hyper
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartyGetAccountInfoRequest) -> RelyingpartyGetAccountInfoCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartyGetAccountInfoRequest) -> RelyingpartyGetAccountInfoCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -2510,7 +2542,7 @@ impl<'a, C, A> RelyingpartyGetAccountInfoCall<'a, C, A> where C: BorrowMut<hyper
/// // 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.relyingparty().reset_password(&req)
/// let result = hub.relyingparty().reset_password(req)
/// .doit();
/// # }
/// ```
@@ -2605,12 +2637,17 @@ impl<'a, C, A> RelyingpartyResetPasswordCall<'a, C, A> where C: BorrowMut<hyper:
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -2619,7 +2656,7 @@ impl<'a, C, A> RelyingpartyResetPasswordCall<'a, C, A> where C: BorrowMut<hyper:
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -2637,8 +2674,8 @@ impl<'a, C, A> RelyingpartyResetPasswordCall<'a, C, A> where C: BorrowMut<hyper:
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartyResetPasswordRequest) -> RelyingpartyResetPasswordCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartyResetPasswordRequest) -> RelyingpartyResetPasswordCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -2709,7 +2746,7 @@ impl<'a, C, A> RelyingpartyResetPasswordCall<'a, C, A> where C: BorrowMut<hyper:
/// // 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.relyingparty().download_account(&req)
/// let result = hub.relyingparty().download_account(req)
/// .doit();
/// # }
/// ```
@@ -2804,12 +2841,17 @@ impl<'a, C, A> RelyingpartyDownloadAccountCall<'a, C, A> where C: BorrowMut<hype
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -2818,7 +2860,7 @@ impl<'a, C, A> RelyingpartyDownloadAccountCall<'a, C, A> where C: BorrowMut<hype
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -2836,8 +2878,8 @@ impl<'a, C, A> RelyingpartyDownloadAccountCall<'a, C, A> where C: BorrowMut<hype
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartyDownloadAccountRequest) -> RelyingpartyDownloadAccountCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartyDownloadAccountRequest) -> RelyingpartyDownloadAccountCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -2908,7 +2950,7 @@ impl<'a, C, A> RelyingpartyDownloadAccountCall<'a, C, A> where C: BorrowMut<hype
/// // 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.relyingparty().set_account_info(&req)
/// let result = hub.relyingparty().set_account_info(req)
/// .doit();
/// # }
/// ```
@@ -3003,12 +3045,17 @@ impl<'a, C, A> RelyingpartySetAccountInfoCall<'a, C, A> where C: BorrowMut<hyper
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -3017,7 +3064,7 @@ impl<'a, C, A> RelyingpartySetAccountInfoCall<'a, C, A> where C: BorrowMut<hyper
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -3035,8 +3082,8 @@ impl<'a, C, A> RelyingpartySetAccountInfoCall<'a, C, A> where C: BorrowMut<hyper
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartySetAccountInfoRequest) -> RelyingpartySetAccountInfoCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartySetAccountInfoRequest) -> RelyingpartySetAccountInfoCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -3107,7 +3154,7 @@ impl<'a, C, A> RelyingpartySetAccountInfoCall<'a, C, A> where C: BorrowMut<hyper
/// // 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.relyingparty().delete_account(&req)
/// let result = hub.relyingparty().delete_account(req)
/// .doit();
/// # }
/// ```
@@ -3202,12 +3249,17 @@ impl<'a, C, A> RelyingpartyDeleteAccountCall<'a, C, A> where C: BorrowMut<hyper:
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -3216,7 +3268,7 @@ impl<'a, C, A> RelyingpartyDeleteAccountCall<'a, C, A> where C: BorrowMut<hyper:
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -3234,8 +3286,8 @@ impl<'a, C, A> RelyingpartyDeleteAccountCall<'a, C, A> where C: BorrowMut<hyper:
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartyDeleteAccountRequest) -> RelyingpartyDeleteAccountCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartyDeleteAccountRequest) -> RelyingpartyDeleteAccountCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
@@ -3386,12 +3438,17 @@ impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut<hy
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -3400,7 +3457,7 @@ impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut<hy
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -3481,7 +3538,7 @@ impl<'a, C, A> RelyingpartyGetRecaptchaParamCall<'a, C, A> where C: BorrowMut<hy
/// // 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.relyingparty().verify_password(&req)
/// let result = hub.relyingparty().verify_password(req)
/// .doit();
/// # }
/// ```
@@ -3576,12 +3633,17 @@ impl<'a, C, A> RelyingpartyVerifyPasswordCall<'a, C, A> where C: BorrowMut<hyper
if !res.status.is_success() {
let mut json_err = String::new();
res.read_to_string(&mut json_err).unwrap();
if let oauth2::Retry::After(d) = dlg.http_failure(&res, json::from_str(&json_err).ok()) {
if let oauth2::Retry::After(d) = dlg.http_failure(&res,
json::from_str(&json_err).ok(),
json::from_str(&json_err).ok()) {
sleep_ms(d.num_milliseconds() as u32);
continue;
}
dlg.finished(false);
return Err(Error::Failure(res))
return match json::from_str::<ErrorResponse>(&json_err){
Err(_) => Err(Error::Failure(res)),
Ok(serr) => Err(Error::BadRequest(serr))
}
}
let result_value = {
let mut json_response = String::new();
@@ -3590,7 +3652,7 @@ impl<'a, C, A> RelyingpartyVerifyPasswordCall<'a, C, A> where C: BorrowMut<hyper
Ok(decoded) => (res, decoded),
Err(err) => {
dlg.response_json_decode_error(&json_response, &err);
return Err(Error::JsonDecodeError(err));
return Err(Error::JsonDecodeError(json_response, err));
}
}
};
@@ -3608,8 +3670,8 @@ impl<'a, C, A> RelyingpartyVerifyPasswordCall<'a, C, A> where C: BorrowMut<hyper
///
/// Even though the property as already been set when instantiating this call,
/// we provide this method for API completeness.
pub fn request(mut self, new_value: &IdentitytoolkitRelyingpartyVerifyPasswordRequest) -> RelyingpartyVerifyPasswordCall<'a, C, A> {
self._request = new_value.clone();
pub fn request(mut self, new_value: IdentitytoolkitRelyingpartyVerifyPasswordRequest) -> RelyingpartyVerifyPasswordCall<'a, C, A> {
self._request = new_value;
self
}
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong