mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
regenerate everything
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::borrow::BorrowMut;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeMap;
|
||||
use serde_json as json;
|
||||
@@ -103,38 +102,37 @@ impl Default for Scope {
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct Speech<C> {
|
||||
client: RefCell<C>,
|
||||
auth: RefCell<oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>>,
|
||||
pub struct Speech<> {
|
||||
client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>,
|
||||
auth: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>,
|
||||
_user_agent: String,
|
||||
_base_url: String,
|
||||
_root_url: String,
|
||||
}
|
||||
|
||||
impl<'a, C> client::Hub for Speech<C> {}
|
||||
impl<'a, > client::Hub for Speech<> {}
|
||||
|
||||
impl<'a, C> Speech<C>
|
||||
where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a, > Speech<> {
|
||||
|
||||
pub fn new(client: C, authenticator: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>) -> Speech<C> {
|
||||
pub fn new(client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>, authenticator: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>) -> Speech<> {
|
||||
Speech {
|
||||
client: RefCell::new(client),
|
||||
auth: RefCell::new(authenticator),
|
||||
_user_agent: "google-api-rust-client/2.0.0".to_string(),
|
||||
client,
|
||||
auth: authenticator,
|
||||
_user_agent: "google-api-rust-client/2.0.3".to_string(),
|
||||
_base_url: "https://speech.googleapis.com/".to_string(),
|
||||
_root_url: "https://speech.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn operations(&'a self) -> OperationMethods<'a, C> {
|
||||
pub fn operations(&'a self) -> OperationMethods<'a> {
|
||||
OperationMethods { hub: &self }
|
||||
}
|
||||
pub fn speech(&'a self) -> SpeechMethods<'a, C> {
|
||||
pub fn speech(&'a self) -> SpeechMethods<'a> {
|
||||
SpeechMethods { hub: &self }
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/2.0.0`.
|
||||
/// It defaults to `google-api-rust-client/2.0.3`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -519,15 +517,15 @@ impl client::Part for Status {}
|
||||
/// let rb = hub.operations();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationMethods<'a, C>
|
||||
where C: 'a {
|
||||
pub struct OperationMethods<'a>
|
||||
where {
|
||||
|
||||
hub: &'a Speech<C>,
|
||||
hub: &'a Speech<>,
|
||||
}
|
||||
|
||||
impl<'a, C> client::MethodsBuilder for OperationMethods<'a, C> {}
|
||||
impl<'a> client::MethodsBuilder for OperationMethods<'a> {}
|
||||
|
||||
impl<'a, C> OperationMethods<'a, C> {
|
||||
impl<'a> OperationMethods<'a> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
@@ -541,7 +539,7 @@ impl<'a, C> OperationMethods<'a, C> {
|
||||
/// For backwards compatibility, the default name includes the operations
|
||||
/// collection id, however overriding users must ensure the name binding
|
||||
/// is the parent resource, without the operations collection id.
|
||||
pub fn list(&self) -> OperationListCall<'a, C> {
|
||||
pub fn list(&self) -> OperationListCall<'a> {
|
||||
OperationListCall {
|
||||
hub: self.hub,
|
||||
_page_token: Default::default(),
|
||||
@@ -563,7 +561,7 @@ impl<'a, C> OperationMethods<'a, C> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The name of the operation resource.
|
||||
pub fn get(&self, name: &str) -> OperationGetCall<'a, C> {
|
||||
pub fn get(&self, name: &str) -> OperationGetCall<'a> {
|
||||
OperationGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
@@ -606,15 +604,15 @@ impl<'a, C> OperationMethods<'a, C> {
|
||||
/// let rb = hub.speech();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct SpeechMethods<'a, C>
|
||||
where C: 'a {
|
||||
pub struct SpeechMethods<'a>
|
||||
where {
|
||||
|
||||
hub: &'a Speech<C>,
|
||||
hub: &'a Speech<>,
|
||||
}
|
||||
|
||||
impl<'a, C> client::MethodsBuilder for SpeechMethods<'a, C> {}
|
||||
impl<'a> client::MethodsBuilder for SpeechMethods<'a> {}
|
||||
|
||||
impl<'a, C> SpeechMethods<'a, C> {
|
||||
impl<'a> SpeechMethods<'a> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
@@ -628,7 +626,7 @@ impl<'a, C> SpeechMethods<'a, C> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn asyncrecognize(&self, request: AsyncRecognizeRequest) -> SpeechAsyncrecognizeCall<'a, C> {
|
||||
pub fn asyncrecognize(&self, request: AsyncRecognizeRequest) -> SpeechAsyncrecognizeCall<'a> {
|
||||
SpeechAsyncrecognizeCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
@@ -646,7 +644,7 @@ impl<'a, C> SpeechMethods<'a, C> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn syncrecognize(&self, request: SyncRecognizeRequest) -> SpeechSyncrecognizeCall<'a, C> {
|
||||
pub fn syncrecognize(&self, request: SyncRecognizeRequest) -> SpeechSyncrecognizeCall<'a> {
|
||||
SpeechSyncrecognizeCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
@@ -710,10 +708,10 @@ impl<'a, C> SpeechMethods<'a, C> {
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationListCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct OperationListCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a Speech<C>,
|
||||
hub: &'a Speech<>,
|
||||
_page_token: Option<String>,
|
||||
_page_size: Option<i32>,
|
||||
_name: Option<String>,
|
||||
@@ -723,9 +721,9 @@ pub struct OperationListCall<'a, C>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for OperationListCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for OperationListCall<'a> {}
|
||||
|
||||
impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> OperationListCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -776,8 +774,7 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
|
||||
|
||||
loop {
|
||||
let authenticator = self.hub.auth.borrow_mut();
|
||||
let token = match authenticator.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
let token = match self.hub.auth.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token.clone(),
|
||||
Err(err) => {
|
||||
match dlg.token(&err) {
|
||||
@@ -790,7 +787,7 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
}
|
||||
};
|
||||
let mut req_result = {
|
||||
let mut client = &mut *self.hub.client.borrow_mut();
|
||||
let client = &self.hub.client;
|
||||
dlg.pre_request();
|
||||
let mut req_builder = hyper::Request::builder().method(hyper::Method::GET).uri(url.clone().into_string())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone()) .header(AUTHORIZATION, format!("Bearer {}", token.as_str()));
|
||||
@@ -799,7 +796,7 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
let request = req_builder
|
||||
.body(hyper::body::Body::empty());
|
||||
|
||||
client.borrow_mut().request(request.unwrap()).await
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
};
|
||||
|
||||
@@ -856,28 +853,28 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
/// The standard list page token.
|
||||
///
|
||||
/// Sets the *page token* query property to the given value.
|
||||
pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a, C> {
|
||||
pub fn page_token(mut self, new_value: &str) -> OperationListCall<'a> {
|
||||
self._page_token = Some(new_value.to_string());
|
||||
self
|
||||
}
|
||||
/// The standard list page size.
|
||||
///
|
||||
/// Sets the *page size* query property to the given value.
|
||||
pub fn page_size(mut self, new_value: i32) -> OperationListCall<'a, C> {
|
||||
pub fn page_size(mut self, new_value: i32) -> OperationListCall<'a> {
|
||||
self._page_size = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// The name of the operation's parent resource.
|
||||
///
|
||||
/// Sets the *name* query property to the given value.
|
||||
pub fn name(mut self, new_value: &str) -> OperationListCall<'a, C> {
|
||||
pub fn name(mut self, new_value: &str) -> OperationListCall<'a> {
|
||||
self._name = Some(new_value.to_string());
|
||||
self
|
||||
}
|
||||
/// The standard list filter.
|
||||
///
|
||||
/// Sets the *filter* query property to the given value.
|
||||
pub fn filter(mut self, new_value: &str) -> OperationListCall<'a, C> {
|
||||
pub fn filter(mut self, new_value: &str) -> OperationListCall<'a> {
|
||||
self._filter = Some(new_value.to_string());
|
||||
self
|
||||
}
|
||||
@@ -887,7 +884,7 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> OperationListCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> OperationListCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -912,7 +909,7 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
/// * *alt* (query-string) - Data format for response.
|
||||
/// * *access_token* (query-string) - OAuth access token.
|
||||
/// * *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.
|
||||
pub fn param<T>(mut self, name: T, value: T) -> OperationListCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> OperationListCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -932,7 +929,7 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
/// Usually there is more than one suitable scope to authorize an operation, some of which may
|
||||
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
|
||||
/// sufficient, a read-write scope will do as well.
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> OperationListCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> OperationListCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -978,19 +975,19 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationGetCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct OperationGetCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a Speech<C>,
|
||||
hub: &'a Speech<>,
|
||||
_name: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for OperationGetCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for OperationGetCall<'a> {}
|
||||
|
||||
impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> OperationGetCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -1055,8 +1052,7 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
|
||||
|
||||
loop {
|
||||
let authenticator = self.hub.auth.borrow_mut();
|
||||
let token = match authenticator.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
let token = match self.hub.auth.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token.clone(),
|
||||
Err(err) => {
|
||||
match dlg.token(&err) {
|
||||
@@ -1069,7 +1065,7 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
}
|
||||
};
|
||||
let mut req_result = {
|
||||
let mut client = &mut *self.hub.client.borrow_mut();
|
||||
let client = &self.hub.client;
|
||||
dlg.pre_request();
|
||||
let mut req_builder = hyper::Request::builder().method(hyper::Method::GET).uri(url.clone().into_string())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone()) .header(AUTHORIZATION, format!("Bearer {}", token.as_str()));
|
||||
@@ -1078,7 +1074,7 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
let request = req_builder
|
||||
.body(hyper::body::Body::empty());
|
||||
|
||||
client.borrow_mut().request(request.unwrap()).await
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
};
|
||||
|
||||
@@ -1138,7 +1134,7 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn name(mut self, new_value: &str) -> OperationGetCall<'a, C> {
|
||||
pub fn name(mut self, new_value: &str) -> OperationGetCall<'a> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -1148,7 +1144,7 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> OperationGetCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> OperationGetCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1173,7 +1169,7 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
/// * *alt* (query-string) - Data format for response.
|
||||
/// * *access_token* (query-string) - OAuth access token.
|
||||
/// * *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.
|
||||
pub fn param<T>(mut self, name: T, value: T) -> OperationGetCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> OperationGetCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -1193,7 +1189,7 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
/// Usually there is more than one suitable scope to authorize an operation, some of which may
|
||||
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
|
||||
/// sufficient, a read-write scope will do as well.
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> OperationGetCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> OperationGetCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -1248,19 +1244,19 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct SpeechAsyncrecognizeCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct SpeechAsyncrecognizeCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a Speech<C>,
|
||||
hub: &'a Speech<>,
|
||||
_request: AsyncRecognizeRequest,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for SpeechAsyncrecognizeCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for SpeechAsyncrecognizeCall<'a> {}
|
||||
|
||||
impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> SpeechAsyncrecognizeCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -1310,8 +1306,7 @@ impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
|
||||
|
||||
loop {
|
||||
let authenticator = self.hub.auth.borrow_mut();
|
||||
let token = match authenticator.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
let token = match self.hub.auth.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token.clone(),
|
||||
Err(err) => {
|
||||
match dlg.token(&err) {
|
||||
@@ -1325,7 +1320,7 @@ impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
};
|
||||
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
|
||||
let mut req_result = {
|
||||
let mut client = &mut *self.hub.client.borrow_mut();
|
||||
let client = &self.hub.client;
|
||||
dlg.pre_request();
|
||||
let mut req_builder = hyper::Request::builder().method(hyper::Method::POST).uri(url.clone().into_string())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone()) .header(AUTHORIZATION, format!("Bearer {}", token.as_str()));
|
||||
@@ -1336,7 +1331,7 @@ impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
.header(CONTENT_LENGTH, request_size as u64)
|
||||
.body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
|
||||
|
||||
client.borrow_mut().request(request.unwrap()).await
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
};
|
||||
|
||||
@@ -1395,7 +1390,7 @@ impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn request(mut self, new_value: AsyncRecognizeRequest) -> SpeechAsyncrecognizeCall<'a, C> {
|
||||
pub fn request(mut self, new_value: AsyncRecognizeRequest) -> SpeechAsyncrecognizeCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
@@ -1405,7 +1400,7 @@ impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> SpeechAsyncrecognizeCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> SpeechAsyncrecognizeCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1430,7 +1425,7 @@ impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
/// * *alt* (query-string) - Data format for response.
|
||||
/// * *access_token* (query-string) - OAuth access token.
|
||||
/// * *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.
|
||||
pub fn param<T>(mut self, name: T, value: T) -> SpeechAsyncrecognizeCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> SpeechAsyncrecognizeCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -1450,7 +1445,7 @@ impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
/// Usually there is more than one suitable scope to authorize an operation, some of which may
|
||||
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
|
||||
/// sufficient, a read-write scope will do as well.
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> SpeechAsyncrecognizeCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> SpeechAsyncrecognizeCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -1501,19 +1496,19 @@ impl<'a, C> SpeechAsyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct SpeechSyncrecognizeCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct SpeechSyncrecognizeCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a Speech<C>,
|
||||
hub: &'a Speech<>,
|
||||
_request: SyncRecognizeRequest,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for SpeechSyncrecognizeCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for SpeechSyncrecognizeCall<'a> {}
|
||||
|
||||
impl<'a, C> SpeechSyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> SpeechSyncrecognizeCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -1563,8 +1558,7 @@ impl<'a, C> SpeechSyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hype
|
||||
|
||||
|
||||
loop {
|
||||
let authenticator = self.hub.auth.borrow_mut();
|
||||
let token = match authenticator.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
let token = match self.hub.auth.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token.clone(),
|
||||
Err(err) => {
|
||||
match dlg.token(&err) {
|
||||
@@ -1578,7 +1572,7 @@ impl<'a, C> SpeechSyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hype
|
||||
};
|
||||
request_value_reader.seek(io::SeekFrom::Start(0)).unwrap();
|
||||
let mut req_result = {
|
||||
let mut client = &mut *self.hub.client.borrow_mut();
|
||||
let client = &self.hub.client;
|
||||
dlg.pre_request();
|
||||
let mut req_builder = hyper::Request::builder().method(hyper::Method::POST).uri(url.clone().into_string())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone()) .header(AUTHORIZATION, format!("Bearer {}", token.as_str()));
|
||||
@@ -1589,7 +1583,7 @@ impl<'a, C> SpeechSyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hype
|
||||
.header(CONTENT_LENGTH, request_size as u64)
|
||||
.body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
|
||||
|
||||
client.borrow_mut().request(request.unwrap()).await
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
};
|
||||
|
||||
@@ -1648,7 +1642,7 @@ impl<'a, C> SpeechSyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hype
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn request(mut self, new_value: SyncRecognizeRequest) -> SpeechSyncrecognizeCall<'a, C> {
|
||||
pub fn request(mut self, new_value: SyncRecognizeRequest) -> SpeechSyncrecognizeCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
@@ -1658,7 +1652,7 @@ impl<'a, C> SpeechSyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hype
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
///
|
||||
/// Sets the *delegate* property to the given value.
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> SpeechSyncrecognizeCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> SpeechSyncrecognizeCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1683,7 +1677,7 @@ impl<'a, C> SpeechSyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hype
|
||||
/// * *alt* (query-string) - Data format for response.
|
||||
/// * *access_token* (query-string) - OAuth access token.
|
||||
/// * *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.
|
||||
pub fn param<T>(mut self, name: T, value: T) -> SpeechSyncrecognizeCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> SpeechSyncrecognizeCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -1703,7 +1697,7 @@ impl<'a, C> SpeechSyncrecognizeCall<'a, C> where C: BorrowMut<hyper::Client<hype
|
||||
/// Usually there is more than one suitable scope to authorize an operation, some of which may
|
||||
/// encompass more rights than others. For example, for listing resources, a *read-only* scope will be
|
||||
/// sufficient, a read-write scope will do as well.
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> SpeechSyncrecognizeCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> SpeechSyncrecognizeCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
|
||||
Reference in New Issue
Block a user