make regen-apis

This commit is contained in:
OMGeeky
2024-05-16 21:23:40 +02:00
parent 52d2e89e51
commit ad85cafeef
5108 changed files with 1615625 additions and 992044 deletions

View File

@@ -0,0 +1,613 @@
use super::*;
// region CryptoKeyVersionStateEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The current state of the CryptoKeyVersion.
pub enum CryptoKeyVersionStateEnum {
/// Not specified.
///
/// "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED"
#[serde(rename="CRYPTO_KEY_VERSION_STATE_UNSPECIFIED")]
CRYPTOKEYVERSIONSTATEUNSPECIFIED,
/// This version may be used in Encrypt and
Decrypt requests.
///
/// "ENABLED"
#[serde(rename="ENABLED")]
ENABLED,
/// This version may not be used, but the key material is still available,
and the version can be placed back into the ENABLED state.
///
/// "DISABLED"
#[serde(rename="DISABLED")]
DISABLED,
/// This version is destroyed, and the key material is no longer stored.
A version may not leave this state once entered.
///
/// "DESTROYED"
#[serde(rename="DESTROYED")]
DESTROYED,
/// This version is scheduled for destruction, and will be destroyed soon.
Call
RestoreCryptoKeyVersion
to put it back into the DISABLED state.
///
/// "DESTROY_SCHEDULED"
#[serde(rename="DESTROY_SCHEDULED")]
DESTROYSCHEDULED,
}
impl AsRef<str> for CryptoKeyVersionStateEnum {
fn as_ref(&self) -> &str {
match *self {
CryptoKeyVersionStateEnum::CRYPTOKEYVERSIONSTATEUNSPECIFIED => "CRYPTO_KEY_VERSION_STATE_UNSPECIFIED",
CryptoKeyVersionStateEnum::ENABLED => "ENABLED",
CryptoKeyVersionStateEnum::DISABLED => "DISABLED",
CryptoKeyVersionStateEnum::DESTROYED => "DESTROYED",
CryptoKeyVersionStateEnum::DESTROYSCHEDULED => "DESTROY_SCHEDULED",
}
}
}
impl std::convert::TryFrom< &str> for CryptoKeyVersionStateEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"CRYPTO_KEY_VERSION_STATE_UNSPECIFIED" => Ok(CryptoKeyVersionStateEnum::CRYPTOKEYVERSIONSTATEUNSPECIFIED),
"ENABLED" => Ok(CryptoKeyVersionStateEnum::ENABLED),
"DISABLED" => Ok(CryptoKeyVersionStateEnum::DISABLED),
"DESTROYED" => Ok(CryptoKeyVersionStateEnum::DESTROYED),
"DESTROY_SCHEDULED" => Ok(CryptoKeyVersionStateEnum::DESTROYSCHEDULED),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a CryptoKeyVersionStateEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region CloudAuditOptionLogNameEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The log_name to populate in the Cloud Audit Record.
pub enum CloudAuditOptionLogNameEnum {
/// Default. Should not be used.
///
/// "UNSPECIFIED_LOG_NAME"
#[serde(rename="UNSPECIFIED_LOG_NAME")]
UNSPECIFIEDLOGNAME,
/// Corresponds to "cloudaudit.googleapis.com/activity"
///
/// "ADMIN_ACTIVITY"
#[serde(rename="ADMIN_ACTIVITY")]
ADMINACTIVITY,
/// Corresponds to "cloudaudit.googleapis.com/data_access"
///
/// "DATA_ACCESS"
#[serde(rename="DATA_ACCESS")]
DATAACCESS,
}
impl AsRef<str> for CloudAuditOptionLogNameEnum {
fn as_ref(&self) -> &str {
match *self {
CloudAuditOptionLogNameEnum::UNSPECIFIEDLOGNAME => "UNSPECIFIED_LOG_NAME",
CloudAuditOptionLogNameEnum::ADMINACTIVITY => "ADMIN_ACTIVITY",
CloudAuditOptionLogNameEnum::DATAACCESS => "DATA_ACCESS",
}
}
}
impl std::convert::TryFrom< &str> for CloudAuditOptionLogNameEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"UNSPECIFIED_LOG_NAME" => Ok(CloudAuditOptionLogNameEnum::UNSPECIFIEDLOGNAME),
"ADMIN_ACTIVITY" => Ok(CloudAuditOptionLogNameEnum::ADMINACTIVITY),
"DATA_ACCESS" => Ok(CloudAuditOptionLogNameEnum::DATAACCESS),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a CloudAuditOptionLogNameEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region CryptoKeyPurposeEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The immutable purpose of this CryptoKey. Currently, the only acceptable
purpose is ENCRYPT_DECRYPT.
pub enum CryptoKeyPurposeEnum {
/// Not specified.
///
/// "CRYPTO_KEY_PURPOSE_UNSPECIFIED"
#[serde(rename="CRYPTO_KEY_PURPOSE_UNSPECIFIED")]
CRYPTOKEYPURPOSEUNSPECIFIED,
/// CryptoKeys with this purpose may be used with
Encrypt and
Decrypt.
///
/// "ENCRYPT_DECRYPT"
#[serde(rename="ENCRYPT_DECRYPT")]
ENCRYPTDECRYPT,
}
impl AsRef<str> for CryptoKeyPurposeEnum {
fn as_ref(&self) -> &str {
match *self {
CryptoKeyPurposeEnum::CRYPTOKEYPURPOSEUNSPECIFIED => "CRYPTO_KEY_PURPOSE_UNSPECIFIED",
CryptoKeyPurposeEnum::ENCRYPTDECRYPT => "ENCRYPT_DECRYPT",
}
}
}
impl std::convert::TryFrom< &str> for CryptoKeyPurposeEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"CRYPTO_KEY_PURPOSE_UNSPECIFIED" => Ok(CryptoKeyPurposeEnum::CRYPTOKEYPURPOSEUNSPECIFIED),
"ENCRYPT_DECRYPT" => Ok(CryptoKeyPurposeEnum::ENCRYPTDECRYPT),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a CryptoKeyPurposeEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region RuleActionEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// Required
pub enum RuleActionEnum {
/// Default no action.
///
/// "NO_ACTION"
#[serde(rename="NO_ACTION")]
NOACTION,
/// Matching 'Entries' grant access.
///
/// "ALLOW"
#[serde(rename="ALLOW")]
ALLOW,
/// Matching 'Entries' grant access and the caller promises to log
the request per the returned log_configs.
///
/// "ALLOW_WITH_LOG"
#[serde(rename="ALLOW_WITH_LOG")]
ALLOWWITHLOG,
/// Matching 'Entries' deny access.
///
/// "DENY"
#[serde(rename="DENY")]
DENY,
/// Matching 'Entries' deny access and the caller promises to log
the request per the returned log_configs.
///
/// "DENY_WITH_LOG"
#[serde(rename="DENY_WITH_LOG")]
DENYWITHLOG,
/// Matching 'Entries' tell IAM.Check callers to generate logs.
///
/// "LOG"
#[serde(rename="LOG")]
LOG,
}
impl AsRef<str> for RuleActionEnum {
fn as_ref(&self) -> &str {
match *self {
RuleActionEnum::NOACTION => "NO_ACTION",
RuleActionEnum::ALLOW => "ALLOW",
RuleActionEnum::ALLOWWITHLOG => "ALLOW_WITH_LOG",
RuleActionEnum::DENY => "DENY",
RuleActionEnum::DENYWITHLOG => "DENY_WITH_LOG",
RuleActionEnum::LOG => "LOG",
}
}
}
impl std::convert::TryFrom< &str> for RuleActionEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"NO_ACTION" => Ok(RuleActionEnum::NOACTION),
"ALLOW" => Ok(RuleActionEnum::ALLOW),
"ALLOW_WITH_LOG" => Ok(RuleActionEnum::ALLOWWITHLOG),
"DENY" => Ok(RuleActionEnum::DENY),
"DENY_WITH_LOG" => Ok(RuleActionEnum::DENYWITHLOG),
"LOG" => Ok(RuleActionEnum::LOG),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a RuleActionEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region ConditionOpEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// An operator to apply the subject with.
pub enum ConditionOpEnum {
/// Default no-op.
///
/// "NO_OP"
#[serde(rename="NO_OP")]
NOOP,
/// DEPRECATED. Use IN instead.
///
/// "EQUALS"
#[serde(rename="EQUALS")]
EQUALS,
/// DEPRECATED. Use NOT_IN instead.
///
/// "NOT_EQUALS"
#[serde(rename="NOT_EQUALS")]
NOTEQUALS,
/// The condition is true if the subject (or any element of it if it is
a set) matches any of the supplied values.
///
/// "IN"
#[serde(rename="IN")]
IN,
/// The condition is true if the subject (or every element of it if it is
a set) matches none of the supplied values.
///
/// "NOT_IN"
#[serde(rename="NOT_IN")]
NOTIN,
/// Subject is discharged
///
/// "DISCHARGED"
#[serde(rename="DISCHARGED")]
DISCHARGED,
}
impl AsRef<str> for ConditionOpEnum {
fn as_ref(&self) -> &str {
match *self {
ConditionOpEnum::NOOP => "NO_OP",
ConditionOpEnum::EQUALS => "EQUALS",
ConditionOpEnum::NOTEQUALS => "NOT_EQUALS",
ConditionOpEnum::IN => "IN",
ConditionOpEnum::NOTIN => "NOT_IN",
ConditionOpEnum::DISCHARGED => "DISCHARGED",
}
}
}
impl std::convert::TryFrom< &str> for ConditionOpEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"NO_OP" => Ok(ConditionOpEnum::NOOP),
"EQUALS" => Ok(ConditionOpEnum::EQUALS),
"NOT_EQUALS" => Ok(ConditionOpEnum::NOTEQUALS),
"IN" => Ok(ConditionOpEnum::IN),
"NOT_IN" => Ok(ConditionOpEnum::NOTIN),
"DISCHARGED" => Ok(ConditionOpEnum::DISCHARGED),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ConditionOpEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region ConditionSysEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// Trusted attributes supplied by any service that owns resources and uses
the IAM system for access control.
pub enum ConditionSysEnum {
/// Default non-attribute type
///
/// "NO_ATTR"
#[serde(rename="NO_ATTR")]
NOATTR,
/// Region of the resource
///
/// "REGION"
#[serde(rename="REGION")]
REGION,
/// Service name
///
/// "SERVICE"
#[serde(rename="SERVICE")]
SERVICE,
/// Resource name
///
/// "NAME"
#[serde(rename="NAME")]
NAME,
/// IP address of the caller
///
/// "IP"
#[serde(rename="IP")]
IP,
}
impl AsRef<str> for ConditionSysEnum {
fn as_ref(&self) -> &str {
match *self {
ConditionSysEnum::NOATTR => "NO_ATTR",
ConditionSysEnum::REGION => "REGION",
ConditionSysEnum::SERVICE => "SERVICE",
ConditionSysEnum::NAME => "NAME",
ConditionSysEnum::IP => "IP",
}
}
}
impl std::convert::TryFrom< &str> for ConditionSysEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"NO_ATTR" => Ok(ConditionSysEnum::NOATTR),
"REGION" => Ok(ConditionSysEnum::REGION),
"SERVICE" => Ok(ConditionSysEnum::SERVICE),
"NAME" => Ok(ConditionSysEnum::NAME),
"IP" => Ok(ConditionSysEnum::IP),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ConditionSysEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region ConditionIamEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// Trusted attributes supplied by the IAM system.
pub enum ConditionIamEnum {
/// Default non-attribute.
///
/// "NO_ATTR"
#[serde(rename="NO_ATTR")]
NOATTR,
/// Either principal or (if present) authority selector.
///
/// "AUTHORITY"
#[serde(rename="AUTHORITY")]
AUTHORITY,
/// The principal (even if an authority selector is present), which
must only be used for attribution, not authorization.
///
/// "ATTRIBUTION"
#[serde(rename="ATTRIBUTION")]
ATTRIBUTION,
/// An approver (distinct from the requester) that has authorized this
request.
When used with IN, the condition indicates that one of the approvers
associated with the request matches the specified principal, or is a
member of the specified group. Approvers can only grant additional
access, and are thus only used in a strictly positive context
(e.g. ALLOW/IN or DENY/NOT_IN).
See: go/rpc-security-policy-dynamicauth.
///
/// "APPROVER"
#[serde(rename="APPROVER")]
APPROVER,
/// What types of justifications have been supplied with this request.
String values should match enum names from tech.iam.JustificationType,
e.g. "MANUAL_STRING". It is not permitted to grant access based on
the *absence* of a justification, so justification conditions can only
be used in a "positive" context (e.g., ALLOW/IN or DENY/NOT_IN).
Multiple justifications, e.g., a Buganizer ID and a manually-entered
reason, are normal and supported.
///
/// "JUSTIFICATION_TYPE"
#[serde(rename="JUSTIFICATION_TYPE")]
JUSTIFICATIONTYPE,
}
impl AsRef<str> for ConditionIamEnum {
fn as_ref(&self) -> &str {
match *self {
ConditionIamEnum::NOATTR => "NO_ATTR",
ConditionIamEnum::AUTHORITY => "AUTHORITY",
ConditionIamEnum::ATTRIBUTION => "ATTRIBUTION",
ConditionIamEnum::APPROVER => "APPROVER",
ConditionIamEnum::JUSTIFICATIONTYPE => "JUSTIFICATION_TYPE",
}
}
}
impl std::convert::TryFrom< &str> for ConditionIamEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"NO_ATTR" => Ok(ConditionIamEnum::NOATTR),
"AUTHORITY" => Ok(ConditionIamEnum::AUTHORITY),
"ATTRIBUTION" => Ok(ConditionIamEnum::ATTRIBUTION),
"APPROVER" => Ok(ConditionIamEnum::APPROVER),
"JUSTIFICATION_TYPE" => Ok(ConditionIamEnum::JUSTIFICATIONTYPE),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a ConditionIamEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion
// region AuditLogConfigLogTypeEnum
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
/// The log type that this config enables.
pub enum AuditLogConfigLogTypeEnum {
/// Default case. Should never be this.
///
/// "LOG_TYPE_UNSPECIFIED"
#[serde(rename="LOG_TYPE_UNSPECIFIED")]
LOGTYPEUNSPECIFIED,
/// Admin reads. Example: CloudIAM getIamPolicy
///
/// "ADMIN_READ"
#[serde(rename="ADMIN_READ")]
ADMINREAD,
/// Data writes. Example: CloudSQL Users create
///
/// "DATA_WRITE"
#[serde(rename="DATA_WRITE")]
DATAWRITE,
/// Data reads. Example: CloudSQL Users list
///
/// "DATA_READ"
#[serde(rename="DATA_READ")]
DATAREAD,
}
impl AsRef<str> for AuditLogConfigLogTypeEnum {
fn as_ref(&self) -> &str {
match *self {
AuditLogConfigLogTypeEnum::LOGTYPEUNSPECIFIED => "LOG_TYPE_UNSPECIFIED",
AuditLogConfigLogTypeEnum::ADMINREAD => "ADMIN_READ",
AuditLogConfigLogTypeEnum::DATAWRITE => "DATA_WRITE",
AuditLogConfigLogTypeEnum::DATAREAD => "DATA_READ",
}
}
}
impl std::convert::TryFrom< &str> for AuditLogConfigLogTypeEnum {
type Error = ();
fn try_from(value: &str) -> Result<Self, Self::Error> {
match value {
"LOG_TYPE_UNSPECIFIED" => Ok(AuditLogConfigLogTypeEnum::LOGTYPEUNSPECIFIED),
"ADMIN_READ" => Ok(AuditLogConfigLogTypeEnum::ADMINREAD),
"DATA_WRITE" => Ok(AuditLogConfigLogTypeEnum::DATAWRITE),
"DATA_READ" => Ok(AuditLogConfigLogTypeEnum::DATAREAD),
_=> Err(()),
}
}
}
impl<'a> Into<std::borrow::Cow<'a, str>> for &'a AuditLogConfigLogTypeEnum {
fn into(self) -> std::borrow::Cow<'a, str> {
self.as_ref().into()
}
}
// endregion

