google_plus1/api.rs
1#![allow(clippy::ptr_arg)]
2
3use std::collections::{BTreeSet, HashMap};
4
5use tokio::time::sleep;
6
7// ##############
8// UTILITIES ###
9// ############
10
11/// Identifies the an OAuth2 authorization scope.
12/// A scope is needed when requesting an
13/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
14#[derive(PartialEq, Eq, Ord, PartialOrd, Hash, Debug, Clone, Copy)]
15pub enum Scope {
16 /// View your basic profile info, including your age range and language
17 Login,
18
19 /// Associate you with your personal info on Google
20 Me,
21
22 /// View your email address
23 UserinfoEmail,
24
25 /// See your personal info, including any personal info you've made publicly available
26 UserinfoProfile,
27}
28
29impl AsRef<str> for Scope {
30 fn as_ref(&self) -> &str {
31 match *self {
32 Scope::Login => "https://www.googleapis.com/auth/plus.login",
33 Scope::Me => "https://www.googleapis.com/auth/plus.me",
34 Scope::UserinfoEmail => "https://www.googleapis.com/auth/userinfo.email",
35 Scope::UserinfoProfile => "https://www.googleapis.com/auth/userinfo.profile",
36 }
37 }
38}
39
40#[allow(clippy::derivable_impls)]
41impl Default for Scope {
42 fn default() -> Scope {
43 Scope::Me
44 }
45}
46
47// ########
48// HUB ###
49// ######
50
51/// Central instance to access all Plus related resource activities
52///
53/// # Examples
54///
55/// Instantiate a new hub
56///
57/// ```test_harness,no_run
58/// extern crate hyper;
59/// extern crate hyper_rustls;
60/// extern crate google_plus1 as plus1;
61/// use plus1::{Result, Error};
62/// # async fn dox() {
63/// use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
64///
65/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
66/// // `client_secret`, among other things.
67/// let secret: yup_oauth2::ApplicationSecret = Default::default();
68/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
69/// // unless you replace `None` with the desired Flow.
70/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
71/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
72/// // retrieve them from storage.
73/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
74/// secret,
75/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
76/// ).build().await.unwrap();
77///
78/// let client = hyper_util::client::legacy::Client::builder(
79/// hyper_util::rt::TokioExecutor::new()
80/// )
81/// .build(
82/// hyper_rustls::HttpsConnectorBuilder::new()
83/// .with_native_roots()
84/// .unwrap()
85/// .https_or_http()
86/// .enable_http1()
87/// .build()
88/// );
89/// let mut hub = Plus::new(client, auth);
90/// // You can configure optional parameters by calling the respective setters at will, and
91/// // execute the final call using `doit()`.
92/// // Values shown here are possibly random and not representative !
93/// let result = hub.people().list("userId", "collection")
94/// .page_token("ipsum")
95/// .order_by("gubergren")
96/// .max_results(50)
97/// .doit().await;
98///
99/// match result {
100/// Err(e) => match e {
101/// // The Error enum provides details about what exactly happened.
102/// // You can also just use its `Debug`, `Display` or `Error` traits
103/// Error::HttpError(_)
104/// |Error::Io(_)
105/// |Error::MissingAPIKey
106/// |Error::MissingToken(_)
107/// |Error::Cancelled
108/// |Error::UploadSizeLimitExceeded(_, _)
109/// |Error::Failure(_)
110/// |Error::BadRequest(_)
111/// |Error::FieldClash(_)
112/// |Error::JsonDecodeError(_, _) => println!("{}", e),
113/// },
114/// Ok(res) => println!("Success: {:?}", res),
115/// }
116/// # }
117/// ```
118#[derive(Clone)]
119pub struct Plus<C> {
120 pub client: common::Client<C>,
121 pub auth: Box<dyn common::GetToken>,
122 _user_agent: String,
123 _base_url: String,
124 _root_url: String,
125}
126
127impl<C> common::Hub for Plus<C> {}
128
129impl<'a, C> Plus<C> {
130 pub fn new<A: 'static + common::GetToken>(client: common::Client<C>, auth: A) -> Plus<C> {
131 Plus {
132 client,
133 auth: Box::new(auth),
134 _user_agent: "google-api-rust-client/6.0.0".to_string(),
135 _base_url: "https://www.googleapis.com/plus/v1/".to_string(),
136 _root_url: "https://www.googleapis.com/".to_string(),
137 }
138 }
139
140 pub fn activities(&'a self) -> ActivityMethods<'a, C> {
141 ActivityMethods { hub: self }
142 }
143 pub fn comments(&'a self) -> CommentMethods<'a, C> {
144 CommentMethods { hub: self }
145 }
146 pub fn people(&'a self) -> PersonMethods<'a, C> {
147 PersonMethods { hub: self }
148 }
149
150 /// Set the user-agent header field to use in all requests to the server.
151 /// It defaults to `google-api-rust-client/6.0.0`.
152 ///
153 /// Returns the previously set user-agent.
154 pub fn user_agent(&mut self, agent_name: String) -> String {
155 std::mem::replace(&mut self._user_agent, agent_name)
156 }
157
158 /// Set the base url to use in all requests to the server.
159 /// It defaults to `https://www.googleapis.com/plus/v1/`.
160 ///
161 /// Returns the previously set base url.
162 pub fn base_url(&mut self, new_base_url: String) -> String {
163 std::mem::replace(&mut self._base_url, new_base_url)
164 }
165
166 /// Set the root url to use in all requests to the server.
167 /// It defaults to `https://www.googleapis.com/`.
168 ///
169 /// Returns the previously set root url.
170 pub fn root_url(&mut self, new_root_url: String) -> String {
171 std::mem::replace(&mut self._root_url, new_root_url)
172 }
173}
174
175// ############
176// SCHEMAS ###
177// ##########
178/// There is no detailed description.
179///
180/// This type is not used in any activity, and only used as *part* of another schema.
181///
182#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
183#[serde_with::serde_as]
184#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
185pub struct Acl {
186 /// Description of the access granted, suitable for display.
187 pub description: Option<String>,
188 /// The list of access entries.
189 pub items: Option<Vec<PlusAclentryResource>>,
190 /// Identifies this resource as a collection of access controls. Value: "plus#acl".
191 pub kind: Option<String>,
192}
193
194impl common::Part for Acl {}
195
196/// There is no detailed description.
197///
198/// # Activities
199///
200/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
201/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
202///
203/// * [get activities](ActivityGetCall) (response)
204#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
205#[serde_with::serde_as]
206#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
207pub struct Activity {
208 /// Identifies who has access to see this activity.
209 pub access: Option<Acl>,
210 /// The person who performed this activity.
211 pub actor: Option<ActivityActor>,
212 /// Street address where this activity occurred.
213 pub address: Option<String>,
214 /// Additional content added by the person who shared this activity, applicable only when resharing an activity.
215 pub annotation: Option<String>,
216 /// If this activity is a crosspost from another system, this property specifies the ID of the original activity.
217 #[serde(rename = "crosspostSource")]
218 pub crosspost_source: Option<String>,
219 /// ETag of this response for caching purposes.
220 pub etag: Option<String>,
221 /// Latitude and longitude where this activity occurred. Format is latitude followed by longitude, space separated.
222 pub geocode: Option<String>,
223 /// The ID of this activity.
224 pub id: Option<String>,
225 /// Identifies this resource as an activity. Value: "plus#activity".
226 pub kind: Option<String>,
227 /// The location where this activity occurred.
228 pub location: Option<Place>,
229 /// The object of this activity.
230 pub object: Option<ActivityObject>,
231 /// ID of the place where this activity occurred.
232 #[serde(rename = "placeId")]
233 pub place_id: Option<String>,
234 /// Name of the place where this activity occurred.
235 #[serde(rename = "placeName")]
236 pub place_name: Option<String>,
237 /// The service provider that initially published this activity.
238 pub provider: Option<ActivityProvider>,
239 /// The time at which this activity was initially published. Formatted as an RFC 3339 timestamp.
240 pub published: Option<chrono::DateTime<chrono::offset::Utc>>,
241 /// Radius, in meters, of the region where this activity occurred, centered at the latitude and longitude identified in geocode.
242 pub radius: Option<String>,
243 /// Title of this activity.
244 pub title: Option<String>,
245 /// The time at which this activity was last updated. Formatted as an RFC 3339 timestamp.
246 pub updated: Option<chrono::DateTime<chrono::offset::Utc>>,
247 /// The link to this activity.
248 pub url: Option<String>,
249 /// This activity's verb, which indicates the action that was performed. Possible values include, but are not limited to, the following values:
250 /// - "post" - Publish content to the stream.
251 /// - "share" - Reshare an activity.
252 pub verb: Option<String>,
253}
254
255impl common::ResponseResult for Activity {}
256
257/// There is no detailed description.
258///
259/// # Activities
260///
261/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
262/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
263///
264/// * [list activities](ActivityListCall) (response)
265/// * [search activities](ActivitySearchCall) (response)
266#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
267#[serde_with::serde_as]
268#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
269pub struct ActivityFeed {
270 /// ETag of this response for caching purposes.
271 pub etag: Option<String>,
272 /// The ID of this collection of activities. Deprecated.
273 pub id: Option<String>,
274 /// The activities in this page of results.
275 pub items: Option<Vec<Activity>>,
276 /// Identifies this resource as a collection of activities. Value: "plus#activityFeed".
277 pub kind: Option<String>,
278 /// Link to the next page of activities.
279 #[serde(rename = "nextLink")]
280 pub next_link: Option<String>,
281 /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
282 #[serde(rename = "nextPageToken")]
283 pub next_page_token: Option<String>,
284 /// Link to this activity resource.
285 #[serde(rename = "selfLink")]
286 pub self_link: Option<String>,
287 /// The title of this collection of activities, which is a truncated portion of the content.
288 pub title: Option<String>,
289 /// The time at which this collection of activities was last updated. Formatted as an RFC 3339 timestamp.
290 pub updated: Option<chrono::DateTime<chrono::offset::Utc>>,
291}
292
293impl common::ResponseResult for ActivityFeed {}
294
295/// There is no detailed description.
296///
297/// # Activities
298///
299/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
300/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
301///
302/// * [get comments](CommentGetCall) (response)
303/// * [list comments](CommentListCall) (none)
304#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
305#[serde_with::serde_as]
306#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
307pub struct Comment {
308 /// The person who posted this comment.
309 pub actor: Option<CommentActor>,
310 /// ETag of this response for caching purposes.
311 pub etag: Option<String>,
312 /// The ID of this comment.
313 pub id: Option<String>,
314 /// The activity this comment replied to.
315 #[serde(rename = "inReplyTo")]
316 pub in_reply_to: Option<Vec<CommentInReplyTo>>,
317 /// Identifies this resource as a comment. Value: "plus#comment".
318 pub kind: Option<String>,
319 /// The object of this comment.
320 pub object: Option<CommentObject>,
321 /// People who +1'd this comment.
322 pub plusoners: Option<CommentPlusoners>,
323 /// The time at which this comment was initially published. Formatted as an RFC 3339 timestamp.
324 pub published: Option<chrono::DateTime<chrono::offset::Utc>>,
325 /// Link to this comment resource.
326 #[serde(rename = "selfLink")]
327 pub self_link: Option<String>,
328 /// The time at which this comment was last updated. Formatted as an RFC 3339 timestamp.
329 pub updated: Option<chrono::DateTime<chrono::offset::Utc>>,
330 /// This comment's verb, indicating what action was performed. Possible values are:
331 /// - "post" - Publish content to the stream.
332 pub verb: Option<String>,
333}
334
335impl common::Resource for Comment {}
336impl common::ResponseResult for Comment {}
337
338/// There is no detailed description.
339///
340/// # Activities
341///
342/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
343/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
344///
345/// * [list comments](CommentListCall) (response)
346#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
347#[serde_with::serde_as]
348#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
349pub struct CommentFeed {
350 /// ETag of this response for caching purposes.
351 pub etag: Option<String>,
352 /// The ID of this collection of comments.
353 pub id: Option<String>,
354 /// The comments in this page of results.
355 pub items: Option<Vec<Comment>>,
356 /// Identifies this resource as a collection of comments. Value: "plus#commentFeed".
357 pub kind: Option<String>,
358 /// Link to the next page of activities.
359 #[serde(rename = "nextLink")]
360 pub next_link: Option<String>,
361 /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
362 #[serde(rename = "nextPageToken")]
363 pub next_page_token: Option<String>,
364 /// The title of this collection of comments.
365 pub title: Option<String>,
366 /// The time at which this collection of comments was last updated. Formatted as an RFC 3339 timestamp.
367 pub updated: Option<chrono::DateTime<chrono::offset::Utc>>,
368}
369
370impl common::ResponseResult for CommentFeed {}
371
372/// There is no detailed description.
373///
374/// # Activities
375///
376/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
377/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
378///
379/// * [list people](PersonListCall) (response)
380/// * [list by activity people](PersonListByActivityCall) (response)
381/// * [search people](PersonSearchCall) (response)
382#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
383#[serde_with::serde_as]
384#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
385pub struct PeopleFeed {
386 /// ETag of this response for caching purposes.
387 pub etag: Option<String>,
388 /// The people in this page of results. Each item includes the id, displayName, image, and url for the person. To retrieve additional profile data, see the people.get method.
389 pub items: Option<Vec<Person>>,
390 /// Identifies this resource as a collection of people. Value: "plus#peopleFeed".
391 pub kind: Option<String>,
392 /// The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results.
393 #[serde(rename = "nextPageToken")]
394 pub next_page_token: Option<String>,
395 /// Link to this resource.
396 #[serde(rename = "selfLink")]
397 pub self_link: Option<String>,
398 /// The title of this collection of people.
399 pub title: Option<String>,
400 /// The total number of people available in this list. The number of people in a response might be smaller due to paging. This might not be set for all collections.
401 #[serde(rename = "totalItems")]
402 pub total_items: Option<i32>,
403}
404
405impl common::ResponseResult for PeopleFeed {}
406
407/// There is no detailed description.
408///
409/// # Activities
410///
411/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
412/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
413///
414/// * [get people](PersonGetCall) (response)
415#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
416#[serde_with::serde_as]
417#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
418pub struct Person {
419 /// A short biography for this person.
420 #[serde(rename = "aboutMe")]
421 pub about_me: Option<String>,
422 /// The age range of the person. Valid ranges are 17 or younger, 18 to 20, and 21 or older. Age is determined from the user's birthday using Western age reckoning.
423 #[serde(rename = "ageRange")]
424 pub age_range: Option<PersonAgeRange>,
425 /// The person's date of birth, represented as YYYY-MM-DD.
426 pub birthday: Option<String>,
427 /// The "bragging rights" line of this person.
428 #[serde(rename = "braggingRights")]
429 pub bragging_rights: Option<String>,
430 /// For followers who are visible, the number of people who have added this person or page to a circle.
431 #[serde(rename = "circledByCount")]
432 pub circled_by_count: Option<i32>,
433 /// The cover photo content.
434 pub cover: Option<PersonCover>,
435 /// (this field is not currently used)
436 #[serde(rename = "currentLocation")]
437 pub current_location: Option<String>,
438 /// The name of this person, which is suitable for display.
439 #[serde(rename = "displayName")]
440 pub display_name: Option<String>,
441 /// The hosted domain name for the user's Google Apps account. For instance, example.com. The plus.profile.emails.read or email scope is needed to get this domain name.
442 pub domain: Option<String>,
443 /// A list of email addresses that this person has, including their Google account email address, and the public verified email addresses on their Google+ profile. The plus.profile.emails.read scope is needed to retrieve these email addresses, or the email scope can be used to retrieve just the Google account email address.
444 pub emails: Option<Vec<PersonEmails>>,
445 /// ETag of this response for caching purposes.
446 pub etag: Option<String>,
447 /// The person's gender. Possible values include, but are not limited to, the following values:
448 /// - "male" - Male gender.
449 /// - "female" - Female gender.
450 /// - "other" - Other.
451 pub gender: Option<String>,
452 /// The ID of this person.
453 pub id: Option<String>,
454 /// The representation of the person's profile photo.
455 pub image: Option<PersonImage>,
456 /// Whether this user has signed up for Google+.
457 #[serde(rename = "isPlusUser")]
458 pub is_plus_user: Option<bool>,
459 /// Identifies this resource as a person. Value: "plus#person".
460 pub kind: Option<String>,
461 /// The user's preferred language for rendering.
462 pub language: Option<String>,
463 /// An object representation of the individual components of a person's name.
464 pub name: Option<PersonName>,
465 /// The nickname of this person.
466 pub nickname: Option<String>,
467 /// Type of person within Google+. Possible values include, but are not limited to, the following values:
468 /// - "person" - represents an actual person.
469 /// - "page" - represents a page.
470 #[serde(rename = "objectType")]
471 pub object_type: Option<String>,
472 /// The occupation of this person.
473 pub occupation: Option<String>,
474 /// A list of current or past organizations with which this person is associated.
475 pub organizations: Option<Vec<PersonOrganizations>>,
476 /// A list of places where this person has lived.
477 #[serde(rename = "placesLived")]
478 pub places_lived: Option<Vec<PersonPlacesLived>>,
479 /// If a Google+ Page, the number of people who have +1'd this page.
480 #[serde(rename = "plusOneCount")]
481 pub plus_one_count: Option<i32>,
482 /// The person's relationship status. Possible values include, but are not limited to, the following values:
483 /// - "single" - Person is single.
484 /// - "in_a_relationship" - Person is in a relationship.
485 /// - "engaged" - Person is engaged.
486 /// - "married" - Person is married.
487 /// - "its_complicated" - The relationship is complicated.
488 /// - "open_relationship" - Person is in an open relationship.
489 /// - "widowed" - Person is widowed.
490 /// - "in_domestic_partnership" - Person is in a domestic partnership.
491 /// - "in_civil_union" - Person is in a civil union.
492 #[serde(rename = "relationshipStatus")]
493 pub relationship_status: Option<String>,
494 /// The person's skills.
495 pub skills: Option<String>,
496 /// The brief description (tagline) of this person.
497 pub tagline: Option<String>,
498 /// The URL of this person's profile.
499 pub url: Option<String>,
500 /// A list of URLs for this person.
501 pub urls: Option<Vec<PersonUrls>>,
502 /// Whether the person or Google+ Page has been verified.
503 pub verified: Option<bool>,
504}
505
506impl common::ResponseResult for Person {}
507
508/// There is no detailed description.
509///
510/// This type is not used in any activity, and only used as *part* of another schema.
511///
512#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
513#[serde_with::serde_as]
514#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
515pub struct Place {
516 /// The physical address of the place.
517 pub address: Option<PlaceAddress>,
518 /// The display name of the place.
519 #[serde(rename = "displayName")]
520 pub display_name: Option<String>,
521 /// The id of the place.
522 pub id: Option<String>,
523 /// Identifies this resource as a place. Value: "plus#place".
524 pub kind: Option<String>,
525 /// The position of the place.
526 pub position: Option<PlacePosition>,
527}
528
529impl common::Part for Place {}
530
531/// There is no detailed description.
532///
533/// This type is not used in any activity, and only used as *part* of another schema.
534///
535#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
536#[serde_with::serde_as]
537#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
538pub struct PlusAclentryResource {
539 /// A descriptive name for this entry. Suitable for display.
540 #[serde(rename = "displayName")]
541 pub display_name: Option<String>,
542 /// The ID of the entry. For entries of type "person" or "circle", this is the ID of the resource. For other types, this property is not set.
543 pub id: Option<String>,
544 /// The type of entry describing to whom access is granted. Possible values are:
545 /// - "person" - Access to an individual.
546 /// - "circle" - Access to members of a circle.
547 /// - "myCircles" - Access to members of all the person's circles.
548 /// - "extendedCircles" - Access to members of all the person's circles, plus all of the people in their circles.
549 /// - "domain" - Access to members of the person's Google Apps domain.
550 /// - "public" - Access to anyone on the web.
551 #[serde(rename = "type")]
552 pub type_: Option<String>,
553}
554
555impl common::Part for PlusAclentryResource {}
556
557/// The person who performed this activity.
558///
559/// This type is not used in any activity, and only used as *part* of another schema.
560///
561#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
562#[serde_with::serde_as]
563#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
564pub struct ActivityActor {
565 /// Actor info specific to particular clients.
566 #[serde(rename = "clientSpecificActorInfo")]
567 pub client_specific_actor_info: Option<ActivityActorClientSpecificActorInfo>,
568 /// The name of the actor, suitable for display.
569 #[serde(rename = "displayName")]
570 pub display_name: Option<String>,
571 /// The ID of the actor's Person resource.
572 pub id: Option<String>,
573 /// The image representation of the actor.
574 pub image: Option<ActivityActorImage>,
575 /// An object representation of the individual components of name.
576 pub name: Option<ActivityActorName>,
577 /// The link to the actor's Google profile.
578 pub url: Option<String>,
579 /// Verification status of actor.
580 pub verification: Option<ActivityActorVerification>,
581}
582
583impl common::NestedType for ActivityActor {}
584impl common::Part for ActivityActor {}
585
586/// Actor info specific to particular clients.
587///
588/// This type is not used in any activity, and only used as *part* of another schema.
589///
590#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
591#[serde_with::serde_as]
592#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
593pub struct ActivityActorClientSpecificActorInfo {
594 /// Actor info specific to YouTube clients.
595 #[serde(rename = "youtubeActorInfo")]
596 pub youtube_actor_info: Option<ActivityActorClientSpecificActorInfoYoutubeActorInfo>,
597}
598
599impl common::NestedType for ActivityActorClientSpecificActorInfo {}
600impl common::Part for ActivityActorClientSpecificActorInfo {}
601
602/// Actor info specific to YouTube clients.
603///
604/// This type is not used in any activity, and only used as *part* of another schema.
605///
606#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
607#[serde_with::serde_as]
608#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
609pub struct ActivityActorClientSpecificActorInfoYoutubeActorInfo {
610 /// ID of the YouTube channel owned by the Actor.
611 #[serde(rename = "channelId")]
612 pub channel_id: Option<String>,
613}
614
615impl common::NestedType for ActivityActorClientSpecificActorInfoYoutubeActorInfo {}
616impl common::Part for ActivityActorClientSpecificActorInfoYoutubeActorInfo {}
617
618/// The image representation of the actor.
619///
620/// This type is not used in any activity, and only used as *part* of another schema.
621///
622#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
623#[serde_with::serde_as]
624#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
625pub struct ActivityActorImage {
626 /// The URL of the actor's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side.
627 pub url: Option<String>,
628}
629
630impl common::NestedType for ActivityActorImage {}
631impl common::Part for ActivityActorImage {}
632
633/// An object representation of the individual components of name.
634///
635/// This type is not used in any activity, and only used as *part* of another schema.
636///
637#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
638#[serde_with::serde_as]
639#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
640pub struct ActivityActorName {
641 /// The family name ("last name") of the actor.
642 #[serde(rename = "familyName")]
643 pub family_name: Option<String>,
644 /// The given name ("first name") of the actor.
645 #[serde(rename = "givenName")]
646 pub given_name: Option<String>,
647}
648
649impl common::NestedType for ActivityActorName {}
650impl common::Part for ActivityActorName {}
651
652/// Verification status of actor.
653///
654/// This type is not used in any activity, and only used as *part* of another schema.
655///
656#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
657#[serde_with::serde_as]
658#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
659pub struct ActivityActorVerification {
660 /// Verification for one-time or manual processes.
661 #[serde(rename = "adHocVerified")]
662 pub ad_hoc_verified: Option<String>,
663}
664
665impl common::NestedType for ActivityActorVerification {}
666impl common::Part for ActivityActorVerification {}
667
668/// The object of this activity.
669///
670/// This type is not used in any activity, and only used as *part* of another schema.
671///
672#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
673#[serde_with::serde_as]
674#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
675pub struct ActivityObject {
676 /// If this activity's object is itself another activity, such as when a person reshares an activity, this property specifies the original activity's actor.
677 pub actor: Option<ActivityObjectActor>,
678 /// The media objects attached to this activity.
679 pub attachments: Option<Vec<ActivityObjectAttachments>>,
680 /// The HTML-formatted content, which is suitable for display.
681 pub content: Option<String>,
682 /// The ID of the object. When resharing an activity, this is the ID of the activity that is being reshared.
683 pub id: Option<String>,
684 /// The type of the object. Possible values include, but are not limited to, the following values:
685 /// - "note" - Textual content.
686 /// - "activity" - A Google+ activity.
687 #[serde(rename = "objectType")]
688 pub object_type: Option<String>,
689 /// The content (text) as provided by the author, which is stored without any HTML formatting. When creating or updating an activity, this value must be supplied as plain text in the request.
690 #[serde(rename = "originalContent")]
691 pub original_content: Option<String>,
692 /// People who +1'd this activity.
693 pub plusoners: Option<ActivityObjectPlusoners>,
694 /// Comments in reply to this activity.
695 pub replies: Option<ActivityObjectReplies>,
696 /// People who reshared this activity.
697 pub resharers: Option<ActivityObjectResharers>,
698 /// The URL that points to the linked resource.
699 pub url: Option<String>,
700}
701
702impl common::NestedType for ActivityObject {}
703impl common::Part for ActivityObject {}
704
705/// If this activity's object is itself another activity, such as when a person reshares an activity, this property specifies the original activity's actor.
706///
707/// This type is not used in any activity, and only used as *part* of another schema.
708///
709#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
710#[serde_with::serde_as]
711#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
712pub struct ActivityObjectActor {
713 /// Actor info specific to particular clients.
714 #[serde(rename = "clientSpecificActorInfo")]
715 pub client_specific_actor_info: Option<ActivityObjectActorClientSpecificActorInfo>,
716 /// The original actor's name, which is suitable for display.
717 #[serde(rename = "displayName")]
718 pub display_name: Option<String>,
719 /// ID of the original actor.
720 pub id: Option<String>,
721 /// The image representation of the original actor.
722 pub image: Option<ActivityObjectActorImage>,
723 /// A link to the original actor's Google profile.
724 pub url: Option<String>,
725 /// Verification status of actor.
726 pub verification: Option<ActivityObjectActorVerification>,
727}
728
729impl common::NestedType for ActivityObjectActor {}
730impl common::Part for ActivityObjectActor {}
731
732/// Actor info specific to particular clients.
733///
734/// This type is not used in any activity, and only used as *part* of another schema.
735///
736#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
737#[serde_with::serde_as]
738#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
739pub struct ActivityObjectActorClientSpecificActorInfo {
740 /// Actor info specific to YouTube clients.
741 #[serde(rename = "youtubeActorInfo")]
742 pub youtube_actor_info: Option<ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo>,
743}
744
745impl common::NestedType for ActivityObjectActorClientSpecificActorInfo {}
746impl common::Part for ActivityObjectActorClientSpecificActorInfo {}
747
748/// Actor info specific to YouTube clients.
749///
750/// This type is not used in any activity, and only used as *part* of another schema.
751///
752#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
753#[serde_with::serde_as]
754#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
755pub struct ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo {
756 /// ID of the YouTube channel owned by the Actor.
757 #[serde(rename = "channelId")]
758 pub channel_id: Option<String>,
759}
760
761impl common::NestedType for ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo {}
762impl common::Part for ActivityObjectActorClientSpecificActorInfoYoutubeActorInfo {}
763
764/// The image representation of the original actor.
765///
766/// This type is not used in any activity, and only used as *part* of another schema.
767///
768#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
769#[serde_with::serde_as]
770#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
771pub struct ActivityObjectActorImage {
772 /// A URL that points to a thumbnail photo of the original actor.
773 pub url: Option<String>,
774}
775
776impl common::NestedType for ActivityObjectActorImage {}
777impl common::Part for ActivityObjectActorImage {}
778
779/// Verification status of actor.
780///
781/// This type is not used in any activity, and only used as *part* of another schema.
782///
783#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
784#[serde_with::serde_as]
785#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
786pub struct ActivityObjectActorVerification {
787 /// Verification for one-time or manual processes.
788 #[serde(rename = "adHocVerified")]
789 pub ad_hoc_verified: Option<String>,
790}
791
792impl common::NestedType for ActivityObjectActorVerification {}
793impl common::Part for ActivityObjectActorVerification {}
794
795/// The media objects attached to this activity.
796///
797/// This type is not used in any activity, and only used as *part* of another schema.
798///
799#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
800#[serde_with::serde_as]
801#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
802pub struct ActivityObjectAttachments {
803 /// If the attachment is an article, this property contains a snippet of text from the article. It can also include descriptions for other types.
804 pub content: Option<String>,
805 /// The title of the attachment, such as a photo caption or an article title.
806 #[serde(rename = "displayName")]
807 pub display_name: Option<String>,
808 /// If the attachment is a video, the embeddable link.
809 pub embed: Option<ActivityObjectAttachmentsEmbed>,
810 /// The full image URL for photo attachments.
811 #[serde(rename = "fullImage")]
812 pub full_image: Option<ActivityObjectAttachmentsFullImage>,
813 /// The ID of the attachment.
814 pub id: Option<String>,
815 /// The preview image for photos or videos.
816 pub image: Option<ActivityObjectAttachmentsImage>,
817 /// The type of media object. Possible values include, but are not limited to, the following values:
818 /// - "photo" - A photo.
819 /// - "album" - A photo album.
820 /// - "video" - A video.
821 /// - "article" - An article, specified by a link.
822 #[serde(rename = "objectType")]
823 pub object_type: Option<String>,
824 /// If the attachment is an album, this property is a list of potential additional thumbnails from the album.
825 pub thumbnails: Option<Vec<ActivityObjectAttachmentsThumbnails>>,
826 /// The link to the attachment, which should be of type text/html.
827 pub url: Option<String>,
828}
829
830impl common::NestedType for ActivityObjectAttachments {}
831impl common::Part for ActivityObjectAttachments {}
832
833/// If the attachment is a video, the embeddable link.
834///
835/// This type is not used in any activity, and only used as *part* of another schema.
836///
837#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
838#[serde_with::serde_as]
839#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
840pub struct ActivityObjectAttachmentsEmbed {
841 /// Media type of the link.
842 #[serde(rename = "type")]
843 pub type_: Option<String>,
844 /// URL of the link.
845 pub url: Option<String>,
846}
847
848impl common::NestedType for ActivityObjectAttachmentsEmbed {}
849impl common::Part for ActivityObjectAttachmentsEmbed {}
850
851/// The full image URL for photo attachments.
852///
853/// This type is not used in any activity, and only used as *part* of another schema.
854///
855#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
856#[serde_with::serde_as]
857#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
858pub struct ActivityObjectAttachmentsFullImage {
859 /// The height, in pixels, of the linked resource.
860 pub height: Option<u32>,
861 /// Media type of the link.
862 #[serde(rename = "type")]
863 pub type_: Option<String>,
864 /// URL of the image.
865 pub url: Option<String>,
866 /// The width, in pixels, of the linked resource.
867 pub width: Option<u32>,
868}
869
870impl common::NestedType for ActivityObjectAttachmentsFullImage {}
871impl common::Part for ActivityObjectAttachmentsFullImage {}
872
873/// The preview image for photos or videos.
874///
875/// This type is not used in any activity, and only used as *part* of another schema.
876///
877#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
878#[serde_with::serde_as]
879#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
880pub struct ActivityObjectAttachmentsImage {
881 /// The height, in pixels, of the linked resource.
882 pub height: Option<u32>,
883 /// Media type of the link.
884 #[serde(rename = "type")]
885 pub type_: Option<String>,
886 /// Image URL.
887 pub url: Option<String>,
888 /// The width, in pixels, of the linked resource.
889 pub width: Option<u32>,
890}
891
892impl common::NestedType for ActivityObjectAttachmentsImage {}
893impl common::Part for ActivityObjectAttachmentsImage {}
894
895/// If the attachment is an album, this property is a list of potential additional thumbnails from the album.
896///
897/// This type is not used in any activity, and only used as *part* of another schema.
898///
899#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
900#[serde_with::serde_as]
901#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
902pub struct ActivityObjectAttachmentsThumbnails {
903 /// Potential name of the thumbnail.
904 pub description: Option<String>,
905 /// Image resource.
906 pub image: Option<ActivityObjectAttachmentsThumbnailsImage>,
907 /// URL of the webpage containing the image.
908 pub url: Option<String>,
909}
910
911impl common::NestedType for ActivityObjectAttachmentsThumbnails {}
912impl common::Part for ActivityObjectAttachmentsThumbnails {}
913
914/// Image resource.
915///
916/// This type is not used in any activity, and only used as *part* of another schema.
917///
918#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
919#[serde_with::serde_as]
920#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
921pub struct ActivityObjectAttachmentsThumbnailsImage {
922 /// The height, in pixels, of the linked resource.
923 pub height: Option<u32>,
924 /// Media type of the link.
925 #[serde(rename = "type")]
926 pub type_: Option<String>,
927 /// Image url.
928 pub url: Option<String>,
929 /// The width, in pixels, of the linked resource.
930 pub width: Option<u32>,
931}
932
933impl common::NestedType for ActivityObjectAttachmentsThumbnailsImage {}
934impl common::Part for ActivityObjectAttachmentsThumbnailsImage {}
935
936/// People who +1'd this activity.
937///
938/// This type is not used in any activity, and only used as *part* of another schema.
939///
940#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
941#[serde_with::serde_as]
942#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
943pub struct ActivityObjectPlusoners {
944 /// The URL for the collection of people who +1'd this activity.
945 #[serde(rename = "selfLink")]
946 pub self_link: Option<String>,
947 /// Total number of people who +1'd this activity.
948 #[serde(rename = "totalItems")]
949 pub total_items: Option<u32>,
950}
951
952impl common::NestedType for ActivityObjectPlusoners {}
953impl common::Part for ActivityObjectPlusoners {}
954
955/// Comments in reply to this activity.
956///
957/// This type is not used in any activity, and only used as *part* of another schema.
958///
959#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
960#[serde_with::serde_as]
961#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
962pub struct ActivityObjectReplies {
963 /// The URL for the collection of comments in reply to this activity.
964 #[serde(rename = "selfLink")]
965 pub self_link: Option<String>,
966 /// Total number of comments on this activity.
967 #[serde(rename = "totalItems")]
968 pub total_items: Option<u32>,
969}
970
971impl common::NestedType for ActivityObjectReplies {}
972impl common::Part for ActivityObjectReplies {}
973
974/// People who reshared this activity.
975///
976/// This type is not used in any activity, and only used as *part* of another schema.
977///
978#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
979#[serde_with::serde_as]
980#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
981pub struct ActivityObjectResharers {
982 /// The URL for the collection of resharers.
983 #[serde(rename = "selfLink")]
984 pub self_link: Option<String>,
985 /// Total number of people who reshared this activity.
986 #[serde(rename = "totalItems")]
987 pub total_items: Option<u32>,
988}
989
990impl common::NestedType for ActivityObjectResharers {}
991impl common::Part for ActivityObjectResharers {}
992
993/// The service provider that initially published this activity.
994///
995/// This type is not used in any activity, and only used as *part* of another schema.
996///
997#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
998#[serde_with::serde_as]
999#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1000pub struct ActivityProvider {
1001 /// Name of the service provider.
1002 pub title: Option<String>,
1003}
1004
1005impl common::NestedType for ActivityProvider {}
1006impl common::Part for ActivityProvider {}
1007
1008/// The person who posted this comment.
1009///
1010/// This type is not used in any activity, and only used as *part* of another schema.
1011///
1012#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1013#[serde_with::serde_as]
1014#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1015pub struct CommentActor {
1016 /// Actor info specific to particular clients.
1017 #[serde(rename = "clientSpecificActorInfo")]
1018 pub client_specific_actor_info: Option<CommentActorClientSpecificActorInfo>,
1019 /// The name of this actor, suitable for display.
1020 #[serde(rename = "displayName")]
1021 pub display_name: Option<String>,
1022 /// The ID of the actor.
1023 pub id: Option<String>,
1024 /// The image representation of this actor.
1025 pub image: Option<CommentActorImage>,
1026 /// A link to the Person resource for this actor.
1027 pub url: Option<String>,
1028 /// Verification status of actor.
1029 pub verification: Option<CommentActorVerification>,
1030}
1031
1032impl common::NestedType for CommentActor {}
1033impl common::Part for CommentActor {}
1034
1035/// Actor info specific to particular clients.
1036///
1037/// This type is not used in any activity, and only used as *part* of another schema.
1038///
1039#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1040#[serde_with::serde_as]
1041#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1042pub struct CommentActorClientSpecificActorInfo {
1043 /// Actor info specific to YouTube clients.
1044 #[serde(rename = "youtubeActorInfo")]
1045 pub youtube_actor_info: Option<CommentActorClientSpecificActorInfoYoutubeActorInfo>,
1046}
1047
1048impl common::NestedType for CommentActorClientSpecificActorInfo {}
1049impl common::Part for CommentActorClientSpecificActorInfo {}
1050
1051/// Actor info specific to YouTube clients.
1052///
1053/// This type is not used in any activity, and only used as *part* of another schema.
1054///
1055#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1056#[serde_with::serde_as]
1057#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1058pub struct CommentActorClientSpecificActorInfoYoutubeActorInfo {
1059 /// ID of the YouTube channel owned by the Actor.
1060 #[serde(rename = "channelId")]
1061 pub channel_id: Option<String>,
1062}
1063
1064impl common::NestedType for CommentActorClientSpecificActorInfoYoutubeActorInfo {}
1065impl common::Part for CommentActorClientSpecificActorInfoYoutubeActorInfo {}
1066
1067/// The image representation of this actor.
1068///
1069/// This type is not used in any activity, and only used as *part* of another schema.
1070///
1071#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1072#[serde_with::serde_as]
1073#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1074pub struct CommentActorImage {
1075 /// The URL of the actor's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side.
1076 pub url: Option<String>,
1077}
1078
1079impl common::NestedType for CommentActorImage {}
1080impl common::Part for CommentActorImage {}
1081
1082/// Verification status of actor.
1083///
1084/// This type is not used in any activity, and only used as *part* of another schema.
1085///
1086#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1087#[serde_with::serde_as]
1088#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1089pub struct CommentActorVerification {
1090 /// Verification for one-time or manual processes.
1091 #[serde(rename = "adHocVerified")]
1092 pub ad_hoc_verified: Option<String>,
1093}
1094
1095impl common::NestedType for CommentActorVerification {}
1096impl common::Part for CommentActorVerification {}
1097
1098/// The activity this comment replied to.
1099///
1100/// This type is not used in any activity, and only used as *part* of another schema.
1101///
1102#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1103#[serde_with::serde_as]
1104#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1105pub struct CommentInReplyTo {
1106 /// The ID of the activity.
1107 pub id: Option<String>,
1108 /// The URL of the activity.
1109 pub url: Option<String>,
1110}
1111
1112impl common::NestedType for CommentInReplyTo {}
1113impl common::Part for CommentInReplyTo {}
1114
1115/// The object of this comment.
1116///
1117/// This type is not used in any activity, and only used as *part* of another schema.
1118///
1119#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1120#[serde_with::serde_as]
1121#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1122pub struct CommentObject {
1123 /// The HTML-formatted content, suitable for display.
1124 pub content: Option<String>,
1125 /// The object type of this comment. Possible values are:
1126 /// - "comment" - A comment in reply to an activity.
1127 #[serde(rename = "objectType")]
1128 pub object_type: Option<String>,
1129 /// The content (text) as provided by the author, stored without any HTML formatting. When creating or updating a comment, this value must be supplied as plain text in the request.
1130 #[serde(rename = "originalContent")]
1131 pub original_content: Option<String>,
1132}
1133
1134impl common::NestedType for CommentObject {}
1135impl common::Part for CommentObject {}
1136
1137/// People who +1'd this comment.
1138///
1139/// This type is not used in any activity, and only used as *part* of another schema.
1140///
1141#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1142#[serde_with::serde_as]
1143#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1144pub struct CommentPlusoners {
1145 /// Total number of people who +1'd this comment.
1146 #[serde(rename = "totalItems")]
1147 pub total_items: Option<u32>,
1148}
1149
1150impl common::NestedType for CommentPlusoners {}
1151impl common::Part for CommentPlusoners {}
1152
1153/// The age range of the person. Valid ranges are 17 or younger, 18 to 20, and 21 or older. Age is determined from the user's birthday using Western age reckoning.
1154///
1155/// This type is not used in any activity, and only used as *part* of another schema.
1156///
1157#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1158#[serde_with::serde_as]
1159#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1160pub struct PersonAgeRange {
1161 /// The age range's upper bound, if any. Possible values include, but are not limited to, the following:
1162 /// - "17" - for age 17
1163 /// - "20" - for age 20
1164 pub max: Option<i32>,
1165 /// The age range's lower bound, if any. Possible values include, but are not limited to, the following:
1166 /// - "21" - for age 21
1167 /// - "18" - for age 18
1168 pub min: Option<i32>,
1169}
1170
1171impl common::NestedType for PersonAgeRange {}
1172impl common::Part for PersonAgeRange {}
1173
1174/// The cover photo content.
1175///
1176/// This type is not used in any activity, and only used as *part* of another schema.
1177///
1178#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1179#[serde_with::serde_as]
1180#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1181pub struct PersonCover {
1182 /// Extra information about the cover photo.
1183 #[serde(rename = "coverInfo")]
1184 pub cover_info: Option<PersonCoverCoverInfo>,
1185 /// The person's primary cover image.
1186 #[serde(rename = "coverPhoto")]
1187 pub cover_photo: Option<PersonCoverCoverPhoto>,
1188 /// The layout of the cover art. Possible values include, but are not limited to, the following values:
1189 /// - "banner" - One large image banner.
1190 pub layout: Option<String>,
1191}
1192
1193impl common::NestedType for PersonCover {}
1194impl common::Part for PersonCover {}
1195
1196/// Extra information about the cover photo.
1197///
1198/// This type is not used in any activity, and only used as *part* of another schema.
1199///
1200#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1201#[serde_with::serde_as]
1202#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1203pub struct PersonCoverCoverInfo {
1204 /// The difference between the left position of the cover image and the actual displayed cover image. Only valid for banner layout.
1205 #[serde(rename = "leftImageOffset")]
1206 pub left_image_offset: Option<i32>,
1207 /// The difference between the top position of the cover image and the actual displayed cover image. Only valid for banner layout.
1208 #[serde(rename = "topImageOffset")]
1209 pub top_image_offset: Option<i32>,
1210}
1211
1212impl common::NestedType for PersonCoverCoverInfo {}
1213impl common::Part for PersonCoverCoverInfo {}
1214
1215/// The person's primary cover image.
1216///
1217/// This type is not used in any activity, and only used as *part* of another schema.
1218///
1219#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1220#[serde_with::serde_as]
1221#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1222pub struct PersonCoverCoverPhoto {
1223 /// The height of the image.
1224 pub height: Option<i32>,
1225 /// The URL of the image.
1226 pub url: Option<String>,
1227 /// The width of the image.
1228 pub width: Option<i32>,
1229}
1230
1231impl common::NestedType for PersonCoverCoverPhoto {}
1232impl common::Part for PersonCoverCoverPhoto {}
1233
1234/// A list of email addresses that this person has, including their Google account email address, and the public verified email addresses on their Google+ profile. The plus.profile.emails.read scope is needed to retrieve these email addresses, or the email scope can be used to retrieve just the Google account email address.
1235///
1236/// This type is not used in any activity, and only used as *part* of another schema.
1237///
1238#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1239#[serde_with::serde_as]
1240#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1241pub struct PersonEmails {
1242 /// The type of address. Possible values include, but are not limited to, the following values:
1243 /// - "account" - Google account email address.
1244 /// - "home" - Home email address.
1245 /// - "work" - Work email address.
1246 /// - "other" - Other.
1247 #[serde(rename = "type")]
1248 pub type_: Option<String>,
1249 /// The email address.
1250 pub value: Option<String>,
1251}
1252
1253impl common::NestedType for PersonEmails {}
1254impl common::Part for PersonEmails {}
1255
1256/// The representation of the person's profile photo.
1257///
1258/// This type is not used in any activity, and only used as *part* of another schema.
1259///
1260#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1261#[serde_with::serde_as]
1262#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1263pub struct PersonImage {
1264 /// Whether the person's profile photo is the default one
1265 #[serde(rename = "isDefault")]
1266 pub is_default: Option<bool>,
1267 /// The URL of the person's profile photo. To resize the image and crop it to a square, append the query string ?sz=x, where x is the dimension in pixels of each side.
1268 pub url: Option<String>,
1269}
1270
1271impl common::NestedType for PersonImage {}
1272impl common::Part for PersonImage {}
1273
1274/// An object representation of the individual components of a person's name.
1275///
1276/// This type is not used in any activity, and only used as *part* of another schema.
1277///
1278#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1279#[serde_with::serde_as]
1280#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1281pub struct PersonName {
1282 /// The family name (last name) of this person.
1283 #[serde(rename = "familyName")]
1284 pub family_name: Option<String>,
1285 /// The full name of this person, including middle names, suffixes, etc.
1286 pub formatted: Option<String>,
1287 /// The given name (first name) of this person.
1288 #[serde(rename = "givenName")]
1289 pub given_name: Option<String>,
1290 /// The honorific prefixes (such as "Dr." or "Mrs.") for this person.
1291 #[serde(rename = "honorificPrefix")]
1292 pub honorific_prefix: Option<String>,
1293 /// The honorific suffixes (such as "Jr.") for this person.
1294 #[serde(rename = "honorificSuffix")]
1295 pub honorific_suffix: Option<String>,
1296 /// The middle name of this person.
1297 #[serde(rename = "middleName")]
1298 pub middle_name: Option<String>,
1299}
1300
1301impl common::NestedType for PersonName {}
1302impl common::Part for PersonName {}
1303
1304/// A list of current or past organizations with which this person is associated.
1305///
1306/// This type is not used in any activity, and only used as *part* of another schema.
1307///
1308#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1309#[serde_with::serde_as]
1310#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1311pub struct PersonOrganizations {
1312 /// The department within the organization. Deprecated.
1313 pub department: Option<String>,
1314 /// A short description of the person's role in this organization. Deprecated.
1315 pub description: Option<String>,
1316 /// The date that the person left this organization.
1317 #[serde(rename = "endDate")]
1318 pub end_date: Option<String>,
1319 /// The location of this organization. Deprecated.
1320 pub location: Option<String>,
1321 /// The name of the organization.
1322 pub name: Option<String>,
1323 /// If "true", indicates this organization is the person's primary one, which is typically interpreted as the current one.
1324 pub primary: Option<bool>,
1325 /// The date that the person joined this organization.
1326 #[serde(rename = "startDate")]
1327 pub start_date: Option<String>,
1328 /// The person's job title or role within the organization.
1329 pub title: Option<String>,
1330 /// The type of organization. Possible values include, but are not limited to, the following values:
1331 /// - "work" - Work.
1332 /// - "school" - School.
1333 #[serde(rename = "type")]
1334 pub type_: Option<String>,
1335}
1336
1337impl common::NestedType for PersonOrganizations {}
1338impl common::Part for PersonOrganizations {}
1339
1340/// A list of places where this person has lived.
1341///
1342/// This type is not used in any activity, and only used as *part* of another schema.
1343///
1344#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1345#[serde_with::serde_as]
1346#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1347pub struct PersonPlacesLived {
1348 /// If "true", this place of residence is this person's primary residence.
1349 pub primary: Option<bool>,
1350 /// A place where this person has lived. For example: "Seattle, WA", "Near Toronto".
1351 pub value: Option<String>,
1352}
1353
1354impl common::NestedType for PersonPlacesLived {}
1355impl common::Part for PersonPlacesLived {}
1356
1357/// A list of URLs for this person.
1358///
1359/// This type is not used in any activity, and only used as *part* of another schema.
1360///
1361#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1362#[serde_with::serde_as]
1363#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1364pub struct PersonUrls {
1365 /// The label of the URL.
1366 pub label: Option<String>,
1367 /// The type of URL. Possible values include, but are not limited to, the following values:
1368 /// - "otherProfile" - URL for another profile.
1369 /// - "contributor" - URL to a site for which this person is a contributor.
1370 /// - "website" - URL for this Google+ Page's primary website.
1371 /// - "other" - Other URL.
1372 #[serde(rename = "type")]
1373 pub type_: Option<String>,
1374 /// The URL value.
1375 pub value: Option<String>,
1376}
1377
1378impl common::NestedType for PersonUrls {}
1379impl common::Part for PersonUrls {}
1380
1381/// The physical address of the place.
1382///
1383/// This type is not used in any activity, and only used as *part* of another schema.
1384///
1385#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1386#[serde_with::serde_as]
1387#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1388pub struct PlaceAddress {
1389 /// The formatted address for display.
1390 pub formatted: Option<String>,
1391}
1392
1393impl common::NestedType for PlaceAddress {}
1394impl common::Part for PlaceAddress {}
1395
1396/// The position of the place.
1397///
1398/// This type is not used in any activity, and only used as *part* of another schema.
1399///
1400#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
1401#[serde_with::serde_as]
1402#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
1403pub struct PlacePosition {
1404 /// The latitude of this position.
1405 pub latitude: Option<f64>,
1406 /// The longitude of this position.
1407 pub longitude: Option<f64>,
1408}
1409
1410impl common::NestedType for PlacePosition {}
1411impl common::Part for PlacePosition {}
1412
1413// ###################
1414// MethodBuilders ###
1415// #################
1416
1417/// A builder providing access to all methods supported on *activity* resources.
1418/// It is not used directly, but through the [`Plus`] hub.
1419///
1420/// # Example
1421///
1422/// Instantiate a resource builder
1423///
1424/// ```test_harness,no_run
1425/// extern crate hyper;
1426/// extern crate hyper_rustls;
1427/// extern crate google_plus1 as plus1;
1428///
1429/// # async fn dox() {
1430/// use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1431///
1432/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1433/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
1434/// secret,
1435/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1436/// ).build().await.unwrap();
1437///
1438/// let client = hyper_util::client::legacy::Client::builder(
1439/// hyper_util::rt::TokioExecutor::new()
1440/// )
1441/// .build(
1442/// hyper_rustls::HttpsConnectorBuilder::new()
1443/// .with_native_roots()
1444/// .unwrap()
1445/// .https_or_http()
1446/// .enable_http1()
1447/// .build()
1448/// );
1449/// let mut hub = Plus::new(client, auth);
1450/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1451/// // like `get(...)`, `list(...)` and `search(...)`
1452/// // to build up your call.
1453/// let rb = hub.activities();
1454/// # }
1455/// ```
1456pub struct ActivityMethods<'a, C>
1457where
1458 C: 'a,
1459{
1460 hub: &'a Plus<C>,
1461}
1462
1463impl<'a, C> common::MethodsBuilder for ActivityMethods<'a, C> {}
1464
1465impl<'a, C> ActivityMethods<'a, C> {
1466 /// Create a builder to help you perform the following task:
1467 ///
1468 /// Shut down. See https://developers.google.com/+/api-shutdown for more details.
1469 ///
1470 /// # Arguments
1471 ///
1472 /// * `activityId` - The ID of the activity to get.
1473 pub fn get(&self, activity_id: &str) -> ActivityGetCall<'a, C> {
1474 ActivityGetCall {
1475 hub: self.hub,
1476 _activity_id: activity_id.to_string(),
1477 _delegate: Default::default(),
1478 _additional_params: Default::default(),
1479 _scopes: Default::default(),
1480 }
1481 }
1482
1483 /// Create a builder to help you perform the following task:
1484 ///
1485 /// Shut down. See https://developers.google.com/+/api-shutdown for more details.
1486 ///
1487 /// # Arguments
1488 ///
1489 /// * `userId` - The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user.
1490 /// * `collection` - The collection of activities to list.
1491 pub fn list(&self, user_id: &str, collection: &str) -> ActivityListCall<'a, C> {
1492 ActivityListCall {
1493 hub: self.hub,
1494 _user_id: user_id.to_string(),
1495 _collection: collection.to_string(),
1496 _page_token: Default::default(),
1497 _max_results: Default::default(),
1498 _delegate: Default::default(),
1499 _additional_params: Default::default(),
1500 _scopes: Default::default(),
1501 }
1502 }
1503
1504 /// Create a builder to help you perform the following task:
1505 ///
1506 /// Shut down. See https://developers.google.com/+/api-shutdown for more details.
1507 ///
1508 /// # Arguments
1509 ///
1510 /// * `query` - Full-text search query string.
1511 pub fn search(&self, query: &str) -> ActivitySearchCall<'a, C> {
1512 ActivitySearchCall {
1513 hub: self.hub,
1514 _query: query.to_string(),
1515 _page_token: Default::default(),
1516 _order_by: Default::default(),
1517 _max_results: Default::default(),
1518 _language: Default::default(),
1519 _delegate: Default::default(),
1520 _additional_params: Default::default(),
1521 _scopes: Default::default(),
1522 }
1523 }
1524}
1525
1526/// A builder providing access to all methods supported on *comment* resources.
1527/// It is not used directly, but through the [`Plus`] hub.
1528///
1529/// # Example
1530///
1531/// Instantiate a resource builder
1532///
1533/// ```test_harness,no_run
1534/// extern crate hyper;
1535/// extern crate hyper_rustls;
1536/// extern crate google_plus1 as plus1;
1537///
1538/// # async fn dox() {
1539/// use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1540///
1541/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1542/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
1543/// secret,
1544/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1545/// ).build().await.unwrap();
1546///
1547/// let client = hyper_util::client::legacy::Client::builder(
1548/// hyper_util::rt::TokioExecutor::new()
1549/// )
1550/// .build(
1551/// hyper_rustls::HttpsConnectorBuilder::new()
1552/// .with_native_roots()
1553/// .unwrap()
1554/// .https_or_http()
1555/// .enable_http1()
1556/// .build()
1557/// );
1558/// let mut hub = Plus::new(client, auth);
1559/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1560/// // like `get(...)` and `list(...)`
1561/// // to build up your call.
1562/// let rb = hub.comments();
1563/// # }
1564/// ```
1565pub struct CommentMethods<'a, C>
1566where
1567 C: 'a,
1568{
1569 hub: &'a Plus<C>,
1570}
1571
1572impl<'a, C> common::MethodsBuilder for CommentMethods<'a, C> {}
1573
1574impl<'a, C> CommentMethods<'a, C> {
1575 /// Create a builder to help you perform the following task:
1576 ///
1577 /// Shut down. See https://developers.google.com/+/api-shutdown for more details.
1578 ///
1579 /// # Arguments
1580 ///
1581 /// * `commentId` - The ID of the comment to get.
1582 pub fn get(&self, comment_id: &str) -> CommentGetCall<'a, C> {
1583 CommentGetCall {
1584 hub: self.hub,
1585 _comment_id: comment_id.to_string(),
1586 _delegate: Default::default(),
1587 _additional_params: Default::default(),
1588 _scopes: Default::default(),
1589 }
1590 }
1591
1592 /// Create a builder to help you perform the following task:
1593 ///
1594 /// Shut down. See https://developers.google.com/+/api-shutdown for more details.
1595 ///
1596 /// # Arguments
1597 ///
1598 /// * `activityId` - The ID of the activity to get comments for.
1599 pub fn list(&self, activity_id: &str) -> CommentListCall<'a, C> {
1600 CommentListCall {
1601 hub: self.hub,
1602 _activity_id: activity_id.to_string(),
1603 _sort_order: Default::default(),
1604 _page_token: Default::default(),
1605 _max_results: Default::default(),
1606 _delegate: Default::default(),
1607 _additional_params: Default::default(),
1608 _scopes: Default::default(),
1609 }
1610 }
1611}
1612
1613/// A builder providing access to all methods supported on *person* resources.
1614/// It is not used directly, but through the [`Plus`] hub.
1615///
1616/// # Example
1617///
1618/// Instantiate a resource builder
1619///
1620/// ```test_harness,no_run
1621/// extern crate hyper;
1622/// extern crate hyper_rustls;
1623/// extern crate google_plus1 as plus1;
1624///
1625/// # async fn dox() {
1626/// use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1627///
1628/// let secret: yup_oauth2::ApplicationSecret = Default::default();
1629/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
1630/// secret,
1631/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1632/// ).build().await.unwrap();
1633///
1634/// let client = hyper_util::client::legacy::Client::builder(
1635/// hyper_util::rt::TokioExecutor::new()
1636/// )
1637/// .build(
1638/// hyper_rustls::HttpsConnectorBuilder::new()
1639/// .with_native_roots()
1640/// .unwrap()
1641/// .https_or_http()
1642/// .enable_http1()
1643/// .build()
1644/// );
1645/// let mut hub = Plus::new(client, auth);
1646/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
1647/// // like `get(...)`, `list(...)`, `list_by_activity(...)` and `search(...)`
1648/// // to build up your call.
1649/// let rb = hub.people();
1650/// # }
1651/// ```
1652pub struct PersonMethods<'a, C>
1653where
1654 C: 'a,
1655{
1656 hub: &'a Plus<C>,
1657}
1658
1659impl<'a, C> common::MethodsBuilder for PersonMethods<'a, C> {}
1660
1661impl<'a, C> PersonMethods<'a, C> {
1662 /// Create a builder to help you perform the following task:
1663 ///
1664 /// Get a person's profile. If your app uses scope https://www.googleapis.com/auth/plus.login, this method is guaranteed to return ageRange and language.
1665 ///
1666 /// # Arguments
1667 ///
1668 /// * `userId` - The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user.
1669 pub fn get(&self, user_id: &str) -> PersonGetCall<'a, C> {
1670 PersonGetCall {
1671 hub: self.hub,
1672 _user_id: user_id.to_string(),
1673 _delegate: Default::default(),
1674 _additional_params: Default::default(),
1675 _scopes: Default::default(),
1676 }
1677 }
1678
1679 /// Create a builder to help you perform the following task:
1680 ///
1681 /// List all of the people in the specified collection.
1682 ///
1683 /// # Arguments
1684 ///
1685 /// * `userId` - Get the collection of people for the person identified. Use "me" to indicate the authenticated user.
1686 /// * `collection` - The collection of people to list.
1687 pub fn list(&self, user_id: &str, collection: &str) -> PersonListCall<'a, C> {
1688 PersonListCall {
1689 hub: self.hub,
1690 _user_id: user_id.to_string(),
1691 _collection: collection.to_string(),
1692 _page_token: Default::default(),
1693 _order_by: Default::default(),
1694 _max_results: Default::default(),
1695 _delegate: Default::default(),
1696 _additional_params: Default::default(),
1697 _scopes: Default::default(),
1698 }
1699 }
1700
1701 /// Create a builder to help you perform the following task:
1702 ///
1703 /// Shut down. See https://developers.google.com/+/api-shutdown for more details.
1704 ///
1705 /// # Arguments
1706 ///
1707 /// * `activityId` - The ID of the activity to get the list of people for.
1708 /// * `collection` - The collection of people to list.
1709 pub fn list_by_activity(
1710 &self,
1711 activity_id: &str,
1712 collection: &str,
1713 ) -> PersonListByActivityCall<'a, C> {
1714 PersonListByActivityCall {
1715 hub: self.hub,
1716 _activity_id: activity_id.to_string(),
1717 _collection: collection.to_string(),
1718 _page_token: Default::default(),
1719 _max_results: Default::default(),
1720 _delegate: Default::default(),
1721 _additional_params: Default::default(),
1722 _scopes: Default::default(),
1723 }
1724 }
1725
1726 /// Create a builder to help you perform the following task:
1727 ///
1728 /// Shut down. See https://developers.google.com/+/api-shutdown for more details.
1729 ///
1730 /// # Arguments
1731 ///
1732 /// * `query` - Specify a query string for full text search of public text in all profiles.
1733 pub fn search(&self, query: &str) -> PersonSearchCall<'a, C> {
1734 PersonSearchCall {
1735 hub: self.hub,
1736 _query: query.to_string(),
1737 _page_token: Default::default(),
1738 _max_results: Default::default(),
1739 _language: Default::default(),
1740 _delegate: Default::default(),
1741 _additional_params: Default::default(),
1742 _scopes: Default::default(),
1743 }
1744 }
1745}
1746
1747// ###################
1748// CallBuilders ###
1749// #################
1750
1751/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
1752///
1753/// A builder for the *get* method supported by a *activity* resource.
1754/// It is not used directly, but through a [`ActivityMethods`] instance.
1755///
1756/// # Example
1757///
1758/// Instantiate a resource method builder
1759///
1760/// ```test_harness,no_run
1761/// # extern crate hyper;
1762/// # extern crate hyper_rustls;
1763/// # extern crate google_plus1 as plus1;
1764/// # async fn dox() {
1765/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1766///
1767/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1768/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
1769/// # secret,
1770/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1771/// # ).build().await.unwrap();
1772///
1773/// # let client = hyper_util::client::legacy::Client::builder(
1774/// # hyper_util::rt::TokioExecutor::new()
1775/// # )
1776/// # .build(
1777/// # hyper_rustls::HttpsConnectorBuilder::new()
1778/// # .with_native_roots()
1779/// # .unwrap()
1780/// # .https_or_http()
1781/// # .enable_http1()
1782/// # .build()
1783/// # );
1784/// # let mut hub = Plus::new(client, auth);
1785/// // You can configure optional parameters by calling the respective setters at will, and
1786/// // execute the final call using `doit()`.
1787/// // Values shown here are possibly random and not representative !
1788/// let result = hub.activities().get("activityId")
1789/// .doit().await;
1790/// # }
1791/// ```
1792pub struct ActivityGetCall<'a, C>
1793where
1794 C: 'a,
1795{
1796 hub: &'a Plus<C>,
1797 _activity_id: String,
1798 _delegate: Option<&'a mut dyn common::Delegate>,
1799 _additional_params: HashMap<String, String>,
1800 _scopes: BTreeSet<String>,
1801}
1802
1803impl<'a, C> common::CallBuilder for ActivityGetCall<'a, C> {}
1804
1805impl<'a, C> ActivityGetCall<'a, C>
1806where
1807 C: common::Connector,
1808{
1809 /// Perform the operation you have build so far.
1810 pub async fn doit(mut self) -> common::Result<(common::Response, Activity)> {
1811 use std::borrow::Cow;
1812 use std::io::{Read, Seek};
1813
1814 use common::{url::Params, ToParts};
1815 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1816
1817 let mut dd = common::DefaultDelegate;
1818 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1819 dlg.begin(common::MethodInfo {
1820 id: "plus.activities.get",
1821 http_method: hyper::Method::GET,
1822 });
1823
1824 for &field in ["alt", "activityId"].iter() {
1825 if self._additional_params.contains_key(field) {
1826 dlg.finished(false);
1827 return Err(common::Error::FieldClash(field));
1828 }
1829 }
1830
1831 let mut params = Params::with_capacity(3 + self._additional_params.len());
1832 params.push("activityId", self._activity_id);
1833
1834 params.extend(self._additional_params.iter());
1835
1836 params.push("alt", "json");
1837 let mut url = self.hub._base_url.clone() + "activities/{activityId}";
1838 if self._scopes.is_empty() {
1839 self._scopes.insert(Scope::Login.as_ref().to_string());
1840 }
1841
1842 #[allow(clippy::single_element_loop)]
1843 for &(find_this, param_name) in [("{activityId}", "activityId")].iter() {
1844 url = params.uri_replacement(url, param_name, find_this, false);
1845 }
1846 {
1847 let to_remove = ["activityId"];
1848 params.remove_params(&to_remove);
1849 }
1850
1851 let url = params.parse_with_url(&url);
1852
1853 loop {
1854 let token = match self
1855 .hub
1856 .auth
1857 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
1858 .await
1859 {
1860 Ok(token) => token,
1861 Err(e) => match dlg.token(e) {
1862 Ok(token) => token,
1863 Err(e) => {
1864 dlg.finished(false);
1865 return Err(common::Error::MissingToken(e));
1866 }
1867 },
1868 };
1869 let mut req_result = {
1870 let client = &self.hub.client;
1871 dlg.pre_request();
1872 let mut req_builder = hyper::Request::builder()
1873 .method(hyper::Method::GET)
1874 .uri(url.as_str())
1875 .header(USER_AGENT, self.hub._user_agent.clone());
1876
1877 if let Some(token) = token.as_ref() {
1878 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
1879 }
1880
1881 let request = req_builder
1882 .header(CONTENT_LENGTH, 0_u64)
1883 .body(common::to_body::<String>(None));
1884
1885 client.request(request.unwrap()).await
1886 };
1887
1888 match req_result {
1889 Err(err) => {
1890 if let common::Retry::After(d) = dlg.http_error(&err) {
1891 sleep(d).await;
1892 continue;
1893 }
1894 dlg.finished(false);
1895 return Err(common::Error::HttpError(err));
1896 }
1897 Ok(res) => {
1898 let (mut parts, body) = res.into_parts();
1899 let mut body = common::Body::new(body);
1900 if !parts.status.is_success() {
1901 let bytes = common::to_bytes(body).await.unwrap_or_default();
1902 let error = serde_json::from_str(&common::to_string(&bytes));
1903 let response = common::to_response(parts, bytes.into());
1904
1905 if let common::Retry::After(d) =
1906 dlg.http_failure(&response, error.as_ref().ok())
1907 {
1908 sleep(d).await;
1909 continue;
1910 }
1911
1912 dlg.finished(false);
1913
1914 return Err(match error {
1915 Ok(value) => common::Error::BadRequest(value),
1916 _ => common::Error::Failure(response),
1917 });
1918 }
1919 let response = {
1920 let bytes = common::to_bytes(body).await.unwrap_or_default();
1921 let encoded = common::to_string(&bytes);
1922 match serde_json::from_str(&encoded) {
1923 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1924 Err(error) => {
1925 dlg.response_json_decode_error(&encoded, &error);
1926 return Err(common::Error::JsonDecodeError(
1927 encoded.to_string(),
1928 error,
1929 ));
1930 }
1931 }
1932 };
1933
1934 dlg.finished(true);
1935 return Ok(response);
1936 }
1937 }
1938 }
1939 }
1940
1941 /// The ID of the activity to get.
1942 ///
1943 /// Sets the *activity id* path property to the given value.
1944 ///
1945 /// Even though the property as already been set when instantiating this call,
1946 /// we provide this method for API completeness.
1947 pub fn activity_id(mut self, new_value: &str) -> ActivityGetCall<'a, C> {
1948 self._activity_id = new_value.to_string();
1949 self
1950 }
1951 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1952 /// while executing the actual API request.
1953 ///
1954 /// ````text
1955 /// It should be used to handle progress information, and to implement a certain level of resilience.
1956 /// ````
1957 ///
1958 /// Sets the *delegate* property to the given value.
1959 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> ActivityGetCall<'a, C> {
1960 self._delegate = Some(new_value);
1961 self
1962 }
1963
1964 /// Set any additional parameter of the query string used in the request.
1965 /// It should be used to set parameters which are not yet available through their own
1966 /// setters.
1967 ///
1968 /// Please note that this method must not be used to set any of the known parameters
1969 /// which have their own setter method. If done anyway, the request will fail.
1970 ///
1971 /// # Additional Parameters
1972 ///
1973 /// * *alt* (query-string) - Data format for the response.
1974 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1975 /// * *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.
1976 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1977 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1978 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
1979 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
1980 pub fn param<T>(mut self, name: T, value: T) -> ActivityGetCall<'a, C>
1981 where
1982 T: AsRef<str>,
1983 {
1984 self._additional_params
1985 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1986 self
1987 }
1988
1989 /// Identifies the authorization scope for the method you are building.
1990 ///
1991 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
1992 /// [`Scope::Login`].
1993 ///
1994 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
1995 /// tokens for more than one scope.
1996 ///
1997 /// Usually there is more than one suitable scope to authorize an operation, some of which may
1998 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
1999 /// sufficient, a read-write scope will do as well.
2000 pub fn add_scope<St>(mut self, scope: St) -> ActivityGetCall<'a, C>
2001 where
2002 St: AsRef<str>,
2003 {
2004 self._scopes.insert(String::from(scope.as_ref()));
2005 self
2006 }
2007 /// Identifies the authorization scope(s) for the method you are building.
2008 ///
2009 /// See [`Self::add_scope()`] for details.
2010 pub fn add_scopes<I, St>(mut self, scopes: I) -> ActivityGetCall<'a, C>
2011 where
2012 I: IntoIterator<Item = St>,
2013 St: AsRef<str>,
2014 {
2015 self._scopes
2016 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2017 self
2018 }
2019
2020 /// Removes all scopes, and no default scope will be used either.
2021 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2022 /// for details).
2023 pub fn clear_scopes(mut self) -> ActivityGetCall<'a, C> {
2024 self._scopes.clear();
2025 self
2026 }
2027}
2028
2029/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
2030///
2031/// A builder for the *list* method supported by a *activity* resource.
2032/// It is not used directly, but through a [`ActivityMethods`] instance.
2033///
2034/// # Example
2035///
2036/// Instantiate a resource method builder
2037///
2038/// ```test_harness,no_run
2039/// # extern crate hyper;
2040/// # extern crate hyper_rustls;
2041/// # extern crate google_plus1 as plus1;
2042/// # async fn dox() {
2043/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2044///
2045/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2046/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
2047/// # secret,
2048/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2049/// # ).build().await.unwrap();
2050///
2051/// # let client = hyper_util::client::legacy::Client::builder(
2052/// # hyper_util::rt::TokioExecutor::new()
2053/// # )
2054/// # .build(
2055/// # hyper_rustls::HttpsConnectorBuilder::new()
2056/// # .with_native_roots()
2057/// # .unwrap()
2058/// # .https_or_http()
2059/// # .enable_http1()
2060/// # .build()
2061/// # );
2062/// # let mut hub = Plus::new(client, auth);
2063/// // You can configure optional parameters by calling the respective setters at will, and
2064/// // execute the final call using `doit()`.
2065/// // Values shown here are possibly random and not representative !
2066/// let result = hub.activities().list("userId", "collection")
2067/// .page_token("ea")
2068/// .max_results(46)
2069/// .doit().await;
2070/// # }
2071/// ```
2072pub struct ActivityListCall<'a, C>
2073where
2074 C: 'a,
2075{
2076 hub: &'a Plus<C>,
2077 _user_id: String,
2078 _collection: String,
2079 _page_token: Option<String>,
2080 _max_results: Option<u32>,
2081 _delegate: Option<&'a mut dyn common::Delegate>,
2082 _additional_params: HashMap<String, String>,
2083 _scopes: BTreeSet<String>,
2084}
2085
2086impl<'a, C> common::CallBuilder for ActivityListCall<'a, C> {}
2087
2088impl<'a, C> ActivityListCall<'a, C>
2089where
2090 C: common::Connector,
2091{
2092 /// Perform the operation you have build so far.
2093 pub async fn doit(mut self) -> common::Result<(common::Response, ActivityFeed)> {
2094 use std::borrow::Cow;
2095 use std::io::{Read, Seek};
2096
2097 use common::{url::Params, ToParts};
2098 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2099
2100 let mut dd = common::DefaultDelegate;
2101 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2102 dlg.begin(common::MethodInfo {
2103 id: "plus.activities.list",
2104 http_method: hyper::Method::GET,
2105 });
2106
2107 for &field in ["alt", "userId", "collection", "pageToken", "maxResults"].iter() {
2108 if self._additional_params.contains_key(field) {
2109 dlg.finished(false);
2110 return Err(common::Error::FieldClash(field));
2111 }
2112 }
2113
2114 let mut params = Params::with_capacity(6 + self._additional_params.len());
2115 params.push("userId", self._user_id);
2116 params.push("collection", self._collection);
2117 if let Some(value) = self._page_token.as_ref() {
2118 params.push("pageToken", value);
2119 }
2120 if let Some(value) = self._max_results.as_ref() {
2121 params.push("maxResults", value.to_string());
2122 }
2123
2124 params.extend(self._additional_params.iter());
2125
2126 params.push("alt", "json");
2127 let mut url = self.hub._base_url.clone() + "people/{userId}/activities/{collection}";
2128 if self._scopes.is_empty() {
2129 self._scopes.insert(Scope::Login.as_ref().to_string());
2130 }
2131
2132 #[allow(clippy::single_element_loop)]
2133 for &(find_this, param_name) in
2134 [("{userId}", "userId"), ("{collection}", "collection")].iter()
2135 {
2136 url = params.uri_replacement(url, param_name, find_this, false);
2137 }
2138 {
2139 let to_remove = ["collection", "userId"];
2140 params.remove_params(&to_remove);
2141 }
2142
2143 let url = params.parse_with_url(&url);
2144
2145 loop {
2146 let token = match self
2147 .hub
2148 .auth
2149 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2150 .await
2151 {
2152 Ok(token) => token,
2153 Err(e) => match dlg.token(e) {
2154 Ok(token) => token,
2155 Err(e) => {
2156 dlg.finished(false);
2157 return Err(common::Error::MissingToken(e));
2158 }
2159 },
2160 };
2161 let mut req_result = {
2162 let client = &self.hub.client;
2163 dlg.pre_request();
2164 let mut req_builder = hyper::Request::builder()
2165 .method(hyper::Method::GET)
2166 .uri(url.as_str())
2167 .header(USER_AGENT, self.hub._user_agent.clone());
2168
2169 if let Some(token) = token.as_ref() {
2170 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2171 }
2172
2173 let request = req_builder
2174 .header(CONTENT_LENGTH, 0_u64)
2175 .body(common::to_body::<String>(None));
2176
2177 client.request(request.unwrap()).await
2178 };
2179
2180 match req_result {
2181 Err(err) => {
2182 if let common::Retry::After(d) = dlg.http_error(&err) {
2183 sleep(d).await;
2184 continue;
2185 }
2186 dlg.finished(false);
2187 return Err(common::Error::HttpError(err));
2188 }
2189 Ok(res) => {
2190 let (mut parts, body) = res.into_parts();
2191 let mut body = common::Body::new(body);
2192 if !parts.status.is_success() {
2193 let bytes = common::to_bytes(body).await.unwrap_or_default();
2194 let error = serde_json::from_str(&common::to_string(&bytes));
2195 let response = common::to_response(parts, bytes.into());
2196
2197 if let common::Retry::After(d) =
2198 dlg.http_failure(&response, error.as_ref().ok())
2199 {
2200 sleep(d).await;
2201 continue;
2202 }
2203
2204 dlg.finished(false);
2205
2206 return Err(match error {
2207 Ok(value) => common::Error::BadRequest(value),
2208 _ => common::Error::Failure(response),
2209 });
2210 }
2211 let response = {
2212 let bytes = common::to_bytes(body).await.unwrap_or_default();
2213 let encoded = common::to_string(&bytes);
2214 match serde_json::from_str(&encoded) {
2215 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2216 Err(error) => {
2217 dlg.response_json_decode_error(&encoded, &error);
2218 return Err(common::Error::JsonDecodeError(
2219 encoded.to_string(),
2220 error,
2221 ));
2222 }
2223 }
2224 };
2225
2226 dlg.finished(true);
2227 return Ok(response);
2228 }
2229 }
2230 }
2231 }
2232
2233 /// The ID of the user to get activities for. The special value "me" can be used to indicate the authenticated user.
2234 ///
2235 /// Sets the *user id* path property to the given value.
2236 ///
2237 /// Even though the property as already been set when instantiating this call,
2238 /// we provide this method for API completeness.
2239 pub fn user_id(mut self, new_value: &str) -> ActivityListCall<'a, C> {
2240 self._user_id = new_value.to_string();
2241 self
2242 }
2243 /// The collection of activities to list.
2244 ///
2245 /// Sets the *collection* path property to the given value.
2246 ///
2247 /// Even though the property as already been set when instantiating this call,
2248 /// we provide this method for API completeness.
2249 pub fn collection(mut self, new_value: &str) -> ActivityListCall<'a, C> {
2250 self._collection = new_value.to_string();
2251 self
2252 }
2253 /// 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.
2254 ///
2255 /// Sets the *page token* query property to the given value.
2256 pub fn page_token(mut self, new_value: &str) -> ActivityListCall<'a, C> {
2257 self._page_token = Some(new_value.to_string());
2258 self
2259 }
2260 /// The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.
2261 ///
2262 /// Sets the *max results* query property to the given value.
2263 pub fn max_results(mut self, new_value: u32) -> ActivityListCall<'a, C> {
2264 self._max_results = Some(new_value);
2265 self
2266 }
2267 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2268 /// while executing the actual API request.
2269 ///
2270 /// ````text
2271 /// It should be used to handle progress information, and to implement a certain level of resilience.
2272 /// ````
2273 ///
2274 /// Sets the *delegate* property to the given value.
2275 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> ActivityListCall<'a, C> {
2276 self._delegate = Some(new_value);
2277 self
2278 }
2279
2280 /// Set any additional parameter of the query string used in the request.
2281 /// It should be used to set parameters which are not yet available through their own
2282 /// setters.
2283 ///
2284 /// Please note that this method must not be used to set any of the known parameters
2285 /// which have their own setter method. If done anyway, the request will fail.
2286 ///
2287 /// # Additional Parameters
2288 ///
2289 /// * *alt* (query-string) - Data format for the response.
2290 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2291 /// * *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.
2292 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2293 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2294 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
2295 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
2296 pub fn param<T>(mut self, name: T, value: T) -> ActivityListCall<'a, C>
2297 where
2298 T: AsRef<str>,
2299 {
2300 self._additional_params
2301 .insert(name.as_ref().to_string(), value.as_ref().to_string());
2302 self
2303 }
2304
2305 /// Identifies the authorization scope for the method you are building.
2306 ///
2307 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2308 /// [`Scope::Login`].
2309 ///
2310 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2311 /// tokens for more than one scope.
2312 ///
2313 /// Usually there is more than one suitable scope to authorize an operation, some of which may
2314 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2315 /// sufficient, a read-write scope will do as well.
2316 pub fn add_scope<St>(mut self, scope: St) -> ActivityListCall<'a, C>
2317 where
2318 St: AsRef<str>,
2319 {
2320 self._scopes.insert(String::from(scope.as_ref()));
2321 self
2322 }
2323 /// Identifies the authorization scope(s) for the method you are building.
2324 ///
2325 /// See [`Self::add_scope()`] for details.
2326 pub fn add_scopes<I, St>(mut self, scopes: I) -> ActivityListCall<'a, C>
2327 where
2328 I: IntoIterator<Item = St>,
2329 St: AsRef<str>,
2330 {
2331 self._scopes
2332 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2333 self
2334 }
2335
2336 /// Removes all scopes, and no default scope will be used either.
2337 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2338 /// for details).
2339 pub fn clear_scopes(mut self) -> ActivityListCall<'a, C> {
2340 self._scopes.clear();
2341 self
2342 }
2343}
2344
2345/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
2346///
2347/// A builder for the *search* method supported by a *activity* resource.
2348/// It is not used directly, but through a [`ActivityMethods`] instance.
2349///
2350/// # Example
2351///
2352/// Instantiate a resource method builder
2353///
2354/// ```test_harness,no_run
2355/// # extern crate hyper;
2356/// # extern crate hyper_rustls;
2357/// # extern crate google_plus1 as plus1;
2358/// # async fn dox() {
2359/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2360///
2361/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2362/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
2363/// # secret,
2364/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2365/// # ).build().await.unwrap();
2366///
2367/// # let client = hyper_util::client::legacy::Client::builder(
2368/// # hyper_util::rt::TokioExecutor::new()
2369/// # )
2370/// # .build(
2371/// # hyper_rustls::HttpsConnectorBuilder::new()
2372/// # .with_native_roots()
2373/// # .unwrap()
2374/// # .https_or_http()
2375/// # .enable_http1()
2376/// # .build()
2377/// # );
2378/// # let mut hub = Plus::new(client, auth);
2379/// // You can configure optional parameters by calling the respective setters at will, and
2380/// // execute the final call using `doit()`.
2381/// // Values shown here are possibly random and not representative !
2382/// let result = hub.activities().search("query")
2383/// .page_token("amet")
2384/// .order_by("duo")
2385/// .max_results(51)
2386/// .language("sed")
2387/// .doit().await;
2388/// # }
2389/// ```
2390pub struct ActivitySearchCall<'a, C>
2391where
2392 C: 'a,
2393{
2394 hub: &'a Plus<C>,
2395 _query: String,
2396 _page_token: Option<String>,
2397 _order_by: Option<String>,
2398 _max_results: Option<u32>,
2399 _language: Option<String>,
2400 _delegate: Option<&'a mut dyn common::Delegate>,
2401 _additional_params: HashMap<String, String>,
2402 _scopes: BTreeSet<String>,
2403}
2404
2405impl<'a, C> common::CallBuilder for ActivitySearchCall<'a, C> {}
2406
2407impl<'a, C> ActivitySearchCall<'a, C>
2408where
2409 C: common::Connector,
2410{
2411 /// Perform the operation you have build so far.
2412 pub async fn doit(mut self) -> common::Result<(common::Response, ActivityFeed)> {
2413 use std::borrow::Cow;
2414 use std::io::{Read, Seek};
2415
2416 use common::{url::Params, ToParts};
2417 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2418
2419 let mut dd = common::DefaultDelegate;
2420 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2421 dlg.begin(common::MethodInfo {
2422 id: "plus.activities.search",
2423 http_method: hyper::Method::GET,
2424 });
2425
2426 for &field in [
2427 "alt",
2428 "query",
2429 "pageToken",
2430 "orderBy",
2431 "maxResults",
2432 "language",
2433 ]
2434 .iter()
2435 {
2436 if self._additional_params.contains_key(field) {
2437 dlg.finished(false);
2438 return Err(common::Error::FieldClash(field));
2439 }
2440 }
2441
2442 let mut params = Params::with_capacity(7 + self._additional_params.len());
2443 params.push("query", self._query);
2444 if let Some(value) = self._page_token.as_ref() {
2445 params.push("pageToken", value);
2446 }
2447 if let Some(value) = self._order_by.as_ref() {
2448 params.push("orderBy", value);
2449 }
2450 if let Some(value) = self._max_results.as_ref() {
2451 params.push("maxResults", value.to_string());
2452 }
2453 if let Some(value) = self._language.as_ref() {
2454 params.push("language", value);
2455 }
2456
2457 params.extend(self._additional_params.iter());
2458
2459 params.push("alt", "json");
2460 let mut url = self.hub._base_url.clone() + "activities";
2461 if self._scopes.is_empty() {
2462 self._scopes.insert(Scope::Login.as_ref().to_string());
2463 }
2464
2465 let url = params.parse_with_url(&url);
2466
2467 loop {
2468 let token = match self
2469 .hub
2470 .auth
2471 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2472 .await
2473 {
2474 Ok(token) => token,
2475 Err(e) => match dlg.token(e) {
2476 Ok(token) => token,
2477 Err(e) => {
2478 dlg.finished(false);
2479 return Err(common::Error::MissingToken(e));
2480 }
2481 },
2482 };
2483 let mut req_result = {
2484 let client = &self.hub.client;
2485 dlg.pre_request();
2486 let mut req_builder = hyper::Request::builder()
2487 .method(hyper::Method::GET)
2488 .uri(url.as_str())
2489 .header(USER_AGENT, self.hub._user_agent.clone());
2490
2491 if let Some(token) = token.as_ref() {
2492 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2493 }
2494
2495 let request = req_builder
2496 .header(CONTENT_LENGTH, 0_u64)
2497 .body(common::to_body::<String>(None));
2498
2499 client.request(request.unwrap()).await
2500 };
2501
2502 match req_result {
2503 Err(err) => {
2504 if let common::Retry::After(d) = dlg.http_error(&err) {
2505 sleep(d).await;
2506 continue;
2507 }
2508 dlg.finished(false);
2509 return Err(common::Error::HttpError(err));
2510 }
2511 Ok(res) => {
2512 let (mut parts, body) = res.into_parts();
2513 let mut body = common::Body::new(body);
2514 if !parts.status.is_success() {
2515 let bytes = common::to_bytes(body).await.unwrap_or_default();
2516 let error = serde_json::from_str(&common::to_string(&bytes));
2517 let response = common::to_response(parts, bytes.into());
2518
2519 if let common::Retry::After(d) =
2520 dlg.http_failure(&response, error.as_ref().ok())
2521 {
2522 sleep(d).await;
2523 continue;
2524 }
2525
2526 dlg.finished(false);
2527
2528 return Err(match error {
2529 Ok(value) => common::Error::BadRequest(value),
2530 _ => common::Error::Failure(response),
2531 });
2532 }
2533 let response = {
2534 let bytes = common::to_bytes(body).await.unwrap_or_default();
2535 let encoded = common::to_string(&bytes);
2536 match serde_json::from_str(&encoded) {
2537 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2538 Err(error) => {
2539 dlg.response_json_decode_error(&encoded, &error);
2540 return Err(common::Error::JsonDecodeError(
2541 encoded.to_string(),
2542 error,
2543 ));
2544 }
2545 }
2546 };
2547
2548 dlg.finished(true);
2549 return Ok(response);
2550 }
2551 }
2552 }
2553 }
2554
2555 /// Full-text search query string.
2556 ///
2557 /// Sets the *query* query property to the given value.
2558 ///
2559 /// Even though the property as already been set when instantiating this call,
2560 /// we provide this method for API completeness.
2561 pub fn query(mut self, new_value: &str) -> ActivitySearchCall<'a, C> {
2562 self._query = new_value.to_string();
2563 self
2564 }
2565 /// 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. This token can be of any length.
2566 ///
2567 /// Sets the *page token* query property to the given value.
2568 pub fn page_token(mut self, new_value: &str) -> ActivitySearchCall<'a, C> {
2569 self._page_token = Some(new_value.to_string());
2570 self
2571 }
2572 /// Specifies how to order search results.
2573 ///
2574 /// Sets the *order by* query property to the given value.
2575 pub fn order_by(mut self, new_value: &str) -> ActivitySearchCall<'a, C> {
2576 self._order_by = Some(new_value.to_string());
2577 self
2578 }
2579 /// The maximum number of activities to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.
2580 ///
2581 /// Sets the *max results* query property to the given value.
2582 pub fn max_results(mut self, new_value: u32) -> ActivitySearchCall<'a, C> {
2583 self._max_results = Some(new_value);
2584 self
2585 }
2586 /// Specify the preferred language to search with. See search language codes for available values.
2587 ///
2588 /// Sets the *language* query property to the given value.
2589 pub fn language(mut self, new_value: &str) -> ActivitySearchCall<'a, C> {
2590 self._language = Some(new_value.to_string());
2591 self
2592 }
2593 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2594 /// while executing the actual API request.
2595 ///
2596 /// ````text
2597 /// It should be used to handle progress information, and to implement a certain level of resilience.
2598 /// ````
2599 ///
2600 /// Sets the *delegate* property to the given value.
2601 pub fn delegate(
2602 mut self,
2603 new_value: &'a mut dyn common::Delegate,
2604 ) -> ActivitySearchCall<'a, C> {
2605 self._delegate = Some(new_value);
2606 self
2607 }
2608
2609 /// Set any additional parameter of the query string used in the request.
2610 /// It should be used to set parameters which are not yet available through their own
2611 /// setters.
2612 ///
2613 /// Please note that this method must not be used to set any of the known parameters
2614 /// which have their own setter method. If done anyway, the request will fail.
2615 ///
2616 /// # Additional Parameters
2617 ///
2618 /// * *alt* (query-string) - Data format for the response.
2619 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2620 /// * *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.
2621 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2622 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2623 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
2624 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
2625 pub fn param<T>(mut self, name: T, value: T) -> ActivitySearchCall<'a, C>
2626 where
2627 T: AsRef<str>,
2628 {
2629 self._additional_params
2630 .insert(name.as_ref().to_string(), value.as_ref().to_string());
2631 self
2632 }
2633
2634 /// Identifies the authorization scope for the method you are building.
2635 ///
2636 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2637 /// [`Scope::Login`].
2638 ///
2639 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2640 /// tokens for more than one scope.
2641 ///
2642 /// Usually there is more than one suitable scope to authorize an operation, some of which may
2643 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2644 /// sufficient, a read-write scope will do as well.
2645 pub fn add_scope<St>(mut self, scope: St) -> ActivitySearchCall<'a, C>
2646 where
2647 St: AsRef<str>,
2648 {
2649 self._scopes.insert(String::from(scope.as_ref()));
2650 self
2651 }
2652 /// Identifies the authorization scope(s) for the method you are building.
2653 ///
2654 /// See [`Self::add_scope()`] for details.
2655 pub fn add_scopes<I, St>(mut self, scopes: I) -> ActivitySearchCall<'a, C>
2656 where
2657 I: IntoIterator<Item = St>,
2658 St: AsRef<str>,
2659 {
2660 self._scopes
2661 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2662 self
2663 }
2664
2665 /// Removes all scopes, and no default scope will be used either.
2666 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2667 /// for details).
2668 pub fn clear_scopes(mut self) -> ActivitySearchCall<'a, C> {
2669 self._scopes.clear();
2670 self
2671 }
2672}
2673
2674/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
2675///
2676/// A builder for the *get* method supported by a *comment* resource.
2677/// It is not used directly, but through a [`CommentMethods`] instance.
2678///
2679/// # Example
2680///
2681/// Instantiate a resource method builder
2682///
2683/// ```test_harness,no_run
2684/// # extern crate hyper;
2685/// # extern crate hyper_rustls;
2686/// # extern crate google_plus1 as plus1;
2687/// # async fn dox() {
2688/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2689///
2690/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2691/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
2692/// # secret,
2693/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2694/// # ).build().await.unwrap();
2695///
2696/// # let client = hyper_util::client::legacy::Client::builder(
2697/// # hyper_util::rt::TokioExecutor::new()
2698/// # )
2699/// # .build(
2700/// # hyper_rustls::HttpsConnectorBuilder::new()
2701/// # .with_native_roots()
2702/// # .unwrap()
2703/// # .https_or_http()
2704/// # .enable_http1()
2705/// # .build()
2706/// # );
2707/// # let mut hub = Plus::new(client, auth);
2708/// // You can configure optional parameters by calling the respective setters at will, and
2709/// // execute the final call using `doit()`.
2710/// // Values shown here are possibly random and not representative !
2711/// let result = hub.comments().get("commentId")
2712/// .doit().await;
2713/// # }
2714/// ```
2715pub struct CommentGetCall<'a, C>
2716where
2717 C: 'a,
2718{
2719 hub: &'a Plus<C>,
2720 _comment_id: String,
2721 _delegate: Option<&'a mut dyn common::Delegate>,
2722 _additional_params: HashMap<String, String>,
2723 _scopes: BTreeSet<String>,
2724}
2725
2726impl<'a, C> common::CallBuilder for CommentGetCall<'a, C> {}
2727
2728impl<'a, C> CommentGetCall<'a, C>
2729where
2730 C: common::Connector,
2731{
2732 /// Perform the operation you have build so far.
2733 pub async fn doit(mut self) -> common::Result<(common::Response, Comment)> {
2734 use std::borrow::Cow;
2735 use std::io::{Read, Seek};
2736
2737 use common::{url::Params, ToParts};
2738 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
2739
2740 let mut dd = common::DefaultDelegate;
2741 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
2742 dlg.begin(common::MethodInfo {
2743 id: "plus.comments.get",
2744 http_method: hyper::Method::GET,
2745 });
2746
2747 for &field in ["alt", "commentId"].iter() {
2748 if self._additional_params.contains_key(field) {
2749 dlg.finished(false);
2750 return Err(common::Error::FieldClash(field));
2751 }
2752 }
2753
2754 let mut params = Params::with_capacity(3 + self._additional_params.len());
2755 params.push("commentId", self._comment_id);
2756
2757 params.extend(self._additional_params.iter());
2758
2759 params.push("alt", "json");
2760 let mut url = self.hub._base_url.clone() + "comments/{commentId}";
2761 if self._scopes.is_empty() {
2762 self._scopes.insert(Scope::Login.as_ref().to_string());
2763 }
2764
2765 #[allow(clippy::single_element_loop)]
2766 for &(find_this, param_name) in [("{commentId}", "commentId")].iter() {
2767 url = params.uri_replacement(url, param_name, find_this, false);
2768 }
2769 {
2770 let to_remove = ["commentId"];
2771 params.remove_params(&to_remove);
2772 }
2773
2774 let url = params.parse_with_url(&url);
2775
2776 loop {
2777 let token = match self
2778 .hub
2779 .auth
2780 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
2781 .await
2782 {
2783 Ok(token) => token,
2784 Err(e) => match dlg.token(e) {
2785 Ok(token) => token,
2786 Err(e) => {
2787 dlg.finished(false);
2788 return Err(common::Error::MissingToken(e));
2789 }
2790 },
2791 };
2792 let mut req_result = {
2793 let client = &self.hub.client;
2794 dlg.pre_request();
2795 let mut req_builder = hyper::Request::builder()
2796 .method(hyper::Method::GET)
2797 .uri(url.as_str())
2798 .header(USER_AGENT, self.hub._user_agent.clone());
2799
2800 if let Some(token) = token.as_ref() {
2801 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
2802 }
2803
2804 let request = req_builder
2805 .header(CONTENT_LENGTH, 0_u64)
2806 .body(common::to_body::<String>(None));
2807
2808 client.request(request.unwrap()).await
2809 };
2810
2811 match req_result {
2812 Err(err) => {
2813 if let common::Retry::After(d) = dlg.http_error(&err) {
2814 sleep(d).await;
2815 continue;
2816 }
2817 dlg.finished(false);
2818 return Err(common::Error::HttpError(err));
2819 }
2820 Ok(res) => {
2821 let (mut parts, body) = res.into_parts();
2822 let mut body = common::Body::new(body);
2823 if !parts.status.is_success() {
2824 let bytes = common::to_bytes(body).await.unwrap_or_default();
2825 let error = serde_json::from_str(&common::to_string(&bytes));
2826 let response = common::to_response(parts, bytes.into());
2827
2828 if let common::Retry::After(d) =
2829 dlg.http_failure(&response, error.as_ref().ok())
2830 {
2831 sleep(d).await;
2832 continue;
2833 }
2834
2835 dlg.finished(false);
2836
2837 return Err(match error {
2838 Ok(value) => common::Error::BadRequest(value),
2839 _ => common::Error::Failure(response),
2840 });
2841 }
2842 let response = {
2843 let bytes = common::to_bytes(body).await.unwrap_or_default();
2844 let encoded = common::to_string(&bytes);
2845 match serde_json::from_str(&encoded) {
2846 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
2847 Err(error) => {
2848 dlg.response_json_decode_error(&encoded, &error);
2849 return Err(common::Error::JsonDecodeError(
2850 encoded.to_string(),
2851 error,
2852 ));
2853 }
2854 }
2855 };
2856
2857 dlg.finished(true);
2858 return Ok(response);
2859 }
2860 }
2861 }
2862 }
2863
2864 /// The ID of the comment to get.
2865 ///
2866 /// Sets the *comment id* path property to the given value.
2867 ///
2868 /// Even though the property as already been set when instantiating this call,
2869 /// we provide this method for API completeness.
2870 pub fn comment_id(mut self, new_value: &str) -> CommentGetCall<'a, C> {
2871 self._comment_id = new_value.to_string();
2872 self
2873 }
2874 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
2875 /// while executing the actual API request.
2876 ///
2877 /// ````text
2878 /// It should be used to handle progress information, and to implement a certain level of resilience.
2879 /// ````
2880 ///
2881 /// Sets the *delegate* property to the given value.
2882 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> CommentGetCall<'a, C> {
2883 self._delegate = Some(new_value);
2884 self
2885 }
2886
2887 /// Set any additional parameter of the query string used in the request.
2888 /// It should be used to set parameters which are not yet available through their own
2889 /// setters.
2890 ///
2891 /// Please note that this method must not be used to set any of the known parameters
2892 /// which have their own setter method. If done anyway, the request will fail.
2893 ///
2894 /// # Additional Parameters
2895 ///
2896 /// * *alt* (query-string) - Data format for the response.
2897 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
2898 /// * *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.
2899 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
2900 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
2901 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
2902 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
2903 pub fn param<T>(mut self, name: T, value: T) -> CommentGetCall<'a, C>
2904 where
2905 T: AsRef<str>,
2906 {
2907 self._additional_params
2908 .insert(name.as_ref().to_string(), value.as_ref().to_string());
2909 self
2910 }
2911
2912 /// Identifies the authorization scope for the method you are building.
2913 ///
2914 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
2915 /// [`Scope::Login`].
2916 ///
2917 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
2918 /// tokens for more than one scope.
2919 ///
2920 /// Usually there is more than one suitable scope to authorize an operation, some of which may
2921 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
2922 /// sufficient, a read-write scope will do as well.
2923 pub fn add_scope<St>(mut self, scope: St) -> CommentGetCall<'a, C>
2924 where
2925 St: AsRef<str>,
2926 {
2927 self._scopes.insert(String::from(scope.as_ref()));
2928 self
2929 }
2930 /// Identifies the authorization scope(s) for the method you are building.
2931 ///
2932 /// See [`Self::add_scope()`] for details.
2933 pub fn add_scopes<I, St>(mut self, scopes: I) -> CommentGetCall<'a, C>
2934 where
2935 I: IntoIterator<Item = St>,
2936 St: AsRef<str>,
2937 {
2938 self._scopes
2939 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
2940 self
2941 }
2942
2943 /// Removes all scopes, and no default scope will be used either.
2944 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
2945 /// for details).
2946 pub fn clear_scopes(mut self) -> CommentGetCall<'a, C> {
2947 self._scopes.clear();
2948 self
2949 }
2950}
2951
2952/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
2953///
2954/// A builder for the *list* method supported by a *comment* resource.
2955/// It is not used directly, but through a [`CommentMethods`] instance.
2956///
2957/// # Example
2958///
2959/// Instantiate a resource method builder
2960///
2961/// ```test_harness,no_run
2962/// # extern crate hyper;
2963/// # extern crate hyper_rustls;
2964/// # extern crate google_plus1 as plus1;
2965/// # async fn dox() {
2966/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
2967///
2968/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
2969/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
2970/// # secret,
2971/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
2972/// # ).build().await.unwrap();
2973///
2974/// # let client = hyper_util::client::legacy::Client::builder(
2975/// # hyper_util::rt::TokioExecutor::new()
2976/// # )
2977/// # .build(
2978/// # hyper_rustls::HttpsConnectorBuilder::new()
2979/// # .with_native_roots()
2980/// # .unwrap()
2981/// # .https_or_http()
2982/// # .enable_http1()
2983/// # .build()
2984/// # );
2985/// # let mut hub = Plus::new(client, auth);
2986/// // You can configure optional parameters by calling the respective setters at will, and
2987/// // execute the final call using `doit()`.
2988/// // Values shown here are possibly random and not representative !
2989/// let result = hub.comments().list("activityId")
2990/// .sort_order("rebum.")
2991/// .page_token("est")
2992/// .max_results(51)
2993/// .doit().await;
2994/// # }
2995/// ```
2996pub struct CommentListCall<'a, C>
2997where
2998 C: 'a,
2999{
3000 hub: &'a Plus<C>,
3001 _activity_id: String,
3002 _sort_order: Option<String>,
3003 _page_token: Option<String>,
3004 _max_results: Option<u32>,
3005 _delegate: Option<&'a mut dyn common::Delegate>,
3006 _additional_params: HashMap<String, String>,
3007 _scopes: BTreeSet<String>,
3008}
3009
3010impl<'a, C> common::CallBuilder for CommentListCall<'a, C> {}
3011
3012impl<'a, C> CommentListCall<'a, C>
3013where
3014 C: common::Connector,
3015{
3016 /// Perform the operation you have build so far.
3017 pub async fn doit(mut self) -> common::Result<(common::Response, CommentFeed)> {
3018 use std::borrow::Cow;
3019 use std::io::{Read, Seek};
3020
3021 use common::{url::Params, ToParts};
3022 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3023
3024 let mut dd = common::DefaultDelegate;
3025 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3026 dlg.begin(common::MethodInfo {
3027 id: "plus.comments.list",
3028 http_method: hyper::Method::GET,
3029 });
3030
3031 for &field in ["alt", "activityId", "sortOrder", "pageToken", "maxResults"].iter() {
3032 if self._additional_params.contains_key(field) {
3033 dlg.finished(false);
3034 return Err(common::Error::FieldClash(field));
3035 }
3036 }
3037
3038 let mut params = Params::with_capacity(6 + self._additional_params.len());
3039 params.push("activityId", self._activity_id);
3040 if let Some(value) = self._sort_order.as_ref() {
3041 params.push("sortOrder", value);
3042 }
3043 if let Some(value) = self._page_token.as_ref() {
3044 params.push("pageToken", value);
3045 }
3046 if let Some(value) = self._max_results.as_ref() {
3047 params.push("maxResults", value.to_string());
3048 }
3049
3050 params.extend(self._additional_params.iter());
3051
3052 params.push("alt", "json");
3053 let mut url = self.hub._base_url.clone() + "activities/{activityId}/comments";
3054 if self._scopes.is_empty() {
3055 self._scopes.insert(Scope::Login.as_ref().to_string());
3056 }
3057
3058 #[allow(clippy::single_element_loop)]
3059 for &(find_this, param_name) in [("{activityId}", "activityId")].iter() {
3060 url = params.uri_replacement(url, param_name, find_this, false);
3061 }
3062 {
3063 let to_remove = ["activityId"];
3064 params.remove_params(&to_remove);
3065 }
3066
3067 let url = params.parse_with_url(&url);
3068
3069 loop {
3070 let token = match self
3071 .hub
3072 .auth
3073 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3074 .await
3075 {
3076 Ok(token) => token,
3077 Err(e) => match dlg.token(e) {
3078 Ok(token) => token,
3079 Err(e) => {
3080 dlg.finished(false);
3081 return Err(common::Error::MissingToken(e));
3082 }
3083 },
3084 };
3085 let mut req_result = {
3086 let client = &self.hub.client;
3087 dlg.pre_request();
3088 let mut req_builder = hyper::Request::builder()
3089 .method(hyper::Method::GET)
3090 .uri(url.as_str())
3091 .header(USER_AGENT, self.hub._user_agent.clone());
3092
3093 if let Some(token) = token.as_ref() {
3094 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3095 }
3096
3097 let request = req_builder
3098 .header(CONTENT_LENGTH, 0_u64)
3099 .body(common::to_body::<String>(None));
3100
3101 client.request(request.unwrap()).await
3102 };
3103
3104 match req_result {
3105 Err(err) => {
3106 if let common::Retry::After(d) = dlg.http_error(&err) {
3107 sleep(d).await;
3108 continue;
3109 }
3110 dlg.finished(false);
3111 return Err(common::Error::HttpError(err));
3112 }
3113 Ok(res) => {
3114 let (mut parts, body) = res.into_parts();
3115 let mut body = common::Body::new(body);
3116 if !parts.status.is_success() {
3117 let bytes = common::to_bytes(body).await.unwrap_or_default();
3118 let error = serde_json::from_str(&common::to_string(&bytes));
3119 let response = common::to_response(parts, bytes.into());
3120
3121 if let common::Retry::After(d) =
3122 dlg.http_failure(&response, error.as_ref().ok())
3123 {
3124 sleep(d).await;
3125 continue;
3126 }
3127
3128 dlg.finished(false);
3129
3130 return Err(match error {
3131 Ok(value) => common::Error::BadRequest(value),
3132 _ => common::Error::Failure(response),
3133 });
3134 }
3135 let response = {
3136 let bytes = common::to_bytes(body).await.unwrap_or_default();
3137 let encoded = common::to_string(&bytes);
3138 match serde_json::from_str(&encoded) {
3139 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3140 Err(error) => {
3141 dlg.response_json_decode_error(&encoded, &error);
3142 return Err(common::Error::JsonDecodeError(
3143 encoded.to_string(),
3144 error,
3145 ));
3146 }
3147 }
3148 };
3149
3150 dlg.finished(true);
3151 return Ok(response);
3152 }
3153 }
3154 }
3155 }
3156
3157 /// The ID of the activity to get comments for.
3158 ///
3159 /// Sets the *activity id* path property to the given value.
3160 ///
3161 /// Even though the property as already been set when instantiating this call,
3162 /// we provide this method for API completeness.
3163 pub fn activity_id(mut self, new_value: &str) -> CommentListCall<'a, C> {
3164 self._activity_id = new_value.to_string();
3165 self
3166 }
3167 /// The order in which to sort the list of comments.
3168 ///
3169 /// Sets the *sort order* query property to the given value.
3170 pub fn sort_order(mut self, new_value: &str) -> CommentListCall<'a, C> {
3171 self._sort_order = Some(new_value.to_string());
3172 self
3173 }
3174 /// 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.
3175 ///
3176 /// Sets the *page token* query property to the given value.
3177 pub fn page_token(mut self, new_value: &str) -> CommentListCall<'a, C> {
3178 self._page_token = Some(new_value.to_string());
3179 self
3180 }
3181 /// The maximum number of comments to include in the response, which is used for paging. For any response, the actual number returned might be less than the specified maxResults.
3182 ///
3183 /// Sets the *max results* query property to the given value.
3184 pub fn max_results(mut self, new_value: u32) -> CommentListCall<'a, C> {
3185 self._max_results = Some(new_value);
3186 self
3187 }
3188 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3189 /// while executing the actual API request.
3190 ///
3191 /// ````text
3192 /// It should be used to handle progress information, and to implement a certain level of resilience.
3193 /// ````
3194 ///
3195 /// Sets the *delegate* property to the given value.
3196 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> CommentListCall<'a, C> {
3197 self._delegate = Some(new_value);
3198 self
3199 }
3200
3201 /// Set any additional parameter of the query string used in the request.
3202 /// It should be used to set parameters which are not yet available through their own
3203 /// setters.
3204 ///
3205 /// Please note that this method must not be used to set any of the known parameters
3206 /// which have their own setter method. If done anyway, the request will fail.
3207 ///
3208 /// # Additional Parameters
3209 ///
3210 /// * *alt* (query-string) - Data format for the response.
3211 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3212 /// * *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.
3213 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3214 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3215 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
3216 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
3217 pub fn param<T>(mut self, name: T, value: T) -> CommentListCall<'a, C>
3218 where
3219 T: AsRef<str>,
3220 {
3221 self._additional_params
3222 .insert(name.as_ref().to_string(), value.as_ref().to_string());
3223 self
3224 }
3225
3226 /// Identifies the authorization scope for the method you are building.
3227 ///
3228 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3229 /// [`Scope::Login`].
3230 ///
3231 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3232 /// tokens for more than one scope.
3233 ///
3234 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3235 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3236 /// sufficient, a read-write scope will do as well.
3237 pub fn add_scope<St>(mut self, scope: St) -> CommentListCall<'a, C>
3238 where
3239 St: AsRef<str>,
3240 {
3241 self._scopes.insert(String::from(scope.as_ref()));
3242 self
3243 }
3244 /// Identifies the authorization scope(s) for the method you are building.
3245 ///
3246 /// See [`Self::add_scope()`] for details.
3247 pub fn add_scopes<I, St>(mut self, scopes: I) -> CommentListCall<'a, C>
3248 where
3249 I: IntoIterator<Item = St>,
3250 St: AsRef<str>,
3251 {
3252 self._scopes
3253 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3254 self
3255 }
3256
3257 /// Removes all scopes, and no default scope will be used either.
3258 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3259 /// for details).
3260 pub fn clear_scopes(mut self) -> CommentListCall<'a, C> {
3261 self._scopes.clear();
3262 self
3263 }
3264}
3265
3266/// Get a person's profile. If your app uses scope https://www.googleapis.com/auth/plus.login, this method is guaranteed to return ageRange and language.
3267///
3268/// A builder for the *get* method supported by a *person* resource.
3269/// It is not used directly, but through a [`PersonMethods`] instance.
3270///
3271/// # Example
3272///
3273/// Instantiate a resource method builder
3274///
3275/// ```test_harness,no_run
3276/// # extern crate hyper;
3277/// # extern crate hyper_rustls;
3278/// # extern crate google_plus1 as plus1;
3279/// # async fn dox() {
3280/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3281///
3282/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3283/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
3284/// # secret,
3285/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3286/// # ).build().await.unwrap();
3287///
3288/// # let client = hyper_util::client::legacy::Client::builder(
3289/// # hyper_util::rt::TokioExecutor::new()
3290/// # )
3291/// # .build(
3292/// # hyper_rustls::HttpsConnectorBuilder::new()
3293/// # .with_native_roots()
3294/// # .unwrap()
3295/// # .https_or_http()
3296/// # .enable_http1()
3297/// # .build()
3298/// # );
3299/// # let mut hub = Plus::new(client, auth);
3300/// // You can configure optional parameters by calling the respective setters at will, and
3301/// // execute the final call using `doit()`.
3302/// // Values shown here are possibly random and not representative !
3303/// let result = hub.people().get("userId")
3304/// .doit().await;
3305/// # }
3306/// ```
3307pub struct PersonGetCall<'a, C>
3308where
3309 C: 'a,
3310{
3311 hub: &'a Plus<C>,
3312 _user_id: String,
3313 _delegate: Option<&'a mut dyn common::Delegate>,
3314 _additional_params: HashMap<String, String>,
3315 _scopes: BTreeSet<String>,
3316}
3317
3318impl<'a, C> common::CallBuilder for PersonGetCall<'a, C> {}
3319
3320impl<'a, C> PersonGetCall<'a, C>
3321where
3322 C: common::Connector,
3323{
3324 /// Perform the operation you have build so far.
3325 pub async fn doit(mut self) -> common::Result<(common::Response, Person)> {
3326 use std::borrow::Cow;
3327 use std::io::{Read, Seek};
3328
3329 use common::{url::Params, ToParts};
3330 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3331
3332 let mut dd = common::DefaultDelegate;
3333 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3334 dlg.begin(common::MethodInfo {
3335 id: "plus.people.get",
3336 http_method: hyper::Method::GET,
3337 });
3338
3339 for &field in ["alt", "userId"].iter() {
3340 if self._additional_params.contains_key(field) {
3341 dlg.finished(false);
3342 return Err(common::Error::FieldClash(field));
3343 }
3344 }
3345
3346 let mut params = Params::with_capacity(3 + self._additional_params.len());
3347 params.push("userId", self._user_id);
3348
3349 params.extend(self._additional_params.iter());
3350
3351 params.push("alt", "json");
3352 let mut url = self.hub._base_url.clone() + "people/{userId}";
3353 if self._scopes.is_empty() {
3354 self._scopes.insert(Scope::Login.as_ref().to_string());
3355 }
3356
3357 #[allow(clippy::single_element_loop)]
3358 for &(find_this, param_name) in [("{userId}", "userId")].iter() {
3359 url = params.uri_replacement(url, param_name, find_this, false);
3360 }
3361 {
3362 let to_remove = ["userId"];
3363 params.remove_params(&to_remove);
3364 }
3365
3366 let url = params.parse_with_url(&url);
3367
3368 loop {
3369 let token = match self
3370 .hub
3371 .auth
3372 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3373 .await
3374 {
3375 Ok(token) => token,
3376 Err(e) => match dlg.token(e) {
3377 Ok(token) => token,
3378 Err(e) => {
3379 dlg.finished(false);
3380 return Err(common::Error::MissingToken(e));
3381 }
3382 },
3383 };
3384 let mut req_result = {
3385 let client = &self.hub.client;
3386 dlg.pre_request();
3387 let mut req_builder = hyper::Request::builder()
3388 .method(hyper::Method::GET)
3389 .uri(url.as_str())
3390 .header(USER_AGENT, self.hub._user_agent.clone());
3391
3392 if let Some(token) = token.as_ref() {
3393 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3394 }
3395
3396 let request = req_builder
3397 .header(CONTENT_LENGTH, 0_u64)
3398 .body(common::to_body::<String>(None));
3399
3400 client.request(request.unwrap()).await
3401 };
3402
3403 match req_result {
3404 Err(err) => {
3405 if let common::Retry::After(d) = dlg.http_error(&err) {
3406 sleep(d).await;
3407 continue;
3408 }
3409 dlg.finished(false);
3410 return Err(common::Error::HttpError(err));
3411 }
3412 Ok(res) => {
3413 let (mut parts, body) = res.into_parts();
3414 let mut body = common::Body::new(body);
3415 if !parts.status.is_success() {
3416 let bytes = common::to_bytes(body).await.unwrap_or_default();
3417 let error = serde_json::from_str(&common::to_string(&bytes));
3418 let response = common::to_response(parts, bytes.into());
3419
3420 if let common::Retry::After(d) =
3421 dlg.http_failure(&response, error.as_ref().ok())
3422 {
3423 sleep(d).await;
3424 continue;
3425 }
3426
3427 dlg.finished(false);
3428
3429 return Err(match error {
3430 Ok(value) => common::Error::BadRequest(value),
3431 _ => common::Error::Failure(response),
3432 });
3433 }
3434 let response = {
3435 let bytes = common::to_bytes(body).await.unwrap_or_default();
3436 let encoded = common::to_string(&bytes);
3437 match serde_json::from_str(&encoded) {
3438 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3439 Err(error) => {
3440 dlg.response_json_decode_error(&encoded, &error);
3441 return Err(common::Error::JsonDecodeError(
3442 encoded.to_string(),
3443 error,
3444 ));
3445 }
3446 }
3447 };
3448
3449 dlg.finished(true);
3450 return Ok(response);
3451 }
3452 }
3453 }
3454 }
3455
3456 /// The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user.
3457 ///
3458 /// Sets the *user id* path property to the given value.
3459 ///
3460 /// Even though the property as already been set when instantiating this call,
3461 /// we provide this method for API completeness.
3462 pub fn user_id(mut self, new_value: &str) -> PersonGetCall<'a, C> {
3463 self._user_id = new_value.to_string();
3464 self
3465 }
3466 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3467 /// while executing the actual API request.
3468 ///
3469 /// ````text
3470 /// It should be used to handle progress information, and to implement a certain level of resilience.
3471 /// ````
3472 ///
3473 /// Sets the *delegate* property to the given value.
3474 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> PersonGetCall<'a, C> {
3475 self._delegate = Some(new_value);
3476 self
3477 }
3478
3479 /// Set any additional parameter of the query string used in the request.
3480 /// It should be used to set parameters which are not yet available through their own
3481 /// setters.
3482 ///
3483 /// Please note that this method must not be used to set any of the known parameters
3484 /// which have their own setter method. If done anyway, the request will fail.
3485 ///
3486 /// # Additional Parameters
3487 ///
3488 /// * *alt* (query-string) - Data format for the response.
3489 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3490 /// * *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.
3491 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3492 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3493 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
3494 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
3495 pub fn param<T>(mut self, name: T, value: T) -> PersonGetCall<'a, C>
3496 where
3497 T: AsRef<str>,
3498 {
3499 self._additional_params
3500 .insert(name.as_ref().to_string(), value.as_ref().to_string());
3501 self
3502 }
3503
3504 /// Identifies the authorization scope for the method you are building.
3505 ///
3506 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3507 /// [`Scope::Login`].
3508 ///
3509 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3510 /// tokens for more than one scope.
3511 ///
3512 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3513 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3514 /// sufficient, a read-write scope will do as well.
3515 pub fn add_scope<St>(mut self, scope: St) -> PersonGetCall<'a, C>
3516 where
3517 St: AsRef<str>,
3518 {
3519 self._scopes.insert(String::from(scope.as_ref()));
3520 self
3521 }
3522 /// Identifies the authorization scope(s) for the method you are building.
3523 ///
3524 /// See [`Self::add_scope()`] for details.
3525 pub fn add_scopes<I, St>(mut self, scopes: I) -> PersonGetCall<'a, C>
3526 where
3527 I: IntoIterator<Item = St>,
3528 St: AsRef<str>,
3529 {
3530 self._scopes
3531 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3532 self
3533 }
3534
3535 /// Removes all scopes, and no default scope will be used either.
3536 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3537 /// for details).
3538 pub fn clear_scopes(mut self) -> PersonGetCall<'a, C> {
3539 self._scopes.clear();
3540 self
3541 }
3542}
3543
3544/// List all of the people in the specified collection.
3545///
3546/// A builder for the *list* method supported by a *person* resource.
3547/// It is not used directly, but through a [`PersonMethods`] instance.
3548///
3549/// # Example
3550///
3551/// Instantiate a resource method builder
3552///
3553/// ```test_harness,no_run
3554/// # extern crate hyper;
3555/// # extern crate hyper_rustls;
3556/// # extern crate google_plus1 as plus1;
3557/// # async fn dox() {
3558/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3559///
3560/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3561/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
3562/// # secret,
3563/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3564/// # ).build().await.unwrap();
3565///
3566/// # let client = hyper_util::client::legacy::Client::builder(
3567/// # hyper_util::rt::TokioExecutor::new()
3568/// # )
3569/// # .build(
3570/// # hyper_rustls::HttpsConnectorBuilder::new()
3571/// # .with_native_roots()
3572/// # .unwrap()
3573/// # .https_or_http()
3574/// # .enable_http1()
3575/// # .build()
3576/// # );
3577/// # let mut hub = Plus::new(client, auth);
3578/// // You can configure optional parameters by calling the respective setters at will, and
3579/// // execute the final call using `doit()`.
3580/// // Values shown here are possibly random and not representative !
3581/// let result = hub.people().list("userId", "collection")
3582/// .page_token("ea")
3583/// .order_by("dolor")
3584/// .max_results(45)
3585/// .doit().await;
3586/// # }
3587/// ```
3588pub struct PersonListCall<'a, C>
3589where
3590 C: 'a,
3591{
3592 hub: &'a Plus<C>,
3593 _user_id: String,
3594 _collection: String,
3595 _page_token: Option<String>,
3596 _order_by: Option<String>,
3597 _max_results: Option<u32>,
3598 _delegate: Option<&'a mut dyn common::Delegate>,
3599 _additional_params: HashMap<String, String>,
3600 _scopes: BTreeSet<String>,
3601}
3602
3603impl<'a, C> common::CallBuilder for PersonListCall<'a, C> {}
3604
3605impl<'a, C> PersonListCall<'a, C>
3606where
3607 C: common::Connector,
3608{
3609 /// Perform the operation you have build so far.
3610 pub async fn doit(mut self) -> common::Result<(common::Response, PeopleFeed)> {
3611 use std::borrow::Cow;
3612 use std::io::{Read, Seek};
3613
3614 use common::{url::Params, ToParts};
3615 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3616
3617 let mut dd = common::DefaultDelegate;
3618 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3619 dlg.begin(common::MethodInfo {
3620 id: "plus.people.list",
3621 http_method: hyper::Method::GET,
3622 });
3623
3624 for &field in [
3625 "alt",
3626 "userId",
3627 "collection",
3628 "pageToken",
3629 "orderBy",
3630 "maxResults",
3631 ]
3632 .iter()
3633 {
3634 if self._additional_params.contains_key(field) {
3635 dlg.finished(false);
3636 return Err(common::Error::FieldClash(field));
3637 }
3638 }
3639
3640 let mut params = Params::with_capacity(7 + self._additional_params.len());
3641 params.push("userId", self._user_id);
3642 params.push("collection", self._collection);
3643 if let Some(value) = self._page_token.as_ref() {
3644 params.push("pageToken", value);
3645 }
3646 if let Some(value) = self._order_by.as_ref() {
3647 params.push("orderBy", value);
3648 }
3649 if let Some(value) = self._max_results.as_ref() {
3650 params.push("maxResults", value.to_string());
3651 }
3652
3653 params.extend(self._additional_params.iter());
3654
3655 params.push("alt", "json");
3656 let mut url = self.hub._base_url.clone() + "people/{userId}/people/{collection}";
3657 if self._scopes.is_empty() {
3658 self._scopes.insert(Scope::Login.as_ref().to_string());
3659 }
3660
3661 #[allow(clippy::single_element_loop)]
3662 for &(find_this, param_name) in
3663 [("{userId}", "userId"), ("{collection}", "collection")].iter()
3664 {
3665 url = params.uri_replacement(url, param_name, find_this, false);
3666 }
3667 {
3668 let to_remove = ["collection", "userId"];
3669 params.remove_params(&to_remove);
3670 }
3671
3672 let url = params.parse_with_url(&url);
3673
3674 loop {
3675 let token = match self
3676 .hub
3677 .auth
3678 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
3679 .await
3680 {
3681 Ok(token) => token,
3682 Err(e) => match dlg.token(e) {
3683 Ok(token) => token,
3684 Err(e) => {
3685 dlg.finished(false);
3686 return Err(common::Error::MissingToken(e));
3687 }
3688 },
3689 };
3690 let mut req_result = {
3691 let client = &self.hub.client;
3692 dlg.pre_request();
3693 let mut req_builder = hyper::Request::builder()
3694 .method(hyper::Method::GET)
3695 .uri(url.as_str())
3696 .header(USER_AGENT, self.hub._user_agent.clone());
3697
3698 if let Some(token) = token.as_ref() {
3699 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
3700 }
3701
3702 let request = req_builder
3703 .header(CONTENT_LENGTH, 0_u64)
3704 .body(common::to_body::<String>(None));
3705
3706 client.request(request.unwrap()).await
3707 };
3708
3709 match req_result {
3710 Err(err) => {
3711 if let common::Retry::After(d) = dlg.http_error(&err) {
3712 sleep(d).await;
3713 continue;
3714 }
3715 dlg.finished(false);
3716 return Err(common::Error::HttpError(err));
3717 }
3718 Ok(res) => {
3719 let (mut parts, body) = res.into_parts();
3720 let mut body = common::Body::new(body);
3721 if !parts.status.is_success() {
3722 let bytes = common::to_bytes(body).await.unwrap_or_default();
3723 let error = serde_json::from_str(&common::to_string(&bytes));
3724 let response = common::to_response(parts, bytes.into());
3725
3726 if let common::Retry::After(d) =
3727 dlg.http_failure(&response, error.as_ref().ok())
3728 {
3729 sleep(d).await;
3730 continue;
3731 }
3732
3733 dlg.finished(false);
3734
3735 return Err(match error {
3736 Ok(value) => common::Error::BadRequest(value),
3737 _ => common::Error::Failure(response),
3738 });
3739 }
3740 let response = {
3741 let bytes = common::to_bytes(body).await.unwrap_or_default();
3742 let encoded = common::to_string(&bytes);
3743 match serde_json::from_str(&encoded) {
3744 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
3745 Err(error) => {
3746 dlg.response_json_decode_error(&encoded, &error);
3747 return Err(common::Error::JsonDecodeError(
3748 encoded.to_string(),
3749 error,
3750 ));
3751 }
3752 }
3753 };
3754
3755 dlg.finished(true);
3756 return Ok(response);
3757 }
3758 }
3759 }
3760 }
3761
3762 /// Get the collection of people for the person identified. Use "me" to indicate the authenticated user.
3763 ///
3764 /// Sets the *user id* path property to the given value.
3765 ///
3766 /// Even though the property as already been set when instantiating this call,
3767 /// we provide this method for API completeness.
3768 pub fn user_id(mut self, new_value: &str) -> PersonListCall<'a, C> {
3769 self._user_id = new_value.to_string();
3770 self
3771 }
3772 /// The collection of people to list.
3773 ///
3774 /// Sets the *collection* path property to the given value.
3775 ///
3776 /// Even though the property as already been set when instantiating this call,
3777 /// we provide this method for API completeness.
3778 pub fn collection(mut self, new_value: &str) -> PersonListCall<'a, C> {
3779 self._collection = new_value.to_string();
3780 self
3781 }
3782 /// 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.
3783 ///
3784 /// Sets the *page token* query property to the given value.
3785 pub fn page_token(mut self, new_value: &str) -> PersonListCall<'a, C> {
3786 self._page_token = Some(new_value.to_string());
3787 self
3788 }
3789 /// The order to return people in.
3790 ///
3791 /// Sets the *order by* query property to the given value.
3792 pub fn order_by(mut self, new_value: &str) -> PersonListCall<'a, C> {
3793 self._order_by = Some(new_value.to_string());
3794 self
3795 }
3796 /// 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.
3797 ///
3798 /// Sets the *max results* query property to the given value.
3799 pub fn max_results(mut self, new_value: u32) -> PersonListCall<'a, C> {
3800 self._max_results = Some(new_value);
3801 self
3802 }
3803 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
3804 /// while executing the actual API request.
3805 ///
3806 /// ````text
3807 /// It should be used to handle progress information, and to implement a certain level of resilience.
3808 /// ````
3809 ///
3810 /// Sets the *delegate* property to the given value.
3811 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> PersonListCall<'a, C> {
3812 self._delegate = Some(new_value);
3813 self
3814 }
3815
3816 /// Set any additional parameter of the query string used in the request.
3817 /// It should be used to set parameters which are not yet available through their own
3818 /// setters.
3819 ///
3820 /// Please note that this method must not be used to set any of the known parameters
3821 /// which have their own setter method. If done anyway, the request will fail.
3822 ///
3823 /// # Additional Parameters
3824 ///
3825 /// * *alt* (query-string) - Data format for the response.
3826 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
3827 /// * *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.
3828 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
3829 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
3830 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
3831 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
3832 pub fn param<T>(mut self, name: T, value: T) -> PersonListCall<'a, C>
3833 where
3834 T: AsRef<str>,
3835 {
3836 self._additional_params
3837 .insert(name.as_ref().to_string(), value.as_ref().to_string());
3838 self
3839 }
3840
3841 /// Identifies the authorization scope for the method you are building.
3842 ///
3843 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
3844 /// [`Scope::Login`].
3845 ///
3846 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
3847 /// tokens for more than one scope.
3848 ///
3849 /// Usually there is more than one suitable scope to authorize an operation, some of which may
3850 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
3851 /// sufficient, a read-write scope will do as well.
3852 pub fn add_scope<St>(mut self, scope: St) -> PersonListCall<'a, C>
3853 where
3854 St: AsRef<str>,
3855 {
3856 self._scopes.insert(String::from(scope.as_ref()));
3857 self
3858 }
3859 /// Identifies the authorization scope(s) for the method you are building.
3860 ///
3861 /// See [`Self::add_scope()`] for details.
3862 pub fn add_scopes<I, St>(mut self, scopes: I) -> PersonListCall<'a, C>
3863 where
3864 I: IntoIterator<Item = St>,
3865 St: AsRef<str>,
3866 {
3867 self._scopes
3868 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
3869 self
3870 }
3871
3872 /// Removes all scopes, and no default scope will be used either.
3873 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
3874 /// for details).
3875 pub fn clear_scopes(mut self) -> PersonListCall<'a, C> {
3876 self._scopes.clear();
3877 self
3878 }
3879}
3880
3881/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
3882///
3883/// A builder for the *listByActivity* method supported by a *person* resource.
3884/// It is not used directly, but through a [`PersonMethods`] instance.
3885///
3886/// # Example
3887///
3888/// Instantiate a resource method builder
3889///
3890/// ```test_harness,no_run
3891/// # extern crate hyper;
3892/// # extern crate hyper_rustls;
3893/// # extern crate google_plus1 as plus1;
3894/// # async fn dox() {
3895/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
3896///
3897/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
3898/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
3899/// # secret,
3900/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
3901/// # ).build().await.unwrap();
3902///
3903/// # let client = hyper_util::client::legacy::Client::builder(
3904/// # hyper_util::rt::TokioExecutor::new()
3905/// # )
3906/// # .build(
3907/// # hyper_rustls::HttpsConnectorBuilder::new()
3908/// # .with_native_roots()
3909/// # .unwrap()
3910/// # .https_or_http()
3911/// # .enable_http1()
3912/// # .build()
3913/// # );
3914/// # let mut hub = Plus::new(client, auth);
3915/// // You can configure optional parameters by calling the respective setters at will, and
3916/// // execute the final call using `doit()`.
3917/// // Values shown here are possibly random and not representative !
3918/// let result = hub.people().list_by_activity("activityId", "collection")
3919/// .page_token("sed")
3920/// .max_results(31)
3921/// .doit().await;
3922/// # }
3923/// ```
3924pub struct PersonListByActivityCall<'a, C>
3925where
3926 C: 'a,
3927{
3928 hub: &'a Plus<C>,
3929 _activity_id: String,
3930 _collection: String,
3931 _page_token: Option<String>,
3932 _max_results: Option<u32>,
3933 _delegate: Option<&'a mut dyn common::Delegate>,
3934 _additional_params: HashMap<String, String>,
3935 _scopes: BTreeSet<String>,
3936}
3937
3938impl<'a, C> common::CallBuilder for PersonListByActivityCall<'a, C> {}
3939
3940impl<'a, C> PersonListByActivityCall<'a, C>
3941where
3942 C: common::Connector,
3943{
3944 /// Perform the operation you have build so far.
3945 pub async fn doit(mut self) -> common::Result<(common::Response, PeopleFeed)> {
3946 use std::borrow::Cow;
3947 use std::io::{Read, Seek};
3948
3949 use common::{url::Params, ToParts};
3950 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
3951
3952 let mut dd = common::DefaultDelegate;
3953 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
3954 dlg.begin(common::MethodInfo {
3955 id: "plus.people.listByActivity",
3956 http_method: hyper::Method::GET,
3957 });
3958
3959 for &field in ["alt", "activityId", "collection", "pageToken", "maxResults"].iter() {
3960 if self._additional_params.contains_key(field) {
3961 dlg.finished(false);
3962 return Err(common::Error::FieldClash(field));
3963 }
3964 }
3965
3966 let mut params = Params::with_capacity(6 + self._additional_params.len());
3967 params.push("activityId", self._activity_id);
3968 params.push("collection", self._collection);
3969 if let Some(value) = self._page_token.as_ref() {
3970 params.push("pageToken", value);
3971 }
3972 if let Some(value) = self._max_results.as_ref() {
3973 params.push("maxResults", value.to_string());
3974 }
3975
3976 params.extend(self._additional_params.iter());
3977
3978 params.push("alt", "json");
3979 let mut url = self.hub._base_url.clone() + "activities/{activityId}/people/{collection}";
3980 if self._scopes.is_empty() {
3981 self._scopes.insert(Scope::Login.as_ref().to_string());
3982 }
3983
3984 #[allow(clippy::single_element_loop)]
3985 for &(find_this, param_name) in [
3986 ("{activityId}", "activityId"),
3987 ("{collection}", "collection"),
3988 ]
3989 .iter()
3990 {
3991 url = params.uri_replacement(url, param_name, find_this, false);
3992 }
3993 {
3994 let to_remove = ["collection", "activityId"];
3995 params.remove_params(&to_remove);
3996 }
3997
3998 let url = params.parse_with_url(&url);
3999
4000 loop {
4001 let token = match self
4002 .hub
4003 .auth
4004 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4005 .await
4006 {
4007 Ok(token) => token,
4008 Err(e) => match dlg.token(e) {
4009 Ok(token) => token,
4010 Err(e) => {
4011 dlg.finished(false);
4012 return Err(common::Error::MissingToken(e));
4013 }
4014 },
4015 };
4016 let mut req_result = {
4017 let client = &self.hub.client;
4018 dlg.pre_request();
4019 let mut req_builder = hyper::Request::builder()
4020 .method(hyper::Method::GET)
4021 .uri(url.as_str())
4022 .header(USER_AGENT, self.hub._user_agent.clone());
4023
4024 if let Some(token) = token.as_ref() {
4025 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4026 }
4027
4028 let request = req_builder
4029 .header(CONTENT_LENGTH, 0_u64)
4030 .body(common::to_body::<String>(None));
4031
4032 client.request(request.unwrap()).await
4033 };
4034
4035 match req_result {
4036 Err(err) => {
4037 if let common::Retry::After(d) = dlg.http_error(&err) {
4038 sleep(d).await;
4039 continue;
4040 }
4041 dlg.finished(false);
4042 return Err(common::Error::HttpError(err));
4043 }
4044 Ok(res) => {
4045 let (mut parts, body) = res.into_parts();
4046 let mut body = common::Body::new(body);
4047 if !parts.status.is_success() {
4048 let bytes = common::to_bytes(body).await.unwrap_or_default();
4049 let error = serde_json::from_str(&common::to_string(&bytes));
4050 let response = common::to_response(parts, bytes.into());
4051
4052 if let common::Retry::After(d) =
4053 dlg.http_failure(&response, error.as_ref().ok())
4054 {
4055 sleep(d).await;
4056 continue;
4057 }
4058
4059 dlg.finished(false);
4060
4061 return Err(match error {
4062 Ok(value) => common::Error::BadRequest(value),
4063 _ => common::Error::Failure(response),
4064 });
4065 }
4066 let response = {
4067 let bytes = common::to_bytes(body).await.unwrap_or_default();
4068 let encoded = common::to_string(&bytes);
4069 match serde_json::from_str(&encoded) {
4070 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
4071 Err(error) => {
4072 dlg.response_json_decode_error(&encoded, &error);
4073 return Err(common::Error::JsonDecodeError(
4074 encoded.to_string(),
4075 error,
4076 ));
4077 }
4078 }
4079 };
4080
4081 dlg.finished(true);
4082 return Ok(response);
4083 }
4084 }
4085 }
4086 }
4087
4088 /// The ID of the activity to get the list of people for.
4089 ///
4090 /// Sets the *activity id* path property to the given value.
4091 ///
4092 /// Even though the property as already been set when instantiating this call,
4093 /// we provide this method for API completeness.
4094 pub fn activity_id(mut self, new_value: &str) -> PersonListByActivityCall<'a, C> {
4095 self._activity_id = new_value.to_string();
4096 self
4097 }
4098 /// The collection of people to list.
4099 ///
4100 /// Sets the *collection* path property to the given value.
4101 ///
4102 /// Even though the property as already been set when instantiating this call,
4103 /// we provide this method for API completeness.
4104 pub fn collection(mut self, new_value: &str) -> PersonListByActivityCall<'a, C> {
4105 self._collection = new_value.to_string();
4106 self
4107 }
4108 /// 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.
4109 ///
4110 /// Sets the *page token* query property to the given value.
4111 pub fn page_token(mut self, new_value: &str) -> PersonListByActivityCall<'a, C> {
4112 self._page_token = Some(new_value.to_string());
4113 self
4114 }
4115 /// 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.
4116 ///
4117 /// Sets the *max results* query property to the given value.
4118 pub fn max_results(mut self, new_value: u32) -> PersonListByActivityCall<'a, C> {
4119 self._max_results = Some(new_value);
4120 self
4121 }
4122 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4123 /// while executing the actual API request.
4124 ///
4125 /// ````text
4126 /// It should be used to handle progress information, and to implement a certain level of resilience.
4127 /// ````
4128 ///
4129 /// Sets the *delegate* property to the given value.
4130 pub fn delegate(
4131 mut self,
4132 new_value: &'a mut dyn common::Delegate,
4133 ) -> PersonListByActivityCall<'a, C> {
4134 self._delegate = Some(new_value);
4135 self
4136 }
4137
4138 /// Set any additional parameter of the query string used in the request.
4139 /// It should be used to set parameters which are not yet available through their own
4140 /// setters.
4141 ///
4142 /// Please note that this method must not be used to set any of the known parameters
4143 /// which have their own setter method. If done anyway, the request will fail.
4144 ///
4145 /// # Additional Parameters
4146 ///
4147 /// * *alt* (query-string) - Data format for the response.
4148 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4149 /// * *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.
4150 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4151 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4152 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
4153 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
4154 pub fn param<T>(mut self, name: T, value: T) -> PersonListByActivityCall<'a, C>
4155 where
4156 T: AsRef<str>,
4157 {
4158 self._additional_params
4159 .insert(name.as_ref().to_string(), value.as_ref().to_string());
4160 self
4161 }
4162
4163 /// Identifies the authorization scope for the method you are building.
4164 ///
4165 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4166 /// [`Scope::Login`].
4167 ///
4168 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4169 /// tokens for more than one scope.
4170 ///
4171 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4172 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4173 /// sufficient, a read-write scope will do as well.
4174 pub fn add_scope<St>(mut self, scope: St) -> PersonListByActivityCall<'a, C>
4175 where
4176 St: AsRef<str>,
4177 {
4178 self._scopes.insert(String::from(scope.as_ref()));
4179 self
4180 }
4181 /// Identifies the authorization scope(s) for the method you are building.
4182 ///
4183 /// See [`Self::add_scope()`] for details.
4184 pub fn add_scopes<I, St>(mut self, scopes: I) -> PersonListByActivityCall<'a, C>
4185 where
4186 I: IntoIterator<Item = St>,
4187 St: AsRef<str>,
4188 {
4189 self._scopes
4190 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4191 self
4192 }
4193
4194 /// Removes all scopes, and no default scope will be used either.
4195 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4196 /// for details).
4197 pub fn clear_scopes(mut self) -> PersonListByActivityCall<'a, C> {
4198 self._scopes.clear();
4199 self
4200 }
4201}
4202
4203/// Shut down. See https://developers.google.com/+/api-shutdown for more details.
4204///
4205/// A builder for the *search* method supported by a *person* resource.
4206/// It is not used directly, but through a [`PersonMethods`] instance.
4207///
4208/// # Example
4209///
4210/// Instantiate a resource method builder
4211///
4212/// ```test_harness,no_run
4213/// # extern crate hyper;
4214/// # extern crate hyper_rustls;
4215/// # extern crate google_plus1 as plus1;
4216/// # async fn dox() {
4217/// # use plus1::{Plus, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
4218///
4219/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
4220/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
4221/// # secret,
4222/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
4223/// # ).build().await.unwrap();
4224///
4225/// # let client = hyper_util::client::legacy::Client::builder(
4226/// # hyper_util::rt::TokioExecutor::new()
4227/// # )
4228/// # .build(
4229/// # hyper_rustls::HttpsConnectorBuilder::new()
4230/// # .with_native_roots()
4231/// # .unwrap()
4232/// # .https_or_http()
4233/// # .enable_http1()
4234/// # .build()
4235/// # );
4236/// # let mut hub = Plus::new(client, auth);
4237/// // You can configure optional parameters by calling the respective setters at will, and
4238/// // execute the final call using `doit()`.
4239/// // Values shown here are possibly random and not representative !
4240/// let result = hub.people().search("query")
4241/// .page_token("no")
4242/// .max_results(86)
4243/// .language("kasd")
4244/// .doit().await;
4245/// # }
4246/// ```
4247pub struct PersonSearchCall<'a, C>
4248where
4249 C: 'a,
4250{
4251 hub: &'a Plus<C>,
4252 _query: String,
4253 _page_token: Option<String>,
4254 _max_results: Option<u32>,
4255 _language: Option<String>,
4256 _delegate: Option<&'a mut dyn common::Delegate>,
4257 _additional_params: HashMap<String, String>,
4258 _scopes: BTreeSet<String>,
4259}
4260
4261impl<'a, C> common::CallBuilder for PersonSearchCall<'a, C> {}
4262
4263impl<'a, C> PersonSearchCall<'a, C>
4264where
4265 C: common::Connector,
4266{
4267 /// Perform the operation you have build so far.
4268 pub async fn doit(mut self) -> common::Result<(common::Response, PeopleFeed)> {
4269 use std::borrow::Cow;
4270 use std::io::{Read, Seek};
4271
4272 use common::{url::Params, ToParts};
4273 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
4274
4275 let mut dd = common::DefaultDelegate;
4276 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
4277 dlg.begin(common::MethodInfo {
4278 id: "plus.people.search",
4279 http_method: hyper::Method::GET,
4280 });
4281
4282 for &field in ["alt", "query", "pageToken", "maxResults", "language"].iter() {
4283 if self._additional_params.contains_key(field) {
4284 dlg.finished(false);
4285 return Err(common::Error::FieldClash(field));
4286 }
4287 }
4288
4289 let mut params = Params::with_capacity(6 + self._additional_params.len());
4290 params.push("query", self._query);
4291 if let Some(value) = self._page_token.as_ref() {
4292 params.push("pageToken", value);
4293 }
4294 if let Some(value) = self._max_results.as_ref() {
4295 params.push("maxResults", value.to_string());
4296 }
4297 if let Some(value) = self._language.as_ref() {
4298 params.push("language", value);
4299 }
4300
4301 params.extend(self._additional_params.iter());
4302
4303 params.push("alt", "json");
4304 let mut url = self.hub._base_url.clone() + "people";
4305 if self._scopes.is_empty() {
4306 self._scopes.insert(Scope::Login.as_ref().to_string());
4307 }
4308
4309 let url = params.parse_with_url(&url);
4310
4311 loop {
4312 let token = match self
4313 .hub
4314 .auth
4315 .get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..])
4316 .await
4317 {
4318 Ok(token) => token,
4319 Err(e) => match dlg.token(e) {
4320 Ok(token) => token,
4321 Err(e) => {
4322 dlg.finished(false);
4323 return Err(common::Error::MissingToken(e));
4324 }
4325 },
4326 };
4327 let mut req_result = {
4328 let client = &self.hub.client;
4329 dlg.pre_request();
4330 let mut req_builder = hyper::Request::builder()
4331 .method(hyper::Method::GET)
4332 .uri(url.as_str())
4333 .header(USER_AGENT, self.hub._user_agent.clone());
4334
4335 if let Some(token) = token.as_ref() {
4336 req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
4337 }
4338
4339 let request = req_builder
4340 .header(CONTENT_LENGTH, 0_u64)
4341 .body(common::to_body::<String>(None));
4342
4343 client.request(request.unwrap()).await
4344 };
4345
4346 match req_result {
4347 Err(err) => {
4348 if let common::Retry::After(d) = dlg.http_error(&err) {
4349 sleep(d).await;
4350 continue;
4351 }
4352 dlg.finished(false);
4353 return Err(common::Error::HttpError(err));
4354 }
4355 Ok(res) => {
4356 let (mut parts, body) = res.into_parts();
4357 let mut body = common::Body::new(body);
4358 if !parts.status.is_success() {
4359 let bytes = common::to_bytes(body).await.unwrap_or_default();
4360 let error = serde_json::from_str(&common::to_string(&bytes));
4361 let response = common::to_response(parts, bytes.into());
4362
4363 if let common::Retry::After(d) =
4364 dlg.http_failure(&response, error.as_ref().ok())
4365 {
4366 sleep(d).await;
4367 continue;
4368 }
4369
4370 dlg.finished(false);
4371
4372 return Err(match error {
4373 Ok(value) => common::Error::BadRequest(value),
4374 _ => common::Error::Failure(response),
4375 });
4376 }
4377 let response = {
4378 let bytes = common::to_bytes(body).await.unwrap_or_default();
4379 let encoded = common::to_string(&bytes);
4380 match serde_json::from_str(&encoded) {
4381 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
4382 Err(error) => {
4383 dlg.response_json_decode_error(&encoded, &error);
4384 return Err(common::Error::JsonDecodeError(
4385 encoded.to_string(),
4386 error,
4387 ));
4388 }
4389 }
4390 };
4391
4392 dlg.finished(true);
4393 return Ok(response);
4394 }
4395 }
4396 }
4397 }
4398
4399 /// Specify a query string for full text search of public text in all profiles.
4400 ///
4401 /// Sets the *query* query property to the given value.
4402 ///
4403 /// Even though the property as already been set when instantiating this call,
4404 /// we provide this method for API completeness.
4405 pub fn query(mut self, new_value: &str) -> PersonSearchCall<'a, C> {
4406 self._query = new_value.to_string();
4407 self
4408 }
4409 /// 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. This token can be of any length.
4410 ///
4411 /// Sets the *page token* query property to the given value.
4412 pub fn page_token(mut self, new_value: &str) -> PersonSearchCall<'a, C> {
4413 self._page_token = Some(new_value.to_string());
4414 self
4415 }
4416 /// 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.
4417 ///
4418 /// Sets the *max results* query property to the given value.
4419 pub fn max_results(mut self, new_value: u32) -> PersonSearchCall<'a, C> {
4420 self._max_results = Some(new_value);
4421 self
4422 }
4423 /// Specify the preferred language to search with. See search language codes for available values.
4424 ///
4425 /// Sets the *language* query property to the given value.
4426 pub fn language(mut self, new_value: &str) -> PersonSearchCall<'a, C> {
4427 self._language = Some(new_value.to_string());
4428 self
4429 }
4430 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
4431 /// while executing the actual API request.
4432 ///
4433 /// ````text
4434 /// It should be used to handle progress information, and to implement a certain level of resilience.
4435 /// ````
4436 ///
4437 /// Sets the *delegate* property to the given value.
4438 pub fn delegate(mut self, new_value: &'a mut dyn common::Delegate) -> PersonSearchCall<'a, C> {
4439 self._delegate = Some(new_value);
4440 self
4441 }
4442
4443 /// Set any additional parameter of the query string used in the request.
4444 /// It should be used to set parameters which are not yet available through their own
4445 /// setters.
4446 ///
4447 /// Please note that this method must not be used to set any of the known parameters
4448 /// which have their own setter method. If done anyway, the request will fail.
4449 ///
4450 /// # Additional Parameters
4451 ///
4452 /// * *alt* (query-string) - Data format for the response.
4453 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
4454 /// * *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.
4455 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
4456 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
4457 /// * *quotaUser* (query-string) - An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
4458 /// * *userIp* (query-string) - Deprecated. Please use quotaUser instead.
4459 pub fn param<T>(mut self, name: T, value: T) -> PersonSearchCall<'a, C>
4460 where
4461 T: AsRef<str>,
4462 {
4463 self._additional_params
4464 .insert(name.as_ref().to_string(), value.as_ref().to_string());
4465 self
4466 }
4467
4468 /// Identifies the authorization scope for the method you are building.
4469 ///
4470 /// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
4471 /// [`Scope::Login`].
4472 ///
4473 /// The `scope` will be added to a set of scopes. This is important as one can maintain access
4474 /// tokens for more than one scope.
4475 ///
4476 /// Usually there is more than one suitable scope to authorize an operation, some of which may
4477 /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
4478 /// sufficient, a read-write scope will do as well.
4479 pub fn add_scope<St>(mut self, scope: St) -> PersonSearchCall<'a, C>
4480 where
4481 St: AsRef<str>,
4482 {
4483 self._scopes.insert(String::from(scope.as_ref()));
4484 self
4485 }
4486 /// Identifies the authorization scope(s) for the method you are building.
4487 ///
4488 /// See [`Self::add_scope()`] for details.
4489 pub fn add_scopes<I, St>(mut self, scopes: I) -> PersonSearchCall<'a, C>
4490 where
4491 I: IntoIterator<Item = St>,
4492 St: AsRef<str>,
4493 {
4494 self._scopes
4495 .extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
4496 self
4497 }
4498
4499 /// Removes all scopes, and no default scope will be used either.
4500 /// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
4501 /// for details).
4502 pub fn clear_scopes(mut self) -> PersonSearchCall<'a, C> {
4503 self._scopes.clear();
4504 self
4505 }
4506}