#![allow(rustdoc::redundant_explicit_links)]
#![allow(rustdoc::broken_intra_doc_links)]
#![no_implicit_prelude]
extern crate async_trait;
extern crate bytes;
extern crate gaxi;
extern crate google_cloud_gax;
extern crate google_cloud_iam_v1;
extern crate google_cloud_type;
extern crate serde;
extern crate serde_json;
extern crate serde_with;
extern crate std;
extern crate tracing;
extern crate wkt;
mod debug;
mod deserialize;
mod serialize;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuditData {
pub permission_delta: std::option::Option<crate::model::audit_data::PermissionDelta>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuditData {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_permission_delta<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::audit_data::PermissionDelta>,
{
self.permission_delta = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_permission_delta<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::audit_data::PermissionDelta>,
{
self.permission_delta = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for AuditData {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.AuditData"
}
}
pub mod audit_data {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PermissionDelta {
pub added_permissions: std::vec::Vec<std::string::String>,
pub removed_permissions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PermissionDelta {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_added_permissions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.added_permissions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_removed_permissions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.removed_permissions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PermissionDelta {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.AuditData.PermissionDelta"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceAccount {
pub name: std::string::String,
pub project_id: std::string::String,
pub unique_id: std::string::String,
pub email: std::string::String,
pub display_name: std::string::String,
#[deprecated]
pub etag: ::bytes::Bytes,
pub description: std::string::String,
pub oauth2_client_id: std::string::String,
pub disabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceAccount {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.project_id = v.into();
self
}
pub fn set_unique_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.unique_id = v.into();
self
}
pub fn set_email<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.email = v.into();
self
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
#[deprecated]
pub fn set_etag<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_oauth2_client_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.oauth2_client_id = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
}
impl wkt::message::Message for ServiceAccount {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.ServiceAccount"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceAccountRequest {
pub name: std::string::String,
pub account_id: std::string::String,
pub service_account: std::option::Option<crate::model::ServiceAccount>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateServiceAccountRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_account_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.account_id = v.into();
self
}
pub fn set_service_account<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceAccount>,
{
self.service_account = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceAccount>,
{
self.service_account = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateServiceAccountRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.CreateServiceAccountRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceAccountsRequest {
pub name: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceAccountsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for ListServiceAccountsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.ListServiceAccountsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceAccountsResponse {
pub accounts: std::vec::Vec<crate::model::ServiceAccount>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceAccountsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_accounts<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceAccount>,
{
use std::iter::Iterator;
self.accounts = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListServiceAccountsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.ListServiceAccountsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListServiceAccountsResponse {
type PageItem = crate::model::ServiceAccount;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.accounts
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceAccountRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetServiceAccountRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetServiceAccountRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.GetServiceAccountRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceAccountRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteServiceAccountRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteServiceAccountRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.DeleteServiceAccountRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PatchServiceAccountRequest {
#[allow(missing_docs)]
pub service_account: std::option::Option<crate::model::ServiceAccount>,
#[allow(missing_docs)]
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PatchServiceAccountRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service_account<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceAccount>,
{
self.service_account = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_service_account<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceAccount>,
{
self.service_account = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for PatchServiceAccountRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.PatchServiceAccountRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteServiceAccountRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteServiceAccountRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for UndeleteServiceAccountRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.UndeleteServiceAccountRequest"
}
}
#[allow(missing_docs)]
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteServiceAccountResponse {
pub restored_account: std::option::Option<crate::model::ServiceAccount>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteServiceAccountResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_restored_account<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::ServiceAccount>,
{
self.restored_account = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_restored_account<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::ServiceAccount>,
{
self.restored_account = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UndeleteServiceAccountResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.UndeleteServiceAccountResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnableServiceAccountRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnableServiceAccountRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for EnableServiceAccountRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.EnableServiceAccountRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisableServiceAccountRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisableServiceAccountRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DisableServiceAccountRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.DisableServiceAccountRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceAccountKeysRequest {
pub name: std::string::String,
pub key_types: std::vec::Vec<crate::model::list_service_account_keys_request::KeyType>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceAccountKeysRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_key_types<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::list_service_account_keys_request::KeyType>,
{
use std::iter::Iterator;
self.key_types = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListServiceAccountKeysRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.ListServiceAccountKeysRequest"
}
}
pub mod list_service_account_keys_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum KeyType {
Unspecified,
UserManaged,
SystemManaged,
UnknownValue(key_type::UnknownValue),
}
#[doc(hidden)]
pub mod key_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl KeyType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::UserManaged => std::option::Option::Some(1),
Self::SystemManaged => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("KEY_TYPE_UNSPECIFIED"),
Self::UserManaged => std::option::Option::Some("USER_MANAGED"),
Self::SystemManaged => std::option::Option::Some("SYSTEM_MANAGED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for KeyType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for KeyType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for KeyType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::UserManaged,
2 => Self::SystemManaged,
_ => Self::UnknownValue(key_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for KeyType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KEY_TYPE_UNSPECIFIED" => Self::Unspecified,
"USER_MANAGED" => Self::UserManaged,
"SYSTEM_MANAGED" => Self::SystemManaged,
_ => Self::UnknownValue(key_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for KeyType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::UserManaged => serializer.serialize_i32(1),
Self::SystemManaged => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for KeyType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<KeyType>::new(
".google.iam.admin.v1.ListServiceAccountKeysRequest.KeyType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListServiceAccountKeysResponse {
pub keys: std::vec::Vec<crate::model::ServiceAccountKey>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListServiceAccountKeysResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::ServiceAccountKey>,
{
use std::iter::Iterator;
self.keys = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for ListServiceAccountKeysResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.ListServiceAccountKeysResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetServiceAccountKeyRequest {
pub name: std::string::String,
pub public_key_type: crate::model::ServiceAccountPublicKeyType,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetServiceAccountKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_public_key_type<T: std::convert::Into<crate::model::ServiceAccountPublicKeyType>>(
mut self,
v: T,
) -> Self {
self.public_key_type = v.into();
self
}
}
impl wkt::message::Message for GetServiceAccountKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.GetServiceAccountKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ServiceAccountKey {
pub name: std::string::String,
pub private_key_type: crate::model::ServiceAccountPrivateKeyType,
pub key_algorithm: crate::model::ServiceAccountKeyAlgorithm,
pub private_key_data: ::bytes::Bytes,
pub public_key_data: ::bytes::Bytes,
pub valid_after_time: std::option::Option<wkt::Timestamp>,
pub valid_before_time: std::option::Option<wkt::Timestamp>,
pub key_origin: crate::model::ServiceAccountKeyOrigin,
pub key_type: crate::model::list_service_account_keys_request::KeyType,
pub disabled: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ServiceAccountKey {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_private_key_type<
T: std::convert::Into<crate::model::ServiceAccountPrivateKeyType>,
>(
mut self,
v: T,
) -> Self {
self.private_key_type = v.into();
self
}
pub fn set_key_algorithm<T: std::convert::Into<crate::model::ServiceAccountKeyAlgorithm>>(
mut self,
v: T,
) -> Self {
self.key_algorithm = v.into();
self
}
pub fn set_private_key_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.private_key_data = v.into();
self
}
pub fn set_public_key_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.public_key_data = v.into();
self
}
pub fn set_valid_after_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.valid_after_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_valid_after_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.valid_after_time = v.map(|x| x.into());
self
}
pub fn set_valid_before_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.valid_before_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_valid_before_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.valid_before_time = v.map(|x| x.into());
self
}
pub fn set_key_origin<T: std::convert::Into<crate::model::ServiceAccountKeyOrigin>>(
mut self,
v: T,
) -> Self {
self.key_origin = v.into();
self
}
pub fn set_key_type<
T: std::convert::Into<crate::model::list_service_account_keys_request::KeyType>,
>(
mut self,
v: T,
) -> Self {
self.key_type = v.into();
self
}
pub fn set_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.disabled = v.into();
self
}
}
impl wkt::message::Message for ServiceAccountKey {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.ServiceAccountKey"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateServiceAccountKeyRequest {
pub name: std::string::String,
pub private_key_type: crate::model::ServiceAccountPrivateKeyType,
pub key_algorithm: crate::model::ServiceAccountKeyAlgorithm,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateServiceAccountKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_private_key_type<
T: std::convert::Into<crate::model::ServiceAccountPrivateKeyType>,
>(
mut self,
v: T,
) -> Self {
self.private_key_type = v.into();
self
}
pub fn set_key_algorithm<T: std::convert::Into<crate::model::ServiceAccountKeyAlgorithm>>(
mut self,
v: T,
) -> Self {
self.key_algorithm = v.into();
self
}
}
impl wkt::message::Message for CreateServiceAccountKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.CreateServiceAccountKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UploadServiceAccountKeyRequest {
pub name: std::string::String,
pub public_key_data: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UploadServiceAccountKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_public_key_data<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.public_key_data = v.into();
self
}
}
impl wkt::message::Message for UploadServiceAccountKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.UploadServiceAccountKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteServiceAccountKeyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteServiceAccountKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DeleteServiceAccountKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.DeleteServiceAccountKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DisableServiceAccountKeyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DisableServiceAccountKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for DisableServiceAccountKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.DisableServiceAccountKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct EnableServiceAccountKeyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EnableServiceAccountKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for EnableServiceAccountKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.EnableServiceAccountKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SignBlobRequest {
#[deprecated]
pub name: std::string::String,
#[deprecated]
pub bytes_to_sign: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SignBlobRequest {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
#[deprecated]
pub fn set_bytes_to_sign<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.bytes_to_sign = v.into();
self
}
}
impl wkt::message::Message for SignBlobRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.SignBlobRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SignBlobResponse {
#[deprecated]
pub key_id: std::string::String,
#[deprecated]
pub signature: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SignBlobResponse {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_id = v.into();
self
}
#[deprecated]
pub fn set_signature<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.signature = v.into();
self
}
}
impl wkt::message::Message for SignBlobResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.SignBlobResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SignJwtRequest {
#[deprecated]
pub name: std::string::String,
#[deprecated]
pub payload: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SignJwtRequest {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
#[deprecated]
pub fn set_payload<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.payload = v.into();
self
}
}
impl wkt::message::Message for SignJwtRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.SignJwtRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SignJwtResponse {
#[deprecated]
pub key_id: std::string::String,
#[deprecated]
pub signed_jwt: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SignJwtResponse {
pub fn new() -> Self {
std::default::Default::default()
}
#[deprecated]
pub fn set_key_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.key_id = v.into();
self
}
#[deprecated]
pub fn set_signed_jwt<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.signed_jwt = v.into();
self
}
}
impl wkt::message::Message for SignJwtResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.SignJwtResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Role {
pub name: std::string::String,
pub title: std::string::String,
pub description: std::string::String,
pub included_permissions: std::vec::Vec<std::string::String>,
pub stage: crate::model::role::RoleLaunchStage,
pub etag: ::bytes::Bytes,
pub deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Role {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.title = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
pub fn set_included_permissions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.included_permissions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_stage<T: std::convert::Into<crate::model::role::RoleLaunchStage>>(
mut self,
v: T,
) -> Self {
self.stage = v.into();
self
}
pub fn set_etag<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.deleted = v.into();
self
}
}
impl wkt::message::Message for Role {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.Role"
}
}
pub mod role {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RoleLaunchStage {
Alpha,
Beta,
Ga,
Deprecated,
Disabled,
Eap,
UnknownValue(role_launch_stage::UnknownValue),
}
#[doc(hidden)]
pub mod role_launch_stage {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RoleLaunchStage {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Alpha => std::option::Option::Some(0),
Self::Beta => std::option::Option::Some(1),
Self::Ga => std::option::Option::Some(2),
Self::Deprecated => std::option::Option::Some(4),
Self::Disabled => std::option::Option::Some(5),
Self::Eap => std::option::Option::Some(6),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Alpha => std::option::Option::Some("ALPHA"),
Self::Beta => std::option::Option::Some("BETA"),
Self::Ga => std::option::Option::Some("GA"),
Self::Deprecated => std::option::Option::Some("DEPRECATED"),
Self::Disabled => std::option::Option::Some("DISABLED"),
Self::Eap => std::option::Option::Some("EAP"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RoleLaunchStage {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RoleLaunchStage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RoleLaunchStage {
fn from(value: i32) -> Self {
match value {
0 => Self::Alpha,
1 => Self::Beta,
2 => Self::Ga,
4 => Self::Deprecated,
5 => Self::Disabled,
6 => Self::Eap,
_ => Self::UnknownValue(role_launch_stage::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RoleLaunchStage {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ALPHA" => Self::Alpha,
"BETA" => Self::Beta,
"GA" => Self::Ga,
"DEPRECATED" => Self::Deprecated,
"DISABLED" => Self::Disabled,
"EAP" => Self::Eap,
_ => Self::UnknownValue(role_launch_stage::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RoleLaunchStage {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Alpha => serializer.serialize_i32(0),
Self::Beta => serializer.serialize_i32(1),
Self::Ga => serializer.serialize_i32(2),
Self::Deprecated => serializer.serialize_i32(4),
Self::Disabled => serializer.serialize_i32(5),
Self::Eap => serializer.serialize_i32(6),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RoleLaunchStage {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoleLaunchStage>::new(
".google.iam.admin.v1.Role.RoleLaunchStage",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryGrantableRolesRequest {
pub full_resource_name: std::string::String,
#[allow(missing_docs)]
pub view: crate::model::RoleView,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryGrantableRolesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.full_resource_name = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::RoleView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for QueryGrantableRolesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.QueryGrantableRolesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryGrantableRolesResponse {
pub roles: std::vec::Vec<crate::model::Role>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryGrantableRolesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Role>,
{
use std::iter::Iterator;
self.roles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for QueryGrantableRolesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.QueryGrantableRolesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for QueryGrantableRolesResponse {
type PageItem = crate::model::Role;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.roles
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRolesRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub view: crate::model::RoleView,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRolesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
pub fn set_view<T: std::convert::Into<crate::model::RoleView>>(mut self, v: T) -> Self {
self.view = v.into();
self
}
pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListRolesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.ListRolesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListRolesResponse {
pub roles: std::vec::Vec<crate::model::Role>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListRolesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_roles<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Role>,
{
use std::iter::Iterator;
self.roles = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for ListRolesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.ListRolesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListRolesResponse {
type PageItem = crate::model::Role;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.roles
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetRoleRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetRoleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for GetRoleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.GetRoleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateRoleRequest {
pub parent: std::string::String,
pub role_id: std::string::String,
pub role: std::option::Option<crate::model::Role>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateRoleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_role_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.role_id = v.into();
self
}
pub fn set_role<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Role>,
{
self.role = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Role>,
{
self.role = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateRoleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.CreateRoleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateRoleRequest {
pub name: std::string::String,
pub role: std::option::Option<crate::model::Role>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateRoleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_role<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Role>,
{
self.role = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_role<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Role>,
{
self.role = v.map(|x| x.into());
self
}
pub fn set_update_mask<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::FieldMask>,
{
self.update_mask = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for UpdateRoleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.UpdateRoleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteRoleRequest {
pub name: std::string::String,
pub etag: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteRoleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteRoleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.DeleteRoleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteRoleRequest {
pub name: std::string::String,
pub etag: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteRoleRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_etag<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for UndeleteRoleRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.UndeleteRoleRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Permission {
pub name: std::string::String,
pub title: std::string::String,
pub description: std::string::String,
#[allow(missing_docs)]
#[deprecated]
pub only_in_predefined_roles: bool,
pub stage: crate::model::permission::PermissionLaunchStage,
pub custom_roles_support_level: crate::model::permission::CustomRolesSupportLevel,
pub api_disabled: bool,
pub primary_permission: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Permission {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
pub fn set_title<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.title = v.into();
self
}
pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.description = v.into();
self
}
#[deprecated]
pub fn set_only_in_predefined_roles<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.only_in_predefined_roles = v.into();
self
}
pub fn set_stage<T: std::convert::Into<crate::model::permission::PermissionLaunchStage>>(
mut self,
v: T,
) -> Self {
self.stage = v.into();
self
}
pub fn set_custom_roles_support_level<
T: std::convert::Into<crate::model::permission::CustomRolesSupportLevel>,
>(
mut self,
v: T,
) -> Self {
self.custom_roles_support_level = v.into();
self
}
pub fn set_api_disabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.api_disabled = v.into();
self
}
pub fn set_primary_permission<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.primary_permission = v.into();
self
}
}
impl wkt::message::Message for Permission {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.Permission"
}
}
pub mod permission {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum PermissionLaunchStage {
Alpha,
Beta,
Ga,
Deprecated,
UnknownValue(permission_launch_stage::UnknownValue),
}
#[doc(hidden)]
pub mod permission_launch_stage {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl PermissionLaunchStage {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Alpha => std::option::Option::Some(0),
Self::Beta => std::option::Option::Some(1),
Self::Ga => std::option::Option::Some(2),
Self::Deprecated => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Alpha => std::option::Option::Some("ALPHA"),
Self::Beta => std::option::Option::Some("BETA"),
Self::Ga => std::option::Option::Some("GA"),
Self::Deprecated => std::option::Option::Some("DEPRECATED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for PermissionLaunchStage {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for PermissionLaunchStage {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for PermissionLaunchStage {
fn from(value: i32) -> Self {
match value {
0 => Self::Alpha,
1 => Self::Beta,
2 => Self::Ga,
3 => Self::Deprecated,
_ => Self::UnknownValue(permission_launch_stage::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for PermissionLaunchStage {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ALPHA" => Self::Alpha,
"BETA" => Self::Beta,
"GA" => Self::Ga,
"DEPRECATED" => Self::Deprecated,
_ => Self::UnknownValue(permission_launch_stage::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for PermissionLaunchStage {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Alpha => serializer.serialize_i32(0),
Self::Beta => serializer.serialize_i32(1),
Self::Ga => serializer.serialize_i32(2),
Self::Deprecated => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for PermissionLaunchStage {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<PermissionLaunchStage>::new(
".google.iam.admin.v1.Permission.PermissionLaunchStage",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum CustomRolesSupportLevel {
Supported,
Testing,
NotSupported,
UnknownValue(custom_roles_support_level::UnknownValue),
}
#[doc(hidden)]
pub mod custom_roles_support_level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl CustomRolesSupportLevel {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Supported => std::option::Option::Some(0),
Self::Testing => std::option::Option::Some(1),
Self::NotSupported => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Supported => std::option::Option::Some("SUPPORTED"),
Self::Testing => std::option::Option::Some("TESTING"),
Self::NotSupported => std::option::Option::Some("NOT_SUPPORTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for CustomRolesSupportLevel {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for CustomRolesSupportLevel {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for CustomRolesSupportLevel {
fn from(value: i32) -> Self {
match value {
0 => Self::Supported,
1 => Self::Testing,
2 => Self::NotSupported,
_ => Self::UnknownValue(custom_roles_support_level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for CustomRolesSupportLevel {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SUPPORTED" => Self::Supported,
"TESTING" => Self::Testing,
"NOT_SUPPORTED" => Self::NotSupported,
_ => Self::UnknownValue(custom_roles_support_level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for CustomRolesSupportLevel {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Supported => serializer.serialize_i32(0),
Self::Testing => serializer.serialize_i32(1),
Self::NotSupported => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for CustomRolesSupportLevel {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<CustomRolesSupportLevel>::new(
".google.iam.admin.v1.Permission.CustomRolesSupportLevel",
),
)
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryTestablePermissionsRequest {
pub full_resource_name: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryTestablePermissionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.full_resource_name = v.into();
self
}
pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = v.into();
self
}
}
impl wkt::message::Message for QueryTestablePermissionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.QueryTestablePermissionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryTestablePermissionsResponse {
pub permissions: std::vec::Vec<crate::model::Permission>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryTestablePermissionsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_permissions<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Permission>,
{
use std::iter::Iterator;
self.permissions = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.next_page_token = v.into();
self
}
}
impl wkt::message::Message for QueryTestablePermissionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.QueryTestablePermissionsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for QueryTestablePermissionsResponse {
type PageItem = crate::model::Permission;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.permissions
}
fn next_page_token(&self) -> std::string::String {
use std::clone::Clone;
self.next_page_token.clone()
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryAuditableServicesRequest {
pub full_resource_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryAuditableServicesRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.full_resource_name = v.into();
self
}
}
impl wkt::message::Message for QueryAuditableServicesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.QueryAuditableServicesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct QueryAuditableServicesResponse {
pub services: std::vec::Vec<crate::model::query_auditable_services_response::AuditableService>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl QueryAuditableServicesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_services<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::query_auditable_services_response::AuditableService>,
{
use std::iter::Iterator;
self.services = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for QueryAuditableServicesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.QueryAuditableServicesResponse"
}
}
pub mod query_auditable_services_response {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuditableService {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuditableService {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.name = v.into();
self
}
}
impl wkt::message::Message for AuditableService {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.QueryAuditableServicesResponse.AuditableService"
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LintPolicyRequest {
pub full_resource_name: std::string::String,
pub lint_object: std::option::Option<crate::model::lint_policy_request::LintObject>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LintPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_full_resource_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.full_resource_name = v.into();
self
}
pub fn set_lint_object<
T: std::convert::Into<std::option::Option<crate::model::lint_policy_request::LintObject>>,
>(
mut self,
v: T,
) -> Self {
self.lint_object = v.into();
self
}
pub fn condition(
&self,
) -> std::option::Option<&std::boxed::Box<google_cloud_type::model::Expr>> {
#[allow(unreachable_patterns)]
self.lint_object.as_ref().and_then(|v| match v {
crate::model::lint_policy_request::LintObject::Condition(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_condition<T: std::convert::Into<std::boxed::Box<google_cloud_type::model::Expr>>>(
mut self,
v: T,
) -> Self {
self.lint_object = std::option::Option::Some(
crate::model::lint_policy_request::LintObject::Condition(v.into()),
);
self
}
}
impl wkt::message::Message for LintPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.LintPolicyRequest"
}
}
pub mod lint_policy_request {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LintObject {
Condition(std::boxed::Box<google_cloud_type::model::Expr>),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LintResult {
pub level: crate::model::lint_result::Level,
pub validation_unit_name: std::string::String,
pub severity: crate::model::lint_result::Severity,
pub field_name: std::string::String,
pub location_offset: i32,
pub debug_message: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LintResult {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_level<T: std::convert::Into<crate::model::lint_result::Level>>(
mut self,
v: T,
) -> Self {
self.level = v.into();
self
}
pub fn set_validation_unit_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.validation_unit_name = v.into();
self
}
pub fn set_severity<T: std::convert::Into<crate::model::lint_result::Severity>>(
mut self,
v: T,
) -> Self {
self.severity = v.into();
self
}
pub fn set_field_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.field_name = v.into();
self
}
pub fn set_location_offset<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.location_offset = v.into();
self
}
pub fn set_debug_message<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.debug_message = v.into();
self
}
}
impl wkt::message::Message for LintResult {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.LintResult"
}
}
pub mod lint_result {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Level {
Unspecified,
Condition,
UnknownValue(level::UnknownValue),
}
#[doc(hidden)]
pub mod level {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Level {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Condition => std::option::Option::Some(3),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("LEVEL_UNSPECIFIED"),
Self::Condition => std::option::Option::Some("CONDITION"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Level {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Level {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Level {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
3 => Self::Condition,
_ => Self::UnknownValue(level::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Level {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LEVEL_UNSPECIFIED" => Self::Unspecified,
"CONDITION" => Self::Condition,
_ => Self::UnknownValue(level::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Level {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Condition => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Level {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Level>::new(
".google.iam.admin.v1.LintResult.Level",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Severity {
Unspecified,
Error,
Warning,
Notice,
Info,
Deprecated,
UnknownValue(severity::UnknownValue),
}
#[doc(hidden)]
pub mod severity {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Severity {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Error => std::option::Option::Some(1),
Self::Warning => std::option::Option::Some(2),
Self::Notice => std::option::Option::Some(3),
Self::Info => std::option::Option::Some(4),
Self::Deprecated => std::option::Option::Some(5),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("SEVERITY_UNSPECIFIED"),
Self::Error => std::option::Option::Some("ERROR"),
Self::Warning => std::option::Option::Some("WARNING"),
Self::Notice => std::option::Option::Some("NOTICE"),
Self::Info => std::option::Option::Some("INFO"),
Self::Deprecated => std::option::Option::Some("DEPRECATED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Severity {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Severity {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for Severity {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Error,
2 => Self::Warning,
3 => Self::Notice,
4 => Self::Info,
5 => Self::Deprecated,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Severity {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"SEVERITY_UNSPECIFIED" => Self::Unspecified,
"ERROR" => Self::Error,
"WARNING" => Self::Warning,
"NOTICE" => Self::Notice,
"INFO" => Self::Info,
"DEPRECATED" => Self::Deprecated,
_ => Self::UnknownValue(severity::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Severity {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Unspecified => serializer.serialize_i32(0),
Self::Error => serializer.serialize_i32(1),
Self::Warning => serializer.serialize_i32(2),
Self::Notice => serializer.serialize_i32(3),
Self::Info => serializer.serialize_i32(4),
Self::Deprecated => serializer.serialize_i32(5),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Severity {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Severity>::new(
".google.iam.admin.v1.LintResult.Severity",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct LintPolicyResponse {
pub lint_results: std::vec::Vec<crate::model::LintResult>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl LintPolicyResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_lint_results<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::LintResult>,
{
use std::iter::Iterator;
self.lint_results = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for LintPolicyResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.admin.v1.LintPolicyResponse"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ServiceAccountKeyAlgorithm {
KeyAlgUnspecified,
KeyAlgRsa1024,
KeyAlgRsa2048,
UnknownValue(service_account_key_algorithm::UnknownValue),
}
#[doc(hidden)]
pub mod service_account_key_algorithm {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ServiceAccountKeyAlgorithm {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::KeyAlgUnspecified => std::option::Option::Some(0),
Self::KeyAlgRsa1024 => std::option::Option::Some(1),
Self::KeyAlgRsa2048 => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::KeyAlgUnspecified => std::option::Option::Some("KEY_ALG_UNSPECIFIED"),
Self::KeyAlgRsa1024 => std::option::Option::Some("KEY_ALG_RSA_1024"),
Self::KeyAlgRsa2048 => std::option::Option::Some("KEY_ALG_RSA_2048"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ServiceAccountKeyAlgorithm {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ServiceAccountKeyAlgorithm {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ServiceAccountKeyAlgorithm {
fn from(value: i32) -> Self {
match value {
0 => Self::KeyAlgUnspecified,
1 => Self::KeyAlgRsa1024,
2 => Self::KeyAlgRsa2048,
_ => Self::UnknownValue(service_account_key_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ServiceAccountKeyAlgorithm {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"KEY_ALG_UNSPECIFIED" => Self::KeyAlgUnspecified,
"KEY_ALG_RSA_1024" => Self::KeyAlgRsa1024,
"KEY_ALG_RSA_2048" => Self::KeyAlgRsa2048,
_ => Self::UnknownValue(service_account_key_algorithm::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ServiceAccountKeyAlgorithm {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::KeyAlgUnspecified => serializer.serialize_i32(0),
Self::KeyAlgRsa1024 => serializer.serialize_i32(1),
Self::KeyAlgRsa2048 => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ServiceAccountKeyAlgorithm {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<ServiceAccountKeyAlgorithm>::new(
".google.iam.admin.v1.ServiceAccountKeyAlgorithm",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ServiceAccountPrivateKeyType {
TypeUnspecified,
TypePkcs12File,
TypeGoogleCredentialsFile,
UnknownValue(service_account_private_key_type::UnknownValue),
}
#[doc(hidden)]
pub mod service_account_private_key_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ServiceAccountPrivateKeyType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::TypeUnspecified => std::option::Option::Some(0),
Self::TypePkcs12File => std::option::Option::Some(1),
Self::TypeGoogleCredentialsFile => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::TypeUnspecified => std::option::Option::Some("TYPE_UNSPECIFIED"),
Self::TypePkcs12File => std::option::Option::Some("TYPE_PKCS12_FILE"),
Self::TypeGoogleCredentialsFile => {
std::option::Option::Some("TYPE_GOOGLE_CREDENTIALS_FILE")
}
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ServiceAccountPrivateKeyType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ServiceAccountPrivateKeyType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ServiceAccountPrivateKeyType {
fn from(value: i32) -> Self {
match value {
0 => Self::TypeUnspecified,
1 => Self::TypePkcs12File,
2 => Self::TypeGoogleCredentialsFile,
_ => Self::UnknownValue(service_account_private_key_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ServiceAccountPrivateKeyType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_UNSPECIFIED" => Self::TypeUnspecified,
"TYPE_PKCS12_FILE" => Self::TypePkcs12File,
"TYPE_GOOGLE_CREDENTIALS_FILE" => Self::TypeGoogleCredentialsFile,
_ => Self::UnknownValue(service_account_private_key_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ServiceAccountPrivateKeyType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::TypeUnspecified => serializer.serialize_i32(0),
Self::TypePkcs12File => serializer.serialize_i32(1),
Self::TypeGoogleCredentialsFile => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ServiceAccountPrivateKeyType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<ServiceAccountPrivateKeyType>::new(
".google.iam.admin.v1.ServiceAccountPrivateKeyType",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ServiceAccountPublicKeyType {
TypeNone,
TypeX509PemFile,
TypeRawPublicKey,
UnknownValue(service_account_public_key_type::UnknownValue),
}
#[doc(hidden)]
pub mod service_account_public_key_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ServiceAccountPublicKeyType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::TypeNone => std::option::Option::Some(0),
Self::TypeX509PemFile => std::option::Option::Some(1),
Self::TypeRawPublicKey => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::TypeNone => std::option::Option::Some("TYPE_NONE"),
Self::TypeX509PemFile => std::option::Option::Some("TYPE_X509_PEM_FILE"),
Self::TypeRawPublicKey => std::option::Option::Some("TYPE_RAW_PUBLIC_KEY"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ServiceAccountPublicKeyType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ServiceAccountPublicKeyType {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ServiceAccountPublicKeyType {
fn from(value: i32) -> Self {
match value {
0 => Self::TypeNone,
1 => Self::TypeX509PemFile,
2 => Self::TypeRawPublicKey,
_ => Self::UnknownValue(service_account_public_key_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ServiceAccountPublicKeyType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"TYPE_NONE" => Self::TypeNone,
"TYPE_X509_PEM_FILE" => Self::TypeX509PemFile,
"TYPE_RAW_PUBLIC_KEY" => Self::TypeRawPublicKey,
_ => Self::UnknownValue(service_account_public_key_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ServiceAccountPublicKeyType {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::TypeNone => serializer.serialize_i32(0),
Self::TypeX509PemFile => serializer.serialize_i32(1),
Self::TypeRawPublicKey => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ServiceAccountPublicKeyType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(
wkt::internal::EnumVisitor::<ServiceAccountPublicKeyType>::new(
".google.iam.admin.v1.ServiceAccountPublicKeyType",
),
)
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum ServiceAccountKeyOrigin {
OriginUnspecified,
UserProvided,
GoogleProvided,
UnknownValue(service_account_key_origin::UnknownValue),
}
#[doc(hidden)]
pub mod service_account_key_origin {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl ServiceAccountKeyOrigin {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::OriginUnspecified => std::option::Option::Some(0),
Self::UserProvided => std::option::Option::Some(1),
Self::GoogleProvided => std::option::Option::Some(2),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::OriginUnspecified => std::option::Option::Some("ORIGIN_UNSPECIFIED"),
Self::UserProvided => std::option::Option::Some("USER_PROVIDED"),
Self::GoogleProvided => std::option::Option::Some("GOOGLE_PROVIDED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for ServiceAccountKeyOrigin {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for ServiceAccountKeyOrigin {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for ServiceAccountKeyOrigin {
fn from(value: i32) -> Self {
match value {
0 => Self::OriginUnspecified,
1 => Self::UserProvided,
2 => Self::GoogleProvided,
_ => Self::UnknownValue(service_account_key_origin::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for ServiceAccountKeyOrigin {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ORIGIN_UNSPECIFIED" => Self::OriginUnspecified,
"USER_PROVIDED" => Self::UserProvided,
"GOOGLE_PROVIDED" => Self::GoogleProvided,
_ => Self::UnknownValue(service_account_key_origin::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for ServiceAccountKeyOrigin {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::OriginUnspecified => serializer.serialize_i32(0),
Self::UserProvided => serializer.serialize_i32(1),
Self::GoogleProvided => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for ServiceAccountKeyOrigin {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<ServiceAccountKeyOrigin>::new(
".google.iam.admin.v1.ServiceAccountKeyOrigin",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum RoleView {
Basic,
Full,
UnknownValue(role_view::UnknownValue),
}
#[doc(hidden)]
pub mod role_view {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl RoleView {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Basic => std::option::Option::Some(0),
Self::Full => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Basic => std::option::Option::Some("BASIC"),
Self::Full => std::option::Option::Some("FULL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for RoleView {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for RoleView {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
wkt::internal::display_enum(f, self.name(), self.value())
}
}
impl std::convert::From<i32> for RoleView {
fn from(value: i32) -> Self {
match value {
0 => Self::Basic,
1 => Self::Full,
_ => Self::UnknownValue(role_view::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for RoleView {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"BASIC" => Self::Basic,
"FULL" => Self::Full,
_ => Self::UnknownValue(role_view::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for RoleView {
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
match self {
Self::Basic => serializer.serialize_i32(0),
Self::Full => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for RoleView {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<RoleView>::new(
".google.iam.admin.v1.RoleView",
))
}
}