remove generated libs

This commit is contained in:
OMGeeky
2024-05-12 22:15:06 +02:00
4862 changed files with 0 additions and 6416267 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,121 +0,0 @@
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)
}
}

View File

@@ -1,263 +0,0 @@
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(),
}
}
}

View File

@@ -1,35 +0,0 @@
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::*;
mod enums;
pub use enums::*;

View File

@@ -1,472 +0,0 @@
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 {}

View File

@@ -1,28 +0,0 @@
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
}
}

View File

@@ -1,212 +0,0 @@
// DO NOT EDIT !
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
// DO NOT EDIT !
//! This documentation was generated from *Cloud Monitoring* crate version *5.0.4+20170501*, where *20170501* is the exact revision of the *cloudmonitoring:v2beta2* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
//!
//! Everything else about the *Cloud Monitoring* *v2_beta2* API can be found at the
//! [official documentation site](https://cloud.google.com/monitoring/v2beta2/).
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/cloudmonitoring2_beta2).
//! # Features
//!
//! Handle the following *Resources* with ease from the central [hub](CloudMonitoring) ...
//!
//! * [metric descriptors](api::MetricDescriptor)
//! * [*create*](api::MetricDescriptorCreateCall), [*delete*](api::MetricDescriptorDeleteCall) and [*list*](api::MetricDescriptorListCall)
//! * timeseries
//! * [*list*](api::TimeseryListCall) and [*write*](api::TimeseryWriteCall)
//! * [timeseries descriptors](api::TimeseriesDescriptor)
//! * [*list*](api::TimeseriesDescriptorListCall)
//!
//!
//!
//!
//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
//!
//! # Structure of this Library
//!
//! The API is structured into the following primary items:
//!
//! * **[Hub](CloudMonitoring)**
//! * a central object to maintain state and allow accessing all *Activities*
//! * creates [*Method Builders*](client::MethodsBuilder) which in turn
//! allow access to individual [*Call Builders*](client::CallBuilder)
//! * **[Resources](client::Resource)**
//! * primary types that you can apply *Activities* to
//! * a collection of properties and *Parts*
//! * **[Parts](client::Part)**
//! * a collection of properties
//! * never directly used in *Activities*
//! * **[Activities](client::CallBuilder)**
//! * operations to apply to *Resources*
//!
//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
//!
//! Generally speaking, you can invoke *Activities* like this:
//!
//! ```Rust,ignore
//! let r = hub.resource().activity(...).doit().await
//! ```
//!
//! Or specifically ...
//!
//! ```ignore
//! let r = hub.metric_descriptors().create(...).doit().await
//! let r = hub.metric_descriptors().delete(...).doit().await
//! let r = hub.metric_descriptors().list(...).doit().await
//! ```
//!
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
//! The `doit()` method performs the actual communication with the server and returns the respective result.
//!
//! # Usage
//!
//! ## Setting up your Project
//!
//! To use this library, you would put the following lines into your `Cargo.toml` file:
//!
//! ```toml
//! [dependencies]
//! google-cloudmonitoring2_beta2 = "*"
//! serde = "^1.0"
//! serde_json = "^1.0"
//! ```
//!
//! ## A complete example
//!
//! ```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("At")
//! .page_token("sanctus")
//! .count(-80)
//! .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),
//! }
//! # }
//! ```
//! ## Handling Errors
//!
//! All errors produced by the system are provided either as [Result](client::Result) enumeration as return value of
//! the doit() methods, or handed as possibly intermediate results to either the
//! [Hub Delegate](client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
//!
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
//! makes the system potentially resilient to all kinds of errors.
//!
//! ## Uploads and Downloads
//! If a method supports downloads, the response body, which is part of the [Result](client::Result), should be
//! read by you to obtain the media.
//! If such a method also supports a [Response Result](client::ResponseResult), it will return that by default.
//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
//! this call: `.param("alt", "media")`.
//!
//! Methods supporting uploads can do so using up to 2 different protocols:
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
//!
//! ## Customization and Callbacks
//!
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
//! Respective methods will be called to provide progress information, as well as determine whether the system should
//! retry on failure.
//!
//! The [delegate trait](client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
//!
//! ## Optional Parts in Server-Requests
//!
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
//! are valid.
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
//! the server to indicate either the set parts of the request or the desired parts in the response.
//!
//! ## Builder Arguments
//!
//! Using [method builders](client::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
//! These will always take a single argument, for which the following statements are true.
//!
//! * [PODs][wiki-pod] are handed by copy
//! * strings are passed as `&str`
//! * [request values](client::RequestValue) are moved
//!
//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
//!
//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
//! [google-go-api]: https://github.com/google/google-api-go-client
//!
//!
// Unused attributes happen thanks to defined, but unused structures
// We don't warn about this, as depending on the API, some data structures or facilities are never used.
// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any
// unused imports in fully featured APIs. Same with unused_mut ... .
#![allow(unused_imports, unused_mut, dead_code)]
// DO NOT EDIT !
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
// DO NOT EDIT !
// Re-export the hyper and hyper_rustls crate, they are required to build the hub
pub use hyper;
pub use hyper_rustls;
pub extern crate google_apis_common as client;
pub use client::chrono;
pub mod api;
// Re-export the hub type and some basic client structs
pub use api::CloudMonitoring;
pub use client::{Result, Error, Delegate, FieldMask};
// Re-export the yup_oauth2 crate, that is required to call some methods of the hub and the client
#[cfg(feature = "yup-oauth2")]
pub use client::oauth2;