mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
chore(code): updated to latest state
This commit is contained in:
@@ -19,10 +19,11 @@ use std::collections::BTreeMap;
|
||||
use serde_json as json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
use std::thread::sleep_ms;
|
||||
use std::thread::sleep;
|
||||
use std::time::Duration;
|
||||
|
||||
pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part,
|
||||
ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder,
|
||||
ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder,
|
||||
Resource, ErrorResponse, remove_json_null_values};
|
||||
|
||||
|
||||
@@ -127,7 +128,7 @@ impl<'a, C, A> GroupsMigration<C, A>
|
||||
GroupsMigration {
|
||||
client: RefCell::new(client),
|
||||
auth: RefCell::new(authenticator),
|
||||
_user_agent: "google-api-rust-client/0.1.10".to_string(),
|
||||
_user_agent: "google-api-rust-client/0.1.11".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,7 +137,7 @@ impl<'a, C, A> GroupsMigration<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.10`.
|
||||
/// It defaults to `google-api-rust-client/0.1.11`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -296,7 +297,7 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
Some(d) => d,
|
||||
None => &mut dd
|
||||
};
|
||||
dlg.begin(MethodInfo { id: "groupsmigration.archive.insert",
|
||||
dlg.begin(MethodInfo { id: "groupsmigration.archive.insert",
|
||||
http_method: hyper::method::Method::Post });
|
||||
let mut params: Vec<(&str, String)> = Vec::with_capacity((3 + self._additional_params.len()));
|
||||
params.push(("groupId", self._group_id.to_string()));
|
||||
@@ -312,13 +313,13 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
|
||||
params.push(("alt", "json".to_string()));
|
||||
|
||||
let (mut url, upload_type) =
|
||||
let (mut url, upload_type) =
|
||||
if protocol == "simple" {
|
||||
("https://www.googleapis.com/upload/groups/v1/groups/{groupId}/archive".to_string(), "multipart")
|
||||
} else if protocol == "resumable" {
|
||||
("https://www.googleapis.com/resumable/upload/groups/v1/groups/{groupId}/archive".to_string(), "resumable")
|
||||
} else {
|
||||
unreachable!()
|
||||
} else {
|
||||
unreachable!()
|
||||
};
|
||||
params.push(("uploadType", upload_type.to_string()));
|
||||
if self._scopes.len() == 0 {
|
||||
@@ -346,7 +347,7 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
params.remove(index);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if params.len() > 0 {
|
||||
url.push('?');
|
||||
url.push_str(&url::form_urlencoded::serialize(params));
|
||||
@@ -410,7 +411,7 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
match req_result {
|
||||
Err(err) => {
|
||||
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
|
||||
sleep_ms(d.num_milliseconds() as u32);
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
dlg.finished(false);
|
||||
@@ -420,10 +421,10 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
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,
|
||||
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);
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
dlg.finished(false);
|
||||
@@ -527,7 +528,7 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
///
|
||||
/// Sets the *group id* path property to the given value.
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn group_id(mut self, new_value: &str) -> ArchiveInsertCall<'a, C, A> {
|
||||
self._group_id = new_value.to_string();
|
||||
@@ -545,12 +546,12 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
}
|
||||
|
||||
/// Set any additional parameter of the query string used in the request.
|
||||
/// It should be used to set parameters which are not yet available through their own
|
||||
/// It should be used to set parameters which are not yet available through their own
|
||||
/// setters.
|
||||
///
|
||||
/// Please note that this method must not be used to set any of the known paramters
|
||||
/// which have their own setter method. If done anyway, the request will fail.
|
||||
///
|
||||
///
|
||||
/// # Additional Parameters
|
||||
///
|
||||
/// * *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. Overrides userIp if both are provided.
|
||||
@@ -567,17 +568,17 @@ impl<'a, C, A> ArchiveInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
}
|
||||
|
||||
/// Identifies the authorization scope for the method you are building.
|
||||
///
|
||||
///
|
||||
/// Use this method to actively specify which scope should be used, instead the default `Scope` variant
|
||||
/// `Scope::AppGroupMigration`.
|
||||
///
|
||||
/// The `scope` will be added to a set of scopes. This is important as one can maintain access
|
||||
/// tokens for more than one scope.
|
||||
///
|
||||
///
|
||||
/// 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>(mut self, scope: T) -> ArchiveInsertCall<'a, C, A>
|
||||
pub fn add_scope<T>(mut self, scope: T) -> ArchiveInsertCall<'a, C, A>
|
||||
where T: AsRef<str> {
|
||||
self._scopes.insert(scope.as_ref().to_string(), ());
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user