View File

@@ -0,0 +1,114 @@
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};
/// use cloudkms1_beta1::api::enums::*;
/// # 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().unwrap().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(FieldMask::new::<&str>(&[]))
/// .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.5".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.5`.
///
/// Returns the previously set user-agent.
pub fn user_agent(&mut self, agent_name: String) -> String {
mem::replace(&mut self._user_agent, agent_name)
}
/// Set the base url to use in all requests to the server.
/// It defaults to `https://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().unwrap().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,35 @@
use std::collections::HashMap;
use std::cell::RefCell;
use std::default::Default;
use std::collections::BTreeSet;
use std::error::Error as StdError;
use serde_json as json;
use std::io;
use std::fs;
use std::mem;
use hyper::client::connect;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::time::sleep;
use tower_service;
use serde::{Serialize, Deserialize};
use crate::{client, client::GetToken, client::serde_with};
mod utilities;
pub use utilities::*;
mod hub;
pub use hub::*;
mod schemas;
pub use schemas::*;
mod method_builders;
pub use method_builders::*;
mod call_builders;
pub use call_builders::*;
pub mod enums;
pub(crate) use enums::*;

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::standard_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::standard_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<CryptoKeyVersionStateEnum>,
/// 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<CloudAuditOptionLogNameEnum>,
}
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::standard_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::standard_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<CryptoKeyPurposeEnum>,
/// 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<RuleActionEnum>,
/// 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::standard_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::standard_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<ConditionOpEnum>,
/// 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<ConditionSysEnum>,
/// DEPRECATED. Use 'values' instead.
pub value: Option<String>,
/// Trusted attributes supplied by the IAM system.
pub iam: Option<ConditionIamEnum>,
/// 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<AuditLogConfigLogTypeEnum>,
}
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::standard_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
}
}

