mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
regen all APIs and validate them
This commit is contained in:
@@ -19,7 +19,7 @@ use crate::client;
|
||||
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
|
||||
#[derive(PartialEq, Eq, Hash)]
|
||||
pub enum Scope {
|
||||
/// View and manage your data across Google Cloud Platform services
|
||||
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
||||
CloudPlatform,
|
||||
|
||||
/// Write Trace data for a project or application
|
||||
@@ -56,14 +56,12 @@ impl Default for Scope {
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_cloudtrace2 as cloudtrace2;
|
||||
/// use cloudtrace2::api::Span;
|
||||
/// use cloudtrace2::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use cloudtrace2::CloudTrace;
|
||||
/// use cloudtrace2::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
@@ -73,9 +71,9 @@ impl Default for Scope {
|
||||
/// // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
|
||||
/// // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
|
||||
/// // retrieve them from storage.
|
||||
/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = CloudTrace::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -110,8 +108,8 @@ impl Default for Scope {
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct CloudTrace<> {
|
||||
client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>,
|
||||
auth: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>,
|
||||
pub client: hyper::Client<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>, hyper::body::Body>,
|
||||
pub auth: oauth2::authenticator::Authenticator<hyper_rustls::HttpsConnector<hyper::client::connect::HttpConnector>>,
|
||||
_user_agent: String,
|
||||
_base_url: String,
|
||||
_root_url: String,
|
||||
@@ -125,7 +123,7 @@ impl<'a, > CloudTrace<> {
|
||||
CloudTrace {
|
||||
client,
|
||||
auth: authenticator,
|
||||
_user_agent: "google-api-rust-client/2.0.8".to_string(),
|
||||
_user_agent: "google-api-rust-client/3.0.0".to_string(),
|
||||
_base_url: "https://cloudtrace.googleapis.com/".to_string(),
|
||||
_root_url: "https://cloudtrace.googleapis.com/".to_string(),
|
||||
}
|
||||
@@ -136,7 +134,7 @@ impl<'a, > CloudTrace<> {
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/2.0.8`.
|
||||
/// It defaults to `google-api-rust-client/3.0.0`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
@@ -179,7 +177,7 @@ pub struct Annotation {
|
||||
impl client::Part for Annotation {}
|
||||
|
||||
|
||||
/// The allowed types for [VALUE] in a `[KEY]:[VALUE]` attribute.
|
||||
/// The allowed types for `[VALUE]` in a `[KEY]:[VALUE]` attribute.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
@@ -199,13 +197,13 @@ pub struct AttributeValue {
|
||||
impl client::Part for AttributeValue {}
|
||||
|
||||
|
||||
/// A set of attributes, each in the format `[KEY]:[VALUE]`.
|
||||
/// A set of attributes as key-value pairs.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Attributes {
|
||||
/// The set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the Boolean values `true` and `false`. For example: "/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "abc.com/myattribute": { "bool_value": false }
|
||||
/// A set of attributes. Each attribute's key can be up to 128 bytes long. The value can be a string up to 256 bytes, a signed 64-bit integer, or the boolean values `true` or `false`. For example: "/instance_id": { "string_value": { "value": "my-instance" } } "/http/request_bytes": { "int_value": 300 } "abc.com/myattribute": { "bool_value": false }
|
||||
#[serde(rename="attributeMap")]
|
||||
pub attribute_map: Option<HashMap<String, AttributeValue>>,
|
||||
/// The number of attributes that were discarded. Attributes can be discarded because their keys are too long or because there are too many attributes. If this value is 0 then all attributes are valid.
|
||||
@@ -227,7 +225,7 @@ impl client::Part for Attributes {}
|
||||
///
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct BatchWriteSpansRequest {
|
||||
/// Required. A list of new spans. The span names must not match existing spans, or the results are undefined.
|
||||
/// Required. A list of new spans. The span names must not match existing spans, otherwise the results are undefined.
|
||||
pub spans: Option<Vec<Span>>,
|
||||
}
|
||||
|
||||
@@ -255,12 +253,12 @@ impl client::ResponseResult for Empty {}
|
||||
///
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Link {
|
||||
/// A set of attributes on the link. You have have up to 32 attributes per link.
|
||||
/// A set of attributes on the link. Up to 32 attributes can be specified per link.
|
||||
pub attributes: Option<Attributes>,
|
||||
/// The [SPAN_ID] for a span within a trace.
|
||||
/// The `[SPAN_ID]` for a span within a trace.
|
||||
#[serde(rename="spanId")]
|
||||
pub span_id: Option<String>,
|
||||
/// The [TRACE_ID] for a trace within a project.
|
||||
/// The `[TRACE_ID]` for a trace within a project.
|
||||
#[serde(rename="traceId")]
|
||||
pub trace_id: Option<String>,
|
||||
/// The relationship of the current span relative to the linked span.
|
||||
@@ -293,10 +291,10 @@ impl client::Part for Links {}
|
||||
///
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct MessageEvent {
|
||||
/// The number of compressed bytes sent or received. If missing assumed to be the same size as uncompressed.
|
||||
/// The number of compressed bytes sent or received. If missing, the compressed size is assumed to be the same size as the uncompressed size.
|
||||
#[serde(rename="compressedSizeBytes")]
|
||||
pub compressed_size_bytes: Option<String>,
|
||||
/// An identifier for the MessageEvent's message that can be used to match SENT and RECEIVED MessageEvents. It is recommended to be unique within a Span.
|
||||
/// An identifier for the MessageEvent's message that can be used to match `SENT` and `RECEIVED` MessageEvents.
|
||||
pub id: Option<String>,
|
||||
/// Type of MessageEvent. Indicates whether the message was sent or received.
|
||||
#[serde(rename="type")]
|
||||
@@ -325,7 +323,7 @@ pub struct Module {
|
||||
impl client::Part for Module {}
|
||||
|
||||
|
||||
/// A span represents a single operation within a trace. Spans can be nested to form a trace tree. Often, a trace contains a root span that describes the end-to-end latency, and one or more subspans for its sub-operations. A trace can also contain multiple root spans, or none at all. Spans do not need to be contiguous—there may be gaps or overlaps between spans in a trace.
|
||||
/// A span represents a single operation within a trace. Spans can be nested to form a trace tree. Often, a trace contains a root span that describes the end-to-end latency, and one or more subspans for its sub-operations. A trace can also contain multiple root spans, or none at all. Spans do not need to be contiguous—there might be gaps or overlaps between spans in a trace.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
@@ -341,7 +339,7 @@ pub struct Span {
|
||||
/// Optional. The number of child spans that were generated while this span was active. If set, allows implementation to detect missing child spans.
|
||||
#[serde(rename="childSpanCount")]
|
||||
pub child_span_count: Option<i32>,
|
||||
/// Required. A description of the span's operation (up to 128 bytes). Trace displays the description in the Google Cloud Platform Console. For example, the display name can be a qualified method name or a file name and a line number where the operation is called. A best practice is to use the same display name within an application and at the same call point. This makes it easier to correlate spans in different traces.
|
||||
/// Required. A description of the span's operation (up to 128 bytes). Cloud Trace displays the description in the Cloud Console. For example, the display name can be a qualified method name or a file name and a line number where the operation is called. A best practice is to use the same display name within an application and at the same call point. This makes it easier to correlate spans in different traces.
|
||||
#[serde(rename="displayName")]
|
||||
pub display_name: Option<TruncatableString>,
|
||||
/// Required. The end time of the span. On the client side, this is the time kept by the local machine where the span execution ends. On the server side, this is the time when the server application handler stops running.
|
||||
@@ -349,15 +347,15 @@ pub struct Span {
|
||||
pub end_time: Option<String>,
|
||||
/// Links associated with the span. You can have up to 128 links per Span.
|
||||
pub links: Option<Links>,
|
||||
/// Required. The resource name of the span in the following format: projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero.
|
||||
/// Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero. .
|
||||
pub name: Option<String>,
|
||||
/// The [SPAN_ID] of this span's parent span. If this is a root span, then this field must be empty.
|
||||
/// The `[SPAN_ID]` of this span's parent span. If this is a root span, then this field must be empty.
|
||||
#[serde(rename="parentSpanId")]
|
||||
pub parent_span_id: Option<String>,
|
||||
/// Optional. Set this parameter to indicate whether this span is in the same process as its parent. If you do not set this parameter, Trace is unable to take advantage of this helpful information.
|
||||
#[serde(rename="sameProcessAsParentSpan")]
|
||||
pub same_process_as_parent_span: Option<bool>,
|
||||
/// Required. The [SPAN_ID] portion of the span's resource name.
|
||||
/// Required. The `[SPAN_ID]` portion of the span's resource name.
|
||||
#[serde(rename="spanId")]
|
||||
pub span_id: Option<String>,
|
||||
/// Optional. Distinguishes between spans generated in a particular context. For example, two spans with the same name may be distinguished using `CLIENT` (caller) and `SERVER` (callee) to identify an RPC call.
|
||||
@@ -531,18 +529,16 @@ impl client::Part for TruncatableString {}
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate yup_oauth2 as oauth2;
|
||||
/// extern crate google_cloudtrace2 as cloudtrace2;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use oauth2;
|
||||
/// use cloudtrace2::CloudTrace;
|
||||
/// use cloudtrace2::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = CloudTrace::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
@@ -568,7 +564,7 @@ impl<'a> ProjectMethods<'a> {
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Required. The resource name of the span in the following format: projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero.
|
||||
/// * `name` - Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero. .
|
||||
pub fn traces_spans_create_span(&self, request: Span, name: &str) -> ProjectTraceSpanCreateSpanCall<'a> {
|
||||
ProjectTraceSpanCreateSpanCall {
|
||||
hub: self.hub,
|
||||
@@ -582,7 +578,7 @@ impl<'a> ProjectMethods<'a> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Sends new spans to new or existing traces. You cannot update existing spans.
|
||||
/// Batch writes new spans to new or existing traces. You cannot update existing spans.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
@@ -620,18 +616,16 @@ impl<'a> ProjectMethods<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_cloudtrace2 as cloudtrace2;
|
||||
/// use cloudtrace2::api::Span;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use cloudtrace2::CloudTrace;
|
||||
/// # use cloudtrace2::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = CloudTrace::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -776,22 +770,22 @@ impl<'a> ProjectTraceSpanCreateSpanCall<'a> {
|
||||
Ok(mut res) => {
|
||||
if !res.status().is_success() {
|
||||
let res_body_string = client::get_body_as_string(res.body_mut()).await;
|
||||
let (parts, _) = res.into_parts();
|
||||
let body = hyper::Body::from(res_body_string.clone());
|
||||
let restored_response = hyper::Response::from_parts(parts, body);
|
||||
|
||||
let json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
@@ -823,7 +817,7 @@ impl<'a> ProjectTraceSpanCreateSpanCall<'a> {
|
||||
self._request = new_value;
|
||||
self
|
||||
}
|
||||
/// Required. The resource name of the span in the following format: projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/SPAN_ID is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. [SPAN_ID] is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero.
|
||||
/// Required. The resource name of the span in the following format: * `projects/[PROJECT_ID]/traces/[TRACE_ID]/spans/[SPAN_ID]` `[TRACE_ID]` is a unique identifier for a trace within a project; it is a 32-character hexadecimal encoding of a 16-byte array. It should not be zero. `[SPAN_ID]` is a unique identifier for a span within a trace; it is a 16-character hexadecimal encoding of an 8-byte array. It should not be zero. .
|
||||
///
|
||||
/// Sets the *name* path property to the given value.
|
||||
///
|
||||
@@ -896,7 +890,7 @@ impl<'a> ProjectTraceSpanCreateSpanCall<'a> {
|
||||
}
|
||||
|
||||
|
||||
/// Sends new spans to new or existing traces. You cannot update existing spans.
|
||||
/// Batch writes new spans to new or existing traces. You cannot update existing spans.
|
||||
///
|
||||
/// A builder for the *traces.batchWrite* method supported by a *project* resource.
|
||||
/// It is not used directly, but through a `ProjectMethods` instance.
|
||||
@@ -908,18 +902,16 @@ impl<'a> ProjectTraceSpanCreateSpanCall<'a> {
|
||||
/// ```test_harness,no_run
|
||||
/// # extern crate hyper;
|
||||
/// # extern crate hyper_rustls;
|
||||
/// # extern crate yup_oauth2 as oauth2;
|
||||
/// # extern crate google_cloudtrace2 as cloudtrace2;
|
||||
/// use cloudtrace2::api::BatchWriteSpansRequest;
|
||||
/// # async fn dox() {
|
||||
/// # use std::default::Default;
|
||||
/// # use oauth2;
|
||||
/// # use cloudtrace2::CloudTrace;
|
||||
/// # use cloudtrace2::{CloudTrace, oauth2, hyper, hyper_rustls};
|
||||
///
|
||||
/// # let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// # let auth = yup_oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// # secret,
|
||||
/// # yup_oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// # ).build().await.unwrap();
|
||||
/// # let mut hub = CloudTrace::new(hyper::Client::builder().build(hyper_rustls::HttpsConnector::with_native_roots()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
@@ -1064,22 +1056,22 @@ impl<'a> ProjectTraceBatchWriteCall<'a> {
|
||||
Ok(mut res) => {
|
||||
if !res.status().is_success() {
|
||||
let res_body_string = client::get_body_as_string(res.body_mut()).await;
|
||||
let (parts, _) = res.into_parts();
|
||||
let body = hyper::Body::from(res_body_string.clone());
|
||||
let restored_response = hyper::Response::from_parts(parts, body);
|
||||
|
||||
let json_server_error = json::from_str::<client::JsonServerError>(&res_body_string).ok();
|
||||
let server_error = json::from_str::<client::ServerError>(&res_body_string)
|
||||
.or_else(|_| json::from_str::<client::ErrorResponse>(&res_body_string).map(|r| r.error))
|
||||
.ok();
|
||||
let server_response = json::from_str::<serde_json::Value>(&res_body_string).ok();
|
||||
|
||||
if let client::Retry::After(d) = dlg.http_failure(&res,
|
||||
json_server_error,
|
||||
server_error) {
|
||||
if let client::Retry::After(d) = dlg.http_failure(&restored_response, server_response.clone()) {
|
||||
sleep(d);
|
||||
continue;
|
||||
}
|
||||
|
||||
dlg.finished(false);
|
||||
return match json::from_str::<client::ErrorResponse>(&res_body_string){
|
||||
Err(_) => Err(client::Error::Failure(res)),
|
||||
Ok(serr) => Err(client::Error::BadRequest(serr))
|
||||
|
||||
return match server_response {
|
||||
Some(error_value) => Err(client::Error::BadRequest(error_value)),
|
||||
None => Err(client::Error::Failure(restored_response)),
|
||||
}
|
||||
}
|
||||
let result_value = {
|
||||
|
||||
Reference in New Issue
Block a user