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