regenerate everything

This commit is contained in:
Sebastian Thiel
2021-04-14 10:10:59 +08:00
parent 65f9c22094
commit 34096d3862
2792 changed files with 149735 additions and 162953 deletions

View File

@@ -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;
@@ -109,35 +108,34 @@ impl Default for Scope {
/// }
/// # }
/// ```
pub struct CloudTrace<C> {
client: RefCell<C>,
auth: RefCell<oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>>,
pub struct CloudTrace<> {
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 CloudTrace<C> {}
impl<'a, > client::Hub for CloudTrace<> {}
impl<'a, C> CloudTrace<C>
where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
impl<'a, > CloudTrace<> {
pub fn new(client: C, authenticator: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>) -> CloudTrace<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>>) -> CloudTrace<> {
CloudTrace {
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://cloudtrace.googleapis.com/".to_string(),
_root_url: "https://cloudtrace.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 {
@@ -552,15 +550,15 @@ impl client::Part for TruncatableString {}
/// let rb = hub.projects();
/// # }
/// ```
pub struct ProjectMethods<'a, C>
where C: 'a {
pub struct ProjectMethods<'a>
where {
hub: &'a CloudTrace<C>,
hub: &'a CloudTrace<>,
}
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:
///
@@ -570,7 +568,7 @@ impl<'a, C> ProjectMethods<'a, C> {
///
/// * `request` - No description provided.
/// * `name` - Required. The resource name of the span in the following format: projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero.
pub fn traces_spans_create_span(&self, request: Span, name: &str) -> ProjectTraceSpanCreateSpanCall<'a, C> {
pub fn traces_spans_create_span(&self, request: Span, name: &str) -> ProjectTraceSpanCreateSpanCall<'a> {
ProjectTraceSpanCreateSpanCall {
hub: self.hub,
_request: request,
@@ -589,7 +587,7 @@ impl<'a, C> ProjectMethods<'a, C> {
///
/// * `request` - No description provided.
/// * `name` - Required. The name of the project where the spans belong. The format is `projects/[PROJECT_ID]`.
pub fn traces_batch_write(&self, request: BatchWriteSpansRequest, name: &str) -> ProjectTraceBatchWriteCall<'a, C> {
pub fn traces_batch_write(&self, request: BatchWriteSpansRequest, name: &str) -> ProjectTraceBatchWriteCall<'a> {
ProjectTraceBatchWriteCall {
hub: self.hub,
_request: request,
@@ -647,10 +645,10 @@ impl<'a, C> ProjectMethods<'a, C> {
/// .doit().await;
/// # }
/// ```
pub struct ProjectTraceSpanCreateSpanCall<'a, C>
where C: 'a {
pub struct ProjectTraceSpanCreateSpanCall<'a>
where {
hub: &'a CloudTrace<C>,
hub: &'a CloudTrace<>,
_request: Span,
_name: String,
_delegate: Option<&'a mut dyn client::Delegate>,
@@ -658,9 +656,9 @@ pub struct ProjectTraceSpanCreateSpanCall<'a, C>
_scopes: BTreeMap<String, ()>
}
impl<'a, C> client::CallBuilder for ProjectTraceSpanCreateSpanCall<'a, C> {}
impl<'a> client::CallBuilder for ProjectTraceSpanCreateSpanCall<'a> {}
impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
impl<'a> ProjectTraceSpanCreateSpanCall<'a> {
/// Perform the operation you have build so far.
@@ -736,8 +734,7 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
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) {
@@ -751,7 +748,7 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
};
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()));
@@ -762,7 +759,7 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
.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
};
@@ -821,7 +818,7 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
///
/// 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: Span) -> ProjectTraceSpanCreateSpanCall<'a, C> {
pub fn request(mut self, new_value: Span) -> ProjectTraceSpanCreateSpanCall<'a> {
self._request = new_value;
self
}
@@ -831,7 +828,7 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
///
/// 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) -> ProjectTraceSpanCreateSpanCall<'a, C> {
pub fn name(mut self, new_value: &str) -> ProjectTraceSpanCreateSpanCall<'a> {
self._name = new_value.to_string();
self
}
@@ -841,7 +838,7 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
/// 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) -> ProjectTraceSpanCreateSpanCall<'a, C> {
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectTraceSpanCreateSpanCall<'a> {
self._delegate = Some(new_value);
self
}
@@ -866,7 +863,7 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
/// * *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) -> ProjectTraceSpanCreateSpanCall<'a, C>
pub fn param<T>(mut self, name: T, value: T) -> ProjectTraceSpanCreateSpanCall<'a>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
@@ -886,7 +883,7 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
/// 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) -> ProjectTraceSpanCreateSpanCall<'a, C>
pub fn add_scope<T, S>(mut self, scope: T) -> ProjectTraceSpanCreateSpanCall<'a>
where T: Into<Option<S>>,
S: AsRef<str> {
match scope.into() {
@@ -936,10 +933,10 @@ impl<'a, C> ProjectTraceSpanCreateSpanCall<'a, C> where C: BorrowMut<hyper::Clie
/// .doit().await;
/// # }
/// ```
pub struct ProjectTraceBatchWriteCall<'a, C>
where C: 'a {
pub struct ProjectTraceBatchWriteCall<'a>
where {
hub: &'a CloudTrace<C>,
hub: &'a CloudTrace<>,
_request: BatchWriteSpansRequest,
_name: String,
_delegate: Option<&'a mut dyn client::Delegate>,
@@ -947,9 +944,9 @@ pub struct ProjectTraceBatchWriteCall<'a, C>
_scopes: BTreeMap<String, ()>
}
impl<'a, C> client::CallBuilder for ProjectTraceBatchWriteCall<'a, C> {}
impl<'a> client::CallBuilder for ProjectTraceBatchWriteCall<'a> {}
impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
impl<'a> ProjectTraceBatchWriteCall<'a> {
/// Perform the operation you have build so far.
@@ -1025,8 +1022,7 @@ impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<h
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) {
@@ -1040,7 +1036,7 @@ impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<h
};
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()));
@@ -1051,7 +1047,7 @@ impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<h
.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
};
@@ -1110,7 +1106,7 @@ impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<h
///
/// 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: BatchWriteSpansRequest) -> ProjectTraceBatchWriteCall<'a, C> {
pub fn request(mut self, new_value: BatchWriteSpansRequest) -> ProjectTraceBatchWriteCall<'a> {
self._request = new_value;
self
}
@@ -1120,7 +1116,7 @@ impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<h
///
/// 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) -> ProjectTraceBatchWriteCall<'a, C> {
pub fn name(mut self, new_value: &str) -> ProjectTraceBatchWriteCall<'a> {
self._name = new_value.to_string();
self
}
@@ -1130,7 +1126,7 @@ impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<h
/// 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) -> ProjectTraceBatchWriteCall<'a, C> {
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> ProjectTraceBatchWriteCall<'a> {
self._delegate = Some(new_value);
self
}
@@ -1155,7 +1151,7 @@ impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<h
/// * *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) -> ProjectTraceBatchWriteCall<'a, C>
pub fn param<T>(mut self, name: T, value: T) -> ProjectTraceBatchWriteCall<'a>
where T: AsRef<str> {
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
self
@@ -1175,7 +1171,7 @@ impl<'a, C> ProjectTraceBatchWriteCall<'a, C> where C: BorrowMut<hyper::Client<h
/// 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) -> ProjectTraceBatchWriteCall<'a, C>
pub fn add_scope<T, S>(mut self, scope: T) -> ProjectTraceBatchWriteCall<'a>
where T: Into<Option<S>>,
S: AsRef<str> {
match scope.into() {