Skip to main content

google_cloud_resourcemanager_v3/
model.rs

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