View File

@@ -2,14 +2,14 @@
// This file was generated automatically from 'src/generator/templates/api/lib.rs.mako'
// DO NOT EDIT !
//! This documentation was generated from *Cloud KMS* crate version *5.0.4+20170515*, where *20170515* is the exact revision of the *cloudkms:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.4*.
//! This documentation was generated from *Cloud KMS* crate version *5.0.5+20170515*, where *20170515* is the exact revision of the *cloudkms:v1beta1* schema built by the [mako](http://www.makotemplates.org/) code generator *v5.0.5*.
//!
//! Everything else about the *Cloud KMS* *v1_beta1* API can be found at the
//! [official documentation site](https://cloud.google.com/kms/).
//! The original source code is [on github](https://github.com/Byron/google-apis-rs/tree/main/gen/cloudkms1_beta1).
//! # Features
//!
//! Handle the following *Resources* with ease from the central [hub](CloudKMS) ...
//! Handle the following *Resources* with ease from the central [hub](CloudKMS) ...
//!
//! * projects
//! * [*locations get*](api::ProjectLocationGetCall), [*locations key rings create*](api::ProjectLocationKeyRingCreateCall), [*locations key rings crypto keys create*](api::ProjectLocationKeyRingCryptoKeyCreateCall), [*locations key rings crypto keys crypto key versions create*](api::ProjectLocationKeyRingCryptoKeyCryptoKeyVersionCreateCall), [*locations key rings crypto keys crypto key versions destroy*](api::ProjectLocationKeyRingCryptoKeyCryptoKeyVersionDestroyCall), [*locations key rings crypto keys crypto key versions get*](api::ProjectLocationKeyRingCryptoKeyCryptoKeyVersionGetCall), [*locations key rings crypto keys crypto key versions list*](api::ProjectLocationKeyRingCryptoKeyCryptoKeyVersionListCall), [*locations key rings crypto keys crypto key versions patch*](api::ProjectLocationKeyRingCryptoKeyCryptoKeyVersionPatchCall), [*locations key rings crypto keys crypto key versions restore*](api::ProjectLocationKeyRingCryptoKeyCryptoKeyVersionRestoreCall), [*locations key rings crypto keys decrypt*](api::ProjectLocationKeyRingCryptoKeyDecryptCall), [*locations key rings crypto keys encrypt*](api::ProjectLocationKeyRingCryptoKeyEncryptCall), [*locations key rings crypto keys get*](api::ProjectLocationKeyRingCryptoKeyGetCall), [*locations key rings crypto keys get iam policy*](api::ProjectLocationKeyRingCryptoKeyGetIamPolicyCall), [*locations key rings crypto keys list*](api::ProjectLocationKeyRingCryptoKeyListCall), [*locations key rings crypto keys patch*](api::ProjectLocationKeyRingCryptoKeyPatchCall), [*locations key rings crypto keys set iam policy*](api::ProjectLocationKeyRingCryptoKeySetIamPolicyCall), [*locations key rings crypto keys test iam permissions*](api::ProjectLocationKeyRingCryptoKeyTestIamPermissionCall), [*locations key rings crypto keys update primary version*](api::ProjectLocationKeyRingCryptoKeyUpdatePrimaryVersionCall), [*locations key rings get*](api::ProjectLocationKeyRingGetCall), [*locations key rings get iam policy*](api::ProjectLocationKeyRingGetIamPolicyCall), [*locations key rings list*](api::ProjectLocationKeyRingListCall), [*locations key rings set iam policy*](api::ProjectLocationKeyRingSetIamPolicyCall), [*locations key rings test iam permissions*](api::ProjectLocationKeyRingTestIamPermissionCall) and [*locations list*](api::ProjectLocationListCall)
@@ -54,8 +54,8 @@
//! let r = hub.projects().locations_key_rings_crypto_keys_crypto_key_versions_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
//! 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.
//!
@@ -80,23 +80,24 @@
//! extern crate google_cloudkms1_beta1 as cloudkms1_beta1;
//! use cloudkms1_beta1::api::CryptoKeyVersion;
//! use cloudkms1_beta1::{Result, Error};
//! use cloudkms1_beta1::api::enums::*;
//! # 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
//! // Get an ApplicationSecret instance by some means. It contains the `client_id` and
//! // `client_secret`, among other things.
//! let secret: oauth2::ApplicationSecret = Default::default();
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
//! // Instantiate the authenticator. It will choose a suitable authentication flow for you,
//! // unless you replace `None` with the desired Flow.
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
//! // Provide your own `AuthenticatorDelegate` to adjust the way it operates and get feedback about
//! // what's going on. You probably want to bring in your own `TokenStorage` to persist tokens and
//! // retrieve them from storage.
//! let auth = oauth2::InstalledFlowAuthenticator::builder(
//! secret,
//! oauth2::InstalledFlowReturnMethod::HTTPRedirect,
//! ).build().await.unwrap();
//! let mut hub = CloudKMS::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().https_or_http().enable_http1().build()), auth);
//! let mut hub = CloudKMS::new(hyper::Client::builder().build(hyper_rustls::HttpsConnectorBuilder::new().with_native_roots().unwrap().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 !
@@ -106,7 +107,7 @@
//! // 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())
//! .update_mask(FieldMask::new::<&str>(&[]))
//! .doit().await;
//!
//! match result {
@@ -131,10 +132,10 @@
//! ## Handling Errors
//!
//! All errors produced by the system are provided either as [Result](client::Result) enumeration as return value of
//! the doit() methods, or handed as possibly intermediate results to either the
//! the doit() methods, or handed as possibly intermediate results to either the
//! [Hub Delegate](client::Delegate), or the [Authenticator Delegate](https://docs.rs/yup-oauth2/*/yup_oauth2/trait.AuthenticatorDelegate.html).
//!
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
//! When delegates handle errors or intermediate values, they may have a chance to instruct the system to retry. This
//! makes the system potentially resilient to all kinds of errors.
//!
//! ## Uploads and Downloads
@@ -144,25 +145,25 @@
//! You can see it as meta-data for the actual media. To trigger a media download, you will have to set up the builder by making
//! this call: `.param("alt", "media")`.
//!
//! Methods supporting uploads can do so using up to 2 different protocols:
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
//! Methods supporting uploads can do so using up to 2 different protocols:
//! *simple* and *resumable*. The distinctiveness of each is represented by customized
//! `doit(...)` methods, which are then named `upload(...)` and `upload_resumable(...)` respectively.
//!
//! ## Customization and Callbacks
//!
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
//! Respective methods will be called to provide progress information, as well as determine whether the system should
//! You may alter the way an `doit()` method is called by providing a [delegate](client::Delegate) to the
//! [Method Builder](client::CallBuilder) before making the final `doit()` call.
//! Respective methods will be called to provide progress information, as well as determine whether the system should
//! retry on failure.
//!
//! The [delegate trait](client::Delegate) is default-implemented, allowing you to customize it with minimal effort.
//!
//! ## Optional Parts in Server-Requests
//!
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
//! All structures provided by this library are made to be [encodable](client::RequestValue) and
//! [decodable](client::ResponseResult) via *json*. Optionals are used to indicate that partial requests are responses
//! are valid.
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
//! Most optionals are are considered [Parts](client::Part) which are identifiable by name, which will be sent to
//! the server to indicate either the set parts of the request or the desired parts in the response.
//!
//! ## Builder Arguments