google_kgsearch1/lib.rs
1// DO NOT EDIT !
2// This file was generated automatically from 'src/mako/api/lib.rs.mako'
3// DO NOT EDIT !
4
5//! This documentation was generated from *kgsearch* crate version *1.0.4+20151215*, where *20151215* is the exact revision of the *kgsearch:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v1.0.4*.
6//!
7//! Everything else about the *kgsearch* *v1* API can be found at the
8//! [official documentation site](https://developers.google.com/knowledge-graph/).
9//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/kgsearch1).
10//! # Features
11//!
12//! Handle the following *Resources* with ease from the central [hub](struct.Kgsearch.html) ...
13//!
14//! * entities
15//! * [*search*](struct.EntitySearchCall.html)
16//!
17//!
18//!
19//!
20//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
21//!
22//! # Structure of this Library
23//!
24//! The API is structured into the following primary items:
25//!
26//! * **[Hub](struct.Kgsearch.html)**
27//! * a central object to maintain state and allow accessing all *Activities*
28//! * creates [*Method Builders*](trait.MethodsBuilder.html) which in turn
29//! allow access to individual [*Call Builders*](trait.CallBuilder.html)
30//! * **[Resources](trait.Resource.html)**
31//! * primary types that you can apply *Activities* to
32//! * a collection of properties and *Parts*
33//! * **[Parts](trait.Part.html)**
34//! * a collection of properties
35//! * never directly used in *Activities*
36//! * **[Activities](trait.CallBuilder.html)**
37//! * operations to apply to *Resources*
38//!
39//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
40//!
41//! Generally speaking, you can invoke *Activities* like this:
42//!
43//! ```Rust,ignore
44//! let r = hub.resource().activity(...).doit()
45//! ```
46//!
47//! Or specifically ...
48//!
49//! ```ignore
50//! let r = hub.entities().search(...).doit()
51//! ```
52//!
53//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
54//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
55//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
56//! The `doit()` method performs the actual communication with the server and returns the respective result.
57//!
58//! # Usage
59//!
60//! ## Setting up your Project
61//!
62//! To use this library, you would put the following lines into your `Cargo.toml` file:
63//!
64//! ```toml
65//! [dependencies]
66//! google-kgsearch1 = "*"
67//! ```
68//!
69//! ## A complete example
70//!
71//! ```test_harness,no_run
72//! extern crate hyper;
73//! extern crate yup_oauth2 as oauth2;
74//! extern crate google_kgsearch1 as kgsearch1;
75//! use kgsearch1::{Result, Error};
76//! # #[test] fn egal() {
77//! use std::default::Default;
78//! use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
79//! use kgsearch1::Kgsearch;
80//!
81//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
82//! // `client_secret`, among other things.
83//! let secret: ApplicationSecret = Default::default();
84//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
85//! // unless you replace `None` with the desired Flow.
86//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
87//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
88//! // retrieve them from storage.
89//! let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
90//! hyper::Client::new(),
91//! <MemoryStorage as Default>::default(), None);
92//! let mut hub = Kgsearch::new(hyper::Client::new(), auth);
93//! // You can configure optional parameters by calling the respective setters at will, and
94//! // execute the final call using `doit()`.
95//! // Values shown here are possibly random and not representative !
96//! let result = hub.entities().search()
97//! .add_types("accusam")
98//! .query("takimata")
99//! .prefix(false)
100//! .limit(-1)
101//! .add_languages("erat")
102//! .indent(true)
103//! .add_ids("sea")
104//! .doit();
105//!
106//! match result {
107//! Err(e) => match e {
108//! // The Error enum provides details about what exactly happened.
109//! // You can also just use its `Debug`, `Display` or `Error` traits
110//! Error::HttpError(_)
111//! |Error::MissingAPIKey
112//! |Error::MissingToken(_)
113//! |Error::Cancelled
114//! |Error::UploadSizeLimitExceeded(_, _)
115//! |Error::Failure(_)
116//! |Error::BadRequest(_)
117//! |Error::FieldClash(_)
118//! |Error::JsonDecodeError(_, _) => println!("{}", e),
119//! },
120//! Ok(res) => println!("Success: {:?}", res),
121//! }
122//! # }
123//! ```
124//! ## Handling Errors
125//!
126//! All errors produced by the system are provided either as [Result](enum.Result.html) enumeration as return value of
127//! the doit() methods, or handed as possibly intermediate results to either the
128//! [Hub Delegate](trait.Delegate.html), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
129//!
130//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
131//! makes the system potentially resilient to all kinds of errors.
132//!
133//! ## Uploads and Downloads
134//! If a method supports downloads, the response body, which is part of the [Result](enum.Result.html), should be
135//! read by you to obtain the media.
136//! If such a method also supports a [Response Result](trait.ResponseResult.html), it will return that by default.
137//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
138//! this call: `.param("alt", "media")`.
139//!
140//! Methods supporting uploads can do so using up to 2 different protocols:
141//! *simple* and *resumable*. The distinctiveness of each is represented by customized
142//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
143//!
144//! ## Customization and Callbacks
145//!
146//! You may alter the way an `doit()` method is called by providing a [delegate](trait.Delegate.html) to the
147//! [Method Builder](trait.CallBuilder.html) before making the final `doit()` call.
148//! Respective methods will be called to provide progress information, as well as determine whether the system should
149//! retry on failure.
150//!
151//! The [delegate trait](trait.Delegate.html) is default-implemented, allowing you to customize it with minimal effort.
152//!
153//! ## Optional Parts in Server-Requests
154//!
155//! All structures provided by this library are made to be [enocodable](trait.RequestValue.html) and
156//! [decodable](trait.ResponseResult.html) via *json*. Optionals are used to indicate that partial requests are responses
157//! are valid.
158//! Most optionals are are considered [Parts](trait.Part.html) which are identifiable by name, which will be sent to
159//! the server to indicate either the set parts of the request or the desired parts in the response.
160//!
161//! ## Builder Arguments
162//!
163//! Using [method builders](trait.CallBuilder.html), you are able to prepare an action call by repeatedly calling it's methods.
164//! These will always take a single argument, for which the following statements are true.
165//!
166//! * [PODs][wiki-pod] are handed by copy
167//! * strings are passed as `&str`
168//! * [request values](trait.RequestValue.html) are moved
169//!
170//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
171//!
172//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
173//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
174//! [google-go-api]: https://github.com/google/google-api-go-client
175//!
176//!
177
178// Unused attributes happen thanks to defined, but unused structures
179// We don't warn about this, as depending on the API, some data structures or facilities are never used.
180// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any
181// unused imports in fully featured APIs. Same with unused_mut ... .
182#![allow(unused_imports, unused_mut, dead_code)]
183
184// DO NOT EDIT !
185// This file was generated automatically from 'src/mako/api/lib.rs.mako'
186// DO NOT EDIT !
187
188#[macro_use]
189extern crate serde_derive;
190
191extern crate hyper;
192extern crate serde;
193extern crate serde_json;
194extern crate yup_oauth2 as oauth2;
195extern crate mime;
196extern crate url;
197
198mod cmn;
199
200use std::collections::HashMap;
201use std::cell::RefCell;
202use std::borrow::BorrowMut;
203use std::default::Default;
204use std::collections::BTreeMap;
205use serde_json as json;
206use std::io;
207use std::fs;
208use std::thread::sleep;
209use std::time::Duration;
210
211pub use cmn::{MultiPartReader, ToParts, MethodInfo, Result, Error, CallBuilder, Hub, ReadSeek, Part,
212 ResponseResult, RequestValue, NestedType, Delegate, DefaultDelegate, MethodsBuilder,
213 Resource, ErrorResponse, remove_json_null_values};
214
215
216// ##############
217// UTILITIES ###
218// ############
219
220
221
222
223// ########
224// HUB ###
225// ######
226
227/// Central instance to access all Kgsearch related resource activities
228///
229/// # Examples
230///
231/// Instantiate a new hub
232///
233/// ```test_harness,no_run
234/// extern crate hyper;
235/// extern crate yup_oauth2 as oauth2;
236/// extern crate google_kgsearch1 as kgsearch1;
237/// use kgsearch1::{Result, Error};
238/// # #[test] fn egal() {
239/// use std::default::Default;
240/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
241/// use kgsearch1::Kgsearch;
242///
243/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
244/// // `client_secret`, among other things.
245/// let secret: ApplicationSecret = Default::default();
246/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
247/// // unless you replace `None` with the desired Flow.
248/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
249/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
250/// // retrieve them from storage.
251/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
252/// hyper::Client::new(),
253/// <MemoryStorage as Default>::default(), None);
254/// let mut hub = Kgsearch::new(hyper::Client::new(), auth);
255/// // You can configure optional parameters by calling the respective setters at will, and
256/// // execute the final call using `doit()`.
257/// // Values shown here are possibly random and not representative !
258/// let result = hub.entities().search()
259/// .add_types("nonumy")
260/// .query("dolores")
261/// .prefix(false)
262/// .limit(-95)
263/// .add_languages("aliquyam")
264/// .indent(false)
265/// .add_ids("no")
266/// .doit();
267///
268/// match result {
269/// Err(e) => match e {
270/// // The Error enum provides details about what exactly happened.
271/// // You can also just use its `Debug`, `Display` or `Error` traits
272/// Error::HttpError(_)
273/// |Error::MissingAPIKey
274/// |Error::MissingToken(_)
275/// |Error::Cancelled
276/// |Error::UploadSizeLimitExceeded(_, _)
277/// |Error::Failure(_)
278/// |Error::BadRequest(_)
279/// |Error::FieldClash(_)
280/// |Error::JsonDecodeError(_, _) => println!("{}", e),
281/// },
282/// Ok(res) => println!("Success: {:?}", res),
283/// }
284/// # }
285/// ```
286pub struct Kgsearch<C, A> {
287 client: RefCell<C>,
288 auth: RefCell<A>,
289 _user_agent: String,
290}
291
292impl<'a, C, A> Hub for Kgsearch<C, A> {}
293
294impl<'a, C, A> Kgsearch<C, A>
295 where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
296
297 pub fn new(client: C, authenticator: A) -> Kgsearch<C, A> {
298 Kgsearch {
299 client: RefCell::new(client),
300 auth: RefCell::new(authenticator),
301 _user_agent: "google-api-rust-client/1.0.4".to_string(),
302 }
303 }
304
305 pub fn entities(&'a self) -> EntityMethods<'a, C, A> {
306 EntityMethods { hub: &self }
307 }
308
309 /// Set the user-agent header field to use in all requests to the server.
310 /// It defaults to `google-api-rust-client/1.0.4`.
311 ///
312 /// Returns the previously set user-agent.
313 pub fn user_agent(&mut self, agent_name: String) -> String {
314 let prev = self._user_agent.clone();
315 self._user_agent = agent_name;
316 prev
317 }
318}
319
320
321// ############
322// SCHEMAS ###
323// ##########
324/// Response message includes the context and a list of matching results which contain the detail of associated entities.
325///
326/// # Activities
327///
328/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
329/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
330///
331/// * [search entities](struct.EntitySearchCall.html) (response)
332///
333#[derive(Default, Clone, Debug, Serialize, Deserialize)]
334pub struct SearchResponse {
335 /// The schema type of top-level JSON-LD object, e.g. ItemList.
336 #[serde(rename="type")]
337 pub type_: Option<String>,
338 /// The item list of search results.
339 #[serde(rename="itemListElement")]
340 pub item_list_element: Option<Vec<String>>,
341 /// The local context applicable for the response. See more details at http://www.w3.org/TR/json-ld/#context-definitions.
342 pub context: Option<String>,
343}
344
345impl ResponseResult for SearchResponse {}
346
347
348
349// ###################
350// MethodBuilders ###
351// #################
352
353/// A builder providing access to all methods supported on *entity* resources.
354/// It is not used directly, but through the `Kgsearch` hub.
355///
356/// # Example
357///
358/// Instantiate a resource builder
359///
360/// ```test_harness,no_run
361/// extern crate hyper;
362/// extern crate yup_oauth2 as oauth2;
363/// extern crate google_kgsearch1 as kgsearch1;
364///
365/// # #[test] fn egal() {
366/// use std::default::Default;
367/// use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
368/// use kgsearch1::Kgsearch;
369///
370/// let secret: ApplicationSecret = Default::default();
371/// let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
372/// hyper::Client::new(),
373/// <MemoryStorage as Default>::default(), None);
374/// let mut hub = Kgsearch::new(hyper::Client::new(), auth);
375/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
376/// // like `search(...)`
377/// // to build up your call.
378/// let rb = hub.entities();
379/// # }
380/// ```
381pub struct EntityMethods<'a, C, A>
382 where C: 'a, A: 'a {
383
384 hub: &'a Kgsearch<C, A>,
385}
386
387impl<'a, C, A> MethodsBuilder for EntityMethods<'a, C, A> {}
388
389impl<'a, C, A> EntityMethods<'a, C, A> {
390
391 /// Create a builder to help you perform the following task:
392 ///
393 /// Searches Knowledge Graph for entities that match the constraints. A list of matched entities will be returned in response, which will be in JSON-LD format and compatible with http://schema.org
394 pub fn search(&self) -> EntitySearchCall<'a, C, A> {
395 EntitySearchCall {
396 hub: self.hub,
397 _types: Default::default(),
398 _query: Default::default(),
399 _prefix: Default::default(),
400 _limit: Default::default(),
401 _languages: Default::default(),
402 _indent: Default::default(),
403 _ids: Default::default(),
404 _delegate: Default::default(),
405 _additional_params: Default::default(),
406 }
407 }
408}
409
410
411
412
413
414// ###################
415// CallBuilders ###
416// #################
417
418/// Searches Knowledge Graph for entities that match the constraints. A list of matched entities will be returned in response, which will be in JSON-LD format and compatible with http://schema.org
419///
420/// A builder for the *search* method supported by a *entity* resource.
421/// It is not used directly, but through a `EntityMethods` instance.
422///
423/// # Example
424///
425/// Instantiate a resource method builder
426///
427/// ```test_harness,no_run
428/// # extern crate hyper;
429/// # extern crate yup_oauth2 as oauth2;
430/// # extern crate google_kgsearch1 as kgsearch1;
431/// # #[test] fn egal() {
432/// # use std::default::Default;
433/// # use oauth2::{Authenticator, DefaultAuthenticatorDelegate, ApplicationSecret, MemoryStorage};
434/// # use kgsearch1::Kgsearch;
435///
436/// # let secret: ApplicationSecret = Default::default();
437/// # let auth = Authenticator::new(&secret, DefaultAuthenticatorDelegate,
438/// # hyper::Client::new(),
439/// # <MemoryStorage as Default>::default(), None);
440/// # let mut hub = Kgsearch::new(hyper::Client::new(), auth);
441/// // You can configure optional parameters by calling the respective setters at will, and
442/// // execute the final call using `doit()`.
443/// // Values shown here are possibly random and not representative !
444/// let result = hub.entities().search()
445/// .add_types("justo")
446/// .query("justo")
447/// .prefix(true)
448/// .limit(-17)
449/// .add_languages("diam")
450/// .indent(false)
451/// .add_ids("Lorem")
452/// .doit();
453/// # }
454/// ```
455pub struct EntitySearchCall<'a, C, A>
456 where C: 'a, A: 'a {
457
458 hub: &'a Kgsearch<C, A>,
459 _types: Vec<String>,
460 _query: Option<String>,
461 _prefix: Option<bool>,
462 _limit: Option<i32>,
463 _languages: Vec<String>,
464 _indent: Option<bool>,
465 _ids: Vec<String>,
466 _delegate: Option<&'a mut Delegate>,
467 _additional_params: HashMap<String, String>,
468}
469
470impl<'a, C, A> CallBuilder for EntitySearchCall<'a, C, A> {}
471
472impl<'a, C, A> EntitySearchCall<'a, C, A> where C: BorrowMut<hyper::Client>, A: oauth2::GetToken {
473
474
475 /// Perform the operation you have build so far.
476 pub fn doit(mut self) -> Result<(hyper::client::Response, SearchResponse)> {
477 use std::io::{Read, Seek};
478 use hyper::header::{ContentType, ContentLength, Authorization, Bearer, UserAgent, Location};
479 let mut dd = DefaultDelegate;
480 let mut dlg: &mut Delegate = match self._delegate {
481 Some(d) => d,
482 None => &mut dd
483 };
484 dlg.begin(MethodInfo { id: "kgsearch.entities.search",
485 http_method: hyper::method::Method::Get });
486 let mut params: Vec<(&str, String)> = Vec::with_capacity((9 + self._additional_params.len()));
487 if self._types.len() > 0 {
488 for f in self._types.iter() {
489 params.push(("types", f.to_string()));
490 }
491 }
492 if let Some(value) = self._query {
493 params.push(("query", value.to_string()));
494 }
495 if let Some(value) = self._prefix {
496 params.push(("prefix", value.to_string()));
497 }
498 if let Some(value) = self._limit {
499 params.push(("limit", value.to_string()));
500 }
501 if self._languages.len() > 0 {
502 for f in self._languages.iter() {
503 params.push(("languages", f.to_string()));
504 }
505 }
506 if let Some(value) = self._indent {
507 params.push(("indent", value.to_string()));
508 }
509 if self._ids.len() > 0 {
510 for f in self._ids.iter() {
511 params.push(("ids", f.to_string()));
512 }
513 }
514 for &field in ["alt", "types", "query", "prefix", "limit", "languages", "indent", "ids"].iter() {
515 if self._additional_params.contains_key(field) {
516 dlg.finished(false);
517 return Err(Error::FieldClash(field));
518 }
519 }
520 for (name, value) in self._additional_params.iter() {
521 params.push((&name, value.clone()));
522 }
523
524 params.push(("alt", "json".to_string()));
525
526 let mut url = "https://kgsearch.googleapis.com/v1/entities:search".to_string();
527
528 let mut key = self.hub.auth.borrow_mut().api_key();
529 if key.is_none() {
530 key = dlg.api_key();
531 }
532 match key {
533 Some(value) => params.push(("key", value)),
534 None => {
535 dlg.finished(false);
536 return Err(Error::MissingAPIKey)
537 }
538 }
539
540
541 if params.len() > 0 {
542 url.push('?');
543 url.push_str(&url::form_urlencoded::serialize(params));
544 }
545
546
547
548 loop {
549 let mut req_result = {
550 let mut client = &mut *self.hub.client.borrow_mut();
551 let mut req = client.borrow_mut().request(hyper::method::Method::Get, &url)
552 .header(UserAgent(self.hub._user_agent.clone()));
553
554 dlg.pre_request();
555 req.send()
556 };
557
558 match req_result {
559 Err(err) => {
560 if let oauth2::Retry::After(d) = dlg.http_error(&err) {
561 sleep(d);
562 continue;
563 }
564 dlg.finished(false);
565 return Err(Error::HttpError(err))
566 }
567 Ok(mut res) => {
568 if !res.status.is_success() {
569 let mut json_err = String::new();
570 res.read_to_string(&mut json_err).unwrap();
571 if let oauth2::Retry::After(d) = dlg.http_failure(&res,
572 json::from_str(&json_err).ok(),
573 json::from_str(&json_err).ok()) {
574 sleep(d);
575 continue;
576 }
577 dlg.finished(false);
578 return match json::from_str::<ErrorResponse>(&json_err){
579 Err(_) => Err(Error::Failure(res)),
580 Ok(serr) => Err(Error::BadRequest(serr))
581 }
582 }
583 let result_value = {
584 let mut json_response = String::new();
585 res.read_to_string(&mut json_response).unwrap();
586 match json::from_str(&json_response) {
587 Ok(decoded) => (res, decoded),
588 Err(err) => {
589 dlg.response_json_decode_error(&json_response, &err);
590 return Err(Error::JsonDecodeError(json_response, err));
591 }
592 }
593 };
594
595 dlg.finished(true);
596 return Ok(result_value)
597 }
598 }
599 }
600 }
601
602
603 /// Restricts returned entities with these types, e.g. Person (as defined in http://schema.org/Person).
604 ///
605 /// Append the given value to the *types* query property.
606 /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters.
607 pub fn add_types(mut self, new_value: &str) -> EntitySearchCall<'a, C, A> {
608 self._types.push(new_value.to_string());
609 self
610 }
611 /// The literal query string for search.
612 ///
613 /// Sets the *query* query property to the given value.
614 pub fn query(mut self, new_value: &str) -> EntitySearchCall<'a, C, A> {
615 self._query = Some(new_value.to_string());
616 self
617 }
618 /// Enables prefix match against names and aliases of entities
619 ///
620 /// Sets the *prefix* query property to the given value.
621 pub fn prefix(mut self, new_value: bool) -> EntitySearchCall<'a, C, A> {
622 self._prefix = Some(new_value);
623 self
624 }
625 /// Limits the number of entities to be returned.
626 ///
627 /// Sets the *limit* query property to the given value.
628 pub fn limit(mut self, new_value: i32) -> EntitySearchCall<'a, C, A> {
629 self._limit = Some(new_value);
630 self
631 }
632 /// The list of language codes (defined in ISO 693) to run the query with, e.g. 'en'.
633 ///
634 /// Append the given value to the *languages* query property.
635 /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters.
636 pub fn add_languages(mut self, new_value: &str) -> EntitySearchCall<'a, C, A> {
637 self._languages.push(new_value.to_string());
638 self
639 }
640 /// Enables indenting of json results.
641 ///
642 /// Sets the *indent* query property to the given value.
643 pub fn indent(mut self, new_value: bool) -> EntitySearchCall<'a, C, A> {
644 self._indent = Some(new_value);
645 self
646 }
647 /// The list of entity id to be used for search instead of query string.
648 ///
649 /// Append the given value to the *ids* query property.
650 /// Each appended value will retain its original ordering and be '/'-separated in the URL's parameters.
651 pub fn add_ids(mut self, new_value: &str) -> EntitySearchCall<'a, C, A> {
652 self._ids.push(new_value.to_string());
653 self
654 }
655 /// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
656 /// while executing the actual API request.
657 ///
658 /// It should be used to handle progress information, and to implement a certain level of resilience.
659 ///
660 /// Sets the *delegate* property to the given value.
661 pub fn delegate(mut self, new_value: &'a mut Delegate) -> EntitySearchCall<'a, C, A> {
662 self._delegate = Some(new_value);
663 self
664 }
665
666 /// Set any additional parameter of the query string used in the request.
667 /// It should be used to set parameters which are not yet available through their own
668 /// setters.
669 ///
670 /// Please note that this method must not be used to set any of the known paramters
671 /// which have their own setter method. If done anyway, the request will fail.
672 ///
673 /// # Additional Parameters
674 ///
675 /// * *bearer_token* (query-string) - OAuth bearer token.
676 /// * *pp* (query-boolean) - Pretty-print response.
677 /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks.
678 /// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
679 /// * *access_token* (query-string) - OAuth access token.
680 /// * *fields* (query-string) - Selector specifying which fields to include in a partial response.
681 /// * *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.
682 /// * *callback* (query-string) - JSONP
683 /// * *oauth_token* (query-string) - OAuth 2.0 token for the current user.
684 /// * *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.
685 /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
686 /// * *alt* (query-string) - Data format for response.
687 /// * *$.xgafv* (query-string) - V1 error format.
688 pub fn param<T>(mut self, name: T, value: T) -> EntitySearchCall<'a, C, A>
689 where T: AsRef<str> {
690 self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
691 self
692 }
693
694}
695
696
697