mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
make regen-apis
This commit is contained in:
2923
gen/cloudmonitoring2_beta2/src/api/call_builders.rs
Normal file
2923
gen/cloudmonitoring2_beta2/src/api/call_builders.rs
Normal file
File diff suppressed because it is too large
Load Diff
121
gen/cloudmonitoring2_beta2/src/api/hub.rs
Normal file
121
gen/cloudmonitoring2_beta2/src/api/hub.rs
Normal file
@@ -0,0 +1,121 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all CloudMonitoring related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudmonitoring2_beta2 as cloudmonitoring2_beta2;
|
||||
/// use cloudmonitoring2_beta2::api::ListMetricDescriptorsRequest;
|
||||
/// use cloudmonitoring2_beta2::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudmonitoring2_beta2::{CloudMonitoring, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
/// // `client_secret`, among other things.
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// // Instantiate the authenticator. It will choose a suitable authentication flow for you,
|
||||
/// // unless you replace `None` with the desired Flow.
|
||||
/// // 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 = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = CloudMonitoring::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
/// // into the respective structure. Some of the parts shown here might not be applicable !
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let mut req = ListMetricDescriptorsRequest::default();
|
||||
///
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.metric_descriptors().list(req, "project")
|
||||
/// .query("takimata")
|
||||
/// .page_token("amet.")
|
||||
/// .count(-20)
|
||||
/// .doit().await;
|
||||
///
|
||||
/// match result {
|
||||
/// Err(e) => match e {
|
||||
/// // The Error enum provides details about what exactly happened.
|
||||
/// // You can also just use its `Debug`, `Display` or `Error` traits
|
||||
/// Error::HttpError(_)
|
||||
/// |Error::Io(_)
|
||||
/// |Error::MissingAPIKey
|
||||
/// |Error::MissingToken(_)
|
||||
/// |Error::Cancelled
|
||||
/// |Error::UploadSizeLimitExceeded(_, _)
|
||||
/// |Error::Failure(_)
|
||||
/// |Error::BadRequest(_)
|
||||
/// |Error::FieldClash(_)
|
||||
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
|
||||
/// },
|
||||
/// Ok(res) => println!("Success: {:?}", res),
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct CloudMonitoring<S> {
|
||||
pub client: hyper::Client<S, hyper::body::Body>,
|
||||
pub auth: Box<dyn client::GetToken>,
|
||||
pub(super) _user_agent: String,
|
||||
pub(super) _base_url: String,
|
||||
pub(super) _root_url: String,
|
||||
}
|
||||
|
||||
impl<'a, S> client::Hub for CloudMonitoring<S> {}
|
||||
|
||||
impl<'a, S> CloudMonitoring<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> CloudMonitoring<S> {
|
||||
CloudMonitoring {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.3".to_string(),
|
||||
_base_url: "https://www.googleapis.com/cloudmonitoring/v2beta2/projects/".to_string(),
|
||||
_root_url: "https://www.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn metric_descriptors(&'a self) -> MetricDescriptorMethods<'a, S> {
|
||||
MetricDescriptorMethods { hub: &self }
|
||||
}
|
||||
pub fn timeseries(&'a self) -> TimeseryMethods<'a, S> {
|
||||
TimeseryMethods { hub: &self }
|
||||
}
|
||||
pub fn timeseries_descriptors(&'a self) -> TimeseriesDescriptorMethods<'a, S> {
|
||||
TimeseriesDescriptorMethods { hub: &self }
|
||||
}
|
||||
|
||||
/// Set the user-agent header field to use in all requests to the server.
|
||||
/// It defaults to `google-api-rust-client/5.0.3`.
|
||||
///
|
||||
/// Returns the previously set user-agent.
|
||||
pub fn user_agent(&mut self, agent_name: String) -> String {
|
||||
mem::replace(&mut self._user_agent, agent_name)
|
||||
}
|
||||
|
||||
/// Set the base url to use in all requests to the server.
|
||||
/// It defaults to `https://www.googleapis.com/cloudmonitoring/v2beta2/projects/`.
|
||||
///
|
||||
/// Returns the previously set base url.
|
||||
pub fn base_url(&mut self, new_base_url: String) -> String {
|
||||
mem::replace(&mut self._base_url, new_base_url)
|
||||
}
|
||||
|
||||
/// Set the root url to use in all requests to the server.
|
||||
/// It defaults to `https://www.googleapis.com/`.
|
||||
///
|
||||
/// Returns the previously set root url.
|
||||
pub fn root_url(&mut self, new_root_url: String) -> String {
|
||||
mem::replace(&mut self._root_url, new_root_url)
|
||||
}
|
||||
}
|
||||
263
gen/cloudmonitoring2_beta2/src/api/method_builders.rs
Normal file
263
gen/cloudmonitoring2_beta2/src/api/method_builders.rs
Normal file
@@ -0,0 +1,263 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *metricDescriptor* resources.
|
||||
/// It is not used directly, but through the [`CloudMonitoring`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudmonitoring2_beta2 as cloudmonitoring2_beta2;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudmonitoring2_beta2::{CloudMonitoring, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = CloudMonitoring::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `create(...)`, `delete(...)` and `list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.metric_descriptors();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct MetricDescriptorMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a CloudMonitoring<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for MetricDescriptorMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> MetricDescriptorMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Create a new metric.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `project` - The project id. The value can be the numeric project ID or string-based project name.
|
||||
pub fn create(&self, request: MetricDescriptor, project: &str) -> MetricDescriptorCreateCall<'a, S> {
|
||||
MetricDescriptorCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_project: project.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Delete an existing metric.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `project` - The project ID to which the metric belongs.
|
||||
/// * `metric` - Name of the metric.
|
||||
pub fn delete(&self, project: &str, metric: &str) -> MetricDescriptorDeleteCall<'a, S> {
|
||||
MetricDescriptorDeleteCall {
|
||||
hub: self.hub,
|
||||
_project: project.to_string(),
|
||||
_metric: metric.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// List metric descriptors that match the query. If the query is not set, then all of the metric descriptors will be returned. Large responses will be paginated, use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `project` - The project id. The value can be the numeric project ID or string-based project name.
|
||||
pub fn list(&self, request: ListMetricDescriptorsRequest, project: &str) -> MetricDescriptorListCall<'a, S> {
|
||||
MetricDescriptorListCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_project: project.to_string(),
|
||||
_query: Default::default(),
|
||||
_page_token: Default::default(),
|
||||
_count: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *timesery* resources.
|
||||
/// It is not used directly, but through the [`CloudMonitoring`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudmonitoring2_beta2 as cloudmonitoring2_beta2;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudmonitoring2_beta2::{CloudMonitoring, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = CloudMonitoring::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `list(...)` and `write(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.timeseries();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct TimeseryMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a CloudMonitoring<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for TimeseryMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> TimeseryMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// List the data points of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `project` - The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name.
|
||||
/// * `metric` - Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.
|
||||
/// * `youngest` - End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.
|
||||
pub fn list(&self, request: ListTimeseriesRequest, project: &str, metric: &str, youngest: &str) -> TimeseryListCall<'a, S> {
|
||||
TimeseryListCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_project: project.to_string(),
|
||||
_metric: metric.to_string(),
|
||||
_youngest: youngest.to_string(),
|
||||
_window: Default::default(),
|
||||
_timespan: Default::default(),
|
||||
_page_token: Default::default(),
|
||||
_oldest: Default::default(),
|
||||
_labels: Default::default(),
|
||||
_count: Default::default(),
|
||||
_aggregator: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Put data points to one or more time series for one or more metrics. If a time series does not exist, a new time series will be created. It is not allowed to write a time series point that is older than the existing youngest point of that time series. Points that are older than the existing youngest point of that time series will be discarded silently. Therefore, users should make sure that points of a time series are written sequentially in the order of their end time.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `project` - The project ID. The value can be the numeric project ID or string-based project name.
|
||||
pub fn write(&self, request: WriteTimeseriesRequest, project: &str) -> TimeseryWriteCall<'a, S> {
|
||||
TimeseryWriteCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_project: project.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *timeseriesDescriptor* resources.
|
||||
/// It is not used directly, but through the [`CloudMonitoring`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudmonitoring2_beta2 as cloudmonitoring2_beta2;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudmonitoring2_beta2::{CloudMonitoring, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
///
|
||||
/// let secret: oauth2::ApplicationSecret = Default::default();
|
||||
/// let auth = oauth2::InstalledFlowAuthenticator::builder(
|
||||
/// secret,
|
||||
/// oauth2::InstalledFlowReturnMethod::HTTPRedirect,
|
||||
/// ).build().await.unwrap();
|
||||
/// let mut hub = CloudMonitoring::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.timeseries_descriptors();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct TimeseriesDescriptorMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a CloudMonitoring<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for TimeseriesDescriptorMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> TimeseriesDescriptorMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// List the descriptors of the time series that match the metric and labels values and that have data points in the interval. Large responses are paginated; use the nextPageToken returned in the response to request subsequent pages of results by setting the pageToken query parameter to the value of the nextPageToken.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `project` - The project ID to which this time series belongs. The value can be the numeric project ID or string-based project name.
|
||||
/// * `metric` - Metric names are protocol-free URLs as listed in the Supported Metrics page. For example, compute.googleapis.com/instance/disk/read_ops_count.
|
||||
/// * `youngest` - End of the time interval (inclusive), which is expressed as an RFC 3339 timestamp.
|
||||
pub fn list(&self, request: ListTimeseriesDescriptorsRequest, project: &str, metric: &str, youngest: &str) -> TimeseriesDescriptorListCall<'a, S> {
|
||||
TimeseriesDescriptorListCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_project: project.to_string(),
|
||||
_metric: metric.to_string(),
|
||||
_youngest: youngest.to_string(),
|
||||
_window: Default::default(),
|
||||
_timespan: Default::default(),
|
||||
_page_token: Default::default(),
|
||||
_oldest: Default::default(),
|
||||
_labels: Default::default(),
|
||||
_count: Default::default(),
|
||||
_aggregator: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
32
gen/cloudmonitoring2_beta2/src/api/mod.rs
Normal file
32
gen/cloudmonitoring2_beta2/src/api/mod.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::default::Default;
|
||||
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 hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::time::sleep;
|
||||
use tower_service;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::{client, client::GetToken, client::serde_with};
|
||||
|
||||
mod utilities;
|
||||
pub use utilities::*;
|
||||
|
||||
mod hub;
|
||||
pub use hub::*;
|
||||
|
||||
mod schemas;
|
||||
pub use schemas::*;
|
||||
|
||||
mod method_builders;
|
||||
pub use method_builders::*;
|
||||
|
||||
mod call_builders;
|
||||
pub use call_builders::*;
|
||||
472
gen/cloudmonitoring2_beta2/src/api/schemas.rs
Normal file
472
gen/cloudmonitoring2_beta2/src/api/schemas.rs
Normal file
@@ -0,0 +1,472 @@
|
||||
use super::*;
|
||||
/// The response of cloudmonitoring.metricDescriptors.delete.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [delete metric descriptors](MetricDescriptorDeleteCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct DeleteMetricDescriptorResponse {
|
||||
/// Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#deleteMetricDescriptorResponse".
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for DeleteMetricDescriptorResponse {}
|
||||
|
||||
|
||||
/// The request of cloudmonitoring.metricDescriptors.list.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list metric descriptors](MetricDescriptorListCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListMetricDescriptorsRequest {
|
||||
/// Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listMetricDescriptorsRequest".
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for ListMetricDescriptorsRequest {}
|
||||
|
||||
|
||||
/// The response of cloudmonitoring.metricDescriptors.list.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list metric descriptors](MetricDescriptorListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListMetricDescriptorsResponse {
|
||||
/// Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listMetricDescriptorsResponse".
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// The returned metric descriptors.
|
||||
|
||||
pub metrics: Option<Vec<MetricDescriptor>>,
|
||||
/// Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, pass this value to the pageToken query parameter.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListMetricDescriptorsResponse {}
|
||||
|
||||
|
||||
/// The request of cloudmonitoring.timeseriesDescriptors.list
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list timeseries descriptors](TimeseriesDescriptorListCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListTimeseriesDescriptorsRequest {
|
||||
/// Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesDescriptorsRequest".
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for ListTimeseriesDescriptorsRequest {}
|
||||
|
||||
|
||||
/// The response of cloudmonitoring.timeseriesDescriptors.list
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list timeseries descriptors](TimeseriesDescriptorListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListTimeseriesDescriptorsResponse {
|
||||
/// Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesDescriptorsResponse".
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set this value to the pageToken query parameter.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
/// The oldest timestamp of the interval of this query, as an RFC 3339 string.
|
||||
|
||||
pub oldest: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// The returned time series descriptors.
|
||||
|
||||
pub timeseries: Option<Vec<TimeseriesDescriptor>>,
|
||||
/// The youngest timestamp of the interval of this query, as an RFC 3339 string.
|
||||
|
||||
pub youngest: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListTimeseriesDescriptorsResponse {}
|
||||
|
||||
|
||||
/// The request of cloudmonitoring.timeseries.list
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list timeseries](TimeseryListCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListTimeseriesRequest {
|
||||
/// Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesRequest".
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for ListTimeseriesRequest {}
|
||||
|
||||
|
||||
/// The response of cloudmonitoring.timeseries.list
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list timeseries](TimeseryListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListTimeseriesResponse {
|
||||
/// Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#listTimeseriesResponse".
|
||||
|
||||
pub kind: Option<String>,
|
||||
/// Pagination token. If present, indicates that additional results are available for retrieval. To access the results past the pagination limit, set the pageToken query parameter to this value. All of the points of a time series will be returned before returning any point of the subsequent time series.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
/// The oldest timestamp of the interval of this query as an RFC 3339 string.
|
||||
|
||||
pub oldest: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// The returned time series.
|
||||
|
||||
pub timeseries: Option<Vec<Timeseries>>,
|
||||
/// The youngest timestamp of the interval of this query as an RFC 3339 string.
|
||||
|
||||
pub youngest: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListTimeseriesResponse {}
|
||||
|
||||
|
||||
/// A metricDescriptor defines the name, label keys, and data type of a particular metric.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [create metric descriptors](MetricDescriptorCreateCall) (request|response)
|
||||
/// * [delete metric descriptors](MetricDescriptorDeleteCall) (none)
|
||||
/// * [list metric descriptors](MetricDescriptorListCall) (none)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct MetricDescriptor {
|
||||
/// Description of this metric.
|
||||
|
||||
pub description: Option<String>,
|
||||
/// Labels defined for this metric.
|
||||
|
||||
pub labels: Option<Vec<MetricDescriptorLabelDescriptor>>,
|
||||
/// The name of this metric.
|
||||
|
||||
pub name: Option<String>,
|
||||
/// The project ID to which the metric belongs.
|
||||
|
||||
pub project: Option<String>,
|
||||
/// Type description for this metric.
|
||||
#[serde(rename="typeDescriptor")]
|
||||
|
||||
pub type_descriptor: Option<MetricDescriptorTypeDescriptor>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for MetricDescriptor {}
|
||||
impl client::Resource for MetricDescriptor {}
|
||||
impl client::ResponseResult for MetricDescriptor {}
|
||||
|
||||
|
||||
/// A label in a metric is a description of this metric, including the key of this description (what the description is), and the value for this description.
|
||||
///
|
||||
/// 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 MetricDescriptorLabelDescriptor {
|
||||
/// Label description.
|
||||
|
||||
pub description: Option<String>,
|
||||
/// Label key.
|
||||
|
||||
pub key: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for MetricDescriptorLabelDescriptor {}
|
||||
|
||||
|
||||
/// A type in a metric contains information about how the metric is collected and what its data points look like.
|
||||
///
|
||||
/// 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 MetricDescriptorTypeDescriptor {
|
||||
/// The method of collecting data for the metric. See Metric types.
|
||||
#[serde(rename="metricType")]
|
||||
|
||||
pub metric_type: Option<String>,
|
||||
/// The data type of of individual points in the metric's time series. See Metric value types.
|
||||
#[serde(rename="valueType")]
|
||||
|
||||
pub value_type: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for MetricDescriptorTypeDescriptor {}
|
||||
|
||||
|
||||
/// Point is a single point in a time series. It consists of a start time, an end time, and a value.
|
||||
///
|
||||
/// 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 Point {
|
||||
/// The value of this data point. Either "true" or "false".
|
||||
#[serde(rename="boolValue")]
|
||||
|
||||
pub bool_value: Option<bool>,
|
||||
/// The value of this data point as a distribution. A distribution value can contain a list of buckets and/or an underflowBucket and an overflowBucket. The values of these points can be used to create a histogram.
|
||||
#[serde(rename="distributionValue")]
|
||||
|
||||
pub distribution_value: Option<PointDistribution>,
|
||||
/// The value of this data point as a double-precision floating-point number.
|
||||
#[serde(rename="doubleValue")]
|
||||
|
||||
pub double_value: Option<f64>,
|
||||
/// The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings.
|
||||
|
||||
pub end: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// The value of this data point as a 64-bit integer.
|
||||
#[serde(rename="int64Value")]
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub int64_value: Option<i64>,
|
||||
/// The interval [start, end] is the time period to which the point's value applies. For gauge metrics, whose values are instantaneous measurements, this interval should be empty (start should equal end). For cumulative metrics (of which deltas and rates are special cases), the interval should be non-empty. Both start and end are RFC 3339 strings.
|
||||
|
||||
pub start: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// The value of this data point in string format.
|
||||
#[serde(rename="stringValue")]
|
||||
|
||||
pub string_value: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for Point {}
|
||||
|
||||
|
||||
/// Distribution data point value type. When writing distribution points, try to be consistent with the boundaries of your buckets. If you must modify the bucket boundaries, then do so by merging, partitioning, or appending rather than skewing them.
|
||||
///
|
||||
/// 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 PointDistribution {
|
||||
/// The finite buckets.
|
||||
|
||||
pub buckets: Option<Vec<PointDistributionBucket>>,
|
||||
/// The overflow bucket.
|
||||
#[serde(rename="overflowBucket")]
|
||||
|
||||
pub overflow_bucket: Option<PointDistributionOverflowBucket>,
|
||||
/// The underflow bucket.
|
||||
#[serde(rename="underflowBucket")]
|
||||
|
||||
pub underflow_bucket: Option<PointDistributionUnderflowBucket>,
|
||||
}
|
||||
|
||||
impl client::Part for PointDistribution {}
|
||||
|
||||
|
||||
/// The histogram's bucket. Buckets that form the histogram of a distribution value. If the upper bound of a bucket, say U1, does not equal the lower bound of the next bucket, say L2, this means that there is no event in [U1, L2).
|
||||
///
|
||||
/// 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 PointDistributionBucket {
|
||||
/// The number of events whose values are in the interval defined by this bucket.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub count: Option<i64>,
|
||||
/// The lower bound of the value interval of this bucket (inclusive).
|
||||
#[serde(rename="lowerBound")]
|
||||
|
||||
pub lower_bound: Option<f64>,
|
||||
/// The upper bound of the value interval of this bucket (exclusive).
|
||||
#[serde(rename="upperBound")]
|
||||
|
||||
pub upper_bound: Option<f64>,
|
||||
}
|
||||
|
||||
impl client::Part for PointDistributionBucket {}
|
||||
|
||||
|
||||
/// The overflow bucket is a special bucket that does not have the upperBound field; it includes all of the events that are no less than its lower bound.
|
||||
///
|
||||
/// 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 PointDistributionOverflowBucket {
|
||||
/// The number of events whose values are in the interval defined by this bucket.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub count: Option<i64>,
|
||||
/// The lower bound of the value interval of this bucket (inclusive).
|
||||
#[serde(rename="lowerBound")]
|
||||
|
||||
pub lower_bound: Option<f64>,
|
||||
}
|
||||
|
||||
impl client::Part for PointDistributionOverflowBucket {}
|
||||
|
||||
|
||||
/// The underflow bucket is a special bucket that does not have the lowerBound field; it includes all of the events that are less than its upper bound.
|
||||
///
|
||||
/// 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 PointDistributionUnderflowBucket {
|
||||
/// The number of events whose values are in the interval defined by this bucket.
|
||||
|
||||
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
|
||||
pub count: Option<i64>,
|
||||
/// The upper bound of the value interval of this bucket (exclusive).
|
||||
#[serde(rename="upperBound")]
|
||||
|
||||
pub upper_bound: Option<f64>,
|
||||
}
|
||||
|
||||
impl client::Part for PointDistributionUnderflowBucket {}
|
||||
|
||||
|
||||
/// The monitoring data is organized as metrics and stored as data points that are recorded over time. Each data point represents information like the CPU utilization of your virtual machine. A historical record of these data points is called a time series.
|
||||
///
|
||||
/// 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 Timeseries {
|
||||
/// The data points of this time series. The points are listed in order of their end timestamp, from younger to older.
|
||||
|
||||
pub points: Option<Vec<Point>>,
|
||||
/// The descriptor of this time series.
|
||||
#[serde(rename="timeseriesDesc")]
|
||||
|
||||
pub timeseries_desc: Option<TimeseriesDescriptor>,
|
||||
}
|
||||
|
||||
impl client::Part for Timeseries {}
|
||||
|
||||
|
||||
/// TimeseriesDescriptor identifies a single time series.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list timeseries descriptors](TimeseriesDescriptorListCall) (none)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct TimeseriesDescriptor {
|
||||
/// The label's name.
|
||||
|
||||
pub labels: Option<HashMap<String, String>>,
|
||||
/// The name of the metric.
|
||||
|
||||
pub metric: Option<String>,
|
||||
/// The Developers Console project number to which this time series belongs.
|
||||
|
||||
pub project: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Resource for TimeseriesDescriptor {}
|
||||
|
||||
|
||||
/// When writing time series, TimeseriesPoint should be used instead of Timeseries, to enforce single point for each time series in the timeseries.write request.
|
||||
///
|
||||
/// 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 TimeseriesPoint {
|
||||
/// The data point in this time series snapshot.
|
||||
|
||||
pub point: Option<Point>,
|
||||
/// The descriptor of this time series.
|
||||
#[serde(rename="timeseriesDesc")]
|
||||
|
||||
pub timeseries_desc: Option<TimeseriesDescriptor>,
|
||||
}
|
||||
|
||||
impl client::Part for TimeseriesPoint {}
|
||||
|
||||
|
||||
/// The request of cloudmonitoring.timeseries.write
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [write timeseries](TimeseryWriteCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct WriteTimeseriesRequest {
|
||||
/// The label's name.
|
||||
#[serde(rename="commonLabels")]
|
||||
|
||||
pub common_labels: Option<HashMap<String, String>>,
|
||||
/// Provide time series specific labels and the data points for each time series. The labels in timeseries and the common_labels should form a complete list of labels that required by the metric.
|
||||
|
||||
pub timeseries: Option<Vec<TimeseriesPoint>>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for WriteTimeseriesRequest {}
|
||||
|
||||
|
||||
/// The response of cloudmonitoring.timeseries.write
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [write timeseries](TimeseryWriteCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct WriteTimeseriesResponse {
|
||||
/// Identifies what kind of resource this is. Value: the fixed string "cloudmonitoring#writeTimeseriesResponse".
|
||||
|
||||
pub kind: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for WriteTimeseriesResponse {}
|
||||
|
||||
|
||||
28
gen/cloudmonitoring2_beta2/src/api/utilities.rs
Normal file
28
gen/cloudmonitoring2_beta2/src/api/utilities.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use super::*;
|
||||
/// Identifies the an OAuth2 authorization scope.
|
||||
/// A scope is needed when requesting an
|
||||
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
|
||||
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
|
||||
pub enum Scope {
|
||||
/// View and manage your data across Google Cloud Platform services
|
||||
CloudPlatform,
|
||||
|
||||
/// View and write monitoring data for all of your Google and third-party Cloud and API projects
|
||||
Monitoring,
|
||||
}
|
||||
|
||||
impl AsRef<str> for Scope {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
|
||||
Scope::Monitoring => "https://www.googleapis.com/auth/monitoring",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Scope {
|
||||
fn default() -> Scope {
|
||||
Scope::Monitoring
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user