#![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_longrunning;
extern crate google_cloud_lro;
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 Folder {
pub name: std::string::String,
pub parent: std::string::String,
pub display_name: std::string::String,
pub state: crate::model::folder::State,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Folder {
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_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = 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
}
pub fn set_state<T: std::convert::Into<crate::model::folder::State>>(mut self, v: T) -> Self {
self.state = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for Folder {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.Folder"
}
}
pub mod folder {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
DeleteRequested,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::DeleteRequested => 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("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::DeleteRequested => std::option::Option::Some("DELETE_REQUESTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::DeleteRequested,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"DELETE_REQUESTED" => Self::DeleteRequested,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Active => serializer.serialize_i32(1),
Self::DeleteRequested => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.resourcemanager.v3.Folder.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetFolderRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetFolderRequest {
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 GetFolderRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.GetFolderRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFoldersRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFoldersRequest {
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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListFoldersRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListFoldersRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListFoldersResponse {
pub folders: std::vec::Vec<crate::model::Folder>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListFoldersResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_folders<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Folder>,
{
use std::iter::Iterator;
self.folders = 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 ListFoldersResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListFoldersResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListFoldersResponse {
type PageItem = crate::model::Folder;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.folders
}
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 SearchFoldersRequest {
pub page_size: i32,
pub page_token: std::string::String,
pub query: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchFoldersRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
}
impl wkt::message::Message for SearchFoldersRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.SearchFoldersRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchFoldersResponse {
pub folders: std::vec::Vec<crate::model::Folder>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchFoldersResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_folders<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Folder>,
{
use std::iter::Iterator;
self.folders = 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 SearchFoldersResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.SearchFoldersResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for SearchFoldersResponse {
type PageItem = crate::model::Folder;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.folders
}
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 CreateFolderRequest {
pub folder: std::option::Option<crate::model::Folder>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateFolderRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_folder<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Folder>,
{
self.folder = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Folder>,
{
self.folder = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateFolderRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateFolderRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateFolderMetadata {
pub display_name: std::string::String,
pub parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateFolderMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
}
impl wkt::message::Message for CreateFolderMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateFolderMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateFolderRequest {
pub folder: std::option::Option<crate::model::Folder>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateFolderRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_folder<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Folder>,
{
self.folder = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Folder>,
{
self.folder = 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 UpdateFolderRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UpdateFolderRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateFolderMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateFolderMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpdateFolderMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UpdateFolderMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveFolderRequest {
pub name: std::string::String,
pub destination_parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MoveFolderRequest {
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_destination_parent<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_parent = v.into();
self
}
}
impl wkt::message::Message for MoveFolderRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.MoveFolderRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveFolderMetadata {
pub display_name: std::string::String,
pub source_parent: std::string::String,
pub destination_parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MoveFolderMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_source_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.source_parent = v.into();
self
}
pub fn set_destination_parent<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_parent = v.into();
self
}
}
impl wkt::message::Message for MoveFolderMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.MoveFolderMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteFolderRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteFolderRequest {
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 DeleteFolderRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteFolderRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteFolderMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteFolderMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteFolderMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteFolderMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteFolderRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteFolderRequest {
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 UndeleteFolderRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteFolderRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteFolderMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteFolderMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UndeleteFolderMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteFolderMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Organization {
pub name: std::string::String,
pub display_name: std::string::String,
pub state: crate::model::organization::State,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub owner: std::option::Option<crate::model::organization::Owner>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Organization {
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_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.display_name = v.into();
self
}
pub fn set_state<T: std::convert::Into<crate::model::organization::State>>(
mut self,
v: T,
) -> Self {
self.state = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_owner<
T: std::convert::Into<std::option::Option<crate::model::organization::Owner>>,
>(
mut self,
v: T,
) -> Self {
self.owner = v.into();
self
}
pub fn directory_customer_id(&self) -> std::option::Option<&std::string::String> {
#[allow(unreachable_patterns)]
self.owner.as_ref().and_then(|v| match v {
crate::model::organization::Owner::DirectoryCustomerId(v) => {
std::option::Option::Some(v)
}
_ => std::option::Option::None,
})
}
pub fn set_directory_customer_id<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.owner = std::option::Option::Some(
crate::model::organization::Owner::DirectoryCustomerId(v.into()),
);
self
}
}
impl wkt::message::Message for Organization {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.Organization"
}
}
pub mod organization {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
DeleteRequested,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::DeleteRequested => 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("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::DeleteRequested => std::option::Option::Some("DELETE_REQUESTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::DeleteRequested,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"DELETE_REQUESTED" => Self::DeleteRequested,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Active => serializer.serialize_i32(1),
Self::DeleteRequested => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.resourcemanager.v3.Organization.State",
))
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Owner {
DirectoryCustomerId(std::string::String),
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetOrganizationRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetOrganizationRequest {
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 GetOrganizationRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.GetOrganizationRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchOrganizationsRequest {
pub page_size: i32,
pub page_token: std::string::String,
pub query: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchOrganizationsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
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_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = v.into();
self
}
}
impl wkt::message::Message for SearchOrganizationsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.SearchOrganizationsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchOrganizationsResponse {
pub organizations: std::vec::Vec<crate::model::Organization>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchOrganizationsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_organizations<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Organization>,
{
use std::iter::Iterator;
self.organizations = 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 SearchOrganizationsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.SearchOrganizationsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for SearchOrganizationsResponse {
type PageItem = crate::model::Organization;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.organizations
}
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 DeleteOrganizationMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteOrganizationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteOrganizationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteOrganizationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteOrganizationMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteOrganizationMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UndeleteOrganizationMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct Project {
pub name: std::string::String,
pub parent: std::string::String,
pub project_id: std::string::String,
pub state: crate::model::project::State,
pub display_name: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub delete_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub labels: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl Project {
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_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = 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_state<T: std::convert::Into<crate::model::project::State>>(mut self, v: T) -> Self {
self.state = 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
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_delete_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.delete_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_labels<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for Project {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.Project"
}
}
pub mod project {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum State {
Unspecified,
Active,
DeleteRequested,
UnknownValue(state::UnknownValue),
}
#[doc(hidden)]
pub mod state {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl State {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::Active => std::option::Option::Some(1),
Self::DeleteRequested => 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("STATE_UNSPECIFIED"),
Self::Active => std::option::Option::Some("ACTIVE"),
Self::DeleteRequested => std::option::Option::Some("DELETE_REQUESTED"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for State {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for State {
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 State {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::Active,
2 => Self::DeleteRequested,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for State {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"STATE_UNSPECIFIED" => Self::Unspecified,
"ACTIVE" => Self::Active,
"DELETE_REQUESTED" => Self::DeleteRequested,
_ => Self::UnknownValue(state::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for State {
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::Active => serializer.serialize_i32(1),
Self::DeleteRequested => serializer.serialize_i32(2),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for State {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
".google.cloud.resourcemanager.v3.Project.State",
))
}
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetProjectRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetProjectRequest {
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 GetProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.GetProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListProjectsRequest {
pub parent: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub show_deleted: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListProjectsRequest {
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_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.page_token = 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_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.show_deleted = v.into();
self
}
}
impl wkt::message::Message for ListProjectsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListProjectsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListProjectsResponse {
pub projects: std::vec::Vec<crate::model::Project>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListProjectsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_projects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Project>,
{
use std::iter::Iterator;
self.projects = 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 ListProjectsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListProjectsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListProjectsResponse {
type PageItem = crate::model::Project;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.projects
}
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 SearchProjectsRequest {
pub query: std::string::String,
pub page_token: std::string::String,
pub page_size: i32,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchProjectsRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.query = 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_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
self.page_size = v.into();
self
}
}
impl wkt::message::Message for SearchProjectsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.SearchProjectsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct SearchProjectsResponse {
pub projects: std::vec::Vec<crate::model::Project>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl SearchProjectsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_projects<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::Project>,
{
use std::iter::Iterator;
self.projects = 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 SearchProjectsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.SearchProjectsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for SearchProjectsResponse {
type PageItem = crate::model::Project;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.projects
}
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 CreateProjectRequest {
pub project: std::option::Option<crate::model::Project>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateProjectRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Project>,
{
self.project = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Project>,
{
self.project = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for CreateProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateProjectMetadata {
pub create_time: std::option::Option<wkt::Timestamp>,
pub gettable: bool,
pub ready: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateProjectMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_gettable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.gettable = v.into();
self
}
pub fn set_ready<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.ready = v.into();
self
}
}
impl wkt::message::Message for CreateProjectMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateProjectMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateProjectRequest {
pub project: std::option::Option<crate::model::Project>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateProjectRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_project<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::Project>,
{
self.project = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::Project>,
{
self.project = 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 UpdateProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UpdateProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateProjectMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateProjectMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpdateProjectMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UpdateProjectMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveProjectRequest {
pub name: std::string::String,
pub destination_parent: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MoveProjectRequest {
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_destination_parent<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.destination_parent = v.into();
self
}
}
impl wkt::message::Message for MoveProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.MoveProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct MoveProjectMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl MoveProjectMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for MoveProjectMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.MoveProjectMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteProjectRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteProjectRequest {
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 DeleteProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteProjectMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteProjectMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteProjectMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteProjectMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteProjectRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteProjectRequest {
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 UndeleteProjectRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteProjectRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UndeleteProjectMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UndeleteProjectMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UndeleteProjectMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteProjectMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TagBinding {
pub name: std::string::String,
pub parent: std::string::String,
pub tag_value: std::string::String,
pub tag_value_namespaced_name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TagBinding {
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_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_tag_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tag_value = v.into();
self
}
pub fn set_tag_value_namespaced_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.tag_value_namespaced_name = v.into();
self
}
}
impl wkt::message::Message for TagBinding {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.TagBinding"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTagBindingMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTagBindingMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateTagBindingMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagBindingMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTagBindingRequest {
pub tag_binding: std::option::Option<crate::model::TagBinding>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTagBindingRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_binding<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TagBinding>,
{
self.tag_binding = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tag_binding<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TagBinding>,
{
self.tag_binding = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateTagBindingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagBindingRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTagBindingMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTagBindingMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteTagBindingMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagBindingMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTagBindingRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTagBindingRequest {
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 DeleteTagBindingRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagBindingRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTagBindingsRequest {
pub parent: 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 ListTagBindingsRequest {
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
}
}
impl wkt::message::Message for ListTagBindingsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListTagBindingsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTagBindingsResponse {
pub tag_bindings: std::vec::Vec<crate::model::TagBinding>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTagBindingsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_bindings<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TagBinding>,
{
use std::iter::Iterator;
self.tag_bindings = 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 ListTagBindingsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListTagBindingsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTagBindingsResponse {
type PageItem = crate::model::TagBinding;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.tag_bindings
}
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 ListEffectiveTagsRequest {
pub parent: 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 ListEffectiveTagsRequest {
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
}
}
impl wkt::message::Message for ListEffectiveTagsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListEffectiveTagsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListEffectiveTagsResponse {
pub effective_tags: std::vec::Vec<crate::model::EffectiveTag>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListEffectiveTagsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_effective_tags<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::EffectiveTag>,
{
use std::iter::Iterator;
self.effective_tags = 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 ListEffectiveTagsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListEffectiveTagsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListEffectiveTagsResponse {
type PageItem = crate::model::EffectiveTag;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.effective_tags
}
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 EffectiveTag {
pub tag_value: std::string::String,
pub namespaced_tag_value: std::string::String,
pub tag_key: std::string::String,
pub namespaced_tag_key: std::string::String,
pub tag_key_parent_name: std::string::String,
pub inherited: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl EffectiveTag {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tag_value = v.into();
self
}
pub fn set_namespaced_tag_value<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.namespaced_tag_value = v.into();
self
}
pub fn set_tag_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.tag_key = v.into();
self
}
pub fn set_namespaced_tag_key<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.namespaced_tag_key = v.into();
self
}
pub fn set_tag_key_parent_name<T: std::convert::Into<std::string::String>>(
mut self,
v: T,
) -> Self {
self.tag_key_parent_name = v.into();
self
}
pub fn set_inherited<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.inherited = v.into();
self
}
}
impl wkt::message::Message for EffectiveTag {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.EffectiveTag"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TagHold {
pub name: std::string::String,
pub holder: std::string::String,
pub origin: std::string::String,
pub help_link: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TagHold {
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_holder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.holder = v.into();
self
}
pub fn set_origin<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.origin = v.into();
self
}
pub fn set_help_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.help_link = v.into();
self
}
pub fn set_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
}
impl wkt::message::Message for TagHold {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.TagHold"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTagHoldRequest {
pub parent: std::string::String,
pub tag_hold: std::option::Option<crate::model::TagHold>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTagHoldRequest {
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_tag_hold<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TagHold>,
{
self.tag_hold = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tag_hold<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TagHold>,
{
self.tag_hold = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateTagHoldRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagHoldRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTagHoldMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTagHoldMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateTagHoldMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagHoldMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTagHoldRequest {
pub name: std::string::String,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTagHoldRequest {
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_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for DeleteTagHoldRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagHoldRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTagHoldMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTagHoldMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteTagHoldMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagHoldMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTagHoldsRequest {
pub parent: std::string::String,
pub page_size: i32,
pub page_token: std::string::String,
pub filter: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTagHoldsRequest {
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_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.filter = v.into();
self
}
}
impl wkt::message::Message for ListTagHoldsRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListTagHoldsRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTagHoldsResponse {
pub tag_holds: std::vec::Vec<crate::model::TagHold>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTagHoldsResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_holds<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TagHold>,
{
use std::iter::Iterator;
self.tag_holds = 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 ListTagHoldsResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListTagHoldsResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTagHoldsResponse {
type PageItem = crate::model::TagHold;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.tag_holds
}
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 TagKey {
pub name: std::string::String,
pub parent: std::string::String,
pub short_name: std::string::String,
pub namespaced_name: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub purpose: crate::model::Purpose,
pub purpose_data: std::collections::HashMap<std::string::String, std::string::String>,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TagKey {
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_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_short_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.short_name = v.into();
self
}
pub fn set_namespaced_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.namespaced_name = 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_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
pub fn set_purpose<T: std::convert::Into<crate::model::Purpose>>(mut self, v: T) -> Self {
self.purpose = v.into();
self
}
pub fn set_purpose_data<T, K, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = (K, V)>,
K: std::convert::Into<std::string::String>,
V: std::convert::Into<std::string::String>,
{
use std::iter::Iterator;
self.purpose_data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
self
}
}
impl wkt::message::Message for TagKey {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.TagKey"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTagKeysRequest {
pub parent: 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 ListTagKeysRequest {
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
}
}
impl wkt::message::Message for ListTagKeysRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListTagKeysRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTagKeysResponse {
pub tag_keys: std::vec::Vec<crate::model::TagKey>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTagKeysResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_keys<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TagKey>,
{
use std::iter::Iterator;
self.tag_keys = 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 ListTagKeysResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListTagKeysResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTagKeysResponse {
type PageItem = crate::model::TagKey;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.tag_keys
}
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 GetTagKeyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTagKeyRequest {
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 GetTagKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.GetTagKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetNamespacedTagKeyRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetNamespacedTagKeyRequest {
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 GetNamespacedTagKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTagKeyRequest {
pub tag_key: std::option::Option<crate::model::TagKey>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTagKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TagKey>,
{
self.tag_key = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TagKey>,
{
self.tag_key = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateTagKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTagKeyMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTagKeyMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateTagKeyMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagKeyMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTagKeyRequest {
pub tag_key: std::option::Option<crate::model::TagKey>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTagKeyRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_key<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TagKey>,
{
self.tag_key = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TagKey>,
{
self.tag_key = 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
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateTagKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UpdateTagKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTagKeyMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTagKeyMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpdateTagKeyMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UpdateTagKeyMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTagKeyRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTagKeyRequest {
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_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteTagKeyRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagKeyRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTagKeyMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTagKeyMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteTagKeyMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagKeyMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct TagValue {
pub name: std::string::String,
pub parent: std::string::String,
pub short_name: std::string::String,
pub namespaced_name: std::string::String,
pub description: std::string::String,
pub create_time: std::option::Option<wkt::Timestamp>,
pub update_time: std::option::Option<wkt::Timestamp>,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl TagValue {
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_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.parent = v.into();
self
}
pub fn set_short_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.short_name = v.into();
self
}
pub fn set_namespaced_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.namespaced_name = 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_create_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.create_time = v.map(|x| x.into());
self
}
pub fn set_update_time<T>(mut self, v: T) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<wkt::Timestamp>,
{
self.update_time = v.map(|x| x.into());
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for TagValue {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.TagValue"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTagValuesRequest {
pub parent: 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 ListTagValuesRequest {
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
}
}
impl wkt::message::Message for ListTagValuesRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListTagValuesRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct ListTagValuesResponse {
pub tag_values: std::vec::Vec<crate::model::TagValue>,
pub next_page_token: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl ListTagValuesResponse {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_values<T, V>(mut self, v: T) -> Self
where
T: std::iter::IntoIterator<Item = V>,
V: std::convert::Into<crate::model::TagValue>,
{
use std::iter::Iterator;
self.tag_values = 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 ListTagValuesResponse {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.ListTagValuesResponse"
}
}
#[doc(hidden)]
impl google_cloud_gax::paginator::internal::PageableResponse for ListTagValuesResponse {
type PageItem = crate::model::TagValue;
fn items(self) -> std::vec::Vec<Self::PageItem> {
self.tag_values
}
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 GetTagValueRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetTagValueRequest {
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 GetTagValueRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.GetTagValueRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct GetNamespacedTagValueRequest {
pub name: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl GetNamespacedTagValueRequest {
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 GetNamespacedTagValueRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTagValueRequest {
pub tag_value: std::option::Option<crate::model::TagValue>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTagValueRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TagValue>,
{
self.tag_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TagValue>,
{
self.tag_value = v.map(|x| x.into());
self
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for CreateTagValueRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagValueRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct CreateTagValueMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl CreateTagValueMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for CreateTagValueMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagValueMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTagValueRequest {
pub tag_value: std::option::Option<crate::model::TagValue>,
pub update_mask: std::option::Option<wkt::FieldMask>,
pub validate_only: bool,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTagValueRequest {
pub fn new() -> Self {
std::default::Default::default()
}
pub fn set_tag_value<T>(mut self, v: T) -> Self
where
T: std::convert::Into<crate::model::TagValue>,
{
self.tag_value = std::option::Option::Some(v.into());
self
}
pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
where
T: std::convert::Into<crate::model::TagValue>,
{
self.tag_value = 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
}
pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
}
impl wkt::message::Message for UpdateTagValueRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UpdateTagValueRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct UpdateTagValueMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl UpdateTagValueMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for UpdateTagValueMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.UpdateTagValueMetadata"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTagValueRequest {
pub name: std::string::String,
pub validate_only: bool,
pub etag: std::string::String,
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTagValueRequest {
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_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
self.validate_only = v.into();
self
}
pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
self.etag = v.into();
self
}
}
impl wkt::message::Message for DeleteTagValueRequest {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagValueRequest"
}
}
#[derive(Clone, Default, PartialEq)]
#[non_exhaustive]
pub struct DeleteTagValueMetadata {
pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
}
impl DeleteTagValueMetadata {
pub fn new() -> Self {
std::default::Default::default()
}
}
impl wkt::message::Message for DeleteTagValueMetadata {
fn typename() -> &'static str {
"type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagValueMetadata"
}
}
#[derive(Clone, Debug, PartialEq)]
#[non_exhaustive]
pub enum Purpose {
Unspecified,
GceFirewall,
UnknownValue(purpose::UnknownValue),
}
#[doc(hidden)]
pub mod purpose {
#[allow(unused_imports)]
use super::*;
#[derive(Clone, Debug, PartialEq)]
pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
}
impl Purpose {
pub fn value(&self) -> std::option::Option<i32> {
match self {
Self::Unspecified => std::option::Option::Some(0),
Self::GceFirewall => std::option::Option::Some(1),
Self::UnknownValue(u) => u.0.value(),
}
}
pub fn name(&self) -> std::option::Option<&str> {
match self {
Self::Unspecified => std::option::Option::Some("PURPOSE_UNSPECIFIED"),
Self::GceFirewall => std::option::Option::Some("GCE_FIREWALL"),
Self::UnknownValue(u) => u.0.name(),
}
}
}
impl std::default::Default for Purpose {
fn default() -> Self {
use std::convert::From;
Self::from(0)
}
}
impl std::fmt::Display for Purpose {
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 Purpose {
fn from(value: i32) -> Self {
match value {
0 => Self::Unspecified,
1 => Self::GceFirewall,
_ => Self::UnknownValue(purpose::UnknownValue(
wkt::internal::UnknownEnumValue::Integer(value),
)),
}
}
}
impl std::convert::From<&str> for Purpose {
fn from(value: &str) -> Self {
use std::string::ToString;
match value {
"PURPOSE_UNSPECIFIED" => Self::Unspecified,
"GCE_FIREWALL" => Self::GceFirewall,
_ => Self::UnknownValue(purpose::UnknownValue(
wkt::internal::UnknownEnumValue::String(value.to_string()),
)),
}
}
}
impl serde::ser::Serialize for Purpose {
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::GceFirewall => serializer.serialize_i32(1),
Self::UnknownValue(u) => u.0.serialize(serializer),
}
}
}
impl<'de> serde::de::Deserialize<'de> for Purpose {
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
deserializer.deserialize_any(wkt::internal::EnumVisitor::<Purpose>::new(
".google.cloud.resourcemanager.v3.Purpose",
))
}
}