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