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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,112 @@
use super::*;
/// Central instance to access all Replicapool related resource activities
///
/// # Examples
///
/// Instantiate a new hub
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_replicapool1_beta2 as replicapool1_beta2;
/// use replicapool1_beta2::{Result, Error};
/// # async fn dox() {
/// use std::default::Default;
/// use replicapool1_beta2::{Replicapool, 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 = Replicapool::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
/// // 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.instance_group_managers().list("project", "zone")
/// .page_token("ipsum")
/// .max_results(39)
/// .filter("Lorem")
/// .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 Replicapool<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 Replicapool<S> {}
impl<'a, S> Replicapool<S> {
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> Replicapool<S> {
Replicapool {
client,
auth: Box::new(auth),
_user_agent: "google-api-rust-client/5.0.3".to_string(),
_base_url: "https://www.googleapis.com/replicapool/v1beta2/projects/".to_string(),
_root_url: "https://www.googleapis.com/".to_string(),
}
}
pub fn instance_group_managers(&'a self) -> InstanceGroupManagerMethods<'a, S> {
InstanceGroupManagerMethods { hub: &self }
}
pub fn zone_operations(&'a self) -> ZoneOperationMethods<'a, S> {
ZoneOperationMethods { 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/replicapool/v1beta2/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

@@ -0,0 +1,351 @@
use super::*;
/// A builder providing access to all methods supported on *instanceGroupManager* resources.
/// It is not used directly, but through the [`Replicapool`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_replicapool1_beta2 as replicapool1_beta2;
///
/// # async fn dox() {
/// use std::default::Default;
/// use replicapool1_beta2::{Replicapool, 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 = Replicapool::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 `abandon_instances(...)`, `delete(...)`, `delete_instances(...)`, `get(...)`, `insert(...)`, `list(...)`, `recreate_instances(...)`, `resize(...)`, `set_instance_template(...)` and `set_target_pools(...)`
/// // to build up your call.
/// let rb = hub.instance_group_managers();
/// # }
/// ```
pub struct InstanceGroupManagerMethods<'a, S>
where S: 'a {
pub(super) hub: &'a Replicapool<S>,
}
impl<'a, S> client::MethodsBuilder for InstanceGroupManagerMethods<'a, S> {}
impl<'a, S> InstanceGroupManagerMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// Removes the specified instances from the managed instance group, and from any target pools of which they were members, without deleting the instances.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `instanceGroupManager` - The name of the instance group manager.
pub fn abandon_instances(&self, request: InstanceGroupManagersAbandonInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerAbandonInstanceCall<'a, S> {
InstanceGroupManagerAbandonInstanceCall {
hub: self.hub,
_request: request,
_project: project.to_string(),
_zone: zone.to_string(),
_instance_group_manager: instance_group_manager.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Deletes the instance group manager and all instances contained within. If you'd like to delete the manager without deleting the instances, you must first abandon the instances to remove them from the group.
///
/// # Arguments
///
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `instanceGroupManager` - Name of the Instance Group Manager resource to delete.
pub fn delete(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerDeleteCall<'a, S> {
InstanceGroupManagerDeleteCall {
hub: self.hub,
_project: project.to_string(),
_zone: zone.to_string(),
_instance_group_manager: instance_group_manager.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Deletes the specified instances. The instances are deleted, then removed from the instance group and any target pools of which they were a member. The targetSize of the instance group manager is reduced by the number of instances deleted.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `instanceGroupManager` - The name of the instance group manager.
pub fn delete_instances(&self, request: InstanceGroupManagersDeleteInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerDeleteInstanceCall<'a, S> {
InstanceGroupManagerDeleteInstanceCall {
hub: self.hub,
_request: request,
_project: project.to_string(),
_zone: zone.to_string(),
_instance_group_manager: instance_group_manager.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Returns the specified Instance Group Manager resource.
///
/// # Arguments
///
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `instanceGroupManager` - Name of the instance resource to return.
pub fn get(&self, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerGetCall<'a, S> {
InstanceGroupManagerGetCall {
hub: self.hub,
_project: project.to_string(),
_zone: zone.to_string(),
_instance_group_manager: instance_group_manager.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Creates an instance group manager, as well as the instance group and the specified number of instances.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `size` - Number of instances that should exist.
pub fn insert(&self, request: InstanceGroupManager, project: &str, zone: &str, size: i32) -> InstanceGroupManagerInsertCall<'a, S> {
InstanceGroupManagerInsertCall {
hub: self.hub,
_request: request,
_project: project.to_string(),
_zone: zone.to_string(),
_size: size,
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Retrieves the list of Instance Group Manager resources contained within the specified zone.
///
/// # Arguments
///
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
pub fn list(&self, project: &str, zone: &str) -> InstanceGroupManagerListCall<'a, S> {
InstanceGroupManagerListCall {
hub: self.hub,
_project: project.to_string(),
_zone: zone.to_string(),
_page_token: Default::default(),
_max_results: Default::default(),
_filter: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Recreates the specified instances. The instances are deleted, then recreated using the instance group manager's current instance template.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `instanceGroupManager` - The name of the instance group manager.
pub fn recreate_instances(&self, request: InstanceGroupManagersRecreateInstancesRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerRecreateInstanceCall<'a, S> {
InstanceGroupManagerRecreateInstanceCall {
hub: self.hub,
_request: request,
_project: project.to_string(),
_zone: zone.to_string(),
_instance_group_manager: instance_group_manager.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Resizes the managed instance group up or down. If resized up, new instances are created using the current instance template. If resized down, instances are removed in the order outlined in Resizing a managed instance group.
///
/// # Arguments
///
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `instanceGroupManager` - The name of the instance group manager.
/// * `size` - Number of instances that should exist in this Instance Group Manager.
pub fn resize(&self, project: &str, zone: &str, instance_group_manager: &str, size: i32) -> InstanceGroupManagerResizeCall<'a, S> {
InstanceGroupManagerResizeCall {
hub: self.hub,
_project: project.to_string(),
_zone: zone.to_string(),
_instance_group_manager: instance_group_manager.to_string(),
_size: size,
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Sets the instance template to use when creating new instances in this group. Existing instances are not affected.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `instanceGroupManager` - The name of the instance group manager.
pub fn set_instance_template(&self, request: InstanceGroupManagersSetInstanceTemplateRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerSetInstanceTemplateCall<'a, S> {
InstanceGroupManagerSetInstanceTemplateCall {
hub: self.hub,
_request: request,
_project: project.to_string(),
_zone: zone.to_string(),
_instance_group_manager: instance_group_manager.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Modifies the target pools to which all new instances in this group are assigned. Existing instances in the group are not affected.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `project` - The Google Developers Console project name.
/// * `zone` - The name of the zone in which the instance group manager resides.
/// * `instanceGroupManager` - The name of the instance group manager.
pub fn set_target_pools(&self, request: InstanceGroupManagersSetTargetPoolsRequest, project: &str, zone: &str, instance_group_manager: &str) -> InstanceGroupManagerSetTargetPoolCall<'a, S> {
InstanceGroupManagerSetTargetPoolCall {
hub: self.hub,
_request: request,
_project: project.to_string(),
_zone: zone.to_string(),
_instance_group_manager: instance_group_manager.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}
/// A builder providing access to all methods supported on *zoneOperation* resources.
/// It is not used directly, but through the [`Replicapool`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_replicapool1_beta2 as replicapool1_beta2;
///
/// # async fn dox() {
/// use std::default::Default;
/// use replicapool1_beta2::{Replicapool, 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 = Replicapool::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 `get(...)` and `list(...)`
/// // to build up your call.
/// let rb = hub.zone_operations();
/// # }
/// ```
pub struct ZoneOperationMethods<'a, S>
where S: 'a {
pub(super) hub: &'a Replicapool<S>,
}
impl<'a, S> client::MethodsBuilder for ZoneOperationMethods<'a, S> {}
impl<'a, S> ZoneOperationMethods<'a, S> {
/// Create a builder to help you perform the following task:
///
/// Retrieves the specified zone-specific operation resource.
///
/// # Arguments
///
/// * `project` - Name of the project scoping this request.
/// * `zone` - Name of the zone scoping this request.
/// * `operation` - Name of the operation resource to return.
pub fn get(&self, project: &str, zone: &str, operation: &str) -> ZoneOperationGetCall<'a, S> {
ZoneOperationGetCall {
hub: self.hub,
_project: project.to_string(),
_zone: zone.to_string(),
_operation: operation.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Retrieves the list of operation resources contained within the specified zone.
///
/// # Arguments
///
/// * `project` - Name of the project scoping this request.
/// * `zone` - Name of the zone scoping this request.
pub fn list(&self, project: &str, zone: &str) -> ZoneOperationListCall<'a, S> {
ZoneOperationListCall {
hub: self.hub,
_project: project.to_string(),
_zone: zone.to_string(),
_page_token: Default::default(),
_max_results: Default::default(),
_filter: 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,454 @@
use super::*;
/// An Instance Group Manager 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*).
///
/// * [abandon instances instance group managers](InstanceGroupManagerAbandonInstanceCall) (none)
/// * [delete instance group managers](InstanceGroupManagerDeleteCall) (none)
/// * [delete instances instance group managers](InstanceGroupManagerDeleteInstanceCall) (none)
/// * [get instance group managers](InstanceGroupManagerGetCall) (response)
/// * [insert instance group managers](InstanceGroupManagerInsertCall) (request)
/// * [list instance group managers](InstanceGroupManagerListCall) (none)
/// * [recreate instances instance group managers](InstanceGroupManagerRecreateInstanceCall) (none)
/// * [resize instance group managers](InstanceGroupManagerResizeCall) (none)
/// * [set instance template instance group managers](InstanceGroupManagerSetInstanceTemplateCall) (none)
/// * [set target pools instance group managers](InstanceGroupManagerSetTargetPoolCall) (none)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct InstanceGroupManager {
/// The autohealing policy for this managed instance group. You can specify only one value.
#[serde(rename="autoHealingPolicies")]
pub auto_healing_policies: Option<Vec<ReplicaPoolAutoHealingPolicy>>,
/// The base instance name to use for instances in this group. The value must be a valid RFC1035 name. Supported characters are lowercase letters, numbers, and hyphens (-). Instances are named by appending a hyphen and a random four-character string to the base instance name.
#[serde(rename="baseInstanceName")]
pub base_instance_name: Option<String>,
/// [Output only] The time the instance group manager was created, in RFC3339 text format.
#[serde(rename="creationTimestamp")]
pub creation_timestamp: Option<String>,
/// [Output only] The number of instances that currently exist and are a part of this group. This includes instances that are starting but are not yet RUNNING, and instances that are in the process of being deleted or abandoned.
#[serde(rename="currentSize")]
pub current_size: Option<i32>,
/// An optional textual description of the instance group manager.
pub description: Option<String>,
/// [Output only] Fingerprint of the instance group manager. This field is used for optimistic locking. An up-to-date fingerprint must be provided in order to modify the Instance Group Manager resource.
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub fingerprint: Option<Vec<u8>>,
/// [Output only] The full URL of the instance group created by the manager. This group contains all of the instances being managed, and cannot contain non-managed instances.
pub group: Option<String>,
/// [Output only] A server-assigned unique identifier for the resource.
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
pub id: Option<u64>,
/// The full URL to an instance template from which all new instances will be created.
#[serde(rename="instanceTemplate")]
pub instance_template: Option<String>,
/// [Output only] The resource type. Always replicapool#instanceGroupManager.
pub kind: Option<String>,
/// The name of the instance group manager. Must be 1-63 characters long and comply with RFC1035. Supported characters include lowercase letters, numbers, and hyphens.
pub name: Option<String>,
/// [Output only] The fully qualified URL for this resource.
#[serde(rename="selfLink")]
pub self_link: Option<String>,
/// The full URL of all target pools to which new instances in the group are added. Updating the target pool values does not affect existing instances.
#[serde(rename="targetPools")]
pub target_pools: Option<Vec<String>>,
/// [Output only] The number of instances that the manager is attempting to maintain. Deleting or abandoning instances affects this number, as does resizing the group.
#[serde(rename="targetSize")]
pub target_size: Option<i32>,
}
impl client::RequestValue for InstanceGroupManager {}
impl client::Resource for InstanceGroupManager {}
impl client::ResponseResult for InstanceGroupManager {}
/// There is no detailed description.
///
/// # 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 instance group managers](InstanceGroupManagerListCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct InstanceGroupManagerList {
/// Unique identifier for the resource; defined by the server (output only).
pub id: Option<String>,
/// A list of instance resources.
pub items: Option<Vec<InstanceGroupManager>>,
/// Type of resource.
pub kind: Option<String>,
/// A token used to continue a truncated list request (output only).
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
/// Server defined URL for this resource (output only).
#[serde(rename="selfLink")]
pub self_link: Option<String>,
}
impl client::ResponseResult for InstanceGroupManagerList {}
/// There is no detailed description.
///
/// # 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*).
///
/// * [abandon instances instance group managers](InstanceGroupManagerAbandonInstanceCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct InstanceGroupManagersAbandonInstancesRequest {
/// The names of one or more instances to abandon. For example:
/// { 'instances': [ 'instance-c3po', 'instance-r2d2' ] }
pub instances: Option<Vec<String>>,
}
impl client::RequestValue for InstanceGroupManagersAbandonInstancesRequest {}
/// There is no detailed description.
///
/// # 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 instances instance group managers](InstanceGroupManagerDeleteInstanceCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct InstanceGroupManagersDeleteInstancesRequest {
/// Names of instances to delete.
///
/// Example: 'instance-foo', 'instance-bar'
pub instances: Option<Vec<String>>,
}
impl client::RequestValue for InstanceGroupManagersDeleteInstancesRequest {}
/// There is no detailed description.
///
/// # 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*).
///
/// * [recreate instances instance group managers](InstanceGroupManagerRecreateInstanceCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct InstanceGroupManagersRecreateInstancesRequest {
/// The names of one or more instances to recreate. For example:
/// { 'instances': [ 'instance-c3po', 'instance-r2d2' ] }
pub instances: Option<Vec<String>>,
}
impl client::RequestValue for InstanceGroupManagersRecreateInstancesRequest {}
/// There is no detailed description.
///
/// # 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*).
///
/// * [set instance template instance group managers](InstanceGroupManagerSetInstanceTemplateCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct InstanceGroupManagersSetInstanceTemplateRequest {
/// The full URL to an Instance Template from which all new instances will be created.
#[serde(rename="instanceTemplate")]
pub instance_template: Option<String>,
}
impl client::RequestValue for InstanceGroupManagersSetInstanceTemplateRequest {}
/// There is no detailed description.
///
/// # 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*).
///
/// * [set target pools instance group managers](InstanceGroupManagerSetTargetPoolCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct InstanceGroupManagersSetTargetPoolsRequest {
/// The current fingerprint of the Instance Group Manager resource. If this does not match the server-side fingerprint of the resource, then the request will be rejected.
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub fingerprint: Option<Vec<u8>>,
/// A list of fully-qualified URLs to existing Target Pool resources. New instances in the Instance Group Manager will be added to the specified target pools; existing instances are not affected.
#[serde(rename="targetPools")]
pub target_pools: Option<Vec<String>>,
}
impl client::RequestValue for InstanceGroupManagersSetTargetPoolsRequest {}
/// An operation resource, used to manage asynchronous API requests.
///
/// # 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*).
///
/// * [abandon instances instance group managers](InstanceGroupManagerAbandonInstanceCall) (response)
/// * [delete instance group managers](InstanceGroupManagerDeleteCall) (response)
/// * [delete instances instance group managers](InstanceGroupManagerDeleteInstanceCall) (response)
/// * [insert instance group managers](InstanceGroupManagerInsertCall) (response)
/// * [recreate instances instance group managers](InstanceGroupManagerRecreateInstanceCall) (response)
/// * [resize instance group managers](InstanceGroupManagerResizeCall) (response)
/// * [set instance template instance group managers](InstanceGroupManagerSetInstanceTemplateCall) (response)
/// * [set target pools instance group managers](InstanceGroupManagerSetTargetPoolCall) (response)
/// * [get zone operations](ZoneOperationGetCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Operation {
/// [Output only] An optional identifier specified by the client when the mutation was initiated. Must be unique for all operation resources in the project.
#[serde(rename="clientOperationId")]
pub client_operation_id: Option<String>,
/// [Output Only] The time that this operation was requested, in RFC3339 text format.
#[serde(rename="creationTimestamp")]
pub creation_timestamp: Option<String>,
/// [Output Only] The time that this operation was completed, in RFC3339 text format.
#[serde(rename="endTime")]
pub end_time: Option<String>,
/// [Output Only] If errors occurred during processing of this operation, this field will be populated.
pub error: Option<OperationError>,
/// [Output only] If operation fails, the HTTP error message returned.
#[serde(rename="httpErrorMessage")]
pub http_error_message: Option<String>,
/// [Output only] If operation fails, the HTTP error status code returned.
#[serde(rename="httpErrorStatusCode")]
pub http_error_status_code: Option<i32>,
/// [Output Only] Unique identifier for the resource, generated by the server.
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
pub id: Option<u64>,
/// [Output Only] The time that this operation was requested, in RFC3339 text format.
#[serde(rename="insertTime")]
pub insert_time: Option<String>,
/// [Output only] Type of the resource.
pub kind: Option<String>,
/// [Output Only] Name of the resource.
pub name: Option<String>,
/// [Output only] Type of the operation. Operations include insert, update, and delete.
#[serde(rename="operationType")]
pub operation_type: Option<String>,
/// [Output only] An optional progress indicator that ranges from 0 to 100. There is no requirement that this be linear or support any granularity of operations. This should not be used to guess at when the operation will be complete. This number should be monotonically increasing as the operation progresses.
pub progress: Option<i32>,
/// [Output Only] URL of the region where the operation resides. Only available when performing regional operations.
pub region: Option<String>,
/// [Output Only] Server-defined fully-qualified URL for this resource.
#[serde(rename="selfLink")]
pub self_link: Option<String>,
/// [Output Only] The time that this operation was started by the server, in RFC3339 text format.
#[serde(rename="startTime")]
pub start_time: Option<String>,
/// [Output Only] Status of the operation.
pub status: Option<String>,
/// [Output Only] An optional textual description of the current status of the operation.
#[serde(rename="statusMessage")]
pub status_message: Option<String>,
/// [Output Only] Unique target ID which identifies a particular incarnation of the target.
#[serde(rename="targetId")]
#[serde_as(as = "Option<::client::serde_with::DisplayFromStr>")]
pub target_id: Option<u64>,
/// [Output only] URL of the resource the operation is mutating.
#[serde(rename="targetLink")]
pub target_link: Option<String>,
/// [Output Only] User who requested the operation, for example: user@example.com.
pub user: Option<String>,
/// [Output Only] If there are issues with this operation, a warning is returned.
pub warnings: Option<Vec<OperationWarnings>>,
/// [Output Only] URL of the zone where the operation resides. Only available when performing per-zone operations.
pub zone: Option<String>,
}
impl client::ResponseResult for Operation {}
/// There is no detailed description.
///
/// # 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 zone operations](ZoneOperationListCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct OperationList {
/// Unique identifier for the resource; defined by the server (output only).
pub id: Option<String>,
/// The operation resources.
pub items: Option<Vec<Operation>>,
/// Type of resource.
pub kind: Option<String>,
/// A token used to continue a truncated list request (output only).
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
/// Server defined URL for this resource (output only).
#[serde(rename="selfLink")]
pub self_link: Option<String>,
}
impl client::ResponseResult for OperationList {}
/// There is no detailed 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 ReplicaPoolAutoHealingPolicy {
/// The action to perform when an instance becomes unhealthy. Possible values are RECREATE or REBOOT. RECREATE replaces an unhealthy instance with a new instance that is based on the instance template for this managed instance group. REBOOT performs a soft reboot on an instance. If the instance cannot reboot, the instance performs a hard restart.
#[serde(rename="actionType")]
pub action_type: Option<String>,
/// The URL for the HealthCheck that signals autohealing.
#[serde(rename="healthCheck")]
pub health_check: Option<String>,
}
impl client::Part for ReplicaPoolAutoHealingPolicy {}
/// [Output Only] If errors occurred during processing of this operation, this field will be populated.
///
/// 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 OperationError {
/// [Output Only] The array of errors encountered while processing this operation.
pub errors: Option<Vec<OperationErrorErrors>>,
}
impl client::NestedType for OperationError {}
impl client::Part for OperationError {}
/// [Output Only] The array of errors encountered while processing this operation.
///
/// 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 OperationErrorErrors {
/// [Output Only] The error type identifier for this error.
pub code: Option<String>,
/// [Output Only] Indicates the field in the request which caused the error. This property is optional.
pub location: Option<String>,
/// [Output Only] An optional, human-readable error message.
pub message: Option<String>,
}
impl client::NestedType for OperationErrorErrors {}
impl client::Part for OperationErrorErrors {}
/// [Output Only] If there are issues with this operation, a warning is returned.
///
/// 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 OperationWarnings {
/// [Output only] The warning type identifier for this warning.
pub code: Option<String>,
/// [Output only] Metadata for this warning in key:value format.
pub data: Option<Vec<OperationWarningsData>>,
/// [Output only] Optional human-readable details for this warning.
pub message: Option<String>,
}
impl client::NestedType for OperationWarnings {}
impl client::Part for OperationWarnings {}
/// [Output only] Metadata for this warning in key:value format.
///
/// 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 OperationWarningsData {
/// [Output Only] Metadata key for this warning.
pub key: Option<String>,
/// [Output Only] Metadata value for this warning.
pub value: Option<String>,
}
impl client::NestedType for OperationWarningsData {}
impl client::Part for OperationWarningsData {}

View File

@@ -0,0 +1,36 @@
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 your data across Google Cloud Platform services
CloudPlatformReadOnly,
/// View and manage your Google Compute Engine resources
Compute,
/// View your Google Compute Engine resources
ComputeReadonly,
}
impl AsRef<str> for Scope {
fn as_ref(&self) -> &str {
match *self {
Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
Scope::CloudPlatformReadOnly => "https://www.googleapis.com/auth/cloud-platform.read-only",
Scope::Compute => "https://www.googleapis.com/auth/compute",
Scope::ComputeReadonly => "https://www.googleapis.com/auth/compute.readonly",
}
}
}
impl Default for Scope {
fn default() -> Scope {
Scope::ComputeReadonly
}
}