google_ideahub1_beta/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// ########
12// HUB ###
13// ######
14
15/// Central instance to access all Ideahub related resource activities
16///
17/// # Examples
18///
19/// Instantiate a new hub
20///
21/// ```test_harness,no_run
22/// extern crate hyper;
23/// extern crate hyper_rustls;
24/// extern crate google_ideahub1_beta as ideahub1_beta;
25/// use ideahub1_beta::api::GoogleSearchIdeahubV1betaIdeaActivity;
26/// use ideahub1_beta::{Result, Error};
27/// # async fn dox() {
28/// use ideahub1_beta::{Ideahub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
29///
30/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
31/// // `client_secret`, among other things.
32/// let secret: yup_oauth2::ApplicationSecret = Default::default();
33/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
34/// // unless you replace `None` with the desired Flow.
35/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
36/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
37/// // retrieve them from storage.
38/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
39/// .with_native_roots()
40/// .unwrap()
41/// .https_only()
42/// .enable_http2()
43/// .build();
44///
45/// let executor = hyper_util::rt::TokioExecutor::new();
46/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
47/// secret,
48/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
49/// yup_oauth2::client::CustomHyperClientBuilder::from(
50/// hyper_util::client::legacy::Client::builder(executor).build(connector),
51/// ),
52/// ).build().await.unwrap();
53///
54/// let client = hyper_util::client::legacy::Client::builder(
55/// hyper_util::rt::TokioExecutor::new()
56/// )
57/// .build(
58/// hyper_rustls::HttpsConnectorBuilder::new()
59/// .with_native_roots()
60/// .unwrap()
61/// .https_or_http()
62/// .enable_http2()
63/// .build()
64/// );
65/// let mut hub = Ideahub::new(client, auth);
66/// // As the method needs a request, you would usually fill it with the desired information
67/// // into the respective structure. Some of the parts shown here might not be applicable !
68/// // Values shown here are possibly random and not representative !
69/// let mut req = GoogleSearchIdeahubV1betaIdeaActivity::default();
70///
71/// // You can configure optional parameters by calling the respective setters at will, and
72/// // execute the final call using `doit()`.
73/// // Values shown here are possibly random and not representative !
74/// let result = hub.platforms().properties_idea_activities_create(req, "parent")
75/// .doit().await;
76///
77/// match result {
78/// Err(e) => match e {
79/// // The Error enum provides details about what exactly happened.
80/// // You can also just use its `Debug`, `Display` or `Error` traits
81/// Error::HttpError(_)
82/// |Error::Io(_)
83/// |Error::MissingAPIKey
84/// |Error::MissingToken(_)
85/// |Error::Cancelled
86/// |Error::UploadSizeLimitExceeded(_, _)
87/// |Error::Failure(_)
88/// |Error::BadRequest(_)
89/// |Error::FieldClash(_)
90/// |Error::JsonDecodeError(_, _) => println!("{}", e),
91/// },
92/// Ok(res) => println!("Success: {:?}", res),
93/// }
94/// # }
95/// ```
96#[derive(Clone)]
97pub struct Ideahub<C> {
98 pub client: common::Client<C>,
99 pub auth: Box<dyn common::GetToken>,
100 _user_agent: String,
101 _base_url: String,
102 _root_url: String,
103}
104
105impl<C> common::Hub for Ideahub<C> {}
106
107impl<'a, C> Ideahub<C> {
108 pub fn new<A: 'static + common::GetToken>(client: common::Client<C>, auth: A) -> Ideahub<C> {
109 Ideahub {
110 client,
111 auth: Box::new(auth),
112 _user_agent: "google-api-rust-client/7.0.0".to_string(),
113 _base_url: "https://ideahub.googleapis.com/".to_string(),
114 _root_url: "https://ideahub.googleapis.com/".to_string(),
115 }
116 }
117
118 pub fn platforms(&'a self) -> PlatformMethods<'a, C> {
119 PlatformMethods { hub: self }
120 }
121
122 /// Set the user-agent header field to use in all requests to the server.
123 /// It defaults to `google-api-rust-client/7.0.0`.
124 ///
125 /// Returns the previously set user-agent.
126 pub fn user_agent(&mut self, agent_name: String) -> String {
127 std::mem::replace(&mut self._user_agent, agent_name)
128 }
129
130 /// Set the base url to use in all requests to the server.
131 /// It defaults to `https://ideahub.googleapis.com/`.
132 ///
133 /// Returns the previously set base url.
134 pub fn base_url(&mut self, new_base_url: String) -> String {
135 std::mem::replace(&mut self._base_url, new_base_url)
136 }
137
138 /// Set the root url to use in all requests to the server.
139 /// It defaults to `https://ideahub.googleapis.com/`.
140 ///
141 /// Returns the previously set root url.
142 pub fn root_url(&mut self, new_root_url: String) -> String {
143 std::mem::replace(&mut self._root_url, new_root_url)
144 }
145}
146
147// ############
148// SCHEMAS ###
149// ##########
150/// Represents locales that are available for a web property.
151///
152/// This type is not used in any activity, and only used as *part* of another schema.
153///
154#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
155#[serde_with::serde_as]
156#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
157pub struct GoogleSearchIdeahubV1betaAvailableLocale {
158 /// A string in BCP 47 format, without a resource prefix.
159 pub locale: Option<String>,
160 /// A string in BCP 47 format, prefixed with the platform and property name, and "locales/". Format: platforms/{platform}/properties/{property}/locales/{locale}
161 pub name: Option<String>,
162}
163
164impl common::Part for GoogleSearchIdeahubV1betaAvailableLocale {}
165
166/// A single Idea that we want to show the end user.
167///
168/// This type is not used in any activity, and only used as *part* of another schema.
169///
170#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
171#[serde_with::serde_as]
172#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
173pub struct GoogleSearchIdeahubV1betaIdea {
174 /// Unique identifier for the idea. Format: ideas/{ideaId}
175 pub name: Option<String>,
176 /// The idea’s text.
177 pub text: Option<String>,
178 /// The Topics that match the idea.
179 pub topics: Option<Vec<GoogleSearchIdeahubV1betaTopic>>,
180}
181
182impl common::Part for GoogleSearchIdeahubV1betaIdea {}
183
184/// An idea activity entry.
185///
186/// # Activities
187///
188/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
189/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
190///
191/// * [properties idea activities create platforms](PlatformPropertyIdeaActivityCreateCall) (request|response)
192#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
193#[serde_with::serde_as]
194#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
195pub struct GoogleSearchIdeahubV1betaIdeaActivity {
196 /// The Idea IDs for this entry. If empty, topics should be set.
197 pub ideas: Option<Vec<String>>,
198 /// Unique identifier for the idea activity. The name is ignored when creating an idea activity. Format: platforms/{platform}/properties/{property}/ideaActivities/{idea_activity}
199 pub name: Option<String>,
200 /// The Topic IDs for this entry. If empty, ideas should be set.
201 pub topics: Option<Vec<String>>,
202 /// The type of activity performed.
203 #[serde(rename = "type")]
204 pub type_: Option<String>,
205 /// The uri the activity relates to.
206 pub uri: Option<String>,
207}
208
209impl common::RequestValue for GoogleSearchIdeahubV1betaIdeaActivity {}
210impl common::ResponseResult for GoogleSearchIdeahubV1betaIdeaActivity {}
211
212/// Represents idea state specific to a web property.
213///
214/// # Activities
215///
216/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
217/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
218///
219/// * [properties idea states patch platforms](PlatformPropertyIdeaStatePatchCall) (request|response)
220#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
221#[serde_with::serde_as]
222#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
223pub struct GoogleSearchIdeahubV1betaIdeaState {
224 /// Whether the idea is dismissed.
225 pub dismissed: Option<bool>,
226 /// Unique identifier for the idea state. Format: platforms/{platform}/properties/{property}/ideaStates/{idea_state}
227 pub name: Option<String>,
228 /// Whether the idea is saved.
229 pub saved: Option<bool>,
230}
231
232impl common::RequestValue for GoogleSearchIdeahubV1betaIdeaState {}
233impl common::ResponseResult for GoogleSearchIdeahubV1betaIdeaState {}
234
235/// Response for whether ideas are available for a given web property on a platform, for the currently logged-in user.
236///
237/// # Activities
238///
239/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
240/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
241///
242/// * [properties locales list platforms](PlatformPropertyLocaleListCall) (response)
243#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
244#[serde_with::serde_as]
245#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
246pub struct GoogleSearchIdeahubV1betaListAvailableLocalesResponse {
247 /// Locales for which ideas are available for the given Creator.
248 #[serde(rename = "availableLocales")]
249 pub available_locales: Option<Vec<GoogleSearchIdeahubV1betaAvailableLocale>>,
250 /// A token that can be sent as `page_token` to retrieve the next page. If this field is omitted, there are no subsequent pages.
251 #[serde(rename = "nextPageToken")]
252 pub next_page_token: Option<String>,
253}
254
255impl common::ResponseResult for GoogleSearchIdeahubV1betaListAvailableLocalesResponse {}
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/// * [properties ideas list platforms](PlatformPropertyIdeaListCall) (response)
265#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
266#[serde_with::serde_as]
267#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
268pub struct GoogleSearchIdeahubV1betaListIdeasResponse {
269 /// Results for the ListIdeasRequest.
270 pub ideas: Option<Vec<GoogleSearchIdeahubV1betaIdea>>,
271 /// Used to fetch the next page in a subsequent request.
272 #[serde(rename = "nextPageToken")]
273 pub next_page_token: Option<String>,
274}
275
276impl common::ResponseResult for GoogleSearchIdeahubV1betaListIdeasResponse {}
277
278/// Represents a Topic umbrella for a list of questions that a Creator may want to respond to.
279///
280/// This type is not used in any activity, and only used as *part* of another schema.
281///
282#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
283#[serde_with::serde_as]
284#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
285pub struct GoogleSearchIdeahubV1betaTopic {
286 /// String displayed to the creator indicating the name of the Topic.
287 #[serde(rename = "displayName")]
288 pub display_name: Option<String>,
289 /// The mID of the topic.
290 pub mid: Option<String>,
291 /// Unique identifier for the topic. Format: topics/{topic}
292 pub name: Option<String>,
293}
294
295impl common::Part for GoogleSearchIdeahubV1betaTopic {}
296
297/// Represents topic state specific to a web property.
298///
299/// # Activities
300///
301/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
302/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
303///
304/// * [properties topic states patch platforms](PlatformPropertyTopicStatePatchCall) (request|response)
305#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
306#[serde_with::serde_as]
307#[derive(Default, Clone, Debug, serde::Serialize, serde::Deserialize)]
308pub struct GoogleSearchIdeahubV1betaTopicState {
309 /// Whether the topic is dismissed.
310 pub dismissed: Option<bool>,
311 /// Unique identifier for the topic state. Format: platforms/{platform}/properties/{property}/topicStates/{topic_state}
312 pub name: Option<String>,
313 /// Whether the topic is saved.
314 pub saved: Option<bool>,
315}
316
317impl common::RequestValue for GoogleSearchIdeahubV1betaTopicState {}
318impl common::ResponseResult for GoogleSearchIdeahubV1betaTopicState {}
319
320// ###################
321// MethodBuilders ###
322// #################
323
324/// A builder providing access to all methods supported on *platform* resources.
325/// It is not used directly, but through the [`Ideahub`] hub.
326///
327/// # Example
328///
329/// Instantiate a resource builder
330///
331/// ```test_harness,no_run
332/// extern crate hyper;
333/// extern crate hyper_rustls;
334/// extern crate google_ideahub1_beta as ideahub1_beta;
335///
336/// # async fn dox() {
337/// use ideahub1_beta::{Ideahub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
338///
339/// let secret: yup_oauth2::ApplicationSecret = Default::default();
340/// let connector = hyper_rustls::HttpsConnectorBuilder::new()
341/// .with_native_roots()
342/// .unwrap()
343/// .https_only()
344/// .enable_http2()
345/// .build();
346///
347/// let executor = hyper_util::rt::TokioExecutor::new();
348/// let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
349/// secret,
350/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
351/// yup_oauth2::client::CustomHyperClientBuilder::from(
352/// hyper_util::client::legacy::Client::builder(executor).build(connector),
353/// ),
354/// ).build().await.unwrap();
355///
356/// let client = hyper_util::client::legacy::Client::builder(
357/// hyper_util::rt::TokioExecutor::new()
358/// )
359/// .build(
360/// hyper_rustls::HttpsConnectorBuilder::new()
361/// .with_native_roots()
362/// .unwrap()
363/// .https_or_http()
364/// .enable_http2()
365/// .build()
366/// );
367/// let mut hub = Ideahub::new(client, auth);
368/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
369/// // like `properties_idea_activities_create(...)`, `properties_idea_states_patch(...)`, `properties_ideas_list(...)`, `properties_locales_list(...)` and `properties_topic_states_patch(...)`
370/// // to build up your call.
371/// let rb = hub.platforms();
372/// # }
373/// ```
374pub struct PlatformMethods<'a, C>
375where
376 C: 'a,
377{
378 hub: &'a Ideahub<C>,
379}
380
381impl<'a, C> common::MethodsBuilder for PlatformMethods<'a, C> {}
382
383impl<'a, C> PlatformMethods<'a, C> {
384 /// Create a builder to help you perform the following task:
385 ///
386 /// Creates an idea activity entry.
387 ///
388 /// # Arguments
389 ///
390 /// * `request` - No description provided.
391 /// * `parent` - Required. The parent resource where this idea activity will be created. Format: platforms/{platform}/property/{property}
392 pub fn properties_idea_activities_create(
393 &self,
394 request: GoogleSearchIdeahubV1betaIdeaActivity,
395 parent: &str,
396 ) -> PlatformPropertyIdeaActivityCreateCall<'a, C> {
397 PlatformPropertyIdeaActivityCreateCall {
398 hub: self.hub,
399 _request: request,
400 _parent: parent.to_string(),
401 _delegate: Default::default(),
402 _additional_params: Default::default(),
403 }
404 }
405
406 /// Create a builder to help you perform the following task:
407 ///
408 /// Update an idea state resource.
409 ///
410 /// # Arguments
411 ///
412 /// * `request` - No description provided.
413 /// * `name` - Unique identifier for the idea state. Format: platforms/{platform}/properties/{property}/ideaStates/{idea_state}
414 pub fn properties_idea_states_patch(
415 &self,
416 request: GoogleSearchIdeahubV1betaIdeaState,
417 name: &str,
418 ) -> PlatformPropertyIdeaStatePatchCall<'a, C> {
419 PlatformPropertyIdeaStatePatchCall {
420 hub: self.hub,
421 _request: request,
422 _name: name.to_string(),
423 _update_mask: Default::default(),
424 _delegate: Default::default(),
425 _additional_params: Default::default(),
426 }
427 }
428
429 /// Create a builder to help you perform the following task:
430 ///
431 /// List ideas for a given Creator and filter and sort options.
432 ///
433 /// # Arguments
434 ///
435 /// * `parent` - Required. If defined, specifies the creator for which to filter by. Format: publishers/{publisher}/properties/{property}
436 pub fn properties_ideas_list(&self, parent: &str) -> PlatformPropertyIdeaListCall<'a, C> {
437 PlatformPropertyIdeaListCall {
438 hub: self.hub,
439 _parent: parent.to_string(),
440 _page_token: Default::default(),
441 _page_size: Default::default(),
442 _order_by: Default::default(),
443 _filter: Default::default(),
444 _delegate: Default::default(),
445 _additional_params: Default::default(),
446 }
447 }
448
449 /// Create a builder to help you perform the following task:
450 ///
451 /// Returns which locales ideas are available in for a given Creator.
452 ///
453 /// # Arguments
454 ///
455 /// * `parent` - Required. The web property to check idea availability for Format: platforms/{platform}/property/{property}
456 pub fn properties_locales_list(&self, parent: &str) -> PlatformPropertyLocaleListCall<'a, C> {
457 PlatformPropertyLocaleListCall {
458 hub: self.hub,
459 _parent: parent.to_string(),
460 _page_token: Default::default(),
461 _page_size: Default::default(),
462 _delegate: Default::default(),
463 _additional_params: Default::default(),
464 }
465 }
466
467 /// Create a builder to help you perform the following task:
468 ///
469 /// Update a topic state resource.
470 ///
471 /// # Arguments
472 ///
473 /// * `request` - No description provided.
474 /// * `name` - Unique identifier for the topic state. Format: platforms/{platform}/properties/{property}/topicStates/{topic_state}
475 pub fn properties_topic_states_patch(
476 &self,
477 request: GoogleSearchIdeahubV1betaTopicState,
478 name: &str,
479 ) -> PlatformPropertyTopicStatePatchCall<'a, C> {
480 PlatformPropertyTopicStatePatchCall {
481 hub: self.hub,
482 _request: request,
483 _name: name.to_string(),
484 _update_mask: Default::default(),
485 _delegate: Default::default(),
486 _additional_params: Default::default(),
487 }
488 }
489}
490
491// ###################
492// CallBuilders ###
493// #################
494
495/// Creates an idea activity entry.
496///
497/// A builder for the *properties.ideaActivities.create* method supported by a *platform* resource.
498/// It is not used directly, but through a [`PlatformMethods`] instance.
499///
500/// # Example
501///
502/// Instantiate a resource method builder
503///
504/// ```test_harness,no_run
505/// # extern crate hyper;
506/// # extern crate hyper_rustls;
507/// # extern crate google_ideahub1_beta as ideahub1_beta;
508/// use ideahub1_beta::api::GoogleSearchIdeahubV1betaIdeaActivity;
509/// # async fn dox() {
510/// # use ideahub1_beta::{Ideahub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
511///
512/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
513/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
514/// # .with_native_roots()
515/// # .unwrap()
516/// # .https_only()
517/// # .enable_http2()
518/// # .build();
519///
520/// # let executor = hyper_util::rt::TokioExecutor::new();
521/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
522/// # secret,
523/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
524/// # yup_oauth2::client::CustomHyperClientBuilder::from(
525/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
526/// # ),
527/// # ).build().await.unwrap();
528///
529/// # let client = hyper_util::client::legacy::Client::builder(
530/// # hyper_util::rt::TokioExecutor::new()
531/// # )
532/// # .build(
533/// # hyper_rustls::HttpsConnectorBuilder::new()
534/// # .with_native_roots()
535/// # .unwrap()
536/// # .https_or_http()
537/// # .enable_http2()
538/// # .build()
539/// # );
540/// # let mut hub = Ideahub::new(client, auth);
541/// // As the method needs a request, you would usually fill it with the desired information
542/// // into the respective structure. Some of the parts shown here might not be applicable !
543/// // Values shown here are possibly random and not representative !
544/// let mut req = GoogleSearchIdeahubV1betaIdeaActivity::default();
545///
546/// // You can configure optional parameters by calling the respective setters at will, and
547/// // execute the final call using `doit()`.
548/// // Values shown here are possibly random and not representative !
549/// let result = hub.platforms().properties_idea_activities_create(req, "parent")
550/// .doit().await;
551/// # }
552/// ```
553pub struct PlatformPropertyIdeaActivityCreateCall<'a, C>
554where
555 C: 'a,
556{
557 hub: &'a Ideahub<C>,
558 _request: GoogleSearchIdeahubV1betaIdeaActivity,
559 _parent: String,
560 _delegate: Option<&'a mut dyn common::Delegate>,
561 _additional_params: HashMap<String, String>,
562}
563
564impl<'a, C> common::CallBuilder for PlatformPropertyIdeaActivityCreateCall<'a, C> {}
565
566impl<'a, C> PlatformPropertyIdeaActivityCreateCall<'a, C>
567where
568 C: common::Connector,
569{
570 /// Perform the operation you have build so far.
571 pub async fn doit(
572 mut self,
573 ) -> common::Result<(common::Response, GoogleSearchIdeahubV1betaIdeaActivity)> {
574 use std::borrow::Cow;
575 use std::io::{Read, Seek};
576
577 use common::{url::Params, ToParts};
578 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
579
580 let mut dd = common::DefaultDelegate;
581 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
582 dlg.begin(common::MethodInfo {
583 id: "ideahub.platforms.properties.ideaActivities.create",
584 http_method: hyper::Method::POST,
585 });
586
587 for &field in ["alt", "parent"].iter() {
588 if self._additional_params.contains_key(field) {
589 dlg.finished(false);
590 return Err(common::Error::FieldClash(field));
591 }
592 }
593
594 let mut params = Params::with_capacity(4 + self._additional_params.len());
595 params.push("parent", self._parent);
596
597 params.extend(self._additional_params.iter());
598
599 params.push("alt", "json");
600 let mut url = self.hub._base_url.clone() + "v1beta/{+parent}/ideaActivities";
601
602 match dlg.api_key() {
603 Some(value) => params.push("key", value),
604 None => {
605 dlg.finished(false);
606 return Err(common::Error::MissingAPIKey);
607 }
608 }
609
610 #[allow(clippy::single_element_loop)]
611 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
612 url = params.uri_replacement(url, param_name, find_this, true);
613 }
614 {
615 let to_remove = ["parent"];
616 params.remove_params(&to_remove);
617 }
618
619 let url = params.parse_with_url(&url);
620
621 let mut json_mime_type = mime::APPLICATION_JSON;
622 let mut request_value_reader = {
623 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
624 common::remove_json_null_values(&mut value);
625 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
626 serde_json::to_writer(&mut dst, &value).unwrap();
627 dst
628 };
629 let request_size = request_value_reader
630 .seek(std::io::SeekFrom::End(0))
631 .unwrap();
632 request_value_reader
633 .seek(std::io::SeekFrom::Start(0))
634 .unwrap();
635
636 loop {
637 request_value_reader
638 .seek(std::io::SeekFrom::Start(0))
639 .unwrap();
640 let mut req_result = {
641 let client = &self.hub.client;
642 dlg.pre_request();
643 let mut req_builder = hyper::Request::builder()
644 .method(hyper::Method::POST)
645 .uri(url.as_str())
646 .header(USER_AGENT, self.hub._user_agent.clone());
647
648 let request = req_builder
649 .header(CONTENT_TYPE, json_mime_type.to_string())
650 .header(CONTENT_LENGTH, request_size as u64)
651 .body(common::to_body(
652 request_value_reader.get_ref().clone().into(),
653 ));
654
655 client.request(request.unwrap()).await
656 };
657
658 match req_result {
659 Err(err) => {
660 if let common::Retry::After(d) = dlg.http_error(&err) {
661 sleep(d).await;
662 continue;
663 }
664 dlg.finished(false);
665 return Err(common::Error::HttpError(err));
666 }
667 Ok(res) => {
668 let (mut parts, body) = res.into_parts();
669 let mut body = common::Body::new(body);
670 if !parts.status.is_success() {
671 let bytes = common::to_bytes(body).await.unwrap_or_default();
672 let error = serde_json::from_str(&common::to_string(&bytes));
673 let response = common::to_response(parts, bytes.into());
674
675 if let common::Retry::After(d) =
676 dlg.http_failure(&response, error.as_ref().ok())
677 {
678 sleep(d).await;
679 continue;
680 }
681
682 dlg.finished(false);
683
684 return Err(match error {
685 Ok(value) => common::Error::BadRequest(value),
686 _ => common::Error::Failure(response),
687 });
688 }
689 let response = {
690 let bytes = common::to_bytes(body).await.unwrap_or_default();
691 let encoded = common::to_string(&bytes);
692 match serde_json::from_str(&encoded) {
693 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
694 Err(error) => {
695 dlg.response_json_decode_error(&encoded, &error);
696 return Err(common::Error::JsonDecodeError(
697 encoded.to_string(),
698 error,
699 ));
700 }
701 }
702 };
703
704 dlg.finished(true);
705 return Ok(response);
706 }
707 }
708 }
709 }
710
711 ///
712 /// Sets the *request* property to the given value.
713 ///
714 /// Even though the property as already been set when instantiating this call,
715 /// we provide this method for API completeness.
716 pub fn request(
717 mut self,
718 new_value: GoogleSearchIdeahubV1betaIdeaActivity,
719 ) -> PlatformPropertyIdeaActivityCreateCall<'a, C> {
720 self._request = new_value;
721 self
722 }
723 /// Required. The parent resource where this idea activity will be created. Format: platforms/{platform}/property/{property}
724 ///
725 /// Sets the *parent* path property to the given value.
726 ///
727 /// Even though the property as already been set when instantiating this call,
728 /// we provide this method for API completeness.
729 pub fn parent(mut self, new_value: &str) -> PlatformPropertyIdeaActivityCreateCall<'a, C> {
730 self._parent = new_value.to_string();
731 self
732 }
733 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
734 /// while executing the actual API request.
735 ///
736 /// ````text
737 /// It should be used to handle progress information, and to implement a certain level of resilience.
738 /// ````
739 ///
740 /// Sets the *delegate* property to the given value.
741 pub fn delegate(
742 mut self,
743 new_value: &'a mut dyn common::Delegate,
744 ) -> PlatformPropertyIdeaActivityCreateCall<'a, C> {
745 self._delegate = Some(new_value);
746 self
747 }
748
749 /// Set any additional parameter of the query string used in the request.
750 /// It should be used to set parameters which are not yet available through their own
751 /// setters.
752 ///
753 /// Please note that this method must not be used to set any of the known parameters
754 /// which have their own setter method. If done anyway, the request will fail.
755 ///
756 /// # Additional Parameters
757 ///
758 /// * *$.xgafv* (query-string) - V1 error format.
759 /// * *access_token* (query-string) - OAuth access token.
760 /// * *alt* (query-string) - Data format for response.
761 /// * *callback* (query-string) - JSONP
762 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
763 /// * *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.
764 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
765 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
766 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
767 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
768 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
769 pub fn param<T>(mut self, name: T, value: T) -> PlatformPropertyIdeaActivityCreateCall<'a, C>
770 where
771 T: AsRef<str>,
772 {
773 self._additional_params
774 .insert(name.as_ref().to_string(), value.as_ref().to_string());
775 self
776 }
777}
778
779/// Update an idea state resource.
780///
781/// A builder for the *properties.ideaStates.patch* method supported by a *platform* resource.
782/// It is not used directly, but through a [`PlatformMethods`] instance.
783///
784/// # Example
785///
786/// Instantiate a resource method builder
787///
788/// ```test_harness,no_run
789/// # extern crate hyper;
790/// # extern crate hyper_rustls;
791/// # extern crate google_ideahub1_beta as ideahub1_beta;
792/// use ideahub1_beta::api::GoogleSearchIdeahubV1betaIdeaState;
793/// # async fn dox() {
794/// # use ideahub1_beta::{Ideahub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
795///
796/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
797/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
798/// # .with_native_roots()
799/// # .unwrap()
800/// # .https_only()
801/// # .enable_http2()
802/// # .build();
803///
804/// # let executor = hyper_util::rt::TokioExecutor::new();
805/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
806/// # secret,
807/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
808/// # yup_oauth2::client::CustomHyperClientBuilder::from(
809/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
810/// # ),
811/// # ).build().await.unwrap();
812///
813/// # let client = hyper_util::client::legacy::Client::builder(
814/// # hyper_util::rt::TokioExecutor::new()
815/// # )
816/// # .build(
817/// # hyper_rustls::HttpsConnectorBuilder::new()
818/// # .with_native_roots()
819/// # .unwrap()
820/// # .https_or_http()
821/// # .enable_http2()
822/// # .build()
823/// # );
824/// # let mut hub = Ideahub::new(client, auth);
825/// // As the method needs a request, you would usually fill it with the desired information
826/// // into the respective structure. Some of the parts shown here might not be applicable !
827/// // Values shown here are possibly random and not representative !
828/// let mut req = GoogleSearchIdeahubV1betaIdeaState::default();
829///
830/// // You can configure optional parameters by calling the respective setters at will, and
831/// // execute the final call using `doit()`.
832/// // Values shown here are possibly random and not representative !
833/// let result = hub.platforms().properties_idea_states_patch(req, "name")
834/// .update_mask(FieldMask::new::<&str>(&[]))
835/// .doit().await;
836/// # }
837/// ```
838pub struct PlatformPropertyIdeaStatePatchCall<'a, C>
839where
840 C: 'a,
841{
842 hub: &'a Ideahub<C>,
843 _request: GoogleSearchIdeahubV1betaIdeaState,
844 _name: String,
845 _update_mask: Option<common::FieldMask>,
846 _delegate: Option<&'a mut dyn common::Delegate>,
847 _additional_params: HashMap<String, String>,
848}
849
850impl<'a, C> common::CallBuilder for PlatformPropertyIdeaStatePatchCall<'a, C> {}
851
852impl<'a, C> PlatformPropertyIdeaStatePatchCall<'a, C>
853where
854 C: common::Connector,
855{
856 /// Perform the operation you have build so far.
857 pub async fn doit(
858 mut self,
859 ) -> common::Result<(common::Response, GoogleSearchIdeahubV1betaIdeaState)> {
860 use std::borrow::Cow;
861 use std::io::{Read, Seek};
862
863 use common::{url::Params, ToParts};
864 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
865
866 let mut dd = common::DefaultDelegate;
867 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
868 dlg.begin(common::MethodInfo {
869 id: "ideahub.platforms.properties.ideaStates.patch",
870 http_method: hyper::Method::PATCH,
871 });
872
873 for &field in ["alt", "name", "updateMask"].iter() {
874 if self._additional_params.contains_key(field) {
875 dlg.finished(false);
876 return Err(common::Error::FieldClash(field));
877 }
878 }
879
880 let mut params = Params::with_capacity(5 + self._additional_params.len());
881 params.push("name", self._name);
882 if let Some(value) = self._update_mask.as_ref() {
883 params.push("updateMask", value.to_string());
884 }
885
886 params.extend(self._additional_params.iter());
887
888 params.push("alt", "json");
889 let mut url = self.hub._base_url.clone() + "v1beta/{+name}";
890
891 match dlg.api_key() {
892 Some(value) => params.push("key", value),
893 None => {
894 dlg.finished(false);
895 return Err(common::Error::MissingAPIKey);
896 }
897 }
898
899 #[allow(clippy::single_element_loop)]
900 for &(find_this, param_name) in [("{+name}", "name")].iter() {
901 url = params.uri_replacement(url, param_name, find_this, true);
902 }
903 {
904 let to_remove = ["name"];
905 params.remove_params(&to_remove);
906 }
907
908 let url = params.parse_with_url(&url);
909
910 let mut json_mime_type = mime::APPLICATION_JSON;
911 let mut request_value_reader = {
912 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
913 common::remove_json_null_values(&mut value);
914 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
915 serde_json::to_writer(&mut dst, &value).unwrap();
916 dst
917 };
918 let request_size = request_value_reader
919 .seek(std::io::SeekFrom::End(0))
920 .unwrap();
921 request_value_reader
922 .seek(std::io::SeekFrom::Start(0))
923 .unwrap();
924
925 loop {
926 request_value_reader
927 .seek(std::io::SeekFrom::Start(0))
928 .unwrap();
929 let mut req_result = {
930 let client = &self.hub.client;
931 dlg.pre_request();
932 let mut req_builder = hyper::Request::builder()
933 .method(hyper::Method::PATCH)
934 .uri(url.as_str())
935 .header(USER_AGENT, self.hub._user_agent.clone());
936
937 let request = req_builder
938 .header(CONTENT_TYPE, json_mime_type.to_string())
939 .header(CONTENT_LENGTH, request_size as u64)
940 .body(common::to_body(
941 request_value_reader.get_ref().clone().into(),
942 ));
943
944 client.request(request.unwrap()).await
945 };
946
947 match req_result {
948 Err(err) => {
949 if let common::Retry::After(d) = dlg.http_error(&err) {
950 sleep(d).await;
951 continue;
952 }
953 dlg.finished(false);
954 return Err(common::Error::HttpError(err));
955 }
956 Ok(res) => {
957 let (mut parts, body) = res.into_parts();
958 let mut body = common::Body::new(body);
959 if !parts.status.is_success() {
960 let bytes = common::to_bytes(body).await.unwrap_or_default();
961 let error = serde_json::from_str(&common::to_string(&bytes));
962 let response = common::to_response(parts, bytes.into());
963
964 if let common::Retry::After(d) =
965 dlg.http_failure(&response, error.as_ref().ok())
966 {
967 sleep(d).await;
968 continue;
969 }
970
971 dlg.finished(false);
972
973 return Err(match error {
974 Ok(value) => common::Error::BadRequest(value),
975 _ => common::Error::Failure(response),
976 });
977 }
978 let response = {
979 let bytes = common::to_bytes(body).await.unwrap_or_default();
980 let encoded = common::to_string(&bytes);
981 match serde_json::from_str(&encoded) {
982 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
983 Err(error) => {
984 dlg.response_json_decode_error(&encoded, &error);
985 return Err(common::Error::JsonDecodeError(
986 encoded.to_string(),
987 error,
988 ));
989 }
990 }
991 };
992
993 dlg.finished(true);
994 return Ok(response);
995 }
996 }
997 }
998 }
999
1000 ///
1001 /// Sets the *request* property to the given value.
1002 ///
1003 /// Even though the property as already been set when instantiating this call,
1004 /// we provide this method for API completeness.
1005 pub fn request(
1006 mut self,
1007 new_value: GoogleSearchIdeahubV1betaIdeaState,
1008 ) -> PlatformPropertyIdeaStatePatchCall<'a, C> {
1009 self._request = new_value;
1010 self
1011 }
1012 /// Unique identifier for the idea state. Format: platforms/{platform}/properties/{property}/ideaStates/{idea_state}
1013 ///
1014 /// Sets the *name* path property to the given value.
1015 ///
1016 /// Even though the property as already been set when instantiating this call,
1017 /// we provide this method for API completeness.
1018 pub fn name(mut self, new_value: &str) -> PlatformPropertyIdeaStatePatchCall<'a, C> {
1019 self._name = new_value.to_string();
1020 self
1021 }
1022 /// The list of fields to be updated.
1023 ///
1024 /// Sets the *update mask* query property to the given value.
1025 pub fn update_mask(
1026 mut self,
1027 new_value: common::FieldMask,
1028 ) -> PlatformPropertyIdeaStatePatchCall<'a, C> {
1029 self._update_mask = Some(new_value);
1030 self
1031 }
1032 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1033 /// while executing the actual API request.
1034 ///
1035 /// ````text
1036 /// It should be used to handle progress information, and to implement a certain level of resilience.
1037 /// ````
1038 ///
1039 /// Sets the *delegate* property to the given value.
1040 pub fn delegate(
1041 mut self,
1042 new_value: &'a mut dyn common::Delegate,
1043 ) -> PlatformPropertyIdeaStatePatchCall<'a, C> {
1044 self._delegate = Some(new_value);
1045 self
1046 }
1047
1048 /// Set any additional parameter of the query string used in the request.
1049 /// It should be used to set parameters which are not yet available through their own
1050 /// setters.
1051 ///
1052 /// Please note that this method must not be used to set any of the known parameters
1053 /// which have their own setter method. If done anyway, the request will fail.
1054 ///
1055 /// # Additional Parameters
1056 ///
1057 /// * *$.xgafv* (query-string) - V1 error format.
1058 /// * *access_token* (query-string) - OAuth access token.
1059 /// * *alt* (query-string) - Data format for response.
1060 /// * *callback* (query-string) - JSONP
1061 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1062 /// * *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.
1063 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1064 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1065 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1066 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1067 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1068 pub fn param<T>(mut self, name: T, value: T) -> PlatformPropertyIdeaStatePatchCall<'a, C>
1069 where
1070 T: AsRef<str>,
1071 {
1072 self._additional_params
1073 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1074 self
1075 }
1076}
1077
1078/// List ideas for a given Creator and filter and sort options.
1079///
1080/// A builder for the *properties.ideas.list* method supported by a *platform* resource.
1081/// It is not used directly, but through a [`PlatformMethods`] instance.
1082///
1083/// # Example
1084///
1085/// Instantiate a resource method builder
1086///
1087/// ```test_harness,no_run
1088/// # extern crate hyper;
1089/// # extern crate hyper_rustls;
1090/// # extern crate google_ideahub1_beta as ideahub1_beta;
1091/// # async fn dox() {
1092/// # use ideahub1_beta::{Ideahub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1093///
1094/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1095/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1096/// # .with_native_roots()
1097/// # .unwrap()
1098/// # .https_only()
1099/// # .enable_http2()
1100/// # .build();
1101///
1102/// # let executor = hyper_util::rt::TokioExecutor::new();
1103/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1104/// # secret,
1105/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1106/// # yup_oauth2::client::CustomHyperClientBuilder::from(
1107/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
1108/// # ),
1109/// # ).build().await.unwrap();
1110///
1111/// # let client = hyper_util::client::legacy::Client::builder(
1112/// # hyper_util::rt::TokioExecutor::new()
1113/// # )
1114/// # .build(
1115/// # hyper_rustls::HttpsConnectorBuilder::new()
1116/// # .with_native_roots()
1117/// # .unwrap()
1118/// # .https_or_http()
1119/// # .enable_http2()
1120/// # .build()
1121/// # );
1122/// # let mut hub = Ideahub::new(client, auth);
1123/// // You can configure optional parameters by calling the respective setters at will, and
1124/// // execute the final call using `doit()`.
1125/// // Values shown here are possibly random and not representative !
1126/// let result = hub.platforms().properties_ideas_list("parent")
1127/// .page_token("sanctus")
1128/// .page_size(-80)
1129/// .order_by("amet.")
1130/// .filter("takimata")
1131/// .doit().await;
1132/// # }
1133/// ```
1134pub struct PlatformPropertyIdeaListCall<'a, C>
1135where
1136 C: 'a,
1137{
1138 hub: &'a Ideahub<C>,
1139 _parent: String,
1140 _page_token: Option<String>,
1141 _page_size: Option<i32>,
1142 _order_by: Option<String>,
1143 _filter: Option<String>,
1144 _delegate: Option<&'a mut dyn common::Delegate>,
1145 _additional_params: HashMap<String, String>,
1146}
1147
1148impl<'a, C> common::CallBuilder for PlatformPropertyIdeaListCall<'a, C> {}
1149
1150impl<'a, C> PlatformPropertyIdeaListCall<'a, C>
1151where
1152 C: common::Connector,
1153{
1154 /// Perform the operation you have build so far.
1155 pub async fn doit(
1156 mut self,
1157 ) -> common::Result<(common::Response, GoogleSearchIdeahubV1betaListIdeasResponse)> {
1158 use std::borrow::Cow;
1159 use std::io::{Read, Seek};
1160
1161 use common::{url::Params, ToParts};
1162 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1163
1164 let mut dd = common::DefaultDelegate;
1165 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1166 dlg.begin(common::MethodInfo {
1167 id: "ideahub.platforms.properties.ideas.list",
1168 http_method: hyper::Method::GET,
1169 });
1170
1171 for &field in [
1172 "alt",
1173 "parent",
1174 "pageToken",
1175 "pageSize",
1176 "orderBy",
1177 "filter",
1178 ]
1179 .iter()
1180 {
1181 if self._additional_params.contains_key(field) {
1182 dlg.finished(false);
1183 return Err(common::Error::FieldClash(field));
1184 }
1185 }
1186
1187 let mut params = Params::with_capacity(7 + self._additional_params.len());
1188 params.push("parent", self._parent);
1189 if let Some(value) = self._page_token.as_ref() {
1190 params.push("pageToken", value);
1191 }
1192 if let Some(value) = self._page_size.as_ref() {
1193 params.push("pageSize", value.to_string());
1194 }
1195 if let Some(value) = self._order_by.as_ref() {
1196 params.push("orderBy", value);
1197 }
1198 if let Some(value) = self._filter.as_ref() {
1199 params.push("filter", value);
1200 }
1201
1202 params.extend(self._additional_params.iter());
1203
1204 params.push("alt", "json");
1205 let mut url = self.hub._base_url.clone() + "v1beta/{+parent}/ideas";
1206
1207 match dlg.api_key() {
1208 Some(value) => params.push("key", value),
1209 None => {
1210 dlg.finished(false);
1211 return Err(common::Error::MissingAPIKey);
1212 }
1213 }
1214
1215 #[allow(clippy::single_element_loop)]
1216 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
1217 url = params.uri_replacement(url, param_name, find_this, true);
1218 }
1219 {
1220 let to_remove = ["parent"];
1221 params.remove_params(&to_remove);
1222 }
1223
1224 let url = params.parse_with_url(&url);
1225
1226 loop {
1227 let mut req_result = {
1228 let client = &self.hub.client;
1229 dlg.pre_request();
1230 let mut req_builder = hyper::Request::builder()
1231 .method(hyper::Method::GET)
1232 .uri(url.as_str())
1233 .header(USER_AGENT, self.hub._user_agent.clone());
1234
1235 let request = req_builder
1236 .header(CONTENT_LENGTH, 0_u64)
1237 .body(common::to_body::<String>(None));
1238
1239 client.request(request.unwrap()).await
1240 };
1241
1242 match req_result {
1243 Err(err) => {
1244 if let common::Retry::After(d) = dlg.http_error(&err) {
1245 sleep(d).await;
1246 continue;
1247 }
1248 dlg.finished(false);
1249 return Err(common::Error::HttpError(err));
1250 }
1251 Ok(res) => {
1252 let (mut parts, body) = res.into_parts();
1253 let mut body = common::Body::new(body);
1254 if !parts.status.is_success() {
1255 let bytes = common::to_bytes(body).await.unwrap_or_default();
1256 let error = serde_json::from_str(&common::to_string(&bytes));
1257 let response = common::to_response(parts, bytes.into());
1258
1259 if let common::Retry::After(d) =
1260 dlg.http_failure(&response, error.as_ref().ok())
1261 {
1262 sleep(d).await;
1263 continue;
1264 }
1265
1266 dlg.finished(false);
1267
1268 return Err(match error {
1269 Ok(value) => common::Error::BadRequest(value),
1270 _ => common::Error::Failure(response),
1271 });
1272 }
1273 let response = {
1274 let bytes = common::to_bytes(body).await.unwrap_or_default();
1275 let encoded = common::to_string(&bytes);
1276 match serde_json::from_str(&encoded) {
1277 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1278 Err(error) => {
1279 dlg.response_json_decode_error(&encoded, &error);
1280 return Err(common::Error::JsonDecodeError(
1281 encoded.to_string(),
1282 error,
1283 ));
1284 }
1285 }
1286 };
1287
1288 dlg.finished(true);
1289 return Ok(response);
1290 }
1291 }
1292 }
1293 }
1294
1295 /// Required. If defined, specifies the creator for which to filter by. Format: publishers/{publisher}/properties/{property}
1296 ///
1297 /// Sets the *parent* path property to the given value.
1298 ///
1299 /// Even though the property as already been set when instantiating this call,
1300 /// we provide this method for API completeness.
1301 pub fn parent(mut self, new_value: &str) -> PlatformPropertyIdeaListCall<'a, C> {
1302 self._parent = new_value.to_string();
1303 self
1304 }
1305 /// Used to fetch next page.
1306 ///
1307 /// Sets the *page token* query property to the given value.
1308 pub fn page_token(mut self, new_value: &str) -> PlatformPropertyIdeaListCall<'a, C> {
1309 self._page_token = Some(new_value.to_string());
1310 self
1311 }
1312 /// The maximum number of ideas per page. If unspecified, at most 10 ideas will be returned. The maximum value is 2000; values above 2000 will be coerced to 2000.
1313 ///
1314 /// Sets the *page size* query property to the given value.
1315 pub fn page_size(mut self, new_value: i32) -> PlatformPropertyIdeaListCall<'a, C> {
1316 self._page_size = Some(new_value);
1317 self
1318 }
1319 /// Order semantics described below.
1320 ///
1321 /// Sets the *order by* query property to the given value.
1322 pub fn order_by(mut self, new_value: &str) -> PlatformPropertyIdeaListCall<'a, C> {
1323 self._order_by = Some(new_value.to_string());
1324 self
1325 }
1326 /// Allows filtering. Supported syntax: * Filter expressions are made up of one or more restrictions. * Restrictions are implicitly combined, as if the `AND` operator was always used. The `OR` operator is currently unsupported. * Supported functions: - `saved(bool)`: If set to true, fetches only saved ideas. If set to false, fetches all except saved ideas. Can't be simultaneously used with `dismissed(bool)`. - `dismissed(bool)`: If set to true, fetches only dismissed ideas. Can't be simultaneously used with `saved(bool)`. The `false` value is currently unsupported. Examples: * `saved(true)` * `saved(false)` * `dismissed(true)` The length of this field should be no more than 500 characters.
1327 ///
1328 /// Sets the *filter* query property to the given value.
1329 pub fn filter(mut self, new_value: &str) -> PlatformPropertyIdeaListCall<'a, C> {
1330 self._filter = Some(new_value.to_string());
1331 self
1332 }
1333 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1334 /// while executing the actual API request.
1335 ///
1336 /// ````text
1337 /// It should be used to handle progress information, and to implement a certain level of resilience.
1338 /// ````
1339 ///
1340 /// Sets the *delegate* property to the given value.
1341 pub fn delegate(
1342 mut self,
1343 new_value: &'a mut dyn common::Delegate,
1344 ) -> PlatformPropertyIdeaListCall<'a, C> {
1345 self._delegate = Some(new_value);
1346 self
1347 }
1348
1349 /// Set any additional parameter of the query string used in the request.
1350 /// It should be used to set parameters which are not yet available through their own
1351 /// setters.
1352 ///
1353 /// Please note that this method must not be used to set any of the known parameters
1354 /// which have their own setter method. If done anyway, the request will fail.
1355 ///
1356 /// # Additional Parameters
1357 ///
1358 /// * *$.xgafv* (query-string) - V1 error format.
1359 /// * *access_token* (query-string) - OAuth access token.
1360 /// * *alt* (query-string) - Data format for response.
1361 /// * *callback* (query-string) - JSONP
1362 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1363 /// * *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.
1364 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1365 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1366 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1367 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1368 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1369 pub fn param<T>(mut self, name: T, value: T) -> PlatformPropertyIdeaListCall<'a, C>
1370 where
1371 T: AsRef<str>,
1372 {
1373 self._additional_params
1374 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1375 self
1376 }
1377}
1378
1379/// Returns which locales ideas are available in for a given Creator.
1380///
1381/// A builder for the *properties.locales.list* method supported by a *platform* resource.
1382/// It is not used directly, but through a [`PlatformMethods`] instance.
1383///
1384/// # Example
1385///
1386/// Instantiate a resource method builder
1387///
1388/// ```test_harness,no_run
1389/// # extern crate hyper;
1390/// # extern crate hyper_rustls;
1391/// # extern crate google_ideahub1_beta as ideahub1_beta;
1392/// # async fn dox() {
1393/// # use ideahub1_beta::{Ideahub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1394///
1395/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1396/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1397/// # .with_native_roots()
1398/// # .unwrap()
1399/// # .https_only()
1400/// # .enable_http2()
1401/// # .build();
1402///
1403/// # let executor = hyper_util::rt::TokioExecutor::new();
1404/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1405/// # secret,
1406/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1407/// # yup_oauth2::client::CustomHyperClientBuilder::from(
1408/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
1409/// # ),
1410/// # ).build().await.unwrap();
1411///
1412/// # let client = hyper_util::client::legacy::Client::builder(
1413/// # hyper_util::rt::TokioExecutor::new()
1414/// # )
1415/// # .build(
1416/// # hyper_rustls::HttpsConnectorBuilder::new()
1417/// # .with_native_roots()
1418/// # .unwrap()
1419/// # .https_or_http()
1420/// # .enable_http2()
1421/// # .build()
1422/// # );
1423/// # let mut hub = Ideahub::new(client, auth);
1424/// // You can configure optional parameters by calling the respective setters at will, and
1425/// // execute the final call using `doit()`.
1426/// // Values shown here are possibly random and not representative !
1427/// let result = hub.platforms().properties_locales_list("parent")
1428/// .page_token("duo")
1429/// .page_size(-55)
1430/// .doit().await;
1431/// # }
1432/// ```
1433pub struct PlatformPropertyLocaleListCall<'a, C>
1434where
1435 C: 'a,
1436{
1437 hub: &'a Ideahub<C>,
1438 _parent: String,
1439 _page_token: Option<String>,
1440 _page_size: Option<i32>,
1441 _delegate: Option<&'a mut dyn common::Delegate>,
1442 _additional_params: HashMap<String, String>,
1443}
1444
1445impl<'a, C> common::CallBuilder for PlatformPropertyLocaleListCall<'a, C> {}
1446
1447impl<'a, C> PlatformPropertyLocaleListCall<'a, C>
1448where
1449 C: common::Connector,
1450{
1451 /// Perform the operation you have build so far.
1452 pub async fn doit(
1453 mut self,
1454 ) -> common::Result<(
1455 common::Response,
1456 GoogleSearchIdeahubV1betaListAvailableLocalesResponse,
1457 )> {
1458 use std::borrow::Cow;
1459 use std::io::{Read, Seek};
1460
1461 use common::{url::Params, ToParts};
1462 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1463
1464 let mut dd = common::DefaultDelegate;
1465 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1466 dlg.begin(common::MethodInfo {
1467 id: "ideahub.platforms.properties.locales.list",
1468 http_method: hyper::Method::GET,
1469 });
1470
1471 for &field in ["alt", "parent", "pageToken", "pageSize"].iter() {
1472 if self._additional_params.contains_key(field) {
1473 dlg.finished(false);
1474 return Err(common::Error::FieldClash(field));
1475 }
1476 }
1477
1478 let mut params = Params::with_capacity(5 + self._additional_params.len());
1479 params.push("parent", self._parent);
1480 if let Some(value) = self._page_token.as_ref() {
1481 params.push("pageToken", value);
1482 }
1483 if let Some(value) = self._page_size.as_ref() {
1484 params.push("pageSize", value.to_string());
1485 }
1486
1487 params.extend(self._additional_params.iter());
1488
1489 params.push("alt", "json");
1490 let mut url = self.hub._base_url.clone() + "v1beta/{+parent}/locales";
1491
1492 match dlg.api_key() {
1493 Some(value) => params.push("key", value),
1494 None => {
1495 dlg.finished(false);
1496 return Err(common::Error::MissingAPIKey);
1497 }
1498 }
1499
1500 #[allow(clippy::single_element_loop)]
1501 for &(find_this, param_name) in [("{+parent}", "parent")].iter() {
1502 url = params.uri_replacement(url, param_name, find_this, true);
1503 }
1504 {
1505 let to_remove = ["parent"];
1506 params.remove_params(&to_remove);
1507 }
1508
1509 let url = params.parse_with_url(&url);
1510
1511 loop {
1512 let mut req_result = {
1513 let client = &self.hub.client;
1514 dlg.pre_request();
1515 let mut req_builder = hyper::Request::builder()
1516 .method(hyper::Method::GET)
1517 .uri(url.as_str())
1518 .header(USER_AGENT, self.hub._user_agent.clone());
1519
1520 let request = req_builder
1521 .header(CONTENT_LENGTH, 0_u64)
1522 .body(common::to_body::<String>(None));
1523
1524 client.request(request.unwrap()).await
1525 };
1526
1527 match req_result {
1528 Err(err) => {
1529 if let common::Retry::After(d) = dlg.http_error(&err) {
1530 sleep(d).await;
1531 continue;
1532 }
1533 dlg.finished(false);
1534 return Err(common::Error::HttpError(err));
1535 }
1536 Ok(res) => {
1537 let (mut parts, body) = res.into_parts();
1538 let mut body = common::Body::new(body);
1539 if !parts.status.is_success() {
1540 let bytes = common::to_bytes(body).await.unwrap_or_default();
1541 let error = serde_json::from_str(&common::to_string(&bytes));
1542 let response = common::to_response(parts, bytes.into());
1543
1544 if let common::Retry::After(d) =
1545 dlg.http_failure(&response, error.as_ref().ok())
1546 {
1547 sleep(d).await;
1548 continue;
1549 }
1550
1551 dlg.finished(false);
1552
1553 return Err(match error {
1554 Ok(value) => common::Error::BadRequest(value),
1555 _ => common::Error::Failure(response),
1556 });
1557 }
1558 let response = {
1559 let bytes = common::to_bytes(body).await.unwrap_or_default();
1560 let encoded = common::to_string(&bytes);
1561 match serde_json::from_str(&encoded) {
1562 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1563 Err(error) => {
1564 dlg.response_json_decode_error(&encoded, &error);
1565 return Err(common::Error::JsonDecodeError(
1566 encoded.to_string(),
1567 error,
1568 ));
1569 }
1570 }
1571 };
1572
1573 dlg.finished(true);
1574 return Ok(response);
1575 }
1576 }
1577 }
1578 }
1579
1580 /// Required. The web property to check idea availability for Format: platforms/{platform}/property/{property}
1581 ///
1582 /// Sets the *parent* path property to the given value.
1583 ///
1584 /// Even though the property as already been set when instantiating this call,
1585 /// we provide this method for API completeness.
1586 pub fn parent(mut self, new_value: &str) -> PlatformPropertyLocaleListCall<'a, C> {
1587 self._parent = new_value.to_string();
1588 self
1589 }
1590 /// A page token, received from a previous `ListAvailableLocales` call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAvailableLocales` must match the call that provided the page token.
1591 ///
1592 /// Sets the *page token* query property to the given value.
1593 pub fn page_token(mut self, new_value: &str) -> PlatformPropertyLocaleListCall<'a, C> {
1594 self._page_token = Some(new_value.to_string());
1595 self
1596 }
1597 /// The maximum number of locales to return. The service may return fewer than this value. If unspecified, at most 100 locales will be returned. The maximum value is 100; values above 100 will be coerced to 100.
1598 ///
1599 /// Sets the *page size* query property to the given value.
1600 pub fn page_size(mut self, new_value: i32) -> PlatformPropertyLocaleListCall<'a, C> {
1601 self._page_size = Some(new_value);
1602 self
1603 }
1604 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1605 /// while executing the actual API request.
1606 ///
1607 /// ````text
1608 /// It should be used to handle progress information, and to implement a certain level of resilience.
1609 /// ````
1610 ///
1611 /// Sets the *delegate* property to the given value.
1612 pub fn delegate(
1613 mut self,
1614 new_value: &'a mut dyn common::Delegate,
1615 ) -> PlatformPropertyLocaleListCall<'a, C> {
1616 self._delegate = Some(new_value);
1617 self
1618 }
1619
1620 /// Set any additional parameter of the query string used in the request.
1621 /// It should be used to set parameters which are not yet available through their own
1622 /// setters.
1623 ///
1624 /// Please note that this method must not be used to set any of the known parameters
1625 /// which have their own setter method. If done anyway, the request will fail.
1626 ///
1627 /// # Additional Parameters
1628 ///
1629 /// * *$.xgafv* (query-string) - V1 error format.
1630 /// * *access_token* (query-string) - OAuth access token.
1631 /// * *alt* (query-string) - Data format for response.
1632 /// * *callback* (query-string) - JSONP
1633 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1634 /// * *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.
1635 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1636 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1637 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1638 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1639 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1640 pub fn param<T>(mut self, name: T, value: T) -> PlatformPropertyLocaleListCall<'a, C>
1641 where
1642 T: AsRef<str>,
1643 {
1644 self._additional_params
1645 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1646 self
1647 }
1648}
1649
1650/// Update a topic state resource.
1651///
1652/// A builder for the *properties.topicStates.patch* method supported by a *platform* resource.
1653/// It is not used directly, but through a [`PlatformMethods`] instance.
1654///
1655/// # Example
1656///
1657/// Instantiate a resource method builder
1658///
1659/// ```test_harness,no_run
1660/// # extern crate hyper;
1661/// # extern crate hyper_rustls;
1662/// # extern crate google_ideahub1_beta as ideahub1_beta;
1663/// use ideahub1_beta::api::GoogleSearchIdeahubV1betaTopicState;
1664/// # async fn dox() {
1665/// # use ideahub1_beta::{Ideahub, FieldMask, hyper_rustls, hyper_util, yup_oauth2};
1666///
1667/// # let secret: yup_oauth2::ApplicationSecret = Default::default();
1668/// # let connector = hyper_rustls::HttpsConnectorBuilder::new()
1669/// # .with_native_roots()
1670/// # .unwrap()
1671/// # .https_only()
1672/// # .enable_http2()
1673/// # .build();
1674///
1675/// # let executor = hyper_util::rt::TokioExecutor::new();
1676/// # let auth = yup_oauth2::InstalledFlowAuthenticator::with_client(
1677/// # secret,
1678/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
1679/// # yup_oauth2::client::CustomHyperClientBuilder::from(
1680/// # hyper_util::client::legacy::Client::builder(executor).build(connector),
1681/// # ),
1682/// # ).build().await.unwrap();
1683///
1684/// # let client = hyper_util::client::legacy::Client::builder(
1685/// # hyper_util::rt::TokioExecutor::new()
1686/// # )
1687/// # .build(
1688/// # hyper_rustls::HttpsConnectorBuilder::new()
1689/// # .with_native_roots()
1690/// # .unwrap()
1691/// # .https_or_http()
1692/// # .enable_http2()
1693/// # .build()
1694/// # );
1695/// # let mut hub = Ideahub::new(client, auth);
1696/// // As the method needs a request, you would usually fill it with the desired information
1697/// // into the respective structure. Some of the parts shown here might not be applicable !
1698/// // Values shown here are possibly random and not representative !
1699/// let mut req = GoogleSearchIdeahubV1betaTopicState::default();
1700///
1701/// // You can configure optional parameters by calling the respective setters at will, and
1702/// // execute the final call using `doit()`.
1703/// // Values shown here are possibly random and not representative !
1704/// let result = hub.platforms().properties_topic_states_patch(req, "name")
1705/// .update_mask(FieldMask::new::<&str>(&[]))
1706/// .doit().await;
1707/// # }
1708/// ```
1709pub struct PlatformPropertyTopicStatePatchCall<'a, C>
1710where
1711 C: 'a,
1712{
1713 hub: &'a Ideahub<C>,
1714 _request: GoogleSearchIdeahubV1betaTopicState,
1715 _name: String,
1716 _update_mask: Option<common::FieldMask>,
1717 _delegate: Option<&'a mut dyn common::Delegate>,
1718 _additional_params: HashMap<String, String>,
1719}
1720
1721impl<'a, C> common::CallBuilder for PlatformPropertyTopicStatePatchCall<'a, C> {}
1722
1723impl<'a, C> PlatformPropertyTopicStatePatchCall<'a, C>
1724where
1725 C: common::Connector,
1726{
1727 /// Perform the operation you have build so far.
1728 pub async fn doit(
1729 mut self,
1730 ) -> common::Result<(common::Response, GoogleSearchIdeahubV1betaTopicState)> {
1731 use std::borrow::Cow;
1732 use std::io::{Read, Seek};
1733
1734 use common::{url::Params, ToParts};
1735 use hyper::header::{AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, LOCATION, USER_AGENT};
1736
1737 let mut dd = common::DefaultDelegate;
1738 let mut dlg: &mut dyn common::Delegate = self._delegate.unwrap_or(&mut dd);
1739 dlg.begin(common::MethodInfo {
1740 id: "ideahub.platforms.properties.topicStates.patch",
1741 http_method: hyper::Method::PATCH,
1742 });
1743
1744 for &field in ["alt", "name", "updateMask"].iter() {
1745 if self._additional_params.contains_key(field) {
1746 dlg.finished(false);
1747 return Err(common::Error::FieldClash(field));
1748 }
1749 }
1750
1751 let mut params = Params::with_capacity(5 + self._additional_params.len());
1752 params.push("name", self._name);
1753 if let Some(value) = self._update_mask.as_ref() {
1754 params.push("updateMask", value.to_string());
1755 }
1756
1757 params.extend(self._additional_params.iter());
1758
1759 params.push("alt", "json");
1760 let mut url = self.hub._base_url.clone() + "v1beta/{+name}";
1761
1762 match dlg.api_key() {
1763 Some(value) => params.push("key", value),
1764 None => {
1765 dlg.finished(false);
1766 return Err(common::Error::MissingAPIKey);
1767 }
1768 }
1769
1770 #[allow(clippy::single_element_loop)]
1771 for &(find_this, param_name) in [("{+name}", "name")].iter() {
1772 url = params.uri_replacement(url, param_name, find_this, true);
1773 }
1774 {
1775 let to_remove = ["name"];
1776 params.remove_params(&to_remove);
1777 }
1778
1779 let url = params.parse_with_url(&url);
1780
1781 let mut json_mime_type = mime::APPLICATION_JSON;
1782 let mut request_value_reader = {
1783 let mut value = serde_json::value::to_value(&self._request).expect("serde to work");
1784 common::remove_json_null_values(&mut value);
1785 let mut dst = std::io::Cursor::new(Vec::with_capacity(128));
1786 serde_json::to_writer(&mut dst, &value).unwrap();
1787 dst
1788 };
1789 let request_size = request_value_reader
1790 .seek(std::io::SeekFrom::End(0))
1791 .unwrap();
1792 request_value_reader
1793 .seek(std::io::SeekFrom::Start(0))
1794 .unwrap();
1795
1796 loop {
1797 request_value_reader
1798 .seek(std::io::SeekFrom::Start(0))
1799 .unwrap();
1800 let mut req_result = {
1801 let client = &self.hub.client;
1802 dlg.pre_request();
1803 let mut req_builder = hyper::Request::builder()
1804 .method(hyper::Method::PATCH)
1805 .uri(url.as_str())
1806 .header(USER_AGENT, self.hub._user_agent.clone());
1807
1808 let request = req_builder
1809 .header(CONTENT_TYPE, json_mime_type.to_string())
1810 .header(CONTENT_LENGTH, request_size as u64)
1811 .body(common::to_body(
1812 request_value_reader.get_ref().clone().into(),
1813 ));
1814
1815 client.request(request.unwrap()).await
1816 };
1817
1818 match req_result {
1819 Err(err) => {
1820 if let common::Retry::After(d) = dlg.http_error(&err) {
1821 sleep(d).await;
1822 continue;
1823 }
1824 dlg.finished(false);
1825 return Err(common::Error::HttpError(err));
1826 }
1827 Ok(res) => {
1828 let (mut parts, body) = res.into_parts();
1829 let mut body = common::Body::new(body);
1830 if !parts.status.is_success() {
1831 let bytes = common::to_bytes(body).await.unwrap_or_default();
1832 let error = serde_json::from_str(&common::to_string(&bytes));
1833 let response = common::to_response(parts, bytes.into());
1834
1835 if let common::Retry::After(d) =
1836 dlg.http_failure(&response, error.as_ref().ok())
1837 {
1838 sleep(d).await;
1839 continue;
1840 }
1841
1842 dlg.finished(false);
1843
1844 return Err(match error {
1845 Ok(value) => common::Error::BadRequest(value),
1846 _ => common::Error::Failure(response),
1847 });
1848 }
1849 let response = {
1850 let bytes = common::to_bytes(body).await.unwrap_or_default();
1851 let encoded = common::to_string(&bytes);
1852 match serde_json::from_str(&encoded) {
1853 Ok(decoded) => (common::to_response(parts, bytes.into()), decoded),
1854 Err(error) => {
1855 dlg.response_json_decode_error(&encoded, &error);
1856 return Err(common::Error::JsonDecodeError(
1857 encoded.to_string(),
1858 error,
1859 ));
1860 }
1861 }
1862 };
1863
1864 dlg.finished(true);
1865 return Ok(response);
1866 }
1867 }
1868 }
1869 }
1870
1871 ///
1872 /// Sets the *request* property to the given value.
1873 ///
1874 /// Even though the property as already been set when instantiating this call,
1875 /// we provide this method for API completeness.
1876 pub fn request(
1877 mut self,
1878 new_value: GoogleSearchIdeahubV1betaTopicState,
1879 ) -> PlatformPropertyTopicStatePatchCall<'a, C> {
1880 self._request = new_value;
1881 self
1882 }
1883 /// Unique identifier for the topic state. Format: platforms/{platform}/properties/{property}/topicStates/{topic_state}
1884 ///
1885 /// Sets the *name* path property to the given value.
1886 ///
1887 /// Even though the property as already been set when instantiating this call,
1888 /// we provide this method for API completeness.
1889 pub fn name(mut self, new_value: &str) -> PlatformPropertyTopicStatePatchCall<'a, C> {
1890 self._name = new_value.to_string();
1891 self
1892 }
1893 /// The list of fields to be updated.
1894 ///
1895 /// Sets the *update mask* query property to the given value.
1896 pub fn update_mask(
1897 mut self,
1898 new_value: common::FieldMask,
1899 ) -> PlatformPropertyTopicStatePatchCall<'a, C> {
1900 self._update_mask = Some(new_value);
1901 self
1902 }
1903 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
1904 /// while executing the actual API request.
1905 ///
1906 /// ````text
1907 /// It should be used to handle progress information, and to implement a certain level of resilience.
1908 /// ````
1909 ///
1910 /// Sets the *delegate* property to the given value.
1911 pub fn delegate(
1912 mut self,
1913 new_value: &'a mut dyn common::Delegate,
1914 ) -> PlatformPropertyTopicStatePatchCall<'a, C> {
1915 self._delegate = Some(new_value);
1916 self
1917 }
1918
1919 /// Set any additional parameter of the query string used in the request.
1920 /// It should be used to set parameters which are not yet available through their own
1921 /// setters.
1922 ///
1923 /// Please note that this method must not be used to set any of the known parameters
1924 /// which have their own setter method. If done anyway, the request will fail.
1925 ///
1926 /// # Additional Parameters
1927 ///
1928 /// * *$.xgafv* (query-string) - V1 error format.
1929 /// * *access_token* (query-string) - OAuth access token.
1930 /// * *alt* (query-string) - Data format for response.
1931 /// * *callback* (query-string) - JSONP
1932 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
1933 /// * *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.
1934 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
1935 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
1936 /// * *quotaUser* (query-string) - Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
1937 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
1938 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
1939 pub fn param<T>(mut self, name: T, value: T) -> PlatformPropertyTopicStatePatchCall<'a, C>
1940 where
1941 T: AsRef<str>,
1942 {
1943 self._additional_params
1944 .insert(name.as_ref().to_string(), value.as_ref().to_string());
1945 self
1946 }
1947}