mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-13 21:19:05 +01:00
regen all APIs
This commit is contained in:
@@ -1,19 +1,20 @@
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeMap;
|
||||
use std::collections::BTreeSet;
|
||||
use std::error::Error as StdError;
|
||||
use serde_json as json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
use std::mem;
|
||||
use std::thread::sleep;
|
||||
|
||||
use http::Uri;
|
||||
use hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::time::sleep;
|
||||
use tower_service;
|
||||
use crate::client;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::{client, client::GetToken, client::serde_with};
|
||||
|
||||
// ##############
|
||||
// UTILITIES ###
|
||||
@@ -69,7 +70,7 @@ impl Default for Scope {
|
||||
/// use cloudtrace1::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
/// use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
@@ -112,7 +113,7 @@ impl Default for Scope {
|
||||
#[derive(Clone)]
|
||||
pub struct CloudTrace<S> {
|
||||
pub client: hyper::Client<S, hyper::body::Body>,
|
||||
pub auth: oauth2::authenticator::Authenticator<S>,
|
||||
pub auth: Box<dyn client::GetToken>,
|
||||
_user_agent: String,
|
||||
_base_url: String,
|
||||
_root_url: String,
|
||||
@@ -122,11 +123,11 @@ impl<'a, S> client::Hub for CloudTrace<S> {}
|
||||
|
||||
impl<'a, S> CloudTrace<S> {
|
||||
|
||||
pub fn new(client: hyper::Client<S, hyper::body::Body>, authenticator: oauth2::authenticator::Authenticator<S>) -> CloudTrace<S> {
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> CloudTrace<S> {
|
||||
CloudTrace {
|
||||
client,
|
||||
auth: authenticator,
|
||||
_user_agent: "google-api-rust-client/4.0.1".to_string(),
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.2-beta-1".to_string(),
|
||||
_base_url: "https://cloudtrace.googleapis.com/".to_string(),
|
||||
_root_url: "https://cloudtrace.googleapis.com/".to_string(),
|
||||
}
|
||||
@@ -137,7 +138,7 @@ impl<'a, S> CloudTrace<S> {
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/4.0.1`.
|
||||
/// It defaults to `google-api-rust-client/5.0.2-beta-1`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -165,7 +166,7 @@ impl<'a, S> CloudTrace<S> {
|
||||
// ############
|
||||
// SCHEMAS ###
|
||||
// ##########
|
||||
/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`.
|
||||
/// A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
@@ -174,6 +175,7 @@ impl<'a, S> CloudTrace<S> {
|
||||
///
|
||||
/// * [patch traces projects](ProjectPatchTraceCall) (response)
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Empty { _never_set: Option<bool> }
|
||||
|
||||
@@ -189,12 +191,15 @@ impl client::ResponseResult for Empty {}
|
||||
///
|
||||
/// * [traces list projects](ProjectTraceListCall) (response)
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListTracesResponse {
|
||||
/// If defined, indicates that there are more traces that match the request and that this value should be passed to the next request to continue retrieving additional traces.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
/// List of trace records as specified by the view parameter.
|
||||
|
||||
pub traces: Option<Vec<Trace>>,
|
||||
}
|
||||
|
||||
@@ -210,15 +215,19 @@ impl client::ResponseResult for ListTracesResponse {}
|
||||
///
|
||||
/// * [traces get projects](ProjectTraceGetCall) (response)
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Trace {
|
||||
/// Project ID of the Cloud project where the trace data is stored.
|
||||
#[serde(rename="projectId")]
|
||||
|
||||
pub project_id: Option<String>,
|
||||
/// Collection of spans in the trace.
|
||||
|
||||
pub spans: Option<Vec<TraceSpan>>,
|
||||
/// Globally unique identifier for the trace. This identifier is a 128-bit numeric value formatted as a 32-byte hex string. For example, `382d4f4c6b7bb2f4a972559d9085001d`. The numeric value should not be zero.
|
||||
#[serde(rename="traceId")]
|
||||
|
||||
pub trace_id: Option<String>,
|
||||
}
|
||||
|
||||
@@ -229,26 +238,36 @@ impl client::ResponseResult for Trace {}
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct TraceSpan {
|
||||
/// End time of the span in nanoseconds from the UNIX epoch.
|
||||
#[serde(rename="endTime")]
|
||||
pub end_time: Option<String>,
|
||||
|
||||
pub end_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `RPC_CLIENT` and `RPC_SERVER` to identify queueing latency associated with the span.
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Collection of labels associated with the span. Label keys must be less than 128 bytes. Label values must be less than 16 kilobytes (10MB for `/stacktrace` values). Some predefined label keys exist, or you may create your own. When creating your own, we recommend the following formats: * `/category/product/key` for agents of well-known products (e.g. `/db/mongodb/read_size`). * `short_host/path/key` for domain-specific keys (e.g. `foo.com/myproduct/bar`) Predefined labels include: * `/agent` * `/component` * `/error/message` * `/error/name` * `/http/client_city` * `/http/client_country` * `/http/client_protocol` * `/http/client_region` * `/http/host` * `/http/method` * `/http/path` * `/http/redirected_url` * `/http/request/size` * `/http/response/size` * `/http/route` * `/http/status_code` * `/http/url` * `/http/user_agent` * `/pid` * `/stacktrace` * `/tid`
|
||||
|
||||
pub labels: Option<HashMap<String, String>>,
|
||||
/// Name of the span. Must be less than 128 bytes. The span name is sanitized and displayed in the Trace tool in the Google Cloud Platform Console. The name may be a method name or some other per-call site name. For the same executable and the same call point, a best practice is to use a consistent name, which makes it easier to correlate cross-trace spans.
|
||||
|
||||
pub name: Option<String>,
|
||||
/// Optional. ID of the parent span, if any.
|
||||
#[serde(rename="parentSpanId")]
|
||||
pub parent_span_id: Option<String>,
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub parent_span_id: Option<u64>,
|
||||
/// Identifier for the span. Must be a 64-bit integer other than 0 and unique within a trace. For example, `2205310701640571284`.
|
||||
#[serde(rename="spanId")]
|
||||
pub span_id: Option<String>,
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub span_id: Option<u64>,
|
||||
/// Start time of the span in nanoseconds from the UNIX epoch.
|
||||
#[serde(rename="startTime")]
|
||||
pub start_time: Option<String>,
|
||||
|
||||
pub start_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
}
|
||||
|
||||
impl client::Part for TraceSpan {}
|
||||
@@ -263,9 +282,11 @@ impl client::Part for TraceSpan {}
|
||||
///
|
||||
/// * [patch traces projects](ProjectPatchTraceCall) (request)
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Traces {
|
||||
/// List of traces.
|
||||
|
||||
pub traces: Option<Vec<Trace>>,
|
||||
}
|
||||
|
||||
@@ -278,7 +299,7 @@ impl client::RequestValue for Traces {}
|
||||
// #################
|
||||
|
||||
/// A builder providing access to all methods supported on *project* resources.
|
||||
/// It is not used directly, but through the `CloudTrace` hub.
|
||||
/// It is not used directly, but through the [`CloudTrace`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
@@ -291,7 +312,7 @@ impl client::RequestValue for Traces {}
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
/// use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
@@ -389,7 +410,7 @@ impl<'a, S> ProjectMethods<'a, S> {
|
||||
/// Gets a single trace by its ID.
|
||||
///
|
||||
/// A builder for the *traces.get* method supported by a *project* resource.
|
||||
/// It is not used directly, but through a `ProjectMethods` instance.
|
||||
/// It is not used directly, but through a [`ProjectMethods`] instance.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
@@ -401,7 +422,7 @@ impl<'a, S> ProjectMethods<'a, S> {
|
||||
/// # extern crate google_cloudtrace1 as cloudtrace1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
/// # use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
@@ -424,14 +445,14 @@ pub struct ProjectTraceGetCall<'a, S>
|
||||
_trace_id: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
_scopes: BTreeSet<String>
|
||||
}
|
||||
|
||||
impl<'a, S> client::CallBuilder for ProjectTraceGetCall<'a, S> {}
|
||||
|
||||
impl<'a, S> ProjectTraceGetCall<'a, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
@@ -442,69 +463,54 @@ where
|
||||
pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Trace)> {
|
||||
use std::io::{Read, Seek};
|
||||
use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
|
||||
use client::ToParts;
|
||||
use client::{ToParts, url::Params};
|
||||
use std::borrow::Cow;
|
||||
|
||||
let mut dd = client::DefaultDelegate;
|
||||
let mut dlg: &mut dyn client::Delegate = match self._delegate {
|
||||
Some(d) => d,
|
||||
None => &mut dd
|
||||
};
|
||||
let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
|
||||
dlg.begin(client::MethodInfo { id: "cloudtrace.projects.traces.get",
|
||||
http_method: hyper::Method::GET });
|
||||
let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len());
|
||||
params.push(("projectId", self._project_id.to_string()));
|
||||
params.push(("traceId", self._trace_id.to_string()));
|
||||
|
||||
for &field in ["alt", "projectId", "traceId"].iter() {
|
||||
if self._additional_params.contains_key(field) {
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::FieldClash(field));
|
||||
}
|
||||
}
|
||||
for (name, value) in self._additional_params.iter() {
|
||||
params.push((&name, value.clone()));
|
||||
}
|
||||
|
||||
params.push(("alt", "json".to_string()));
|
||||
let mut params = Params::with_capacity(4 + self._additional_params.len());
|
||||
params.push("projectId", self._project_id);
|
||||
params.push("traceId", self._trace_id);
|
||||
|
||||
params.extend(self._additional_params.iter());
|
||||
|
||||
params.push("alt", "json");
|
||||
let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/traces/{traceId}";
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::TraceReadonly.as_ref().to_string(), ());
|
||||
if self._scopes.is_empty() {
|
||||
self._scopes.insert(Scope::TraceReadonly.as_ref().to_string());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{projectId}", "projectId"), ("{traceId}", "traceId")].iter() {
|
||||
let mut replace_with: Option<&str> = None;
|
||||
for &(name, ref value) in params.iter() {
|
||||
if name == param_name {
|
||||
replace_with = Some(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
url = url.replace(find_this, replace_with.expect("to find substitution value in params"));
|
||||
url = params.uri_replacement(url, param_name, find_this, false);
|
||||
}
|
||||
{
|
||||
let mut indices_for_removal: Vec<usize> = Vec::with_capacity(2);
|
||||
for param_name in ["traceId", "projectId"].iter() {
|
||||
if let Some(index) = params.iter().position(|t| &t.0 == param_name) {
|
||||
indices_for_removal.push(index);
|
||||
}
|
||||
}
|
||||
for &index in indices_for_removal.iter() {
|
||||
params.remove(index);
|
||||
}
|
||||
let to_remove = ["traceId", "projectId"];
|
||||
params.remove_params(&to_remove);
|
||||
}
|
||||
|
||||
let url = url::Url::parse_with_params(&url, params).unwrap();
|
||||
let url = params.parse_with_url(&url);
|
||||
|
||||
|
||||
|
||||
loop {
|
||||
let token = match self.hub.auth.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token.clone(),
|
||||
Err(err) => {
|
||||
match dlg.token(&err) {
|
||||
Some(token) => token,
|
||||
None => {
|
||||
let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token,
|
||||
Err(e) => {
|
||||
match dlg.token(e) {
|
||||
Ok(token) => token,
|
||||
Err(e) => {
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::MissingToken(err))
|
||||
return Err(client::Error::MissingToken(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -512,21 +518,27 @@ where
|
||||
let mut req_result = {
|
||||
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()));
|
||||
let mut req_builder = hyper::Request::builder()
|
||||
.method(hyper::Method::GET)
|
||||
.uri(url.as_str())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone());
|
||||
|
||||
if let Some(token) = token.as_ref() {
|
||||
req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
|
||||
}
|
||||
|
||||
|
||||
let request = req_builder
|
||||
.body(hyper::body::Body::empty());
|
||||
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
|
||||
};
|
||||
|
||||
match req_result {
|
||||
Err(err) => {
|
||||
if let client::Retry::After(d) = dlg.http_error(&err) {
|
||||
sleep(d);
|
||||
sleep(d).await;
|
||||
continue;
|
||||
}
|
||||
dlg.finished(false);
|
||||
@@ -542,7 +554,7 @@ where
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
sleep(d).await;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -596,7 +608,8 @@ where
|
||||
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
|
||||
/// while executing the actual API request.
|
||||
///
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
/// ````text
|
||||
/// 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) -> ProjectTraceGetCall<'a, S> {
|
||||
@@ -632,25 +645,36 @@ where
|
||||
|
||||
/// Identifies the authorization scope for the method you are building.
|
||||
///
|
||||
/// Use this method to actively specify which scope should be used, instead the default `Scope` variant
|
||||
/// `Scope::TraceReadonly`.
|
||||
/// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
|
||||
/// [`Scope::TraceReadonly`].
|
||||
///
|
||||
/// The `scope` will be added to a set of scopes. This is important as one can maintain access
|
||||
/// tokens for more than one scope.
|
||||
/// If `None` is specified, then all scopes will be removed and no default scope will be used either.
|
||||
/// In that case, you have to specify your API-key using the `key` parameter (see the `param()`
|
||||
/// function for details).
|
||||
///
|
||||
/// 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, St>(mut self, scope: T) -> ProjectTraceGetCall<'a, S>
|
||||
where T: Into<Option<St>>,
|
||||
St: AsRef<str> {
|
||||
match scope.into() {
|
||||
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
|
||||
None => None,
|
||||
};
|
||||
pub fn add_scope<St>(mut self, scope: St) -> ProjectTraceGetCall<'a, S>
|
||||
where St: AsRef<str> {
|
||||
self._scopes.insert(String::from(scope.as_ref()));
|
||||
self
|
||||
}
|
||||
/// Identifies the authorization scope(s) for the method you are building.
|
||||
///
|
||||
/// See [`Self::add_scope()`] for details.
|
||||
pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectTraceGetCall<'a, S>
|
||||
where I: IntoIterator<Item = St>,
|
||||
St: AsRef<str> {
|
||||
self._scopes
|
||||
.extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
|
||||
self
|
||||
}
|
||||
|
||||
/// Removes all scopes, and no default scope will be used either.
|
||||
/// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
|
||||
/// for details).
|
||||
pub fn clear_scopes(mut self) -> ProjectTraceGetCall<'a, S> {
|
||||
self._scopes.clear();
|
||||
self
|
||||
}
|
||||
}
|
||||
@@ -659,7 +683,7 @@ where
|
||||
/// Returns a list of traces that match the specified filter conditions.
|
||||
///
|
||||
/// A builder for the *traces.list* method supported by a *project* resource.
|
||||
/// It is not used directly, but through a `ProjectMethods` instance.
|
||||
/// It is not used directly, but through a [`ProjectMethods`] instance.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
@@ -671,7 +695,7 @@ where
|
||||
/// # extern crate google_cloudtrace1 as cloudtrace1;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
/// # use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
@@ -684,12 +708,12 @@ where
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.projects().traces_list("projectId")
|
||||
/// .view("takimata")
|
||||
/// .start_time("amet.")
|
||||
/// .page_token("duo")
|
||||
/// .page_size(-55)
|
||||
/// .order_by("gubergren")
|
||||
/// .filter("Lorem")
|
||||
/// .end_time("gubergren")
|
||||
/// .start_time(chrono::Utc::now())
|
||||
/// .page_token("amet.")
|
||||
/// .page_size(-20)
|
||||
/// .order_by("ipsum")
|
||||
/// .filter("gubergren")
|
||||
/// .end_time(chrono::Utc::now())
|
||||
/// .doit().await;
|
||||
/// # }
|
||||
/// ```
|
||||
@@ -699,22 +723,22 @@ pub struct ProjectTraceListCall<'a, S>
|
||||
hub: &'a CloudTrace<S>,
|
||||
_project_id: String,
|
||||
_view: Option<String>,
|
||||
_start_time: Option<String>,
|
||||
_start_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
_page_token: Option<String>,
|
||||
_page_size: Option<i32>,
|
||||
_order_by: Option<String>,
|
||||
_filter: Option<String>,
|
||||
_end_time: Option<String>,
|
||||
_end_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
_scopes: BTreeSet<String>
|
||||
}
|
||||
|
||||
impl<'a, S> client::CallBuilder for ProjectTraceListCall<'a, S> {}
|
||||
|
||||
impl<'a, S> ProjectTraceListCall<'a, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
@@ -725,89 +749,74 @@ where
|
||||
pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, ListTracesResponse)> {
|
||||
use std::io::{Read, Seek};
|
||||
use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
|
||||
use client::ToParts;
|
||||
use client::{ToParts, url::Params};
|
||||
use std::borrow::Cow;
|
||||
|
||||
let mut dd = client::DefaultDelegate;
|
||||
let mut dlg: &mut dyn client::Delegate = match self._delegate {
|
||||
Some(d) => d,
|
||||
None => &mut dd
|
||||
};
|
||||
let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
|
||||
dlg.begin(client::MethodInfo { id: "cloudtrace.projects.traces.list",
|
||||
http_method: hyper::Method::GET });
|
||||
let mut params: Vec<(&str, String)> = Vec::with_capacity(10 + self._additional_params.len());
|
||||
params.push(("projectId", self._project_id.to_string()));
|
||||
if let Some(value) = self._view {
|
||||
params.push(("view", value.to_string()));
|
||||
}
|
||||
if let Some(value) = self._start_time {
|
||||
params.push(("startTime", value.to_string()));
|
||||
}
|
||||
if let Some(value) = self._page_token {
|
||||
params.push(("pageToken", value.to_string()));
|
||||
}
|
||||
if let Some(value) = self._page_size {
|
||||
params.push(("pageSize", value.to_string()));
|
||||
}
|
||||
if let Some(value) = self._order_by {
|
||||
params.push(("orderBy", value.to_string()));
|
||||
}
|
||||
if let Some(value) = self._filter {
|
||||
params.push(("filter", value.to_string()));
|
||||
}
|
||||
if let Some(value) = self._end_time {
|
||||
params.push(("endTime", value.to_string()));
|
||||
}
|
||||
|
||||
for &field in ["alt", "projectId", "view", "startTime", "pageToken", "pageSize", "orderBy", "filter", "endTime"].iter() {
|
||||
if self._additional_params.contains_key(field) {
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::FieldClash(field));
|
||||
}
|
||||
}
|
||||
for (name, value) in self._additional_params.iter() {
|
||||
params.push((&name, value.clone()));
|
||||
|
||||
let mut params = Params::with_capacity(10 + self._additional_params.len());
|
||||
params.push("projectId", self._project_id);
|
||||
if let Some(value) = self._view.as_ref() {
|
||||
params.push("view", value);
|
||||
}
|
||||
if let Some(value) = self._start_time.as_ref() {
|
||||
params.push("startTime", ::client::serde::datetime_to_string(&value));
|
||||
}
|
||||
if let Some(value) = self._page_token.as_ref() {
|
||||
params.push("pageToken", value);
|
||||
}
|
||||
if let Some(value) = self._page_size.as_ref() {
|
||||
params.push("pageSize", value.to_string());
|
||||
}
|
||||
if let Some(value) = self._order_by.as_ref() {
|
||||
params.push("orderBy", value);
|
||||
}
|
||||
if let Some(value) = self._filter.as_ref() {
|
||||
params.push("filter", value);
|
||||
}
|
||||
if let Some(value) = self._end_time.as_ref() {
|
||||
params.push("endTime", ::client::serde::datetime_to_string(&value));
|
||||
}
|
||||
|
||||
params.push(("alt", "json".to_string()));
|
||||
params.extend(self._additional_params.iter());
|
||||
|
||||
params.push("alt", "json");
|
||||
let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/traces";
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::TraceReadonly.as_ref().to_string(), ());
|
||||
if self._scopes.is_empty() {
|
||||
self._scopes.insert(Scope::TraceReadonly.as_ref().to_string());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{projectId}", "projectId")].iter() {
|
||||
let mut replace_with: Option<&str> = None;
|
||||
for &(name, ref value) in params.iter() {
|
||||
if name == param_name {
|
||||
replace_with = Some(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
url = url.replace(find_this, replace_with.expect("to find substitution value in params"));
|
||||
url = params.uri_replacement(url, param_name, find_this, false);
|
||||
}
|
||||
{
|
||||
let mut indices_for_removal: Vec<usize> = Vec::with_capacity(1);
|
||||
for param_name in ["projectId"].iter() {
|
||||
if let Some(index) = params.iter().position(|t| &t.0 == param_name) {
|
||||
indices_for_removal.push(index);
|
||||
}
|
||||
}
|
||||
for &index in indices_for_removal.iter() {
|
||||
params.remove(index);
|
||||
}
|
||||
let to_remove = ["projectId"];
|
||||
params.remove_params(&to_remove);
|
||||
}
|
||||
|
||||
let url = url::Url::parse_with_params(&url, params).unwrap();
|
||||
let url = params.parse_with_url(&url);
|
||||
|
||||
|
||||
|
||||
loop {
|
||||
let token = match self.hub.auth.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token.clone(),
|
||||
Err(err) => {
|
||||
match dlg.token(&err) {
|
||||
Some(token) => token,
|
||||
None => {
|
||||
let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token,
|
||||
Err(e) => {
|
||||
match dlg.token(e) {
|
||||
Ok(token) => token,
|
||||
Err(e) => {
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::MissingToken(err))
|
||||
return Err(client::Error::MissingToken(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -815,21 +824,27 @@ where
|
||||
let mut req_result = {
|
||||
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()));
|
||||
let mut req_builder = hyper::Request::builder()
|
||||
.method(hyper::Method::GET)
|
||||
.uri(url.as_str())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone());
|
||||
|
||||
if let Some(token) = token.as_ref() {
|
||||
req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
|
||||
}
|
||||
|
||||
|
||||
let request = req_builder
|
||||
.body(hyper::body::Body::empty());
|
||||
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
|
||||
};
|
||||
|
||||
match req_result {
|
||||
Err(err) => {
|
||||
if let client::Retry::After(d) = dlg.http_error(&err) {
|
||||
sleep(d);
|
||||
sleep(d).await;
|
||||
continue;
|
||||
}
|
||||
dlg.finished(false);
|
||||
@@ -845,7 +860,7 @@ where
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
sleep(d).await;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -896,8 +911,8 @@ where
|
||||
/// Start of the time interval (inclusive) during which the trace data was collected from the application.
|
||||
///
|
||||
/// Sets the *start time* query property to the given value.
|
||||
pub fn start_time(mut self, new_value: &str) -> ProjectTraceListCall<'a, S> {
|
||||
self._start_time = Some(new_value.to_string());
|
||||
pub fn start_time(mut self, new_value: client::chrono::DateTime<client::chrono::offset::Utc>) -> ProjectTraceListCall<'a, S> {
|
||||
self._start_time = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// Token identifying the page of results to return. If provided, use the value of the `next_page_token` field from a previous request.
|
||||
@@ -931,14 +946,15 @@ where
|
||||
/// End of the time interval (inclusive) during which the trace data was collected from the application.
|
||||
///
|
||||
/// Sets the *end time* query property to the given value.
|
||||
pub fn end_time(mut self, new_value: &str) -> ProjectTraceListCall<'a, S> {
|
||||
self._end_time = Some(new_value.to_string());
|
||||
pub fn end_time(mut self, new_value: client::chrono::DateTime<client::chrono::offset::Utc>) -> ProjectTraceListCall<'a, S> {
|
||||
self._end_time = Some(new_value);
|
||||
self
|
||||
}
|
||||
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
|
||||
/// while executing the actual API request.
|
||||
///
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
/// ````text
|
||||
/// 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) -> ProjectTraceListCall<'a, S> {
|
||||
@@ -974,25 +990,36 @@ where
|
||||
|
||||
/// Identifies the authorization scope for the method you are building.
|
||||
///
|
||||
/// Use this method to actively specify which scope should be used, instead the default `Scope` variant
|
||||
/// `Scope::TraceReadonly`.
|
||||
/// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
|
||||
/// [`Scope::TraceReadonly`].
|
||||
///
|
||||
/// The `scope` will be added to a set of scopes. This is important as one can maintain access
|
||||
/// tokens for more than one scope.
|
||||
/// If `None` is specified, then all scopes will be removed and no default scope will be used either.
|
||||
/// In that case, you have to specify your API-key using the `key` parameter (see the `param()`
|
||||
/// function for details).
|
||||
///
|
||||
/// 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, St>(mut self, scope: T) -> ProjectTraceListCall<'a, S>
|
||||
where T: Into<Option<St>>,
|
||||
St: AsRef<str> {
|
||||
match scope.into() {
|
||||
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
|
||||
None => None,
|
||||
};
|
||||
pub fn add_scope<St>(mut self, scope: St) -> ProjectTraceListCall<'a, S>
|
||||
where St: AsRef<str> {
|
||||
self._scopes.insert(String::from(scope.as_ref()));
|
||||
self
|
||||
}
|
||||
/// Identifies the authorization scope(s) for the method you are building.
|
||||
///
|
||||
/// See [`Self::add_scope()`] for details.
|
||||
pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectTraceListCall<'a, S>
|
||||
where I: IntoIterator<Item = St>,
|
||||
St: AsRef<str> {
|
||||
self._scopes
|
||||
.extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
|
||||
self
|
||||
}
|
||||
|
||||
/// Removes all scopes, and no default scope will be used either.
|
||||
/// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
|
||||
/// for details).
|
||||
pub fn clear_scopes(mut self) -> ProjectTraceListCall<'a, S> {
|
||||
self._scopes.clear();
|
||||
self
|
||||
}
|
||||
}
|
||||
@@ -1001,7 +1028,7 @@ where
|
||||
/// Sends new traces to Cloud Trace or updates existing traces. If the ID of a trace that you send matches that of an existing trace, any fields in the existing trace and its spans are overwritten by the provided values, and any new fields provided are merged with the existing trace data. If the ID does not match, a new trace is created.
|
||||
///
|
||||
/// A builder for the *patchTraces* method supported by a *project* resource.
|
||||
/// It is not used directly, but through a `ProjectMethods` instance.
|
||||
/// It is not used directly, but through a [`ProjectMethods`] instance.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
@@ -1014,7 +1041,7 @@ where
|
||||
/// use cloudtrace1::api::Traces;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
/// # use cloudtrace1::{CloudTrace, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
@@ -1042,14 +1069,14 @@ pub struct ProjectPatchTraceCall<'a, S>
|
||||
_project_id: String,
|
||||
_delegate: Option<&'a mut dyn client::Delegate>,
|
||||
_additional_params: HashMap<String, String>,
|
||||
_scopes: BTreeMap<String, ()>
|
||||
_scopes: BTreeSet<String>
|
||||
}
|
||||
|
||||
impl<'a, S> client::CallBuilder for ProjectPatchTraceCall<'a, S> {}
|
||||
|
||||
impl<'a, S> ProjectPatchTraceCall<'a, S>
|
||||
where
|
||||
S: tower_service::Service<Uri> + Clone + Send + Sync + 'static,
|
||||
S: tower_service::Service<http::Uri> + Clone + Send + Sync + 'static,
|
||||
S::Response: hyper::client::connect::Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
|
||||
S::Future: Send + Unpin + 'static,
|
||||
S::Error: Into<Box<dyn StdError + Send + Sync>>,
|
||||
@@ -1060,58 +1087,43 @@ where
|
||||
pub async fn doit(mut self) -> client::Result<(hyper::Response<hyper::body::Body>, Empty)> {
|
||||
use std::io::{Read, Seek};
|
||||
use hyper::header::{CONTENT_TYPE, CONTENT_LENGTH, AUTHORIZATION, USER_AGENT, LOCATION};
|
||||
use client::ToParts;
|
||||
use client::{ToParts, url::Params};
|
||||
use std::borrow::Cow;
|
||||
|
||||
let mut dd = client::DefaultDelegate;
|
||||
let mut dlg: &mut dyn client::Delegate = match self._delegate {
|
||||
Some(d) => d,
|
||||
None => &mut dd
|
||||
};
|
||||
let mut dlg: &mut dyn client::Delegate = self._delegate.unwrap_or(&mut dd);
|
||||
dlg.begin(client::MethodInfo { id: "cloudtrace.projects.patchTraces",
|
||||
http_method: hyper::Method::PATCH });
|
||||
let mut params: Vec<(&str, String)> = Vec::with_capacity(4 + self._additional_params.len());
|
||||
params.push(("projectId", self._project_id.to_string()));
|
||||
|
||||
for &field in ["alt", "projectId"].iter() {
|
||||
if self._additional_params.contains_key(field) {
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::FieldClash(field));
|
||||
}
|
||||
}
|
||||
for (name, value) in self._additional_params.iter() {
|
||||
params.push((&name, value.clone()));
|
||||
}
|
||||
|
||||
params.push(("alt", "json".to_string()));
|
||||
let mut params = Params::with_capacity(4 + self._additional_params.len());
|
||||
params.push("projectId", self._project_id);
|
||||
|
||||
params.extend(self._additional_params.iter());
|
||||
|
||||
params.push("alt", "json");
|
||||
let mut url = self.hub._base_url.clone() + "v1/projects/{projectId}/traces";
|
||||
if self._scopes.len() == 0 {
|
||||
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string(), ());
|
||||
if self._scopes.is_empty() {
|
||||
self._scopes.insert(Scope::CloudPlatform.as_ref().to_string());
|
||||
}
|
||||
|
||||
for &(find_this, param_name) in [("{projectId}", "projectId")].iter() {
|
||||
let mut replace_with: Option<&str> = None;
|
||||
for &(name, ref value) in params.iter() {
|
||||
if name == param_name {
|
||||
replace_with = Some(value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
url = url.replace(find_this, replace_with.expect("to find substitution value in params"));
|
||||
url = params.uri_replacement(url, param_name, find_this, false);
|
||||
}
|
||||
{
|
||||
let mut indices_for_removal: Vec<usize> = Vec::with_capacity(1);
|
||||
for param_name in ["projectId"].iter() {
|
||||
if let Some(index) = params.iter().position(|t| &t.0 == param_name) {
|
||||
indices_for_removal.push(index);
|
||||
}
|
||||
}
|
||||
for &index in indices_for_removal.iter() {
|
||||
params.remove(index);
|
||||
}
|
||||
let to_remove = ["projectId"];
|
||||
params.remove_params(&to_remove);
|
||||
}
|
||||
|
||||
let url = url::Url::parse_with_params(&url, params).unwrap();
|
||||
let url = params.parse_with_url(&url);
|
||||
|
||||
let mut json_mime_type: mime::Mime = "application/json".parse().unwrap();
|
||||
let mut json_mime_type = mime::APPLICATION_JSON;
|
||||
let mut request_value_reader =
|
||||
{
|
||||
let mut value = json::value::to_value(&self._request).expect("serde to work");
|
||||
@@ -1125,14 +1137,14 @@ where
|
||||
|
||||
|
||||
loop {
|
||||
let token = match self.hub.auth.token(&self._scopes.keys().collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token.clone(),
|
||||
Err(err) => {
|
||||
match dlg.token(&err) {
|
||||
Some(token) => token,
|
||||
None => {
|
||||
let token = match self.hub.auth.get_token(&self._scopes.iter().map(String::as_str).collect::<Vec<_>>()[..]).await {
|
||||
Ok(token) => token,
|
||||
Err(e) => {
|
||||
match dlg.token(e) {
|
||||
Ok(token) => token,
|
||||
Err(e) => {
|
||||
dlg.finished(false);
|
||||
return Err(client::Error::MissingToken(err))
|
||||
return Err(client::Error::MissingToken(e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1141,23 +1153,29 @@ where
|
||||
let mut req_result = {
|
||||
let client = &self.hub.client;
|
||||
dlg.pre_request();
|
||||
let mut req_builder = hyper::Request::builder().method(hyper::Method::PATCH).uri(url.clone().into_string())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone()) .header(AUTHORIZATION, format!("Bearer {}", token.as_str()));
|
||||
let mut req_builder = hyper::Request::builder()
|
||||
.method(hyper::Method::PATCH)
|
||||
.uri(url.as_str())
|
||||
.header(USER_AGENT, self.hub._user_agent.clone());
|
||||
|
||||
if let Some(token) = token.as_ref() {
|
||||
req_builder = req_builder.header(AUTHORIZATION, format!("Bearer {}", token));
|
||||
}
|
||||
|
||||
|
||||
let request = req_builder
|
||||
.header(CONTENT_TYPE, format!("{}", json_mime_type.to_string()))
|
||||
.header(CONTENT_TYPE, json_mime_type.to_string())
|
||||
.header(CONTENT_LENGTH, request_size as u64)
|
||||
.body(hyper::body::Body::from(request_value_reader.get_ref().clone()));
|
||||
|
||||
client.request(request.unwrap()).await
|
||||
|
||||
|
||||
};
|
||||
|
||||
match req_result {
|
||||
Err(err) => {
|
||||
if let client::Retry::After(d) = dlg.http_error(&err) {
|
||||
sleep(d);
|
||||
sleep(d).await;
|
||||
continue;
|
||||
}
|
||||
dlg.finished(false);
|
||||
@@ -1173,7 +1191,7 @@ where
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
sleep(d).await;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1226,7 +1244,8 @@ where
|
||||
/// The delegate implementation is consulted whenever there is an intermediate result, or if something goes wrong
|
||||
/// while executing the actual API request.
|
||||
///
|
||||
/// It should be used to handle progress information, and to implement a certain level of resilience.
|
||||
/// ````text
|
||||
/// 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) -> ProjectPatchTraceCall<'a, S> {
|
||||
@@ -1262,25 +1281,36 @@ where
|
||||
|
||||
/// Identifies the authorization scope for the method you are building.
|
||||
///
|
||||
/// Use this method to actively specify which scope should be used, instead the default `Scope` variant
|
||||
/// `Scope::CloudPlatform`.
|
||||
/// Use this method to actively specify which scope should be used, instead of the default [`Scope`] variant
|
||||
/// [`Scope::CloudPlatform`].
|
||||
///
|
||||
/// The `scope` will be added to a set of scopes. This is important as one can maintain access
|
||||
/// tokens for more than one scope.
|
||||
/// If `None` is specified, then all scopes will be removed and no default scope will be used either.
|
||||
/// In that case, you have to specify your API-key using the `key` parameter (see the `param()`
|
||||
/// function for details).
|
||||
///
|
||||
/// 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, St>(mut self, scope: T) -> ProjectPatchTraceCall<'a, S>
|
||||
where T: Into<Option<St>>,
|
||||
St: AsRef<str> {
|
||||
match scope.into() {
|
||||
Some(scope) => self._scopes.insert(scope.as_ref().to_string(), ()),
|
||||
None => None,
|
||||
};
|
||||
pub fn add_scope<St>(mut self, scope: St) -> ProjectPatchTraceCall<'a, S>
|
||||
where St: AsRef<str> {
|
||||
self._scopes.insert(String::from(scope.as_ref()));
|
||||
self
|
||||
}
|
||||
/// Identifies the authorization scope(s) for the method you are building.
|
||||
///
|
||||
/// See [`Self::add_scope()`] for details.
|
||||
pub fn add_scopes<I, St>(mut self, scopes: I) -> ProjectPatchTraceCall<'a, S>
|
||||
where I: IntoIterator<Item = St>,
|
||||
St: AsRef<str> {
|
||||
self._scopes
|
||||
.extend(scopes.into_iter().map(|s| String::from(s.as_ref())));
|
||||
self
|
||||
}
|
||||
|
||||
/// Removes all scopes, and no default scope will be used either.
|
||||
/// In this case, you have to specify your API-key using the `key` parameter (see [`Self::param()`]
|
||||
/// for details).
|
||||
pub fn clear_scopes(mut self) -> ProjectPatchTraceCall<'a, S> {
|
||||
self._scopes.clear();
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user