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;
|
||||
@@ -102,38 +101,37 @@ impl Default for Scope {
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct CloudShell<C> {
|
||||
client: RefCell<C>,
|
||||
auth: RefCell<oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>>,
|
||||
pub struct CloudShell<> {
|
||||
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 CloudShell<C> {}
|
||||
impl<'a, > client::Hub for CloudShell<> {}
|
||||
|
||||
impl<'a, C> CloudShell<C>
|
||||
where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a, > CloudShell<> {
|
||||
|
||||
pub fn new(client: C, authenticator: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>) -> CloudShell<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>>) -> CloudShell<> {
|
||||
CloudShell {
|
||||
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://cloudshell.googleapis.com/".to_string(),
|
||||
_root_url: "https://cloudshell.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn operations(&'a self) -> OperationMethods<'a, C> {
|
||||
pub fn operations(&'a self) -> OperationMethods<'a> {
|
||||
OperationMethods { hub: &self }
|
||||
}
|
||||
pub fn users(&'a self) -> UserMethods<'a, C> {
|
||||
pub fn users(&'a self) -> UserMethods<'a> {
|
||||
UserMethods { 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 {
|
||||
@@ -422,15 +420,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 CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
}
|
||||
|
||||
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:
|
||||
///
|
||||
@@ -440,7 +438,7 @@ impl<'a, C> OperationMethods<'a, C> {
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - The name of the operation resource to be cancelled.
|
||||
pub fn cancel(&self, request: CancelOperationRequest, name: &str) -> OperationCancelCall<'a, C> {
|
||||
pub fn cancel(&self, request: CancelOperationRequest, name: &str) -> OperationCancelCall<'a> {
|
||||
OperationCancelCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
@@ -458,7 +456,7 @@ impl<'a, C> OperationMethods<'a, C> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The name of the operation resource to be deleted.
|
||||
pub fn delete(&self, name: &str) -> OperationDeleteCall<'a, C> {
|
||||
pub fn delete(&self, name: &str) -> OperationDeleteCall<'a> {
|
||||
OperationDeleteCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
@@ -475,7 +473,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(),
|
||||
@@ -492,7 +490,7 @@ impl<'a, C> OperationMethods<'a, C> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The name of the operation's parent resource.
|
||||
pub fn list(&self, name: &str) -> OperationListCall<'a, C> {
|
||||
pub fn list(&self, name: &str) -> OperationListCall<'a> {
|
||||
OperationListCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
@@ -538,15 +536,15 @@ impl<'a, C> OperationMethods<'a, C> {
|
||||
/// let rb = hub.users();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct UserMethods<'a, C>
|
||||
where C: 'a {
|
||||
pub struct UserMethods<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
}
|
||||
|
||||
impl<'a, C> client::MethodsBuilder for UserMethods<'a, C> {}
|
||||
impl<'a> client::MethodsBuilder for UserMethods<'a> {}
|
||||
|
||||
impl<'a, C> UserMethods<'a, C> {
|
||||
impl<'a> UserMethods<'a> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
@@ -556,7 +554,7 @@ impl<'a, C> UserMethods<'a, C> {
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `environment` - Environment this key should be added to, e.g. `users/me/environments/default`.
|
||||
pub fn environments_add_public_key(&self, request: AddPublicKeyRequest, environment: &str) -> UserEnvironmentAddPublicKeyCall<'a, C> {
|
||||
pub fn environments_add_public_key(&self, request: AddPublicKeyRequest, environment: &str) -> UserEnvironmentAddPublicKeyCall<'a> {
|
||||
UserEnvironmentAddPublicKeyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
@@ -575,7 +573,7 @@ impl<'a, C> UserMethods<'a, C> {
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Name of the resource that should receive the credentials, for example `users/me/environments/default` or `users/someone@example.com/environments/default`.
|
||||
pub fn environments_authorize(&self, request: AuthorizeEnvironmentRequest, name: &str) -> UserEnvironmentAuthorizeCall<'a, C> {
|
||||
pub fn environments_authorize(&self, request: AuthorizeEnvironmentRequest, name: &str) -> UserEnvironmentAuthorizeCall<'a> {
|
||||
UserEnvironmentAuthorizeCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
@@ -593,7 +591,7 @@ impl<'a, C> UserMethods<'a, C> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Name of the requested resource, for example `users/me/environments/default` or `users/someone@example.com/environments/default`.
|
||||
pub fn environments_get(&self, name: &str) -> UserEnvironmentGetCall<'a, C> {
|
||||
pub fn environments_get(&self, name: &str) -> UserEnvironmentGetCall<'a> {
|
||||
UserEnvironmentGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
@@ -611,7 +609,7 @@ impl<'a, C> UserMethods<'a, C> {
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `environment` - Environment this key should be removed from, e.g. `users/me/environments/default`.
|
||||
pub fn environments_remove_public_key(&self, request: RemovePublicKeyRequest, environment: &str) -> UserEnvironmentRemovePublicKeyCall<'a, C> {
|
||||
pub fn environments_remove_public_key(&self, request: RemovePublicKeyRequest, environment: &str) -> UserEnvironmentRemovePublicKeyCall<'a> {
|
||||
UserEnvironmentRemovePublicKeyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
@@ -630,7 +628,7 @@ impl<'a, C> UserMethods<'a, C> {
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Name of the resource that should be started, for example `users/me/environments/default` or `users/someone@example.com/environments/default`.
|
||||
pub fn environments_start(&self, request: StartEnvironmentRequest, name: &str) -> UserEnvironmentStartCall<'a, C> {
|
||||
pub fn environments_start(&self, request: StartEnvironmentRequest, name: &str) -> UserEnvironmentStartCall<'a> {
|
||||
UserEnvironmentStartCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
@@ -688,10 +686,10 @@ impl<'a, C> UserMethods<'a, C> {
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationCancelCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct OperationCancelCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_request: CancelOperationRequest,
|
||||
_name: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
@@ -699,9 +697,9 @@ pub struct OperationCancelCall<'a, C>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for OperationCancelCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for OperationCancelCall<'a> {}
|
||||
|
||||
impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> OperationCancelCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -777,8 +775,7 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
|
||||
|
||||
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) {
|
||||
@@ -792,7 +789,7 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
};
|
||||
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()));
|
||||
@@ -803,7 +800,7 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
.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
|
||||
|
||||
};
|
||||
|
||||
@@ -862,7 +859,7 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
///
|
||||
/// 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: CancelOperationRequest) -> OperationCancelCall<'a, C> {
|
||||
pub fn request(mut self, new_value: CancelOperationRequest) -> OperationCancelCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
@@ -872,7 +869,7 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
///
|
||||
/// 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) -> OperationCancelCall<'a, C> {
|
||||
pub fn name(mut self, new_value: &str) -> OperationCancelCall<'a> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -882,7 +879,7 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
/// 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) -> OperationCancelCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> OperationCancelCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -907,7 +904,7 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
/// * *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) -> OperationCancelCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> OperationCancelCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -927,7 +924,7 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
/// 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) -> OperationCancelCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> OperationCancelCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -971,19 +968,19 @@ impl<'a, C> OperationCancelCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationDeleteCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct OperationDeleteCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_name: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for OperationDeleteCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for OperationDeleteCall<'a> {}
|
||||
|
||||
impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> OperationDeleteCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -1048,8 +1045,7 @@ impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
|
||||
|
||||
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) {
|
||||
@@ -1062,7 +1058,7 @@ impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
}
|
||||
};
|
||||
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::DELETE).uri(url.clone().into_string())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone()) .header(AUTHORIZATION, format!("Bearer {}", token.as_str()));
|
||||
@@ -1071,7 +1067,7 @@ impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
let request = req_builder
|
||||
.body(hyper::body::Body::empty());
|
||||
|
||||
client.borrow_mut().request(request.unwrap()).await
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
};
|
||||
|
||||
@@ -1131,7 +1127,7 @@ impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
///
|
||||
/// 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) -> OperationDeleteCall<'a, C> {
|
||||
pub fn name(mut self, new_value: &str) -> OperationDeleteCall<'a> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -1141,7 +1137,7 @@ impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
/// 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) -> OperationDeleteCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> OperationDeleteCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -1166,7 +1162,7 @@ impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
/// * *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) -> OperationDeleteCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> OperationDeleteCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -1186,7 +1182,7 @@ impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
/// 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) -> OperationDeleteCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> OperationDeleteCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -1230,19 +1226,19 @@ impl<'a, C> OperationDeleteCall<'a, C> where C: BorrowMut<hyper::Client<hyper_ru
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationGetCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct OperationGetCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_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.
|
||||
@@ -1307,8 +1303,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) {
|
||||
@@ -1321,7 +1316,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()));
|
||||
@@ -1330,7 +1325,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
|
||||
|
||||
};
|
||||
|
||||
@@ -1390,7 +1385,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
|
||||
}
|
||||
@@ -1400,7 +1395,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
|
||||
}
|
||||
@@ -1425,7 +1420,7 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
/// * *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) -> 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
|
||||
@@ -1445,7 +1440,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() {
|
||||
@@ -1492,10 +1487,10 @@ impl<'a, C> OperationGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustl
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationListCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct OperationListCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_name: String,
|
||||
_page_token: Option<String>,
|
||||
_page_size: Option<i32>,
|
||||
@@ -1505,9 +1500,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.
|
||||
@@ -1581,8 +1576,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) {
|
||||
@@ -1595,7 +1589,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()));
|
||||
@@ -1604,7 +1598,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
|
||||
|
||||
};
|
||||
|
||||
@@ -1664,28 +1658,28 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
///
|
||||
/// 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) -> OperationListCall<'a, C> {
|
||||
pub fn name(mut self, new_value: &str) -> OperationListCall<'a> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
/// 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 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
|
||||
}
|
||||
@@ -1695,7 +1689,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
|
||||
}
|
||||
@@ -1720,7 +1714,7 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
/// * *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) -> 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
|
||||
@@ -1740,7 +1734,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() {
|
||||
@@ -1790,10 +1784,10 @@ impl<'a, C> OperationListCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rust
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct UserEnvironmentAddPublicKeyCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct UserEnvironmentAddPublicKeyCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_request: AddPublicKeyRequest,
|
||||
_environment: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
@@ -1801,9 +1795,9 @@ pub struct UserEnvironmentAddPublicKeyCall<'a, C>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for UserEnvironmentAddPublicKeyCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for UserEnvironmentAddPublicKeyCall<'a> {}
|
||||
|
||||
impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> UserEnvironmentAddPublicKeyCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -1879,8 +1873,7 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
|
||||
|
||||
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) {
|
||||
@@ -1894,7 +1887,7 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
};
|
||||
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()));
|
||||
@@ -1905,7 +1898,7 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
.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
|
||||
|
||||
};
|
||||
|
||||
@@ -1964,7 +1957,7 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
///
|
||||
/// 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: AddPublicKeyRequest) -> UserEnvironmentAddPublicKeyCall<'a, C> {
|
||||
pub fn request(mut self, new_value: AddPublicKeyRequest) -> UserEnvironmentAddPublicKeyCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
@@ -1974,7 +1967,7 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn environment(mut self, new_value: &str) -> UserEnvironmentAddPublicKeyCall<'a, C> {
|
||||
pub fn environment(mut self, new_value: &str) -> UserEnvironmentAddPublicKeyCall<'a> {
|
||||
self._environment = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -1984,7 +1977,7 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
/// 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) -> UserEnvironmentAddPublicKeyCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> UserEnvironmentAddPublicKeyCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -2009,7 +2002,7 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
/// * *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) -> UserEnvironmentAddPublicKeyCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> UserEnvironmentAddPublicKeyCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -2029,7 +2022,7 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
/// 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) -> UserEnvironmentAddPublicKeyCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> UserEnvironmentAddPublicKeyCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -2079,10 +2072,10 @@ impl<'a, C> UserEnvironmentAddPublicKeyCall<'a, C> where C: BorrowMut<hyper::Cli
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct UserEnvironmentAuthorizeCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct UserEnvironmentAuthorizeCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_request: AuthorizeEnvironmentRequest,
|
||||
_name: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
@@ -2090,9 +2083,9 @@ pub struct UserEnvironmentAuthorizeCall<'a, C>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for UserEnvironmentAuthorizeCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for UserEnvironmentAuthorizeCall<'a> {}
|
||||
|
||||
impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> UserEnvironmentAuthorizeCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -2168,8 +2161,7 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
|
||||
|
||||
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) {
|
||||
@@ -2183,7 +2175,7 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
};
|
||||
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()));
|
||||
@@ -2194,7 +2186,7 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
.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
|
||||
|
||||
};
|
||||
|
||||
@@ -2253,7 +2245,7 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
///
|
||||
/// 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: AuthorizeEnvironmentRequest) -> UserEnvironmentAuthorizeCall<'a, C> {
|
||||
pub fn request(mut self, new_value: AuthorizeEnvironmentRequest) -> UserEnvironmentAuthorizeCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
@@ -2263,7 +2255,7 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
///
|
||||
/// 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) -> UserEnvironmentAuthorizeCall<'a, C> {
|
||||
pub fn name(mut self, new_value: &str) -> UserEnvironmentAuthorizeCall<'a> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -2273,7 +2265,7 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
/// 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) -> UserEnvironmentAuthorizeCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> UserEnvironmentAuthorizeCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -2298,7 +2290,7 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
/// * *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) -> UserEnvironmentAuthorizeCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> UserEnvironmentAuthorizeCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -2318,7 +2310,7 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
/// 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) -> UserEnvironmentAuthorizeCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> UserEnvironmentAuthorizeCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -2362,19 +2354,19 @@ impl<'a, C> UserEnvironmentAuthorizeCall<'a, C> where C: BorrowMut<hyper::Client
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct UserEnvironmentGetCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct UserEnvironmentGetCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_name: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for UserEnvironmentGetCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for UserEnvironmentGetCall<'a> {}
|
||||
|
||||
impl<'a, C> UserEnvironmentGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> UserEnvironmentGetCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -2439,8 +2431,7 @@ impl<'a, C> UserEnvironmentGetCall<'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) {
|
||||
@@ -2453,7 +2444,7 @@ impl<'a, C> UserEnvironmentGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
}
|
||||
};
|
||||
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()));
|
||||
@@ -2462,7 +2453,7 @@ impl<'a, C> UserEnvironmentGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
let request = req_builder
|
||||
.body(hyper::body::Body::empty());
|
||||
|
||||
client.borrow_mut().request(request.unwrap()).await
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
};
|
||||
|
||||
@@ -2522,7 +2513,7 @@ impl<'a, C> UserEnvironmentGetCall<'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 name(mut self, new_value: &str) -> UserEnvironmentGetCall<'a, C> {
|
||||
pub fn name(mut self, new_value: &str) -> UserEnvironmentGetCall<'a> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -2532,7 +2523,7 @@ impl<'a, C> UserEnvironmentGetCall<'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) -> UserEnvironmentGetCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> UserEnvironmentGetCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -2557,7 +2548,7 @@ impl<'a, C> UserEnvironmentGetCall<'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) -> UserEnvironmentGetCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> UserEnvironmentGetCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -2577,7 +2568,7 @@ impl<'a, C> UserEnvironmentGetCall<'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) -> UserEnvironmentGetCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> UserEnvironmentGetCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -2627,10 +2618,10 @@ impl<'a, C> UserEnvironmentGetCall<'a, C> where C: BorrowMut<hyper::Client<hyper
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct UserEnvironmentRemovePublicKeyCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct UserEnvironmentRemovePublicKeyCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_request: RemovePublicKeyRequest,
|
||||
_environment: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
@@ -2638,9 +2629,9 @@ pub struct UserEnvironmentRemovePublicKeyCall<'a, C>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for UserEnvironmentRemovePublicKeyCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for UserEnvironmentRemovePublicKeyCall<'a> {}
|
||||
|
||||
impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> UserEnvironmentRemovePublicKeyCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -2716,8 +2707,7 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<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) {
|
||||
@@ -2731,7 +2721,7 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<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()));
|
||||
@@ -2742,7 +2732,7 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<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
|
||||
|
||||
};
|
||||
|
||||
@@ -2801,7 +2791,7 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<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: RemovePublicKeyRequest) -> UserEnvironmentRemovePublicKeyCall<'a, C> {
|
||||
pub fn request(mut self, new_value: RemovePublicKeyRequest) -> UserEnvironmentRemovePublicKeyCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
@@ -2811,7 +2801,7 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<hyper::
|
||||
///
|
||||
/// Even though the property as already been set when instantiating this call,
|
||||
/// we provide this method for API completeness.
|
||||
pub fn environment(mut self, new_value: &str) -> UserEnvironmentRemovePublicKeyCall<'a, C> {
|
||||
pub fn environment(mut self, new_value: &str) -> UserEnvironmentRemovePublicKeyCall<'a> {
|
||||
self._environment = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -2821,7 +2811,7 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<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) -> UserEnvironmentRemovePublicKeyCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> UserEnvironmentRemovePublicKeyCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -2846,7 +2836,7 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<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) -> UserEnvironmentRemovePublicKeyCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> UserEnvironmentRemovePublicKeyCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -2866,7 +2856,7 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<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) -> UserEnvironmentRemovePublicKeyCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> UserEnvironmentRemovePublicKeyCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
@@ -2916,10 +2906,10 @@ impl<'a, C> UserEnvironmentRemovePublicKeyCall<'a, C> where C: BorrowMut<hyper::
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct UserEnvironmentStartCall<'a, C>
|
||||
where C: 'a {
|
||||
pub struct UserEnvironmentStartCall<'a>
|
||||
where {
|
||||
|
||||
hub: &'a CloudShell<C>,
|
||||
hub: &'a CloudShell<>,
|
||||
_request: StartEnvironmentRequest,
|
||||
_name: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
@@ -2927,9 +2917,9 @@ pub struct UserEnvironmentStartCall<'a, C>
|
||||
_scopes: BTreeMap<String, ()>
|
||||
}
|
||||
|
||||
impl<'a, C> client::CallBuilder for UserEnvironmentStartCall<'a, C> {}
|
||||
impl<'a> client::CallBuilder for UserEnvironmentStartCall<'a> {}
|
||||
|
||||
impl<'a, C> UserEnvironmentStartCall<'a, C> where C: BorrowMut<hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>> {
|
||||
impl<'a> UserEnvironmentStartCall<'a> {
|
||||
|
||||
|
||||
/// Perform the operation you have build so far.
|
||||
@@ -3005,8 +2995,7 @@ impl<'a, C> UserEnvironmentStartCall<'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) {
|
||||
@@ -3020,7 +3009,7 @@ impl<'a, C> UserEnvironmentStartCall<'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()));
|
||||
@@ -3031,7 +3020,7 @@ impl<'a, C> UserEnvironmentStartCall<'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
|
||||
|
||||
};
|
||||
|
||||
@@ -3090,7 +3079,7 @@ impl<'a, C> UserEnvironmentStartCall<'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: StartEnvironmentRequest) -> UserEnvironmentStartCall<'a, C> {
|
||||
pub fn request(mut self, new_value: StartEnvironmentRequest) -> UserEnvironmentStartCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
@@ -3100,7 +3089,7 @@ impl<'a, C> UserEnvironmentStartCall<'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 name(mut self, new_value: &str) -> UserEnvironmentStartCall<'a, C> {
|
||||
pub fn name(mut self, new_value: &str) -> UserEnvironmentStartCall<'a> {
|
||||
self._name = new_value.to_string();
|
||||
self
|
||||
}
|
||||
@@ -3110,7 +3099,7 @@ impl<'a, C> UserEnvironmentStartCall<'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) -> UserEnvironmentStartCall<'a, C> {
|
||||
pub fn delegate(mut self, new_value: &'a mut dyn client::Delegate) -> UserEnvironmentStartCall<'a> {
|
||||
self._delegate = Some(new_value);
|
||||
self
|
||||
}
|
||||
@@ -3135,7 +3124,7 @@ impl<'a, C> UserEnvironmentStartCall<'a, C> where C: BorrowMut<hyper::Client<hyp
|
||||
/// * *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) -> UserEnvironmentStartCall<'a, C>
|
||||
pub fn param<T>(mut self, name: T, value: T) -> UserEnvironmentStartCall<'a>
|
||||
where T: AsRef<str> {
|
||||
self._additional_params.insert(name.as_ref().to_string(), value.as_ref().to_string());
|
||||
self
|
||||
@@ -3155,7 +3144,7 @@ impl<'a, C> UserEnvironmentStartCall<'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) -> UserEnvironmentStartCall<'a, C>
|
||||
pub fn add_scope<T, S>(mut self, scope: T) -> UserEnvironmentStartCall<'a>
|
||||
where T: Into<Option<S>>,
|
||||
S: AsRef<str> {
|
||||
match scope.into() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// COPY OF 'src/rust/api/client.rs'
|
||||
// DO NOT EDIT
|
||||
use std;
|
||||
use std::error;
|
||||
use std::fmt::{self, Display};
|
||||
use std::io::{self, Cursor, Read, Seek, SeekFrom, Write};
|
||||
@@ -10,18 +9,16 @@ use std::time::Duration;
|
||||
|
||||
use itertools::Itertools;
|
||||
|
||||
use hyper;
|
||||
use hyper::body::Buf;
|
||||
use hyper::header::{HeaderMap, AUTHORIZATION, CONTENT_LENGTH, CONTENT_TYPE, USER_AGENT};
|
||||
use hyper::Method;
|
||||
use hyper::StatusCode;
|
||||
use hyper::body::Buf;
|
||||
|
||||
use mime::{Attr, Mime, SubLevel, TopLevel, Value};
|
||||
use oauth2;
|
||||
|
||||
use serde_json as json;
|
||||
|
||||
const LINE_ENDING: &'static str = "\r\n";
|
||||
const LINE_ENDING: &str = "\r\n";
|
||||
|
||||
pub enum Retry {
|
||||
/// Signal you don't want to retry
|
||||
@@ -307,9 +304,9 @@ impl Display for Error {
|
||||
err.domain,
|
||||
err.message,
|
||||
err.reason,
|
||||
match &err.location {
|
||||
&Some(ref loc) => format!("@{}", loc),
|
||||
&None => String::new(),
|
||||
match err.location {
|
||||
Some(ref loc) => format!("@{}", loc),
|
||||
None => String::new(),
|
||||
}
|
||||
)?;
|
||||
}
|
||||
@@ -357,7 +354,7 @@ pub struct MethodInfo {
|
||||
pub http_method: Method,
|
||||
}
|
||||
|
||||
const BOUNDARY: &'static str = "MDuXWGyeE33QFXGchb2VFWc4Z7945d";
|
||||
const BOUNDARY: &str = "MDuXWGyeE33QFXGchb2VFWc4Z7945d";
|
||||
|
||||
/// Provides a `Read` interface that converts multiple parts into the protocol
|
||||
/// identified by [RFC2387](https://tools.ietf.org/html/rfc2387).
|
||||
@@ -418,14 +415,14 @@ impl<'a> MultiPartReader<'a> {
|
||||
|
||||
/// Returns true if we are totally used
|
||||
fn is_depleted(&self) -> bool {
|
||||
self.raw_parts.len() == 0
|
||||
self.raw_parts.is_empty()
|
||||
&& self.current_part.is_none()
|
||||
&& self.last_part_boundary.is_none()
|
||||
}
|
||||
|
||||
/// Returns true if we are handling our last part
|
||||
fn is_last_part(&self) -> bool {
|
||||
self.raw_parts.len() == 0 && self.current_part.is_some()
|
||||
self.raw_parts.is_empty() && self.current_part.is_some()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -520,12 +517,12 @@ pub struct XUploadContentType(pub Mime);
|
||||
|
||||
impl ::std::ops::Deref for XUploadContentType {
|
||||
type Target = Mime;
|
||||
fn deref<'a>(&'a self) -> &'a Mime {
|
||||
fn deref(&self) -> &Mime {
|
||||
&self.0
|
||||
}
|
||||
}
|
||||
impl ::std::ops::DerefMut for XUploadContentType {
|
||||
fn deref_mut<'a>(&'a mut self) -> &'a mut Mime {
|
||||
fn deref_mut(&mut self) -> &mut Mime {
|
||||
&mut self.0
|
||||
}
|
||||
}
|
||||
@@ -595,11 +592,11 @@ pub struct RangeResponseHeader(pub Chunk);
|
||||
|
||||
impl RangeResponseHeader {
|
||||
fn from_bytes(raw: &[u8]) -> Self {
|
||||
if raw.len() > 0 {
|
||||
if !raw.is_empty() {
|
||||
if let Ok(s) = std::str::from_utf8(raw) {
|
||||
const PREFIX: &'static str = "bytes ";
|
||||
if s.starts_with(PREFIX) {
|
||||
if let Ok(c) = <Chunk as FromStr>::from_str(&s[PREFIX.len()..]) {
|
||||
const PREFIX: &str = "bytes ";
|
||||
if let Some(stripped) = s.strip_prefix(PREFIX) {
|
||||
if let Ok(c) = <Chunk as FromStr>::from_str(&stripped) {
|
||||
return RangeResponseHeader(c);
|
||||
}
|
||||
}
|
||||
@@ -612,13 +609,13 @@ impl RangeResponseHeader {
|
||||
|
||||
/// A utility type to perform a resumable upload from start to end.
|
||||
pub struct ResumableUploadHelper<'a, A: 'a> {
|
||||
pub client: &'a mut hyper::client::Client<
|
||||
pub client: &'a hyper::client::Client<
|
||||
hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>,
|
||||
hyper::body::Body,
|
||||
>,
|
||||
pub delegate: &'a mut dyn Delegate,
|
||||
pub start_at: Option<u64>,
|
||||
pub auth: &'a mut A,
|
||||
pub auth: &'a A,
|
||||
pub user_agent: &'a str,
|
||||
pub auth_header: String,
|
||||
pub url: &'a str,
|
||||
@@ -810,7 +807,7 @@ pub fn remove_json_null_values(value: &mut json::value::Value) {
|
||||
|
||||
// Borrowing the body object as mutable and converts it to a string
|
||||
pub async fn get_body_as_string(res_body: &mut hyper::Body) -> String {
|
||||
let res_body_buf = hyper::body::aggregate(res_body).await.unwrap();
|
||||
let res_body_string = String::from_utf8_lossy(res_body_buf.chunk());
|
||||
let res_body_buf = hyper::body::to_bytes(res_body).await.unwrap();
|
||||
let res_body_string = String::from_utf8_lossy(&res_body_buf);
|
||||
res_body_string.to_string()
|
||||
}
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *Cloud Shell* crate version *2.0.0+20210326*, where *20210326* is the exact revision of the *cloudshell:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v2.0.0*.
|
||||
//! This documentation was generated from *Cloud Shell* crate version *2.0.3+20210326*, where *20210326* is the exact revision of the *cloudshell:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v2.0.3*.
|
||||
//!
|
||||
//! Everything else about the *Cloud Shell* *v1* API can be found at the
|
||||
//! [official documentation site](https://cloud.google.com/shell/docs/).
|
||||
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/master/gen/cloudshell1).
|
||||
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/cloudshell1).
|
||||
//! # Features
|
||||
//!
|
||||
//! Handle the following *Resources* with ease from the central [hub](CloudShell) ...
|
||||
|
||||
Reference in New Issue
Block a user