make regen-apis

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

View File

@@ -0,0 +1,113 @@
use super::*;
/// Central instance to access all CloudKMS related resource activities
///
/// # Examples
///
/// Instantiate a new hub
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_cloudkms1_beta1 as cloudkms1_beta1;
/// use cloudkms1_beta1::api::CryptoKeyVersion;
/// use cloudkms1_beta1::{Result, Error};
/// # async fn dox() {
/// use std::default::Default;
/// use cloudkms1_beta1::{CloudKMS, 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 = CloudKMS::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 = CryptoKeyVersion::default();
///
/// // You can configure optional parameters by calling the respective setters at will, and
/// // execute the final call using `doit()`.
/// // Values shown here are possibly random and not representative !
/// let result = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_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 CloudKMS<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 CloudKMS<S> {}
impl<'a, S> CloudKMS<S> {
pub fn new<A: 'static + client::GetToken>(client: hyper::Client<S, hyper::body::Body>, auth: A) -> CloudKMS<S> {
CloudKMS {
client,
auth: Box::new(auth),
_user_agent: "google-api-rust-client/5.0.3".to_string(),
_base_url: "https://cloudkms.googleapis.com/".to_string(),
_root_url: "https://cloudkms.googleapis.com/".to_string(),
}
}
pub fn projects(&'a self) -> ProjectMethods<'a, S> {
ProjectMethods { hub: &self }
}
/// Set the user-agent header field to use in all requests to the server.
/// It defaults to `google-api-rust-client/5.0.3`.
///
/// Returns the previously set user-agent.
pub fn user_agent(&mut self, agent_name: String) -> String {
mem::replace(&mut self._user_agent, agent_name)
}
/// Set the base url to use in all requests to the server.
/// It defaults to `https://cloudkms.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://cloudkms.googleapis.com/`.
///
/// Returns the previously set root url.
pub fn root_url(&mut self, new_root_url: String) -> String {
mem::replace(&mut self._root_url, new_root_url)
}
}

View File

