mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
make regen-apis
This commit is contained in:
File diff suppressed because it is too large
Load Diff
317
gen/cloudresourcemanager1/src/api/enums.rs
Normal file
317
gen/cloudresourcemanager1/src/api/enums.rs
Normal file
@@ -0,0 +1,317 @@
|
||||
use super::*;
|
||||
|
||||
|
||||
|
||||
// region AuditLogConfigLogTypeEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// The log type that this config enables.
|
||||
pub enum AuditLogConfigLogTypeEnum {
|
||||
|
||||
|
||||
/// Default case. Should never be this.
|
||||
///
|
||||
/// "LOG_TYPE_UNSPECIFIED"
|
||||
#[serde(rename="LOG_TYPE_UNSPECIFIED")]
|
||||
LOGTYPEUNSPECIFIED,
|
||||
|
||||
|
||||
/// Admin reads. Example: CloudIAM getIamPolicy
|
||||
///
|
||||
/// "ADMIN_READ"
|
||||
#[serde(rename="ADMIN_READ")]
|
||||
ADMINREAD,
|
||||
|
||||
|
||||
/// Data writes. Example: CloudSQL Users create
|
||||
///
|
||||
/// "DATA_WRITE"
|
||||
#[serde(rename="DATA_WRITE")]
|
||||
DATAWRITE,
|
||||
|
||||
|
||||
/// Data reads. Example: CloudSQL Users list
|
||||
///
|
||||
/// "DATA_READ"
|
||||
#[serde(rename="DATA_READ")]
|
||||
DATAREAD,
|
||||
}
|
||||
|
||||
impl AsRef<str> for AuditLogConfigLogTypeEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
AuditLogConfigLogTypeEnum::LOGTYPEUNSPECIFIED => "LOG_TYPE_UNSPECIFIED",
|
||||
AuditLogConfigLogTypeEnum::ADMINREAD => "ADMIN_READ",
|
||||
AuditLogConfigLogTypeEnum::DATAWRITE => "DATA_WRITE",
|
||||
AuditLogConfigLogTypeEnum::DATAREAD => "DATA_READ",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for AuditLogConfigLogTypeEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"LOG_TYPE_UNSPECIFIED" => Ok(AuditLogConfigLogTypeEnum::LOGTYPEUNSPECIFIED),
|
||||
"ADMIN_READ" => Ok(AuditLogConfigLogTypeEnum::ADMINREAD),
|
||||
"DATA_WRITE" => Ok(AuditLogConfigLogTypeEnum::DATAWRITE),
|
||||
"DATA_READ" => Ok(AuditLogConfigLogTypeEnum::DATAREAD),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a AuditLogConfigLogTypeEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region ConstraintConstraintDefaultEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// The evaluation behavior of this constraint in the absence of 'Policy'.
|
||||
pub enum ConstraintConstraintDefaultEnum {
|
||||
|
||||
|
||||
/// This is only used for distinguishing unset values and should never be used.
|
||||
///
|
||||
/// "CONSTRAINT_DEFAULT_UNSPECIFIED"
|
||||
#[serde(rename="CONSTRAINT_DEFAULT_UNSPECIFIED")]
|
||||
CONSTRAINTDEFAULTUNSPECIFIED,
|
||||
|
||||
|
||||
/// Indicate that all values are allowed for list constraints. Indicate that enforcement is off for boolean constraints.
|
||||
///
|
||||
/// "ALLOW"
|
||||
#[serde(rename="ALLOW")]
|
||||
ALLOW,
|
||||
|
||||
|
||||
/// Indicate that all values are denied for list constraints. Indicate that enforcement is on for boolean constraints.
|
||||
///
|
||||
/// "DENY"
|
||||
#[serde(rename="DENY")]
|
||||
DENY,
|
||||
}
|
||||
|
||||
impl AsRef<str> for ConstraintConstraintDefaultEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
ConstraintConstraintDefaultEnum::CONSTRAINTDEFAULTUNSPECIFIED => "CONSTRAINT_DEFAULT_UNSPECIFIED",
|
||||
ConstraintConstraintDefaultEnum::ALLOW => "ALLOW",
|
||||
ConstraintConstraintDefaultEnum::DENY => "DENY",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for ConstraintConstraintDefaultEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"CONSTRAINT_DEFAULT_UNSPECIFIED" => Ok(ConstraintConstraintDefaultEnum::CONSTRAINTDEFAULTUNSPECIFIED),
|
||||
"ALLOW" => Ok(ConstraintConstraintDefaultEnum::ALLOW),
|
||||
"DENY" => Ok(ConstraintConstraintDefaultEnum::DENY),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ConstraintConstraintDefaultEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region ListPolicyAllValuesEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// The policy all_values state.
|
||||
pub enum ListPolicyAllValuesEnum {
|
||||
|
||||
|
||||
/// Indicates that allowed_values or denied_values must be set.
|
||||
///
|
||||
/// "ALL_VALUES_UNSPECIFIED"
|
||||
#[serde(rename="ALL_VALUES_UNSPECIFIED")]
|
||||
ALLVALUESUNSPECIFIED,
|
||||
|
||||
|
||||
/// A policy with this set allows all values.
|
||||
///
|
||||
/// "ALLOW"
|
||||
#[serde(rename="ALLOW")]
|
||||
ALLOW,
|
||||
|
||||
|
||||
/// A policy with this set denies all values.
|
||||
///
|
||||
/// "DENY"
|
||||
#[serde(rename="DENY")]
|
||||
DENY,
|
||||
}
|
||||
|
||||
impl AsRef<str> for ListPolicyAllValuesEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
ListPolicyAllValuesEnum::ALLVALUESUNSPECIFIED => "ALL_VALUES_UNSPECIFIED",
|
||||
ListPolicyAllValuesEnum::ALLOW => "ALLOW",
|
||||
ListPolicyAllValuesEnum::DENY => "DENY",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for ListPolicyAllValuesEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"ALL_VALUES_UNSPECIFIED" => Ok(ListPolicyAllValuesEnum::ALLVALUESUNSPECIFIED),
|
||||
"ALLOW" => Ok(ListPolicyAllValuesEnum::ALLOW),
|
||||
"DENY" => Ok(ListPolicyAllValuesEnum::DENY),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ListPolicyAllValuesEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region OrganizationLifecycleStateEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// The organization's current lifecycle state. Assigned by the server.
|
||||
pub enum OrganizationLifecycleStateEnum {
|
||||
|
||||
|
||||
/// Unspecified state. This is only useful for distinguishing unset values.
|
||||
///
|
||||
/// "LIFECYCLE_STATE_UNSPECIFIED"
|
||||
#[serde(rename="LIFECYCLE_STATE_UNSPECIFIED")]
|
||||
LIFECYCLESTATEUNSPECIFIED,
|
||||
|
||||
|
||||
/// The normal and active state.
|
||||
///
|
||||
/// "ACTIVE"
|
||||
#[serde(rename="ACTIVE")]
|
||||
ACTIVE,
|
||||
|
||||
|
||||
/// The organization has been marked for deletion by the user.
|
||||
///
|
||||
/// "DELETE_REQUESTED"
|
||||
#[serde(rename="DELETE_REQUESTED")]
|
||||
DELETEREQUESTED,
|
||||
}
|
||||
|
||||
impl AsRef<str> for OrganizationLifecycleStateEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
OrganizationLifecycleStateEnum::LIFECYCLESTATEUNSPECIFIED => "LIFECYCLE_STATE_UNSPECIFIED",
|
||||
OrganizationLifecycleStateEnum::ACTIVE => "ACTIVE",
|
||||
OrganizationLifecycleStateEnum::DELETEREQUESTED => "DELETE_REQUESTED",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for OrganizationLifecycleStateEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"LIFECYCLE_STATE_UNSPECIFIED" => Ok(OrganizationLifecycleStateEnum::LIFECYCLESTATEUNSPECIFIED),
|
||||
"ACTIVE" => Ok(OrganizationLifecycleStateEnum::ACTIVE),
|
||||
"DELETE_REQUESTED" => Ok(OrganizationLifecycleStateEnum::DELETEREQUESTED),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a OrganizationLifecycleStateEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
// region ProjectLifecycleStateEnum
|
||||
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
|
||||
/// The Project lifecycle state. Read-only.
|
||||
pub enum ProjectLifecycleStateEnum {
|
||||
|
||||
|
||||
/// Unspecified state. This is only used/useful for distinguishing unset values.
|
||||
///
|
||||
/// "LIFECYCLE_STATE_UNSPECIFIED"
|
||||
#[serde(rename="LIFECYCLE_STATE_UNSPECIFIED")]
|
||||
LIFECYCLESTATEUNSPECIFIED,
|
||||
|
||||
|
||||
/// The normal and active state.
|
||||
///
|
||||
/// "ACTIVE"
|
||||
#[serde(rename="ACTIVE")]
|
||||
ACTIVE,
|
||||
|
||||
|
||||
/// The project has been marked for deletion by the user (by invoking DeleteProject) or by the system (Google Cloud Platform). This can generally be reversed by invoking UndeleteProject.
|
||||
///
|
||||
/// "DELETE_REQUESTED"
|
||||
#[serde(rename="DELETE_REQUESTED")]
|
||||
DELETEREQUESTED,
|
||||
|
||||
|
||||
/// This lifecycle state is no longer used and not returned by the API.
|
||||
///
|
||||
/// "DELETE_IN_PROGRESS"
|
||||
#[serde(rename="DELETE_IN_PROGRESS")]
|
||||
DELETEINPROGRESS,
|
||||
}
|
||||
|
||||
impl AsRef<str> for ProjectLifecycleStateEnum {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
ProjectLifecycleStateEnum::LIFECYCLESTATEUNSPECIFIED => "LIFECYCLE_STATE_UNSPECIFIED",
|
||||
ProjectLifecycleStateEnum::ACTIVE => "ACTIVE",
|
||||
ProjectLifecycleStateEnum::DELETEREQUESTED => "DELETE_REQUESTED",
|
||||
ProjectLifecycleStateEnum::DELETEINPROGRESS => "DELETE_IN_PROGRESS",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl std::convert::TryFrom< &str> for ProjectLifecycleStateEnum {
|
||||
type Error = ();
|
||||
fn try_from(value: &str) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
"LIFECYCLE_STATE_UNSPECIFIED" => Ok(ProjectLifecycleStateEnum::LIFECYCLESTATEUNSPECIFIED),
|
||||
"ACTIVE" => Ok(ProjectLifecycleStateEnum::ACTIVE),
|
||||
"DELETE_REQUESTED" => Ok(ProjectLifecycleStateEnum::DELETEREQUESTED),
|
||||
"DELETE_IN_PROGRESS" => Ok(ProjectLifecycleStateEnum::DELETEINPROGRESS),
|
||||
_=> Err(()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ProjectLifecycleStateEnum {
|
||||
fn into(self) -> std::borrow::Cow<'a, str> {
|
||||
self.as_ref().into()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// endregion
|
||||
|
||||
|
||||
122
gen/cloudresourcemanager1/src/api/hub.rs
Normal file
122
gen/cloudresourcemanager1/src/api/hub.rs
Normal file
@@ -0,0 +1,122 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all CloudResourceManager related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1;
|
||||
/// use cloudresourcemanager1::{Result, Error};
|
||||
/// use cloudresourcemanager1::api::enums::*;
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudresourcemanager1::{CloudResourceManager, 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 = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().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.projects().list()
|
||||
/// .page_token("sanctus")
|
||||
/// .page_size(-80)
|
||||
/// .filter("amet.")
|
||||
/// .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 CloudResourceManager<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 CloudResourceManager<S> {}
|
||||
|
||||
impl<'a, S> CloudResourceManager<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> CloudResourceManager<S> {
|
||||
CloudResourceManager {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.5".to_string(),
|
||||
_base_url: "https://cloudresourcemanager.googleapis.com/".to_string(),
|
||||
_root_url: "https://cloudresourcemanager.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn folders(&'a self) -> FolderMethods<'a, S> {
|
||||
FolderMethods { hub: &self }
|
||||
}
|
||||
pub fn liens(&'a self) -> LienMethods<'a, S> {
|
||||
LienMethods { hub: &self }
|
||||
}
|
||||
pub fn operations(&'a self) -> OperationMethods<'a, S> {
|
||||
OperationMethods { hub: &self }
|
||||
}
|
||||
pub fn organizations(&'a self) -> OrganizationMethods<'a, S> {
|
||||
OrganizationMethods { hub: &self }
|
||||
}
|
||||
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.5`.
|
||||
///
|
||||
/// 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://cloudresourcemanager.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://cloudresourcemanager.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)
|
||||
}
|
||||
}
|
||||
902
gen/cloudresourcemanager1/src/api/method_builders.rs
Normal file
902
gen/cloudresourcemanager1/src/api/method_builders.rs
Normal file
@@ -0,0 +1,902 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *folder* resources.
|
||||
/// It is not used directly, but through the [`CloudResourceManager`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudresourcemanager1::{CloudResourceManager, 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 = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `clear_org_policy(...)`, `get_effective_org_policy(...)`, `get_org_policy(...)`, `list_available_org_policy_constraints(...)`, `list_org_policies(...)` and `set_org_policy(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.folders();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct FolderMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a CloudResourceManager<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for FolderMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> FolderMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Clears a `Policy` from a resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource for the `Policy` to clear.
|
||||
pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> FolderClearOrgPolicyCall<'a, S> {
|
||||
FolderClearOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - The name of the resource to start computing the effective `Policy`.
|
||||
pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> FolderGetEffectiveOrgPolicyCall<'a, S> {
|
||||
FolderGetEffectiveOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource the `Policy` is set on.
|
||||
pub fn get_org_policy(&self, request: GetOrgPolicyRequest, resource: &str) -> FolderGetOrgPolicyCall<'a, S> {
|
||||
FolderGetOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists `Constraints` that could be applied on the specified resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource to list `Constraints` for.
|
||||
pub fn list_available_org_policy_constraints(&self, request: ListAvailableOrgPolicyConstraintsRequest, resource: &str) -> FolderListAvailableOrgPolicyConstraintCall<'a, S> {
|
||||
FolderListAvailableOrgPolicyConstraintCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists all the `Policies` set for a particular resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource to list Policies for.
|
||||
pub fn list_org_policies(&self, request: ListOrgPoliciesRequest, resource: &str) -> FolderListOrgPolicyCall<'a, S> {
|
||||
FolderListOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Resource name of the resource to attach the `Policy`.
|
||||
pub fn set_org_policy(&self, request: SetOrgPolicyRequest, resource: &str) -> FolderSetOrgPolicyCall<'a, S> {
|
||||
FolderSetOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *lien* resources.
|
||||
/// It is not used directly, but through the [`CloudResourceManager`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudresourcemanager1::{CloudResourceManager, 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 = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `create(...)`, `delete(...)`, `get(...)` and `list(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.liens();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct LienMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a CloudResourceManager<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for LienMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> LienMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Create a Lien which applies to the resource denoted by the `parent` field. Callers of this method will require permission on the `parent` resource. For example, applying to `projects/1234` requires permission `resourcemanager.projects.updateLiens`. NOTE: Some resources may limit the number of Liens which may be applied.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn create(&self, request: Lien) -> LienCreateCall<'a, S> {
|
||||
LienCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Delete a Lien by `name`. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission `resourcemanager.projects.updateLiens`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. The name/identifier of the Lien to delete.
|
||||
pub fn delete(&self, name: &str) -> LienDeleteCall<'a, S> {
|
||||
LienDeleteCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieve a Lien by `name`. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission `resourcemanager.projects.get`
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. The name/identifier of the Lien.
|
||||
pub fn get(&self, name: &str) -> LienGetCall<'a, S> {
|
||||
LienGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// List all Liens applied to the `parent` resource. Callers of this method will require permission on the `parent` resource. For example, a Lien with a `parent` of `projects/1234` requires permission `resourcemanager.projects.get`.
|
||||
pub fn list(&self) -> LienListCall<'a, S> {
|
||||
LienListCall {
|
||||
hub: self.hub,
|
||||
_parent: Default::default(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *operation* resources.
|
||||
/// It is not used directly, but through the [`CloudResourceManager`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudresourcemanager1::{CloudResourceManager, 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 = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `get(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.operations();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a CloudResourceManager<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for OperationMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> OperationMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the latest state of a long-running operation. Clients can use this method to poll the operation result at intervals as recommended by the API service.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The name of the operation resource.
|
||||
pub fn get(&self, name: &str) -> OperationGetCall<'a, S> {
|
||||
OperationGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *organization* resources.
|
||||
/// It is not used directly, but through the [`CloudResourceManager`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudresourcemanager1::{CloudResourceManager, 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 = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `clear_org_policy(...)`, `get(...)`, `get_effective_org_policy(...)`, `get_iam_policy(...)`, `get_org_policy(...)`, `list_available_org_policy_constraints(...)`, `list_org_policies(...)`, `search(...)`, `set_iam_policy(...)`, `set_org_policy(...)` and `test_iam_permissions(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.organizations();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OrganizationMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a CloudResourceManager<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for OrganizationMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> OrganizationMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Clears a `Policy` from a resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource for the `Policy` to clear.
|
||||
pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> OrganizationClearOrgPolicyCall<'a, S> {
|
||||
OrganizationClearOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Fetches an Organization resource identified by the specified resource name.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - The resource name of the Organization to fetch. This is the organization's relative path in the API, formatted as "organizations/[organizationId]". For example, "organizations/1234".
|
||||
pub fn get(&self, name: &str) -> OrganizationGetCall<'a, S> {
|
||||
OrganizationGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - The name of the resource to start computing the effective `Policy`.
|
||||
pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> OrganizationGetEffectiveOrgPolicyCall<'a, S> {
|
||||
OrganizationGetEffectiveOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the access control policy for an Organization resource. May be empty if no such policy or resource exists. The `resource` field should be the organization's resource name, e.g. "organizations/123". Authorization requires the Google IAM permission `resourcemanager.organizations.getIamPolicy` on the specified organization
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> OrganizationGetIamPolicyCall<'a, S> {
|
||||
OrganizationGetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource the `Policy` is set on.
|
||||
pub fn get_org_policy(&self, request: GetOrgPolicyRequest, resource: &str) -> OrganizationGetOrgPolicyCall<'a, S> {
|
||||
OrganizationGetOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists `Constraints` that could be applied on the specified resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource to list `Constraints` for.
|
||||
pub fn list_available_org_policy_constraints(&self, request: ListAvailableOrgPolicyConstraintsRequest, resource: &str) -> OrganizationListAvailableOrgPolicyConstraintCall<'a, S> {
|
||||
OrganizationListAvailableOrgPolicyConstraintCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists all the `Policies` set for a particular resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource to list Policies for.
|
||||
pub fn list_org_policies(&self, request: ListOrgPoliciesRequest, resource: &str) -> OrganizationListOrgPolicyCall<'a, S> {
|
||||
OrganizationListOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Searches Organization resources that are visible to the user and satisfy the specified filter. This method returns Organizations in an unspecified order. New Organizations do not necessarily appear at the end of the results. Search will only return organizations on which the user has the permission `resourcemanager.organizations.get` or has super admin privileges.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn search(&self, request: SearchOrganizationsRequest) -> OrganizationSearchCall<'a, S> {
|
||||
OrganizationSearchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Sets the access control policy on an Organization resource. Replaces any existing policy. The `resource` field should be the organization's resource name, e.g. "organizations/123". Authorization requires the Google IAM permission `resourcemanager.organizations.setIamPolicy` on the specified organization
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> OrganizationSetIamPolicyCall<'a, S> {
|
||||
OrganizationSetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Resource name of the resource to attach the `Policy`.
|
||||
pub fn set_org_policy(&self, request: SetOrgPolicyRequest, resource: &str) -> OrganizationSetOrgPolicyCall<'a, S> {
|
||||
OrganizationSetOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns permissions that a caller has on the specified Organization. The `resource` field should be the organization's resource name, e.g. "organizations/123". There are no permissions required for making this API call.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> OrganizationTestIamPermissionCall<'a, S> {
|
||||
OrganizationTestIamPermissionCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// A builder providing access to all methods supported on *project* resources.
|
||||
/// It is not used directly, but through the [`CloudResourceManager`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_cloudresourcemanager1 as cloudresourcemanager1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use cloudresourcemanager1::{CloudResourceManager, 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 = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `clear_org_policy(...)`, `create(...)`, `delete(...)`, `get(...)`, `get_ancestry(...)`, `get_effective_org_policy(...)`, `get_iam_policy(...)`, `get_org_policy(...)`, `list(...)`, `list_available_org_policy_constraints(...)`, `list_org_policies(...)`, `set_iam_policy(...)`, `set_org_policy(...)`, `test_iam_permissions(...)`, `undelete(...)` and `update(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.projects();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ProjectMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a CloudResourceManager<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:
|
||||
///
|
||||
/// Clears a `Policy` from a resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource for the `Policy` to clear.
|
||||
pub fn clear_org_policy(&self, request: ClearOrgPolicyRequest, resource: &str) -> ProjectClearOrgPolicyCall<'a, S> {
|
||||
ProjectClearOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Request that a new Project be created. The result is an Operation which can be used to track the creation process. This process usually takes a few seconds, but can sometimes take much longer. The tracking Operation is automatically deleted after a few hours, so there is no need to call DeleteOperation. Authorization requires the Google IAM permission `resourcemanager.projects.create` on the specified parent for the new project. The parent is identified by a specified ResourceId, which must include both an ID and a type, such as organization. This method does not associate the new project with a billing account. You can set or update the billing account associated with a project using the \[`projects.updateBillingInfo`\] (/billing/reference/rest/v1/projects/updateBillingInfo) method.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn create(&self, request: Project) -> ProjectCreateCall<'a, S> {
|
||||
ProjectCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Marks the Project identified by the specified `project_id` (for example, `my-project-123`) for deletion. This method will only affect the Project if it has a lifecycle state of ACTIVE. This method changes the Project's lifecycle state from ACTIVE to DELETE_REQUESTED. The deletion starts at an unspecified time, at which point the Project is no longer accessible. Until the deletion completes, you can check the lifecycle state checked by retrieving the Project with GetProject, and the Project remains visible to ListProjects. However, you cannot update the project. After the deletion completes, the Project is not retrievable by the GetProject and ListProjects methods. The caller must have delete permissions for this Project.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `projectId` - The Project ID (for example, `foo-bar-123`). Required.
|
||||
pub fn delete(&self, project_id: &str) -> ProjectDeleteCall<'a, S> {
|
||||
ProjectDeleteCall {
|
||||
hub: self.hub,
|
||||
_project_id: project_id.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Retrieves the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `projectId` - Required. The Project ID (for example, `my-project-123`).
|
||||
pub fn get(&self, project_id: &str) -> ProjectGetCall<'a, S> {
|
||||
ProjectGetCall {
|
||||
hub: self.hub,
|
||||
_project_id: project_id.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets a list of ancestors in the resource hierarchy for the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have read permissions for this Project.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `projectId` - Required. The Project ID (for example, `my-project-123`).
|
||||
pub fn get_ancestry(&self, request: GetAncestryRequest, project_id: &str) -> ProjectGetAncestryCall<'a, S> {
|
||||
ProjectGetAncestryCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_project_id: project_id.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets the effective `Policy` on a resource. This is the result of merging `Policies` in the resource hierarchy. The returned `Policy` will not have an `etag`set because it is a computed `Policy` across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix will not be expanded.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - The name of the resource to start computing the effective `Policy`.
|
||||
pub fn get_effective_org_policy(&self, request: GetEffectiveOrgPolicyRequest, resource: &str) -> ProjectGetEffectiveOrgPolicyCall<'a, S> {
|
||||
ProjectGetEffectiveOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns the IAM access control policy for the specified Project. Permission is denied if the policy or the resource does not exist. Authorization requires the Google IAM permission `resourcemanager.projects.getIamPolicy` on the project. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names).
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn get_iam_policy(&self, request: GetIamPolicyRequest, resource: &str) -> ProjectGetIamPolicyCall<'a, S> {
|
||||
ProjectGetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Gets a `Policy` on a resource. If no `Policy` is set on the resource, a `Policy` is returned with default values including `POLICY_TYPE_NOT_SET` for the `policy_type oneof`. The `etag` value can be used with `SetOrgPolicy()` to create or update a `Policy` during read-modify-write.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource the `Policy` is set on.
|
||||
pub fn get_org_policy(&self, request: GetOrgPolicyRequest, resource: &str) -> ProjectGetOrgPolicyCall<'a, S> {
|
||||
ProjectGetOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists Projects that the caller has the `resourcemanager.projects.get` permission on and satisfy the specified filter. This method returns Projects in an unspecified order. This method is eventually consistent with project mutations; this means that a newly created project may not appear in the results or recent updates to an existing project may not be reflected in the results. To retrieve the latest state of a project, use the GetProject method. NOTE: If the request filter contains a `parent.type` and `parent.id` and the caller has the `resourcemanager.projects.list` permission on the parent, the results will be drawn from an alternate index which provides more consistent results. In future versions of this API, this List method will be split into List and Search to properly capture the behavioral difference.
|
||||
pub fn list(&self) -> ProjectListCall<'a, S> {
|
||||
ProjectListCall {
|
||||
hub: self.hub,
|
||||
_page_token: Default::default(),
|
||||
_page_size: 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:
|
||||
///
|
||||
/// Lists `Constraints` that could be applied on the specified resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource to list `Constraints` for.
|
||||
pub fn list_available_org_policy_constraints(&self, request: ListAvailableOrgPolicyConstraintsRequest, resource: &str) -> ProjectListAvailableOrgPolicyConstraintCall<'a, S> {
|
||||
ProjectListAvailableOrgPolicyConstraintCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Lists all the `Policies` set for a particular resource.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Name of the resource to list Policies for.
|
||||
pub fn list_org_policies(&self, request: ListOrgPoliciesRequest, resource: &str) -> ProjectListOrgPolicyCall<'a, S> {
|
||||
ProjectListOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Sets the IAM access control policy for the specified Project. CAUTION: This method will replace the existing policy, and cannot be used to append additional IAM settings. NOTE: Removing service accounts from policies or changing their roles can render services completely inoperable. It is important to understand how the service account is being used before removing or updating its roles. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names). The following constraints apply when using `setIamPolicy()`: + Project does not support `allUsers` and `allAuthenticatedUsers` as `members` in a `Binding` of a `Policy`. + The owner role can be granted to a `user`, `serviceAccount`, or a group that is part of an organization. For example, group@myownpersonaldomain.com could be added as an owner to a project in the myownpersonaldomain.com organization, but not the examplepetstore.com organization. + Service accounts can be made owners of a project directly without any restrictions. However, to be added as an owner, a user must be invited via Cloud Platform console and must accept the invitation. + A user cannot be granted the owner role using `setIamPolicy()`. The user must be granted the owner role using the Cloud Platform Console and must explicitly accept the invitation. + You can only grant ownership of a project to a member by using the Google Cloud console. Inviting a member will deliver an invitation email that they must accept. An invitation email is not generated if you are granting a role other than owner, or if both the member you are inviting and the project are part of your organization. + If the project is not part of an organization, there must be at least one owner who has accepted the Terms of Service (ToS) agreement in the policy. Calling `setIamPolicy()` to remove the last ToS-accepted owner from the policy will fail. This restriction also applies to legacy projects that no longer have owners who have accepted the ToS. Edits to IAM policies will be rejected until the lack of a ToS-accepting owner is rectified. If the project is part of an organization, you can remove all owners, potentially making the organization inaccessible. Authorization requires the Google IAM permission `resourcemanager.projects.setIamPolicy` on the project
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy is being specified. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectSetIamPolicyCall<'a, S> {
|
||||
ProjectSetIamPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates the specified `Policy` on the resource. Creates a new `Policy` for that `Constraint` on the resource if one does not exist. Not supplying an `etag` on the request `Policy` results in an unconditional write of the `Policy`.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - Resource name of the resource to attach the `Policy`.
|
||||
pub fn set_org_policy(&self, request: SetOrgPolicyRequest, resource: &str) -> ProjectSetOrgPolicyCall<'a, S> {
|
||||
ProjectSetOrgPolicyCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Returns permissions that a caller has on the specified Project. For additional information about `resource` (e.g. my-project-id) structure and identification, see [Resource Names](https://cloud.google.com/apis/design/resource_names). There are no permissions required for making this API call.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested. See [Resource names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for this field.
|
||||
pub fn test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectTestIamPermissionCall<'a, S> {
|
||||
ProjectTestIamPermissionCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_resource: resource.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Restores the Project identified by the specified `project_id` (for example, `my-project-123`). You can only use this method for a Project that has a lifecycle state of DELETE_REQUESTED. After deletion starts, the Project cannot be restored. The caller must have undelete permissions for this Project.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `projectId` - Required. The project ID (for example, `foo-bar-123`).
|
||||
pub fn undelete(&self, request: UndeleteProjectRequest, project_id: &str) -> ProjectUndeleteCall<'a, S> {
|
||||
ProjectUndeleteCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_project_id: project_id.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Updates the attributes of the Project identified by the specified `project_id` (for example, `my-project-123`). The caller must have modify permissions for this Project.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `projectId` - The project ID (for example, `my-project-123`). Required.
|
||||
pub fn update(&self, request: Project, project_id: &str) -> ProjectUpdateCall<'a, S> {
|
||||
ProjectUpdateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_project_id: project_id.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
35
gen/cloudresourcemanager1/src/api/mod.rs
Normal file
35
gen/cloudresourcemanager1/src/api/mod.rs
Normal file
@@ -0,0 +1,35 @@
|
||||
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::*;
|
||||
|
||||
pub mod enums;
|
||||
pub(crate) use enums::*;
|
||||
1000
gen/cloudresourcemanager1/src/api/schemas.rs
Normal file
1000
gen/cloudresourcemanager1/src/api/schemas.rs
Normal file
File diff suppressed because it is too large
Load Diff
28
gen/cloudresourcemanager1/src/api/utilities.rs
Normal file
28
gen/cloudresourcemanager1/src/api/utilities.rs
Normal file
@@ -0,0 +1,28 @@
|
||||
use super::*;
|
||||
/// Identifies the an OAuth2 authorization scope.
|
||||
/// A scope is needed when requesting an
|
||||
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
|
||||
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
|
||||
pub enum Scope {
|
||||
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
||||
CloudPlatform,
|
||||
|
||||
/// View your data across Google Cloud services and see the email address of your Google Account
|
||||
CloudPlatformReadOnly,
|
||||
}
|
||||
|
||||
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",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Scope {
|
||||
fn default() -> Scope {
|
||||
Scope::CloudPlatform
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *Cloud Resource Manager* crate version *5.0.4+20240303*, where *20240303* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
|
||||
//! This documentation was generated from *Cloud Resource Manager* crate version *5.0.5+20240414*, where *20240414* is the exact revision of the *cloudresourcemanager:v1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
|
||||
//!
|
||||
//! Everything else about the *Cloud Resource Manager* *v1* API can be found at the
|
||||
//! [official documentation site](https://cloud.google.com/resource-manager).
|
||||
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/cloudresourcemanager1).
|
||||
//! # Features
|
||||
//!
|
||||
//! Handle the following *Resources* with ease from the central [hub](CloudResourceManager) ...
|
||||
//! Handle the following *Resources* with ease from the central [hub](CloudResourceManager) ...
|
||||
//!
|
||||
//! * folders
|
||||
//! * [*clear org policy*](api::FolderClearOrgPolicyCall), [*get effective org policy*](api::FolderGetEffectiveOrgPolicyCall), [*get org policy*](api::FolderGetOrgPolicyCall), [*list available org policy constraints*](api::FolderListAvailableOrgPolicyConstraintCall), [*list org policies*](api::FolderListOrgPolicyCall) and [*set org policy*](api::FolderSetOrgPolicyCall)
|
||||
@@ -73,8 +73,8 @@
|
||||
//! let r = hub.projects().update(...).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
|
||||
//! 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.
|
||||
//!
|
||||
@@ -98,23 +98,24 @@
|
||||
//! extern crate hyper_rustls;
|
||||
//! extern crate google_cloudresourcemanager1 as cloudresourcemanager1;
|
||||
//! use cloudresourcemanager1::{Result, Error};
|
||||
//! use cloudresourcemanager1::api::enums::*;
|
||||
//! # async fn dox() {
|
||||
//! use std::default::Default;
|
||||
//! use cloudresourcemanager1::{CloudResourceManager, oauth2, hyper, hyper_rustls, chrono, FieldMask};
|
||||
//!
|
||||
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
|
||||
//! // 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,
|
||||
//! // 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
|
||||
//! // 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 = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
//! let mut hub = CloudResourceManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().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 !
|
||||
@@ -146,10 +147,10 @@
|
||||
//! ## 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
|
||||
//! 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
|
||||
//! 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
|
||||
@@ -159,25 +160,25 @@
|
||||
//! 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
|
||||
//! 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
|
||||
//! 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
|
||||
//! 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
|
||||
//! 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
|
||||
|
||||
Reference in New Issue
Block a user