mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
Bump version to 1.0.9; update JSON schemas; add new APIs
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *plusDomains* crate version *1.0.8+20190328*, where *20190328* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.8*.
|
||||
//! This documentation was generated from *plusDomains* crate version *1.0.9+20190616*, where *20190616* is the exact revision of the *plusDomains:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.9*.
|
||||
//!
|
||||
//! Everything else about the *plusDomains* *v1* API can be found at the
|
||||
//! [official documentation site](https://developers.google.com/+/domains/).
|
||||
@@ -22,7 +22,7 @@
|
||||
//! * [media](struct.Media.html)
|
||||
//! * [*insert*](struct.MediaInsertCall.html)
|
||||
//! * people
|
||||
//! * [*get*](struct.PeopleGetCall.html), [*list*](struct.PeopleListCall.html), [*list by activity*](struct.PeopleListByActivityCall.html) and [*list by circle*](struct.PeopleListByCircleCall.html)
|
||||
//! * [*get*](struct.PeopleGetCall.html), [*list*](struct.PeopleListCall.html) and [*list by activity*](struct.PeopleListByActivityCall.html)
|
||||
//!
|
||||
//!
|
||||
//! Upload supported by ...
|
||||
@@ -61,9 +61,8 @@
|
||||
//! Or specifically ...
|
||||
//!
|
||||
//! ```ignore
|
||||
//! let r = hub.people().list_by_circle(...).doit()
|
||||
//! let r = hub.people().list_by_activity(...).doit()
|
||||
//! let r = hub.people().list(...).doit()
|
||||
//! let r = hub.comments().get(...).doit()
|
||||
//! let r = hub.comments().list(...).doit()
|
||||
//! ```
|
||||
//!
|
||||
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
|
||||
@@ -118,10 +117,10 @@
|
||||
//! // 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.people().list("userId", "collection")
|
||||
//! .page_token("accusam")
|
||||
//! .order_by("takimata")
|
||||
//! .max_results(31)
|
||||
//! let result = hub.comments().list("activityId")
|
||||
//! .sort_order("dolores")
|
||||
//! .page_token("kasd")
|
||||
//! .max_results(79)
|
||||
//! .doit();
|
||||
//!
|
||||
//! match result {
|
||||
@@ -230,9 +229,7 @@ use std::mem;
|
||||
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,
|
||||
Resource, ErrorResponse, remove_json_null_values};
|
||||
pub use cmn::*;
|
||||
|
||||
|
||||
// ##############
|
||||
@@ -265,7 +262,7 @@ pub enum Scope {
|
||||
/// See your personal info, including any personal info you've made publicly available
|
||||
UserinfoProfile,
|
||||
|
||||
/// Know who you are on Google
|
||||
/// Associate you with your personal info on Google
|
||||
PluMe,
|
||||
}
|
||||
|
||||
@@ -328,10 +325,10 @@ impl Default for Scope {
|
||||
/// // 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.people().list("userId", "collection")
|
||||
/// .page_token("labore")
|
||||
/// .order_by("sea")
|
||||
/// .max_results(11)
|
||||
/// let result = hub.comments().list("activityId")
|
||||
/// .sort_order("justo")
|
||||
/// .page_token("amet.")
|
||||
/// .max_results(20)
|
||||
/// .doit();
|
||||
///
|
||||
/// match result {
|
||||
@@ -369,7 +366,7 @@ impl<'a, C, A> PlusDomains<C, A>
|
||||
PlusDomains {
|
||||
client: RefCell::new(client),
|
||||
auth: RefCell::new(authenticator),
|
||||
_user_agent: "google-api-rust-client/1.0.8".to_string(),
|
||||
_user_agent: "google-api-rust-client/1.0.9".to_string(),
|
||||
_base_url: "https://www.googleapis.com/plusDomains/v1/".to_string(),
|
||||
_root_url: "https://www.googleapis.com/".to_string(),
|
||||
}
|
||||
@@ -395,7 +392,7 @@ impl<'a, C, A> PlusDomains<C, A>
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/1.0.8`.
|
||||
/// It defaults to `google-api-rust-client/1.0.9`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -930,7 +927,6 @@ impl Part for ActivityActorClientSpecificActorInfo {}
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list by circle people](struct.PeopleListByCircleCall.html) (response)
|
||||
/// * [list by activity people](struct.PeopleListByActivityCall.html) (response)
|
||||
/// * [list people](struct.PeopleListCall.html) (response)
|
||||
///
|
||||
@@ -2081,7 +2077,7 @@ impl<'a, C, A> ActivityMethods<'a, C, A> {
|
||||
/// <MemoryStorage as Default>::default(), None);
|
||||
/// let mut hub = PlusDomains::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `get(...)`, `list(...)`, `list_by_activity(...)` and `list_by_circle(...)`
|
||||
/// // like `get(...)`, `list(...)` and `list_by_activity(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.people();
|
||||
/// # }
|
||||
@@ -2096,25 +2092,6 @@ impl<'a, C, A> MethodsBuilder for PeopleMethods<'a, C, A> {}
|
||||
|
||||
impl<'a, C, A> PeopleMethods<'a, C, A> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `circleId` - The ID of the circle to get the members of.
|
||||
pub fn list_by_circle(&self, circle_id: &str) -> PeopleListByCircleCall<'a, C, A> {
|
||||
PeopleListByCircleCall {
|
||||
hub: self.hub,
|
||||
_circle_id: circle_id.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_max_results: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// List all of the people in the specified collection.
|
||||
@@ -2415,8 +2392,8 @@ impl<'a, C, A> AudienceMethods<'a, C, A> {
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.circles().list("userId")
|
||||
/// .page_token("gubergren")
|
||||
/// .max_results(6)
|
||||
/// .page_token("sea")
|
||||
/// .max_results(11)
|
||||
/// .doit();
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -2919,8 +2896,8 @@ impl<'a, C, A> ActivityGetCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: o
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.activities().list("userId", "collection")
|
||||
/// .page_token("justo")
|
||||
/// .max_results(80)
|
||||
/// .page_token("aliquyam")
|
||||
/// .max_results(35)
|
||||
/// .doit();
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -3167,270 +3144,6 @@ impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A:
|
||||
}
|
||||
|
||||
|
||||
/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
|
||||
///
|
||||
/// A builder for the *listByCircle* method supported by a *people* resource.
|
||||
/// It is not used directly, but through a `PeopleMethods` instance.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource method builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_plusdomains1 as plusdomains1;
|
||||
/// # #[test] fn egal() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
|
||||
/// # use plusdomains1::PlusDomains;
|
||||
///
|
||||
/// # let secret: ApplicationSecret = Default::default();
|
||||
/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
|
||||
/// # hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())),
|
||||
/// # <MemoryStorage as Default>::default(), None);
|
||||
/// # let mut hub = PlusDomains::new(hyper::Client::with_connector(hyper::net::HttpsConnector::new(hyper_rustls::TlsClient::new())), 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 !
|
||||
/// let result = hub.people().list_by_circle("circleId")
|
||||
/// .page_token("et")
|
||||
/// .max_results(60)
|
||||
/// .doit();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct PeopleListByCircleCall<'a, C, A>
|
||||
where C: 'a, A: 'a {
|
||||
|
||||
hub: &'a PlusDomains<C, A>,
|
||||
_circle_id: String,
|
||||
_page_token: Option<String>,
|
||||
_max_results: Option<u32>,
|
||||
_delegate: Option<&'a mut Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C, A> CallBuilder for PeopleListByCircleCall<'a, C, A> {}
|
||||
|
||||
impl<'a, C, A> PeopleListByCircleCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
pub fn doit(mut self) -> Result<(hyper::client::Response, PeopleFeed)> {
|
||||
use std::io::{Read, Seek};
|
||||
use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location};
|
||||
let mut dd = DefaultDelegate;
|
||||
let mut dlg: &mut Delegate = match self._delegate {
|
||||
Some(d) => d,
|
||||
None => &mut dd
|
||||
};
|
||||
dlg.begin(MethodInfo { id: "plusDomains.people.listByCircle",
|
||||
http_method: hyper::method::Method::Get });
|
||||
let mut params: Vec<(&str, String)> = Vec::with_capacity(5 + self._additional_params.len());
|
||||
params.push(("circleId", self._circle_id.to_string()));
|
||||
if let Some(value) = self._page_token {
|
||||
params.push(("pageToken", value.to_string()));
|
||||
}
|
||||
if let Some(value) = self._max_results {
|
||||
params.push(("maxResults", value.to_string()));
|
||||
}
|
||||
for &field in ["alt", "circleId", "pageToken", "maxResults"].iter() {
|
||||
if self._additional_params.contains_key(field) {
|
||||
dlg.finished(false);
|
||||
return Err(Error::FieldClash(field));
|
||||
}
|
||||
}
|
||||
for (name, value) in self._additional_params.iter() {
|
||||
params.push((&name, value.clone()));
|
||||
}
|
||||
|
||||
params.push(("alt", "json".to_string()));
|
||||
|
||||
let mut url = self.hub._base_url.clone() + "circles/{circleId}/people";
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::PluCircleRead.as_ref().to_string(), ());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{circleId}", "circleId")].iter() {
|
||||
let mut replace_with: Option<&str> = None;
|
||||
for &(name, ref value) in params.iter() {
|
||||
if name == param_name {
|
||||
replace_with = Some(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
url = url.replace(find_this, replace_with.expect("to find substitution value in params"));
|
||||
}
|
||||
{
|
||||
let mut indices_for_removal: Vec<usize> = Vec::with_capacity(1);
|
||||
for param_name in ["circleId"].iter() {
|
||||
if let Some(index) = params.iter().position(|t| &t.0 == param_name) {
|
||||
indices_for_removal.push(index);
|
||||
}
|
||||
}
|
||||
for &index in indices_for_removal.iter() {
|
||||
params.remove(index);
|
||||
}
|
||||
}
|
||||
|
||||
let url = hyper::Url::parse_with_params(&url, params).unwrap();
|
||||
|
||||
|
||||
|
||||
loop {
|
||||
let token = match self.hub.auth.borrow_mut().token(self._scopes.keys()) {
|
||||
Ok(token) => token,
|
||||
Err(err) => {
|
||||
match dlg.token(&*err) {
|
||||
Some(token) => token,
|
||||
None => {
|
||||
dlg.finished(false);
|
||||
return Err(Error::MissingToken(err))
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
let auth_header = Authorization(Bearer { token: token.access_token });
|
||||
let mut req_result = {
|
||||
let mut client = &mut *self.hub.client.borrow_mut();
|
||||
let mut req = client.borrow_mut().request(hyper::method::Method::Get, url.clone())
|
||||
.header(UserAgent(self.hub._user_agent.clone()))
|
||||
.header(auth_header.clone());
|
||||
|
||||
dlg.pre_request();
|
||||
req.send()
|
||||
};
|
||||
|
||||
match req_result {
|
||||
Err(err) => {
|
||||
if let oauth2::Retry::After(d) = dlg.http_error(&err) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
dlg.finished(false);
|
||||
return Err(Error::HttpError(err))
|
||||
}
|
||||
Ok(mut res) => {
|
||||
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(),
|
||||
json::from_str(&json_err).ok()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
dlg.finished(false);
|
||||
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();
|
||||
res.read_to_string(&mut json_response).unwrap();
|
||||
match json::from_str(&json_response) {
|
||||
Ok(decoded) => (res, decoded),
|
||||
Err(err) => {
|
||||
dlg.response_json_decode_error(&json_response, &err);
|
||||
return Err(Error::JsonDecodeError(json_response, err));
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
dlg.finished(true);
|
||||
return Ok(result_value)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// The ID of the circle to get the members of.
|
||||
///
|
||||
/// Sets the *circle id* path property to the given value.
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn circle_id(mut self, new_value: &str) -> PeopleListByCircleCall<'a, C, A> {
|
||||
self._circle_id = new_value.to_string();
|
||||
self
|
||||
}
|
||||
/// The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of "nextPageToken" from the previous response.
|
||||
///
|
||||
/// Sets the *page token* query property to the given value.
|
||||
pub fn page_token(mut self, new_value: &str) -> PeopleListByCircleCall<'a, C, A> {
|
||||
self._page_token = Some(new_value.to_string());
|
||||
self
|
||||
}
|
||||
/// The maximum number of people to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.
|
||||
///
|
||||
/// Sets the *max results* query property to the given value.
|
||||
pub fn max_results(mut self, new_value: u32) -> PeopleListByCircleCall<'a, C, A> {
|
||||
self._max_results = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
|
||||
/// while executing the actual API request.
|
||||
///
|
||||
/// 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 Delegate) -> PeopleListByCircleCall<'a, C, A> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
|
||||
/// 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
|
||||
/// setters.
|
||||
///
|
||||
/// Please note that this method must not be used to set any of the known parameters
|
||||
/// which have their own setter method. If done anyway, the request will fail.
|
||||
///
|
||||
/// # Additional Parameters
|
||||
///
|
||||
/// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
|
||||
/// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
|
||||
/// * *key* (query-string) - API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
|
||||
/// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
|
||||
/// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
|
||||
/// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
|
||||
/// * *alt* (query-string) - Data format for the response.
|
||||
pub fn param<T>(mut self, name: T, value: T) -> PeopleListByCircleCall<'a, C, A>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
}
|
||||
|
||||
/// 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::PluCircleRead`.
|
||||
///
|
||||
/// The `scope` will be added to a set of scopes. This is important as one can maintain access
|
||||
/// tokens for more than one scope.
|
||||
/// If `None` is specified, then all scopes will be removed and no default scope will be used either.
|
||||
/// In that case, you have to specify your API-key using the `key` parameter (see the `param()`
|
||||
/// function for details).
|
||||
///
|
||||
/// 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) -> PeopleListByCircleCall<'a, C, A>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
|
||||
None => None,
|
||||
};
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// List all of the people in the specified collection.
|
||||
///
|
||||
/// A builder for the *list* method supported by a *people* resource.
|
||||
@@ -3459,9 +3172,9 @@ impl<'a, C, A> PeopleListByCircleCall<'a, C, A> where C: BorrowMut<hyper::Client
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.people().list("userId", "collection")
|
||||
/// .page_token("et")
|
||||
/// .order_by("duo")
|
||||
/// .max_results(69)
|
||||
/// .page_token("justo")
|
||||
/// .order_by("et")
|
||||
/// .max_results(84)
|
||||
/// .doit();
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -3987,8 +3700,8 @@ impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oau
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.people().list_by_activity("activityId", "collection")
|
||||
/// .page_token("erat")
|
||||
/// .max_results(6)
|
||||
/// .page_token("et")
|
||||
/// .max_results(31)
|
||||
/// .doit();
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -4655,9 +4368,9 @@ impl<'a, C, A> MediaInsertCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: o
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.comments().list("activityId")
|
||||
/// .sort_order("amet")
|
||||
/// .page_token("no")
|
||||
/// .max_results(65)
|
||||
/// .sort_order("eos")
|
||||
/// .page_token("erat")
|
||||
/// .max_results(6)
|
||||
/// .doit();
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -5171,8 +4884,8 @@ impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oa
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.audiences().list("userId")
|
||||
/// .page_token("invidunt")
|
||||
/// .max_results(19)
|
||||
/// .page_token("elitr")
|
||||
/// .max_results(4)
|
||||
/// .doit();
|
||||
/// # }
|
||||
/// ```
|
||||
|
||||
Reference in New Issue
Block a user