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