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