make regen-apis

This commit is contained in:
OMGeeky
2023-10-21 23:50:27 +02:00
parent b09392b768
commit ec6083f22f
1959 changed files with 911619 additions and 913545 deletions

View File

@@ -1,374 +1,4 @@
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};
// ##############
// UTILITIES ###
// ############
/// 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)]
pub enum Scope {
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
CloudPlatform,
/// View and write monitoring data for all of your Google and third-party Cloud and API projects
Monitoring,
/// Publish metric data to your Google Cloud projects
MonitoringWrite,
}
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",
Scope::MonitoringWrite => "https://www.googleapis.com/auth/monitoring.write",
}
}
}
impl Default for Scope {
fn default() -> Scope {
Scope::Monitoring
}
}
// ########
// HUB ###
// ######
/// Central instance to access all CloudProfiler related resource activities
///
/// # Examples
///
/// Instantiate a new hub
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_cloudprofiler2 as cloudprofiler2;
/// use cloudprofiler2::api::Profile;
/// use cloudprofiler2::{Result, Error};
/// # async fn dox() {
/// use std::default::Default;
/// use cloudprofiler2::{CloudProfiler, 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 = CloudProfiler::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 = Profile::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.projects().profiles_patch(req, "name")
/// .update_mask(&Default::default())
/// .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 CloudProfiler<S> {
pub client: hyper::Client<S, hyper::body::Body>,
pub auth: Box<dyn client::GetToken>,
_user_agent: String,
_base_url: String,
_root_url: String,
}
impl<'a, S> client::Hub for CloudProfiler<S> {}
impl<'a, S> CloudProfiler<S> {
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> CloudProfiler<S> {
CloudProfiler {
client,
auth: Box::new(auth),
_user_agent: "google-api-rust-client/5.0.3".to_string(),
_base_url: "https://cloudprofiler.googleapis.com/".to_string(),
_root_url: "https://cloudprofiler.googleapis.com/".to_string(),
}
}
pub fn projects(&'a self) -> ProjectMethods<'a, S> {
ProjectMethods { 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://cloudprofiler.googleapis.com/`.
///
/// 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://cloudprofiler.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)
}
}
// ############
// SCHEMAS ###
// ##########
/// CreateProfileRequest describes a profile resource online creation request. The deployment field must be populated. The profile_type specifies the list of profile types supported by the agent. The creation call will hang until a profile of one of these types needs to be collected.
///
/// # 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*).
///
/// * [profiles create projects](ProjectProfileCreateCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CreateProfileRequest {
/// Required. Deployment details.
pub deployment: Option<Deployment>,
/// Required. One or more profile types that the agent is capable of providing.
#[serde(rename="profileType")]
pub profile_type: Option<Vec<String>>,
}
impl client::RequestValue for CreateProfileRequest {}
/// Deployment contains the deployment identification information.
///
/// 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 Deployment {
/// Labels identify the deployment within the user universe and same target. Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Value for an individual label must be \<= 512 bytes, the total size of all label names and values must be \<= 1024 bytes. Label named “language” can be used to record the programming language of the profiled deployment. The standard choices for the value include “java”, “go”, “python”, “ruby”, “nodejs”, “php”, “dotnet”. For deployments running on Google Cloud Platform, “zone” or “region” label should be present describing the deployment location. An example of a zone is “us-central1-a”, an example of a region is “us-central1” or “us-central”.
pub labels: Option<HashMap<String, String>>,
/// Project ID is the ID of a cloud project. Validation regex: `^a-z{4,61}[a-z0-9]$`.
#[serde(rename="projectId")]
pub project_id: Option<String>,
/// Target is the service name used to group related deployments: * Service name for App Engine Flex / Standard. * Cluster and container name for GKE. * User-specified string for direct Compute Engine profiling (e.g. Java). * Job name for Dataflow. Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`.
pub target: Option<String>,
}
impl client::Part for Deployment {}
/// Profile resource.
///
/// # 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*).
///
/// * [profiles create projects](ProjectProfileCreateCall) (response)
/// * [profiles create offline projects](ProjectProfileCreateOfflineCall) (request|response)
/// * [profiles patch projects](ProjectProfilePatchCall) (request|response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Profile {
/// Deployment this profile corresponds to.
pub deployment: Option<Deployment>,
/// Duration of the profiling session. Input (for the offline mode) or output (for the online mode). The field represents requested profiling duration. It may slightly differ from the effective profiling duration, which is recorded in the profile data, in case the profiling can't be stopped immediately (e.g. in case stopping the profiling is handled asynchronously).
#[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
pub duration: Option<client::chrono::Duration>,
/// Input only. Labels associated to this specific profile. These labels will get merged with the deployment labels for the final data set. See documentation on deployment labels for validation rules and limits.
pub labels: Option<HashMap<String, String>>,
/// Output only. Opaque, server-assigned, unique ID for this profile.
pub name: Option<String>,
/// Input only. Profile bytes, as a gzip compressed serialized proto, the format is https://github.com/google/pprof/blob/master/proto/profile.proto.
#[serde(rename="profileBytes")]
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub profile_bytes: Option<Vec<u8>>,
/// Type of profile. For offline mode, this must be specified when creating the profile. For online mode it is assigned and returned by the server.
#[serde(rename="profileType")]
pub profile_type: Option<String>,
}
impl client::RequestValue for Profile {}
impl client::ResponseResult for Profile {}
// ###################
// MethodBuilders ###
// #################
/// A builder providing access to all methods supported on *project* resources.
/// It is not used directly, but through the [`CloudProfiler`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_cloudprofiler2 as cloudprofiler2;
///
/// # async fn dox() {
/// use std::default::Default;
/// use cloudprofiler2::{CloudProfiler, 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 = CloudProfiler::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 `profiles_create(...)`, `profiles_create_offline(...)` and `profiles_patch(...)`
/// // to build up your call.
/// let rb = hub.projects();
/// # }
/// ```
pub struct ProjectMethods<'a, S>
where S: 'a {
hub: &'a CloudProfiler<S>,
}
impl<'a, S> client::MethodsBuilder for ProjectMethods<'a, S> {}
impl<'a, S> ProjectMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// CreateProfile creates a new profile resource in the online mode. The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin".
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Parent project to create the profile in.
pub fn profiles_create(&self, request: CreateProfileRequest, parent: &str) -> ProjectProfileCreateCall<'a, S> {
ProjectProfileCreateCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Parent project to create the profile in.
pub fn profiles_create_offline(&self, request: Profile, parent: &str) -> ProjectProfileCreateOfflineCall<'a, S> {
ProjectProfileCreateOfflineCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Output only. Opaque, server-assigned, unique ID for this profile.
pub fn profiles_patch(&self, request: Profile, name: &str) -> ProjectProfilePatchCall<'a, S> {
ProjectProfilePatchCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_update_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}
// ###################
// CallBuilders ###
// #################
use super::*;
/// CreateProfile creates a new profile resource in the online mode. The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin".
///
/// A builder for the *profiles.create* method supported by a *project* resource.
@@ -408,12 +38,12 @@ impl<'a, S> ProjectMethods<'a, S> {
pub struct ProjectProfileCreateCall<'a, S>
where S: 'a {
hub: &'a CloudProfiler<S>,
_request: CreateProfileRequest,
_parent: String,
_delegate: Option<&'a mut dyn client::Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeSet<String>
pub(super) hub: &'a CloudProfiler<S>,
pub(super) _request: CreateProfileRequest,
pub(super) _parent: String,
pub(super) _delegate: Option<&'a mut dyn client::Delegate>,
pub(super) _additional_params: HashMap<String, String>,
pub(super) _scopes: BTreeSet<String>
}
impl<'a, S> client::CallBuilder for ProjectProfileCreateCall<'a, S> {}
@@ -700,12 +330,12 @@ where
pub struct ProjectProfileCreateOfflineCall<'a, S>
where S: 'a {
hub: &'a CloudProfiler<S>,
_request: Profile,
_parent: String,
_delegate: Option<&'a mut dyn client::Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeSet<String>
pub(super) hub: &'a CloudProfiler<S>,
pub(super) _request: Profile,
pub(super) _parent: String,
pub(super) _delegate: Option<&'a mut dyn client::Delegate>,
pub(super) _additional_params: HashMap<String, String>,
pub(super) _scopes: BTreeSet<String>
}
impl<'a, S> client::CallBuilder for ProjectProfileCreateOfflineCall<'a, S> {}
@@ -993,13 +623,13 @@ where
pub struct ProjectProfilePatchCall<'a, S>
where S: 'a {
hub: &'a CloudProfiler<S>,
_request: Profile,
_name: String,
_update_mask: Option<client::FieldMask>,
_delegate: Option<&'a mut dyn client::Delegate>,
_additional_params: HashMap<String, String>,
_scopes: BTreeSet<String>
pub(super) hub: &'a CloudProfiler<S>,
pub(super) _request: Profile,
pub(super) _name: String,
pub(super) _update_mask: Option<client::FieldMask>,
pub(super) _delegate: Option<&'a mut dyn client::Delegate>,
pub(super) _additional_params: HashMap<String, String>,
pub(super) _scopes: BTreeSet<String>
}
impl<'a, S> client::CallBuilder for ProjectProfilePatchCall<'a, S> {}

