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;
|
||||
@@ -105,35 +104,34 @@ impl Default for Scope {
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct FirebaseCloudMessaging<C> {
|
||||
client: RefCell<C>,
|
||||
auth: RefCell<oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>>,
|
||||
pub struct FirebaseCloudMessaging<> {
|
||||
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 FirebaseCloudMessaging<C> {}
|
||||
impl<'a, > client::Hub for FirebaseCloudMessaging<> {}
|
||||
|
||||
impl<'a, C> FirebaseCloudMessaging<C>
|
||||
where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a, > FirebaseCloudMessaging<> {
|
||||
|
||||
pub fn new(client: C, authenticator: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>) -> FirebaseCloudMessaging<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>>) -> FirebaseCloudMessaging<> {
|
||||
FirebaseCloudMessaging {
|
||||
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://fcm.googleapis.com/".to_string(),
|
||||
_root_url: "https://fcm.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn projects(&'a self) -> ProjectMethods<'a, C> {
|
||||
pub fn projects(&'a self) -> ProjectMethods<'a> {
|
||||
ProjectMethods { 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 {
|
||||
@@ -514,15 +512,15 @@ impl client::Part for WebpushFcmOptions {}
|
||||
/// let rb = hub.projects();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ProjectMethods<'a, C>
|
||||
where C: 'a {
|
||||
pub struct ProjectMethods<'a>
|
||||
where {
|
||||
|
||||
hub: &'a FirebaseCloudMessaging<C>,
|
||||
hub: &'a FirebaseCloudMessaging<>,
|
||||
}
|
||||
|
||||
impl<'a, C> client::MethodsBuilder for ProjectMethods<'a, C> {}
|
||||
impl<'a> client::MethodsBuilder for ProjectMethods<'a> {}
|
||||
|
||||
impl<'a, C> ProjectMethods<'a, C> {
|
||||
impl<'a> ProjectMethods<'a> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
@@ -532,7 +530,7 @@ impl<'a, C> ProjectMethods<'a, C> {
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `parent` - Required. It contains the Firebase project id (i.e. the unique identifier for your Firebase project), in the format of `projects/{project_id}`. For legacy support, the numeric project number with no padding is also supported in the format of `projects/{project_number}`.
|
||||
pub fn messages_send(&self, request: SendMessageRequest, parent: &str) -> ProjectMessageSendCall<'a, C> {
|
||||
pub fn messages_send(&self, request: SendMessageRequest, parent: &str) -> ProjectMessageSendCall<'a> {
|
||||
ProjectMessageSendCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
@@ -590,10 +588,10 @@ impl<'a, C> ProjectMethods<'a, C> {
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ProjectMessageSendCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct ProjectMessageSendCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a FirebaseCloudMessaging<C>,
|
||||
hub: &'a FirebaseCloudMessaging<>,
|
||||
_request: SendMessageRequest,
|
||||
_parent: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
@@ -601,9 +599,9 @@ pub struct ProjectMessageSendCall<'a, C>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for ProjectMessageSendCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for ProjectMessageSendCall<'a> {}
|
||||
|
||||
impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> ProjectMessageSendCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -679,8 +677,7 @@ impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
|
||||
|
||||
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) {
|
||||
@@ -694,7 +691,7 @@ impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
};
|
||||
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()));
|
||||
@@ -705,7 +702,7 @@ impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
.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
|
||||
|
||||
};
|
||||
|
||||
@@ -764,7 +761,7 @@ impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
///
|
||||
/// 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: SendMessageRequest) -> ProjectMessageSendCall<'a, C> {
|
||||
pub fn request(mut self, new_value: SendMessageRequest) -> ProjectMessageSendCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
@@ -774,7 +771,7 @@ impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn parent(mut self, new_value: &str) -> ProjectMessageSendCall<'a, C> {
|
||||
pub fn parent(mut self, new_value: &str) -> ProjectMessageSendCall<'a> {
|
||||
self._parent = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -784,7 +781,7 @@ impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
/// 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) -> ProjectMessageSendCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectMessageSendCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -809,7 +806,7 @@ impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
/// * *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.
|
||||
/// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart").
|
||||
/// * *upload_protocol* (query-string) - Upload protocol for media (e.g. "raw", "multipart").
|
||||
pub fn param<T>(mut self, name: T, value: T) -> ProjectMessageSendCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> ProjectMessageSendCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -829,7 +826,7 @@ impl<'a, C> ProjectMessageSendCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
/// 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) -> ProjectMessageSendCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> ProjectMessageSendCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
|
||||
Reference in New Issue
Block a user