#![allow(unused_imports, unused_mut, dead_code)]
#[macro_use]
extern crate serde_derive;
extern crate hyper;
extern crate serde;
extern crate serde_json;
extern crate yup_oauth2 as oauth2;
extern crate mime;
extern crate url;
mod cmn;
use std::collections::HashMap;
use std::cell::RefCell;
use std::borrow::BorrowMut;
use std::default::Default;
use std::collections::BTreeMap;
use serde_json as json;
use std::io;
use std::fs;
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};
#[derive(PartialEq, Eq, Hash)]
pub enum Scope {
Login,
UserinfoEmail,
UserinfoProfile,
Me,
}
impl AsRef<str> for Scope {
fn as_ref(&self) -> &str {
match *self {
Scope::Login => "https://www.googleapis.com/auth/plus.login",
Scope::UserinfoEmail => "https://www.googleapis.com/auth/userinfo.email",
Scope::UserinfoProfile => "https://www.googleapis.com/auth/userinfo.profile",
Scope::Me => "https://www.googleapis.com/auth/plus.me",
}
}
}
impl Default for Scope {
fn default() -> Scope {
Scope::Me
}
}
pub struct Plus<C, A> {
client: RefCell<C>,
auth: RefCell<A>,
_user_agent: String,
_base_url: String,
_root_url: String,
}
impl<'a, C, A> Hub for Plus<C, A> {}
impl<'a, C, A> Plus<C, A>
where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
pub fn new(client: C, authenticator: A) -> Plus<C, A> {
Plus {
client: RefCell::new(client),
auth: RefCell::new(authenticator),
_user_agent: "google-api-rust-client/1.0.7".to_string(),
_base_url: "https://www.googleapis.com/plus/v1/".to_string(),
_root_url: "https://www.googleapis.com/".to_string(),
}
}
pub fn activities(&'a self) -> ActivityMethods<'a, C, A> {
ActivityMethods { hub: &self }
}
pub fn comments(&'a self) -> CommentMethods<'a, C, A> {
CommentMethods { hub: &self }
}
pub fn people(&'a self) -> PeopleMethods<'a, C, A> {
PeopleMethods { hub: &self }
}
pub fn user_agent(&mut self, agent_name: String) -> String {
mem::replace(&mut self._user_agent, agent_name)
}
pub fn base_url(&mut self, new_base_url: String) -> String {
mem::replace(&mut self._base_url, new_base_url)
}
pub fn root_url(&mut self, new_root_url: String) -> String {
mem::replace(&mut self._root_url, new_root_url)
}
}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectAttachmentsThumbnails {
pub url: Option<String>,
pub image: Option<ActivityObjectAttachmentsThumbnailsImage>,
pub description: Option<String>,
}
impl NestedType for ActivityObjectAttachmentsThumbnails {}
impl Part for ActivityObjectAttachmentsThumbnails {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityActorName {
#[serde(rename="givenName")]
pub given_name: Option<String>,
#[serde(rename="familyName")]
pub family_name: Option<String>,
}
impl NestedType for ActivityActorName {}
impl Part for ActivityActorName {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityFeed {
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
pub kind: Option<String>,
pub title: Option<String>,
pub items: Option<Vec<Activity>>,
pub updated: Option<String>,
#[serde(rename="nextLink")]
pub next_link: Option<String>,
pub etag: Option<String>,
pub id: Option<String>,
#[serde(rename="selfLink")]
pub self_link: Option<String>,
}
impl ResponseResult for ActivityFeed {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonUrls {
#[serde(rename="type")]
pub type_: Option<String>,
pub value: Option<String>,
pub label: Option<String>,
}
impl NestedType for PersonUrls {}
impl Part for PersonUrls {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonEmails {
#[serde(rename="type")]
pub type_: Option<String>,
pub value: Option<String>,
}
impl NestedType for PersonEmails {}
impl Part for PersonEmails {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonOrganizations {
#[serde(rename="startDate")]
pub start_date: Option<String>,
#[serde(rename="endDate")]
pub end_date: Option<String>,
pub description: Option<String>,
pub title: Option<String>,
pub primary: Option<bool>,
pub location: Option<String>,
pub department: Option<String>,
#[serde(rename="type")]
pub type_: Option<String>,
pub name: Option<String>,
}
impl NestedType for PersonOrganizations {}
impl Part for PersonOrganizations {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Activity {
#[serde(rename="placeName")]
pub place_name: Option<String>,
pub updated: Option<String>,
pub object: Option<ActivityObject>,
pub verb: Option<String>,
pub radius: Option<String>,
pub etag: Option<String>,
pub address: Option<String>,
pub annotation: Option<String>,
pub kind: Option<String>,
pub title: Option<String>,
pub url: Option<String>,
#[serde(rename="placeId")]
pub place_id: Option<String>,
pub actor: Option<ActivityActor>,
pub id: Option<String>,
pub access: Option<Acl>,
pub geocode: Option<String>,
pub location: Option<Place>,
pub provider: Option<ActivityProvider>,
#[serde(rename="crosspostSource")]
pub crosspost_source: Option<String>,
pub published: Option<String>,
}
impl ResponseResult for Activity {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityActorClientSpecificActorInfoYoutubeActorInfo {
#[serde(rename="channelId")]
pub channel_id: Option<String>,
}
impl NestedType for ActivityActorClientSpecificActorInfoYoutubeActorInfo {}
impl Part for ActivityActorClientSpecificActorInfoYoutubeActorInfo {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityActorClientSpecificActorInfo {
#[serde(rename="youtubeActorInfo")]
pub youtube_actor_info: Option<ActivityActorClientSpecificActorInfoYoutubeActorInfo>,
}
impl NestedType for ActivityActorClientSpecificActorInfo {}
impl Part for ActivityActorClientSpecificActorInfo {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityActorVerification {
#[serde(rename="adHocVerified")]
pub ad_hoc_verified: Option<String>,
}
impl NestedType for ActivityActorVerification {}
impl Part for ActivityActorVerification {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectAttachmentsEmbed {
pub url: Option<String>,
#[serde(rename="type")]
pub type_: Option<String>,
}
impl NestedType for ActivityObjectAttachmentsEmbed {}
impl Part for ActivityObjectAttachmentsEmbed {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PlusAclentryResource {
#[serde(rename="displayName")]
pub display_name: Option<String>,
#[serde(rename="type")]
pub type_: Option<String>,
pub id: Option<String>,
}
impl Part for PlusAclentryResource {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonPlacesLived {
pub primary: Option<bool>,
pub value: Option<String>,
}
impl NestedType for PersonPlacesLived {}
impl Part for PersonPlacesLived {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentObject {
pub content: Option<String>,
#[serde(rename="objectType")]
pub object_type: Option<String>,
#[serde(rename="originalContent")]
pub original_content: Option<String>,
}
impl NestedType for CommentObject {}
impl Part for CommentObject {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectAttachmentsImage {
pub url: Option<String>,
pub width: Option<u32>,
#[serde(rename="type")]
pub type_: Option<String>,
pub height: Option<u32>,
}
impl NestedType for ActivityObjectAttachmentsImage {}
impl Part for ActivityObjectAttachmentsImage {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentInReplyTo {
pub url: Option<String>,
pub id: Option<String>,
}
impl NestedType for CommentInReplyTo {}
impl Part for CommentInReplyTo {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PeopleFeed {
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
pub kind: Option<String>,
pub etag: Option<String>,
pub title: Option<String>,
#[serde(rename="totalItems")]
pub total_items: Option<i32>,
pub items: Option<Vec<Person>>,
#[serde(rename="selfLink")]
pub self_link: Option<String>,
}
impl ResponseResult for PeopleFeed {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentActor {
#[serde(rename="displayName")]
pub display_name: Option<String>,
pub verification: Option<CommentActorVerification>,
pub url: Option<String>,
pub image: Option<CommentActorImage>,
#[serde(rename="clientSpecificActorInfo")]
pub client_specific_actor_info: Option<CommentActorClientSpecificActorInfo>,
pub id: Option<String>,
}
impl NestedType for CommentActor {}
impl Part for CommentActor {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo {
#[serde(rename="channelId")]
pub channel_id: Option<String>,
}
impl NestedType for ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo {}
impl Part for ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PlaceAddress {
pub formatted: Option<String>,
}
impl NestedType for PlaceAddress {}
impl Part for PlaceAddress {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityProvider {
pub title: Option<String>,
}
impl NestedType for ActivityProvider {}
impl Part for ActivityProvider {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentActorClientSpecificActorInfo {
#[serde(rename="youtubeActorInfo")]
pub youtube_actor_info: Option<CommentActorClientSpecificActorInfoYoutubeActorInfo>,
}
impl NestedType for CommentActorClientSpecificActorInfo {}
impl Part for CommentActorClientSpecificActorInfo {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PlacePosition {
pub latitude: Option<f64>,
pub longitude: Option<f64>,
}
impl NestedType for PlacePosition {}
impl Part for PlacePosition {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectPlusoners {
#[serde(rename="totalItems")]
pub total_items: Option<u32>,
#[serde(rename="selfLink")]
pub self_link: Option<String>,
}
impl NestedType for ActivityObjectPlusoners {}
impl Part for ActivityObjectPlusoners {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonCoverCoverInfo {
#[serde(rename="leftImageOffset")]
pub left_image_offset: Option<i32>,
#[serde(rename="topImageOffset")]
pub top_image_offset: Option<i32>,
}
impl NestedType for PersonCoverCoverInfo {}
impl Part for PersonCoverCoverInfo {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentActorImage {
pub url: Option<String>,
}
impl NestedType for CommentActorImage {}
impl Part for CommentActorImage {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonImage {
pub url: Option<String>,
#[serde(rename="isDefault")]
pub is_default: Option<bool>,
}
impl NestedType for PersonImage {}
impl Part for PersonImage {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentPlusoners {
#[serde(rename="totalItems")]
pub total_items: Option<u32>,
}
impl NestedType for CommentPlusoners {}
impl Part for CommentPlusoners {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectAttachments {
#[serde(rename="displayName")]
pub display_name: Option<String>,
pub thumbnails: Option<Vec<ActivityObjectAttachmentsThumbnails>>,
#[serde(rename="fullImage")]
pub full_image: Option<ActivityObjectAttachmentsFullImage>,
pub url: Option<String>,
pub image: Option<ActivityObjectAttachmentsImage>,
pub content: Option<String>,
pub embed: Option<ActivityObjectAttachmentsEmbed>,
pub id: Option<String>,
#[serde(rename="objectType")]
pub object_type: Option<String>,
}
impl NestedType for ActivityObjectAttachments {}
impl Part for ActivityObjectAttachments {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonCoverCoverPhoto {
pub url: Option<String>,
pub width: Option<i32>,
pub height: Option<i32>,
}
impl NestedType for PersonCoverCoverPhoto {}
impl Part for PersonCoverCoverPhoto {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectActorVerification {
#[serde(rename="adHocVerified")]
pub ad_hoc_verified: Option<String>,
}
impl NestedType for ActivityObjectActorVerification {}
impl Part for ActivityObjectActorVerification {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectAttachmentsFullImage {
pub url: Option<String>,
pub width: Option<u32>,
#[serde(rename="type")]
pub type_: Option<String>,
pub height: Option<u32>,
}
impl NestedType for ActivityObjectAttachmentsFullImage {}
impl Part for ActivityObjectAttachmentsFullImage {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonCover {
#[serde(rename="coverInfo")]
pub cover_info: Option<PersonCoverCoverInfo>,
pub layout: Option<String>,
#[serde(rename="coverPhoto")]
pub cover_photo: Option<PersonCoverCoverPhoto>,
}
impl NestedType for PersonCover {}
impl Part for PersonCover {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Acl {
pub items: Option<Vec<PlusAclentryResource>>,
pub kind: Option<String>,
pub description: Option<String>,
}
impl Part for Acl {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Person {
#[serde(rename="braggingRights")]
pub bragging_rights: Option<String>,
#[serde(rename="relationshipStatus")]
pub relationship_status: Option<String>,
pub image: Option<PersonImage>,
pub domain: Option<String>,
#[serde(rename="placesLived")]
pub places_lived: Option<Vec<PersonPlacesLived>>,
pub birthday: Option<String>,
#[serde(rename="displayName")]
pub display_name: Option<String>,
pub nickname: Option<String>,
pub emails: Option<Vec<PersonEmails>>,
pub occupation: Option<String>,
pub organizations: Option<Vec<PersonOrganizations>>,
pub kind: Option<String>,
pub verified: Option<bool>,
pub name: Option<PersonName>,
pub language: Option<String>,
#[serde(rename="isPlusUser")]
pub is_plus_user: Option<bool>,
pub skills: Option<String>,
pub tagline: Option<String>,
#[serde(rename="currentLocation")]
pub current_location: Option<String>,
pub cover: Option<PersonCover>,
pub id: Option<String>,
pub url: Option<String>,
pub etag: Option<String>,
#[serde(rename="plusOneCount")]
pub plus_one_count: Option<i32>,
pub urls: Option<Vec<PersonUrls>>,
pub gender: Option<String>,
#[serde(rename="ageRange")]
pub age_range: Option<PersonAgeRange>,
#[serde(rename="circledByCount")]
pub circled_by_count: Option<i32>,
#[serde(rename="objectType")]
pub object_type: Option<String>,
#[serde(rename="aboutMe")]
pub about_me: Option<String>,
}
impl ResponseResult for Person {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectActor {
#[serde(rename="displayName")]
pub display_name: Option<String>,
pub verification: Option<ActivityObjectActorVerification>,
pub url: Option<String>,
pub image: Option<ActivityObjectActorImage>,
#[serde(rename="clientSpecificActorInfo")]
pub client_specific_actor_info: Option<ActivityObjectActorClientSpecificActorInfo>,
pub id: Option<String>,
}
impl NestedType for ActivityObjectActor {}
impl Part for ActivityObjectActor {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentActorClientSpecificActorInfoYoutubeActorInfo {
#[serde(rename="channelId")]
pub channel_id: Option<String>,
}
impl NestedType for CommentActorClientSpecificActorInfoYoutubeActorInfo {}
impl Part for CommentActorClientSpecificActorInfoYoutubeActorInfo {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Place {
pub position: Option<PlacePosition>,
pub kind: Option<String>,
#[serde(rename="displayName")]
pub display_name: Option<String>,
pub id: Option<String>,
pub address: Option<PlaceAddress>,
}
impl Part for Place {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentActorVerification {
#[serde(rename="adHocVerified")]
pub ad_hoc_verified: Option<String>,
}
impl NestedType for CommentActorVerification {}
impl Part for CommentActorVerification {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityActor {
#[serde(rename="displayName")]
pub display_name: Option<String>,
pub name: Option<ActivityActorName>,
pub url: Option<String>,
pub image: Option<ActivityActorImage>,
#[serde(rename="clientSpecificActorInfo")]
pub client_specific_actor_info: Option<ActivityActorClientSpecificActorInfo>,
pub id: Option<String>,
pub verification: Option<ActivityActorVerification>,
}
impl NestedType for ActivityActor {}
impl Part for ActivityActor {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CommentFeed {
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
pub kind: Option<String>,
pub title: Option<String>,
pub items: Option<Vec<Comment>>,
pub updated: Option<String>,
#[serde(rename="nextLink")]
pub next_link: Option<String>,
pub etag: Option<String>,
pub id: Option<String>,
}
impl ResponseResult for CommentFeed {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectResharers {
#[serde(rename="totalItems")]
pub total_items: Option<u32>,
#[serde(rename="selfLink")]
pub self_link: Option<String>,
}
impl NestedType for ActivityObjectResharers {}
impl Part for ActivityObjectResharers {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityActorImage {
pub url: Option<String>,
}
impl NestedType for ActivityActorImage {}
impl Part for ActivityActorImage {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Comment {
#[serde(rename="inReplyTo")]
pub in_reply_to: Option<Vec<CommentInReplyTo>>,
pub kind: Option<String>,
pub plusoners: Option<CommentPlusoners>,
pub object: Option<CommentObject>,
pub updated: Option<String>,
pub actor: Option<CommentActor>,
pub verb: Option<String>,
pub etag: Option<String>,
pub published: Option<String>,
pub id: Option<String>,
#[serde(rename="selfLink")]
pub self_link: Option<String>,
}
impl Resource for Comment {}
impl ResponseResult for Comment {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectActorImage {
pub url: Option<String>,
}
impl NestedType for ActivityObjectActorImage {}
impl Part for ActivityObjectActorImage {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonAgeRange {
pub max: Option<i32>,
pub min: Option<i32>,
}
impl NestedType for PersonAgeRange {}
impl Part for PersonAgeRange {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct PersonName {
#[serde(rename="honorificPrefix")]
pub honorific_prefix: Option<String>,
#[serde(rename="givenName")]
pub given_name: Option<String>,
#[serde(rename="middleName")]
pub middle_name: Option<String>,
#[serde(rename="familyName")]
pub family_name: Option<String>,
pub formatted: Option<String>,
#[serde(rename="honorificSuffix")]
pub honorific_suffix: Option<String>,
}
impl NestedType for PersonName {}
impl Part for PersonName {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectAttachmentsThumbnailsImage {
pub url: Option<String>,
pub width: Option<u32>,
#[serde(rename="type")]
pub type_: Option<String>,
pub height: Option<u32>,
}
impl NestedType for ActivityObjectAttachmentsThumbnailsImage {}
impl Part for ActivityObjectAttachmentsThumbnailsImage {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObject {
pub content: Option<String>,
pub attachments: Option<Vec<ActivityObjectAttachments>>,
#[serde(rename="originalContent")]
pub original_content: Option<String>,
pub plusoners: Option<ActivityObjectPlusoners>,
pub actor: Option<ActivityObjectActor>,
pub resharers: Option<ActivityObjectResharers>,
pub url: Option<String>,
pub replies: Option<ActivityObjectReplies>,
pub id: Option<String>,
#[serde(rename="objectType")]
pub object_type: Option<String>,
}
impl NestedType for ActivityObject {}
impl Part for ActivityObject {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectReplies {
#[serde(rename="totalItems")]
pub total_items: Option<u32>,
#[serde(rename="selfLink")]
pub self_link: Option<String>,
}
impl NestedType for ActivityObjectReplies {}
impl Part for ActivityObjectReplies {}
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ActivityObjectActorClientSpecificActorInfo {
#[serde(rename="youtubeActorInfo")]
pub youtube_actor_info: Option<ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo>,
}
impl NestedType for ActivityObjectActorClientSpecificActorInfo {}
impl Part for ActivityObjectActorClientSpecificActorInfo {}
pub struct ActivityMethods<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
}
impl<'a, C, A> MethodsBuilder for ActivityMethods<'a, C, A> {}
impl<'a, C, A> ActivityMethods<'a, C, A> {
pub fn search(&self, query: &str) -> ActivitySearchCall<'a, C, A> {
ActivitySearchCall {
hub: self.hub,
_query: query.to_string(),
_page_token: Default::default(),
_order_by: Default::default(),
_max_results: Default::default(),
_language: Default::default(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
pub fn get(&self, activity_id: &str) -> ActivityGetCall<'a, C, A> {
ActivityGetCall {
hub: self.hub,
_activity_id: activity_id.to_string(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
pub fn list(&self, user_id: &str, collection: &str) -> ActivityListCall<'a, C, A> {
ActivityListCall {
hub: self.hub,
_user_id: user_id.to_string(),
_collection: collection.to_string(),
_page_token: Default::default(),
_max_results: Default::default(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
}
pub struct CommentMethods<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
}
impl<'a, C, A> MethodsBuilder for CommentMethods<'a, C, A> {}
impl<'a, C, A> CommentMethods<'a, C, A> {
pub fn list(&self, activity_id: &str) -> CommentListCall<'a, C, A> {
CommentListCall {
hub: self.hub,
_activity_id: activity_id.to_string(),
_sort_order: Default::default(),
_page_token: Default::default(),
_max_results: Default::default(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
pub fn get(&self, comment_id: &str) -> CommentGetCall<'a, C, A> {
CommentGetCall {
hub: self.hub,
_comment_id: comment_id.to_string(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
}
pub struct PeopleMethods<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
}
impl<'a, C, A> MethodsBuilder for PeopleMethods<'a, C, A> {}
impl<'a, C, A> PeopleMethods<'a, C, A> {
pub fn search(&self, query: &str) -> PeopleSearchCall<'a, C, A> {
PeopleSearchCall {
hub: self.hub,
_query: query.to_string(),
_page_token: Default::default(),
_max_results: Default::default(),
_language: Default::default(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
pub fn list_by_activity(&self, activity_id: &str, collection: &str) -> PeopleListByActivityCall<'a, C, A> {
PeopleListByActivityCall {
hub: self.hub,
_activity_id: activity_id.to_string(),
_collection: collection.to_string(),
_page_token: Default::default(),
_max_results: Default::default(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
pub fn list(&self, user_id: &str, collection: &str) -> PeopleListCall<'a, C, A> {
PeopleListCall {
hub: self.hub,
_user_id: user_id.to_string(),
_collection: collection.to_string(),
_page_token: Default::default(),
_order_by: Default::default(),
_max_results: Default::default(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
pub fn get(&self, user_id: &str) -> PeopleGetCall<'a, C, A> {
PeopleGetCall {
hub: self.hub,
_user_id: user_id.to_string(),
_delegate: Default::default(),
_scopes: Default::default(),
_additional_params: Default::default(),
}
}
}
pub struct ActivitySearchCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_query: String,
_page_token: Option<String>,
_order_by: Option<String>,
_max_results: Option<u32>,
_language: Option<String>,
_delegate: Option<&'a mut Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeMap<String, ()>
}
impl<'a, C, A> CallBuilder for ActivitySearchCall<'a, C, A> {}
impl<'a, C, A> ActivitySearchCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
pub fn doit(mut self) -> Result<(hyper::client::Response, ActivityFeed)> {
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: "plus.activities.search",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len());
params.push(("query", self._query.to_string()));
if let Some(value) = self._page_token {
params.push(("pageToken", value.to_string()));
}
if let Some(value) = self._order_by {
params.push(("orderBy", value.to_string()));
}
if let Some(value) = self._max_results {
params.push(("maxResults", value.to_string()));
}
if let Some(value) = self._language {
params.push(("language", value.to_string()));
}
for &field in ["alt", "query", "pageToken", "orderBy", "maxResults", "language"].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() + "activities";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn query(mut self, new_value: &str) -> ActivitySearchCall<'a, C, A> {
self._query = new_value.to_string();
self
}
pub fn page_token(mut self, new_value: &str) -> ActivitySearchCall<'a, C, A> {
self._page_token = Some(new_value.to_string());
self
}
pub fn order_by(mut self, new_value: &str) -> ActivitySearchCall<'a, C, A> {
self._order_by = Some(new_value.to_string());
self
}
pub fn max_results(mut self, new_value: u32) -> ActivitySearchCall<'a, C, A> {
self._max_results = Some(new_value);
self
}
pub fn language(mut self, new_value: &str) -> ActivitySearchCall<'a, C, A> {
self._language = Some(new_value.to_string());
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> ActivitySearchCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> ActivitySearchCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> ActivitySearchCall<'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
}
}
pub struct ActivityGetCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_activity_id: String,
_delegate: Option<&'a mut Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeMap<String, ()>
}
impl<'a, C, A> CallBuilder for ActivityGetCall<'a, C, A> {}
impl<'a, C, A> ActivityGetCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
pub fn doit(mut self) -> Result<(hyper::client::Response, Activity)> {
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: "plus.activities.get",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len());
params.push(("activityId", self._activity_id.to_string()));
for &field in ["alt", "activityId"].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() + "activities/{activityId}";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{activityId}", "activityId")].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 ["activityId"].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);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn activity_id(mut self, new_value: &str) -> ActivityGetCall<'a, C, A> {
self._activity_id = new_value.to_string();
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> ActivityGetCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> ActivityGetCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> ActivityGetCall<'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
}
}
pub struct ActivityListCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_user_id: String,
_collection: 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 ActivityListCall<'a, C, A> {}
impl<'a, C, A> ActivityListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
pub fn doit(mut self) -> Result<(hyper::client::Response, ActivityFeed)> {
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: "plus.activities.list",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len());
params.push(("userId", self._user_id.to_string()));
params.push(("collection", self._collection.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", "userId", "collection", "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() + "people/{userId}/activities/{collection}";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{userId}", "userId"), ("{collection}", "collection")].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(2);
for param_name in ["collection", "userId"].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);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn user_id(mut self, new_value: &str) -> ActivityListCall<'a, C, A> {
self._user_id = new_value.to_string();
self
}
pub fn collection(mut self, new_value: &str) -> ActivityListCall<'a, C, A> {
self._collection = new_value.to_string();
self
}
pub fn page_token(mut self, new_value: &str) -> ActivityListCall<'a, C, A> {
self._page_token = Some(new_value.to_string());
self
}
pub fn max_results(mut self, new_value: u32) -> ActivityListCall<'a, C, A> {
self._max_results = Some(new_value);
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> ActivityListCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> ActivityListCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> ActivityListCall<'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
}
}
pub struct CommentListCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_activity_id: String,
_sort_order: Option<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 CommentListCall<'a, C, A> {}
impl<'a, C, A> CommentListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
pub fn doit(mut self) -> Result<(hyper::client::Response, CommentFeed)> {
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: "plus.comments.list",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len());
params.push(("activityId", self._activity_id.to_string()));
if let Some(value) = self._sort_order {
params.push(("sortOrder", value.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", "activityId", "sortOrder", "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() + "activities/{activityId}/comments";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{activityId}", "activityId")].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 ["activityId"].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);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn activity_id(mut self, new_value: &str) -> CommentListCall<'a, C, A> {
self._activity_id = new_value.to_string();
self
}
pub fn sort_order(mut self, new_value: &str) -> CommentListCall<'a, C, A> {
self._sort_order = Some(new_value.to_string());
self
}
pub fn page_token(mut self, new_value: &str) -> CommentListCall<'a, C, A> {
self._page_token = Some(new_value.to_string());
self
}
pub fn max_results(mut self, new_value: u32) -> CommentListCall<'a, C, A> {
self._max_results = Some(new_value);
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> CommentListCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> CommentListCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> CommentListCall<'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
}
}
pub struct CommentGetCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_comment_id: String,
_delegate: Option<&'a mut Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeMap<String, ()>
}
impl<'a, C, A> CallBuilder for CommentGetCall<'a, C, A> {}
impl<'a, C, A> CommentGetCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
pub fn doit(mut self) -> Result<(hyper::client::Response, Comment)> {
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: "plus.comments.get",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len());
params.push(("commentId", self._comment_id.to_string()));
for &field in ["alt", "commentId"].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() + "comments/{commentId}";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{commentId}", "commentId")].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 ["commentId"].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);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn comment_id(mut self, new_value: &str) -> CommentGetCall<'a, C, A> {
self._comment_id = new_value.to_string();
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> CommentGetCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> CommentGetCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> CommentGetCall<'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
}
}
pub struct PeopleSearchCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_query: String,
_page_token: Option<String>,
_max_results: Option<u32>,
_language: Option<String>,
_delegate: Option<&'a mut Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeMap<String, ()>
}
impl<'a, C, A> CallBuilder for PeopleSearchCall<'a, C, A> {}
impl<'a, C, A> PeopleSearchCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
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: "plus.people.search",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len());
params.push(("query", self._query.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()));
}
if let Some(value) = self._language {
params.push(("language", value.to_string()));
}
for &field in ["alt", "query", "pageToken", "maxResults", "language"].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() + "people";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn query(mut self, new_value: &str) -> PeopleSearchCall<'a, C, A> {
self._query = new_value.to_string();
self
}
pub fn page_token(mut self, new_value: &str) -> PeopleSearchCall<'a, C, A> {
self._page_token = Some(new_value.to_string());
self
}
pub fn max_results(mut self, new_value: u32) -> PeopleSearchCall<'a, C, A> {
self._max_results = Some(new_value);
self
}
pub fn language(mut self, new_value: &str) -> PeopleSearchCall<'a, C, A> {
self._language = Some(new_value.to_string());
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> PeopleSearchCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> PeopleSearchCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> PeopleSearchCall<'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
}
}
pub struct PeopleListByActivityCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_activity_id: String,
_collection: 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 PeopleListByActivityCall<'a, C, A> {}
impl<'a, C, A> PeopleListByActivityCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
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: "plus.people.listByActivity",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(6 + self._additional_params.len());
params.push(("activityId", self._activity_id.to_string()));
params.push(("collection", self._collection.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", "activityId", "collection", "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() + "activities/{activityId}/people/{collection}";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{activityId}", "activityId"), ("{collection}", "collection")].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(2);
for param_name in ["collection", "activityId"].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);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn activity_id(mut self, new_value: &str) -> PeopleListByActivityCall<'a, C, A> {
self._activity_id = new_value.to_string();
self
}
pub fn collection(mut self, new_value: &str) -> PeopleListByActivityCall<'a, C, A> {
self._collection = new_value.to_string();
self
}
pub fn page_token(mut self, new_value: &str) -> PeopleListByActivityCall<'a, C, A> {
self._page_token = Some(new_value.to_string());
self
}
pub fn max_results(mut self, new_value: u32) -> PeopleListByActivityCall<'a, C, A> {
self._max_results = Some(new_value);
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> PeopleListByActivityCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> PeopleListByActivityCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> PeopleListByActivityCall<'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
}
}
pub struct PeopleListCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_user_id: String,
_collection: String,
_page_token: Option<String>,
_order_by: 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 PeopleListCall<'a, C, A> {}
impl<'a, C, A> PeopleListCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
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: "plus.people.list",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(7 + self._additional_params.len());
params.push(("userId", self._user_id.to_string()));
params.push(("collection", self._collection.to_string()));
if let Some(value) = self._page_token {
params.push(("pageToken", value.to_string()));
}
if let Some(value) = self._order_by {
params.push(("orderBy", value.to_string()));
}
if let Some(value) = self._max_results {
params.push(("maxResults", value.to_string()));
}
for &field in ["alt", "userId", "collection", "pageToken", "orderBy", "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() + "people/{userId}/people/{collection}";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{userId}", "userId"), ("{collection}", "collection")].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(2);
for param_name in ["collection", "userId"].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);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn user_id(mut self, new_value: &str) -> PeopleListCall<'a, C, A> {
self._user_id = new_value.to_string();
self
}
pub fn collection(mut self, new_value: &str) -> PeopleListCall<'a, C, A> {
self._collection = new_value.to_string();
self
}
pub fn page_token(mut self, new_value: &str) -> PeopleListCall<'a, C, A> {
self._page_token = Some(new_value.to_string());
self
}
pub fn order_by(mut self, new_value: &str) -> PeopleListCall<'a, C, A> {
self._order_by = Some(new_value.to_string());
self
}
pub fn max_results(mut self, new_value: u32) -> PeopleListCall<'a, C, A> {
self._max_results = Some(new_value);
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> PeopleListCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> PeopleListCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> PeopleListCall<'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
}
}
pub struct PeopleGetCall<'a, C, A>
where C: 'a, A: 'a {
hub: &'a Plus<C, A>,
_user_id: String,
_delegate: Option<&'a mut Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeMap<String, ()>
}
impl<'a, C, A> CallBuilder for PeopleGetCall<'a, C, A> {}
impl<'a, C, A> PeopleGetCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
pub fn doit(mut self) -> Result<(hyper::client::Response, Person)> {
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: "plus.people.get",
http_method: hyper::method::Method::Get });
let mut params: Vec<(&str, String)> = Vec::with_capacity(3 + self._additional_params.len());
params.push(("userId", self._user_id.to_string()));
for &field in ["alt", "userId"].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() + "people/{userId}";
if self._scopes.len() == 0 {
self._scopes.insert(Scope::Login.as_ref().to_string(), ());
}
for &(find_this, param_name) in [("{userId}", "userId")].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 ["userId"].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);
}
}
if params.len() > 0 {
url.push('?');
url.push_str(&url::form_urlencoded::serialize(params));
}
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)
.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)
}
}
}
}
pub fn user_id(mut self, new_value: &str) -> PeopleGetCall<'a, C, A> {
self._user_id = new_value.to_string();
self
}
pub fn delegate(mut self, new_value: &'a mut Delegate) -> PeopleGetCall<'a, C, A> {
self._delegate = Some(new_value);
self
}
pub fn param<T>(mut self, name: T, value: T) -> PeopleGetCall<'a, C, A>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
}
pub fn add_scope<T, S>(mut self, scope: T) -> PeopleGetCall<'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
}
}