#![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_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 SetIamPolicyRequest {
pub resource: std::string::String,
pub policy: std::option::Option<crate::model::Policy>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SetIamPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
pub fn set_policy<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.policy = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Policy>,
{
self.policy = 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 SetIamPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.SetIamPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetIamPolicyRequest {
pub resource: std::string::String,
pub options: std::option::Option<crate::model::GetPolicyOptions>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetIamPolicyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
pub fn set_options<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::GetPolicyOptions>,
{
self.options = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::GetPolicyOptions>,
{
self.options = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for GetIamPolicyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.GetIamPolicyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TestIamPermissionsRequest {
pub resource: std::string::String,
pub permissions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TestIamPermissionsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_resource<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.resource = v.into();
self
}
pub fn set_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.permissions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TestIamPermissionsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.TestIamPermissionsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TestIamPermissionsResponse {
pub permissions: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TestIamPermissionsResponse {
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<std::string::String>,
{
use std::iter::Iterator;
self.permissions = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for TestIamPermissionsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.TestIamPermissionsResponse"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetPolicyOptions {
pub requested_policy_version: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetPolicyOptions {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_requested_policy_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.requested_policy_version = v.into();
self
}
}
impl wkt::message::Message for GetPolicyOptions {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.GetPolicyOptions"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Policy {
pub version: i32,
pub bindings: std::vec::Vec<crate::model::Binding>,
pub audit_configs: std::vec::Vec<crate::model::AuditConfig>,
pub etag: ::bytes::Bytes,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Policy {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_version<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.version = v.into();
self
}
pub fn set_bindings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Binding>,
{
use std::iter::Iterator;
self.bindings = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_audit_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuditConfig>,
{
use std::iter::Iterator;
self.audit_configs = v.into_iter().map(|i| i.into()).collect();
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 Policy {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.Policy"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Binding {
pub role: std::string::String,
pub members: std::vec::Vec<std::string::String>,
pub condition: std::option::Option<google_cloud_type::model::Expr>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Binding {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.role = v.into();
self
}
pub fn set_members<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.members = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.condition = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for Binding {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.Binding"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuditConfig {
pub service: std::string::String,
pub audit_log_configs: std::vec::Vec<crate::model::AuditLogConfig>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuditConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_audit_log_configs<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuditLogConfig>,
{
use std::iter::Iterator;
self.audit_log_configs = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AuditConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.AuditConfig"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuditLogConfig {
pub log_type: crate::model::audit_log_config::LogType,
pub exempted_members: std::vec::Vec<std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuditLogConfig {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_log_type<T: std::convert::Into<crate::model::audit_log_config::LogType>>(
mut self,
v: T,
) -> Self {
self.log_type = v.into();
self
}
pub fn set_exempted_members<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.exempted_members = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for AuditLogConfig {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.AuditLogConfig"
}
}
pub mod audit_log_config {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum LogType {
Unspecified,
AdminRead,
DataWrite,
DataRead,
UnknownValue(log_type::UnknownValue),
}
#[doc(hidden)]
pub mod log_type {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl LogType {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::AdminRead => std::option::Option::Some(1),
Self::DataWrite => std::option::Option::Some(2),
Self::DataRead => 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("LOG_TYPE_UNSPECIFIED"),
Self::AdminRead => std::option::Option::Some("ADMIN_READ"),
Self::DataWrite => std::option::Option::Some("DATA_WRITE"),
Self::DataRead => std::option::Option::Some("DATA_READ"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for LogType {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for LogType {
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 LogType {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::AdminRead,
2 => Self::DataWrite,
3 => Self::DataRead,
_ => Self::UnknownValue(log_type::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for LogType {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"LOG_TYPE_UNSPECIFIED" => Self::Unspecified,
"ADMIN_READ" => Self::AdminRead,
"DATA_WRITE" => Self::DataWrite,
"DATA_READ" => Self::DataRead,
_ => Self::UnknownValue(log_type::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for LogType {
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::AdminRead => serializer.serialize_i32(1),
Self::DataWrite => serializer.serialize_i32(2),
Self::DataRead => serializer.serialize_i32(3),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for LogType {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<LogType>::new(
".google.iam.v1.AuditLogConfig.LogType",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct PolicyDelta {
pub binding_deltas: std::vec::Vec<crate::model::BindingDelta>,
pub audit_config_deltas: std::vec::Vec<crate::model::AuditConfigDelta>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl PolicyDelta {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_binding_deltas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::BindingDelta>,
{
use std::iter::Iterator;
self.binding_deltas = v.into_iter().map(|i| i.into()).collect();
self
}
pub fn set_audit_config_deltas<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::AuditConfigDelta>,
{
use std::iter::Iterator;
self.audit_config_deltas = v.into_iter().map(|i| i.into()).collect();
self
}
}
impl wkt::message::Message for PolicyDelta {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.PolicyDelta"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct BindingDelta {
pub action: crate::model::binding_delta::Action,
pub role: std::string::String,
pub member: std::string::String,
pub condition: std::option::Option<google_cloud_type::model::Expr>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl BindingDelta {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action<T: std::convert::Into<crate::model::binding_delta::Action>>(
mut self,
v: T,
) -> Self {
self.action = v.into();
self
}
pub fn set_role<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.role = v.into();
self
}
pub fn set_member<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.member = v.into();
self
}
pub fn set_condition<T>(mut self, v: T) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.condition = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_condition<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<google_cloud_type::model::Expr>,
{
self.condition = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for BindingDelta {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.BindingDelta"
}
}
pub mod binding_delta {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Action {
Unspecified,
Add,
Remove,
UnknownValue(action::UnknownValue),
}
#[doc(hidden)]
pub mod action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Action {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Add => std::option::Option::Some(1),
Self::Remove => 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("ACTION_UNSPECIFIED"),
Self::Add => std::option::Option::Some("ADD"),
Self::Remove => std::option::Option::Some("REMOVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Action {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Action {
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 Action {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Add,
2 => Self::Remove,
_ => Self::UnknownValue(action::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Action {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ACTION_UNSPECIFIED" => Self::Unspecified,
"ADD" => Self::Add,
"REMOVE" => Self::Remove,
_ => Self::UnknownValue(action::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Action {
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::Add => serializer.serialize_i32(1),
Self::Remove => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Action {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
".google.iam.v1.BindingDelta.Action",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct AuditConfigDelta {
pub action: crate::model::audit_config_delta::Action,
pub service: std::string::String,
pub exempted_member: std::string::String,
pub log_type: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl AuditConfigDelta {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_action<T: std::convert::Into<crate::model::audit_config_delta::Action>>(
mut self,
v: T,
) -> Self {
self.action = v.into();
self
}
pub fn set_service<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.service = v.into();
self
}
pub fn set_exempted_member<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.exempted_member = v.into();
self
}
pub fn set_log_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.log_type = v.into();
self
}
}
impl wkt::message::Message for AuditConfigDelta {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.AuditConfigDelta"
}
}
pub mod audit_config_delta {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Action {
Unspecified,
Add,
Remove,
UnknownValue(action::UnknownValue),
}
#[doc(hidden)]
pub mod action {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Action {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Add => std::option::Option::Some(1),
Self::Remove => 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("ACTION_UNSPECIFIED"),
Self::Add => std::option::Option::Some("ADD"),
Self::Remove => std::option::Option::Some("REMOVE"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Action {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Action {
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 Action {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Add,
2 => Self::Remove,
_ => Self::UnknownValue(action::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Action {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"ACTION_UNSPECIFIED" => Self::Unspecified,
"ADD" => Self::Add,
"REMOVE" => Self::Remove,
_ => Self::UnknownValue(action::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Action {
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::Add => serializer.serialize_i32(1),
Self::Remove => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Action {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Action>::new(
".google.iam.v1.AuditConfigDelta.Action",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ResourcePolicyMember {
pub iam_policy_name_principal: std::string::String,
pub iam_policy_uid_principal: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ResourcePolicyMember {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_iam_policy_name_principal<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.iam_policy_name_principal = v.into();
self
}
pub fn set_iam_policy_uid_principal<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.iam_policy_uid_principal = v.into();
self
}
}
impl wkt::message::Message for ResourcePolicyMember {
fn typename() -> &'static str {
"type.googleapis.com/google.iam.v1.ResourcePolicyMember"
}
}