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:
118
gen/accessapproval1_beta1/src/api/hub.rs
Normal file
118
gen/accessapproval1_beta1/src/api/hub.rs
Normal file
@@ -0,0 +1,118 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all AccessApproval related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_accessapproval1_beta1 as accessapproval1_beta1;
|
||||
/// use accessapproval1_beta1::api::ApproveApprovalRequestMessage;
|
||||
/// use accessapproval1_beta1::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use accessapproval1_beta1::{AccessApproval, 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 = AccessApproval::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // As the method needs a request, you would usually fill it with the desired information
|
||||
/// // into the respective structure. Some of the parts shown here might not be applicable !
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let mut req = ApproveApprovalRequestMessage::default();
|
||||
///
|
||||
/// // You can configure optional parameters by calling the respective setters at will, and
|
||||
/// // execute the final call using `doit()`.
|
||||
/// // Values shown here are possibly random and not representative !
|
||||
/// let result = hub.folders().approval_requests_approve(req, "name")
|
||||
/// .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 AccessApproval<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 AccessApproval<S> {}
|
||||
|
||||
impl<'a, S> AccessApproval<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> AccessApproval<S> {
|
||||
AccessApproval {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.3".to_string(),
|
||||
_base_url: "https://accessapproval.googleapis.com/".to_string(),
|
||||
_root_url: "https://accessapproval.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn folders(&'a self) -> FolderMethods<'a, S> {
|
||||
FolderMethods { 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.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://accessapproval.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://accessapproval.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)
|
||||
}
|
||||
}
|
||||
589
gen/accessapproval1_beta1/src/api/method_builders.rs
Normal file
589
gen/accessapproval1_beta1/src/api/method_builders.rs
Normal file
@@ -0,0 +1,589 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *folder* resources.
|
||||
/// It is not used directly, but through the [`AccessApproval`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_accessapproval1_beta1 as accessapproval1_beta1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use accessapproval1_beta1::{AccessApproval, 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 = AccessApproval::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 `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `delete_access_approval_settings(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.folders();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct FolderMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a AccessApproval<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:
|
||||
///
|
||||
/// Approves a request and returns the updated ApprovalRequest.
|
||||
///
|
||||
/// Returns NOT_FOUND if the request does not exist. Returns
|
||||
/// FAILED_PRECONDITION if the request exists but is not in a pending state.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Name of the approval request to approve.
|
||||
pub fn approval_requests_approve(&self, request: ApproveApprovalRequestMessage, name: &str) -> FolderApprovalRequestApproveCall<'a, S> {
|
||||
FolderApprovalRequestApproveCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Dismisses a request. Returns the updated ApprovalRequest.
|
||||
///
|
||||
/// NOTE: This does not deny access to the resource if another request has been
|
||||
/// made and approved. It is equivalent in effect to ignoring the request
|
||||
/// altogether.
|
||||
///
|
||||
/// Returns NOT_FOUND if the request does not exist.
|
||||
///
|
||||
/// Returns FAILED_PRECONDITION if the request exists but is not in a pending
|
||||
/// state.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Name of the ApprovalRequest to dismiss.
|
||||
pub fn approval_requests_dismiss(&self, request: DismissApprovalRequestMessage, name: &str) -> FolderApprovalRequestDismisCall<'a, S> {
|
||||
FolderApprovalRequestDismisCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_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 an approval request. Returns NOT_FOUND if the request does not exist.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the approval request to retrieve.
|
||||
pub fn approval_requests_get(&self, name: &str) -> FolderApprovalRequestGetCall<'a, S> {
|
||||
FolderApprovalRequestGetCall {
|
||||
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:
|
||||
///
|
||||
/// Lists approval requests associated with a project, folder, or organization.
|
||||
/// Approval requests can be filtered by state (pending, active, dismissed).
|
||||
/// The order is reverse chronological.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - The parent resource. This may be "projects/{project_id}",
|
||||
/// "folders/{folder_id}", or "organizations/{organization_id}".
|
||||
pub fn approval_requests_list(&self, parent: &str) -> FolderApprovalRequestListCall<'a, S> {
|
||||
FolderApprovalRequestListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
_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:
|
||||
///
|
||||
/// Deletes the settings associated with a project, folder, or organization.
|
||||
/// This will have the effect of disabling Access Approval for the project,
|
||||
/// folder, or organization, but only if all ancestors also have Access
|
||||
/// Approval disabled. If Access Approval is enabled at a higher level of the
|
||||
/// hierarchy, then Access Approval will still be enabled at this level as
|
||||
/// the settings are inherited.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the AccessApprovalSettings to delete.
|
||||
pub fn delete_access_approval_settings(&self, name: &str) -> FolderDeleteAccessApprovalSettingCall<'a, S> {
|
||||
FolderDeleteAccessApprovalSettingCall {
|
||||
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 settings associated with a project, folder, or organization.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the AccessApprovalSettings to retrieve.
|
||||
pub fn get_access_approval_settings(&self, name: &str) -> FolderGetAccessApprovalSettingCall<'a, S> {
|
||||
FolderGetAccessApprovalSettingCall {
|
||||
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:
|
||||
///
|
||||
/// Updates the settings associated with a project, folder, or organization.
|
||||
/// Settings to update are determined by the value of field_mask.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - The resource name of the settings. Format is one of:
|
||||
/// <ol>
|
||||
/// <li>"projects/{project_id}/accessApprovalSettings"</li>
|
||||
/// <li>"folders/{folder_id}/accessApprovalSettings"</li>
|
||||
/// <li>"organizations/{organization_id}/accessApprovalSettings"</li>
|
||||
/// <ol>
|
||||
pub fn update_access_approval_settings(&self, request: AccessApprovalSettings, name: &str) -> FolderUpdateAccessApprovalSettingCall<'a, S> {
|
||||
FolderUpdateAccessApprovalSettingCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_update_mask: Default::default(),
|
||||
_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 [`AccessApproval`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_accessapproval1_beta1 as accessapproval1_beta1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use accessapproval1_beta1::{AccessApproval, 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 = AccessApproval::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 `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `delete_access_approval_settings(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.organizations();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OrganizationMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a AccessApproval<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:
|
||||
///
|
||||
/// Approves a request and returns the updated ApprovalRequest.
|
||||
///
|
||||
/// Returns NOT_FOUND if the request does not exist. Returns
|
||||
/// FAILED_PRECONDITION if the request exists but is not in a pending state.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Name of the approval request to approve.
|
||||
pub fn approval_requests_approve(&self, request: ApproveApprovalRequestMessage, name: &str) -> OrganizationApprovalRequestApproveCall<'a, S> {
|
||||
OrganizationApprovalRequestApproveCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Dismisses a request. Returns the updated ApprovalRequest.
|
||||
///
|
||||
/// NOTE: This does not deny access to the resource if another request has been
|
||||
/// made and approved. It is equivalent in effect to ignoring the request
|
||||
/// altogether.
|
||||
///
|
||||
/// Returns NOT_FOUND if the request does not exist.
|
||||
///
|
||||
/// Returns FAILED_PRECONDITION if the request exists but is not in a pending
|
||||
/// state.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Name of the ApprovalRequest to dismiss.
|
||||
pub fn approval_requests_dismiss(&self, request: DismissApprovalRequestMessage, name: &str) -> OrganizationApprovalRequestDismisCall<'a, S> {
|
||||
OrganizationApprovalRequestDismisCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_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 an approval request. Returns NOT_FOUND if the request does not exist.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the approval request to retrieve.
|
||||
pub fn approval_requests_get(&self, name: &str) -> OrganizationApprovalRequestGetCall<'a, S> {
|
||||
OrganizationApprovalRequestGetCall {
|
||||
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:
|
||||
///
|
||||
/// Lists approval requests associated with a project, folder, or organization.
|
||||
/// Approval requests can be filtered by state (pending, active, dismissed).
|
||||
/// The order is reverse chronological.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - The parent resource. This may be "projects/{project_id}",
|
||||
/// "folders/{folder_id}", or "organizations/{organization_id}".
|
||||
pub fn approval_requests_list(&self, parent: &str) -> OrganizationApprovalRequestListCall<'a, S> {
|
||||
OrganizationApprovalRequestListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
_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:
|
||||
///
|
||||
/// Deletes the settings associated with a project, folder, or organization.
|
||||
/// This will have the effect of disabling Access Approval for the project,
|
||||
/// folder, or organization, but only if all ancestors also have Access
|
||||
/// Approval disabled. If Access Approval is enabled at a higher level of the
|
||||
/// hierarchy, then Access Approval will still be enabled at this level as
|
||||
/// the settings are inherited.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the AccessApprovalSettings to delete.
|
||||
pub fn delete_access_approval_settings(&self, name: &str) -> OrganizationDeleteAccessApprovalSettingCall<'a, S> {
|
||||
OrganizationDeleteAccessApprovalSettingCall {
|
||||
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 settings associated with a project, folder, or organization.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the AccessApprovalSettings to retrieve.
|
||||
pub fn get_access_approval_settings(&self, name: &str) -> OrganizationGetAccessApprovalSettingCall<'a, S> {
|
||||
OrganizationGetAccessApprovalSettingCall {
|
||||
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:
|
||||
///
|
||||
/// Updates the settings associated with a project, folder, or organization.
|
||||
/// Settings to update are determined by the value of field_mask.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - The resource name of the settings. Format is one of:
|
||||
/// <ol>
|
||||
/// <li>"projects/{project_id}/accessApprovalSettings"</li>
|
||||
/// <li>"folders/{folder_id}/accessApprovalSettings"</li>
|
||||
/// <li>"organizations/{organization_id}/accessApprovalSettings"</li>
|
||||
/// <ol>
|
||||
pub fn update_access_approval_settings(&self, request: AccessApprovalSettings, name: &str) -> OrganizationUpdateAccessApprovalSettingCall<'a, S> {
|
||||
OrganizationUpdateAccessApprovalSettingCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_update_mask: Default::default(),
|
||||
_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 [`AccessApproval`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_accessapproval1_beta1 as accessapproval1_beta1;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use accessapproval1_beta1::{AccessApproval, 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 = AccessApproval::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 `approval_requests_approve(...)`, `approval_requests_dismiss(...)`, `approval_requests_get(...)`, `approval_requests_list(...)`, `delete_access_approval_settings(...)`, `get_access_approval_settings(...)` and `update_access_approval_settings(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.projects();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct ProjectMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a AccessApproval<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:
|
||||
///
|
||||
/// Approves a request and returns the updated ApprovalRequest.
|
||||
///
|
||||
/// Returns NOT_FOUND if the request does not exist. Returns
|
||||
/// FAILED_PRECONDITION if the request exists but is not in a pending state.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Name of the approval request to approve.
|
||||
pub fn approval_requests_approve(&self, request: ApproveApprovalRequestMessage, name: &str) -> ProjectApprovalRequestApproveCall<'a, S> {
|
||||
ProjectApprovalRequestApproveCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Dismisses a request. Returns the updated ApprovalRequest.
|
||||
///
|
||||
/// NOTE: This does not deny access to the resource if another request has been
|
||||
/// made and approved. It is equivalent in effect to ignoring the request
|
||||
/// altogether.
|
||||
///
|
||||
/// Returns NOT_FOUND if the request does not exist.
|
||||
///
|
||||
/// Returns FAILED_PRECONDITION if the request exists but is not in a pending
|
||||
/// state.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Name of the ApprovalRequest to dismiss.
|
||||
pub fn approval_requests_dismiss(&self, request: DismissApprovalRequestMessage, name: &str) -> ProjectApprovalRequestDismisCall<'a, S> {
|
||||
ProjectApprovalRequestDismisCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_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 an approval request. Returns NOT_FOUND if the request does not exist.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the approval request to retrieve.
|
||||
pub fn approval_requests_get(&self, name: &str) -> ProjectApprovalRequestGetCall<'a, S> {
|
||||
ProjectApprovalRequestGetCall {
|
||||
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:
|
||||
///
|
||||
/// Lists approval requests associated with a project, folder, or organization.
|
||||
/// Approval requests can be filtered by state (pending, active, dismissed).
|
||||
/// The order is reverse chronological.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - The parent resource. This may be "projects/{project_id}",
|
||||
/// "folders/{folder_id}", or "organizations/{organization_id}".
|
||||
pub fn approval_requests_list(&self, parent: &str) -> ProjectApprovalRequestListCall<'a, S> {
|
||||
ProjectApprovalRequestListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
_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:
|
||||
///
|
||||
/// Deletes the settings associated with a project, folder, or organization.
|
||||
/// This will have the effect of disabling Access Approval for the project,
|
||||
/// folder, or organization, but only if all ancestors also have Access
|
||||
/// Approval disabled. If Access Approval is enabled at a higher level of the
|
||||
/// hierarchy, then Access Approval will still be enabled at this level as
|
||||
/// the settings are inherited.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the AccessApprovalSettings to delete.
|
||||
pub fn delete_access_approval_settings(&self, name: &str) -> ProjectDeleteAccessApprovalSettingCall<'a, S> {
|
||||
ProjectDeleteAccessApprovalSettingCall {
|
||||
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 settings associated with a project, folder, or organization.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Name of the AccessApprovalSettings to retrieve.
|
||||
pub fn get_access_approval_settings(&self, name: &str) -> ProjectGetAccessApprovalSettingCall<'a, S> {
|
||||
ProjectGetAccessApprovalSettingCall {
|
||||
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:
|
||||
///
|
||||
/// Updates the settings associated with a project, folder, or organization.
|
||||
/// Settings to update are determined by the value of field_mask.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - The resource name of the settings. Format is one of:
|
||||
/// <ol>
|
||||
/// <li>"projects/{project_id}/accessApprovalSettings"</li>
|
||||
/// <li>"folders/{folder_id}/accessApprovalSettings"</li>
|
||||
/// <li>"organizations/{organization_id}/accessApprovalSettings"</li>
|
||||
/// <ol>
|
||||
pub fn update_access_approval_settings(&self, request: AccessApprovalSettings, name: &str) -> ProjectUpdateAccessApprovalSettingCall<'a, S> {
|
||||
ProjectUpdateAccessApprovalSettingCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_update_mask: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
32
gen/accessapproval1_beta1/src/api/mod.rs
Normal file
32
gen/accessapproval1_beta1/src/api/mod.rs
Normal file
@@ -0,0 +1,32 @@
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeSet;
|
||||
use std::error::Error as StdError;
|
||||
use serde_json as json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
use std::mem;
|
||||
|
||||
use hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::time::sleep;
|
||||
use tower_service;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::{client, client::GetToken, client::serde_with};
|
||||
|
||||
mod utilities;
|
||||
pub use utilities::*;
|
||||
|
||||
mod hub;
|
||||
pub use hub::*;
|
||||
|
||||
mod schemas;
|
||||
pub use schemas::*;
|
||||
|
||||
mod method_builders;
|
||||
pub use method_builders::*;
|
||||
|
||||
mod call_builders;
|
||||
pub use call_builders::*;
|
||||
370
gen/accessapproval1_beta1/src/api/schemas.rs
Normal file
370
gen/accessapproval1_beta1/src/api/schemas.rs
Normal file
@@ -0,0 +1,370 @@
|
||||
use super::*;
|
||||
/// Settings on a Project/Folder/Organization related to Access Approval.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [get access approval settings folders](FolderGetAccessApprovalSettingCall) (response)
|
||||
/// * [update access approval settings folders](FolderUpdateAccessApprovalSettingCall) (request|response)
|
||||
/// * [get access approval settings organizations](OrganizationGetAccessApprovalSettingCall) (response)
|
||||
/// * [update access approval settings organizations](OrganizationUpdateAccessApprovalSettingCall) (request|response)
|
||||
/// * [get access approval settings projects](ProjectGetAccessApprovalSettingCall) (response)
|
||||
/// * [update access approval settings projects](ProjectUpdateAccessApprovalSettingCall) (request|response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct AccessApprovalSettings {
|
||||
/// Output only. This field is read only (not settable via
|
||||
/// UpdateAccessAccessApprovalSettings method). If the field is true, that
|
||||
/// indicates that at least one service is enrolled for Access Approval in one
|
||||
/// or more ancestors of the Project or Folder (this field will always be
|
||||
/// unset for the organization since organizations do not have ancestors).
|
||||
#[serde(rename="enrolledAncestor")]
|
||||
|
||||
pub enrolled_ancestor: Option<bool>,
|
||||
/// A list of Google Cloud Services for which the given resource has Access
|
||||
/// Approval enrolled. Access requests for the resource given by name against
|
||||
/// any of these services contained here will be required to have explicit
|
||||
/// approval. If name refers to an organization, enrollment can be done for
|
||||
/// individual services. If name refers to a folder or project, enrollment can
|
||||
/// only be done on an all or nothing basis.
|
||||
///
|
||||
/// If a cloud_product is repeated in this list, the first entry will be
|
||||
/// honored and all following entries will be discarded. A maximum of 10
|
||||
/// enrolled services will be enforced, to be expanded as the set of supported
|
||||
/// services is expanded.
|
||||
#[serde(rename="enrolledServices")]
|
||||
|
||||
pub enrolled_services: Option<Vec<EnrolledService>>,
|
||||
/// The resource name of the settings. Format is one of:
|
||||
/// <ol>
|
||||
/// <li>"projects/{project_id}/accessApprovalSettings"</li>
|
||||
/// <li>"folders/{folder_id}/accessApprovalSettings"</li>
|
||||
/// <li>"organizations/{organization_id}/accessApprovalSettings"</li>
|
||||
/// <ol>
|
||||
|
||||
pub name: Option<String>,
|
||||
/// A list of email addresses to which notifications relating to approval
|
||||
/// requests should be sent. Notifications relating to a resource will be sent
|
||||
/// to all emails in the settings of ancestor resources of that resource. A
|
||||
/// maximum of 50 email addresses are allowed.
|
||||
#[serde(rename="notificationEmails")]
|
||||
|
||||
pub notification_emails: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for AccessApprovalSettings {}
|
||||
impl client::ResponseResult for AccessApprovalSettings {}
|
||||
|
||||
|
||||
/// Home office and physical location of the principal.
|
||||
///
|
||||
/// 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 AccessLocations {
|
||||
/// The "home office" location of the principal. A two-letter country code
|
||||
/// (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or a region code. In some
|
||||
/// limited situations Google systems may refer refer to a region code instead
|
||||
/// of a country code.
|
||||
/// Possible Region Codes:
|
||||
/// <ol>
|
||||
/// <li>ASI: Asia</li>
|
||||
/// <li>EUR: Europe</li>
|
||||
/// <li>OCE: Oceania</li>
|
||||
/// <li>AFR: Africa</li>
|
||||
/// <li>NAM: North America</li>
|
||||
/// <li>SAM: South America</li>
|
||||
/// <li>ANT: Antarctica</li>
|
||||
/// <li>ANY: Any location</li>
|
||||
/// </ol>
|
||||
#[serde(rename="principalOfficeCountry")]
|
||||
|
||||
pub principal_office_country: Option<String>,
|
||||
/// Physical location of the principal at the time of the access. A
|
||||
/// two-letter country code (ISO 3166-1 alpha-2), such as "US", "DE" or "GB" or
|
||||
/// a region code. In some limited situations Google systems may refer refer to
|
||||
/// a region code instead of a country code.
|
||||
/// Possible Region Codes:
|
||||
/// <ol>
|
||||
/// <li>ASI: Asia</li>
|
||||
/// <li>EUR: Europe</li>
|
||||
/// <li>OCE: Oceania</li>
|
||||
/// <li>AFR: Africa</li>
|
||||
/// <li>NAM: North America</li>
|
||||
/// <li>SAM: South America</li>
|
||||
/// <li>ANT: Antarctica</li>
|
||||
/// <li>ANY: Any location</li>
|
||||
/// </ol>
|
||||
#[serde(rename="principalPhysicalLocationCountry")]
|
||||
|
||||
pub principal_physical_location_country: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for AccessLocations {}
|
||||
|
||||
|
||||
/// 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 AccessReason {
|
||||
/// More detail about certain reason types. See comments for each type above.
|
||||
|
||||
pub detail: Option<String>,
|
||||
/// Type of access justification.
|
||||
#[serde(rename="type")]
|
||||
|
||||
pub type_: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for AccessReason {}
|
||||
|
||||
|
||||
/// A request for the customer to approve access to a 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*).
|
||||
///
|
||||
/// * [approval requests approve folders](FolderApprovalRequestApproveCall) (response)
|
||||
/// * [approval requests dismiss folders](FolderApprovalRequestDismisCall) (response)
|
||||
/// * [approval requests get folders](FolderApprovalRequestGetCall) (response)
|
||||
/// * [approval requests approve organizations](OrganizationApprovalRequestApproveCall) (response)
|
||||
/// * [approval requests dismiss organizations](OrganizationApprovalRequestDismisCall) (response)
|
||||
/// * [approval requests get organizations](OrganizationApprovalRequestGetCall) (response)
|
||||
/// * [approval requests approve projects](ProjectApprovalRequestApproveCall) (response)
|
||||
/// * [approval requests dismiss projects](ProjectApprovalRequestDismisCall) (response)
|
||||
/// * [approval requests get projects](ProjectApprovalRequestGetCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ApprovalRequest {
|
||||
/// Access was approved.
|
||||
|
||||
pub approve: Option<ApproveDecision>,
|
||||
/// The request was dismissed.
|
||||
|
||||
pub dismiss: Option<DismissDecision>,
|
||||
/// The resource name of the request. Format is
|
||||
/// "{projects|folders|organizations}/{id}/approvalRequests/{approval_request_id}".
|
||||
|
||||
pub name: Option<String>,
|
||||
/// The time at which approval was requested.
|
||||
#[serde(rename="requestTime")]
|
||||
|
||||
pub request_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// The requested expiration for the approval. If the request is approved,
|
||||
/// access will be granted from the time of approval until the expiration time.
|
||||
#[serde(rename="requestedExpiration")]
|
||||
|
||||
pub requested_expiration: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// The locations for which approval is being requested.
|
||||
#[serde(rename="requestedLocations")]
|
||||
|
||||
pub requested_locations: Option<AccessLocations>,
|
||||
/// The justification for which approval is being requested.
|
||||
#[serde(rename="requestedReason")]
|
||||
|
||||
pub requested_reason: Option<AccessReason>,
|
||||
/// The resource for which approval is being requested. The format of the
|
||||
/// resource name is defined at
|
||||
/// https://cloud.google.com/apis/design/resource_names. The resource name here
|
||||
/// may either be a "full" resource name (e.g.
|
||||
/// "//library.googleapis.com/shelves/shelf1/books/book2") or a "relative"
|
||||
/// resource name (e.g. "shelves/shelf1/books/book2") as described in the
|
||||
/// resource name specification.
|
||||
#[serde(rename="requestedResourceName")]
|
||||
|
||||
pub requested_resource_name: Option<String>,
|
||||
/// Properties related to the resource represented by requested_resource_name.
|
||||
#[serde(rename="requestedResourceProperties")]
|
||||
|
||||
pub requested_resource_properties: Option<ResourceProperties>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ApprovalRequest {}
|
||||
|
||||
|
||||
/// Request to approve an ApprovalRequest.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [approval requests approve folders](FolderApprovalRequestApproveCall) (request)
|
||||
/// * [approval requests approve organizations](OrganizationApprovalRequestApproveCall) (request)
|
||||
/// * [approval requests approve projects](ProjectApprovalRequestApproveCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ApproveApprovalRequestMessage {
|
||||
/// The expiration time of this approval.
|
||||
#[serde(rename="expireTime")]
|
||||
|
||||
pub expire_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for ApproveApprovalRequestMessage {}
|
||||
|
||||
|
||||
/// A decision that has been made to approve access to a resource.
|
||||
///
|
||||
/// 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 ApproveDecision {
|
||||
/// The time at which approval was granted.
|
||||
#[serde(rename="approveTime")]
|
||||
|
||||
pub approve_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
/// The time at which the approval expires.
|
||||
#[serde(rename="expireTime")]
|
||||
|
||||
pub expire_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
}
|
||||
|
||||
impl client::Part for ApproveDecision {}
|
||||
|
||||
|
||||
/// Request to dismiss an approval request.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [approval requests dismiss folders](FolderApprovalRequestDismisCall) (request)
|
||||
/// * [approval requests dismiss organizations](OrganizationApprovalRequestDismisCall) (request)
|
||||
/// * [approval requests dismiss projects](ProjectApprovalRequestDismisCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct DismissApprovalRequestMessage { _never_set: Option<bool> }
|
||||
|
||||
impl client::RequestValue for DismissApprovalRequestMessage {}
|
||||
|
||||
|
||||
/// A decision that has been made to dismiss an approval request.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct DismissDecision {
|
||||
/// The time at which the approval request was dismissed.
|
||||
#[serde(rename="dismissTime")]
|
||||
|
||||
pub dismiss_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
|
||||
}
|
||||
|
||||
impl client::Part for DismissDecision {}
|
||||
|
||||
|
||||
/// A generic empty message that you can re-use to avoid defining duplicated
|
||||
/// empty messages in your APIs. A typical example is to use it as the request
|
||||
/// or the response type of an API method. For instance:
|
||||
///
|
||||
/// ````text
|
||||
/// service Foo {
|
||||
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
|
||||
/// }
|
||||
/// ````
|
||||
///
|
||||
/// The JSON representation for `Empty` is empty JSON object `{}`.
|
||||
///
|
||||
/// # 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 access approval settings folders](FolderDeleteAccessApprovalSettingCall) (response)
|
||||
/// * [delete access approval settings organizations](OrganizationDeleteAccessApprovalSettingCall) (response)
|
||||
/// * [delete access approval settings projects](ProjectDeleteAccessApprovalSettingCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Empty { _never_set: Option<bool> }
|
||||
|
||||
impl client::ResponseResult for Empty {}
|
||||
|
||||
|
||||
/// Represents the enrollment of a cloud resource into a specific service.
|
||||
///
|
||||
/// 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 EnrolledService {
|
||||
/// The product for which Access Approval will be enrolled. Allowed values are
|
||||
/// listed below (case-sensitive):
|
||||
/// <ol>
|
||||
/// <li>all</li>
|
||||
/// <li>appengine.googleapis.com</li>
|
||||
/// <li>bigquery.googleapis.com</li>
|
||||
/// <li>bigtable.googleapis.com</li>
|
||||
/// <li>cloudkms.googleapis.com</li>
|
||||
/// <li>compute.googleapis.com</li>
|
||||
/// <li>dataflow.googleapis.com</li>
|
||||
/// <li>iam.googleapis.com</li>
|
||||
/// <li>pubsub.googleapis.com</li>
|
||||
/// <li>storage.googleapis.com</li>
|
||||
/// <ol>
|
||||
#[serde(rename="cloudProduct")]
|
||||
|
||||
pub cloud_product: Option<String>,
|
||||
/// The enrollment level of the service.
|
||||
#[serde(rename="enrollmentLevel")]
|
||||
|
||||
pub enrollment_level: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for EnrolledService {}
|
||||
|
||||
|
||||
/// Response to listing of ApprovalRequest objects.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [approval requests list folders](FolderApprovalRequestListCall) (response)
|
||||
/// * [approval requests list organizations](OrganizationApprovalRequestListCall) (response)
|
||||
/// * [approval requests list projects](ProjectApprovalRequestListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListApprovalRequestsResponse {
|
||||
/// Approval request details.
|
||||
#[serde(rename="approvalRequests")]
|
||||
|
||||
pub approval_requests: Option<Vec<ApprovalRequest>>,
|
||||
/// Token to retrieve the next page of results, or empty if there are no more.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListApprovalRequestsResponse {}
|
||||
|
||||
|
||||
/// The properties associated with the resource of the request.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ResourceProperties {
|
||||
/// Whether an approval will exclude the descendants of the resource being
|
||||
/// requested.
|
||||
#[serde(rename="excludesDescendants")]
|
||||
|
||||
pub excludes_descendants: Option<bool>,
|
||||
}
|
||||
|
||||
impl client::Part for ResourceProperties {}
|
||||
|
||||
|
||||
24
gen/accessapproval1_beta1/src/api/utilities.rs
Normal file
24
gen/accessapproval1_beta1/src/api/utilities.rs
Normal file
@@ -0,0 +1,24 @@
|
||||
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,
|
||||
}
|
||||
|
||||
impl AsRef<str> for Scope {
|
||||
fn as_ref(&self) -> &str {
|
||||
match *self {
|
||||
Scope::CloudPlatform => "https://www.googleapis.com/auth/cloud-platform",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for Scope {
|
||||
fn default() -> Scope {
|
||||
Scope::CloudPlatform
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user