@@ -0,0 +1,557 @@
use super::*;
/// A builder providing access to all methods supported on *project* resources.
/// It is not used directly, but through the [`CloudKMS`] hub.
///
/// # Example
///
/// Instantiate a resource builder
///
/// ```test_harness,no_run
/// extern crate hyper;
/// extern crate hyper_rustls;
/// extern crate google_cloudkms1_beta1 as cloudkms1_beta1;
///
/// # async fn dox() {
/// use std::default::Default;
/// use cloudkms1_beta1::{CloudKMS, 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 = CloudKMS::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 `locations_get(...)`, `locations_key_rings_create(...)`, `locations_key_rings_crypto_keys_create(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_create(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_destroy(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_get(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_list(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_patch(...)`, `locations_key_rings_crypto_keys_crypto_key_versions_restore(...)`, `locations_key_rings_crypto_keys_decrypt(...)`, `locations_key_rings_crypto_keys_encrypt(...)`, `locations_key_rings_crypto_keys_get(...)`, `locations_key_rings_crypto_keys_get_iam_policy(...)`, `locations_key_rings_crypto_keys_list(...)`, `locations_key_rings_crypto_keys_patch(...)`, `locations_key_rings_crypto_keys_set_iam_policy(...)`, `locations_key_rings_crypto_keys_test_iam_permissions(...)`, `locations_key_rings_crypto_keys_update_primary_version(...)`, `locations_key_rings_get(...)`, `locations_key_rings_get_iam_policy(...)`, `locations_key_rings_list(...)`, `locations_key_rings_set_iam_policy(...)`, `locations_key_rings_test_iam_permissions(...)` and `locations_list(...)`
/// // to build up your call.
/// let rb = hub.projects();
/// # }
/// ```
pub struct ProjectMethods<'a, S>
where S: 'a {
pub(super) hub: &'a CloudKMS<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:
///
/// Lists CryptoKeyVersions.
///
/// # Arguments
///
/// * `parent` - Required. The resource name of the CryptoKey to list, in the format
/// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
pub fn locations_key_rings_crypto_keys_crypto_key_versions_list(&self, parent: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall<'a, S> {
ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall {
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:
///
/// Create a new CryptoKeyVersion in a CryptoKey.
///
/// The server will assign the next sequential id. If unset,
/// state will be set to
/// ENABLED.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Required. The name of the CryptoKey associated with
/// the CryptoKeyVersions.
pub fn locations_key_rings_crypto_keys_crypto_key_versions_create(&self, request: CryptoKeyVersion, parent: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall<'a, S> {
ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall {
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:
///
/// Schedule a CryptoKeyVersion for destruction.
///
/// Upon calling this method, CryptoKeyVersion.state will be set to
/// DESTROY_SCHEDULED
/// and destroy_time will be set to a time 24
/// hours in the future, at which point the state
/// will be changed to
/// DESTROYED, and the key
/// material will be irrevocably destroyed.
///
/// Before the destroy_time is reached,
/// RestoreCryptoKeyVersion may be called to reverse the process.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - The resource name of the CryptoKeyVersion to destroy.
pub fn locations_key_rings_crypto_keys_crypto_key_versions_destroy(&self, request: DestroyCryptoKeyVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall<'a, S> {
ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall {
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:
///
/// Restore a CryptoKeyVersion in the
/// DESTROY_SCHEDULED,
/// state.
///
/// Upon restoration of the CryptoKeyVersion, state
/// will be set to DISABLED,
/// and destroy_time will be cleared.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - The resource name of the CryptoKeyVersion to restore.
pub fn locations_key_rings_crypto_keys_crypto_key_versions_restore(&self, request: RestoreCryptoKeyVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall<'a, S> {
ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall {
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:
///
/// Update a CryptoKeyVersion's metadata.
///
/// state may be changed between
/// ENABLED and
/// DISABLED using this
/// method. See DestroyCryptoKeyVersion and RestoreCryptoKeyVersion to
/// move between other states.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Output only. The resource name for this CryptoKeyVersion in the format
/// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
pub fn locations_key_rings_crypto_keys_crypto_key_versions_patch(&self, request: CryptoKeyVersion, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall<'a, S> {
ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall {
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:
///
/// Returns metadata for a given CryptoKeyVersion.
///
/// # Arguments
///
/// * `name` - The name of the CryptoKeyVersion to get.
pub fn locations_key_rings_crypto_keys_crypto_key_versions_get(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall<'a, S> {
ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall {
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:
///
/// Update a CryptoKey.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Output only. The resource name for this CryptoKey in the format
/// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
pub fn locations_key_rings_crypto_keys_patch(&self, request: CryptoKey, name: &str) -> ProjectLocationKeyRingCryptoKeyPatchCall<'a, S> {
ProjectLocationKeyRingCryptoKeyPatchCall {
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:
///
/// Returns metadata for a given CryptoKey, as well as its
/// primary CryptoKeyVersion.
///
/// # Arguments
///
/// * `name` - The name of the CryptoKey to get.
pub fn locations_key_rings_crypto_keys_get(&self, name: &str) -> ProjectLocationKeyRingCryptoKeyGetCall<'a, S> {
ProjectLocationKeyRingCryptoKeyGetCall {
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:
///
/// Returns permissions that a caller has on the specified resource.
/// If the resource does not exist, this will return an empty set of
/// permissions, not a NOT_FOUND error.
///
/// Note: This operation is designed to be used for building permission-aware
/// UIs and command-line tools, not for authorization checking. This operation
/// may "fail open" without warning.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested.
/// See the operation documentation for the appropriate value for this field.
pub fn locations_key_rings_crypto_keys_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationKeyRingCryptoKeyTestIamPermissionCall<'a, S> {
ProjectLocationKeyRingCryptoKeyTestIamPermissionCall {
hub: self.hub,
_request: request,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Decrypt data that was protected by Encrypt.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Required. The resource name of the CryptoKey to use for decryption.
/// The server will choose the appropriate version.
pub fn locations_key_rings_crypto_keys_decrypt(&self, request: DecryptRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyDecryptCall<'a, S> {
ProjectLocationKeyRingCryptoKeyDecryptCall {
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:
///
/// Lists CryptoKeys.
///
/// # Arguments
///
/// * `parent` - Required. The resource name of the KeyRing to list, in the format
/// `projects/*/locations/*/keyRings/*`.
pub fn locations_key_rings_crypto_keys_list(&self, parent: &str) -> ProjectLocationKeyRingCryptoKeyListCall<'a, S> {
ProjectLocationKeyRingCryptoKeyListCall {
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:
///
/// Encrypt data, so that it can only be recovered by a call to Decrypt.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - Required. The resource name of the CryptoKey or CryptoKeyVersion
/// to use for encryption.
/// If a CryptoKey is specified, the server will use its
/// primary version.
pub fn locations_key_rings_crypto_keys_encrypt(&self, request: EncryptRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyEncryptCall<'a, S> {
ProjectLocationKeyRingCryptoKeyEncryptCall {
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:
///
/// Create a new CryptoKey within a KeyRing.
///
/// CryptoKey.purpose is required.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Required. The name of the KeyRing associated with the
/// CryptoKeys.
pub fn locations_key_rings_crypto_keys_create(&self, request: CryptoKey, parent: &str) -> ProjectLocationKeyRingCryptoKeyCreateCall<'a, S> {
ProjectLocationKeyRingCryptoKeyCreateCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_crypto_key_id: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Sets the access control policy on the specified resource. Replaces any
/// existing policy.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `resource` - REQUIRED: The resource for which the policy is being specified.
/// See the operation documentation for the appropriate value for this field.
pub fn locations_key_rings_crypto_keys_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationKeyRingCryptoKeySetIamPolicyCall<'a, S> {
ProjectLocationKeyRingCryptoKeySetIamPolicyCall {
hub: self.hub,
_request: request,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Update the version of a CryptoKey that will be used in Encrypt
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `name` - The resource name of the CryptoKey to update.
pub fn locations_key_rings_crypto_keys_update_primary_version(&self, request: UpdateCryptoKeyPrimaryVersionRequest, name: &str) -> ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall<'a, S> {
ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall {
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 the access control policy for a resource.
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// # Arguments
///
/// * `resource` - REQUIRED: The resource for which the policy is being requested.
/// See the operation documentation for the appropriate value for this field.
pub fn locations_key_rings_crypto_keys_get_iam_policy(&self, resource: &str) -> ProjectLocationKeyRingCryptoKeyGetIamPolicyCall<'a, S> {
ProjectLocationKeyRingCryptoKeyGetIamPolicyCall {
hub: self.hub,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Gets the access control policy for a resource.
/// Returns an empty policy if the resource exists and does not have a policy
/// set.
///
/// # Arguments
///
/// * `resource` - REQUIRED: The resource for which the policy is being requested.
/// See the operation documentation for the appropriate value for this field.
pub fn locations_key_rings_get_iam_policy(&self, resource: &str) -> ProjectLocationKeyRingGetIamPolicyCall<'a, S> {
ProjectLocationKeyRingGetIamPolicyCall {
hub: self.hub,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Returns metadata for a given KeyRing.
///
/// # Arguments
///
/// * `name` - The name of the KeyRing to get.
pub fn locations_key_rings_get(&self, name: &str) -> ProjectLocationKeyRingGetCall<'a, S> {
ProjectLocationKeyRingGetCall {
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:
///
/// Returns permissions that a caller has on the specified resource.
/// If the resource does not exist, this will return an empty set of
/// permissions, not a NOT_FOUND error.
///
/// Note: This operation is designed to be used for building permission-aware
/// UIs and command-line tools, not for authorization checking. This operation
/// may "fail open" without warning.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `resource` - REQUIRED: The resource for which the policy detail is being requested.
/// See the operation documentation for the appropriate value for this field.
pub fn locations_key_rings_test_iam_permissions(&self, request: TestIamPermissionsRequest, resource: &str) -> ProjectLocationKeyRingTestIamPermissionCall<'a, S> {
ProjectLocationKeyRingTestIamPermissionCall {
hub: self.hub,
_request: request,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists KeyRings.
///
/// # Arguments
///
/// * `parent` - Required. The resource name of the location associated with the
/// KeyRings, in the format `projects/*/locations/*`.
pub fn locations_key_rings_list(&self, parent: &str) -> ProjectLocationKeyRingListCall<'a, S> {
ProjectLocationKeyRingListCall {
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:
///
/// Sets the access control policy on the specified resource. Replaces any
/// existing policy.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `resource` - REQUIRED: The resource for which the policy is being specified.
/// See the operation documentation for the appropriate value for this field.
pub fn locations_key_rings_set_iam_policy(&self, request: SetIamPolicyRequest, resource: &str) -> ProjectLocationKeyRingSetIamPolicyCall<'a, S> {
ProjectLocationKeyRingSetIamPolicyCall {
hub: self.hub,
_request: request,
_resource: resource.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Create a new KeyRing in a given Project and Location.
///
/// # Arguments
///
/// * `request` - No description provided.
/// * `parent` - Required. The resource name of the location associated with the
/// KeyRings, in the format `projects/*/locations/*`.
pub fn locations_key_rings_create(&self, request: KeyRing, parent: &str) -> ProjectLocationKeyRingCreateCall<'a, S> {
ProjectLocationKeyRingCreateCall {
hub: self.hub,
_request: request,
_parent: parent.to_string(),
_key_ring_id: Default::default(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
/// Create a builder to help you perform the following task:
///
/// Lists information about the supported locations for this service.
///
/// # Arguments
///
/// * `name` - The resource that owns the locations collection, if applicable.
pub fn locations_list(&self, name: &str) -> ProjectLocationListCall<'a, S> {
ProjectLocationListCall {
hub: self.hub,
_name: name.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:
///
/// Get information about a location.
///
/// # Arguments
///
/// * `name` - Resource name for the location.
pub fn locations_get(&self, name: &str) -> ProjectLocationGetCall<'a, S> {
ProjectLocationGetCall {
hub: self.hub,
_name: name.to_string(),
_delegate: Default::default(),
_additional_params: Default::default(),
_scopes: Default::default(),
}
}
}

View File

@@ -0,0 +1,32 @@
use std::collections::HashMap;
use std::cell::RefCell;
use std::default::Default;
use std::collections::BTreeSet;
use std::error::Error as StdError;
use serde_json as json;
use std::io;
use std::fs;
use std::mem;
use hyper::client::connect;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::time::sleep;
use tower_service;
use serde::{Serialize, Deserialize};
use crate::{client, client::GetToken, client::serde_with};
mod utilities;
pub use utilities::*;
mod hub;
pub use hub::*;
mod schemas;
pub use schemas::*;
mod method_builders;
pub use method_builders::*;
mod call_builders;
pub use call_builders::*;

View File

@@ -0,0 +1,902 @@
use super::*;
/// Request message for `TestIamPermissions` method.
///
/// # 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*).
///
/// * [locations key rings crypto keys test iam permissions projects](ProjectLocationKeyRingCryptoKeyTestIamPermissionCall) (request)
/// * [locations key rings test iam permissions projects](ProjectLocationKeyRingTestIamPermissionCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct TestIamPermissionsRequest {
/// The set of permissions to check for the `resource`. Permissions with
/// wildcards (such as '*' or 'storage.*') are not allowed. For more
/// information see
/// [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
pub permissions: Option<Vec<String>>,
}
impl client::RequestValue for TestIamPermissionsRequest {}
/// Defines an Identity and Access Management (IAM) policy. It is used to
/// specify access control policies for Cloud Platform resources.
///
/// A `Policy` consists of a list of `bindings`. A `Binding` binds a list of
/// `members` to a `role`, where the members can be user accounts, Google groups,
/// Google domains, and service accounts. A `role` is a named list of permissions
/// defined by IAM.
///
/// **Example**
///
/// ````text
/// {
/// "bindings": [
/// {
/// "role": "roles/owner",
/// "members": [
/// "user:mike@example.com",
/// "group:admins@example.com",
/// "domain:google.com",
/// "serviceAccount:my-other-app@appspot.gserviceaccount.com",
/// ]
/// },
/// {
/// "role": "roles/viewer",
/// "members": ["user:sean@example.com"]
/// }
/// ]
/// }
/// ````
///
/// For a description of IAM and its features, see the
/// [IAM developers guide](https://cloud.google.com/iam).
///
/// # 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*).
///
/// * [locations key rings crypto keys set iam policy projects](ProjectLocationKeyRingCryptoKeySetIamPolicyCall) (response)
/// * [locations key rings crypto keys get iam policy projects](ProjectLocationKeyRingCryptoKeyGetIamPolicyCall) (response)
/// * [locations key rings get iam policy projects](ProjectLocationKeyRingGetIamPolicyCall) (response)
/// * [locations key rings set iam policy projects](ProjectLocationKeyRingSetIamPolicyCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Policy {
/// no description provided
#[serde(rename="iamOwned")]
pub iam_owned: Option<bool>,
/// If more than one rule is specified, the rules are applied in the following
/// manner:
/// - All matching LOG rules are always applied.
/// - If any DENY/DENY_WITH_LOG rule matches, permission is denied.
/// Logging will be applied if one or more matching rule requires logging.
/// - Otherwise, if any ALLOW/ALLOW_WITH_LOG rule matches, permission is
/// granted.
/// Logging will be applied if one or more matching rule requires logging.
/// - Otherwise, if no rule applies, permission is denied.
pub rules: Option<Vec<Rule>>,
/// Version of the `Policy`. The default version is 0.
pub version: Option<i32>,
/// Specifies cloud audit logging configuration for this policy.
#[serde(rename="auditConfigs")]
pub audit_configs: Option<Vec<AuditConfig>>,
/// Associates a list of `members` to a `role`.
/// Multiple `bindings` must not be specified for the same `role`.
/// `bindings` with no members will result in an error.
pub bindings: Option<Vec<Binding>>,
/// `etag` is used for optimistic concurrency control as a way to help
/// prevent simultaneous updates of a policy from overwriting each other.
/// It is strongly suggested that systems make use of the `etag` in the
/// read-modify-write cycle to perform policy updates in order to avoid race
/// conditions: An `etag` is returned in the response to `getIamPolicy`, and
/// systems are expected to put that etag in the request to `setIamPolicy` to
/// ensure that their change will be applied to the same version of the policy.
///
/// If no `etag` is provided in the call to `setIamPolicy`, then the existing
/// policy is overwritten blindly.
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub etag: Option<Vec<u8>>,
}
impl client::ResponseResult for Policy {}
/// The response message for Locations.ListLocations.
///
/// # 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*).
///
/// * [locations list projects](ProjectLocationListCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ListLocationsResponse {
/// A list of locations that matches the specified filter in the request.
pub locations: Option<Vec<Location>>,
/// The standard List next-page token.
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
}
impl client::ResponseResult for ListLocationsResponse {}
/// A KeyRing is a toplevel logical grouping of CryptoKeys.
///
/// # 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*).
///
/// * [locations key rings get projects](ProjectLocationKeyRingGetCall) (response)
/// * [locations key rings create projects](ProjectLocationKeyRingCreateCall) (request|response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct KeyRing {
/// Output only. The time at which this KeyRing was created.
#[serde(rename="createTime")]
pub create_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
/// Output only. The resource name for the KeyRing in the format
/// `projects/*/locations/*/keyRings/*`.
pub name: Option<String>,
}
impl client::RequestValue for KeyRing {}
impl client::ResponseResult for KeyRing {}
/// Response message for KeyManagementService.Encrypt.
///
/// # 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*).
///
/// * [locations key rings crypto keys encrypt projects](ProjectLocationKeyRingCryptoKeyEncryptCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct EncryptResponse {
/// The resource name of the CryptoKeyVersion used in encryption.
pub name: Option<String>,
/// The encrypted data.
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub ciphertext: Option<Vec<u8>>,
}
impl client::ResponseResult for EncryptResponse {}
/// Request message for KeyManagementService.UpdateCryptoKeyPrimaryVersion.
///
/// # 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*).
///
/// * [locations key rings crypto keys update primary version projects](ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct UpdateCryptoKeyPrimaryVersionRequest {
/// The id of the child CryptoKeyVersion to use as primary.
#[serde(rename="cryptoKeyVersionId")]
pub crypto_key_version_id: Option<String>,
}
impl client::RequestValue for UpdateCryptoKeyPrimaryVersionRequest {}
/// Request message for KeyManagementService.RestoreCryptoKeyVersion.
///
/// # 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*).
///
/// * [locations key rings crypto keys crypto key versions restore projects](ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct RestoreCryptoKeyVersionRequest { _never_set: Option<bool> }
impl client::RequestValue for RestoreCryptoKeyVersionRequest {}
/// Response message for KeyManagementService.ListKeyRings.
///
/// # 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*).
///
/// * [locations key rings list projects](ProjectLocationKeyRingListCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ListKeyRingsResponse {
/// A token to retrieve next page of results. Pass this value in
/// ListKeyRingsRequest.page_token to retrieve the next page of results.
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
/// The total number of KeyRings that matched the query.
#[serde(rename="totalSize")]
pub total_size: Option<i32>,
/// The list of KeyRings.
#[serde(rename="keyRings")]
pub key_rings: Option<Vec<KeyRing>>,
}
impl client::ResponseResult for ListKeyRingsResponse {}
/// Write a Data Access (Gin) log
///
/// 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 DataAccessOptions { _never_set: Option<bool> }
impl client::Part for DataAccessOptions {}
/// Specifies the audit configuration for a service.
/// The configuration determines which permission types are logged, and what
/// identities, if any, are exempted from logging.
/// An AuditConfig must have one or more AuditLogConfigs.
///
/// If there are AuditConfigs for both `allServices` and a specific service,
/// the union of the two AuditConfigs is used for that service: the log_types
/// specified in each AuditConfig are enabled, and the exempted_members in each
/// AuditConfig are exempted.
///
/// Example Policy with multiple AuditConfigs:
///
/// ````text
/// {
/// "audit_configs": [
/// {
/// "service": "allServices"
/// "audit_log_configs": [
/// {
/// "log_type": "DATA_READ",
/// "exempted_members": [
/// "user:foo@gmail.com"
/// ]
/// },
/// {
/// "log_type": "DATA_WRITE",
/// },
/// {
/// "log_type": "ADMIN_READ",
/// }
/// ]
/// },
/// {
/// "service": "fooservice.googleapis.com"
/// "audit_log_configs": [
/// {
/// "log_type": "DATA_READ",
/// },
/// {
/// "log_type": "DATA_WRITE",
/// "exempted_members": [
/// "user:bar@gmail.com"
/// ]
/// }
/// ]
/// }
/// ]
/// }
/// ````
///
/// For fooservice, this policy enables DATA_READ, DATA_WRITE and ADMIN_READ
/// logging. It also exempts foo@gmail.com from DATA_READ logging, and
/// bar@gmail.com from DATA_WRITE logging.
///
/// 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 AuditConfig {
/// Specifies a service that will be enabled for audit logging.
/// For example, `storage.googleapis.com`, `cloudsql.googleapis.com`.
/// `allServices` is a special value that covers all services.
pub service: Option<String>,
/// The configuration for logging of each type of permission.
/// Next ID: 4
#[serde(rename="auditLogConfigs")]
pub audit_log_configs: Option<Vec<AuditLogConfig>>,
/// no description provided
#[serde(rename="exemptedMembers")]
pub exempted_members: Option<Vec<String>>,
}
impl client::Part for AuditConfig {}
/// A CryptoKeyVersion represents an individual cryptographic key, and the
/// associated key material.
///
/// It can be used for cryptographic operations either directly, or via its
/// parent CryptoKey, in which case the server will choose the appropriate
/// version for the operation.
///
/// # 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*).
///
/// * [locations key rings crypto keys crypto key versions create projects](ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall) (request|response)
/// * [locations key rings crypto keys crypto key versions destroy projects](ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall) (response)
/// * [locations key rings crypto keys crypto key versions restore projects](ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall) (response)
/// * [locations key rings crypto keys crypto key versions patch projects](ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall) (request|response)
/// * [locations key rings crypto keys crypto key versions get projects](ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CryptoKeyVersion {
/// Output only. The time at which this CryptoKeyVersion was created.
#[serde(rename="createTime")]
pub create_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
/// The current state of the CryptoKeyVersion.
pub state: Option<String>,
/// Output only. The resource name for this CryptoKeyVersion in the format
/// `projects/*/locations/*/keyRings/*/cryptoKeys/*/cryptoKeyVersions/*`.
pub name: Option<String>,
/// Output only. The time this CryptoKeyVersion's key material was
/// destroyed. Only present if state is
/// DESTROYED.
#[serde(rename="destroyEventTime")]
pub destroy_event_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
/// Output only. The time this CryptoKeyVersion's key material is scheduled
/// for destruction. Only present if state is
/// DESTROY_SCHEDULED.
#[serde(rename="destroyTime")]
pub destroy_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
}
impl client::RequestValue for CryptoKeyVersion {}
impl client::ResponseResult for CryptoKeyVersion {}
/// Write a Cloud Audit log
///
/// 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 CloudAuditOptions {
/// The log_name to populate in the Cloud Audit Record.
#[serde(rename="logName")]
pub log_name: Option<String>,
}
impl client::Part for CloudAuditOptions {}
/// Associates `members` with a `role`.
///
/// 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 Binding {
/// Specifies the identities requesting access for a Cloud Platform resource.
/// `members` can have the following values:
///
/// * `allUsers`: A special identifier that represents anyone who is
/// on the internet; with or without a Google account.
///
/// * `allAuthenticatedUsers`: A special identifier that represents anyone
/// who is authenticated with a Google account or a service account.
///
/// * `user:{emailid}`: An email address that represents a specific Google
/// account. For example, `alice@gmail.com` or `joe@example.com`.
///
///
/// * `serviceAccount:{emailid}`: An email address that represents a service
/// account. For example, `my-other-app@appspot.gserviceaccount.com`.
///
/// * `group:{emailid}`: An email address that represents a Google group.
/// For example, `admins@example.com`.
///
///
/// * `domain:{domain}`: A Google Apps domain name that represents all the
/// users of that domain. For example, `google.com` or `example.com`.
///
///
pub members: Option<Vec<String>>,
/// Role that is assigned to `members`.
/// For example, `roles/viewer`, `roles/editor`, or `roles/owner`.
/// Required
pub role: Option<String>,
}
impl client::Part for Binding {}
/// Request message for KeyManagementService.Encrypt.
///
/// # 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*).
///
/// * [locations key rings crypto keys encrypt projects](ProjectLocationKeyRingCryptoKeyEncryptCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct EncryptRequest {
/// Optional data that, if specified, must also be provided during decryption
/// through DecryptRequest.additional_authenticated_data. Must be no
/// larger than 64KiB.
#[serde(rename="additionalAuthenticatedData")]
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub additional_authenticated_data: Option<Vec<u8>>,
/// Required. The data to encrypt. Must be no larger than 64KiB.
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub plaintext: Option<Vec<u8>>,
}
impl client::RequestValue for EncryptRequest {}
/// Response message for KeyManagementService.ListCryptoKeyVersions.
///
/// # 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*).
///
/// * [locations key rings crypto keys crypto key versions list projects](ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ListCryptoKeyVersionsResponse {
/// The list of CryptoKeyVersions.
#[serde(rename="cryptoKeyVersions")]
pub crypto_key_versions: Option<Vec<CryptoKeyVersion>>,
/// A token to retrieve next page of results. Pass this value in
/// ListCryptoKeyVersionsRequest.page_token to retrieve the next page of
/// results.
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
/// The total number of CryptoKeyVersions that matched the
/// query.
#[serde(rename="totalSize")]
pub total_size: Option<i32>,
}
impl client::ResponseResult for ListCryptoKeyVersionsResponse {}
/// Response message for `TestIamPermissions` method.
///
/// # 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*).
///
/// * [locations key rings crypto keys test iam permissions projects](ProjectLocationKeyRingCryptoKeyTestIamPermissionCall) (response)
/// * [locations key rings test iam permissions projects](ProjectLocationKeyRingTestIamPermissionCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct TestIamPermissionsResponse {
/// A subset of `TestPermissionsRequest.permissions` that the caller is
/// allowed.
pub permissions: Option<Vec<String>>,
}
impl client::ResponseResult for TestIamPermissionsResponse {}
/// Request message for KeyManagementService.DestroyCryptoKeyVersion.
///
/// # 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*).
///
/// * [locations key rings crypto keys crypto key versions destroy projects](ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct DestroyCryptoKeyVersionRequest { _never_set: Option<bool> }
impl client::RequestValue for DestroyCryptoKeyVersionRequest {}
/// A CryptoKey represents a logical key that can be used for cryptographic
/// operations.
///
/// A CryptoKey is made up of one or more versions, which
/// represent the actual key material used in cryptographic operations.
///
/// # 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*).
///
/// * [locations key rings crypto keys patch projects](ProjectLocationKeyRingCryptoKeyPatchCall) (request|response)
/// * [locations key rings crypto keys get projects](ProjectLocationKeyRingCryptoKeyGetCall) (response)
/// * [locations key rings crypto keys create projects](ProjectLocationKeyRingCryptoKeyCreateCall) (request|response)
/// * [locations key rings crypto keys update primary version projects](ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct CryptoKey {
/// Output only. The time at which this CryptoKey was created.
#[serde(rename="createTime")]
pub create_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
/// next_rotation_time will be advanced by this period when the service
/// automatically rotates a key. Must be at least one day.
///
/// If rotation_period is set, next_rotation_time must also be set.
#[serde(rename="rotationPeriod")]
#[serde_as(as = "Option<::client::serde::duration::Wrapper>")]
pub rotation_period: Option<client::chrono::Duration>,
/// Output only. A copy of the "primary" CryptoKeyVersion that will be used
/// by Encrypt when this CryptoKey is given
/// in EncryptRequest.name.
///
/// The CryptoKey's primary version can be updated via
/// UpdateCryptoKeyPrimaryVersion.
pub primary: Option<CryptoKeyVersion>,
/// Output only. The resource name for this CryptoKey in the format
/// `projects/*/locations/*/keyRings/*/cryptoKeys/*`.
pub name: Option<String>,
/// The immutable purpose of this CryptoKey. Currently, the only acceptable
/// purpose is ENCRYPT_DECRYPT.
pub purpose: Option<String>,
/// At next_rotation_time, the Key Management Service will automatically:
///
/// 1. Create a new version of this CryptoKey.
/// 2. Mark the new version as primary.
///
/// Key rotations performed manually via
/// CreateCryptoKeyVersion and
/// UpdateCryptoKeyPrimaryVersion
/// do not affect next_rotation_time.
#[serde(rename="nextRotationTime")]
pub next_rotation_time: Option<client::chrono::DateTime<client::chrono::offset::Utc>>,
}
impl client::RequestValue for CryptoKey {}
impl client::ResponseResult for CryptoKey {}
/// A rule to be applied in a Policy.
///
/// 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 Rule {
/// Human-readable description of the rule.
pub description: Option<String>,
/// Additional restrictions that must be met
pub conditions: Option<Vec<Condition>>,
/// The config returned to callers of tech.iam.IAM.CheckPolicy for any entries
/// that match the LOG action.
#[serde(rename="logConfig")]
pub log_config: Option<Vec<LogConfig>>,
/// If one or more 'in' clauses are specified, the rule matches if
/// the PRINCIPAL/AUTHORITY_SELECTOR is in at least one of these entries.
#[serde(rename="in")]
pub in_: Option<Vec<String>>,
/// A permission is a string of form '<service>.<resource type>.<verb>'
/// (e.g., 'storage.buckets.list'). A value of '*' matches all permissions,
/// and a verb part of '*' (e.g., 'storage.buckets.*') matches all verbs.
pub permissions: Option<Vec<String>>,
/// Required
pub action: Option<String>,
/// If one or more 'not_in' clauses are specified, the rule matches
/// if the PRINCIPAL/AUTHORITY_SELECTOR is in none of the entries.
/// The format for in and not_in entries is the same as for members in a
/// Binding (see google/iam/v1/policy.proto).
#[serde(rename="notIn")]
pub not_in: Option<Vec<String>>,
}
impl client::Part for Rule {}
/// Specifies what kind of log the caller must write
///
/// 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 LogConfig {
/// Counter options.
pub counter: Option<CounterOptions>,
/// Data access options.
#[serde(rename="dataAccess")]
pub data_access: Option<DataAccessOptions>,
/// Cloud audit options.
#[serde(rename="cloudAudit")]
pub cloud_audit: Option<CloudAuditOptions>,
}
impl client::Part for LogConfig {}
/// Request message for `SetIamPolicy` method.
///
/// # 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*).
///
/// * [locations key rings crypto keys set iam policy projects](ProjectLocationKeyRingCryptoKeySetIamPolicyCall) (request)
/// * [locations key rings set iam policy projects](ProjectLocationKeyRingSetIamPolicyCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct SetIamPolicyRequest {
/// OPTIONAL: A FieldMask specifying which fields of the policy to modify. Only
/// the fields in the mask will be modified. If no mask is provided, the
/// following default mask is used:
/// paths: "bindings, etag"
/// This field is only used by Cloud IAM.
#[serde(rename="updateMask")]
pub update_mask: Option<client::FieldMask>,
/// REQUIRED: The complete policy to be applied to the `resource`. The size of
/// the policy is limited to a few 10s of KB. An empty policy is a
/// valid policy but certain Cloud Platform services (such as Projects)
/// might reject them.
pub policy: Option<Policy>,
}
impl client::RequestValue for SetIamPolicyRequest {}
/// Request message for KeyManagementService.Decrypt.
///
/// # 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*).
///
/// * [locations key rings crypto keys decrypt projects](ProjectLocationKeyRingCryptoKeyDecryptCall) (request)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct DecryptRequest {
/// Required. The encrypted data originally returned in
/// EncryptResponse.ciphertext.
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub ciphertext: Option<Vec<u8>>,
/// Optional data that must match the data originally supplied in
/// EncryptRequest.additional_authenticated_data.
#[serde(rename="additionalAuthenticatedData")]
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub additional_authenticated_data: Option<Vec<u8>>,
}
impl client::RequestValue for DecryptRequest {}
/// A resource that represents Google Cloud Platform location.
///
/// # 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*).
///
/// * [locations get projects](ProjectLocationGetCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct Location {
/// The canonical id for this location. For example: `"us-east1"`.
#[serde(rename="locationId")]
pub location_id: Option<String>,
/// Service-specific metadata. For example the available capacity at the given
/// location.
pub metadata: Option<HashMap<String, json::Value>>,
/// Cross-service attributes for the location. For example
///
/// ````text
/// {"cloud.googleapis.com/region": "us-east1"}
/// ````
pub labels: Option<HashMap<String, String>>,
/// Resource name for the location, which may vary between implementations.
/// For example: `"projects/example-project/locations/us-east1"`
pub name: Option<String>,
}
impl client::ResponseResult for Location {}
/// Response message for KeyManagementService.ListCryptoKeys.
///
/// # 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*).
///
/// * [locations key rings crypto keys list projects](ProjectLocationKeyRingCryptoKeyListCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct ListCryptoKeysResponse {
/// A token to retrieve next page of results. Pass this value in
/// ListCryptoKeysRequest.page_token to retrieve the next page of results.
#[serde(rename="nextPageToken")]
pub next_page_token: Option<String>,
/// The list of CryptoKeys.
#[serde(rename="cryptoKeys")]
pub crypto_keys: Option<Vec<CryptoKey>>,
/// The total number of CryptoKeys that matched the query.
#[serde(rename="totalSize")]
pub total_size: Option<i32>,
}
impl client::ResponseResult for ListCryptoKeysResponse {}
/// A condition to be met.
///
/// 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 {
/// An operator to apply the subject with.
pub op: Option<String>,
/// Trusted attributes discharged by the service.
pub svc: Option<String>,
/// Trusted attributes supplied by any service that owns resources and uses
/// the IAM system for access control.
pub sys: Option<String>,
/// DEPRECATED. Use 'values' instead.
pub value: Option<String>,
/// Trusted attributes supplied by the IAM system.
pub iam: Option<String>,
/// The objects of the condition. This is mutually exclusive with 'value'.
pub values: Option<Vec<String>>,
}
impl client::Part for Condition {}
/// Options for counters
///
/// 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 CounterOptions {
/// The metric to update.
pub metric: Option<String>,
/// The field value to attribute.
pub field: Option<String>,
}
impl client::Part for CounterOptions {}
/// Provides the configuration for logging a type of permissions.
/// Example:
///
/// ````text
/// {
/// "audit_log_configs": [
/// {
/// "log_type": "DATA_READ",
/// "exempted_members": [
/// "user:foo@gmail.com"
/// ]
/// },
/// {
/// "log_type": "DATA_WRITE",
/// }
/// ]
/// }
/// ````
///
/// This enables DATA_READ and DATA_WRITE logging, while exempting
/// foo@gmail.com from DATA_READ logging.
///
/// 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 AuditLogConfig {
/// Specifies the identities that do not cause logging for this type of
/// permission.
/// Follows the same format of Binding.members.
#[serde(rename="exemptedMembers")]
pub exempted_members: Option<Vec<String>>,
/// The log type that this config enables.
#[serde(rename="logType")]
pub log_type: Option<String>,
}
impl client::Part for AuditLogConfig {}
/// Response message for KeyManagementService.Decrypt.
///
/// # 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*).
///
/// * [locations key rings crypto keys decrypt projects](ProjectLocationKeyRingCryptoKeyDecryptCall) (response)
#[serde_with::serde_as(crate = "::client::serde_with")]
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
pub struct DecryptResponse {
/// The decrypted data originally supplied in EncryptRequest.plaintext.
#[serde_as(as = "Option<::client::serde::urlsafe_base64::Wrapper>")]
pub plaintext: Option<Vec<u8>>,
}
impl client::ResponseResult for DecryptResponse {}

View 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
}
}