mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-02-23 15:49:49 +01:00
remove generated libs
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,116 +0,0 @@
|
||||
use super::*;
|
||||
|
||||
/// Central instance to access all AccessContextManager related resource activities
|
||||
///
|
||||
/// # Examples
|
||||
///
|
||||
/// Instantiate a new hub
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_accesscontextmanager1_beta as accesscontextmanager1_beta;
|
||||
/// use accesscontextmanager1_beta::api::AccessLevel;
|
||||
/// use accesscontextmanager1_beta::{Result, Error};
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use accesscontextmanager1_beta::{AccessContextManager, 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 = AccessContextManager::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 = AccessLevel::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.access_policies().access_levels_patch(req, "name")
|
||||
/// .update_mask(&Default::default())
|
||||
/// .doit().await;
|
||||
///
|
||||
/// match result {
|
||||
/// Err(e) => match e {
|
||||
/// // The Error enum provides details about what exactly happened.
|
||||
/// // You can also just use its `Debug`, `Display` or `Error` traits
|
||||
/// Error::HttpError(_)
|
||||
/// |Error::Io(_)
|
||||
/// |Error::MissingAPIKey
|
||||
/// |Error::MissingToken(_)
|
||||
/// |Error::Cancelled
|
||||
/// |Error::UploadSizeLimitExceeded(_, _)
|
||||
/// |Error::Failure(_)
|
||||
/// |Error::BadRequest(_)
|
||||
/// |Error::FieldClash(_)
|
||||
/// |Error::JsonDecodeError(_, _) => println!("{}", e),
|
||||
/// },
|
||||
/// Ok(res) => println!("Success: {:?}", res),
|
||||
/// }
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Clone)]
|
||||
pub struct AccessContextManager<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 AccessContextManager<S> {}
|
||||
|
||||
impl<'a, S> AccessContextManager<S> {
|
||||
|
||||
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> AccessContextManager<S> {
|
||||
AccessContextManager {
|
||||
client,
|
||||
auth: Box::new(auth),
|
||||
_user_agent: "google-api-rust-client/5.0.3".to_string(),
|
||||
_base_url: "https://accesscontextmanager.googleapis.com/".to_string(),
|
||||
_root_url: "https://accesscontextmanager.googleapis.com/".to_string(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn access_policies(&'a self) -> AccessPolicyMethods<'a, S> {
|
||||
AccessPolicyMethods { hub: &self }
|
||||
}
|
||||
pub fn operations(&'a self) -> OperationMethods<'a, S> {
|
||||
OperationMethods { 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://accesscontextmanager.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://accesscontextmanager.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)
|
||||
}
|
||||
}
|
||||
@@ -1,372 +0,0 @@
|
||||
use super::*;
|
||||
/// A builder providing access to all methods supported on *accessPolicy* resources.
|
||||
/// It is not used directly, but through the [`AccessContextManager`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_accesscontextmanager1_beta as accesscontextmanager1_beta;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use accesscontextmanager1_beta::{AccessContextManager, 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 = AccessContextManager::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 `access_levels_create(...)`, `access_levels_delete(...)`, `access_levels_get(...)`, `access_levels_list(...)`, `access_levels_patch(...)`, `create(...)`, `delete(...)`, `get(...)`, `list(...)`, `patch(...)`, `service_perimeters_create(...)`, `service_perimeters_delete(...)`, `service_perimeters_get(...)`, `service_perimeters_list(...)` and `service_perimeters_patch(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.access_policies();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct AccessPolicyMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a AccessContextManager<S>,
|
||||
}
|
||||
|
||||
impl<'a, S> client::MethodsBuilder for AccessPolicyMethods<'a, S> {}
|
||||
|
||||
impl<'a, S> AccessPolicyMethods<'a, S> {
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Create an Access Level. The longrunning operation from this RPC will have a successful status once the Access Level has propagated to long-lasting storage. Access Levels containing errors will result in an error response for the first error encountered.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `parent` - Required. Resource name for the access policy which owns this Access Level. Format: `accessPolicies/{policy_id}`
|
||||
pub fn access_levels_create(&self, request: AccessLevel, parent: &str) -> AccessPolicyAccessLevelCreateCall<'a, S> {
|
||||
AccessPolicyAccessLevelCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_parent: parent.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Delete an Access Level by resource name. The longrunning operation from this RPC will have a successful status once the Access Level has been removed from long-lasting storage.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Resource name for the Access Level. Format: `accessPolicies/{policy_id}/accessLevels/{access_level_id}`
|
||||
pub fn access_levels_delete(&self, name: &str) -> AccessPolicyAccessLevelDeleteCall<'a, S> {
|
||||
AccessPolicyAccessLevelDeleteCall {
|
||||
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:
|
||||
///
|
||||
/// Get an Access Level by resource name.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Resource name for the Access Level. Format: `accessPolicies/{policy_id}/accessLevels/{access_level_id}`
|
||||
pub fn access_levels_get(&self, name: &str) -> AccessPolicyAccessLevelGetCall<'a, S> {
|
||||
AccessPolicyAccessLevelGetCall {
|
||||
hub: self.hub,
|
||||
_name: name.to_string(),
|
||||
_access_level_format: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// List all Access Levels for an access policy.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - Required. Resource name for the access policy to list Access Levels from. Format: `accessPolicies/{policy_id}`
|
||||
pub fn access_levels_list(&self, parent: &str) -> AccessPolicyAccessLevelListCall<'a, S> {
|
||||
AccessPolicyAccessLevelListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_access_level_format: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Update an Access Level. The longrunning operation from this RPC will have a successful status once the changes to the Access Level have propagated to long-lasting storage. Access Levels containing errors will result in an error response for the first error encountered.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Resource name for the `AccessLevel`. Format: `accessPolicies/{access_policy}/accessLevels/{access_level}`. The `access_level` component must begin with a letter, followed by alphanumeric characters or `_`. Its maximum length is 50 characters. After you create an `AccessLevel`, you cannot change its `name`.
|
||||
pub fn access_levels_patch(&self, request: AccessLevel, name: &str) -> AccessPolicyAccessLevelPatchCall<'a, S> {
|
||||
AccessPolicyAccessLevelPatchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_update_mask: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Create a Service Perimeter. The longrunning operation from this RPC will have a successful status once the Service Perimeter has propagated to long-lasting storage. Service Perimeters containing errors will result in an error response for the first error encountered.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `parent` - Required. Resource name for the access policy which owns this Service Perimeter. Format: `accessPolicies/{policy_id}`
|
||||
pub fn service_perimeters_create(&self, request: ServicePerimeter, parent: &str) -> AccessPolicyServicePerimeterCreateCall<'a, S> {
|
||||
AccessPolicyServicePerimeterCreateCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_parent: parent.to_string(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Delete a Service Perimeter by resource name. The longrunning operation from this RPC will have a successful status once the Service Perimeter has been removed from long-lasting storage.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Resource name for the Service Perimeter. Format: `accessPolicies/{policy_id}/servicePerimeters/{service_perimeter_id}`
|
||||
pub fn service_perimeters_delete(&self, name: &str) -> AccessPolicyServicePerimeterDeleteCall<'a, S> {
|
||||
AccessPolicyServicePerimeterDeleteCall {
|
||||
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:
|
||||
///
|
||||
/// Get a Service Perimeter by resource name.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Resource name for the Service Perimeter. Format: `accessPolicies/{policy_id}/servicePerimeters/{service_perimeters_id}`
|
||||
pub fn service_perimeters_get(&self, name: &str) -> AccessPolicyServicePerimeterGetCall<'a, S> {
|
||||
AccessPolicyServicePerimeterGetCall {
|
||||
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 Service Perimeters for an access policy.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `parent` - Required. Resource name for the access policy to list Service Perimeters from. Format: `accessPolicies/{policy_id}`
|
||||
pub fn service_perimeters_list(&self, parent: &str) -> AccessPolicyServicePerimeterListCall<'a, S> {
|
||||
AccessPolicyServicePerimeterListCall {
|
||||
hub: self.hub,
|
||||
_parent: parent.to_string(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Update a Service Perimeter. The longrunning operation from this RPC will have a successful status once the changes to the Service Perimeter have propagated to long-lasting storage. Service Perimeter containing errors will result in an error response for the first error encountered.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Resource name for the `ServicePerimeter`. Format: `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}`. The `service_perimeter` component must begin with a letter, followed by alphanumeric characters or `_`. After you create a `ServicePerimeter`, you cannot change its `name`.
|
||||
pub fn service_perimeters_patch(&self, request: ServicePerimeter, name: &str) -> AccessPolicyServicePerimeterPatchCall<'a, S> {
|
||||
AccessPolicyServicePerimeterPatchCall {
|
||||
hub: self.hub,
|
||||
_request: request,
|
||||
_name: name.to_string(),
|
||||
_update_mask: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Create an `AccessPolicy`. Fails if this organization already has a `AccessPolicy`. The longrunning Operation will have a successful status once the `AccessPolicy` has propagated to long-lasting storage. Syntactic and basic semantic errors will be returned in `metadata` as a BadRequest proto.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
pub fn create(&self, request: AccessPolicy) -> AccessPolicyCreateCall<'a, S> {
|
||||
AccessPolicyCreateCall {
|
||||
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 an AccessPolicy by resource name. The longrunning Operation will have a successful status once the AccessPolicy has been removed from long-lasting storage.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Resource name for the access policy to delete. Format `accessPolicies/{policy_id}`
|
||||
pub fn delete(&self, name: &str) -> AccessPolicyDeleteCall<'a, S> {
|
||||
AccessPolicyDeleteCall {
|
||||
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:
|
||||
///
|
||||
/// Get an AccessPolicy by name.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `name` - Required. Resource name for the access policy to get. Format `accessPolicies/{policy_id}`
|
||||
pub fn get(&self, name: &str) -> AccessPolicyGetCall<'a, S> {
|
||||
AccessPolicyGetCall {
|
||||
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 AccessPolicies under a container.
|
||||
pub fn list(&self) -> AccessPolicyListCall<'a, S> {
|
||||
AccessPolicyListCall {
|
||||
hub: self.hub,
|
||||
_parent: Default::default(),
|
||||
_page_token: Default::default(),
|
||||
_page_size: Default::default(),
|
||||
_delegate: Default::default(),
|
||||
_additional_params: Default::default(),
|
||||
_scopes: Default::default(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a builder to help you perform the following task:
|
||||
///
|
||||
/// Update an AccessPolicy. The longrunning Operation from this RPC will have a successful status once the changes to the AccessPolicy have propagated to long-lasting storage. Syntactic and basic semantic errors will be returned in `metadata` as a BadRequest proto.
|
||||
///
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `request` - No description provided.
|
||||
/// * `name` - Output only. Resource name of the `AccessPolicy`. Format: `accessPolicies/{policy_id}`
|
||||
pub fn patch(&self, request: AccessPolicy, name: &str) -> AccessPolicyPatchCall<'a, S> {
|
||||
AccessPolicyPatchCall {
|
||||
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 *operation* resources.
|
||||
/// It is not used directly, but through the [`AccessContextManager`] hub.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// Instantiate a resource builder
|
||||
///
|
||||
/// ```test_harness,no_run
|
||||
/// extern crate hyper;
|
||||
/// extern crate hyper_rustls;
|
||||
/// extern crate google_accesscontextmanager1_beta as accesscontextmanager1_beta;
|
||||
///
|
||||
/// # async fn dox() {
|
||||
/// use std::default::Default;
|
||||
/// use accesscontextmanager1_beta::{AccessContextManager, 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 = AccessContextManager::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
|
||||
/// // Usually you wouldn't bind this to a variable, but keep calling *CallBuilders*
|
||||
/// // like `get(...)`
|
||||
/// // to build up your call.
|
||||
/// let rb = hub.operations();
|
||||
/// # }
|
||||
/// ```
|
||||
pub struct OperationMethods<'a, S>
|
||||
where S: 'a {
|
||||
|
||||
pub(super) hub: &'a AccessContextManager<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(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,35 +0,0 @@
|
||||
use std::collections::HashMap;
|
||||
use std::cell::RefCell;
|
||||
use std::default::Default;
|
||||
use std::collections::BTreeSet;
|
||||
use std::error::Error as StdError;
|
||||
use serde_json as json;
|
||||
use std::io;
|
||||
use std::fs;
|
||||
use std::mem;
|
||||
|
||||
use hyper::client::connect;
|
||||
use tokio::io::{AsyncRead, AsyncWrite};
|
||||
use tokio::time::sleep;
|
||||
use tower_service;
|
||||
use serde::{Serialize, Deserialize};
|
||||
|
||||
use crate::{client, client::GetToken, client::serde_with};
|
||||
|
||||
mod utilities;
|
||||
pub use utilities::*;
|
||||
|
||||
mod hub;
|
||||
pub use hub::*;
|
||||
|
||||
mod schemas;
|
||||
pub use schemas::*;
|
||||
|
||||
mod method_builders;
|
||||
pub use method_builders::*;
|
||||
|
||||
mod call_builders;
|
||||
pub use call_builders::*;
|
||||
|
||||
mod enums;
|
||||
pub use enums::*;
|
||||
@@ -1,434 +0,0 @@
|
||||
use super::*;
|
||||
/// An `AccessLevel` is a label that can be applied to requests to Google Cloud services, along with a list of requirements necessary for the label to be applied.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [access levels create access policies](AccessPolicyAccessLevelCreateCall) (request)
|
||||
/// * [access levels get access policies](AccessPolicyAccessLevelGetCall) (response)
|
||||
/// * [access levels patch access policies](AccessPolicyAccessLevelPatchCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct AccessLevel {
|
||||
/// A `BasicLevel` composed of `Conditions`.
|
||||
|
||||
pub basic: Option<BasicLevel>,
|
||||
/// A `CustomLevel` written in the Common Expression Language.
|
||||
|
||||
pub custom: Option<CustomLevel>,
|
||||
/// Description of the `AccessLevel` and its use. Does not affect behavior.
|
||||
|
||||
pub description: Option<String>,
|
||||
/// Resource name for the `AccessLevel`. Format: `accessPolicies/{access_policy}/accessLevels/{access_level}`. The `access_level` component must begin with a letter, followed by alphanumeric characters or `_`. Its maximum length is 50 characters. After you create an `AccessLevel`, you cannot change its `name`.
|
||||
|
||||
pub name: Option<String>,
|
||||
/// Human readable title. Must be unique within the Policy.
|
||||
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for AccessLevel {}
|
||||
impl client::ResponseResult for AccessLevel {}
|
||||
|
||||
|
||||
/// `AccessPolicy` is a container for `AccessLevels` (which define the necessary attributes to use Google Cloud services) and `ServicePerimeters` (which define regions of services able to freely pass data within a perimeter). An access policy is globally visible within an organization, and the restrictions it specifies apply to all projects within an organization.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [create access policies](AccessPolicyCreateCall) (request)
|
||||
/// * [get access policies](AccessPolicyGetCall) (response)
|
||||
/// * [patch access policies](AccessPolicyPatchCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct AccessPolicy {
|
||||
/// Output only. Resource name of the `AccessPolicy`. Format: `accessPolicies/{policy_id}`
|
||||
|
||||
pub name: Option<String>,
|
||||
/// Required. The parent of this `AccessPolicy` in the Cloud Resource Hierarchy. Currently immutable once created. Format: `organizations/{organization_id}`
|
||||
|
||||
pub parent: Option<String>,
|
||||
/// Required. Human readable title. Does not affect behavior.
|
||||
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for AccessPolicy {}
|
||||
impl client::ResponseResult for AccessPolicy {}
|
||||
|
||||
|
||||
/// `BasicLevel` is an `AccessLevel` using a set of recommended features.
|
||||
///
|
||||
/// 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 BasicLevel {
|
||||
/// How the `conditions` list should be combined to determine if a request is granted this `AccessLevel`. If AND is used, each `Condition` in `conditions` must be satisfied for the `AccessLevel` to be applied. If OR is used, at least one `Condition` in `conditions` must be satisfied for the `AccessLevel` to be applied. Default behavior is AND.
|
||||
#[serde(rename="combiningFunction")]
|
||||
|
||||
pub combining_function: Option<BasicLevelCombiningFunctionEnum>,
|
||||
/// Required. A list of requirements for the `AccessLevel` to be granted.
|
||||
|
||||
pub conditions: Option<Vec<Condition>>,
|
||||
}
|
||||
|
||||
impl client::Part for BasicLevel {}
|
||||
|
||||
|
||||
/// A condition necessary for an `AccessLevel` to be granted. The Condition is an AND over its fields. So a Condition is true if: 1) the request IP is from one of the listed subnetworks AND 2) the originating device complies with the listed device policy AND 3) all listed access levels are granted AND 4) the request was sent at a time allowed by the DateTimeRestriction.
|
||||
///
|
||||
/// 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 Condition {
|
||||
/// Device specific restrictions, all restrictions must hold for the Condition to be true. If not specified, all devices are allowed.
|
||||
#[serde(rename="devicePolicy")]
|
||||
|
||||
pub device_policy: Option<DevicePolicy>,
|
||||
/// CIDR block IP subnetwork specification. May be IPv4 or IPv6. Note that for a CIDR IP address block, the specified IP address portion must be properly truncated (i.e. all the host bits must be zero) or the input is considered malformed. For example, "192.0.2.0/24" is accepted but "192.0.2.1/24" is not. Similarly, for IPv6, "2001:db8::/32" is accepted whereas "2001:db8::1/32" is not. The originating IP of a request must be in one of the listed subnets in order for this Condition to be true. If empty, all IP addresses are allowed.
|
||||
#[serde(rename="ipSubnetworks")]
|
||||
|
||||
pub ip_subnetworks: Option<Vec<String>>,
|
||||
/// The request must be made by one of the provided user or service accounts. Groups are not supported. Syntax: `user:{emailid}` `serviceAccount:{emailid}` If not specified, a request may come from any user.
|
||||
|
||||
pub members: Option<Vec<String>>,
|
||||
/// Whether to negate the Condition. If true, the Condition becomes a NAND over its non-empty fields, each field must be false for the Condition overall to be satisfied. Defaults to false.
|
||||
|
||||
pub negate: Option<bool>,
|
||||
/// The request must originate from one of the provided countries/regions. Must be valid ISO 3166-1 alpha-2 codes.
|
||||
|
||||
pub regions: Option<Vec<String>>,
|
||||
/// A list of other access levels defined in the same `Policy`, referenced by resource name. Referencing an `AccessLevel` which does not exist is an error. All access levels listed must be granted for the Condition to be true. Example: "`accessPolicies/MY_POLICY/accessLevels/LEVEL_NAME"`
|
||||
#[serde(rename="requiredAccessLevels")]
|
||||
|
||||
pub required_access_levels: Option<Vec<String>>,
|
||||
}
|
||||
|
||||
impl client::Part for Condition {}
|
||||
|
||||
|
||||
/// `CustomLevel` is an `AccessLevel` using the Cloud Common Expression Language to represent the necessary conditions for the level to apply to a request. See CEL spec at: https://github.com/google/cel-spec
|
||||
///
|
||||
/// 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 CustomLevel {
|
||||
/// Required. A Cloud CEL expression evaluating to a boolean.
|
||||
|
||||
pub expr: Option<Expr>,
|
||||
}
|
||||
|
||||
impl client::Part for CustomLevel {}
|
||||
|
||||
|
||||
/// `DevicePolicy` specifies device specific restrictions necessary to acquire a given access level. A `DevicePolicy` specifies requirements for requests from devices to be granted access levels, it does not do any enforcement on the device. `DevicePolicy` acts as an AND over all specified fields, and each repeated field is an OR over its elements. Any unset fields are ignored. For example, if the proto is { os_type : DESKTOP_WINDOWS, os_type : DESKTOP_LINUX, encryption_status: ENCRYPTED}, then the DevicePolicy will be true for requests originating from encrypted Linux desktops and encrypted Windows desktops.
|
||||
///
|
||||
/// 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 DevicePolicy {
|
||||
/// Allowed device management levels, an empty list allows all management levels.
|
||||
#[serde(rename="allowedDeviceManagementLevels")]
|
||||
|
||||
pub allowed_device_management_levels: Option<Vec<DevicePolicyAllowedDeviceManagementLevelsEnum>>,
|
||||
/// Allowed encryptions statuses, an empty list allows all statuses.
|
||||
#[serde(rename="allowedEncryptionStatuses")]
|
||||
|
||||
pub allowed_encryption_statuses: Option<Vec<DevicePolicyAllowedEncryptionStatusesEnum>>,
|
||||
/// Allowed OS versions, an empty list allows all types and all versions.
|
||||
#[serde(rename="osConstraints")]
|
||||
|
||||
pub os_constraints: Option<Vec<OsConstraint>>,
|
||||
/// Whether the device needs to be approved by the customer admin.
|
||||
#[serde(rename="requireAdminApproval")]
|
||||
|
||||
pub require_admin_approval: Option<bool>,
|
||||
/// Whether the device needs to be corp owned.
|
||||
#[serde(rename="requireCorpOwned")]
|
||||
|
||||
pub require_corp_owned: Option<bool>,
|
||||
/// Whether or not screenlock is required for the DevicePolicy to be true. Defaults to `false`.
|
||||
#[serde(rename="requireScreenlock")]
|
||||
|
||||
pub require_screenlock: Option<bool>,
|
||||
}
|
||||
|
||||
impl client::Part for DevicePolicy {}
|
||||
|
||||
|
||||
/// Represents a textual expression in the Common Expression Language (CEL) syntax. CEL is a C-like expression language. The syntax and semantics of CEL are documented at https://github.com/google/cel-spec. Example (Comparison): title: "Summary size limit" description: "Determines if a summary is less than 100 chars" expression: "document.summary.size() < 100" Example (Equality): title: "Requestor is owner" description: "Determines if requestor is the document owner" expression: "document.owner == request.auth.claims.email" Example (Logic): title: "Public documents" description: "Determine whether the document should be publicly visible" expression: "document.type != 'private' && document.type != 'internal'" Example (Data Manipulation): title: "Notification string" description: "Create a notification string with a timestamp." expression: "'New message received at ' + string(document.create_time)" The exact variables and functions that may be referenced within an expression are determined by the service that evaluates it. See the service documentation for additional information.
|
||||
///
|
||||
/// This type is not used in any activity, and only used as *part* of another schema.
|
||||
///
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Expr {
|
||||
/// Optional. Description of the expression. This is a longer text which describes the expression, e.g. when hovered over it in a UI.
|
||||
|
||||
pub description: Option<String>,
|
||||
/// Textual representation of an expression in Common Expression Language syntax.
|
||||
|
||||
pub expression: Option<String>,
|
||||
/// Optional. String indicating the location of the expression for error reporting, e.g. a file name and a position in the file.
|
||||
|
||||
pub location: Option<String>,
|
||||
/// Optional. Title for the expression, i.e. a short string describing its purpose. This can be used e.g. in UIs which allow to enter the expression.
|
||||
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for Expr {}
|
||||
|
||||
|
||||
/// A response to `ListAccessLevelsRequest`.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [access levels list access policies](AccessPolicyAccessLevelListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListAccessLevelsResponse {
|
||||
/// List of the Access Level instances.
|
||||
#[serde(rename="accessLevels")]
|
||||
|
||||
pub access_levels: Option<Vec<AccessLevel>>,
|
||||
/// The pagination token to retrieve the next page of results. If the value is empty, no further results remain.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListAccessLevelsResponse {}
|
||||
|
||||
|
||||
/// A response to `ListAccessPoliciesRequest`.
|
||||
///
|
||||
/// # Activities
|
||||
///
|
||||
/// This type is used in activities, which are methods you may call on this type or where this type is involved in.
|
||||
/// The list links the activity name, along with information about where it is used (one of *request* and *response*).
|
||||
///
|
||||
/// * [list access policies](AccessPolicyListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListAccessPoliciesResponse {
|
||||
/// List of the AccessPolicy instances.
|
||||
#[serde(rename="accessPolicies")]
|
||||
|
||||
pub access_policies: Option<Vec<AccessPolicy>>,
|
||||
/// The pagination token to retrieve the next page of results. If the value is empty, no further results remain.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListAccessPoliciesResponse {}
|
||||
|
||||
|
||||
/// A response to `ListServicePerimetersRequest`.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [service perimeters list access policies](AccessPolicyServicePerimeterListCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ListServicePerimetersResponse {
|
||||
/// The pagination token to retrieve the next page of results. If the value is empty, no further results remain.
|
||||
#[serde(rename="nextPageToken")]
|
||||
|
||||
pub next_page_token: Option<String>,
|
||||
/// List of the Service Perimeter instances.
|
||||
#[serde(rename="servicePerimeters")]
|
||||
|
||||
pub service_perimeters: Option<Vec<ServicePerimeter>>,
|
||||
}
|
||||
|
||||
impl client::ResponseResult for ListServicePerimetersResponse {}
|
||||
|
||||
|
||||
/// This resource represents a long-running operation that is the result of a network API call.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [access levels create access policies](AccessPolicyAccessLevelCreateCall) (response)
|
||||
/// * [access levels delete access policies](AccessPolicyAccessLevelDeleteCall) (response)
|
||||
/// * [access levels patch access policies](AccessPolicyAccessLevelPatchCall) (response)
|
||||
/// * [service perimeters create access policies](AccessPolicyServicePerimeterCreateCall) (response)
|
||||
/// * [service perimeters delete access policies](AccessPolicyServicePerimeterDeleteCall) (response)
|
||||
/// * [service perimeters patch access policies](AccessPolicyServicePerimeterPatchCall) (response)
|
||||
/// * [create access policies](AccessPolicyCreateCall) (response)
|
||||
/// * [delete access policies](AccessPolicyDeleteCall) (response)
|
||||
/// * [patch access policies](AccessPolicyPatchCall) (response)
|
||||
/// * [get operations](OperationGetCall) (response)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct Operation {
|
||||
/// If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
|
||||
|
||||
pub done: Option<bool>,
|
||||
/// The error result of the operation in case of failure or cancellation.
|
||||
|
||||
pub error: Option<Status>,
|
||||
/// Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
|
||||
|
||||
pub metadata: Option<HashMap<String, json::Value>>,
|
||||
/// The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
|
||||
|
||||
pub name: Option<String>,
|
||||
/// The normal response of the operation in case of success. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
|
||||
|
||||
pub response: Option<HashMap<String, json::Value>>,
|
||||
}
|
||||
|
||||
impl client::Resource for Operation {}
|
||||
impl client::ResponseResult for Operation {}
|
||||
|
||||
|
||||
/// A restriction on the OS type and version of devices making requests.
|
||||
///
|
||||
/// 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 OsConstraint {
|
||||
/// The minimum allowed OS version. If not set, any version of this OS satisfies the constraint. Format: `"major.minor.patch"`. Examples: `"10.5.301"`, `"9.2.1"`.
|
||||
#[serde(rename="minimumVersion")]
|
||||
|
||||
pub minimum_version: Option<String>,
|
||||
/// Required. The allowed OS type.
|
||||
#[serde(rename="osType")]
|
||||
|
||||
pub os_type: Option<OsConstraintOsTypeEnum>,
|
||||
/// Only allows requests from devices with a verified Chrome OS. Verifications includes requirements that the device is enterprise-managed, conformant to domain policies, and the caller has permission to call the API targeted by the request.
|
||||
#[serde(rename="requireVerifiedChromeOs")]
|
||||
|
||||
pub require_verified_chrome_os: Option<bool>,
|
||||
}
|
||||
|
||||
impl client::Part for OsConstraint {}
|
||||
|
||||
|
||||
/// `ServicePerimeter` describes a set of Google Cloud resources which can freely import and export data amongst themselves, but not export outside of the `ServicePerimeter`. If a request with a source within this `ServicePerimeter` has a target outside of the `ServicePerimeter`, the request will be blocked. Otherwise the request is allowed. There are two types of Service Perimeter - Regular and Bridge. Regular Service Perimeters cannot overlap, a single Google Cloud project can only belong to a single regular Service Perimeter. Service Perimeter Bridges can contain only Google Cloud projects as members, a single Google Cloud project may belong to multiple Service Perimeter Bridges.
|
||||
///
|
||||
/// # 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*).
|
||||
///
|
||||
/// * [service perimeters create access policies](AccessPolicyServicePerimeterCreateCall) (request)
|
||||
/// * [service perimeters get access policies](AccessPolicyServicePerimeterGetCall) (response)
|
||||
/// * [service perimeters patch access policies](AccessPolicyServicePerimeterPatchCall) (request)
|
||||
#[serde_with::serde_as(crate = "::client::serde_with")]
|
||||
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
|
||||
pub struct ServicePerimeter {
|
||||
/// Description of the `ServicePerimeter` and its use. Does not affect behavior.
|
||||
|
||||
pub description: Option<String>,
|
||||
/// Resource name for the `ServicePerimeter`. Format: `accessPolicies/{access_policy}/servicePerimeters/{service_perimeter}`. The `service_perimeter` component must begin with a letter, followed by alphanumeric characters or `_`. After you create a `ServicePerimeter`, you cannot change its `name`.
|
||||
|
||||
pub name: Option<String>,
|
||||
/// Perimeter type indicator. A single project is allowed to be a member of single regular perimeter, but multiple service perimeter bridges. A project cannot be a included in a perimeter bridge without being included in regular perimeter. For perimeter bridges, restricted/unrestricted service lists as well as access lists must be empty.
|
||||
#[serde(rename="perimeterType")]
|
||||
|
||||
pub perimeter_type: Option<ServicePerimeterPerimeterTypeEnum>,
|
||||
/// Current ServicePerimeter configuration. Specifies sets of resources, restricted/unrestricted services and access levels that determine perimeter content and boundaries.
|
||||
|
||||
pub status: Option<ServicePerimeterConfig>,
|
||||
/// Human readable title. Must be unique within the Policy.
|
||||
|
||||
pub title: Option<String>,
|
||||
}
|
||||
|
||||
impl client::RequestValue for ServicePerimeter {}
|
||||
impl client::ResponseResult for ServicePerimeter {}
|
||||
|
||||
|
||||
/// `ServicePerimeterConfig` specifies a set of Google Cloud resources that describe specific Service Perimeter configuration.
|
||||
///
|
||||
/// 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 ServicePerimeterConfig {
|
||||
/// A list of `AccessLevel` resource names that allow resources within the `ServicePerimeter` to be accessed from the internet. `AccessLevels` listed must be in the same policy as this `ServicePerimeter`. Referencing a nonexistent `AccessLevel` is a syntax error. If no `AccessLevel` names are listed, resources within the perimeter can only be accessed via Google Cloud calls with request origins within the perimeter. Example: `"accessPolicies/MY_POLICY/accessLevels/MY_LEVEL"`. For Service Perimeter Bridge, must be empty.
|
||||
#[serde(rename="accessLevels")]
|
||||
|
||||
pub access_levels: Option<Vec<String>>,
|
||||
/// A list of Google Cloud resources that are inside of the service perimeter. Currently only projects are allowed. Format: `projects/{project_number}`
|
||||
|
||||
pub resources: Option<Vec<String>>,
|
||||
/// Google Cloud services that are subject to the Service Perimeter restrictions. Must contain a list of services. For example, if `storage.googleapis.com` is specified, access to the storage buckets inside the perimeter must meet the perimeter's access restrictions.
|
||||
#[serde(rename="restrictedServices")]
|
||||
|
||||
pub restricted_services: Option<Vec<String>>,
|
||||
/// Google Cloud services that are not subject to the Service Perimeter restrictions. Deprecated. Must be set to a single wildcard "*". The wildcard means that unless explicitly specified by "restricted_services" list, any service is treated as unrestricted.
|
||||
#[serde(rename="unrestrictedServices")]
|
||||
|
||||
pub unrestricted_services: Option<Vec<String>>,
|
||||
/// Beta. Configuration for APIs allowed within Perimeter.
|
||||
#[serde(rename="vpcAccessibleServices")]
|
||||
|
||||
pub vpc_accessible_services: Option<VpcAccessibleServices>,
|
||||
}
|
||||
|
||||
impl client::Part for ServicePerimeterConfig {}
|
||||
|
||||
|
||||
/// The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
|
||||
///
|
||||
/// 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 Status {
|
||||
/// The status code, which should be an enum value of google.rpc.Code.
|
||||
|
||||
pub code: Option<i32>,
|
||||
/// A list of messages that carry the error details. There is a common set of message types for APIs to use.
|
||||
|
||||
pub details: Option<Vec<HashMap<String, json::Value>>>,
|
||||
/// A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
|
||||
|
||||
pub message: Option<String>,
|
||||
}
|
||||
|
||||
impl client::Part for Status {}
|
||||
|
||||
|
||||
/// Specifies how APIs are allowed to communicate within the Service Perimeter.
|
||||
///
|
||||
/// 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 VpcAccessibleServices {
|
||||
/// The list of APIs usable within the Service Perimeter. Must be empty unless 'enable_restriction' is True. You can specify a list of individual services, as well as include the 'RESTRICTED-SERVICES' value, which automatically includes all of the services protected by the perimeter.
|
||||
#[serde(rename="allowedServices")]
|
||||
|
||||
pub allowed_services: Option<Vec<String>>,
|
||||
/// Whether to restrict API calls within the Service Perimeter to the list of APIs specified in 'allowed_services'.
|
||||
#[serde(rename="enableRestriction")]
|
||||
|
||||
pub enable_restriction: Option<bool>,
|
||||
}
|
||||
|
||||
impl client::Part for VpcAccessibleServices {}
|
||||
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
use super::*;
|
||||
/// Identifies the an OAuth2 authorization scope.
|
||||
/// A scope is needed when requesting an
|
||||
/// [authorization token](https://developers.google.com/youtube/v3/guides/authentication).
|
||||
#[derive(PartialEq, Eq, Hash, Debug, Clone)]
|
||||
pub enum Scope {
|
||||
/// See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,215 +0,0 @@
|
||||
// DO NOT EDIT !
|
||||
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
//! This documentation was generated from *Access Context Manager* crate version *5.0.4+20230123*, where *20230123* is the exact revision of the *accesscontextmanager:v1beta* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
|
||||
//!
|
||||
//! Everything else about the *Access Context Manager* *v1_beta* API can be found at the
|
||||
//! [official documentation site](https://cloud.google.com/access-context-manager/docs/reference/rest/).
|
||||
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/accesscontextmanager1_beta).
|
||||
//! # Features
|
||||
//!
|
||||
//! Handle the following *Resources* with ease from the central [hub](AccessContextManager) ...
|
||||
//!
|
||||
//! * [access policies](api::AccessPolicy)
|
||||
//! * [*access levels create*](api::AccessPolicyAccessLevelCreateCall), [*access levels delete*](api::AccessPolicyAccessLevelDeleteCall), [*access levels get*](api::AccessPolicyAccessLevelGetCall), [*access levels list*](api::AccessPolicyAccessLevelListCall), [*access levels patch*](api::AccessPolicyAccessLevelPatchCall), [*create*](api::AccessPolicyCreateCall), [*delete*](api::AccessPolicyDeleteCall), [*get*](api::AccessPolicyGetCall), [*list*](api::AccessPolicyListCall), [*patch*](api::AccessPolicyPatchCall), [*service perimeters create*](api::AccessPolicyServicePerimeterCreateCall), [*service perimeters delete*](api::AccessPolicyServicePerimeterDeleteCall), [*service perimeters get*](api::AccessPolicyServicePerimeterGetCall), [*service perimeters list*](api::AccessPolicyServicePerimeterListCall) and [*service perimeters patch*](api::AccessPolicyServicePerimeterPatchCall)
|
||||
//! * [operations](api::Operation)
|
||||
//! * [*get*](api::OperationGetCall)
|
||||
//!
|
||||
//!
|
||||
//!
|
||||
//!
|
||||
//! Not what you are looking for ? Find all other Google APIs in their Rust [documentation index](http://byron.github.io/google-apis-rs).
|
||||
//!
|
||||
//! # Structure of this Library
|
||||
//!
|
||||
//! The API is structured into the following primary items:
|
||||
//!
|
||||
//! * **[Hub](AccessContextManager)**
|
||||
//! * a central object to maintain state and allow accessing all *Activities*
|
||||
//! * creates [*Method Builders*](client::MethodsBuilder) which in turn
|
||||
//! allow access to individual [*Call Builders*](client::CallBuilder)
|
||||
//! * **[Resources](client::Resource)**
|
||||
//! * primary types that you can apply *Activities* to
|
||||
//! * a collection of properties and *Parts*
|
||||
//! * **[Parts](client::Part)**
|
||||
//! * a collection of properties
|
||||
//! * never directly used in *Activities*
|
||||
//! * **[Activities](client::CallBuilder)**
|
||||
//! * operations to apply to *Resources*
|
||||
//!
|
||||
//! All *structures* are marked with applicable traits to further categorize them and ease browsing.
|
||||
//!
|
||||
//! Generally speaking, you can invoke *Activities* like this:
|
||||
//!
|
||||
//! ```Rust,ignore
|
||||
//! let r = hub.resource().activity(...).doit().await
|
||||
//! ```
|
||||
//!
|
||||
//! Or specifically ...
|
||||
//!
|
||||
//! ```ignore
|
||||
//! let r = hub.access_policies().access_levels_create(...).doit().await
|
||||
//! let r = hub.access_policies().access_levels_delete(...).doit().await
|
||||
//! let r = hub.access_policies().access_levels_patch(...).doit().await
|
||||
//! let r = hub.access_policies().service_perimeters_create(...).doit().await
|
||||
//! let r = hub.access_policies().service_perimeters_delete(...).doit().await
|
||||
//! let r = hub.access_policies().service_perimeters_patch(...).doit().await
|
||||
//! let r = hub.access_policies().create(...).doit().await
|
||||
//! let r = hub.access_policies().delete(...).doit().await
|
||||
//! let r = hub.access_policies().patch(...).doit().await
|
||||
//! let r = hub.operations().get(...).doit().await
|
||||
//! ```
|
||||
//!
|
||||
//! The `resource()` and `activity(...)` calls create [builders][builder-pattern]. The second one dealing with `Activities`
|
||||
//! supports various methods to configure the impending operation (not shown here). It is made such that all required arguments have to be
|
||||
//! specified right away (i.e. `(...)`), whereas all optional ones can be [build up][builder-pattern] as desired.
|
||||
//! The `doit()` method performs the actual communication with the server and returns the respective result.
|
||||
//!
|
||||
//! # Usage
|
||||
//!
|
||||
//! ## Setting up your Project
|
||||
//!
|
||||
//! To use this library, you would put the following lines into your `Cargo.toml` file:
|
||||
//!
|
||||
//! ```toml
|
||||
//! [dependencies]
|
||||
//! google-accesscontextmanager1_beta = "*"
|
||||
//! serde = "^1.0"
|
||||
//! serde_json = "^1.0"
|
||||
//! ```
|
||||
//!
|
||||
//! ## A complete example
|
||||
//!
|
||||
//! ```test_harness,no_run
|
||||
//! extern crate hyper;
|
||||
//! extern crate hyper_rustls;
|
||||
//! extern crate google_accesscontextmanager1_beta as accesscontextmanager1_beta;
|
||||
//! use accesscontextmanager1_beta::api::AccessLevel;
|
||||
//! use accesscontextmanager1_beta::{Result, Error};
|
||||
//! # async fn dox() {
|
||||
//! use std::default::Default;
|
||||
//! use accesscontextmanager1_beta::{AccessContextManager, 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 = AccessContextManager::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 = AccessLevel::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.access_policies().access_levels_patch(req, "name")
|
||||
//! .update_mask(&Default::default())
|
||||
//! .doit().await;
|
||||
//!
|
||||
//! match result {
|
||||
//! Err(e) => match e {
|
||||
//! // The Error enum provides details about what exactly happened.
|
||||
//! // You can also just use its `Debug`, `Display` or `Error` traits
|
||||
//! Error::HttpError(_)
|
||||
//! |Error::Io(_)
|
||||
//! |Error::MissingAPIKey
|
||||
//! |Error::MissingToken(_)
|
||||
//! |Error::Cancelled
|
||||
//! |Error::UploadSizeLimitExceeded(_, _)
|
||||
//! |Error::Failure(_)
|
||||
//! |Error::BadRequest(_)
|
||||
//! |Error::FieldClash(_)
|
||||
//! |Error::JsonDecodeError(_, _) => println!("{}", e),
|
||||
//! },
|
||||
//! Ok(res) => println!("Success: {:?}", res),
|
||||
//! }
|
||||
//! # }
|
||||
//! ```
|
||||
//! ## Handling Errors
|
||||
//!
|
||||
//! All errors produced by the system are provided either as [Result](client::Result) enumeration as return value of
|
||||
//! the doit() methods, or handed as possibly intermediate results to either the
|
||||
//! [Hub Delegate](client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
|
||||
//!
|
||||
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
|
||||
//! makes the system potentially resilient to all kinds of errors.
|
||||
//!
|
||||
//! ## Uploads and Downloads
|
||||
//! If a method supports downloads, the response body, which is part of the [Result](client::Result), should be
|
||||
//! read by you to obtain the media.
|
||||
//! If such a method also supports a [Response Result](client::ResponseResult), it will return that by default.
|
||||
//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
|
||||
//! this call: `.param("alt", "media")`.
|
||||
//!
|
||||
//! Methods supporting uploads can do so using up to 2 different protocols:
|
||||
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
|
||||
//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
|
||||
//!
|
||||
//! ## Customization and Callbacks
|
||||
//!
|
||||
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
|
||||
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
|
||||
//! Respective methods will be called to provide progress information, as well as determine whether the system should
|
||||
//! retry on failure.
|
||||
//!
|
||||
//! The [delegate trait](client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
|
||||
//!
|
||||
//! ## Optional Parts in Server-Requests
|
||||
//!
|
||||
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
|
||||
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
|
||||
//! are valid.
|
||||
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
|
||||
//! the server to indicate either the set parts of the request or the desired parts in the response.
|
||||
//!
|
||||
//! ## Builder Arguments
|
||||
//!
|
||||
//! Using [method builders](client::CallBuilder), you are able to prepare an action call by repeatedly calling it's methods.
|
||||
//! These will always take a single argument, for which the following statements are true.
|
||||
//!
|
||||
//! * [PODs][wiki-pod] are handed by copy
|
||||
//! * strings are passed as `&str`
|
||||
//! * [request values](client::RequestValue) are moved
|
||||
//!
|
||||
//! Arguments will always be copied or cloned into the builder, to make them independent of their original life times.
|
||||
//!
|
||||
//! [wiki-pod]: http://en.wikipedia.org/wiki/Plain_old_data_structure
|
||||
//! [builder-pattern]: http://en.wikipedia.org/wiki/Builder_pattern
|
||||
//! [google-go-api]: https://github.com/google/google-api-go-client
|
||||
//!
|
||||
//!
|
||||
|
||||
// Unused attributes happen thanks to defined, but unused structures
|
||||
// We don't warn about this, as depending on the API, some data structures or facilities are never used.
|
||||
// Instead of pre-determining this, we just disable the lint. It's manually tuned to not have any
|
||||
// unused imports in fully featured APIs. Same with unused_mut ... .
|
||||
#![allow(unused_imports, unused_mut, dead_code)]
|
||||
|
||||
// DO NOT EDIT !
|
||||
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
|
||||
// DO NOT EDIT !
|
||||
|
||||
// Re-export the hyper and hyper_rustls crate, they are required to build the hub
|
||||
pub use hyper;
|
||||
pub use hyper_rustls;
|
||||
pub extern crate google_apis_common as client;
|
||||
pub use client::chrono;
|
||||
pub mod api;
|
||||
|
||||
// Re-export the hub type and some basic client structs
|
||||
pub use api::AccessContextManager;
|
||||
pub use client::{Result, Error, Delegate, FieldMask};
|
||||
|
||||
// Re-export the yup_oauth2 crate, that is required to call some methods of the hub and the client
|
||||
#[cfg(feature = "yup-oauth2")]
|
||||
pub use client::oauth2;
|
||||
Reference in New Issue
Block a user