Skip to main content

google_cloud_resourcemanager_v3/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19#![no_implicit_prelude]
20extern crate async_trait;
21extern crate bytes;
22extern crate gaxi;
23extern crate google_cloud_gax;
24extern crate google_cloud_iam_v1;
25extern crate google_cloud_longrunning;
26extern crate google_cloud_lro;
27extern crate serde;
28extern crate serde_json;
29extern crate serde_with;
30extern crate std;
31extern crate tracing;
32extern crate wkt;
33
34mod debug;
35mod deserialize;
36mod serialize;
37
38/// A folder in an organization's resource hierarchy, used to
39/// organize that organization's resources.
40#[derive(Clone, Default, PartialEq)]
41#[non_exhaustive]
42pub struct Folder {
43    /// Output only. The resource name of the folder.
44    /// Its format is `folders/{folder_id}`, for example: "folders/1234".
45    pub name: std::string::String,
46
47    /// Required. The folder's parent's resource name.
48    /// Updates to the folder's parent must be performed using
49    /// [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder].
50    ///
51    /// [google.cloud.resourcemanager.v3.Folders.MoveFolder]: crate::client::Folders::move_folder
52    pub parent: std::string::String,
53
54    /// The folder's display name.
55    /// A folder's display name must be unique amongst its siblings. For example,
56    /// no two folders with the same parent can share the same display name.
57    /// The display name must start and end with a letter or digit, may contain
58    /// letters, digits, spaces, hyphens and underscores and can be no longer
59    /// than 30 characters. This is captured by the regular expression:
60    /// `[\p{L}\p{N}]([\p{L}\p{N}_- ]{0,28}[\p{L}\p{N}])?`.
61    pub display_name: std::string::String,
62
63    /// Output only. The lifecycle state of the folder.
64    /// Updates to the state must be performed using
65    /// [DeleteFolder][google.cloud.resourcemanager.v3.Folders.DeleteFolder] and
66    /// [UndeleteFolder][google.cloud.resourcemanager.v3.Folders.UndeleteFolder].
67    ///
68    /// [google.cloud.resourcemanager.v3.Folders.DeleteFolder]: crate::client::Folders::delete_folder
69    /// [google.cloud.resourcemanager.v3.Folders.UndeleteFolder]: crate::client::Folders::undelete_folder
70    pub state: crate::model::folder::State,
71
72    /// Output only. Timestamp when the folder was created.
73    pub create_time: std::option::Option<wkt::Timestamp>,
74
75    /// Output only. Timestamp when the folder was last modified.
76    pub update_time: std::option::Option<wkt::Timestamp>,
77
78    /// Output only. Timestamp when the folder was requested to be deleted.
79    pub delete_time: std::option::Option<wkt::Timestamp>,
80
81    /// Output only. A checksum computed by the server based on the current value
82    /// of the folder resource. This may be sent on update and delete requests to
83    /// ensure the client has an up-to-date value before proceeding.
84    pub etag: std::string::String,
85
86    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
87}
88
89impl Folder {
90    pub fn new() -> Self {
91        std::default::Default::default()
92    }
93
94    /// Sets the value of [name][crate::model::Folder::name].
95    ///
96    /// # Example
97    /// ```ignore,no_run
98    /// # use google_cloud_resourcemanager_v3::model::Folder;
99    /// let x = Folder::new().set_name("example");
100    /// ```
101    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
102        self.name = v.into();
103        self
104    }
105
106    /// Sets the value of [parent][crate::model::Folder::parent].
107    ///
108    /// # Example
109    /// ```ignore,no_run
110    /// # use google_cloud_resourcemanager_v3::model::Folder;
111    /// let x = Folder::new().set_parent("example");
112    /// ```
113    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
114        self.parent = v.into();
115        self
116    }
117
118    /// Sets the value of [display_name][crate::model::Folder::display_name].
119    ///
120    /// # Example
121    /// ```ignore,no_run
122    /// # use google_cloud_resourcemanager_v3::model::Folder;
123    /// let x = Folder::new().set_display_name("example");
124    /// ```
125    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
126        self.display_name = v.into();
127        self
128    }
129
130    /// Sets the value of [state][crate::model::Folder::state].
131    ///
132    /// # Example
133    /// ```ignore,no_run
134    /// # use google_cloud_resourcemanager_v3::model::Folder;
135    /// use google_cloud_resourcemanager_v3::model::folder::State;
136    /// let x0 = Folder::new().set_state(State::Active);
137    /// let x1 = Folder::new().set_state(State::DeleteRequested);
138    /// ```
139    pub fn set_state<T: std::convert::Into<crate::model::folder::State>>(mut self, v: T) -> Self {
140        self.state = v.into();
141        self
142    }
143
144    /// Sets the value of [create_time][crate::model::Folder::create_time].
145    ///
146    /// # Example
147    /// ```ignore,no_run
148    /// # use google_cloud_resourcemanager_v3::model::Folder;
149    /// use wkt::Timestamp;
150    /// let x = Folder::new().set_create_time(Timestamp::default()/* use setters */);
151    /// ```
152    pub fn set_create_time<T>(mut self, v: T) -> Self
153    where
154        T: std::convert::Into<wkt::Timestamp>,
155    {
156        self.create_time = std::option::Option::Some(v.into());
157        self
158    }
159
160    /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
161    ///
162    /// # Example
163    /// ```ignore,no_run
164    /// # use google_cloud_resourcemanager_v3::model::Folder;
165    /// use wkt::Timestamp;
166    /// let x = Folder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
167    /// let x = Folder::new().set_or_clear_create_time(None::<Timestamp>);
168    /// ```
169    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
170    where
171        T: std::convert::Into<wkt::Timestamp>,
172    {
173        self.create_time = v.map(|x| x.into());
174        self
175    }
176
177    /// Sets the value of [update_time][crate::model::Folder::update_time].
178    ///
179    /// # Example
180    /// ```ignore,no_run
181    /// # use google_cloud_resourcemanager_v3::model::Folder;
182    /// use wkt::Timestamp;
183    /// let x = Folder::new().set_update_time(Timestamp::default()/* use setters */);
184    /// ```
185    pub fn set_update_time<T>(mut self, v: T) -> Self
186    where
187        T: std::convert::Into<wkt::Timestamp>,
188    {
189        self.update_time = std::option::Option::Some(v.into());
190        self
191    }
192
193    /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
194    ///
195    /// # Example
196    /// ```ignore,no_run
197    /// # use google_cloud_resourcemanager_v3::model::Folder;
198    /// use wkt::Timestamp;
199    /// let x = Folder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
200    /// let x = Folder::new().set_or_clear_update_time(None::<Timestamp>);
201    /// ```
202    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
203    where
204        T: std::convert::Into<wkt::Timestamp>,
205    {
206        self.update_time = v.map(|x| x.into());
207        self
208    }
209
210    /// Sets the value of [delete_time][crate::model::Folder::delete_time].
211    ///
212    /// # Example
213    /// ```ignore,no_run
214    /// # use google_cloud_resourcemanager_v3::model::Folder;
215    /// use wkt::Timestamp;
216    /// let x = Folder::new().set_delete_time(Timestamp::default()/* use setters */);
217    /// ```
218    pub fn set_delete_time<T>(mut self, v: T) -> Self
219    where
220        T: std::convert::Into<wkt::Timestamp>,
221    {
222        self.delete_time = std::option::Option::Some(v.into());
223        self
224    }
225
226    /// Sets or clears the value of [delete_time][crate::model::Folder::delete_time].
227    ///
228    /// # Example
229    /// ```ignore,no_run
230    /// # use google_cloud_resourcemanager_v3::model::Folder;
231    /// use wkt::Timestamp;
232    /// let x = Folder::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
233    /// let x = Folder::new().set_or_clear_delete_time(None::<Timestamp>);
234    /// ```
235    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
236    where
237        T: std::convert::Into<wkt::Timestamp>,
238    {
239        self.delete_time = v.map(|x| x.into());
240        self
241    }
242
243    /// Sets the value of [etag][crate::model::Folder::etag].
244    ///
245    /// # Example
246    /// ```ignore,no_run
247    /// # use google_cloud_resourcemanager_v3::model::Folder;
248    /// let x = Folder::new().set_etag("example");
249    /// ```
250    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
251        self.etag = v.into();
252        self
253    }
254}
255
256impl wkt::message::Message for Folder {
257    fn typename() -> &'static str {
258        "type.googleapis.com/google.cloud.resourcemanager.v3.Folder"
259    }
260}
261
262/// Defines additional types related to [Folder].
263pub mod folder {
264    #[allow(unused_imports)]
265    use super::*;
266
267    /// Folder lifecycle states.
268    ///
269    /// # Working with unknown values
270    ///
271    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
272    /// additional enum variants at any time. Adding new variants is not considered
273    /// a breaking change. Applications should write their code in anticipation of:
274    ///
275    /// - New values appearing in future releases of the client library, **and**
276    /// - New values received dynamically, without application changes.
277    ///
278    /// Please consult the [Working with enums] section in the user guide for some
279    /// guidelines.
280    ///
281    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
282    #[derive(Clone, Debug, PartialEq)]
283    #[non_exhaustive]
284    pub enum State {
285        /// Unspecified state.
286        Unspecified,
287        /// The normal and active state.
288        Active,
289        /// The folder has been marked for deletion by the user.
290        DeleteRequested,
291        /// If set, the enum was initialized with an unknown value.
292        ///
293        /// Applications can examine the value using [State::value] or
294        /// [State::name].
295        UnknownValue(state::UnknownValue),
296    }
297
298    #[doc(hidden)]
299    pub mod state {
300        #[allow(unused_imports)]
301        use super::*;
302        #[derive(Clone, Debug, PartialEq)]
303        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
304    }
305
306    impl State {
307        /// Gets the enum value.
308        ///
309        /// Returns `None` if the enum contains an unknown value deserialized from
310        /// the string representation of enums.
311        pub fn value(&self) -> std::option::Option<i32> {
312            match self {
313                Self::Unspecified => std::option::Option::Some(0),
314                Self::Active => std::option::Option::Some(1),
315                Self::DeleteRequested => std::option::Option::Some(2),
316                Self::UnknownValue(u) => u.0.value(),
317            }
318        }
319
320        /// Gets the enum value as a string.
321        ///
322        /// Returns `None` if the enum contains an unknown value deserialized from
323        /// the integer representation of enums.
324        pub fn name(&self) -> std::option::Option<&str> {
325            match self {
326                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
327                Self::Active => std::option::Option::Some("ACTIVE"),
328                Self::DeleteRequested => std::option::Option::Some("DELETE_REQUESTED"),
329                Self::UnknownValue(u) => u.0.name(),
330            }
331        }
332    }
333
334    impl std::default::Default for State {
335        fn default() -> Self {
336            use std::convert::From;
337            Self::from(0)
338        }
339    }
340
341    impl std::fmt::Display for State {
342        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
343            wkt::internal::display_enum(f, self.name(), self.value())
344        }
345    }
346
347    impl std::convert::From<i32> for State {
348        fn from(value: i32) -> Self {
349            match value {
350                0 => Self::Unspecified,
351                1 => Self::Active,
352                2 => Self::DeleteRequested,
353                _ => Self::UnknownValue(state::UnknownValue(
354                    wkt::internal::UnknownEnumValue::Integer(value),
355                )),
356            }
357        }
358    }
359
360    impl std::convert::From<&str> for State {
361        fn from(value: &str) -> Self {
362            use std::string::ToString;
363            match value {
364                "STATE_UNSPECIFIED" => Self::Unspecified,
365                "ACTIVE" => Self::Active,
366                "DELETE_REQUESTED" => Self::DeleteRequested,
367                _ => Self::UnknownValue(state::UnknownValue(
368                    wkt::internal::UnknownEnumValue::String(value.to_string()),
369                )),
370            }
371        }
372    }
373
374    impl serde::ser::Serialize for State {
375        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
376        where
377            S: serde::Serializer,
378        {
379            match self {
380                Self::Unspecified => serializer.serialize_i32(0),
381                Self::Active => serializer.serialize_i32(1),
382                Self::DeleteRequested => serializer.serialize_i32(2),
383                Self::UnknownValue(u) => u.0.serialize(serializer),
384            }
385        }
386    }
387
388    impl<'de> serde::de::Deserialize<'de> for State {
389        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
390        where
391            D: serde::Deserializer<'de>,
392        {
393            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
394                ".google.cloud.resourcemanager.v3.Folder.State",
395            ))
396        }
397    }
398}
399
400/// The GetFolder request message.
401#[derive(Clone, Default, PartialEq)]
402#[non_exhaustive]
403pub struct GetFolderRequest {
404    /// Required. The resource name of the folder to retrieve.
405    /// Must be of the form `folders/{folder_id}`.
406    pub name: std::string::String,
407
408    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
409}
410
411impl GetFolderRequest {
412    pub fn new() -> Self {
413        std::default::Default::default()
414    }
415
416    /// Sets the value of [name][crate::model::GetFolderRequest::name].
417    ///
418    /// # Example
419    /// ```ignore,no_run
420    /// # use google_cloud_resourcemanager_v3::model::GetFolderRequest;
421    /// let x = GetFolderRequest::new().set_name("example");
422    /// ```
423    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
424        self.name = v.into();
425        self
426    }
427}
428
429impl wkt::message::Message for GetFolderRequest {
430    fn typename() -> &'static str {
431        "type.googleapis.com/google.cloud.resourcemanager.v3.GetFolderRequest"
432    }
433}
434
435/// The ListFolders request message.
436#[derive(Clone, Default, PartialEq)]
437#[non_exhaustive]
438pub struct ListFoldersRequest {
439    /// Required. The name of the parent resource whose folders are being listed.
440    /// Only children of this parent resource are listed; descendants are not
441    /// listed.
442    ///
443    /// If the parent is a folder, use the value `folders/{folder_id}`. If the
444    /// parent is an organization, use the value `organizations/{org_id}`.
445    ///
446    /// Access to this method is controlled by checking the
447    /// `resourcemanager.folders.list` permission on the `parent`.
448    pub parent: std::string::String,
449
450    /// Optional. The maximum number of folders to return in the response. The
451    /// server can return fewer folders than requested. If unspecified, server
452    /// picks an appropriate default.
453    pub page_size: i32,
454
455    /// Optional. A pagination token returned from a previous call to `ListFolders`
456    /// that indicates where this listing should continue from.
457    pub page_token: std::string::String,
458
459    /// Optional. Controls whether folders in the
460    /// [DELETE_REQUESTED][google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED]
461    /// state should be returned. Defaults to false.
462    ///
463    /// [google.cloud.resourcemanager.v3.Folder.State.DELETE_REQUESTED]: crate::model::folder::State::DeleteRequested
464    pub show_deleted: bool,
465
466    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
467}
468
469impl ListFoldersRequest {
470    pub fn new() -> Self {
471        std::default::Default::default()
472    }
473
474    /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
475    ///
476    /// # Example
477    /// ```ignore,no_run
478    /// # use google_cloud_resourcemanager_v3::model::ListFoldersRequest;
479    /// let x = ListFoldersRequest::new().set_parent("example");
480    /// ```
481    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
482        self.parent = v.into();
483        self
484    }
485
486    /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
487    ///
488    /// # Example
489    /// ```ignore,no_run
490    /// # use google_cloud_resourcemanager_v3::model::ListFoldersRequest;
491    /// let x = ListFoldersRequest::new().set_page_size(42);
492    /// ```
493    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
494        self.page_size = v.into();
495        self
496    }
497
498    /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
499    ///
500    /// # Example
501    /// ```ignore,no_run
502    /// # use google_cloud_resourcemanager_v3::model::ListFoldersRequest;
503    /// let x = ListFoldersRequest::new().set_page_token("example");
504    /// ```
505    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
506        self.page_token = v.into();
507        self
508    }
509
510    /// Sets the value of [show_deleted][crate::model::ListFoldersRequest::show_deleted].
511    ///
512    /// # Example
513    /// ```ignore,no_run
514    /// # use google_cloud_resourcemanager_v3::model::ListFoldersRequest;
515    /// let x = ListFoldersRequest::new().set_show_deleted(true);
516    /// ```
517    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
518        self.show_deleted = v.into();
519        self
520    }
521}
522
523impl wkt::message::Message for ListFoldersRequest {
524    fn typename() -> &'static str {
525        "type.googleapis.com/google.cloud.resourcemanager.v3.ListFoldersRequest"
526    }
527}
528
529/// The ListFolders response message.
530#[derive(Clone, Default, PartialEq)]
531#[non_exhaustive]
532pub struct ListFoldersResponse {
533    /// A possibly paginated list of folders that are direct descendants of
534    /// the specified parent resource.
535    pub folders: std::vec::Vec<crate::model::Folder>,
536
537    /// A pagination token returned from a previous call to `ListFolders`
538    /// that indicates from where listing should continue.
539    pub next_page_token: std::string::String,
540
541    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
542}
543
544impl ListFoldersResponse {
545    pub fn new() -> Self {
546        std::default::Default::default()
547    }
548
549    /// Sets the value of [folders][crate::model::ListFoldersResponse::folders].
550    ///
551    /// # Example
552    /// ```ignore,no_run
553    /// # use google_cloud_resourcemanager_v3::model::ListFoldersResponse;
554    /// use google_cloud_resourcemanager_v3::model::Folder;
555    /// let x = ListFoldersResponse::new()
556    ///     .set_folders([
557    ///         Folder::default()/* use setters */,
558    ///         Folder::default()/* use (different) setters */,
559    ///     ]);
560    /// ```
561    pub fn set_folders<T, V>(mut self, v: T) -> Self
562    where
563        T: std::iter::IntoIterator<Item = V>,
564        V: std::convert::Into<crate::model::Folder>,
565    {
566        use std::iter::Iterator;
567        self.folders = v.into_iter().map(|i| i.into()).collect();
568        self
569    }
570
571    /// Sets the value of [next_page_token][crate::model::ListFoldersResponse::next_page_token].
572    ///
573    /// # Example
574    /// ```ignore,no_run
575    /// # use google_cloud_resourcemanager_v3::model::ListFoldersResponse;
576    /// let x = ListFoldersResponse::new().set_next_page_token("example");
577    /// ```
578    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
579        self.next_page_token = v.into();
580        self
581    }
582}
583
584impl wkt::message::Message for ListFoldersResponse {
585    fn typename() -> &'static str {
586        "type.googleapis.com/google.cloud.resourcemanager.v3.ListFoldersResponse"
587    }
588}
589
590#[doc(hidden)]
591impl google_cloud_gax::paginator::internal::PageableResponse for ListFoldersResponse {
592    type PageItem = crate::model::Folder;
593
594    fn items(self) -> std::vec::Vec<Self::PageItem> {
595        self.folders
596    }
597
598    fn next_page_token(&self) -> std::string::String {
599        use std::clone::Clone;
600        self.next_page_token.clone()
601    }
602}
603
604/// The request message for searching folders.
605#[derive(Clone, Default, PartialEq)]
606#[non_exhaustive]
607pub struct SearchFoldersRequest {
608    /// Optional. The maximum number of folders to return in the response. The
609    /// server can return fewer folders than requested. If unspecified, server
610    /// picks an appropriate default.
611    pub page_size: i32,
612
613    /// Optional. A pagination token returned from a previous call to
614    /// `SearchFolders` that indicates from where search should continue.
615    pub page_token: std::string::String,
616
617    /// Optional. Search criteria used to select the folders to return.
618    /// If no search criteria is specified then all accessible folders will be
619    /// returned.
620    ///
621    /// Query expressions can be used to restrict results based upon displayName,
622    /// state and parent, where the operators `=` (`:`) `NOT`, `AND` and `OR`
623    /// can be used along with the suffix wildcard symbol `*`.
624    ///
625    /// The `displayName` field in a query expression should use escaped quotes
626    /// for values that include whitespace to prevent unexpected behavior.
627    ///
628    /// ```norust
629    /// | Field                   | Description                            |
630    /// |-------------------------|----------------------------------------|
631    /// | displayName             | Filters by displayName.                |
632    /// | parent                  | Filters by parent (for example: folders/123). |
633    /// | state, lifecycleState   | Filters by state.                      |
634    /// ```
635    ///
636    /// Some example queries are:
637    ///
638    /// * Query `displayName=Test*` returns Folder resources whose display name
639    ///   starts with "Test".
640    /// * Query `state=ACTIVE` returns Folder resources with
641    ///   `state` set to `ACTIVE`.
642    /// * Query `parent=folders/123` returns Folder resources that have
643    ///   `folders/123` as a parent resource.
644    /// * Query `parent=folders/123 AND state=ACTIVE` returns active
645    ///   Folder resources that have `folders/123` as a parent resource.
646    /// * Query `displayName=\\"Test String\\"` returns Folder resources with
647    ///   display names that include both "Test" and "String".
648    pub query: std::string::String,
649
650    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
651}
652
653impl SearchFoldersRequest {
654    pub fn new() -> Self {
655        std::default::Default::default()
656    }
657
658    /// Sets the value of [page_size][crate::model::SearchFoldersRequest::page_size].
659    ///
660    /// # Example
661    /// ```ignore,no_run
662    /// # use google_cloud_resourcemanager_v3::model::SearchFoldersRequest;
663    /// let x = SearchFoldersRequest::new().set_page_size(42);
664    /// ```
665    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
666        self.page_size = v.into();
667        self
668    }
669
670    /// Sets the value of [page_token][crate::model::SearchFoldersRequest::page_token].
671    ///
672    /// # Example
673    /// ```ignore,no_run
674    /// # use google_cloud_resourcemanager_v3::model::SearchFoldersRequest;
675    /// let x = SearchFoldersRequest::new().set_page_token("example");
676    /// ```
677    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
678        self.page_token = v.into();
679        self
680    }
681
682    /// Sets the value of [query][crate::model::SearchFoldersRequest::query].
683    ///
684    /// # Example
685    /// ```ignore,no_run
686    /// # use google_cloud_resourcemanager_v3::model::SearchFoldersRequest;
687    /// let x = SearchFoldersRequest::new().set_query("example");
688    /// ```
689    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
690        self.query = v.into();
691        self
692    }
693}
694
695impl wkt::message::Message for SearchFoldersRequest {
696    fn typename() -> &'static str {
697        "type.googleapis.com/google.cloud.resourcemanager.v3.SearchFoldersRequest"
698    }
699}
700
701/// The response message for searching folders.
702#[derive(Clone, Default, PartialEq)]
703#[non_exhaustive]
704pub struct SearchFoldersResponse {
705    /// A possibly paginated folder search results.
706    /// the specified parent resource.
707    pub folders: std::vec::Vec<crate::model::Folder>,
708
709    /// A pagination token returned from a previous call to `SearchFolders`
710    /// that indicates from where searching should continue.
711    pub next_page_token: std::string::String,
712
713    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
714}
715
716impl SearchFoldersResponse {
717    pub fn new() -> Self {
718        std::default::Default::default()
719    }
720
721    /// Sets the value of [folders][crate::model::SearchFoldersResponse::folders].
722    ///
723    /// # Example
724    /// ```ignore,no_run
725    /// # use google_cloud_resourcemanager_v3::model::SearchFoldersResponse;
726    /// use google_cloud_resourcemanager_v3::model::Folder;
727    /// let x = SearchFoldersResponse::new()
728    ///     .set_folders([
729    ///         Folder::default()/* use setters */,
730    ///         Folder::default()/* use (different) setters */,
731    ///     ]);
732    /// ```
733    pub fn set_folders<T, V>(mut self, v: T) -> Self
734    where
735        T: std::iter::IntoIterator<Item = V>,
736        V: std::convert::Into<crate::model::Folder>,
737    {
738        use std::iter::Iterator;
739        self.folders = v.into_iter().map(|i| i.into()).collect();
740        self
741    }
742
743    /// Sets the value of [next_page_token][crate::model::SearchFoldersResponse::next_page_token].
744    ///
745    /// # Example
746    /// ```ignore,no_run
747    /// # use google_cloud_resourcemanager_v3::model::SearchFoldersResponse;
748    /// let x = SearchFoldersResponse::new().set_next_page_token("example");
749    /// ```
750    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
751        self.next_page_token = v.into();
752        self
753    }
754}
755
756impl wkt::message::Message for SearchFoldersResponse {
757    fn typename() -> &'static str {
758        "type.googleapis.com/google.cloud.resourcemanager.v3.SearchFoldersResponse"
759    }
760}
761
762#[doc(hidden)]
763impl google_cloud_gax::paginator::internal::PageableResponse for SearchFoldersResponse {
764    type PageItem = crate::model::Folder;
765
766    fn items(self) -> std::vec::Vec<Self::PageItem> {
767        self.folders
768    }
769
770    fn next_page_token(&self) -> std::string::String {
771        use std::clone::Clone;
772        self.next_page_token.clone()
773    }
774}
775
776/// The CreateFolder request message.
777#[derive(Clone, Default, PartialEq)]
778#[non_exhaustive]
779pub struct CreateFolderRequest {
780    /// Required. The folder being created, only the display name and parent will
781    /// be consulted. All other fields will be ignored.
782    pub folder: std::option::Option<crate::model::Folder>,
783
784    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
785}
786
787impl CreateFolderRequest {
788    pub fn new() -> Self {
789        std::default::Default::default()
790    }
791
792    /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
793    ///
794    /// # Example
795    /// ```ignore,no_run
796    /// # use google_cloud_resourcemanager_v3::model::CreateFolderRequest;
797    /// use google_cloud_resourcemanager_v3::model::Folder;
798    /// let x = CreateFolderRequest::new().set_folder(Folder::default()/* use setters */);
799    /// ```
800    pub fn set_folder<T>(mut self, v: T) -> Self
801    where
802        T: std::convert::Into<crate::model::Folder>,
803    {
804        self.folder = std::option::Option::Some(v.into());
805        self
806    }
807
808    /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
809    ///
810    /// # Example
811    /// ```ignore,no_run
812    /// # use google_cloud_resourcemanager_v3::model::CreateFolderRequest;
813    /// use google_cloud_resourcemanager_v3::model::Folder;
814    /// let x = CreateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
815    /// let x = CreateFolderRequest::new().set_or_clear_folder(None::<Folder>);
816    /// ```
817    pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
818    where
819        T: std::convert::Into<crate::model::Folder>,
820    {
821        self.folder = v.map(|x| x.into());
822        self
823    }
824}
825
826impl wkt::message::Message for CreateFolderRequest {
827    fn typename() -> &'static str {
828        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateFolderRequest"
829    }
830}
831
832/// Metadata pertaining to the Folder creation process.
833#[derive(Clone, Default, PartialEq)]
834#[non_exhaustive]
835pub struct CreateFolderMetadata {
836    /// The display name of the folder.
837    pub display_name: std::string::String,
838
839    /// The resource name of the folder or organization we are creating the folder
840    /// under.
841    pub parent: std::string::String,
842
843    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
844}
845
846impl CreateFolderMetadata {
847    pub fn new() -> Self {
848        std::default::Default::default()
849    }
850
851    /// Sets the value of [display_name][crate::model::CreateFolderMetadata::display_name].
852    ///
853    /// # Example
854    /// ```ignore,no_run
855    /// # use google_cloud_resourcemanager_v3::model::CreateFolderMetadata;
856    /// let x = CreateFolderMetadata::new().set_display_name("example");
857    /// ```
858    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
859        self.display_name = v.into();
860        self
861    }
862
863    /// Sets the value of [parent][crate::model::CreateFolderMetadata::parent].
864    ///
865    /// # Example
866    /// ```ignore,no_run
867    /// # use google_cloud_resourcemanager_v3::model::CreateFolderMetadata;
868    /// let x = CreateFolderMetadata::new().set_parent("example");
869    /// ```
870    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
871        self.parent = v.into();
872        self
873    }
874}
875
876impl wkt::message::Message for CreateFolderMetadata {
877    fn typename() -> &'static str {
878        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateFolderMetadata"
879    }
880}
881
882/// The request sent to the
883/// [UpdateFolder][google.cloud.resourcemanager.v3.Folder.UpdateFolder]
884/// method.
885///
886/// Only the `display_name` field can be changed. All other fields will be
887/// ignored. Use the
888/// [MoveFolder][google.cloud.resourcemanager.v3.Folders.MoveFolder] method to
889/// change the `parent` field.
890///
891/// [google.cloud.resourcemanager.v3.Folders.MoveFolder]: crate::client::Folders::move_folder
892#[derive(Clone, Default, PartialEq)]
893#[non_exhaustive]
894pub struct UpdateFolderRequest {
895    /// Required. The new definition of the Folder. It must include the `name`
896    /// field, which cannot be changed.
897    pub folder: std::option::Option<crate::model::Folder>,
898
899    /// Required. Fields to be updated.
900    /// Only the `display_name` can be updated.
901    pub update_mask: std::option::Option<wkt::FieldMask>,
902
903    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
904}
905
906impl UpdateFolderRequest {
907    pub fn new() -> Self {
908        std::default::Default::default()
909    }
910
911    /// Sets the value of [folder][crate::model::UpdateFolderRequest::folder].
912    ///
913    /// # Example
914    /// ```ignore,no_run
915    /// # use google_cloud_resourcemanager_v3::model::UpdateFolderRequest;
916    /// use google_cloud_resourcemanager_v3::model::Folder;
917    /// let x = UpdateFolderRequest::new().set_folder(Folder::default()/* use setters */);
918    /// ```
919    pub fn set_folder<T>(mut self, v: T) -> Self
920    where
921        T: std::convert::Into<crate::model::Folder>,
922    {
923        self.folder = std::option::Option::Some(v.into());
924        self
925    }
926
927    /// Sets or clears the value of [folder][crate::model::UpdateFolderRequest::folder].
928    ///
929    /// # Example
930    /// ```ignore,no_run
931    /// # use google_cloud_resourcemanager_v3::model::UpdateFolderRequest;
932    /// use google_cloud_resourcemanager_v3::model::Folder;
933    /// let x = UpdateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
934    /// let x = UpdateFolderRequest::new().set_or_clear_folder(None::<Folder>);
935    /// ```
936    pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
937    where
938        T: std::convert::Into<crate::model::Folder>,
939    {
940        self.folder = v.map(|x| x.into());
941        self
942    }
943
944    /// Sets the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
945    ///
946    /// # Example
947    /// ```ignore,no_run
948    /// # use google_cloud_resourcemanager_v3::model::UpdateFolderRequest;
949    /// use wkt::FieldMask;
950    /// let x = UpdateFolderRequest::new().set_update_mask(FieldMask::default()/* use setters */);
951    /// ```
952    pub fn set_update_mask<T>(mut self, v: T) -> Self
953    where
954        T: std::convert::Into<wkt::FieldMask>,
955    {
956        self.update_mask = std::option::Option::Some(v.into());
957        self
958    }
959
960    /// Sets or clears the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
961    ///
962    /// # Example
963    /// ```ignore,no_run
964    /// # use google_cloud_resourcemanager_v3::model::UpdateFolderRequest;
965    /// use wkt::FieldMask;
966    /// let x = UpdateFolderRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
967    /// let x = UpdateFolderRequest::new().set_or_clear_update_mask(None::<FieldMask>);
968    /// ```
969    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
970    where
971        T: std::convert::Into<wkt::FieldMask>,
972    {
973        self.update_mask = v.map(|x| x.into());
974        self
975    }
976}
977
978impl wkt::message::Message for UpdateFolderRequest {
979    fn typename() -> &'static str {
980        "type.googleapis.com/google.cloud.resourcemanager.v3.UpdateFolderRequest"
981    }
982}
983
984/// A status object which is used as the `metadata` field for the Operation
985/// returned by UpdateFolder.
986#[derive(Clone, Default, PartialEq)]
987#[non_exhaustive]
988pub struct UpdateFolderMetadata {
989    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
990}
991
992impl UpdateFolderMetadata {
993    pub fn new() -> Self {
994        std::default::Default::default()
995    }
996}
997
998impl wkt::message::Message for UpdateFolderMetadata {
999    fn typename() -> &'static str {
1000        "type.googleapis.com/google.cloud.resourcemanager.v3.UpdateFolderMetadata"
1001    }
1002}
1003
1004/// The MoveFolder request message.
1005#[derive(Clone, Default, PartialEq)]
1006#[non_exhaustive]
1007pub struct MoveFolderRequest {
1008    /// Required. The resource name of the Folder to move.
1009    /// Must be of the form folders/{folder_id}
1010    pub name: std::string::String,
1011
1012    /// Required. The resource name of the folder or organization which should be
1013    /// the folder's new parent. Must be of the form `folders/{folder_id}` or
1014    /// `organizations/{org_id}`.
1015    pub destination_parent: std::string::String,
1016
1017    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1018}
1019
1020impl MoveFolderRequest {
1021    pub fn new() -> Self {
1022        std::default::Default::default()
1023    }
1024
1025    /// Sets the value of [name][crate::model::MoveFolderRequest::name].
1026    ///
1027    /// # Example
1028    /// ```ignore,no_run
1029    /// # use google_cloud_resourcemanager_v3::model::MoveFolderRequest;
1030    /// let x = MoveFolderRequest::new().set_name("example");
1031    /// ```
1032    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1033        self.name = v.into();
1034        self
1035    }
1036
1037    /// Sets the value of [destination_parent][crate::model::MoveFolderRequest::destination_parent].
1038    ///
1039    /// # Example
1040    /// ```ignore,no_run
1041    /// # use google_cloud_resourcemanager_v3::model::MoveFolderRequest;
1042    /// let x = MoveFolderRequest::new().set_destination_parent("example");
1043    /// ```
1044    pub fn set_destination_parent<T: std::convert::Into<std::string::String>>(
1045        mut self,
1046        v: T,
1047    ) -> Self {
1048        self.destination_parent = v.into();
1049        self
1050    }
1051}
1052
1053impl wkt::message::Message for MoveFolderRequest {
1054    fn typename() -> &'static str {
1055        "type.googleapis.com/google.cloud.resourcemanager.v3.MoveFolderRequest"
1056    }
1057}
1058
1059/// Metadata pertaining to the folder move process.
1060#[derive(Clone, Default, PartialEq)]
1061#[non_exhaustive]
1062pub struct MoveFolderMetadata {
1063    /// The display name of the folder.
1064    pub display_name: std::string::String,
1065
1066    /// The resource name of the folder's parent.
1067    pub source_parent: std::string::String,
1068
1069    /// The resource name of the folder or organization to move the folder to.
1070    pub destination_parent: std::string::String,
1071
1072    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1073}
1074
1075impl MoveFolderMetadata {
1076    pub fn new() -> Self {
1077        std::default::Default::default()
1078    }
1079
1080    /// Sets the value of [display_name][crate::model::MoveFolderMetadata::display_name].
1081    ///
1082    /// # Example
1083    /// ```ignore,no_run
1084    /// # use google_cloud_resourcemanager_v3::model::MoveFolderMetadata;
1085    /// let x = MoveFolderMetadata::new().set_display_name("example");
1086    /// ```
1087    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1088        self.display_name = v.into();
1089        self
1090    }
1091
1092    /// Sets the value of [source_parent][crate::model::MoveFolderMetadata::source_parent].
1093    ///
1094    /// # Example
1095    /// ```ignore,no_run
1096    /// # use google_cloud_resourcemanager_v3::model::MoveFolderMetadata;
1097    /// let x = MoveFolderMetadata::new().set_source_parent("example");
1098    /// ```
1099    pub fn set_source_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1100        self.source_parent = v.into();
1101        self
1102    }
1103
1104    /// Sets the value of [destination_parent][crate::model::MoveFolderMetadata::destination_parent].
1105    ///
1106    /// # Example
1107    /// ```ignore,no_run
1108    /// # use google_cloud_resourcemanager_v3::model::MoveFolderMetadata;
1109    /// let x = MoveFolderMetadata::new().set_destination_parent("example");
1110    /// ```
1111    pub fn set_destination_parent<T: std::convert::Into<std::string::String>>(
1112        mut self,
1113        v: T,
1114    ) -> Self {
1115        self.destination_parent = v.into();
1116        self
1117    }
1118}
1119
1120impl wkt::message::Message for MoveFolderMetadata {
1121    fn typename() -> &'static str {
1122        "type.googleapis.com/google.cloud.resourcemanager.v3.MoveFolderMetadata"
1123    }
1124}
1125
1126/// The DeleteFolder request message.
1127#[derive(Clone, Default, PartialEq)]
1128#[non_exhaustive]
1129pub struct DeleteFolderRequest {
1130    /// Required. The resource name of the folder to be deleted.
1131    /// Must be of the form `folders/{folder_id}`.
1132    pub name: std::string::String,
1133
1134    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1135}
1136
1137impl DeleteFolderRequest {
1138    pub fn new() -> Self {
1139        std::default::Default::default()
1140    }
1141
1142    /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
1143    ///
1144    /// # Example
1145    /// ```ignore,no_run
1146    /// # use google_cloud_resourcemanager_v3::model::DeleteFolderRequest;
1147    /// let x = DeleteFolderRequest::new().set_name("example");
1148    /// ```
1149    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1150        self.name = v.into();
1151        self
1152    }
1153}
1154
1155impl wkt::message::Message for DeleteFolderRequest {
1156    fn typename() -> &'static str {
1157        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteFolderRequest"
1158    }
1159}
1160
1161/// A status object which is used as the `metadata` field for the `Operation`
1162/// returned by `DeleteFolder`.
1163#[derive(Clone, Default, PartialEq)]
1164#[non_exhaustive]
1165pub struct DeleteFolderMetadata {
1166    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1167}
1168
1169impl DeleteFolderMetadata {
1170    pub fn new() -> Self {
1171        std::default::Default::default()
1172    }
1173}
1174
1175impl wkt::message::Message for DeleteFolderMetadata {
1176    fn typename() -> &'static str {
1177        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteFolderMetadata"
1178    }
1179}
1180
1181/// The UndeleteFolder request message.
1182#[derive(Clone, Default, PartialEq)]
1183#[non_exhaustive]
1184pub struct UndeleteFolderRequest {
1185    /// Required. The resource name of the folder to undelete.
1186    /// Must be of the form `folders/{folder_id}`.
1187    pub name: std::string::String,
1188
1189    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1190}
1191
1192impl UndeleteFolderRequest {
1193    pub fn new() -> Self {
1194        std::default::Default::default()
1195    }
1196
1197    /// Sets the value of [name][crate::model::UndeleteFolderRequest::name].
1198    ///
1199    /// # Example
1200    /// ```ignore,no_run
1201    /// # use google_cloud_resourcemanager_v3::model::UndeleteFolderRequest;
1202    /// let x = UndeleteFolderRequest::new().set_name("example");
1203    /// ```
1204    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1205        self.name = v.into();
1206        self
1207    }
1208}
1209
1210impl wkt::message::Message for UndeleteFolderRequest {
1211    fn typename() -> &'static str {
1212        "type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteFolderRequest"
1213    }
1214}
1215
1216/// A status object which is used as the `metadata` field for the `Operation`
1217/// returned by `UndeleteFolder`.
1218#[derive(Clone, Default, PartialEq)]
1219#[non_exhaustive]
1220pub struct UndeleteFolderMetadata {
1221    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1222}
1223
1224impl UndeleteFolderMetadata {
1225    pub fn new() -> Self {
1226        std::default::Default::default()
1227    }
1228}
1229
1230impl wkt::message::Message for UndeleteFolderMetadata {
1231    fn typename() -> &'static str {
1232        "type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteFolderMetadata"
1233    }
1234}
1235
1236/// The root node in the resource hierarchy to which a particular entity's
1237/// (a company, for example) resources belong.
1238#[derive(Clone, Default, PartialEq)]
1239#[non_exhaustive]
1240pub struct Organization {
1241    /// Output only. The resource name of the organization. This is the
1242    /// organization's relative path in the API. Its format is
1243    /// "organizations/[organization_id]". For example, "organizations/1234".
1244    pub name: std::string::String,
1245
1246    /// Output only. A human-readable string that refers to the organization in the
1247    /// Google Cloud Console. This string is set by the server and cannot be
1248    /// changed. The string will be set to the primary domain (for example,
1249    /// "google.com") of the Google Workspace customer that owns the organization.
1250    pub display_name: std::string::String,
1251
1252    /// Output only. The organization's current lifecycle state.
1253    pub state: crate::model::organization::State,
1254
1255    /// Output only. Timestamp when the Organization was created.
1256    pub create_time: std::option::Option<wkt::Timestamp>,
1257
1258    /// Output only. Timestamp when the Organization was last modified.
1259    pub update_time: std::option::Option<wkt::Timestamp>,
1260
1261    /// Output only. Timestamp when the Organization was requested for deletion.
1262    pub delete_time: std::option::Option<wkt::Timestamp>,
1263
1264    /// Output only. A checksum computed by the server based on the current value
1265    /// of the Organization resource. This may be sent on update and delete
1266    /// requests to ensure the client has an up-to-date value before proceeding.
1267    pub etag: std::string::String,
1268
1269    /// The owner of this organization. The owner should be specified on
1270    /// creation. Once set, it cannot be changed.
1271    ///
1272    /// The lifetime of the organization and all of its descendants are bound to
1273    /// the owner. If the owner is deleted, the organization and all its
1274    /// descendants will be deleted.
1275    pub owner: std::option::Option<crate::model::organization::Owner>,
1276
1277    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1278}
1279
1280impl Organization {
1281    pub fn new() -> Self {
1282        std::default::Default::default()
1283    }
1284
1285    /// Sets the value of [name][crate::model::Organization::name].
1286    ///
1287    /// # Example
1288    /// ```ignore,no_run
1289    /// # use google_cloud_resourcemanager_v3::model::Organization;
1290    /// let x = Organization::new().set_name("example");
1291    /// ```
1292    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1293        self.name = v.into();
1294        self
1295    }
1296
1297    /// Sets the value of [display_name][crate::model::Organization::display_name].
1298    ///
1299    /// # Example
1300    /// ```ignore,no_run
1301    /// # use google_cloud_resourcemanager_v3::model::Organization;
1302    /// let x = Organization::new().set_display_name("example");
1303    /// ```
1304    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1305        self.display_name = v.into();
1306        self
1307    }
1308
1309    /// Sets the value of [state][crate::model::Organization::state].
1310    ///
1311    /// # Example
1312    /// ```ignore,no_run
1313    /// # use google_cloud_resourcemanager_v3::model::Organization;
1314    /// use google_cloud_resourcemanager_v3::model::organization::State;
1315    /// let x0 = Organization::new().set_state(State::Active);
1316    /// let x1 = Organization::new().set_state(State::DeleteRequested);
1317    /// ```
1318    pub fn set_state<T: std::convert::Into<crate::model::organization::State>>(
1319        mut self,
1320        v: T,
1321    ) -> Self {
1322        self.state = v.into();
1323        self
1324    }
1325
1326    /// Sets the value of [create_time][crate::model::Organization::create_time].
1327    ///
1328    /// # Example
1329    /// ```ignore,no_run
1330    /// # use google_cloud_resourcemanager_v3::model::Organization;
1331    /// use wkt::Timestamp;
1332    /// let x = Organization::new().set_create_time(Timestamp::default()/* use setters */);
1333    /// ```
1334    pub fn set_create_time<T>(mut self, v: T) -> Self
1335    where
1336        T: std::convert::Into<wkt::Timestamp>,
1337    {
1338        self.create_time = std::option::Option::Some(v.into());
1339        self
1340    }
1341
1342    /// Sets or clears the value of [create_time][crate::model::Organization::create_time].
1343    ///
1344    /// # Example
1345    /// ```ignore,no_run
1346    /// # use google_cloud_resourcemanager_v3::model::Organization;
1347    /// use wkt::Timestamp;
1348    /// let x = Organization::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1349    /// let x = Organization::new().set_or_clear_create_time(None::<Timestamp>);
1350    /// ```
1351    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1352    where
1353        T: std::convert::Into<wkt::Timestamp>,
1354    {
1355        self.create_time = v.map(|x| x.into());
1356        self
1357    }
1358
1359    /// Sets the value of [update_time][crate::model::Organization::update_time].
1360    ///
1361    /// # Example
1362    /// ```ignore,no_run
1363    /// # use google_cloud_resourcemanager_v3::model::Organization;
1364    /// use wkt::Timestamp;
1365    /// let x = Organization::new().set_update_time(Timestamp::default()/* use setters */);
1366    /// ```
1367    pub fn set_update_time<T>(mut self, v: T) -> Self
1368    where
1369        T: std::convert::Into<wkt::Timestamp>,
1370    {
1371        self.update_time = std::option::Option::Some(v.into());
1372        self
1373    }
1374
1375    /// Sets or clears the value of [update_time][crate::model::Organization::update_time].
1376    ///
1377    /// # Example
1378    /// ```ignore,no_run
1379    /// # use google_cloud_resourcemanager_v3::model::Organization;
1380    /// use wkt::Timestamp;
1381    /// let x = Organization::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1382    /// let x = Organization::new().set_or_clear_update_time(None::<Timestamp>);
1383    /// ```
1384    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1385    where
1386        T: std::convert::Into<wkt::Timestamp>,
1387    {
1388        self.update_time = v.map(|x| x.into());
1389        self
1390    }
1391
1392    /// Sets the value of [delete_time][crate::model::Organization::delete_time].
1393    ///
1394    /// # Example
1395    /// ```ignore,no_run
1396    /// # use google_cloud_resourcemanager_v3::model::Organization;
1397    /// use wkt::Timestamp;
1398    /// let x = Organization::new().set_delete_time(Timestamp::default()/* use setters */);
1399    /// ```
1400    pub fn set_delete_time<T>(mut self, v: T) -> Self
1401    where
1402        T: std::convert::Into<wkt::Timestamp>,
1403    {
1404        self.delete_time = std::option::Option::Some(v.into());
1405        self
1406    }
1407
1408    /// Sets or clears the value of [delete_time][crate::model::Organization::delete_time].
1409    ///
1410    /// # Example
1411    /// ```ignore,no_run
1412    /// # use google_cloud_resourcemanager_v3::model::Organization;
1413    /// use wkt::Timestamp;
1414    /// let x = Organization::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
1415    /// let x = Organization::new().set_or_clear_delete_time(None::<Timestamp>);
1416    /// ```
1417    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
1418    where
1419        T: std::convert::Into<wkt::Timestamp>,
1420    {
1421        self.delete_time = v.map(|x| x.into());
1422        self
1423    }
1424
1425    /// Sets the value of [etag][crate::model::Organization::etag].
1426    ///
1427    /// # Example
1428    /// ```ignore,no_run
1429    /// # use google_cloud_resourcemanager_v3::model::Organization;
1430    /// let x = Organization::new().set_etag("example");
1431    /// ```
1432    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1433        self.etag = v.into();
1434        self
1435    }
1436
1437    /// Sets the value of [owner][crate::model::Organization::owner].
1438    ///
1439    /// Note that all the setters affecting `owner` are mutually
1440    /// exclusive.
1441    ///
1442    /// # Example
1443    /// ```ignore,no_run
1444    /// # use google_cloud_resourcemanager_v3::model::Organization;
1445    /// use google_cloud_resourcemanager_v3::model::organization::Owner;
1446    /// let x = Organization::new().set_owner(Some(Owner::DirectoryCustomerId("example".to_string())));
1447    /// ```
1448    pub fn set_owner<
1449        T: std::convert::Into<std::option::Option<crate::model::organization::Owner>>,
1450    >(
1451        mut self,
1452        v: T,
1453    ) -> Self {
1454        self.owner = v.into();
1455        self
1456    }
1457
1458    /// The value of [owner][crate::model::Organization::owner]
1459    /// if it holds a `DirectoryCustomerId`, `None` if the field is not set or
1460    /// holds a different branch.
1461    pub fn directory_customer_id(&self) -> std::option::Option<&std::string::String> {
1462        #[allow(unreachable_patterns)]
1463        self.owner.as_ref().and_then(|v| match v {
1464            crate::model::organization::Owner::DirectoryCustomerId(v) => {
1465                std::option::Option::Some(v)
1466            }
1467            _ => std::option::Option::None,
1468        })
1469    }
1470
1471    /// Sets the value of [owner][crate::model::Organization::owner]
1472    /// to hold a `DirectoryCustomerId`.
1473    ///
1474    /// Note that all the setters affecting `owner` are
1475    /// mutually exclusive.
1476    ///
1477    /// # Example
1478    /// ```ignore,no_run
1479    /// # use google_cloud_resourcemanager_v3::model::Organization;
1480    /// let x = Organization::new().set_directory_customer_id("example");
1481    /// assert!(x.directory_customer_id().is_some());
1482    /// ```
1483    pub fn set_directory_customer_id<T: std::convert::Into<std::string::String>>(
1484        mut self,
1485        v: T,
1486    ) -> Self {
1487        self.owner = std::option::Option::Some(
1488            crate::model::organization::Owner::DirectoryCustomerId(v.into()),
1489        );
1490        self
1491    }
1492}
1493
1494impl wkt::message::Message for Organization {
1495    fn typename() -> &'static str {
1496        "type.googleapis.com/google.cloud.resourcemanager.v3.Organization"
1497    }
1498}
1499
1500/// Defines additional types related to [Organization].
1501pub mod organization {
1502    #[allow(unused_imports)]
1503    use super::*;
1504
1505    /// Organization lifecycle states.
1506    ///
1507    /// # Working with unknown values
1508    ///
1509    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
1510    /// additional enum variants at any time. Adding new variants is not considered
1511    /// a breaking change. Applications should write their code in anticipation of:
1512    ///
1513    /// - New values appearing in future releases of the client library, **and**
1514    /// - New values received dynamically, without application changes.
1515    ///
1516    /// Please consult the [Working with enums] section in the user guide for some
1517    /// guidelines.
1518    ///
1519    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
1520    #[derive(Clone, Debug, PartialEq)]
1521    #[non_exhaustive]
1522    pub enum State {
1523        /// Unspecified state.  This is only useful for distinguishing unset values.
1524        Unspecified,
1525        /// The normal and active state.
1526        Active,
1527        /// The organization has been marked for deletion by the user.
1528        DeleteRequested,
1529        /// If set, the enum was initialized with an unknown value.
1530        ///
1531        /// Applications can examine the value using [State::value] or
1532        /// [State::name].
1533        UnknownValue(state::UnknownValue),
1534    }
1535
1536    #[doc(hidden)]
1537    pub mod state {
1538        #[allow(unused_imports)]
1539        use super::*;
1540        #[derive(Clone, Debug, PartialEq)]
1541        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
1542    }
1543
1544    impl State {
1545        /// Gets the enum value.
1546        ///
1547        /// Returns `None` if the enum contains an unknown value deserialized from
1548        /// the string representation of enums.
1549        pub fn value(&self) -> std::option::Option<i32> {
1550            match self {
1551                Self::Unspecified => std::option::Option::Some(0),
1552                Self::Active => std::option::Option::Some(1),
1553                Self::DeleteRequested => std::option::Option::Some(2),
1554                Self::UnknownValue(u) => u.0.value(),
1555            }
1556        }
1557
1558        /// Gets the enum value as a string.
1559        ///
1560        /// Returns `None` if the enum contains an unknown value deserialized from
1561        /// the integer representation of enums.
1562        pub fn name(&self) -> std::option::Option<&str> {
1563            match self {
1564                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
1565                Self::Active => std::option::Option::Some("ACTIVE"),
1566                Self::DeleteRequested => std::option::Option::Some("DELETE_REQUESTED"),
1567                Self::UnknownValue(u) => u.0.name(),
1568            }
1569        }
1570    }
1571
1572    impl std::default::Default for State {
1573        fn default() -> Self {
1574            use std::convert::From;
1575            Self::from(0)
1576        }
1577    }
1578
1579    impl std::fmt::Display for State {
1580        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
1581            wkt::internal::display_enum(f, self.name(), self.value())
1582        }
1583    }
1584
1585    impl std::convert::From<i32> for State {
1586        fn from(value: i32) -> Self {
1587            match value {
1588                0 => Self::Unspecified,
1589                1 => Self::Active,
1590                2 => Self::DeleteRequested,
1591                _ => Self::UnknownValue(state::UnknownValue(
1592                    wkt::internal::UnknownEnumValue::Integer(value),
1593                )),
1594            }
1595        }
1596    }
1597
1598    impl std::convert::From<&str> for State {
1599        fn from(value: &str) -> Self {
1600            use std::string::ToString;
1601            match value {
1602                "STATE_UNSPECIFIED" => Self::Unspecified,
1603                "ACTIVE" => Self::Active,
1604                "DELETE_REQUESTED" => Self::DeleteRequested,
1605                _ => Self::UnknownValue(state::UnknownValue(
1606                    wkt::internal::UnknownEnumValue::String(value.to_string()),
1607                )),
1608            }
1609        }
1610    }
1611
1612    impl serde::ser::Serialize for State {
1613        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1614        where
1615            S: serde::Serializer,
1616        {
1617            match self {
1618                Self::Unspecified => serializer.serialize_i32(0),
1619                Self::Active => serializer.serialize_i32(1),
1620                Self::DeleteRequested => serializer.serialize_i32(2),
1621                Self::UnknownValue(u) => u.0.serialize(serializer),
1622            }
1623        }
1624    }
1625
1626    impl<'de> serde::de::Deserialize<'de> for State {
1627        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1628        where
1629            D: serde::Deserializer<'de>,
1630        {
1631            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
1632                ".google.cloud.resourcemanager.v3.Organization.State",
1633            ))
1634        }
1635    }
1636
1637    /// The owner of this organization. The owner should be specified on
1638    /// creation. Once set, it cannot be changed.
1639    ///
1640    /// The lifetime of the organization and all of its descendants are bound to
1641    /// the owner. If the owner is deleted, the organization and all its
1642    /// descendants will be deleted.
1643    #[derive(Clone, Debug, PartialEq)]
1644    #[non_exhaustive]
1645    pub enum Owner {
1646        /// Immutable. The G Suite / Workspace customer id used in the Directory API.
1647        DirectoryCustomerId(std::string::String),
1648    }
1649}
1650
1651/// The request sent to the `GetOrganization` method. The `name` field is
1652/// required. `organization_id` is no longer accepted.
1653#[derive(Clone, Default, PartialEq)]
1654#[non_exhaustive]
1655pub struct GetOrganizationRequest {
1656    /// Required. The resource name of the Organization to fetch. This is the
1657    /// organization's relative path in the API, formatted as
1658    /// "organizations/[organizationId]". For example, "organizations/1234".
1659    pub name: std::string::String,
1660
1661    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1662}
1663
1664impl GetOrganizationRequest {
1665    pub fn new() -> Self {
1666        std::default::Default::default()
1667    }
1668
1669    /// Sets the value of [name][crate::model::GetOrganizationRequest::name].
1670    ///
1671    /// # Example
1672    /// ```ignore,no_run
1673    /// # use google_cloud_resourcemanager_v3::model::GetOrganizationRequest;
1674    /// let x = GetOrganizationRequest::new().set_name("example");
1675    /// ```
1676    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1677        self.name = v.into();
1678        self
1679    }
1680}
1681
1682impl wkt::message::Message for GetOrganizationRequest {
1683    fn typename() -> &'static str {
1684        "type.googleapis.com/google.cloud.resourcemanager.v3.GetOrganizationRequest"
1685    }
1686}
1687
1688/// The request sent to the `SearchOrganizations` method.
1689#[derive(Clone, Default, PartialEq)]
1690#[non_exhaustive]
1691pub struct SearchOrganizationsRequest {
1692    /// Optional. The maximum number of organizations to return in the response.
1693    /// The server can return fewer organizations than requested. If unspecified,
1694    /// server picks an appropriate default.
1695    pub page_size: i32,
1696
1697    /// Optional. A pagination token returned from a previous call to
1698    /// `SearchOrganizations` that indicates from where listing should continue.
1699    pub page_token: std::string::String,
1700
1701    /// Optional. An optional query string used to filter the Organizations to
1702    /// return in the response. Query rules are case-insensitive.
1703    ///
1704    /// ```norust
1705    /// | Field            | Description                                |
1706    /// |------------------|--------------------------------------------|
1707    /// | directoryCustomerId, owner.directoryCustomerId | Filters by directory
1708    /// customer id. |
1709    /// | domain           | Filters by domain.                         |
1710    /// ```
1711    ///
1712    /// Organizations may be queried by `directoryCustomerId` or by
1713    /// `domain`, where the domain is a G Suite domain, for example:
1714    ///
1715    /// * Query `directorycustomerid:123456789` returns Organization
1716    ///   resources with `owner.directory_customer_id` equal to `123456789`.
1717    /// * Query `domain:google.com` returns Organization resources corresponding
1718    ///   to the domain `google.com`.
1719    pub query: std::string::String,
1720
1721    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1722}
1723
1724impl SearchOrganizationsRequest {
1725    pub fn new() -> Self {
1726        std::default::Default::default()
1727    }
1728
1729    /// Sets the value of [page_size][crate::model::SearchOrganizationsRequest::page_size].
1730    ///
1731    /// # Example
1732    /// ```ignore,no_run
1733    /// # use google_cloud_resourcemanager_v3::model::SearchOrganizationsRequest;
1734    /// let x = SearchOrganizationsRequest::new().set_page_size(42);
1735    /// ```
1736    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1737        self.page_size = v.into();
1738        self
1739    }
1740
1741    /// Sets the value of [page_token][crate::model::SearchOrganizationsRequest::page_token].
1742    ///
1743    /// # Example
1744    /// ```ignore,no_run
1745    /// # use google_cloud_resourcemanager_v3::model::SearchOrganizationsRequest;
1746    /// let x = SearchOrganizationsRequest::new().set_page_token("example");
1747    /// ```
1748    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1749        self.page_token = v.into();
1750        self
1751    }
1752
1753    /// Sets the value of [query][crate::model::SearchOrganizationsRequest::query].
1754    ///
1755    /// # Example
1756    /// ```ignore,no_run
1757    /// # use google_cloud_resourcemanager_v3::model::SearchOrganizationsRequest;
1758    /// let x = SearchOrganizationsRequest::new().set_query("example");
1759    /// ```
1760    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1761        self.query = v.into();
1762        self
1763    }
1764}
1765
1766impl wkt::message::Message for SearchOrganizationsRequest {
1767    fn typename() -> &'static str {
1768        "type.googleapis.com/google.cloud.resourcemanager.v3.SearchOrganizationsRequest"
1769    }
1770}
1771
1772/// The response returned from the `SearchOrganizations` method.
1773#[derive(Clone, Default, PartialEq)]
1774#[non_exhaustive]
1775pub struct SearchOrganizationsResponse {
1776    /// The list of Organizations that matched the search query, possibly
1777    /// paginated.
1778    pub organizations: std::vec::Vec<crate::model::Organization>,
1779
1780    /// A pagination token to be used to retrieve the next page of results. If the
1781    /// result is too large to fit within the page size specified in the request,
1782    /// this field will be set with a token that can be used to fetch the next page
1783    /// of results. If this field is empty, it indicates that this response
1784    /// contains the last page of results.
1785    pub next_page_token: std::string::String,
1786
1787    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1788}
1789
1790impl SearchOrganizationsResponse {
1791    pub fn new() -> Self {
1792        std::default::Default::default()
1793    }
1794
1795    /// Sets the value of [organizations][crate::model::SearchOrganizationsResponse::organizations].
1796    ///
1797    /// # Example
1798    /// ```ignore,no_run
1799    /// # use google_cloud_resourcemanager_v3::model::SearchOrganizationsResponse;
1800    /// use google_cloud_resourcemanager_v3::model::Organization;
1801    /// let x = SearchOrganizationsResponse::new()
1802    ///     .set_organizations([
1803    ///         Organization::default()/* use setters */,
1804    ///         Organization::default()/* use (different) setters */,
1805    ///     ]);
1806    /// ```
1807    pub fn set_organizations<T, V>(mut self, v: T) -> Self
1808    where
1809        T: std::iter::IntoIterator<Item = V>,
1810        V: std::convert::Into<crate::model::Organization>,
1811    {
1812        use std::iter::Iterator;
1813        self.organizations = v.into_iter().map(|i| i.into()).collect();
1814        self
1815    }
1816
1817    /// Sets the value of [next_page_token][crate::model::SearchOrganizationsResponse::next_page_token].
1818    ///
1819    /// # Example
1820    /// ```ignore,no_run
1821    /// # use google_cloud_resourcemanager_v3::model::SearchOrganizationsResponse;
1822    /// let x = SearchOrganizationsResponse::new().set_next_page_token("example");
1823    /// ```
1824    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1825        self.next_page_token = v.into();
1826        self
1827    }
1828}
1829
1830impl wkt::message::Message for SearchOrganizationsResponse {
1831    fn typename() -> &'static str {
1832        "type.googleapis.com/google.cloud.resourcemanager.v3.SearchOrganizationsResponse"
1833    }
1834}
1835
1836#[doc(hidden)]
1837impl google_cloud_gax::paginator::internal::PageableResponse for SearchOrganizationsResponse {
1838    type PageItem = crate::model::Organization;
1839
1840    fn items(self) -> std::vec::Vec<Self::PageItem> {
1841        self.organizations
1842    }
1843
1844    fn next_page_token(&self) -> std::string::String {
1845        use std::clone::Clone;
1846        self.next_page_token.clone()
1847    }
1848}
1849
1850/// A status object which is used as the `metadata` field for the operation
1851/// returned by DeleteOrganization.
1852#[derive(Clone, Default, PartialEq)]
1853#[non_exhaustive]
1854pub struct DeleteOrganizationMetadata {
1855    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1856}
1857
1858impl DeleteOrganizationMetadata {
1859    pub fn new() -> Self {
1860        std::default::Default::default()
1861    }
1862}
1863
1864impl wkt::message::Message for DeleteOrganizationMetadata {
1865    fn typename() -> &'static str {
1866        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteOrganizationMetadata"
1867    }
1868}
1869
1870/// A status object which is used as the `metadata` field for the Operation
1871/// returned by UndeleteOrganization.
1872#[derive(Clone, Default, PartialEq)]
1873#[non_exhaustive]
1874pub struct UndeleteOrganizationMetadata {
1875    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1876}
1877
1878impl UndeleteOrganizationMetadata {
1879    pub fn new() -> Self {
1880        std::default::Default::default()
1881    }
1882}
1883
1884impl wkt::message::Message for UndeleteOrganizationMetadata {
1885    fn typename() -> &'static str {
1886        "type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteOrganizationMetadata"
1887    }
1888}
1889
1890/// A project is a high-level Google Cloud entity. It is a
1891/// container for ACLs, APIs, App Engine Apps, VMs, and other
1892/// Google Cloud Platform resources.
1893#[derive(Clone, Default, PartialEq)]
1894#[non_exhaustive]
1895pub struct Project {
1896    /// Output only. The unique resource name of the project. It is an int64
1897    /// generated number prefixed by "projects/".
1898    ///
1899    /// Example: `projects/415104041262`
1900    pub name: std::string::String,
1901
1902    /// Optional. A reference to a parent Resource. eg., `organizations/123` or
1903    /// `folders/876`.
1904    pub parent: std::string::String,
1905
1906    /// Immutable. The unique, user-assigned id of the project.
1907    /// It must be 6 to 30 lowercase ASCII letters, digits, or hyphens.
1908    /// It must start with a letter.
1909    /// Trailing hyphens are prohibited.
1910    ///
1911    /// Example: `tokyo-rain-123`
1912    pub project_id: std::string::String,
1913
1914    /// Output only. The project lifecycle state.
1915    pub state: crate::model::project::State,
1916
1917    /// Optional. A user-assigned display name of the project.
1918    /// When present it must be between 4 to 30 characters.
1919    /// Allowed characters are: lowercase and uppercase letters, numbers,
1920    /// hyphen, single-quote, double-quote, space, and exclamation point.
1921    ///
1922    /// Example: `My Project`
1923    pub display_name: std::string::String,
1924
1925    /// Output only. Creation time.
1926    pub create_time: std::option::Option<wkt::Timestamp>,
1927
1928    /// Output only. The most recent time this resource was modified.
1929    pub update_time: std::option::Option<wkt::Timestamp>,
1930
1931    /// Output only. The time at which this resource was requested for deletion.
1932    pub delete_time: std::option::Option<wkt::Timestamp>,
1933
1934    /// Output only. A checksum computed by the server based on the current value
1935    /// of the Project resource. This may be sent on update and delete requests to
1936    /// ensure the client has an up-to-date value before proceeding.
1937    pub etag: std::string::String,
1938
1939    /// Optional. The labels associated with this project.
1940    ///
1941    /// Label keys must be between 1 and 63 characters long and must conform
1942    /// to the following regular expression: \[a-z\](\[-a-z0-9\]*\[a-z0-9\])?.
1943    ///
1944    /// Label values must be between 0 and 63 characters long and must conform
1945    /// to the regular expression (\[a-z\](\[-a-z0-9\]*\[a-z0-9\])?)?.
1946    ///
1947    /// No more than 64 labels can be associated with a given resource.
1948    ///
1949    /// Clients should store labels in a representation such as JSON that does not
1950    /// depend on specific characters being disallowed.
1951    ///
1952    /// Example: `"myBusinessDimension" : "businessValue"`
1953    pub labels: std::collections::HashMap<std::string::String, std::string::String>,
1954
1955    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1956}
1957
1958impl Project {
1959    pub fn new() -> Self {
1960        std::default::Default::default()
1961    }
1962
1963    /// Sets the value of [name][crate::model::Project::name].
1964    ///
1965    /// # Example
1966    /// ```ignore,no_run
1967    /// # use google_cloud_resourcemanager_v3::model::Project;
1968    /// let x = Project::new().set_name("example");
1969    /// ```
1970    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1971        self.name = v.into();
1972        self
1973    }
1974
1975    /// Sets the value of [parent][crate::model::Project::parent].
1976    ///
1977    /// # Example
1978    /// ```ignore,no_run
1979    /// # use google_cloud_resourcemanager_v3::model::Project;
1980    /// let x = Project::new().set_parent("example");
1981    /// ```
1982    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1983        self.parent = v.into();
1984        self
1985    }
1986
1987    /// Sets the value of [project_id][crate::model::Project::project_id].
1988    ///
1989    /// # Example
1990    /// ```ignore,no_run
1991    /// # use google_cloud_resourcemanager_v3::model::Project;
1992    /// let x = Project::new().set_project_id("example");
1993    /// ```
1994    pub fn set_project_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1995        self.project_id = v.into();
1996        self
1997    }
1998
1999    /// Sets the value of [state][crate::model::Project::state].
2000    ///
2001    /// # Example
2002    /// ```ignore,no_run
2003    /// # use google_cloud_resourcemanager_v3::model::Project;
2004    /// use google_cloud_resourcemanager_v3::model::project::State;
2005    /// let x0 = Project::new().set_state(State::Active);
2006    /// let x1 = Project::new().set_state(State::DeleteRequested);
2007    /// ```
2008    pub fn set_state<T: std::convert::Into<crate::model::project::State>>(mut self, v: T) -> Self {
2009        self.state = v.into();
2010        self
2011    }
2012
2013    /// Sets the value of [display_name][crate::model::Project::display_name].
2014    ///
2015    /// # Example
2016    /// ```ignore,no_run
2017    /// # use google_cloud_resourcemanager_v3::model::Project;
2018    /// let x = Project::new().set_display_name("example");
2019    /// ```
2020    pub fn set_display_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2021        self.display_name = v.into();
2022        self
2023    }
2024
2025    /// Sets the value of [create_time][crate::model::Project::create_time].
2026    ///
2027    /// # Example
2028    /// ```ignore,no_run
2029    /// # use google_cloud_resourcemanager_v3::model::Project;
2030    /// use wkt::Timestamp;
2031    /// let x = Project::new().set_create_time(Timestamp::default()/* use setters */);
2032    /// ```
2033    pub fn set_create_time<T>(mut self, v: T) -> Self
2034    where
2035        T: std::convert::Into<wkt::Timestamp>,
2036    {
2037        self.create_time = std::option::Option::Some(v.into());
2038        self
2039    }
2040
2041    /// Sets or clears the value of [create_time][crate::model::Project::create_time].
2042    ///
2043    /// # Example
2044    /// ```ignore,no_run
2045    /// # use google_cloud_resourcemanager_v3::model::Project;
2046    /// use wkt::Timestamp;
2047    /// let x = Project::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2048    /// let x = Project::new().set_or_clear_create_time(None::<Timestamp>);
2049    /// ```
2050    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2051    where
2052        T: std::convert::Into<wkt::Timestamp>,
2053    {
2054        self.create_time = v.map(|x| x.into());
2055        self
2056    }
2057
2058    /// Sets the value of [update_time][crate::model::Project::update_time].
2059    ///
2060    /// # Example
2061    /// ```ignore,no_run
2062    /// # use google_cloud_resourcemanager_v3::model::Project;
2063    /// use wkt::Timestamp;
2064    /// let x = Project::new().set_update_time(Timestamp::default()/* use setters */);
2065    /// ```
2066    pub fn set_update_time<T>(mut self, v: T) -> Self
2067    where
2068        T: std::convert::Into<wkt::Timestamp>,
2069    {
2070        self.update_time = std::option::Option::Some(v.into());
2071        self
2072    }
2073
2074    /// Sets or clears the value of [update_time][crate::model::Project::update_time].
2075    ///
2076    /// # Example
2077    /// ```ignore,no_run
2078    /// # use google_cloud_resourcemanager_v3::model::Project;
2079    /// use wkt::Timestamp;
2080    /// let x = Project::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2081    /// let x = Project::new().set_or_clear_update_time(None::<Timestamp>);
2082    /// ```
2083    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2084    where
2085        T: std::convert::Into<wkt::Timestamp>,
2086    {
2087        self.update_time = v.map(|x| x.into());
2088        self
2089    }
2090
2091    /// Sets the value of [delete_time][crate::model::Project::delete_time].
2092    ///
2093    /// # Example
2094    /// ```ignore,no_run
2095    /// # use google_cloud_resourcemanager_v3::model::Project;
2096    /// use wkt::Timestamp;
2097    /// let x = Project::new().set_delete_time(Timestamp::default()/* use setters */);
2098    /// ```
2099    pub fn set_delete_time<T>(mut self, v: T) -> Self
2100    where
2101        T: std::convert::Into<wkt::Timestamp>,
2102    {
2103        self.delete_time = std::option::Option::Some(v.into());
2104        self
2105    }
2106
2107    /// Sets or clears the value of [delete_time][crate::model::Project::delete_time].
2108    ///
2109    /// # Example
2110    /// ```ignore,no_run
2111    /// # use google_cloud_resourcemanager_v3::model::Project;
2112    /// use wkt::Timestamp;
2113    /// let x = Project::new().set_or_clear_delete_time(Some(Timestamp::default()/* use setters */));
2114    /// let x = Project::new().set_or_clear_delete_time(None::<Timestamp>);
2115    /// ```
2116    pub fn set_or_clear_delete_time<T>(mut self, v: std::option::Option<T>) -> Self
2117    where
2118        T: std::convert::Into<wkt::Timestamp>,
2119    {
2120        self.delete_time = v.map(|x| x.into());
2121        self
2122    }
2123
2124    /// Sets the value of [etag][crate::model::Project::etag].
2125    ///
2126    /// # Example
2127    /// ```ignore,no_run
2128    /// # use google_cloud_resourcemanager_v3::model::Project;
2129    /// let x = Project::new().set_etag("example");
2130    /// ```
2131    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2132        self.etag = v.into();
2133        self
2134    }
2135
2136    /// Sets the value of [labels][crate::model::Project::labels].
2137    ///
2138    /// # Example
2139    /// ```ignore,no_run
2140    /// # use google_cloud_resourcemanager_v3::model::Project;
2141    /// let x = Project::new().set_labels([
2142    ///     ("key0", "abc"),
2143    ///     ("key1", "xyz"),
2144    /// ]);
2145    /// ```
2146    pub fn set_labels<T, K, V>(mut self, v: T) -> Self
2147    where
2148        T: std::iter::IntoIterator<Item = (K, V)>,
2149        K: std::convert::Into<std::string::String>,
2150        V: std::convert::Into<std::string::String>,
2151    {
2152        use std::iter::Iterator;
2153        self.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2154        self
2155    }
2156}
2157
2158impl wkt::message::Message for Project {
2159    fn typename() -> &'static str {
2160        "type.googleapis.com/google.cloud.resourcemanager.v3.Project"
2161    }
2162}
2163
2164/// Defines additional types related to [Project].
2165pub mod project {
2166    #[allow(unused_imports)]
2167    use super::*;
2168
2169    /// Project lifecycle states.
2170    ///
2171    /// # Working with unknown values
2172    ///
2173    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2174    /// additional enum variants at any time. Adding new variants is not considered
2175    /// a breaking change. Applications should write their code in anticipation of:
2176    ///
2177    /// - New values appearing in future releases of the client library, **and**
2178    /// - New values received dynamically, without application changes.
2179    ///
2180    /// Please consult the [Working with enums] section in the user guide for some
2181    /// guidelines.
2182    ///
2183    /// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
2184    #[derive(Clone, Debug, PartialEq)]
2185    #[non_exhaustive]
2186    pub enum State {
2187        /// Unspecified state.  This is only used/useful for distinguishing
2188        /// unset values.
2189        Unspecified,
2190        /// The normal and active state.
2191        Active,
2192        /// The project has been marked for deletion by the user
2193        /// (by invoking
2194        /// [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject])
2195        /// or by the system (Google Cloud Platform).
2196        /// This can generally be reversed by invoking [UndeleteProject]
2197        /// [google.cloud.resourcemanager.v3.Projects.UndeleteProject].
2198        ///
2199        /// [google.cloud.resourcemanager.v3.Projects.DeleteProject]: crate::client::Projects::delete_project
2200        DeleteRequested,
2201        /// If set, the enum was initialized with an unknown value.
2202        ///
2203        /// Applications can examine the value using [State::value] or
2204        /// [State::name].
2205        UnknownValue(state::UnknownValue),
2206    }
2207
2208    #[doc(hidden)]
2209    pub mod state {
2210        #[allow(unused_imports)]
2211        use super::*;
2212        #[derive(Clone, Debug, PartialEq)]
2213        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2214    }
2215
2216    impl State {
2217        /// Gets the enum value.
2218        ///
2219        /// Returns `None` if the enum contains an unknown value deserialized from
2220        /// the string representation of enums.
2221        pub fn value(&self) -> std::option::Option<i32> {
2222            match self {
2223                Self::Unspecified => std::option::Option::Some(0),
2224                Self::Active => std::option::Option::Some(1),
2225                Self::DeleteRequested => std::option::Option::Some(2),
2226                Self::UnknownValue(u) => u.0.value(),
2227            }
2228        }
2229
2230        /// Gets the enum value as a string.
2231        ///
2232        /// Returns `None` if the enum contains an unknown value deserialized from
2233        /// the integer representation of enums.
2234        pub fn name(&self) -> std::option::Option<&str> {
2235            match self {
2236                Self::Unspecified => std::option::Option::Some("STATE_UNSPECIFIED"),
2237                Self::Active => std::option::Option::Some("ACTIVE"),
2238                Self::DeleteRequested => std::option::Option::Some("DELETE_REQUESTED"),
2239                Self::UnknownValue(u) => u.0.name(),
2240            }
2241        }
2242    }
2243
2244    impl std::default::Default for State {
2245        fn default() -> Self {
2246            use std::convert::From;
2247            Self::from(0)
2248        }
2249    }
2250
2251    impl std::fmt::Display for State {
2252        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
2253            wkt::internal::display_enum(f, self.name(), self.value())
2254        }
2255    }
2256
2257    impl std::convert::From<i32> for State {
2258        fn from(value: i32) -> Self {
2259            match value {
2260                0 => Self::Unspecified,
2261                1 => Self::Active,
2262                2 => Self::DeleteRequested,
2263                _ => Self::UnknownValue(state::UnknownValue(
2264                    wkt::internal::UnknownEnumValue::Integer(value),
2265                )),
2266            }
2267        }
2268    }
2269
2270    impl std::convert::From<&str> for State {
2271        fn from(value: &str) -> Self {
2272            use std::string::ToString;
2273            match value {
2274                "STATE_UNSPECIFIED" => Self::Unspecified,
2275                "ACTIVE" => Self::Active,
2276                "DELETE_REQUESTED" => Self::DeleteRequested,
2277                _ => Self::UnknownValue(state::UnknownValue(
2278                    wkt::internal::UnknownEnumValue::String(value.to_string()),
2279                )),
2280            }
2281        }
2282    }
2283
2284    impl serde::ser::Serialize for State {
2285        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2286        where
2287            S: serde::Serializer,
2288        {
2289            match self {
2290                Self::Unspecified => serializer.serialize_i32(0),
2291                Self::Active => serializer.serialize_i32(1),
2292                Self::DeleteRequested => serializer.serialize_i32(2),
2293                Self::UnknownValue(u) => u.0.serialize(serializer),
2294            }
2295        }
2296    }
2297
2298    impl<'de> serde::de::Deserialize<'de> for State {
2299        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2300        where
2301            D: serde::Deserializer<'de>,
2302        {
2303            deserializer.deserialize_any(wkt::internal::EnumVisitor::<State>::new(
2304                ".google.cloud.resourcemanager.v3.Project.State",
2305            ))
2306        }
2307    }
2308}
2309
2310/// The request sent to the
2311/// [GetProject][google.cloud.resourcemanager.v3.Projects.GetProject]
2312/// method.
2313///
2314/// [google.cloud.resourcemanager.v3.Projects.GetProject]: crate::client::Projects::get_project
2315#[derive(Clone, Default, PartialEq)]
2316#[non_exhaustive]
2317pub struct GetProjectRequest {
2318    /// Required. The name of the project (for example, `projects/415104041262`).
2319    pub name: std::string::String,
2320
2321    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2322}
2323
2324impl GetProjectRequest {
2325    pub fn new() -> Self {
2326        std::default::Default::default()
2327    }
2328
2329    /// Sets the value of [name][crate::model::GetProjectRequest::name].
2330    ///
2331    /// # Example
2332    /// ```ignore,no_run
2333    /// # use google_cloud_resourcemanager_v3::model::GetProjectRequest;
2334    /// let x = GetProjectRequest::new().set_name("example");
2335    /// ```
2336    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2337        self.name = v.into();
2338        self
2339    }
2340}
2341
2342impl wkt::message::Message for GetProjectRequest {
2343    fn typename() -> &'static str {
2344        "type.googleapis.com/google.cloud.resourcemanager.v3.GetProjectRequest"
2345    }
2346}
2347
2348/// The request sent to the
2349/// [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects]
2350/// method.
2351///
2352/// [google.cloud.resourcemanager.v3.Projects.ListProjects]: crate::client::Projects::list_projects
2353#[derive(Clone, Default, PartialEq)]
2354#[non_exhaustive]
2355pub struct ListProjectsRequest {
2356    /// Required. The name of the parent resource whose projects are being listed.
2357    /// Only children of this parent resource are listed; descendants are not
2358    /// listed.
2359    ///
2360    /// If the parent is a folder, use the value `folders/{folder_id}`. If the
2361    /// parent is an organization, use the value `organizations/{org_id}`.
2362    pub parent: std::string::String,
2363
2364    /// Optional. A pagination token returned from a previous call to
2365    /// [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that
2366    /// indicates from where listing should continue.
2367    pub page_token: std::string::String,
2368
2369    /// Optional. The maximum number of projects to return in the response.
2370    /// The server can return fewer projects than requested.
2371    /// If unspecified, server picks an appropriate default.
2372    pub page_size: i32,
2373
2374    /// Optional. Indicate that projects in the `DELETE_REQUESTED` state should
2375    /// also be returned. Normally only `ACTIVE` projects are returned.
2376    pub show_deleted: bool,
2377
2378    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2379}
2380
2381impl ListProjectsRequest {
2382    pub fn new() -> Self {
2383        std::default::Default::default()
2384    }
2385
2386    /// Sets the value of [parent][crate::model::ListProjectsRequest::parent].
2387    ///
2388    /// # Example
2389    /// ```ignore,no_run
2390    /// # use google_cloud_resourcemanager_v3::model::ListProjectsRequest;
2391    /// let x = ListProjectsRequest::new().set_parent("example");
2392    /// ```
2393    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2394        self.parent = v.into();
2395        self
2396    }
2397
2398    /// Sets the value of [page_token][crate::model::ListProjectsRequest::page_token].
2399    ///
2400    /// # Example
2401    /// ```ignore,no_run
2402    /// # use google_cloud_resourcemanager_v3::model::ListProjectsRequest;
2403    /// let x = ListProjectsRequest::new().set_page_token("example");
2404    /// ```
2405    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2406        self.page_token = v.into();
2407        self
2408    }
2409
2410    /// Sets the value of [page_size][crate::model::ListProjectsRequest::page_size].
2411    ///
2412    /// # Example
2413    /// ```ignore,no_run
2414    /// # use google_cloud_resourcemanager_v3::model::ListProjectsRequest;
2415    /// let x = ListProjectsRequest::new().set_page_size(42);
2416    /// ```
2417    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2418        self.page_size = v.into();
2419        self
2420    }
2421
2422    /// Sets the value of [show_deleted][crate::model::ListProjectsRequest::show_deleted].
2423    ///
2424    /// # Example
2425    /// ```ignore,no_run
2426    /// # use google_cloud_resourcemanager_v3::model::ListProjectsRequest;
2427    /// let x = ListProjectsRequest::new().set_show_deleted(true);
2428    /// ```
2429    pub fn set_show_deleted<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2430        self.show_deleted = v.into();
2431        self
2432    }
2433}
2434
2435impl wkt::message::Message for ListProjectsRequest {
2436    fn typename() -> &'static str {
2437        "type.googleapis.com/google.cloud.resourcemanager.v3.ListProjectsRequest"
2438    }
2439}
2440
2441/// A page of the response received from the
2442/// [ListProjects][google.cloud.resourcemanager.v3.Projects.ListProjects]
2443/// method.
2444///
2445/// A paginated response where more pages are available has
2446/// `next_page_token` set. This token can be used in a subsequent request to
2447/// retrieve the next request page.
2448///
2449/// NOTE: A response may contain fewer elements than the request `page_size` and
2450/// still have a `next_page_token`.
2451///
2452/// [google.cloud.resourcemanager.v3.Projects.ListProjects]: crate::client::Projects::list_projects
2453#[derive(Clone, Default, PartialEq)]
2454#[non_exhaustive]
2455pub struct ListProjectsResponse {
2456    /// The list of Projects under the parent. This list can be paginated.
2457    pub projects: std::vec::Vec<crate::model::Project>,
2458
2459    /// Pagination token.
2460    ///
2461    /// If the result set is too large to fit in a single response, this token
2462    /// is returned. It encodes the position of the current result cursor.
2463    /// Feeding this value into a new list request with the `page_token` parameter
2464    /// gives the next page of the results.
2465    ///
2466    /// When `next_page_token` is not filled in, there is no next page and
2467    /// the list returned is the last page in the result set.
2468    ///
2469    /// Pagination tokens have a limited lifetime.
2470    pub next_page_token: std::string::String,
2471
2472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2473}
2474
2475impl ListProjectsResponse {
2476    pub fn new() -> Self {
2477        std::default::Default::default()
2478    }
2479
2480    /// Sets the value of [projects][crate::model::ListProjectsResponse::projects].
2481    ///
2482    /// # Example
2483    /// ```ignore,no_run
2484    /// # use google_cloud_resourcemanager_v3::model::ListProjectsResponse;
2485    /// use google_cloud_resourcemanager_v3::model::Project;
2486    /// let x = ListProjectsResponse::new()
2487    ///     .set_projects([
2488    ///         Project::default()/* use setters */,
2489    ///         Project::default()/* use (different) setters */,
2490    ///     ]);
2491    /// ```
2492    pub fn set_projects<T, V>(mut self, v: T) -> Self
2493    where
2494        T: std::iter::IntoIterator<Item = V>,
2495        V: std::convert::Into<crate::model::Project>,
2496    {
2497        use std::iter::Iterator;
2498        self.projects = v.into_iter().map(|i| i.into()).collect();
2499        self
2500    }
2501
2502    /// Sets the value of [next_page_token][crate::model::ListProjectsResponse::next_page_token].
2503    ///
2504    /// # Example
2505    /// ```ignore,no_run
2506    /// # use google_cloud_resourcemanager_v3::model::ListProjectsResponse;
2507    /// let x = ListProjectsResponse::new().set_next_page_token("example");
2508    /// ```
2509    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2510        self.next_page_token = v.into();
2511        self
2512    }
2513}
2514
2515impl wkt::message::Message for ListProjectsResponse {
2516    fn typename() -> &'static str {
2517        "type.googleapis.com/google.cloud.resourcemanager.v3.ListProjectsResponse"
2518    }
2519}
2520
2521#[doc(hidden)]
2522impl google_cloud_gax::paginator::internal::PageableResponse for ListProjectsResponse {
2523    type PageItem = crate::model::Project;
2524
2525    fn items(self) -> std::vec::Vec<Self::PageItem> {
2526        self.projects
2527    }
2528
2529    fn next_page_token(&self) -> std::string::String {
2530        use std::clone::Clone;
2531        self.next_page_token.clone()
2532    }
2533}
2534
2535/// The request sent to the
2536/// [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]
2537/// method.
2538///
2539/// [google.cloud.resourcemanager.v3.Projects.SearchProjects]: crate::client::Projects::search_projects
2540#[derive(Clone, Default, PartialEq)]
2541#[non_exhaustive]
2542pub struct SearchProjectsRequest {
2543    /// Optional. A query string for searching for projects that the caller has
2544    /// `resourcemanager.projects.get` permission to. If multiple fields are
2545    /// included in the query, then it will return results that match any of the
2546    /// fields. Some eligible fields are:
2547    ///
2548    /// - **`displayName`, `name`**: Filters by displayName.
2549    /// - **`parent`**: Project's parent (for example: `folders/123`,
2550    ///   `organizations/*`). Prefer `parent` field over `parent.type` and
2551    ///   `parent.id`.
2552    /// - **`parent.type`**: Parent's type: `folder` or `organization`.
2553    /// - **`parent.id`**: Parent's id number (for example: `123`).
2554    /// - **`id`, `projectId`**: Filters by projectId.
2555    /// - **`state`, `lifecycleState`**: Filters by state.
2556    /// - **`labels`**: Filters by label name or value.
2557    /// - **`labels.<key>` (where `<key>` is the name of a label)**: Filters by label
2558    ///   name.
2559    ///
2560    /// Search expressions are case insensitive.
2561    ///
2562    /// Some examples queries:
2563    ///
2564    /// - **`name:how*`**: The project's name starts with "how".
2565    /// - **`name:Howl`**: The project's name is `Howl` or `howl`.
2566    /// - **`name:HOWL`**: Equivalent to above.
2567    /// - **`NAME:howl`**: Equivalent to above.
2568    /// - **`labels.color:*`**: The project has the label `color`.
2569    /// - **`labels.color:red`**:  The project's label `color` has the value `red`.
2570    /// - **`labels.color:red labels.size:big`**: The project's label `color` has
2571    ///   the value `red` or its label `size` has the value `big`.
2572    ///
2573    /// If no query is specified, the call will return projects for which the user
2574    /// has the `resourcemanager.projects.get` permission.
2575    pub query: std::string::String,
2576
2577    /// Optional. A pagination token returned from a previous call to
2578    /// [ListProjects] [google.cloud.resourcemanager.v3.Projects.ListProjects] that
2579    /// indicates from where listing should continue.
2580    pub page_token: std::string::String,
2581
2582    /// Optional. The maximum number of projects to return in the response.
2583    /// The server can return fewer projects than requested.
2584    /// If unspecified, server picks an appropriate default.
2585    pub page_size: i32,
2586
2587    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2588}
2589
2590impl SearchProjectsRequest {
2591    pub fn new() -> Self {
2592        std::default::Default::default()
2593    }
2594
2595    /// Sets the value of [query][crate::model::SearchProjectsRequest::query].
2596    ///
2597    /// # Example
2598    /// ```ignore,no_run
2599    /// # use google_cloud_resourcemanager_v3::model::SearchProjectsRequest;
2600    /// let x = SearchProjectsRequest::new().set_query("example");
2601    /// ```
2602    pub fn set_query<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2603        self.query = v.into();
2604        self
2605    }
2606
2607    /// Sets the value of [page_token][crate::model::SearchProjectsRequest::page_token].
2608    ///
2609    /// # Example
2610    /// ```ignore,no_run
2611    /// # use google_cloud_resourcemanager_v3::model::SearchProjectsRequest;
2612    /// let x = SearchProjectsRequest::new().set_page_token("example");
2613    /// ```
2614    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2615        self.page_token = v.into();
2616        self
2617    }
2618
2619    /// Sets the value of [page_size][crate::model::SearchProjectsRequest::page_size].
2620    ///
2621    /// # Example
2622    /// ```ignore,no_run
2623    /// # use google_cloud_resourcemanager_v3::model::SearchProjectsRequest;
2624    /// let x = SearchProjectsRequest::new().set_page_size(42);
2625    /// ```
2626    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2627        self.page_size = v.into();
2628        self
2629    }
2630}
2631
2632impl wkt::message::Message for SearchProjectsRequest {
2633    fn typename() -> &'static str {
2634        "type.googleapis.com/google.cloud.resourcemanager.v3.SearchProjectsRequest"
2635    }
2636}
2637
2638/// A page of the response received from the
2639/// [SearchProjects][google.cloud.resourcemanager.v3.Projects.SearchProjects]
2640/// method.
2641///
2642/// A paginated response where more pages are available has
2643/// `next_page_token` set. This token can be used in a subsequent request to
2644/// retrieve the next request page.
2645///
2646/// [google.cloud.resourcemanager.v3.Projects.SearchProjects]: crate::client::Projects::search_projects
2647#[derive(Clone, Default, PartialEq)]
2648#[non_exhaustive]
2649pub struct SearchProjectsResponse {
2650    /// The list of Projects that matched the list filter query. This list can
2651    /// be paginated.
2652    pub projects: std::vec::Vec<crate::model::Project>,
2653
2654    /// Pagination token.
2655    ///
2656    /// If the result set is too large to fit in a single response, this token
2657    /// is returned. It encodes the position of the current result cursor.
2658    /// Feeding this value into a new list request with the `page_token` parameter
2659    /// gives the next page of the results.
2660    ///
2661    /// When `next_page_token` is not filled in, there is no next page and
2662    /// the list returned is the last page in the result set.
2663    ///
2664    /// Pagination tokens have a limited lifetime.
2665    pub next_page_token: std::string::String,
2666
2667    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2668}
2669
2670impl SearchProjectsResponse {
2671    pub fn new() -> Self {
2672        std::default::Default::default()
2673    }
2674
2675    /// Sets the value of [projects][crate::model::SearchProjectsResponse::projects].
2676    ///
2677    /// # Example
2678    /// ```ignore,no_run
2679    /// # use google_cloud_resourcemanager_v3::model::SearchProjectsResponse;
2680    /// use google_cloud_resourcemanager_v3::model::Project;
2681    /// let x = SearchProjectsResponse::new()
2682    ///     .set_projects([
2683    ///         Project::default()/* use setters */,
2684    ///         Project::default()/* use (different) setters */,
2685    ///     ]);
2686    /// ```
2687    pub fn set_projects<T, V>(mut self, v: T) -> Self
2688    where
2689        T: std::iter::IntoIterator<Item = V>,
2690        V: std::convert::Into<crate::model::Project>,
2691    {
2692        use std::iter::Iterator;
2693        self.projects = v.into_iter().map(|i| i.into()).collect();
2694        self
2695    }
2696
2697    /// Sets the value of [next_page_token][crate::model::SearchProjectsResponse::next_page_token].
2698    ///
2699    /// # Example
2700    /// ```ignore,no_run
2701    /// # use google_cloud_resourcemanager_v3::model::SearchProjectsResponse;
2702    /// let x = SearchProjectsResponse::new().set_next_page_token("example");
2703    /// ```
2704    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2705        self.next_page_token = v.into();
2706        self
2707    }
2708}
2709
2710impl wkt::message::Message for SearchProjectsResponse {
2711    fn typename() -> &'static str {
2712        "type.googleapis.com/google.cloud.resourcemanager.v3.SearchProjectsResponse"
2713    }
2714}
2715
2716#[doc(hidden)]
2717impl google_cloud_gax::paginator::internal::PageableResponse for SearchProjectsResponse {
2718    type PageItem = crate::model::Project;
2719
2720    fn items(self) -> std::vec::Vec<Self::PageItem> {
2721        self.projects
2722    }
2723
2724    fn next_page_token(&self) -> std::string::String {
2725        use std::clone::Clone;
2726        self.next_page_token.clone()
2727    }
2728}
2729
2730/// The request sent to the
2731/// [CreateProject][google.cloud.resourcemanager.v3.Projects.CreateProject]
2732/// method.
2733///
2734/// [google.cloud.resourcemanager.v3.Projects.CreateProject]: crate::client::Projects::create_project
2735#[derive(Clone, Default, PartialEq)]
2736#[non_exhaustive]
2737pub struct CreateProjectRequest {
2738    /// Required. The Project to create.
2739    ///
2740    /// Project ID is required. If the requested ID is unavailable, the request
2741    /// fails.
2742    ///
2743    /// If the `parent` field is set, the `resourcemanager.projects.create`
2744    /// permission is checked on the parent resource. If no parent is set and
2745    /// the authorization credentials belong to an Organization, the parent
2746    /// will be set to that Organization.
2747    pub project: std::option::Option<crate::model::Project>,
2748
2749    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2750}
2751
2752impl CreateProjectRequest {
2753    pub fn new() -> Self {
2754        std::default::Default::default()
2755    }
2756
2757    /// Sets the value of [project][crate::model::CreateProjectRequest::project].
2758    ///
2759    /// # Example
2760    /// ```ignore,no_run
2761    /// # use google_cloud_resourcemanager_v3::model::CreateProjectRequest;
2762    /// use google_cloud_resourcemanager_v3::model::Project;
2763    /// let x = CreateProjectRequest::new().set_project(Project::default()/* use setters */);
2764    /// ```
2765    pub fn set_project<T>(mut self, v: T) -> Self
2766    where
2767        T: std::convert::Into<crate::model::Project>,
2768    {
2769        self.project = std::option::Option::Some(v.into());
2770        self
2771    }
2772
2773    /// Sets or clears the value of [project][crate::model::CreateProjectRequest::project].
2774    ///
2775    /// # Example
2776    /// ```ignore,no_run
2777    /// # use google_cloud_resourcemanager_v3::model::CreateProjectRequest;
2778    /// use google_cloud_resourcemanager_v3::model::Project;
2779    /// let x = CreateProjectRequest::new().set_or_clear_project(Some(Project::default()/* use setters */));
2780    /// let x = CreateProjectRequest::new().set_or_clear_project(None::<Project>);
2781    /// ```
2782    pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2783    where
2784        T: std::convert::Into<crate::model::Project>,
2785    {
2786        self.project = v.map(|x| x.into());
2787        self
2788    }
2789}
2790
2791impl wkt::message::Message for CreateProjectRequest {
2792    fn typename() -> &'static str {
2793        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateProjectRequest"
2794    }
2795}
2796
2797/// A status object which is used as the `metadata` field for the Operation
2798/// returned by CreateProject. It provides insight for when significant phases of
2799/// Project creation have completed.
2800#[derive(Clone, Default, PartialEq)]
2801#[non_exhaustive]
2802pub struct CreateProjectMetadata {
2803    /// Creation time of the project creation workflow.
2804    pub create_time: std::option::Option<wkt::Timestamp>,
2805
2806    /// True if the project can be retrieved using `GetProject`. No other
2807    /// operations on the project are guaranteed to work until the project creation
2808    /// is complete.
2809    pub gettable: bool,
2810
2811    /// True if the project creation process is complete.
2812    pub ready: bool,
2813
2814    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2815}
2816
2817impl CreateProjectMetadata {
2818    pub fn new() -> Self {
2819        std::default::Default::default()
2820    }
2821
2822    /// Sets the value of [create_time][crate::model::CreateProjectMetadata::create_time].
2823    ///
2824    /// # Example
2825    /// ```ignore,no_run
2826    /// # use google_cloud_resourcemanager_v3::model::CreateProjectMetadata;
2827    /// use wkt::Timestamp;
2828    /// let x = CreateProjectMetadata::new().set_create_time(Timestamp::default()/* use setters */);
2829    /// ```
2830    pub fn set_create_time<T>(mut self, v: T) -> Self
2831    where
2832        T: std::convert::Into<wkt::Timestamp>,
2833    {
2834        self.create_time = std::option::Option::Some(v.into());
2835        self
2836    }
2837
2838    /// Sets or clears the value of [create_time][crate::model::CreateProjectMetadata::create_time].
2839    ///
2840    /// # Example
2841    /// ```ignore,no_run
2842    /// # use google_cloud_resourcemanager_v3::model::CreateProjectMetadata;
2843    /// use wkt::Timestamp;
2844    /// let x = CreateProjectMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2845    /// let x = CreateProjectMetadata::new().set_or_clear_create_time(None::<Timestamp>);
2846    /// ```
2847    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2848    where
2849        T: std::convert::Into<wkt::Timestamp>,
2850    {
2851        self.create_time = v.map(|x| x.into());
2852        self
2853    }
2854
2855    /// Sets the value of [gettable][crate::model::CreateProjectMetadata::gettable].
2856    ///
2857    /// # Example
2858    /// ```ignore,no_run
2859    /// # use google_cloud_resourcemanager_v3::model::CreateProjectMetadata;
2860    /// let x = CreateProjectMetadata::new().set_gettable(true);
2861    /// ```
2862    pub fn set_gettable<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2863        self.gettable = v.into();
2864        self
2865    }
2866
2867    /// Sets the value of [ready][crate::model::CreateProjectMetadata::ready].
2868    ///
2869    /// # Example
2870    /// ```ignore,no_run
2871    /// # use google_cloud_resourcemanager_v3::model::CreateProjectMetadata;
2872    /// let x = CreateProjectMetadata::new().set_ready(true);
2873    /// ```
2874    pub fn set_ready<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2875        self.ready = v.into();
2876        self
2877    }
2878}
2879
2880impl wkt::message::Message for CreateProjectMetadata {
2881    fn typename() -> &'static str {
2882        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateProjectMetadata"
2883    }
2884}
2885
2886/// The request sent to the
2887/// [UpdateProject][google.cloud.resourcemanager.v3.Projects.UpdateProject]
2888/// method.
2889///
2890/// Only the `display_name` and `labels` fields can be change. Use the
2891/// [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject] method to
2892/// change the `parent` field.
2893///
2894/// [google.cloud.resourcemanager.v3.Projects.MoveProject]: crate::client::Projects::move_project
2895/// [google.cloud.resourcemanager.v3.Projects.UpdateProject]: crate::client::Projects::update_project
2896#[derive(Clone, Default, PartialEq)]
2897#[non_exhaustive]
2898pub struct UpdateProjectRequest {
2899    /// Required. The new definition of the project.
2900    pub project: std::option::Option<crate::model::Project>,
2901
2902    /// Optional. An update mask to selectively update fields.
2903    pub update_mask: std::option::Option<wkt::FieldMask>,
2904
2905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2906}
2907
2908impl UpdateProjectRequest {
2909    pub fn new() -> Self {
2910        std::default::Default::default()
2911    }
2912
2913    /// Sets the value of [project][crate::model::UpdateProjectRequest::project].
2914    ///
2915    /// # Example
2916    /// ```ignore,no_run
2917    /// # use google_cloud_resourcemanager_v3::model::UpdateProjectRequest;
2918    /// use google_cloud_resourcemanager_v3::model::Project;
2919    /// let x = UpdateProjectRequest::new().set_project(Project::default()/* use setters */);
2920    /// ```
2921    pub fn set_project<T>(mut self, v: T) -> Self
2922    where
2923        T: std::convert::Into<crate::model::Project>,
2924    {
2925        self.project = std::option::Option::Some(v.into());
2926        self
2927    }
2928
2929    /// Sets or clears the value of [project][crate::model::UpdateProjectRequest::project].
2930    ///
2931    /// # Example
2932    /// ```ignore,no_run
2933    /// # use google_cloud_resourcemanager_v3::model::UpdateProjectRequest;
2934    /// use google_cloud_resourcemanager_v3::model::Project;
2935    /// let x = UpdateProjectRequest::new().set_or_clear_project(Some(Project::default()/* use setters */));
2936    /// let x = UpdateProjectRequest::new().set_or_clear_project(None::<Project>);
2937    /// ```
2938    pub fn set_or_clear_project<T>(mut self, v: std::option::Option<T>) -> Self
2939    where
2940        T: std::convert::Into<crate::model::Project>,
2941    {
2942        self.project = v.map(|x| x.into());
2943        self
2944    }
2945
2946    /// Sets the value of [update_mask][crate::model::UpdateProjectRequest::update_mask].
2947    ///
2948    /// # Example
2949    /// ```ignore,no_run
2950    /// # use google_cloud_resourcemanager_v3::model::UpdateProjectRequest;
2951    /// use wkt::FieldMask;
2952    /// let x = UpdateProjectRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2953    /// ```
2954    pub fn set_update_mask<T>(mut self, v: T) -> Self
2955    where
2956        T: std::convert::Into<wkt::FieldMask>,
2957    {
2958        self.update_mask = std::option::Option::Some(v.into());
2959        self
2960    }
2961
2962    /// Sets or clears the value of [update_mask][crate::model::UpdateProjectRequest::update_mask].
2963    ///
2964    /// # Example
2965    /// ```ignore,no_run
2966    /// # use google_cloud_resourcemanager_v3::model::UpdateProjectRequest;
2967    /// use wkt::FieldMask;
2968    /// let x = UpdateProjectRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2969    /// let x = UpdateProjectRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2970    /// ```
2971    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2972    where
2973        T: std::convert::Into<wkt::FieldMask>,
2974    {
2975        self.update_mask = v.map(|x| x.into());
2976        self
2977    }
2978}
2979
2980impl wkt::message::Message for UpdateProjectRequest {
2981    fn typename() -> &'static str {
2982        "type.googleapis.com/google.cloud.resourcemanager.v3.UpdateProjectRequest"
2983    }
2984}
2985
2986/// A status object which is used as the `metadata` field for the Operation
2987/// returned by UpdateProject.
2988#[derive(Clone, Default, PartialEq)]
2989#[non_exhaustive]
2990pub struct UpdateProjectMetadata {
2991    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2992}
2993
2994impl UpdateProjectMetadata {
2995    pub fn new() -> Self {
2996        std::default::Default::default()
2997    }
2998}
2999
3000impl wkt::message::Message for UpdateProjectMetadata {
3001    fn typename() -> &'static str {
3002        "type.googleapis.com/google.cloud.resourcemanager.v3.UpdateProjectMetadata"
3003    }
3004}
3005
3006/// The request sent to
3007/// [MoveProject][google.cloud.resourcemanager.v3.Projects.MoveProject]
3008/// method.
3009///
3010/// [google.cloud.resourcemanager.v3.Projects.MoveProject]: crate::client::Projects::move_project
3011#[derive(Clone, Default, PartialEq)]
3012#[non_exhaustive]
3013pub struct MoveProjectRequest {
3014    /// Required. The name of the project to move.
3015    pub name: std::string::String,
3016
3017    /// Required. The new parent to move the Project under.
3018    pub destination_parent: std::string::String,
3019
3020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3021}
3022
3023impl MoveProjectRequest {
3024    pub fn new() -> Self {
3025        std::default::Default::default()
3026    }
3027
3028    /// Sets the value of [name][crate::model::MoveProjectRequest::name].
3029    ///
3030    /// # Example
3031    /// ```ignore,no_run
3032    /// # use google_cloud_resourcemanager_v3::model::MoveProjectRequest;
3033    /// let x = MoveProjectRequest::new().set_name("example");
3034    /// ```
3035    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3036        self.name = v.into();
3037        self
3038    }
3039
3040    /// Sets the value of [destination_parent][crate::model::MoveProjectRequest::destination_parent].
3041    ///
3042    /// # Example
3043    /// ```ignore,no_run
3044    /// # use google_cloud_resourcemanager_v3::model::MoveProjectRequest;
3045    /// let x = MoveProjectRequest::new().set_destination_parent("example");
3046    /// ```
3047    pub fn set_destination_parent<T: std::convert::Into<std::string::String>>(
3048        mut self,
3049        v: T,
3050    ) -> Self {
3051        self.destination_parent = v.into();
3052        self
3053    }
3054}
3055
3056impl wkt::message::Message for MoveProjectRequest {
3057    fn typename() -> &'static str {
3058        "type.googleapis.com/google.cloud.resourcemanager.v3.MoveProjectRequest"
3059    }
3060}
3061
3062/// A status object which is used as the `metadata` field for the Operation
3063/// returned by MoveProject.
3064#[derive(Clone, Default, PartialEq)]
3065#[non_exhaustive]
3066pub struct MoveProjectMetadata {
3067    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3068}
3069
3070impl MoveProjectMetadata {
3071    pub fn new() -> Self {
3072        std::default::Default::default()
3073    }
3074}
3075
3076impl wkt::message::Message for MoveProjectMetadata {
3077    fn typename() -> &'static str {
3078        "type.googleapis.com/google.cloud.resourcemanager.v3.MoveProjectMetadata"
3079    }
3080}
3081
3082/// [DeleteProject][google.cloud.resourcemanager.v3.Projects.DeleteProject]
3083/// method.
3084///
3085/// [google.cloud.resourcemanager.v3.Projects.DeleteProject]: crate::client::Projects::delete_project
3086#[derive(Clone, Default, PartialEq)]
3087#[non_exhaustive]
3088pub struct DeleteProjectRequest {
3089    /// Required. The name of the Project (for example, `projects/415104041262`).
3090    pub name: std::string::String,
3091
3092    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3093}
3094
3095impl DeleteProjectRequest {
3096    pub fn new() -> Self {
3097        std::default::Default::default()
3098    }
3099
3100    /// Sets the value of [name][crate::model::DeleteProjectRequest::name].
3101    ///
3102    /// # Example
3103    /// ```ignore,no_run
3104    /// # use google_cloud_resourcemanager_v3::model::DeleteProjectRequest;
3105    /// let x = DeleteProjectRequest::new().set_name("example");
3106    /// ```
3107    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3108        self.name = v.into();
3109        self
3110    }
3111}
3112
3113impl wkt::message::Message for DeleteProjectRequest {
3114    fn typename() -> &'static str {
3115        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteProjectRequest"
3116    }
3117}
3118
3119/// A status object which is used as the `metadata` field for the Operation
3120/// returned by `DeleteProject`.
3121#[derive(Clone, Default, PartialEq)]
3122#[non_exhaustive]
3123pub struct DeleteProjectMetadata {
3124    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3125}
3126
3127impl DeleteProjectMetadata {
3128    pub fn new() -> Self {
3129        std::default::Default::default()
3130    }
3131}
3132
3133impl wkt::message::Message for DeleteProjectMetadata {
3134    fn typename() -> &'static str {
3135        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteProjectMetadata"
3136    }
3137}
3138
3139/// The request sent to the [UndeleteProject]
3140/// [google.cloud.resourcemanager.v3.Projects.UndeleteProject]
3141/// method.
3142#[derive(Clone, Default, PartialEq)]
3143#[non_exhaustive]
3144pub struct UndeleteProjectRequest {
3145    /// Required. The name of the project (for example, `projects/415104041262`).
3146    ///
3147    /// Required.
3148    pub name: std::string::String,
3149
3150    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3151}
3152
3153impl UndeleteProjectRequest {
3154    pub fn new() -> Self {
3155        std::default::Default::default()
3156    }
3157
3158    /// Sets the value of [name][crate::model::UndeleteProjectRequest::name].
3159    ///
3160    /// # Example
3161    /// ```ignore,no_run
3162    /// # use google_cloud_resourcemanager_v3::model::UndeleteProjectRequest;
3163    /// let x = UndeleteProjectRequest::new().set_name("example");
3164    /// ```
3165    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3166        self.name = v.into();
3167        self
3168    }
3169}
3170
3171impl wkt::message::Message for UndeleteProjectRequest {
3172    fn typename() -> &'static str {
3173        "type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteProjectRequest"
3174    }
3175}
3176
3177/// A status object which is used as the `metadata` field for the Operation
3178/// returned by `UndeleteProject`.
3179#[derive(Clone, Default, PartialEq)]
3180#[non_exhaustive]
3181pub struct UndeleteProjectMetadata {
3182    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3183}
3184
3185impl UndeleteProjectMetadata {
3186    pub fn new() -> Self {
3187        std::default::Default::default()
3188    }
3189}
3190
3191impl wkt::message::Message for UndeleteProjectMetadata {
3192    fn typename() -> &'static str {
3193        "type.googleapis.com/google.cloud.resourcemanager.v3.UndeleteProjectMetadata"
3194    }
3195}
3196
3197/// A TagBinding represents a connection between a TagValue and a cloud
3198/// resource Once a TagBinding is created, the TagValue is applied to all the
3199/// descendants of the Google Cloud resource.
3200#[derive(Clone, Default, PartialEq)]
3201#[non_exhaustive]
3202pub struct TagBinding {
3203    /// Output only. The name of the TagBinding. This is a String of the form:
3204    /// `tagBindings/{full-resource-name}/{tag-value-name}` (e.g.
3205    /// `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`).
3206    pub name: std::string::String,
3207
3208    /// The full resource name of the resource the TagValue is bound to.
3209    /// E.g. `//cloudresourcemanager.googleapis.com/projects/123`
3210    pub parent: std::string::String,
3211
3212    /// The TagValue of the TagBinding.
3213    /// Must be of the form `tagValues/456`.
3214    pub tag_value: std::string::String,
3215
3216    /// The namespaced name for the TagValue of the TagBinding.
3217    /// Must be in the format
3218    /// `{parent_id}/{tag_key_short_name}/{short_name}`.
3219    ///
3220    /// For methods that support TagValue namespaced name, only one of
3221    /// tag_value_namespaced_name or tag_value may be filled. Requests with both
3222    /// fields will be rejected.
3223    pub tag_value_namespaced_name: std::string::String,
3224
3225    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3226}
3227
3228impl TagBinding {
3229    pub fn new() -> Self {
3230        std::default::Default::default()
3231    }
3232
3233    /// Sets the value of [name][crate::model::TagBinding::name].
3234    ///
3235    /// # Example
3236    /// ```ignore,no_run
3237    /// # use google_cloud_resourcemanager_v3::model::TagBinding;
3238    /// let x = TagBinding::new().set_name("example");
3239    /// ```
3240    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3241        self.name = v.into();
3242        self
3243    }
3244
3245    /// Sets the value of [parent][crate::model::TagBinding::parent].
3246    ///
3247    /// # Example
3248    /// ```ignore,no_run
3249    /// # use google_cloud_resourcemanager_v3::model::TagBinding;
3250    /// let x = TagBinding::new().set_parent("example");
3251    /// ```
3252    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3253        self.parent = v.into();
3254        self
3255    }
3256
3257    /// Sets the value of [tag_value][crate::model::TagBinding::tag_value].
3258    ///
3259    /// # Example
3260    /// ```ignore,no_run
3261    /// # use google_cloud_resourcemanager_v3::model::TagBinding;
3262    /// let x = TagBinding::new().set_tag_value("example");
3263    /// ```
3264    pub fn set_tag_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3265        self.tag_value = v.into();
3266        self
3267    }
3268
3269    /// Sets the value of [tag_value_namespaced_name][crate::model::TagBinding::tag_value_namespaced_name].
3270    ///
3271    /// # Example
3272    /// ```ignore,no_run
3273    /// # use google_cloud_resourcemanager_v3::model::TagBinding;
3274    /// let x = TagBinding::new().set_tag_value_namespaced_name("example");
3275    /// ```
3276    pub fn set_tag_value_namespaced_name<T: std::convert::Into<std::string::String>>(
3277        mut self,
3278        v: T,
3279    ) -> Self {
3280        self.tag_value_namespaced_name = v.into();
3281        self
3282    }
3283}
3284
3285impl wkt::message::Message for TagBinding {
3286    fn typename() -> &'static str {
3287        "type.googleapis.com/google.cloud.resourcemanager.v3.TagBinding"
3288    }
3289}
3290
3291/// Runtime operation information for creating a TagValue.
3292#[derive(Clone, Default, PartialEq)]
3293#[non_exhaustive]
3294pub struct CreateTagBindingMetadata {
3295    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3296}
3297
3298impl CreateTagBindingMetadata {
3299    pub fn new() -> Self {
3300        std::default::Default::default()
3301    }
3302}
3303
3304impl wkt::message::Message for CreateTagBindingMetadata {
3305    fn typename() -> &'static str {
3306        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagBindingMetadata"
3307    }
3308}
3309
3310/// The request message to create a TagBinding.
3311#[derive(Clone, Default, PartialEq)]
3312#[non_exhaustive]
3313pub struct CreateTagBindingRequest {
3314    /// Required. The TagBinding to be created.
3315    pub tag_binding: std::option::Option<crate::model::TagBinding>,
3316
3317    /// Optional. Set to true to perform the validations necessary for creating the
3318    /// resource, but not actually perform the action.
3319    pub validate_only: bool,
3320
3321    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3322}
3323
3324impl CreateTagBindingRequest {
3325    pub fn new() -> Self {
3326        std::default::Default::default()
3327    }
3328
3329    /// Sets the value of [tag_binding][crate::model::CreateTagBindingRequest::tag_binding].
3330    ///
3331    /// # Example
3332    /// ```ignore,no_run
3333    /// # use google_cloud_resourcemanager_v3::model::CreateTagBindingRequest;
3334    /// use google_cloud_resourcemanager_v3::model::TagBinding;
3335    /// let x = CreateTagBindingRequest::new().set_tag_binding(TagBinding::default()/* use setters */);
3336    /// ```
3337    pub fn set_tag_binding<T>(mut self, v: T) -> Self
3338    where
3339        T: std::convert::Into<crate::model::TagBinding>,
3340    {
3341        self.tag_binding = std::option::Option::Some(v.into());
3342        self
3343    }
3344
3345    /// Sets or clears the value of [tag_binding][crate::model::CreateTagBindingRequest::tag_binding].
3346    ///
3347    /// # Example
3348    /// ```ignore,no_run
3349    /// # use google_cloud_resourcemanager_v3::model::CreateTagBindingRequest;
3350    /// use google_cloud_resourcemanager_v3::model::TagBinding;
3351    /// let x = CreateTagBindingRequest::new().set_or_clear_tag_binding(Some(TagBinding::default()/* use setters */));
3352    /// let x = CreateTagBindingRequest::new().set_or_clear_tag_binding(None::<TagBinding>);
3353    /// ```
3354    pub fn set_or_clear_tag_binding<T>(mut self, v: std::option::Option<T>) -> Self
3355    where
3356        T: std::convert::Into<crate::model::TagBinding>,
3357    {
3358        self.tag_binding = v.map(|x| x.into());
3359        self
3360    }
3361
3362    /// Sets the value of [validate_only][crate::model::CreateTagBindingRequest::validate_only].
3363    ///
3364    /// # Example
3365    /// ```ignore,no_run
3366    /// # use google_cloud_resourcemanager_v3::model::CreateTagBindingRequest;
3367    /// let x = CreateTagBindingRequest::new().set_validate_only(true);
3368    /// ```
3369    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3370        self.validate_only = v.into();
3371        self
3372    }
3373}
3374
3375impl wkt::message::Message for CreateTagBindingRequest {
3376    fn typename() -> &'static str {
3377        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagBindingRequest"
3378    }
3379}
3380
3381/// Runtime operation information for deleting a TagBinding.
3382#[derive(Clone, Default, PartialEq)]
3383#[non_exhaustive]
3384pub struct DeleteTagBindingMetadata {
3385    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3386}
3387
3388impl DeleteTagBindingMetadata {
3389    pub fn new() -> Self {
3390        std::default::Default::default()
3391    }
3392}
3393
3394impl wkt::message::Message for DeleteTagBindingMetadata {
3395    fn typename() -> &'static str {
3396        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagBindingMetadata"
3397    }
3398}
3399
3400/// The request message to delete a TagBinding.
3401#[derive(Clone, Default, PartialEq)]
3402#[non_exhaustive]
3403pub struct DeleteTagBindingRequest {
3404    /// Required. The name of the TagBinding. This is a String of the form:
3405    /// `tagBindings/{id}` (e.g.
3406    /// `tagBindings/%2F%2Fcloudresourcemanager.googleapis.com%2Fprojects%2F123/tagValues/456`).
3407    pub name: std::string::String,
3408
3409    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3410}
3411
3412impl DeleteTagBindingRequest {
3413    pub fn new() -> Self {
3414        std::default::Default::default()
3415    }
3416
3417    /// Sets the value of [name][crate::model::DeleteTagBindingRequest::name].
3418    ///
3419    /// # Example
3420    /// ```ignore,no_run
3421    /// # use google_cloud_resourcemanager_v3::model::DeleteTagBindingRequest;
3422    /// let x = DeleteTagBindingRequest::new().set_name("example");
3423    /// ```
3424    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3425        self.name = v.into();
3426        self
3427    }
3428}
3429
3430impl wkt::message::Message for DeleteTagBindingRequest {
3431    fn typename() -> &'static str {
3432        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagBindingRequest"
3433    }
3434}
3435
3436/// The request message to list all TagBindings for a parent.
3437#[derive(Clone, Default, PartialEq)]
3438#[non_exhaustive]
3439pub struct ListTagBindingsRequest {
3440    /// Required. The full resource name of a resource for which you want to list
3441    /// existing TagBindings. E.g.
3442    /// "//cloudresourcemanager.googleapis.com/projects/123"
3443    pub parent: std::string::String,
3444
3445    /// Optional. The maximum number of TagBindings to return in the response. The
3446    /// server allows a maximum of 300 TagBindings to return. If unspecified, the
3447    /// server will use 100 as the default.
3448    pub page_size: i32,
3449
3450    /// Optional. A pagination token returned from a previous call to
3451    /// `ListTagBindings` that indicates where this listing should continue from.
3452    pub page_token: std::string::String,
3453
3454    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3455}
3456
3457impl ListTagBindingsRequest {
3458    pub fn new() -> Self {
3459        std::default::Default::default()
3460    }
3461
3462    /// Sets the value of [parent][crate::model::ListTagBindingsRequest::parent].
3463    ///
3464    /// # Example
3465    /// ```ignore,no_run
3466    /// # use google_cloud_resourcemanager_v3::model::ListTagBindingsRequest;
3467    /// let x = ListTagBindingsRequest::new().set_parent("example");
3468    /// ```
3469    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3470        self.parent = v.into();
3471        self
3472    }
3473
3474    /// Sets the value of [page_size][crate::model::ListTagBindingsRequest::page_size].
3475    ///
3476    /// # Example
3477    /// ```ignore,no_run
3478    /// # use google_cloud_resourcemanager_v3::model::ListTagBindingsRequest;
3479    /// let x = ListTagBindingsRequest::new().set_page_size(42);
3480    /// ```
3481    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3482        self.page_size = v.into();
3483        self
3484    }
3485
3486    /// Sets the value of [page_token][crate::model::ListTagBindingsRequest::page_token].
3487    ///
3488    /// # Example
3489    /// ```ignore,no_run
3490    /// # use google_cloud_resourcemanager_v3::model::ListTagBindingsRequest;
3491    /// let x = ListTagBindingsRequest::new().set_page_token("example");
3492    /// ```
3493    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3494        self.page_token = v.into();
3495        self
3496    }
3497}
3498
3499impl wkt::message::Message for ListTagBindingsRequest {
3500    fn typename() -> &'static str {
3501        "type.googleapis.com/google.cloud.resourcemanager.v3.ListTagBindingsRequest"
3502    }
3503}
3504
3505/// The ListTagBindings response.
3506#[derive(Clone, Default, PartialEq)]
3507#[non_exhaustive]
3508pub struct ListTagBindingsResponse {
3509    /// A possibly paginated list of TagBindings for the specified resource.
3510    pub tag_bindings: std::vec::Vec<crate::model::TagBinding>,
3511
3512    /// Pagination token.
3513    ///
3514    /// If the result set is too large to fit in a single response, this token
3515    /// is returned. It encodes the position of the current result cursor.
3516    /// Feeding this value into a new list request with the `page_token` parameter
3517    /// gives the next page of the results.
3518    ///
3519    /// When `next_page_token` is not filled in, there is no next page and
3520    /// the list returned is the last page in the result set.
3521    ///
3522    /// Pagination tokens have a limited lifetime.
3523    pub next_page_token: std::string::String,
3524
3525    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3526}
3527
3528impl ListTagBindingsResponse {
3529    pub fn new() -> Self {
3530        std::default::Default::default()
3531    }
3532
3533    /// Sets the value of [tag_bindings][crate::model::ListTagBindingsResponse::tag_bindings].
3534    ///
3535    /// # Example
3536    /// ```ignore,no_run
3537    /// # use google_cloud_resourcemanager_v3::model::ListTagBindingsResponse;
3538    /// use google_cloud_resourcemanager_v3::model::TagBinding;
3539    /// let x = ListTagBindingsResponse::new()
3540    ///     .set_tag_bindings([
3541    ///         TagBinding::default()/* use setters */,
3542    ///         TagBinding::default()/* use (different) setters */,
3543    ///     ]);
3544    /// ```
3545    pub fn set_tag_bindings<T, V>(mut self, v: T) -> Self
3546    where
3547        T: std::iter::IntoIterator<Item = V>,
3548        V: std::convert::Into<crate::model::TagBinding>,
3549    {
3550        use std::iter::Iterator;
3551        self.tag_bindings = v.into_iter().map(|i| i.into()).collect();
3552        self
3553    }
3554
3555    /// Sets the value of [next_page_token][crate::model::ListTagBindingsResponse::next_page_token].
3556    ///
3557    /// # Example
3558    /// ```ignore,no_run
3559    /// # use google_cloud_resourcemanager_v3::model::ListTagBindingsResponse;
3560    /// let x = ListTagBindingsResponse::new().set_next_page_token("example");
3561    /// ```
3562    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3563        self.next_page_token = v.into();
3564        self
3565    }
3566}
3567
3568impl wkt::message::Message for ListTagBindingsResponse {
3569    fn typename() -> &'static str {
3570        "type.googleapis.com/google.cloud.resourcemanager.v3.ListTagBindingsResponse"
3571    }
3572}
3573
3574#[doc(hidden)]
3575impl google_cloud_gax::paginator::internal::PageableResponse for ListTagBindingsResponse {
3576    type PageItem = crate::model::TagBinding;
3577
3578    fn items(self) -> std::vec::Vec<Self::PageItem> {
3579        self.tag_bindings
3580    }
3581
3582    fn next_page_token(&self) -> std::string::String {
3583        use std::clone::Clone;
3584        self.next_page_token.clone()
3585    }
3586}
3587
3588/// The request message to ListEffectiveTags
3589#[derive(Clone, Default, PartialEq)]
3590#[non_exhaustive]
3591pub struct ListEffectiveTagsRequest {
3592    /// Required. The full resource name of a resource for which you want to list
3593    /// the effective tags. E.g.
3594    /// "//cloudresourcemanager.googleapis.com/projects/123"
3595    pub parent: std::string::String,
3596
3597    /// Optional. The maximum number of effective tags to return in the response.
3598    /// The server allows a maximum of 300 effective tags to return in a single
3599    /// page. If unspecified, the server will use 100 as the default.
3600    pub page_size: i32,
3601
3602    /// Optional. A pagination token returned from a previous call to
3603    /// `ListEffectiveTags` that indicates from where this listing should continue.
3604    pub page_token: std::string::String,
3605
3606    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3607}
3608
3609impl ListEffectiveTagsRequest {
3610    pub fn new() -> Self {
3611        std::default::Default::default()
3612    }
3613
3614    /// Sets the value of [parent][crate::model::ListEffectiveTagsRequest::parent].
3615    ///
3616    /// # Example
3617    /// ```ignore,no_run
3618    /// # use google_cloud_resourcemanager_v3::model::ListEffectiveTagsRequest;
3619    /// let x = ListEffectiveTagsRequest::new().set_parent("example");
3620    /// ```
3621    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3622        self.parent = v.into();
3623        self
3624    }
3625
3626    /// Sets the value of [page_size][crate::model::ListEffectiveTagsRequest::page_size].
3627    ///
3628    /// # Example
3629    /// ```ignore,no_run
3630    /// # use google_cloud_resourcemanager_v3::model::ListEffectiveTagsRequest;
3631    /// let x = ListEffectiveTagsRequest::new().set_page_size(42);
3632    /// ```
3633    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3634        self.page_size = v.into();
3635        self
3636    }
3637
3638    /// Sets the value of [page_token][crate::model::ListEffectiveTagsRequest::page_token].
3639    ///
3640    /// # Example
3641    /// ```ignore,no_run
3642    /// # use google_cloud_resourcemanager_v3::model::ListEffectiveTagsRequest;
3643    /// let x = ListEffectiveTagsRequest::new().set_page_token("example");
3644    /// ```
3645    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3646        self.page_token = v.into();
3647        self
3648    }
3649}
3650
3651impl wkt::message::Message for ListEffectiveTagsRequest {
3652    fn typename() -> &'static str {
3653        "type.googleapis.com/google.cloud.resourcemanager.v3.ListEffectiveTagsRequest"
3654    }
3655}
3656
3657/// The response of ListEffectiveTags.
3658#[derive(Clone, Default, PartialEq)]
3659#[non_exhaustive]
3660pub struct ListEffectiveTagsResponse {
3661    /// A possibly paginated list of effective tags for the specified resource.
3662    pub effective_tags: std::vec::Vec<crate::model::EffectiveTag>,
3663
3664    /// Pagination token.
3665    ///
3666    /// If the result set is too large to fit in a single response, this token
3667    /// is returned. It encodes the position of the current result cursor.
3668    /// Feeding this value into a new list request with the `page_token` parameter
3669    /// gives the next page of the results.
3670    ///
3671    /// When `next_page_token` is not filled in, there is no next page and
3672    /// the list returned is the last page in the result set.
3673    ///
3674    /// Pagination tokens have a limited lifetime.
3675    pub next_page_token: std::string::String,
3676
3677    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3678}
3679
3680impl ListEffectiveTagsResponse {
3681    pub fn new() -> Self {
3682        std::default::Default::default()
3683    }
3684
3685    /// Sets the value of [effective_tags][crate::model::ListEffectiveTagsResponse::effective_tags].
3686    ///
3687    /// # Example
3688    /// ```ignore,no_run
3689    /// # use google_cloud_resourcemanager_v3::model::ListEffectiveTagsResponse;
3690    /// use google_cloud_resourcemanager_v3::model::EffectiveTag;
3691    /// let x = ListEffectiveTagsResponse::new()
3692    ///     .set_effective_tags([
3693    ///         EffectiveTag::default()/* use setters */,
3694    ///         EffectiveTag::default()/* use (different) setters */,
3695    ///     ]);
3696    /// ```
3697    pub fn set_effective_tags<T, V>(mut self, v: T) -> Self
3698    where
3699        T: std::iter::IntoIterator<Item = V>,
3700        V: std::convert::Into<crate::model::EffectiveTag>,
3701    {
3702        use std::iter::Iterator;
3703        self.effective_tags = v.into_iter().map(|i| i.into()).collect();
3704        self
3705    }
3706
3707    /// Sets the value of [next_page_token][crate::model::ListEffectiveTagsResponse::next_page_token].
3708    ///
3709    /// # Example
3710    /// ```ignore,no_run
3711    /// # use google_cloud_resourcemanager_v3::model::ListEffectiveTagsResponse;
3712    /// let x = ListEffectiveTagsResponse::new().set_next_page_token("example");
3713    /// ```
3714    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3715        self.next_page_token = v.into();
3716        self
3717    }
3718}
3719
3720impl wkt::message::Message for ListEffectiveTagsResponse {
3721    fn typename() -> &'static str {
3722        "type.googleapis.com/google.cloud.resourcemanager.v3.ListEffectiveTagsResponse"
3723    }
3724}
3725
3726#[doc(hidden)]
3727impl google_cloud_gax::paginator::internal::PageableResponse for ListEffectiveTagsResponse {
3728    type PageItem = crate::model::EffectiveTag;
3729
3730    fn items(self) -> std::vec::Vec<Self::PageItem> {
3731        self.effective_tags
3732    }
3733
3734    fn next_page_token(&self) -> std::string::String {
3735        use std::clone::Clone;
3736        self.next_page_token.clone()
3737    }
3738}
3739
3740/// An EffectiveTag represents a tag that applies to a resource during policy
3741/// evaluation. Tags can be either directly bound to a resource or inherited from
3742/// its ancestor. EffectiveTag contains the name and
3743/// namespaced_name of the tag value and tag key, with additional fields of
3744/// `inherited` to indicate the inheritance status of the effective tag.
3745#[derive(Clone, Default, PartialEq)]
3746#[non_exhaustive]
3747pub struct EffectiveTag {
3748    /// Resource name for TagValue in the format `tagValues/456`.
3749    pub tag_value: std::string::String,
3750
3751    /// The namespaced name of the TagValue. Can be in the form
3752    /// `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or
3753    /// `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or
3754    /// `{project_number}/{tag_key_short_name}/{tag_value_short_name}`.
3755    pub namespaced_tag_value: std::string::String,
3756
3757    /// The name of the TagKey, in the format `tagKeys/{id}`, such as
3758    /// `tagKeys/123`.
3759    pub tag_key: std::string::String,
3760
3761    /// The namespaced name of the TagKey. Can be in the form
3762    /// `{organization_id}/{tag_key_short_name}` or
3763    /// `{project_id}/{tag_key_short_name}` or
3764    /// `{project_number}/{tag_key_short_name}`.
3765    pub namespaced_tag_key: std::string::String,
3766
3767    /// The parent name of the tag key.
3768    /// Must be in the format `organizations/{organization_id}` or
3769    /// `projects/{project_number}`
3770    pub tag_key_parent_name: std::string::String,
3771
3772    /// Indicates the inheritance status of a tag value
3773    /// attached to the given resource. If the tag value is inherited from one of
3774    /// the resource's ancestors, inherited will be true. If false, then the tag
3775    /// value is directly attached to the resource, inherited will be false.
3776    pub inherited: bool,
3777
3778    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3779}
3780
3781impl EffectiveTag {
3782    pub fn new() -> Self {
3783        std::default::Default::default()
3784    }
3785
3786    /// Sets the value of [tag_value][crate::model::EffectiveTag::tag_value].
3787    ///
3788    /// # Example
3789    /// ```ignore,no_run
3790    /// # use google_cloud_resourcemanager_v3::model::EffectiveTag;
3791    /// let x = EffectiveTag::new().set_tag_value("example");
3792    /// ```
3793    pub fn set_tag_value<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3794        self.tag_value = v.into();
3795        self
3796    }
3797
3798    /// Sets the value of [namespaced_tag_value][crate::model::EffectiveTag::namespaced_tag_value].
3799    ///
3800    /// # Example
3801    /// ```ignore,no_run
3802    /// # use google_cloud_resourcemanager_v3::model::EffectiveTag;
3803    /// let x = EffectiveTag::new().set_namespaced_tag_value("example");
3804    /// ```
3805    pub fn set_namespaced_tag_value<T: std::convert::Into<std::string::String>>(
3806        mut self,
3807        v: T,
3808    ) -> Self {
3809        self.namespaced_tag_value = v.into();
3810        self
3811    }
3812
3813    /// Sets the value of [tag_key][crate::model::EffectiveTag::tag_key].
3814    ///
3815    /// # Example
3816    /// ```ignore,no_run
3817    /// # use google_cloud_resourcemanager_v3::model::EffectiveTag;
3818    /// let x = EffectiveTag::new().set_tag_key("example");
3819    /// ```
3820    pub fn set_tag_key<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3821        self.tag_key = v.into();
3822        self
3823    }
3824
3825    /// Sets the value of [namespaced_tag_key][crate::model::EffectiveTag::namespaced_tag_key].
3826    ///
3827    /// # Example
3828    /// ```ignore,no_run
3829    /// # use google_cloud_resourcemanager_v3::model::EffectiveTag;
3830    /// let x = EffectiveTag::new().set_namespaced_tag_key("example");
3831    /// ```
3832    pub fn set_namespaced_tag_key<T: std::convert::Into<std::string::String>>(
3833        mut self,
3834        v: T,
3835    ) -> Self {
3836        self.namespaced_tag_key = v.into();
3837        self
3838    }
3839
3840    /// Sets the value of [tag_key_parent_name][crate::model::EffectiveTag::tag_key_parent_name].
3841    ///
3842    /// # Example
3843    /// ```ignore,no_run
3844    /// # use google_cloud_resourcemanager_v3::model::EffectiveTag;
3845    /// let x = EffectiveTag::new().set_tag_key_parent_name("example");
3846    /// ```
3847    pub fn set_tag_key_parent_name<T: std::convert::Into<std::string::String>>(
3848        mut self,
3849        v: T,
3850    ) -> Self {
3851        self.tag_key_parent_name = v.into();
3852        self
3853    }
3854
3855    /// Sets the value of [inherited][crate::model::EffectiveTag::inherited].
3856    ///
3857    /// # Example
3858    /// ```ignore,no_run
3859    /// # use google_cloud_resourcemanager_v3::model::EffectiveTag;
3860    /// let x = EffectiveTag::new().set_inherited(true);
3861    /// ```
3862    pub fn set_inherited<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3863        self.inherited = v.into();
3864        self
3865    }
3866}
3867
3868impl wkt::message::Message for EffectiveTag {
3869    fn typename() -> &'static str {
3870        "type.googleapis.com/google.cloud.resourcemanager.v3.EffectiveTag"
3871    }
3872}
3873
3874/// A TagHold represents the use of a TagValue that is not captured by
3875/// TagBindings. If a TagValue has any TagHolds, deletion will be blocked.
3876/// This resource is intended to be created in the same cloud location as the
3877/// `holder`.
3878#[derive(Clone, Default, PartialEq)]
3879#[non_exhaustive]
3880pub struct TagHold {
3881    /// Output only. The resource name of a TagHold. This is a String of the form:
3882    /// `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`
3883    /// (e.g. `tagValues/123/tagHolds/456`). This resource name is generated by
3884    /// the server.
3885    pub name: std::string::String,
3886
3887    /// Required. The name of the resource where the TagValue is being used. Must
3888    /// be less than 200 characters. E.g.
3889    /// `//compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group`
3890    pub holder: std::string::String,
3891
3892    /// Optional. An optional string representing the origin of this request. This
3893    /// field should include human-understandable information to distinguish
3894    /// origins from each other. Must be less than 200 characters. E.g.
3895    /// `migs-35678234`
3896    pub origin: std::string::String,
3897
3898    /// Optional. A URL where an end user can learn more about removing this hold.
3899    /// E.g.
3900    /// `<https://cloud.google.com/resource-manager/docs/tags/tags-creating-and-managing>`
3901    pub help_link: std::string::String,
3902
3903    /// Output only. The time this TagHold was created.
3904    pub create_time: std::option::Option<wkt::Timestamp>,
3905
3906    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3907}
3908
3909impl TagHold {
3910    pub fn new() -> Self {
3911        std::default::Default::default()
3912    }
3913
3914    /// Sets the value of [name][crate::model::TagHold::name].
3915    ///
3916    /// # Example
3917    /// ```ignore,no_run
3918    /// # use google_cloud_resourcemanager_v3::model::TagHold;
3919    /// let x = TagHold::new().set_name("example");
3920    /// ```
3921    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3922        self.name = v.into();
3923        self
3924    }
3925
3926    /// Sets the value of [holder][crate::model::TagHold::holder].
3927    ///
3928    /// # Example
3929    /// ```ignore,no_run
3930    /// # use google_cloud_resourcemanager_v3::model::TagHold;
3931    /// let x = TagHold::new().set_holder("example");
3932    /// ```
3933    pub fn set_holder<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3934        self.holder = v.into();
3935        self
3936    }
3937
3938    /// Sets the value of [origin][crate::model::TagHold::origin].
3939    ///
3940    /// # Example
3941    /// ```ignore,no_run
3942    /// # use google_cloud_resourcemanager_v3::model::TagHold;
3943    /// let x = TagHold::new().set_origin("example");
3944    /// ```
3945    pub fn set_origin<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3946        self.origin = v.into();
3947        self
3948    }
3949
3950    /// Sets the value of [help_link][crate::model::TagHold::help_link].
3951    ///
3952    /// # Example
3953    /// ```ignore,no_run
3954    /// # use google_cloud_resourcemanager_v3::model::TagHold;
3955    /// let x = TagHold::new().set_help_link("example");
3956    /// ```
3957    pub fn set_help_link<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3958        self.help_link = v.into();
3959        self
3960    }
3961
3962    /// Sets the value of [create_time][crate::model::TagHold::create_time].
3963    ///
3964    /// # Example
3965    /// ```ignore,no_run
3966    /// # use google_cloud_resourcemanager_v3::model::TagHold;
3967    /// use wkt::Timestamp;
3968    /// let x = TagHold::new().set_create_time(Timestamp::default()/* use setters */);
3969    /// ```
3970    pub fn set_create_time<T>(mut self, v: T) -> Self
3971    where
3972        T: std::convert::Into<wkt::Timestamp>,
3973    {
3974        self.create_time = std::option::Option::Some(v.into());
3975        self
3976    }
3977
3978    /// Sets or clears the value of [create_time][crate::model::TagHold::create_time].
3979    ///
3980    /// # Example
3981    /// ```ignore,no_run
3982    /// # use google_cloud_resourcemanager_v3::model::TagHold;
3983    /// use wkt::Timestamp;
3984    /// let x = TagHold::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
3985    /// let x = TagHold::new().set_or_clear_create_time(None::<Timestamp>);
3986    /// ```
3987    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3988    where
3989        T: std::convert::Into<wkt::Timestamp>,
3990    {
3991        self.create_time = v.map(|x| x.into());
3992        self
3993    }
3994}
3995
3996impl wkt::message::Message for TagHold {
3997    fn typename() -> &'static str {
3998        "type.googleapis.com/google.cloud.resourcemanager.v3.TagHold"
3999    }
4000}
4001
4002/// The request message to create a TagHold.
4003#[derive(Clone, Default, PartialEq)]
4004#[non_exhaustive]
4005pub struct CreateTagHoldRequest {
4006    /// Required. The resource name of the TagHold's parent TagValue. Must be of
4007    /// the form: `tagValues/{tag-value-id}`.
4008    pub parent: std::string::String,
4009
4010    /// Required. The TagHold to be created.
4011    pub tag_hold: std::option::Option<crate::model::TagHold>,
4012
4013    /// Optional. Set to true to perform the validations necessary for creating the
4014    /// resource, but not actually perform the action.
4015    pub validate_only: bool,
4016
4017    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4018}
4019
4020impl CreateTagHoldRequest {
4021    pub fn new() -> Self {
4022        std::default::Default::default()
4023    }
4024
4025    /// Sets the value of [parent][crate::model::CreateTagHoldRequest::parent].
4026    ///
4027    /// # Example
4028    /// ```ignore,no_run
4029    /// # use google_cloud_resourcemanager_v3::model::CreateTagHoldRequest;
4030    /// let x = CreateTagHoldRequest::new().set_parent("example");
4031    /// ```
4032    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4033        self.parent = v.into();
4034        self
4035    }
4036
4037    /// Sets the value of [tag_hold][crate::model::CreateTagHoldRequest::tag_hold].
4038    ///
4039    /// # Example
4040    /// ```ignore,no_run
4041    /// # use google_cloud_resourcemanager_v3::model::CreateTagHoldRequest;
4042    /// use google_cloud_resourcemanager_v3::model::TagHold;
4043    /// let x = CreateTagHoldRequest::new().set_tag_hold(TagHold::default()/* use setters */);
4044    /// ```
4045    pub fn set_tag_hold<T>(mut self, v: T) -> Self
4046    where
4047        T: std::convert::Into<crate::model::TagHold>,
4048    {
4049        self.tag_hold = std::option::Option::Some(v.into());
4050        self
4051    }
4052
4053    /// Sets or clears the value of [tag_hold][crate::model::CreateTagHoldRequest::tag_hold].
4054    ///
4055    /// # Example
4056    /// ```ignore,no_run
4057    /// # use google_cloud_resourcemanager_v3::model::CreateTagHoldRequest;
4058    /// use google_cloud_resourcemanager_v3::model::TagHold;
4059    /// let x = CreateTagHoldRequest::new().set_or_clear_tag_hold(Some(TagHold::default()/* use setters */));
4060    /// let x = CreateTagHoldRequest::new().set_or_clear_tag_hold(None::<TagHold>);
4061    /// ```
4062    pub fn set_or_clear_tag_hold<T>(mut self, v: std::option::Option<T>) -> Self
4063    where
4064        T: std::convert::Into<crate::model::TagHold>,
4065    {
4066        self.tag_hold = v.map(|x| x.into());
4067        self
4068    }
4069
4070    /// Sets the value of [validate_only][crate::model::CreateTagHoldRequest::validate_only].
4071    ///
4072    /// # Example
4073    /// ```ignore,no_run
4074    /// # use google_cloud_resourcemanager_v3::model::CreateTagHoldRequest;
4075    /// let x = CreateTagHoldRequest::new().set_validate_only(true);
4076    /// ```
4077    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4078        self.validate_only = v.into();
4079        self
4080    }
4081}
4082
4083impl wkt::message::Message for CreateTagHoldRequest {
4084    fn typename() -> &'static str {
4085        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagHoldRequest"
4086    }
4087}
4088
4089/// Runtime operation information for creating a TagHold.
4090/// (-- The metadata is currently empty, but may include information in the
4091/// future. --)
4092#[derive(Clone, Default, PartialEq)]
4093#[non_exhaustive]
4094pub struct CreateTagHoldMetadata {
4095    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4096}
4097
4098impl CreateTagHoldMetadata {
4099    pub fn new() -> Self {
4100        std::default::Default::default()
4101    }
4102}
4103
4104impl wkt::message::Message for CreateTagHoldMetadata {
4105    fn typename() -> &'static str {
4106        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagHoldMetadata"
4107    }
4108}
4109
4110/// The request message to delete a TagHold.
4111#[derive(Clone, Default, PartialEq)]
4112#[non_exhaustive]
4113pub struct DeleteTagHoldRequest {
4114    /// Required. The resource name of the TagHold to delete. Must be of the form:
4115    /// `tagValues/{tag-value-id}/tagHolds/{tag-hold-id}`.
4116    pub name: std::string::String,
4117
4118    /// Optional. Set to true to perform the validations necessary for deleting the
4119    /// resource, but not actually perform the action.
4120    pub validate_only: bool,
4121
4122    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4123}
4124
4125impl DeleteTagHoldRequest {
4126    pub fn new() -> Self {
4127        std::default::Default::default()
4128    }
4129
4130    /// Sets the value of [name][crate::model::DeleteTagHoldRequest::name].
4131    ///
4132    /// # Example
4133    /// ```ignore,no_run
4134    /// # use google_cloud_resourcemanager_v3::model::DeleteTagHoldRequest;
4135    /// let x = DeleteTagHoldRequest::new().set_name("example");
4136    /// ```
4137    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4138        self.name = v.into();
4139        self
4140    }
4141
4142    /// Sets the value of [validate_only][crate::model::DeleteTagHoldRequest::validate_only].
4143    ///
4144    /// # Example
4145    /// ```ignore,no_run
4146    /// # use google_cloud_resourcemanager_v3::model::DeleteTagHoldRequest;
4147    /// let x = DeleteTagHoldRequest::new().set_validate_only(true);
4148    /// ```
4149    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4150        self.validate_only = v.into();
4151        self
4152    }
4153}
4154
4155impl wkt::message::Message for DeleteTagHoldRequest {
4156    fn typename() -> &'static str {
4157        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagHoldRequest"
4158    }
4159}
4160
4161/// Runtime operation information for deleting a TagHold.
4162/// (-- The metadata is currently empty, but may include information in the
4163/// future. --)
4164#[derive(Clone, Default, PartialEq)]
4165#[non_exhaustive]
4166pub struct DeleteTagHoldMetadata {
4167    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4168}
4169
4170impl DeleteTagHoldMetadata {
4171    pub fn new() -> Self {
4172        std::default::Default::default()
4173    }
4174}
4175
4176impl wkt::message::Message for DeleteTagHoldMetadata {
4177    fn typename() -> &'static str {
4178        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagHoldMetadata"
4179    }
4180}
4181
4182/// The request message for listing the TagHolds under a TagValue.
4183#[derive(Clone, Default, PartialEq)]
4184#[non_exhaustive]
4185pub struct ListTagHoldsRequest {
4186    /// Required. The resource name of the parent TagValue. Must be of the form:
4187    /// `tagValues/{tag-value-id}`.
4188    pub parent: std::string::String,
4189
4190    /// Optional. The maximum number of TagHolds to return in the response. The
4191    /// server allows a maximum of 300 TagHolds to return. If unspecified, the
4192    /// server will use 100 as the default.
4193    pub page_size: i32,
4194
4195    /// Optional. A pagination token returned from a previous call to
4196    /// `ListTagHolds` that indicates where this listing should continue from.
4197    pub page_token: std::string::String,
4198
4199    /// Optional. Criteria used to select a subset of TagHolds parented by the
4200    /// TagValue to return. This field follows the syntax defined by aip.dev/160;
4201    /// the `holder` and `origin` fields are supported for filtering. Currently
4202    /// only `AND` syntax is supported. Some example queries are:
4203    ///
4204    /// * `holder =
4205    ///   //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group`
4206    /// * `origin = 35678234`
4207    /// * `holder =
4208    ///   //compute.googleapis.com/compute/projects/myproject/regions/us-east-1/instanceGroupManagers/instance-group
4209    ///   AND origin = 35678234`
4210    pub filter: std::string::String,
4211
4212    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4213}
4214
4215impl ListTagHoldsRequest {
4216    pub fn new() -> Self {
4217        std::default::Default::default()
4218    }
4219
4220    /// Sets the value of [parent][crate::model::ListTagHoldsRequest::parent].
4221    ///
4222    /// # Example
4223    /// ```ignore,no_run
4224    /// # use google_cloud_resourcemanager_v3::model::ListTagHoldsRequest;
4225    /// let x = ListTagHoldsRequest::new().set_parent("example");
4226    /// ```
4227    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4228        self.parent = v.into();
4229        self
4230    }
4231
4232    /// Sets the value of [page_size][crate::model::ListTagHoldsRequest::page_size].
4233    ///
4234    /// # Example
4235    /// ```ignore,no_run
4236    /// # use google_cloud_resourcemanager_v3::model::ListTagHoldsRequest;
4237    /// let x = ListTagHoldsRequest::new().set_page_size(42);
4238    /// ```
4239    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4240        self.page_size = v.into();
4241        self
4242    }
4243
4244    /// Sets the value of [page_token][crate::model::ListTagHoldsRequest::page_token].
4245    ///
4246    /// # Example
4247    /// ```ignore,no_run
4248    /// # use google_cloud_resourcemanager_v3::model::ListTagHoldsRequest;
4249    /// let x = ListTagHoldsRequest::new().set_page_token("example");
4250    /// ```
4251    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4252        self.page_token = v.into();
4253        self
4254    }
4255
4256    /// Sets the value of [filter][crate::model::ListTagHoldsRequest::filter].
4257    ///
4258    /// # Example
4259    /// ```ignore,no_run
4260    /// # use google_cloud_resourcemanager_v3::model::ListTagHoldsRequest;
4261    /// let x = ListTagHoldsRequest::new().set_filter("example");
4262    /// ```
4263    pub fn set_filter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4264        self.filter = v.into();
4265        self
4266    }
4267}
4268
4269impl wkt::message::Message for ListTagHoldsRequest {
4270    fn typename() -> &'static str {
4271        "type.googleapis.com/google.cloud.resourcemanager.v3.ListTagHoldsRequest"
4272    }
4273}
4274
4275/// The ListTagHolds response.
4276#[derive(Clone, Default, PartialEq)]
4277#[non_exhaustive]
4278pub struct ListTagHoldsResponse {
4279    /// A possibly paginated list of TagHolds.
4280    pub tag_holds: std::vec::Vec<crate::model::TagHold>,
4281
4282    /// Pagination token.
4283    ///
4284    /// If the result set is too large to fit in a single response, this token
4285    /// is returned. It encodes the position of the current result cursor.
4286    /// Feeding this value into a new list request with the `page_token` parameter
4287    /// gives the next page of the results.
4288    ///
4289    /// When `next_page_token` is not filled in, there is no next page and
4290    /// the list returned is the last page in the result set.
4291    ///
4292    /// Pagination tokens have a limited lifetime.
4293    pub next_page_token: std::string::String,
4294
4295    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4296}
4297
4298impl ListTagHoldsResponse {
4299    pub fn new() -> Self {
4300        std::default::Default::default()
4301    }
4302
4303    /// Sets the value of [tag_holds][crate::model::ListTagHoldsResponse::tag_holds].
4304    ///
4305    /// # Example
4306    /// ```ignore,no_run
4307    /// # use google_cloud_resourcemanager_v3::model::ListTagHoldsResponse;
4308    /// use google_cloud_resourcemanager_v3::model::TagHold;
4309    /// let x = ListTagHoldsResponse::new()
4310    ///     .set_tag_holds([
4311    ///         TagHold::default()/* use setters */,
4312    ///         TagHold::default()/* use (different) setters */,
4313    ///     ]);
4314    /// ```
4315    pub fn set_tag_holds<T, V>(mut self, v: T) -> Self
4316    where
4317        T: std::iter::IntoIterator<Item = V>,
4318        V: std::convert::Into<crate::model::TagHold>,
4319    {
4320        use std::iter::Iterator;
4321        self.tag_holds = v.into_iter().map(|i| i.into()).collect();
4322        self
4323    }
4324
4325    /// Sets the value of [next_page_token][crate::model::ListTagHoldsResponse::next_page_token].
4326    ///
4327    /// # Example
4328    /// ```ignore,no_run
4329    /// # use google_cloud_resourcemanager_v3::model::ListTagHoldsResponse;
4330    /// let x = ListTagHoldsResponse::new().set_next_page_token("example");
4331    /// ```
4332    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4333        self.next_page_token = v.into();
4334        self
4335    }
4336}
4337
4338impl wkt::message::Message for ListTagHoldsResponse {
4339    fn typename() -> &'static str {
4340        "type.googleapis.com/google.cloud.resourcemanager.v3.ListTagHoldsResponse"
4341    }
4342}
4343
4344#[doc(hidden)]
4345impl google_cloud_gax::paginator::internal::PageableResponse for ListTagHoldsResponse {
4346    type PageItem = crate::model::TagHold;
4347
4348    fn items(self) -> std::vec::Vec<Self::PageItem> {
4349        self.tag_holds
4350    }
4351
4352    fn next_page_token(&self) -> std::string::String {
4353        use std::clone::Clone;
4354        self.next_page_token.clone()
4355    }
4356}
4357
4358/// A TagKey, used to group a set of TagValues.
4359#[derive(Clone, Default, PartialEq)]
4360#[non_exhaustive]
4361pub struct TagKey {
4362    /// Immutable. The resource name for a TagKey. Must be in the format
4363    /// `tagKeys/{tag_key_id}`, where `tag_key_id` is the generated numeric id for
4364    /// the TagKey.
4365    pub name: std::string::String,
4366
4367    /// Immutable. The resource name of the TagKey's parent. A TagKey can be
4368    /// parented by an Organization or a Project. For a TagKey parented by an
4369    /// Organization, its parent must be in the form `organizations/{org_id}`. For
4370    /// a TagKey parented by a Project, its parent can be in the form
4371    /// `projects/{project_id}` or `projects/{project_number}`.
4372    pub parent: std::string::String,
4373
4374    /// Required. Immutable. The user friendly name for a TagKey. The short name
4375    /// should be unique for TagKeys within the same tag namespace.
4376    ///
4377    /// The short name must be 1-63 characters, beginning and ending with
4378    /// an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_),
4379    /// dots (.), and alphanumerics between.
4380    pub short_name: std::string::String,
4381
4382    /// Output only. Immutable. Namespaced name of the TagKey.
4383    pub namespaced_name: std::string::String,
4384
4385    /// Optional. User-assigned description of the TagKey. Must not exceed 256
4386    /// characters.
4387    ///
4388    /// Read-write.
4389    pub description: std::string::String,
4390
4391    /// Output only. Creation time.
4392    pub create_time: std::option::Option<wkt::Timestamp>,
4393
4394    /// Output only. Update time.
4395    pub update_time: std::option::Option<wkt::Timestamp>,
4396
4397    /// Optional. Entity tag which users can pass to prevent race conditions. This
4398    /// field is always set in server responses. See UpdateTagKeyRequest for
4399    /// details.
4400    pub etag: std::string::String,
4401
4402    /// Optional. A purpose denotes that this Tag is intended for use in policies
4403    /// of a specific policy engine, and will involve that policy engine in
4404    /// management operations involving this Tag. A purpose does not grant a
4405    /// policy engine exclusive rights to the Tag, and it may be referenced by
4406    /// other policy engines.
4407    ///
4408    /// A purpose cannot be changed once set.
4409    pub purpose: crate::model::Purpose,
4410
4411    /// Optional. Purpose data corresponds to the policy system that the tag is
4412    /// intended for. See documentation for `Purpose` for formatting of this field.
4413    ///
4414    /// Purpose data cannot be changed once set.
4415    pub purpose_data: std::collections::HashMap<std::string::String, std::string::String>,
4416
4417    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4418}
4419
4420impl TagKey {
4421    pub fn new() -> Self {
4422        std::default::Default::default()
4423    }
4424
4425    /// Sets the value of [name][crate::model::TagKey::name].
4426    ///
4427    /// # Example
4428    /// ```ignore,no_run
4429    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4430    /// let x = TagKey::new().set_name("example");
4431    /// ```
4432    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4433        self.name = v.into();
4434        self
4435    }
4436
4437    /// Sets the value of [parent][crate::model::TagKey::parent].
4438    ///
4439    /// # Example
4440    /// ```ignore,no_run
4441    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4442    /// let x = TagKey::new().set_parent("example");
4443    /// ```
4444    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4445        self.parent = v.into();
4446        self
4447    }
4448
4449    /// Sets the value of [short_name][crate::model::TagKey::short_name].
4450    ///
4451    /// # Example
4452    /// ```ignore,no_run
4453    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4454    /// let x = TagKey::new().set_short_name("example");
4455    /// ```
4456    pub fn set_short_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4457        self.short_name = v.into();
4458        self
4459    }
4460
4461    /// Sets the value of [namespaced_name][crate::model::TagKey::namespaced_name].
4462    ///
4463    /// # Example
4464    /// ```ignore,no_run
4465    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4466    /// let x = TagKey::new().set_namespaced_name("example");
4467    /// ```
4468    pub fn set_namespaced_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4469        self.namespaced_name = v.into();
4470        self
4471    }
4472
4473    /// Sets the value of [description][crate::model::TagKey::description].
4474    ///
4475    /// # Example
4476    /// ```ignore,no_run
4477    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4478    /// let x = TagKey::new().set_description("example");
4479    /// ```
4480    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4481        self.description = v.into();
4482        self
4483    }
4484
4485    /// Sets the value of [create_time][crate::model::TagKey::create_time].
4486    ///
4487    /// # Example
4488    /// ```ignore,no_run
4489    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4490    /// use wkt::Timestamp;
4491    /// let x = TagKey::new().set_create_time(Timestamp::default()/* use setters */);
4492    /// ```
4493    pub fn set_create_time<T>(mut self, v: T) -> Self
4494    where
4495        T: std::convert::Into<wkt::Timestamp>,
4496    {
4497        self.create_time = std::option::Option::Some(v.into());
4498        self
4499    }
4500
4501    /// Sets or clears the value of [create_time][crate::model::TagKey::create_time].
4502    ///
4503    /// # Example
4504    /// ```ignore,no_run
4505    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4506    /// use wkt::Timestamp;
4507    /// let x = TagKey::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
4508    /// let x = TagKey::new().set_or_clear_create_time(None::<Timestamp>);
4509    /// ```
4510    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
4511    where
4512        T: std::convert::Into<wkt::Timestamp>,
4513    {
4514        self.create_time = v.map(|x| x.into());
4515        self
4516    }
4517
4518    /// Sets the value of [update_time][crate::model::TagKey::update_time].
4519    ///
4520    /// # Example
4521    /// ```ignore,no_run
4522    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4523    /// use wkt::Timestamp;
4524    /// let x = TagKey::new().set_update_time(Timestamp::default()/* use setters */);
4525    /// ```
4526    pub fn set_update_time<T>(mut self, v: T) -> Self
4527    where
4528        T: std::convert::Into<wkt::Timestamp>,
4529    {
4530        self.update_time = std::option::Option::Some(v.into());
4531        self
4532    }
4533
4534    /// Sets or clears the value of [update_time][crate::model::TagKey::update_time].
4535    ///
4536    /// # Example
4537    /// ```ignore,no_run
4538    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4539    /// use wkt::Timestamp;
4540    /// let x = TagKey::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
4541    /// let x = TagKey::new().set_or_clear_update_time(None::<Timestamp>);
4542    /// ```
4543    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
4544    where
4545        T: std::convert::Into<wkt::Timestamp>,
4546    {
4547        self.update_time = v.map(|x| x.into());
4548        self
4549    }
4550
4551    /// Sets the value of [etag][crate::model::TagKey::etag].
4552    ///
4553    /// # Example
4554    /// ```ignore,no_run
4555    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4556    /// let x = TagKey::new().set_etag("example");
4557    /// ```
4558    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4559        self.etag = v.into();
4560        self
4561    }
4562
4563    /// Sets the value of [purpose][crate::model::TagKey::purpose].
4564    ///
4565    /// # Example
4566    /// ```ignore,no_run
4567    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4568    /// use google_cloud_resourcemanager_v3::model::Purpose;
4569    /// let x0 = TagKey::new().set_purpose(Purpose::GceFirewall);
4570    /// ```
4571    pub fn set_purpose<T: std::convert::Into<crate::model::Purpose>>(mut self, v: T) -> Self {
4572        self.purpose = v.into();
4573        self
4574    }
4575
4576    /// Sets the value of [purpose_data][crate::model::TagKey::purpose_data].
4577    ///
4578    /// # Example
4579    /// ```ignore,no_run
4580    /// # use google_cloud_resourcemanager_v3::model::TagKey;
4581    /// let x = TagKey::new().set_purpose_data([
4582    ///     ("key0", "abc"),
4583    ///     ("key1", "xyz"),
4584    /// ]);
4585    /// ```
4586    pub fn set_purpose_data<T, K, V>(mut self, v: T) -> Self
4587    where
4588        T: std::iter::IntoIterator<Item = (K, V)>,
4589        K: std::convert::Into<std::string::String>,
4590        V: std::convert::Into<std::string::String>,
4591    {
4592        use std::iter::Iterator;
4593        self.purpose_data = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
4594        self
4595    }
4596}
4597
4598impl wkt::message::Message for TagKey {
4599    fn typename() -> &'static str {
4600        "type.googleapis.com/google.cloud.resourcemanager.v3.TagKey"
4601    }
4602}
4603
4604/// The request message for listing all TagKeys under a parent resource.
4605#[derive(Clone, Default, PartialEq)]
4606#[non_exhaustive]
4607pub struct ListTagKeysRequest {
4608    /// Required. The resource name of the TagKey's parent.
4609    /// Must be of the form `organizations/{org_id}` or `projects/{project_id}` or
4610    /// `projects/{project_number}`
4611    pub parent: std::string::String,
4612
4613    /// Optional. The maximum number of TagKeys to return in the response. The
4614    /// server allows a maximum of 300 TagKeys to return. If unspecified, the
4615    /// server will use 100 as the default.
4616    pub page_size: i32,
4617
4618    /// Optional. A pagination token returned from a previous call to `ListTagKey`
4619    /// that indicates where this listing should continue from.
4620    pub page_token: std::string::String,
4621
4622    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4623}
4624
4625impl ListTagKeysRequest {
4626    pub fn new() -> Self {
4627        std::default::Default::default()
4628    }
4629
4630    /// Sets the value of [parent][crate::model::ListTagKeysRequest::parent].
4631    ///
4632    /// # Example
4633    /// ```ignore,no_run
4634    /// # use google_cloud_resourcemanager_v3::model::ListTagKeysRequest;
4635    /// let x = ListTagKeysRequest::new().set_parent("example");
4636    /// ```
4637    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4638        self.parent = v.into();
4639        self
4640    }
4641
4642    /// Sets the value of [page_size][crate::model::ListTagKeysRequest::page_size].
4643    ///
4644    /// # Example
4645    /// ```ignore,no_run
4646    /// # use google_cloud_resourcemanager_v3::model::ListTagKeysRequest;
4647    /// let x = ListTagKeysRequest::new().set_page_size(42);
4648    /// ```
4649    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4650        self.page_size = v.into();
4651        self
4652    }
4653
4654    /// Sets the value of [page_token][crate::model::ListTagKeysRequest::page_token].
4655    ///
4656    /// # Example
4657    /// ```ignore,no_run
4658    /// # use google_cloud_resourcemanager_v3::model::ListTagKeysRequest;
4659    /// let x = ListTagKeysRequest::new().set_page_token("example");
4660    /// ```
4661    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4662        self.page_token = v.into();
4663        self
4664    }
4665}
4666
4667impl wkt::message::Message for ListTagKeysRequest {
4668    fn typename() -> &'static str {
4669        "type.googleapis.com/google.cloud.resourcemanager.v3.ListTagKeysRequest"
4670    }
4671}
4672
4673/// The ListTagKeys response message.
4674#[derive(Clone, Default, PartialEq)]
4675#[non_exhaustive]
4676pub struct ListTagKeysResponse {
4677    /// List of TagKeys that live under the specified parent in the request.
4678    pub tag_keys: std::vec::Vec<crate::model::TagKey>,
4679
4680    /// A pagination token returned from a previous call to `ListTagKeys`
4681    /// that indicates from where listing should continue.
4682    pub next_page_token: std::string::String,
4683
4684    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4685}
4686
4687impl ListTagKeysResponse {
4688    pub fn new() -> Self {
4689        std::default::Default::default()
4690    }
4691
4692    /// Sets the value of [tag_keys][crate::model::ListTagKeysResponse::tag_keys].
4693    ///
4694    /// # Example
4695    /// ```ignore,no_run
4696    /// # use google_cloud_resourcemanager_v3::model::ListTagKeysResponse;
4697    /// use google_cloud_resourcemanager_v3::model::TagKey;
4698    /// let x = ListTagKeysResponse::new()
4699    ///     .set_tag_keys([
4700    ///         TagKey::default()/* use setters */,
4701    ///         TagKey::default()/* use (different) setters */,
4702    ///     ]);
4703    /// ```
4704    pub fn set_tag_keys<T, V>(mut self, v: T) -> Self
4705    where
4706        T: std::iter::IntoIterator<Item = V>,
4707        V: std::convert::Into<crate::model::TagKey>,
4708    {
4709        use std::iter::Iterator;
4710        self.tag_keys = v.into_iter().map(|i| i.into()).collect();
4711        self
4712    }
4713
4714    /// Sets the value of [next_page_token][crate::model::ListTagKeysResponse::next_page_token].
4715    ///
4716    /// # Example
4717    /// ```ignore,no_run
4718    /// # use google_cloud_resourcemanager_v3::model::ListTagKeysResponse;
4719    /// let x = ListTagKeysResponse::new().set_next_page_token("example");
4720    /// ```
4721    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4722        self.next_page_token = v.into();
4723        self
4724    }
4725}
4726
4727impl wkt::message::Message for ListTagKeysResponse {
4728    fn typename() -> &'static str {
4729        "type.googleapis.com/google.cloud.resourcemanager.v3.ListTagKeysResponse"
4730    }
4731}
4732
4733#[doc(hidden)]
4734impl google_cloud_gax::paginator::internal::PageableResponse for ListTagKeysResponse {
4735    type PageItem = crate::model::TagKey;
4736
4737    fn items(self) -> std::vec::Vec<Self::PageItem> {
4738        self.tag_keys
4739    }
4740
4741    fn next_page_token(&self) -> std::string::String {
4742        use std::clone::Clone;
4743        self.next_page_token.clone()
4744    }
4745}
4746
4747/// The request message for getting a TagKey.
4748#[derive(Clone, Default, PartialEq)]
4749#[non_exhaustive]
4750pub struct GetTagKeyRequest {
4751    /// Required. A resource name in the format `tagKeys/{id}`, such as
4752    /// `tagKeys/123`.
4753    pub name: std::string::String,
4754
4755    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4756}
4757
4758impl GetTagKeyRequest {
4759    pub fn new() -> Self {
4760        std::default::Default::default()
4761    }
4762
4763    /// Sets the value of [name][crate::model::GetTagKeyRequest::name].
4764    ///
4765    /// # Example
4766    /// ```ignore,no_run
4767    /// # use google_cloud_resourcemanager_v3::model::GetTagKeyRequest;
4768    /// let x = GetTagKeyRequest::new().set_name("example");
4769    /// ```
4770    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4771        self.name = v.into();
4772        self
4773    }
4774}
4775
4776impl wkt::message::Message for GetTagKeyRequest {
4777    fn typename() -> &'static str {
4778        "type.googleapis.com/google.cloud.resourcemanager.v3.GetTagKeyRequest"
4779    }
4780}
4781
4782/// The request message for getting a TagKey by its namespaced name.
4783#[derive(Clone, Default, PartialEq)]
4784#[non_exhaustive]
4785pub struct GetNamespacedTagKeyRequest {
4786    /// Required. A namespaced tag key name in the format
4787    /// `{parentId}/{tagKeyShort}`, such as `42/foo` for a key with short name
4788    /// "foo" under the organization with ID 42 or `r2-d2/bar` for a key with short
4789    /// name "bar" under the project `r2-d2`.
4790    pub name: std::string::String,
4791
4792    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4793}
4794
4795impl GetNamespacedTagKeyRequest {
4796    pub fn new() -> Self {
4797        std::default::Default::default()
4798    }
4799
4800    /// Sets the value of [name][crate::model::GetNamespacedTagKeyRequest::name].
4801    ///
4802    /// # Example
4803    /// ```ignore,no_run
4804    /// # use google_cloud_resourcemanager_v3::model::GetNamespacedTagKeyRequest;
4805    /// let x = GetNamespacedTagKeyRequest::new().set_name("example");
4806    /// ```
4807    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4808        self.name = v.into();
4809        self
4810    }
4811}
4812
4813impl wkt::message::Message for GetNamespacedTagKeyRequest {
4814    fn typename() -> &'static str {
4815        "type.googleapis.com/google.cloud.resourcemanager.v3.GetNamespacedTagKeyRequest"
4816    }
4817}
4818
4819/// The request message for creating a TagKey.
4820#[derive(Clone, Default, PartialEq)]
4821#[non_exhaustive]
4822pub struct CreateTagKeyRequest {
4823    /// Required. The TagKey to be created. Only fields `short_name`,
4824    /// `description`, and `parent` are considered during the creation request.
4825    pub tag_key: std::option::Option<crate::model::TagKey>,
4826
4827    /// Optional. Set to true to perform validations necessary for creating the
4828    /// resource, but not actually perform the action.
4829    pub validate_only: bool,
4830
4831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4832}
4833
4834impl CreateTagKeyRequest {
4835    pub fn new() -> Self {
4836        std::default::Default::default()
4837    }
4838
4839    /// Sets the value of [tag_key][crate::model::CreateTagKeyRequest::tag_key].
4840    ///
4841    /// # Example
4842    /// ```ignore,no_run
4843    /// # use google_cloud_resourcemanager_v3::model::CreateTagKeyRequest;
4844    /// use google_cloud_resourcemanager_v3::model::TagKey;
4845    /// let x = CreateTagKeyRequest::new().set_tag_key(TagKey::default()/* use setters */);
4846    /// ```
4847    pub fn set_tag_key<T>(mut self, v: T) -> Self
4848    where
4849        T: std::convert::Into<crate::model::TagKey>,
4850    {
4851        self.tag_key = std::option::Option::Some(v.into());
4852        self
4853    }
4854
4855    /// Sets or clears the value of [tag_key][crate::model::CreateTagKeyRequest::tag_key].
4856    ///
4857    /// # Example
4858    /// ```ignore,no_run
4859    /// # use google_cloud_resourcemanager_v3::model::CreateTagKeyRequest;
4860    /// use google_cloud_resourcemanager_v3::model::TagKey;
4861    /// let x = CreateTagKeyRequest::new().set_or_clear_tag_key(Some(TagKey::default()/* use setters */));
4862    /// let x = CreateTagKeyRequest::new().set_or_clear_tag_key(None::<TagKey>);
4863    /// ```
4864    pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4865    where
4866        T: std::convert::Into<crate::model::TagKey>,
4867    {
4868        self.tag_key = v.map(|x| x.into());
4869        self
4870    }
4871
4872    /// Sets the value of [validate_only][crate::model::CreateTagKeyRequest::validate_only].
4873    ///
4874    /// # Example
4875    /// ```ignore,no_run
4876    /// # use google_cloud_resourcemanager_v3::model::CreateTagKeyRequest;
4877    /// let x = CreateTagKeyRequest::new().set_validate_only(true);
4878    /// ```
4879    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4880        self.validate_only = v.into();
4881        self
4882    }
4883}
4884
4885impl wkt::message::Message for CreateTagKeyRequest {
4886    fn typename() -> &'static str {
4887        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagKeyRequest"
4888    }
4889}
4890
4891/// Runtime operation information for creating a TagKey.
4892#[derive(Clone, Default, PartialEq)]
4893#[non_exhaustive]
4894pub struct CreateTagKeyMetadata {
4895    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4896}
4897
4898impl CreateTagKeyMetadata {
4899    pub fn new() -> Self {
4900        std::default::Default::default()
4901    }
4902}
4903
4904impl wkt::message::Message for CreateTagKeyMetadata {
4905    fn typename() -> &'static str {
4906        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagKeyMetadata"
4907    }
4908}
4909
4910/// The request message for updating a TagKey.
4911#[derive(Clone, Default, PartialEq)]
4912#[non_exhaustive]
4913pub struct UpdateTagKeyRequest {
4914    /// Required. The new definition of the TagKey. Only the `description` and
4915    /// `etag` fields can be updated by this request. If the `etag` field is not
4916    /// empty, it must match the `etag` field of the existing tag key. Otherwise,
4917    /// `ABORTED` will be returned.
4918    pub tag_key: std::option::Option<crate::model::TagKey>,
4919
4920    /// Fields to be updated. The mask may only contain `description` or
4921    /// `etag`. If omitted entirely, both `description` and `etag` are assumed to
4922    /// be significant.
4923    pub update_mask: std::option::Option<wkt::FieldMask>,
4924
4925    /// Set as true to perform validations necessary for updating the resource, but
4926    /// not actually perform the action.
4927    pub validate_only: bool,
4928
4929    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4930}
4931
4932impl UpdateTagKeyRequest {
4933    pub fn new() -> Self {
4934        std::default::Default::default()
4935    }
4936
4937    /// Sets the value of [tag_key][crate::model::UpdateTagKeyRequest::tag_key].
4938    ///
4939    /// # Example
4940    /// ```ignore,no_run
4941    /// # use google_cloud_resourcemanager_v3::model::UpdateTagKeyRequest;
4942    /// use google_cloud_resourcemanager_v3::model::TagKey;
4943    /// let x = UpdateTagKeyRequest::new().set_tag_key(TagKey::default()/* use setters */);
4944    /// ```
4945    pub fn set_tag_key<T>(mut self, v: T) -> Self
4946    where
4947        T: std::convert::Into<crate::model::TagKey>,
4948    {
4949        self.tag_key = std::option::Option::Some(v.into());
4950        self
4951    }
4952
4953    /// Sets or clears the value of [tag_key][crate::model::UpdateTagKeyRequest::tag_key].
4954    ///
4955    /// # Example
4956    /// ```ignore,no_run
4957    /// # use google_cloud_resourcemanager_v3::model::UpdateTagKeyRequest;
4958    /// use google_cloud_resourcemanager_v3::model::TagKey;
4959    /// let x = UpdateTagKeyRequest::new().set_or_clear_tag_key(Some(TagKey::default()/* use setters */));
4960    /// let x = UpdateTagKeyRequest::new().set_or_clear_tag_key(None::<TagKey>);
4961    /// ```
4962    pub fn set_or_clear_tag_key<T>(mut self, v: std::option::Option<T>) -> Self
4963    where
4964        T: std::convert::Into<crate::model::TagKey>,
4965    {
4966        self.tag_key = v.map(|x| x.into());
4967        self
4968    }
4969
4970    /// Sets the value of [update_mask][crate::model::UpdateTagKeyRequest::update_mask].
4971    ///
4972    /// # Example
4973    /// ```ignore,no_run
4974    /// # use google_cloud_resourcemanager_v3::model::UpdateTagKeyRequest;
4975    /// use wkt::FieldMask;
4976    /// let x = UpdateTagKeyRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4977    /// ```
4978    pub fn set_update_mask<T>(mut self, v: T) -> Self
4979    where
4980        T: std::convert::Into<wkt::FieldMask>,
4981    {
4982        self.update_mask = std::option::Option::Some(v.into());
4983        self
4984    }
4985
4986    /// Sets or clears the value of [update_mask][crate::model::UpdateTagKeyRequest::update_mask].
4987    ///
4988    /// # Example
4989    /// ```ignore,no_run
4990    /// # use google_cloud_resourcemanager_v3::model::UpdateTagKeyRequest;
4991    /// use wkt::FieldMask;
4992    /// let x = UpdateTagKeyRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4993    /// let x = UpdateTagKeyRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4994    /// ```
4995    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4996    where
4997        T: std::convert::Into<wkt::FieldMask>,
4998    {
4999        self.update_mask = v.map(|x| x.into());
5000        self
5001    }
5002
5003    /// Sets the value of [validate_only][crate::model::UpdateTagKeyRequest::validate_only].
5004    ///
5005    /// # Example
5006    /// ```ignore,no_run
5007    /// # use google_cloud_resourcemanager_v3::model::UpdateTagKeyRequest;
5008    /// let x = UpdateTagKeyRequest::new().set_validate_only(true);
5009    /// ```
5010    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5011        self.validate_only = v.into();
5012        self
5013    }
5014}
5015
5016impl wkt::message::Message for UpdateTagKeyRequest {
5017    fn typename() -> &'static str {
5018        "type.googleapis.com/google.cloud.resourcemanager.v3.UpdateTagKeyRequest"
5019    }
5020}
5021
5022/// Runtime operation information for updating a TagKey.
5023#[derive(Clone, Default, PartialEq)]
5024#[non_exhaustive]
5025pub struct UpdateTagKeyMetadata {
5026    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5027}
5028
5029impl UpdateTagKeyMetadata {
5030    pub fn new() -> Self {
5031        std::default::Default::default()
5032    }
5033}
5034
5035impl wkt::message::Message for UpdateTagKeyMetadata {
5036    fn typename() -> &'static str {
5037        "type.googleapis.com/google.cloud.resourcemanager.v3.UpdateTagKeyMetadata"
5038    }
5039}
5040
5041/// The request message for deleting a TagKey.
5042#[derive(Clone, Default, PartialEq)]
5043#[non_exhaustive]
5044pub struct DeleteTagKeyRequest {
5045    /// Required. The resource name of a TagKey to be deleted in the format
5046    /// `tagKeys/123`. The TagKey cannot be a parent of any existing TagValues or
5047    /// it will not be deleted successfully.
5048    pub name: std::string::String,
5049
5050    /// Optional. Set as true to perform validations necessary for deletion, but
5051    /// not actually perform the action.
5052    pub validate_only: bool,
5053
5054    /// Optional. The etag known to the client for the expected state of the
5055    /// TagKey. This is to be used for optimistic concurrency.
5056    pub etag: std::string::String,
5057
5058    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5059}
5060
5061impl DeleteTagKeyRequest {
5062    pub fn new() -> Self {
5063        std::default::Default::default()
5064    }
5065
5066    /// Sets the value of [name][crate::model::DeleteTagKeyRequest::name].
5067    ///
5068    /// # Example
5069    /// ```ignore,no_run
5070    /// # use google_cloud_resourcemanager_v3::model::DeleteTagKeyRequest;
5071    /// let x = DeleteTagKeyRequest::new().set_name("example");
5072    /// ```
5073    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5074        self.name = v.into();
5075        self
5076    }
5077
5078    /// Sets the value of [validate_only][crate::model::DeleteTagKeyRequest::validate_only].
5079    ///
5080    /// # Example
5081    /// ```ignore,no_run
5082    /// # use google_cloud_resourcemanager_v3::model::DeleteTagKeyRequest;
5083    /// let x = DeleteTagKeyRequest::new().set_validate_only(true);
5084    /// ```
5085    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5086        self.validate_only = v.into();
5087        self
5088    }
5089
5090    /// Sets the value of [etag][crate::model::DeleteTagKeyRequest::etag].
5091    ///
5092    /// # Example
5093    /// ```ignore,no_run
5094    /// # use google_cloud_resourcemanager_v3::model::DeleteTagKeyRequest;
5095    /// let x = DeleteTagKeyRequest::new().set_etag("example");
5096    /// ```
5097    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5098        self.etag = v.into();
5099        self
5100    }
5101}
5102
5103impl wkt::message::Message for DeleteTagKeyRequest {
5104    fn typename() -> &'static str {
5105        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagKeyRequest"
5106    }
5107}
5108
5109/// Runtime operation information for deleting a TagKey.
5110#[derive(Clone, Default, PartialEq)]
5111#[non_exhaustive]
5112pub struct DeleteTagKeyMetadata {
5113    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5114}
5115
5116impl DeleteTagKeyMetadata {
5117    pub fn new() -> Self {
5118        std::default::Default::default()
5119    }
5120}
5121
5122impl wkt::message::Message for DeleteTagKeyMetadata {
5123    fn typename() -> &'static str {
5124        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagKeyMetadata"
5125    }
5126}
5127
5128/// A TagValue is a child of a particular TagKey. This is used to group
5129/// cloud resources for the purpose of controlling them using policies.
5130#[derive(Clone, Default, PartialEq)]
5131#[non_exhaustive]
5132pub struct TagValue {
5133    /// Immutable. Resource name for TagValue in the format `tagValues/456`.
5134    pub name: std::string::String,
5135
5136    /// Immutable. The resource name of the new TagValue's parent TagKey.
5137    /// Must be of the form `tagKeys/{tag_key_id}`.
5138    pub parent: std::string::String,
5139
5140    /// Required. Immutable. User-assigned short name for TagValue. The short name
5141    /// should be unique for TagValues within the same parent TagKey.
5142    ///
5143    /// The short name must be 63 characters or less, beginning and ending with
5144    /// an alphanumeric character ([a-z0-9A-Z]) with dashes (-), underscores (_),
5145    /// dots (.), and alphanumerics between.
5146    pub short_name: std::string::String,
5147
5148    /// Output only. The namespaced name of the TagValue. Can be in the form
5149    /// `{organization_id}/{tag_key_short_name}/{tag_value_short_name}` or
5150    /// `{project_id}/{tag_key_short_name}/{tag_value_short_name}` or
5151    /// `{project_number}/{tag_key_short_name}/{tag_value_short_name}`.
5152    pub namespaced_name: std::string::String,
5153
5154    /// Optional. User-assigned description of the TagValue.
5155    /// Must not exceed 256 characters.
5156    ///
5157    /// Read-write.
5158    pub description: std::string::String,
5159
5160    /// Output only. Creation time.
5161    pub create_time: std::option::Option<wkt::Timestamp>,
5162
5163    /// Output only. Update time.
5164    pub update_time: std::option::Option<wkt::Timestamp>,
5165
5166    /// Optional. Entity tag which users can pass to prevent race conditions. This
5167    /// field is always set in server responses. See UpdateTagValueRequest for
5168    /// details.
5169    pub etag: std::string::String,
5170
5171    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5172}
5173
5174impl TagValue {
5175    pub fn new() -> Self {
5176        std::default::Default::default()
5177    }
5178
5179    /// Sets the value of [name][crate::model::TagValue::name].
5180    ///
5181    /// # Example
5182    /// ```ignore,no_run
5183    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5184    /// let x = TagValue::new().set_name("example");
5185    /// ```
5186    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5187        self.name = v.into();
5188        self
5189    }
5190
5191    /// Sets the value of [parent][crate::model::TagValue::parent].
5192    ///
5193    /// # Example
5194    /// ```ignore,no_run
5195    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5196    /// let x = TagValue::new().set_parent("example");
5197    /// ```
5198    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5199        self.parent = v.into();
5200        self
5201    }
5202
5203    /// Sets the value of [short_name][crate::model::TagValue::short_name].
5204    ///
5205    /// # Example
5206    /// ```ignore,no_run
5207    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5208    /// let x = TagValue::new().set_short_name("example");
5209    /// ```
5210    pub fn set_short_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5211        self.short_name = v.into();
5212        self
5213    }
5214
5215    /// Sets the value of [namespaced_name][crate::model::TagValue::namespaced_name].
5216    ///
5217    /// # Example
5218    /// ```ignore,no_run
5219    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5220    /// let x = TagValue::new().set_namespaced_name("example");
5221    /// ```
5222    pub fn set_namespaced_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5223        self.namespaced_name = v.into();
5224        self
5225    }
5226
5227    /// Sets the value of [description][crate::model::TagValue::description].
5228    ///
5229    /// # Example
5230    /// ```ignore,no_run
5231    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5232    /// let x = TagValue::new().set_description("example");
5233    /// ```
5234    pub fn set_description<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5235        self.description = v.into();
5236        self
5237    }
5238
5239    /// Sets the value of [create_time][crate::model::TagValue::create_time].
5240    ///
5241    /// # Example
5242    /// ```ignore,no_run
5243    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5244    /// use wkt::Timestamp;
5245    /// let x = TagValue::new().set_create_time(Timestamp::default()/* use setters */);
5246    /// ```
5247    pub fn set_create_time<T>(mut self, v: T) -> Self
5248    where
5249        T: std::convert::Into<wkt::Timestamp>,
5250    {
5251        self.create_time = std::option::Option::Some(v.into());
5252        self
5253    }
5254
5255    /// Sets or clears the value of [create_time][crate::model::TagValue::create_time].
5256    ///
5257    /// # Example
5258    /// ```ignore,no_run
5259    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5260    /// use wkt::Timestamp;
5261    /// let x = TagValue::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
5262    /// let x = TagValue::new().set_or_clear_create_time(None::<Timestamp>);
5263    /// ```
5264    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5265    where
5266        T: std::convert::Into<wkt::Timestamp>,
5267    {
5268        self.create_time = v.map(|x| x.into());
5269        self
5270    }
5271
5272    /// Sets the value of [update_time][crate::model::TagValue::update_time].
5273    ///
5274    /// # Example
5275    /// ```ignore,no_run
5276    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5277    /// use wkt::Timestamp;
5278    /// let x = TagValue::new().set_update_time(Timestamp::default()/* use setters */);
5279    /// ```
5280    pub fn set_update_time<T>(mut self, v: T) -> Self
5281    where
5282        T: std::convert::Into<wkt::Timestamp>,
5283    {
5284        self.update_time = std::option::Option::Some(v.into());
5285        self
5286    }
5287
5288    /// Sets or clears the value of [update_time][crate::model::TagValue::update_time].
5289    ///
5290    /// # Example
5291    /// ```ignore,no_run
5292    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5293    /// use wkt::Timestamp;
5294    /// let x = TagValue::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
5295    /// let x = TagValue::new().set_or_clear_update_time(None::<Timestamp>);
5296    /// ```
5297    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5298    where
5299        T: std::convert::Into<wkt::Timestamp>,
5300    {
5301        self.update_time = v.map(|x| x.into());
5302        self
5303    }
5304
5305    /// Sets the value of [etag][crate::model::TagValue::etag].
5306    ///
5307    /// # Example
5308    /// ```ignore,no_run
5309    /// # use google_cloud_resourcemanager_v3::model::TagValue;
5310    /// let x = TagValue::new().set_etag("example");
5311    /// ```
5312    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5313        self.etag = v.into();
5314        self
5315    }
5316}
5317
5318impl wkt::message::Message for TagValue {
5319    fn typename() -> &'static str {
5320        "type.googleapis.com/google.cloud.resourcemanager.v3.TagValue"
5321    }
5322}
5323
5324/// The request message for listing TagValues for the specified TagKey.
5325/// Resource name for TagKey, parent of the TagValues to be listed,
5326/// in the format `tagKeys/123`.
5327#[derive(Clone, Default, PartialEq)]
5328#[non_exhaustive]
5329pub struct ListTagValuesRequest {
5330    /// Required.
5331    pub parent: std::string::String,
5332
5333    /// Optional. The maximum number of TagValues to return in the response. The
5334    /// server allows a maximum of 300 TagValues to return. If unspecified, the
5335    /// server will use 100 as the default.
5336    pub page_size: i32,
5337
5338    /// Optional. A pagination token returned from a previous call to
5339    /// `ListTagValues` that indicates where this listing should continue from.
5340    pub page_token: std::string::String,
5341
5342    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5343}
5344
5345impl ListTagValuesRequest {
5346    pub fn new() -> Self {
5347        std::default::Default::default()
5348    }
5349
5350    /// Sets the value of [parent][crate::model::ListTagValuesRequest::parent].
5351    ///
5352    /// # Example
5353    /// ```ignore,no_run
5354    /// # use google_cloud_resourcemanager_v3::model::ListTagValuesRequest;
5355    /// let x = ListTagValuesRequest::new().set_parent("example");
5356    /// ```
5357    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5358        self.parent = v.into();
5359        self
5360    }
5361
5362    /// Sets the value of [page_size][crate::model::ListTagValuesRequest::page_size].
5363    ///
5364    /// # Example
5365    /// ```ignore,no_run
5366    /// # use google_cloud_resourcemanager_v3::model::ListTagValuesRequest;
5367    /// let x = ListTagValuesRequest::new().set_page_size(42);
5368    /// ```
5369    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
5370        self.page_size = v.into();
5371        self
5372    }
5373
5374    /// Sets the value of [page_token][crate::model::ListTagValuesRequest::page_token].
5375    ///
5376    /// # Example
5377    /// ```ignore,no_run
5378    /// # use google_cloud_resourcemanager_v3::model::ListTagValuesRequest;
5379    /// let x = ListTagValuesRequest::new().set_page_token("example");
5380    /// ```
5381    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5382        self.page_token = v.into();
5383        self
5384    }
5385}
5386
5387impl wkt::message::Message for ListTagValuesRequest {
5388    fn typename() -> &'static str {
5389        "type.googleapis.com/google.cloud.resourcemanager.v3.ListTagValuesRequest"
5390    }
5391}
5392
5393/// The ListTagValues response.
5394#[derive(Clone, Default, PartialEq)]
5395#[non_exhaustive]
5396pub struct ListTagValuesResponse {
5397    /// A possibly paginated list of TagValues that are direct descendants of
5398    /// the specified parent TagKey.
5399    pub tag_values: std::vec::Vec<crate::model::TagValue>,
5400
5401    /// A pagination token returned from a previous call to `ListTagValues`
5402    /// that indicates from where listing should continue. This is currently not
5403    /// used, but the server may at any point start supplying a valid token.
5404    pub next_page_token: std::string::String,
5405
5406    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5407}
5408
5409impl ListTagValuesResponse {
5410    pub fn new() -> Self {
5411        std::default::Default::default()
5412    }
5413
5414    /// Sets the value of [tag_values][crate::model::ListTagValuesResponse::tag_values].
5415    ///
5416    /// # Example
5417    /// ```ignore,no_run
5418    /// # use google_cloud_resourcemanager_v3::model::ListTagValuesResponse;
5419    /// use google_cloud_resourcemanager_v3::model::TagValue;
5420    /// let x = ListTagValuesResponse::new()
5421    ///     .set_tag_values([
5422    ///         TagValue::default()/* use setters */,
5423    ///         TagValue::default()/* use (different) setters */,
5424    ///     ]);
5425    /// ```
5426    pub fn set_tag_values<T, V>(mut self, v: T) -> Self
5427    where
5428        T: std::iter::IntoIterator<Item = V>,
5429        V: std::convert::Into<crate::model::TagValue>,
5430    {
5431        use std::iter::Iterator;
5432        self.tag_values = v.into_iter().map(|i| i.into()).collect();
5433        self
5434    }
5435
5436    /// Sets the value of [next_page_token][crate::model::ListTagValuesResponse::next_page_token].
5437    ///
5438    /// # Example
5439    /// ```ignore,no_run
5440    /// # use google_cloud_resourcemanager_v3::model::ListTagValuesResponse;
5441    /// let x = ListTagValuesResponse::new().set_next_page_token("example");
5442    /// ```
5443    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5444        self.next_page_token = v.into();
5445        self
5446    }
5447}
5448
5449impl wkt::message::Message for ListTagValuesResponse {
5450    fn typename() -> &'static str {
5451        "type.googleapis.com/google.cloud.resourcemanager.v3.ListTagValuesResponse"
5452    }
5453}
5454
5455#[doc(hidden)]
5456impl google_cloud_gax::paginator::internal::PageableResponse for ListTagValuesResponse {
5457    type PageItem = crate::model::TagValue;
5458
5459    fn items(self) -> std::vec::Vec<Self::PageItem> {
5460        self.tag_values
5461    }
5462
5463    fn next_page_token(&self) -> std::string::String {
5464        use std::clone::Clone;
5465        self.next_page_token.clone()
5466    }
5467}
5468
5469/// The request message for getting a TagValue.
5470#[derive(Clone, Default, PartialEq)]
5471#[non_exhaustive]
5472pub struct GetTagValueRequest {
5473    /// Required. Resource name for TagValue to be fetched in the format
5474    /// `tagValues/456`.
5475    pub name: std::string::String,
5476
5477    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5478}
5479
5480impl GetTagValueRequest {
5481    pub fn new() -> Self {
5482        std::default::Default::default()
5483    }
5484
5485    /// Sets the value of [name][crate::model::GetTagValueRequest::name].
5486    ///
5487    /// # Example
5488    /// ```ignore,no_run
5489    /// # use google_cloud_resourcemanager_v3::model::GetTagValueRequest;
5490    /// let x = GetTagValueRequest::new().set_name("example");
5491    /// ```
5492    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5493        self.name = v.into();
5494        self
5495    }
5496}
5497
5498impl wkt::message::Message for GetTagValueRequest {
5499    fn typename() -> &'static str {
5500        "type.googleapis.com/google.cloud.resourcemanager.v3.GetTagValueRequest"
5501    }
5502}
5503
5504/// The request message for getting a TagValue by its namespaced name.
5505#[derive(Clone, Default, PartialEq)]
5506#[non_exhaustive]
5507pub struct GetNamespacedTagValueRequest {
5508    /// Required. A namespaced tag value name in the following format:
5509    ///
5510    /// `{parentId}/{tagKeyShort}/{tagValueShort}`
5511    ///
5512    /// Examples:
5513    ///
5514    /// - `42/foo/abc` for a value with short name "abc" under the key with short
5515    ///   name "foo" under the organization with ID 42
5516    /// - `r2-d2/bar/xyz` for a value with short name "xyz" under the key with
5517    ///   short name "bar" under the project with ID "r2-d2"
5518    pub name: std::string::String,
5519
5520    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5521}
5522
5523impl GetNamespacedTagValueRequest {
5524    pub fn new() -> Self {
5525        std::default::Default::default()
5526    }
5527
5528    /// Sets the value of [name][crate::model::GetNamespacedTagValueRequest::name].
5529    ///
5530    /// # Example
5531    /// ```ignore,no_run
5532    /// # use google_cloud_resourcemanager_v3::model::GetNamespacedTagValueRequest;
5533    /// let x = GetNamespacedTagValueRequest::new().set_name("example");
5534    /// ```
5535    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5536        self.name = v.into();
5537        self
5538    }
5539}
5540
5541impl wkt::message::Message for GetNamespacedTagValueRequest {
5542    fn typename() -> &'static str {
5543        "type.googleapis.com/google.cloud.resourcemanager.v3.GetNamespacedTagValueRequest"
5544    }
5545}
5546
5547/// The request message for creating a TagValue.
5548#[derive(Clone, Default, PartialEq)]
5549#[non_exhaustive]
5550pub struct CreateTagValueRequest {
5551    /// Required. The TagValue to be created. Only fields `short_name`,
5552    /// `description`, and `parent` are considered during the creation request.
5553    pub tag_value: std::option::Option<crate::model::TagValue>,
5554
5555    /// Optional. Set as true to perform the validations necessary for creating the
5556    /// resource, but not actually perform the action.
5557    pub validate_only: bool,
5558
5559    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5560}
5561
5562impl CreateTagValueRequest {
5563    pub fn new() -> Self {
5564        std::default::Default::default()
5565    }
5566
5567    /// Sets the value of [tag_value][crate::model::CreateTagValueRequest::tag_value].
5568    ///
5569    /// # Example
5570    /// ```ignore,no_run
5571    /// # use google_cloud_resourcemanager_v3::model::CreateTagValueRequest;
5572    /// use google_cloud_resourcemanager_v3::model::TagValue;
5573    /// let x = CreateTagValueRequest::new().set_tag_value(TagValue::default()/* use setters */);
5574    /// ```
5575    pub fn set_tag_value<T>(mut self, v: T) -> Self
5576    where
5577        T: std::convert::Into<crate::model::TagValue>,
5578    {
5579        self.tag_value = std::option::Option::Some(v.into());
5580        self
5581    }
5582
5583    /// Sets or clears the value of [tag_value][crate::model::CreateTagValueRequest::tag_value].
5584    ///
5585    /// # Example
5586    /// ```ignore,no_run
5587    /// # use google_cloud_resourcemanager_v3::model::CreateTagValueRequest;
5588    /// use google_cloud_resourcemanager_v3::model::TagValue;
5589    /// let x = CreateTagValueRequest::new().set_or_clear_tag_value(Some(TagValue::default()/* use setters */));
5590    /// let x = CreateTagValueRequest::new().set_or_clear_tag_value(None::<TagValue>);
5591    /// ```
5592    pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5593    where
5594        T: std::convert::Into<crate::model::TagValue>,
5595    {
5596        self.tag_value = v.map(|x| x.into());
5597        self
5598    }
5599
5600    /// Sets the value of [validate_only][crate::model::CreateTagValueRequest::validate_only].
5601    ///
5602    /// # Example
5603    /// ```ignore,no_run
5604    /// # use google_cloud_resourcemanager_v3::model::CreateTagValueRequest;
5605    /// let x = CreateTagValueRequest::new().set_validate_only(true);
5606    /// ```
5607    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5608        self.validate_only = v.into();
5609        self
5610    }
5611}
5612
5613impl wkt::message::Message for CreateTagValueRequest {
5614    fn typename() -> &'static str {
5615        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagValueRequest"
5616    }
5617}
5618
5619/// Runtime operation information for creating a TagValue.
5620#[derive(Clone, Default, PartialEq)]
5621#[non_exhaustive]
5622pub struct CreateTagValueMetadata {
5623    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5624}
5625
5626impl CreateTagValueMetadata {
5627    pub fn new() -> Self {
5628        std::default::Default::default()
5629    }
5630}
5631
5632impl wkt::message::Message for CreateTagValueMetadata {
5633    fn typename() -> &'static str {
5634        "type.googleapis.com/google.cloud.resourcemanager.v3.CreateTagValueMetadata"
5635    }
5636}
5637
5638/// The request message for updating a TagValue.
5639#[derive(Clone, Default, PartialEq)]
5640#[non_exhaustive]
5641pub struct UpdateTagValueRequest {
5642    /// Required. The new definition of the TagValue. Only fields `description` and
5643    /// `etag` fields can be updated by this request. If the `etag` field is
5644    /// nonempty, it must match the `etag` field of the existing ControlGroup.
5645    /// Otherwise, `ABORTED` will be returned.
5646    pub tag_value: std::option::Option<crate::model::TagValue>,
5647
5648    /// Optional. Fields to be updated.
5649    pub update_mask: std::option::Option<wkt::FieldMask>,
5650
5651    /// Optional. True to perform validations necessary for updating the resource,
5652    /// but not actually perform the action.
5653    pub validate_only: bool,
5654
5655    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5656}
5657
5658impl UpdateTagValueRequest {
5659    pub fn new() -> Self {
5660        std::default::Default::default()
5661    }
5662
5663    /// Sets the value of [tag_value][crate::model::UpdateTagValueRequest::tag_value].
5664    ///
5665    /// # Example
5666    /// ```ignore,no_run
5667    /// # use google_cloud_resourcemanager_v3::model::UpdateTagValueRequest;
5668    /// use google_cloud_resourcemanager_v3::model::TagValue;
5669    /// let x = UpdateTagValueRequest::new().set_tag_value(TagValue::default()/* use setters */);
5670    /// ```
5671    pub fn set_tag_value<T>(mut self, v: T) -> Self
5672    where
5673        T: std::convert::Into<crate::model::TagValue>,
5674    {
5675        self.tag_value = std::option::Option::Some(v.into());
5676        self
5677    }
5678
5679    /// Sets or clears the value of [tag_value][crate::model::UpdateTagValueRequest::tag_value].
5680    ///
5681    /// # Example
5682    /// ```ignore,no_run
5683    /// # use google_cloud_resourcemanager_v3::model::UpdateTagValueRequest;
5684    /// use google_cloud_resourcemanager_v3::model::TagValue;
5685    /// let x = UpdateTagValueRequest::new().set_or_clear_tag_value(Some(TagValue::default()/* use setters */));
5686    /// let x = UpdateTagValueRequest::new().set_or_clear_tag_value(None::<TagValue>);
5687    /// ```
5688    pub fn set_or_clear_tag_value<T>(mut self, v: std::option::Option<T>) -> Self
5689    where
5690        T: std::convert::Into<crate::model::TagValue>,
5691    {
5692        self.tag_value = v.map(|x| x.into());
5693        self
5694    }
5695
5696    /// Sets the value of [update_mask][crate::model::UpdateTagValueRequest::update_mask].
5697    ///
5698    /// # Example
5699    /// ```ignore,no_run
5700    /// # use google_cloud_resourcemanager_v3::model::UpdateTagValueRequest;
5701    /// use wkt::FieldMask;
5702    /// let x = UpdateTagValueRequest::new().set_update_mask(FieldMask::default()/* use setters */);
5703    /// ```
5704    pub fn set_update_mask<T>(mut self, v: T) -> Self
5705    where
5706        T: std::convert::Into<wkt::FieldMask>,
5707    {
5708        self.update_mask = std::option::Option::Some(v.into());
5709        self
5710    }
5711
5712    /// Sets or clears the value of [update_mask][crate::model::UpdateTagValueRequest::update_mask].
5713    ///
5714    /// # Example
5715    /// ```ignore,no_run
5716    /// # use google_cloud_resourcemanager_v3::model::UpdateTagValueRequest;
5717    /// use wkt::FieldMask;
5718    /// let x = UpdateTagValueRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
5719    /// let x = UpdateTagValueRequest::new().set_or_clear_update_mask(None::<FieldMask>);
5720    /// ```
5721    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5722    where
5723        T: std::convert::Into<wkt::FieldMask>,
5724    {
5725        self.update_mask = v.map(|x| x.into());
5726        self
5727    }
5728
5729    /// Sets the value of [validate_only][crate::model::UpdateTagValueRequest::validate_only].
5730    ///
5731    /// # Example
5732    /// ```ignore,no_run
5733    /// # use google_cloud_resourcemanager_v3::model::UpdateTagValueRequest;
5734    /// let x = UpdateTagValueRequest::new().set_validate_only(true);
5735    /// ```
5736    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5737        self.validate_only = v.into();
5738        self
5739    }
5740}
5741
5742impl wkt::message::Message for UpdateTagValueRequest {
5743    fn typename() -> &'static str {
5744        "type.googleapis.com/google.cloud.resourcemanager.v3.UpdateTagValueRequest"
5745    }
5746}
5747
5748/// Runtime operation information for updating a TagValue.
5749#[derive(Clone, Default, PartialEq)]
5750#[non_exhaustive]
5751pub struct UpdateTagValueMetadata {
5752    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5753}
5754
5755impl UpdateTagValueMetadata {
5756    pub fn new() -> Self {
5757        std::default::Default::default()
5758    }
5759}
5760
5761impl wkt::message::Message for UpdateTagValueMetadata {
5762    fn typename() -> &'static str {
5763        "type.googleapis.com/google.cloud.resourcemanager.v3.UpdateTagValueMetadata"
5764    }
5765}
5766
5767/// The request message for deleting a TagValue.
5768#[derive(Clone, Default, PartialEq)]
5769#[non_exhaustive]
5770pub struct DeleteTagValueRequest {
5771    /// Required. Resource name for TagValue to be deleted in the format
5772    /// tagValues/456.
5773    pub name: std::string::String,
5774
5775    /// Optional. Set as true to perform the validations necessary for deletion,
5776    /// but not actually perform the action.
5777    pub validate_only: bool,
5778
5779    /// Optional. The etag known to the client for the expected state of the
5780    /// TagValue. This is to be used for optimistic concurrency.
5781    pub etag: std::string::String,
5782
5783    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5784}
5785
5786impl DeleteTagValueRequest {
5787    pub fn new() -> Self {
5788        std::default::Default::default()
5789    }
5790
5791    /// Sets the value of [name][crate::model::DeleteTagValueRequest::name].
5792    ///
5793    /// # Example
5794    /// ```ignore,no_run
5795    /// # use google_cloud_resourcemanager_v3::model::DeleteTagValueRequest;
5796    /// let x = DeleteTagValueRequest::new().set_name("example");
5797    /// ```
5798    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5799        self.name = v.into();
5800        self
5801    }
5802
5803    /// Sets the value of [validate_only][crate::model::DeleteTagValueRequest::validate_only].
5804    ///
5805    /// # Example
5806    /// ```ignore,no_run
5807    /// # use google_cloud_resourcemanager_v3::model::DeleteTagValueRequest;
5808    /// let x = DeleteTagValueRequest::new().set_validate_only(true);
5809    /// ```
5810    pub fn set_validate_only<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5811        self.validate_only = v.into();
5812        self
5813    }
5814
5815    /// Sets the value of [etag][crate::model::DeleteTagValueRequest::etag].
5816    ///
5817    /// # Example
5818    /// ```ignore,no_run
5819    /// # use google_cloud_resourcemanager_v3::model::DeleteTagValueRequest;
5820    /// let x = DeleteTagValueRequest::new().set_etag("example");
5821    /// ```
5822    pub fn set_etag<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5823        self.etag = v.into();
5824        self
5825    }
5826}
5827
5828impl wkt::message::Message for DeleteTagValueRequest {
5829    fn typename() -> &'static str {
5830        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagValueRequest"
5831    }
5832}
5833
5834/// Runtime operation information for deleting a TagValue.
5835#[derive(Clone, Default, PartialEq)]
5836#[non_exhaustive]
5837pub struct DeleteTagValueMetadata {
5838    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5839}
5840
5841impl DeleteTagValueMetadata {
5842    pub fn new() -> Self {
5843        std::default::Default::default()
5844    }
5845}
5846
5847impl wkt::message::Message for DeleteTagValueMetadata {
5848    fn typename() -> &'static str {
5849        "type.googleapis.com/google.cloud.resourcemanager.v3.DeleteTagValueMetadata"
5850    }
5851}
5852
5853/// A purpose for each policy engine requiring such an integration. A single
5854/// policy engine may have multiple purposes defined, however a TagKey may only
5855/// specify a single purpose.
5856///
5857/// # Working with unknown values
5858///
5859/// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
5860/// additional enum variants at any time. Adding new variants is not considered
5861/// a breaking change. Applications should write their code in anticipation of:
5862///
5863/// - New values appearing in future releases of the client library, **and**
5864/// - New values received dynamically, without application changes.
5865///
5866/// Please consult the [Working with enums] section in the user guide for some
5867/// guidelines.
5868///
5869/// [Working with enums]: https://googleapis.github.io/google-cloud-rust/working_with_enums.html
5870#[derive(Clone, Debug, PartialEq)]
5871#[non_exhaustive]
5872pub enum Purpose {
5873    /// Unspecified purpose.
5874    Unspecified,
5875    /// Purpose for Compute Engine firewalls.
5876    /// A corresponding `purpose_data` should be set for the network the tag is
5877    /// intended for. The key should be `network` and the value should be in
5878    /// either of these two formats:
5879    ///
5880    ///
5881    /// `<https://www.googleapis.com/compute/{compute_version}/projects/{project_id}/global/networks/{network_id}>`
5882    ///
5883    /// - `{project_id}/{network_name}`
5884    ///
5885    /// Examples:
5886    ///
5887    ///
5888    /// `<https://www.googleapis.com/compute/staging_v1/projects/fail-closed-load-testing/global/networks/6992953698831725600>`
5889    ///
5890    /// - `fail-closed-load-testing/load-testing-network`
5891    GceFirewall,
5892    /// If set, the enum was initialized with an unknown value.
5893    ///
5894    /// Applications can examine the value using [Purpose::value] or
5895    /// [Purpose::name].
5896    UnknownValue(purpose::UnknownValue),
5897}
5898
5899#[doc(hidden)]
5900pub mod purpose {
5901    #[allow(unused_imports)]
5902    use super::*;
5903    #[derive(Clone, Debug, PartialEq)]
5904    pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
5905}
5906
5907impl Purpose {
5908    /// Gets the enum value.
5909    ///
5910    /// Returns `None` if the enum contains an unknown value deserialized from
5911    /// the string representation of enums.
5912    pub fn value(&self) -> std::option::Option<i32> {
5913        match self {
5914            Self::Unspecified => std::option::Option::Some(0),
5915            Self::GceFirewall => std::option::Option::Some(1),
5916            Self::UnknownValue(u) => u.0.value(),
5917        }
5918    }
5919
5920    /// Gets the enum value as a string.
5921    ///
5922    /// Returns `None` if the enum contains an unknown value deserialized from
5923    /// the integer representation of enums.
5924    pub fn name(&self) -> std::option::Option<&str> {
5925        match self {
5926            Self::Unspecified => std::option::Option::Some("PURPOSE_UNSPECIFIED"),
5927            Self::GceFirewall => std::option::Option::Some("GCE_FIREWALL"),
5928            Self::UnknownValue(u) => u.0.name(),
5929        }
5930    }
5931}
5932
5933impl std::default::Default for Purpose {
5934    fn default() -> Self {
5935        use std::convert::From;
5936        Self::from(0)
5937    }
5938}
5939
5940impl std::fmt::Display for Purpose {
5941    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
5942        wkt::internal::display_enum(f, self.name(), self.value())
5943    }
5944}
5945
5946impl std::convert::From<i32> for Purpose {
5947    fn from(value: i32) -> Self {
5948        match value {
5949            0 => Self::Unspecified,
5950            1 => Self::GceFirewall,
5951            _ => Self::UnknownValue(purpose::UnknownValue(
5952                wkt::internal::UnknownEnumValue::Integer(value),
5953            )),
5954        }
5955    }
5956}
5957
5958impl std::convert::From<&str> for Purpose {
5959    fn from(value: &str) -> Self {
5960        use std::string::ToString;
5961        match value {
5962            "PURPOSE_UNSPECIFIED" => Self::Unspecified,
5963            "GCE_FIREWALL" => Self::GceFirewall,
5964            _ => Self::UnknownValue(purpose::UnknownValue(
5965                wkt::internal::UnknownEnumValue::String(value.to_string()),
5966            )),
5967        }
5968    }
5969}
5970
5971impl serde::ser::Serialize for Purpose {
5972    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5973    where
5974        S: serde::Serializer,
5975    {
5976        match self {
5977            Self::Unspecified => serializer.serialize_i32(0),
5978            Self::GceFirewall => serializer.serialize_i32(1),
5979            Self::UnknownValue(u) => u.0.serialize(serializer),
5980        }
5981    }
5982}
5983
5984impl<'de> serde::de::Deserialize<'de> for Purpose {
5985    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5986    where
5987        D: serde::Deserializer<'de>,
5988    {
5989        deserializer.deserialize_any(wkt::internal::EnumVisitor::<Purpose>::new(
5990            ".google.cloud.resourcemanager.v3.Purpose",
5991        ))
5992    }
5993}