View File

@@ -0,0 +1,113 @@
use super::*;
/// Central instance to access all CloudProfiler related resource activities
///
/// # Examples
///
/// Instantiate a new hub
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_cloudprofiler2 as cloudprofiler2;
/// use cloudprofiler2::api::Profile;
/// use cloudprofiler2::{Result, Error};
/// # async fn dox() {
/// use std::default::Default;
/// use cloudprofiler2::{CloudProfiler, 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 = CloudProfiler::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 = Profile::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.projects().profiles_patch(req, "name")
/// .update_mask(&Default::default())
/// .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 CloudProfiler<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 CloudProfiler<S> {}
impl<'a, S> CloudProfiler<S> {
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> CloudProfiler<S> {
CloudProfiler {
client,
auth: Box::new(auth),
_user_agent: "google-api-rust-client/5.0.3".to_string(),
_base_url: "https://cloudprofiler.googleapis.com/".to_string(),
_root_url: "https://cloudprofiler.googleapis.com/".to_string(),
}
}
pub fn projects(&'a self) -> ProjectMethods<'a, S> {
ProjectMethods { 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://cloudprofiler.googleapis.com/`.
///
/// 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://cloudprofiler.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

@@ -0,0 +1,100 @@
use super::*;
/// A builder providing access to all methods supported on *project* resources.
/// It is not used directly, but through the [`CloudProfiler`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_cloudprofiler2 as cloudprofiler2;
///
/// # async fn dox() {
/// use std::default::Default;
/// use cloudprofiler2::{CloudProfiler, 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 = CloudProfiler::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 `profiles_create(...)`, `profiles_create_offline(...)` and `profiles_patch(...)`
/// // to build up your call.
/// let rb = hub.projects();
/// # }
/// ```
pub struct ProjectMethods<'a, S>
where S: 'a {
pub(super) hub: &'a CloudProfiler<S>,
}
impl<'a, S> client::MethodsBuilder for ProjectMethods<'a, S> {}
impl<'a, S> ProjectMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// CreateProfile creates a new profile resource in the online mode. The server ensures that the new profiles are created at a constant rate per deployment, so the creation request may hang for some time until the next profile session is available. The request may fail with ABORTED error if the creation is not available within ~1m, the response will indicate the duration of the backoff the client should take before attempting creating a profile again. The backoff duration is returned in google.rpc.RetryInfo extension on the response status. To a gRPC client, the extension will be return as a binary-serialized proto in the trailing metadata item named "google.rpc.retryinfo-bin".
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Parent project to create the profile in.
pub fn profiles_create(&self, request: CreateProfileRequest, parent: &str) -> ProjectProfileCreateCall<'a, S> {
ProjectProfileCreateCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// CreateOfflineProfile creates a new profile resource in the offline mode. The client provides the profile to create along with the profile bytes, the server records it.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Parent project to create the profile in.
pub fn profiles_create_offline(&self, request: Profile, parent: &str) -> ProjectProfileCreateOfflineCall<'a, S> {
ProjectProfileCreateOfflineCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// UpdateProfile updates the profile bytes and labels on the profile resource created in the online mode. Updating the bytes for profiles created in the offline mode is currently not supported: the profile content must be provided at the time of the profile creation.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Output only. Opaque, server-assigned, unique ID for this profile.
pub fn profiles_patch(&self, request: Profile, name: &str) -> ProjectProfilePatchCall<'a, S> {
ProjectProfilePatchCall {
hub: self.hub,
_request: request,
_name: name.to_string(),
_update_mask: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}

View 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::*;

View File

@@ -0,0 +1,87 @@
use super::*;
/// CreateProfileRequest describes a profile resource online creation request. The deployment field must be populated. The profile_type specifies the list of profile types supported by the agent. The creation call will hang until a profile of one of these types needs to be collected.
///
/// # 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*).
///
/// * [profiles create projects](ProjectProfileCreateCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CreateProfileRequest {
/// Required. Deployment details.
pub deployment: Option<Deployment>,
/// Required. One or more profile types that the agent is capable of providing.
#[serde(rename="profileType")]
pub profile_type: Option<Vec<String>>,
}
impl client::RequestValue for CreateProfileRequest {}
/// Deployment contains the deployment identification information.
///
/// 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 Deployment {
/// Labels identify the deployment within the user universe and same target. Validation regex for label names: `^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$`. Value for an individual label must be \<= 512 bytes, the total size of all label names and values must be \<= 1024 bytes. Label named “language” can be used to record the programming language of the profiled deployment. The standard choices for the value include “java”, “go”, “python”, “ruby”, “nodejs”, “php”, “dotnet”. For deployments running on Google Cloud Platform, “zone” or “region” label should be present describing the deployment location. An example of a zone is “us-central1-a”, an example of a region is “us-central1” or “us-central”.
pub labels: Option<HashMap<String, String>>,
/// Project ID is the ID of a cloud project. Validation regex: `^a-z{4,61}[a-z0-9]$`.
#[serde(rename="projectId")]
pub project_id: Option<String>,
/// Target is the service name used to group related deployments: * Service name for App Engine Flex / Standard. * Cluster and container name for GKE. * User-specified string for direct Compute Engine profiling (e.g. Java). * Job name for Dataflow. Validation regex: `^[a-z0-9]([-a-z0-9_.]{0,253}[a-z0-9])?$`.
pub target: Option<String>,
}
impl client::Part for Deployment {}
/// Profile resource.
///
/// # 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*).
///
/// * [profiles create projects](ProjectProfileCreateCall) (response)
/// * [profiles create offline projects](ProjectProfileCreateOfflineCall) (request|response)
/// * [profiles patch projects](ProjectProfilePatchCall) (request|response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Profile {
/// Deployment this profile corresponds to.
pub deployment: Option<Deployment>,
/// Duration of the profiling session. Input (for the offline mode) or output (for the online mode). The field represents requested profiling duration. It may slightly differ from the effective profiling duration, which is recorded in the profile data, in case the profiling can't be stopped immediately (e.g. in case stopping the profiling is handled asynchronously).
#[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
pub duration: Option<client::chrono::Duration>,
/// Input only. Labels associated to this specific profile. These labels will get merged with the deployment labels for the final data set. See documentation on deployment labels for validation rules and limits.
pub labels: Option<HashMap<String, String>>,
/// Output only. Opaque, server-assigned, unique ID for this profile.
pub name: Option<String>,
/// Input only. Profile bytes, as a gzip compressed serialized proto, the format is https://github.com/google/pprof/blob/master/proto/profile.proto.
#[serde(rename="profileBytes")]
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub profile_bytes: Option<Vec<u8>>,
/// Type of profile. For offline mode, this must be specified when creating the profile. For online mode it is assigned and returned by the server.
#[serde(rename="profileType")]
pub profile_type: Option<String>,
}
impl client::RequestValue for Profile {}
impl client::ResponseResult for Profile {}

View File

@@ -0,0 +1,32 @@
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 {
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
CloudPlatform,
/// View and write monitoring data for all of your Google and third-party Cloud and API projects
Monitoring,
/// Publish metric data to your Google Cloud projects
MonitoringWrite,
}
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",
Scope::MonitoringWrite => "https://www.googleapis.com/auth/monitoring.write",
}
}
}
impl Default for Scope {
fn default() -> Scope {
Scope::Monitoring
}
}