Skip to main content

google_cloud_storage/generated/gapic_control/
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
20mod debug;
21mod deserialize;
22mod serialize;
23
24/// Contains information about a pending rename operation.
25#[derive(Clone, Default, PartialEq)]
26#[non_exhaustive]
27pub struct PendingRenameInfo {
28    /// Output only. The name of the rename operation.
29    pub operation: std::string::String,
30
31    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32}
33
34impl PendingRenameInfo {
35    pub fn new() -> Self {
36        std::default::Default::default()
37    }
38
39    /// Sets the value of [operation][crate::model::PendingRenameInfo::operation].
40    ///
41    /// # Example
42    /// ```ignore,no_run
43    /// # use google_cloud_storage::model::PendingRenameInfo;
44    /// let x = PendingRenameInfo::new().set_operation("example");
45    /// ```
46    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
47        self.operation = v.into();
48        self
49    }
50}
51
52impl wkt::message::Message for PendingRenameInfo {
53    fn typename() -> &'static str {
54        "type.googleapis.com/google.storage.control.v2.PendingRenameInfo"
55    }
56}
57
58/// A folder resource. This resource can only exist in a hierarchical namespace
59/// enabled bucket.
60#[derive(Clone, Default, PartialEq)]
61#[non_exhaustive]
62pub struct Folder {
63    /// Identifier. The name of this folder.
64    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
65    pub name: std::string::String,
66
67    /// Output only. The version of the metadata for this folder. Used for
68    /// preconditions and for detecting changes in metadata.
69    pub metageneration: i64,
70
71    /// Output only. The creation time of the folder.
72    pub create_time: std::option::Option<wkt::Timestamp>,
73
74    /// Output only. The modification time of the folder.
75    pub update_time: std::option::Option<wkt::Timestamp>,
76
77    /// Output only. Only present if the folder is part of an ongoing RenameFolder
78    /// operation. Contains information which can be used to query the operation
79    /// status. The presence of this field also indicates all write operations are
80    /// blocked for this folder, including folder, managed folder, and object
81    /// operations.
82    pub pending_rename_info: std::option::Option<crate::model::PendingRenameInfo>,
83
84    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
85}
86
87impl Folder {
88    pub fn new() -> Self {
89        std::default::Default::default()
90    }
91
92    /// Sets the value of [name][crate::model::Folder::name].
93    ///
94    /// # Example
95    /// ```ignore,no_run
96    /// # use google_cloud_storage::model::Folder;
97    /// let x = Folder::new().set_name("example");
98    /// ```
99    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
100        self.name = v.into();
101        self
102    }
103
104    /// Sets the value of [metageneration][crate::model::Folder::metageneration].
105    ///
106    /// # Example
107    /// ```ignore,no_run
108    /// # use google_cloud_storage::model::Folder;
109    /// let x = Folder::new().set_metageneration(42);
110    /// ```
111    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
112        self.metageneration = v.into();
113        self
114    }
115
116    /// Sets the value of [create_time][crate::model::Folder::create_time].
117    ///
118    /// # Example
119    /// ```ignore,no_run
120    /// # use google_cloud_storage::model::Folder;
121    /// use wkt::Timestamp;
122    /// let x = Folder::new().set_create_time(Timestamp::default()/* use setters */);
123    /// ```
124    pub fn set_create_time<T>(mut self, v: T) -> Self
125    where
126        T: std::convert::Into<wkt::Timestamp>,
127    {
128        self.create_time = std::option::Option::Some(v.into());
129        self
130    }
131
132    /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
133    ///
134    /// # Example
135    /// ```ignore,no_run
136    /// # use google_cloud_storage::model::Folder;
137    /// use wkt::Timestamp;
138    /// let x = Folder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
139    /// let x = Folder::new().set_or_clear_create_time(None::<Timestamp>);
140    /// ```
141    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
142    where
143        T: std::convert::Into<wkt::Timestamp>,
144    {
145        self.create_time = v.map(|x| x.into());
146        self
147    }
148
149    /// Sets the value of [update_time][crate::model::Folder::update_time].
150    ///
151    /// # Example
152    /// ```ignore,no_run
153    /// # use google_cloud_storage::model::Folder;
154    /// use wkt::Timestamp;
155    /// let x = Folder::new().set_update_time(Timestamp::default()/* use setters */);
156    /// ```
157    pub fn set_update_time<T>(mut self, v: T) -> Self
158    where
159        T: std::convert::Into<wkt::Timestamp>,
160    {
161        self.update_time = std::option::Option::Some(v.into());
162        self
163    }
164
165    /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
166    ///
167    /// # Example
168    /// ```ignore,no_run
169    /// # use google_cloud_storage::model::Folder;
170    /// use wkt::Timestamp;
171    /// let x = Folder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
172    /// let x = Folder::new().set_or_clear_update_time(None::<Timestamp>);
173    /// ```
174    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
175    where
176        T: std::convert::Into<wkt::Timestamp>,
177    {
178        self.update_time = v.map(|x| x.into());
179        self
180    }
181
182    /// Sets the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
183    ///
184    /// # Example
185    /// ```ignore,no_run
186    /// # use google_cloud_storage::model::Folder;
187    /// use google_cloud_storage::model::PendingRenameInfo;
188    /// let x = Folder::new().set_pending_rename_info(PendingRenameInfo::default()/* use setters */);
189    /// ```
190    pub fn set_pending_rename_info<T>(mut self, v: T) -> Self
191    where
192        T: std::convert::Into<crate::model::PendingRenameInfo>,
193    {
194        self.pending_rename_info = std::option::Option::Some(v.into());
195        self
196    }
197
198    /// Sets or clears the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
199    ///
200    /// # Example
201    /// ```ignore,no_run
202    /// # use google_cloud_storage::model::Folder;
203    /// use google_cloud_storage::model::PendingRenameInfo;
204    /// let x = Folder::new().set_or_clear_pending_rename_info(Some(PendingRenameInfo::default()/* use setters */));
205    /// let x = Folder::new().set_or_clear_pending_rename_info(None::<PendingRenameInfo>);
206    /// ```
207    pub fn set_or_clear_pending_rename_info<T>(mut self, v: std::option::Option<T>) -> Self
208    where
209        T: std::convert::Into<crate::model::PendingRenameInfo>,
210    {
211        self.pending_rename_info = v.map(|x| x.into());
212        self
213    }
214}
215
216impl wkt::message::Message for Folder {
217    fn typename() -> &'static str {
218        "type.googleapis.com/google.storage.control.v2.Folder"
219    }
220}
221
222/// Request message for GetFolder. This operation is only applicable to a
223/// hierarchical namespace enabled bucket.
224#[derive(Clone, Default, PartialEq)]
225#[non_exhaustive]
226pub struct GetFolderRequest {
227    /// Required. Name of the folder.
228    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
229    pub name: std::string::String,
230
231    /// Makes the operation only succeed conditional on whether the folder's
232    /// current metageneration matches the given value.
233    pub if_metageneration_match: std::option::Option<i64>,
234
235    /// Makes the operation only succeed conditional on whether the folder's
236    /// current metageneration does not match the given value.
237    pub if_metageneration_not_match: std::option::Option<i64>,
238
239    /// Optional. A unique identifier for this request. UUID is the recommended
240    /// format, but other formats are still accepted.
241    pub request_id: std::string::String,
242
243    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
244}
245
246impl GetFolderRequest {
247    pub fn new() -> Self {
248        std::default::Default::default()
249    }
250
251    /// Sets the value of [name][crate::model::GetFolderRequest::name].
252    ///
253    /// # Example
254    /// ```ignore,no_run
255    /// # use google_cloud_storage::model::GetFolderRequest;
256    /// let x = GetFolderRequest::new().set_name("example");
257    /// ```
258    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
259        self.name = v.into();
260        self
261    }
262
263    /// Sets the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
264    ///
265    /// # Example
266    /// ```ignore,no_run
267    /// # use google_cloud_storage::model::GetFolderRequest;
268    /// let x = GetFolderRequest::new().set_if_metageneration_match(42);
269    /// ```
270    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
271    where
272        T: std::convert::Into<i64>,
273    {
274        self.if_metageneration_match = std::option::Option::Some(v.into());
275        self
276    }
277
278    /// Sets or clears the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
279    ///
280    /// # Example
281    /// ```ignore,no_run
282    /// # use google_cloud_storage::model::GetFolderRequest;
283    /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
284    /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
285    /// ```
286    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
287    where
288        T: std::convert::Into<i64>,
289    {
290        self.if_metageneration_match = v.map(|x| x.into());
291        self
292    }
293
294    /// Sets the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
295    ///
296    /// # Example
297    /// ```ignore,no_run
298    /// # use google_cloud_storage::model::GetFolderRequest;
299    /// let x = GetFolderRequest::new().set_if_metageneration_not_match(42);
300    /// ```
301    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
302    where
303        T: std::convert::Into<i64>,
304    {
305        self.if_metageneration_not_match = std::option::Option::Some(v.into());
306        self
307    }
308
309    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
310    ///
311    /// # Example
312    /// ```ignore,no_run
313    /// # use google_cloud_storage::model::GetFolderRequest;
314    /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
315    /// let x = GetFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
316    /// ```
317    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
318    where
319        T: std::convert::Into<i64>,
320    {
321        self.if_metageneration_not_match = v.map(|x| x.into());
322        self
323    }
324
325    /// Sets the value of [request_id][crate::model::GetFolderRequest::request_id].
326    ///
327    /// # Example
328    /// ```ignore,no_run
329    /// # use google_cloud_storage::model::GetFolderRequest;
330    /// let x = GetFolderRequest::new().set_request_id("example");
331    /// ```
332    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
333        self.request_id = v.into();
334        self
335    }
336}
337
338impl wkt::message::Message for GetFolderRequest {
339    fn typename() -> &'static str {
340        "type.googleapis.com/google.storage.control.v2.GetFolderRequest"
341    }
342}
343
344/// Request message for CreateFolder. This operation is only applicable to a
345/// hierarchical namespace enabled bucket.
346#[derive(Clone, Default, PartialEq)]
347#[non_exhaustive]
348pub struct CreateFolderRequest {
349    /// Required. Name of the bucket in which the folder will reside. The bucket
350    /// must be a hierarchical namespace enabled bucket.
351    pub parent: std::string::String,
352
353    /// Required. Properties of the new folder being created.
354    /// The bucket and name of the folder are specified in the parent and folder_id
355    /// fields, respectively. Populating those fields in `folder` will result in an
356    /// error.
357    pub folder: std::option::Option<crate::model::Folder>,
358
359    /// Required. The full name of a folder, including all its parent folders.
360    /// Folders use single '/' characters as a delimiter.
361    /// The folder_id must end with a slash.
362    /// For example, the folder_id of "books/biographies/" would create a new
363    /// "biographies/" folder under the "books/" folder.
364    pub folder_id: std::string::String,
365
366    /// Optional. If true, parent folder doesn't have to be present and all missing
367    /// ancestor folders will be created atomically.
368    pub recursive: bool,
369
370    /// Optional. A unique identifier for this request. UUID is the recommended
371    /// format, but other formats are still accepted.
372    pub request_id: std::string::String,
373
374    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
375}
376
377impl CreateFolderRequest {
378    pub fn new() -> Self {
379        std::default::Default::default()
380    }
381
382    /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
383    ///
384    /// # Example
385    /// ```ignore,no_run
386    /// # use google_cloud_storage::model::CreateFolderRequest;
387    /// let x = CreateFolderRequest::new().set_parent("example");
388    /// ```
389    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
390        self.parent = v.into();
391        self
392    }
393
394    /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
395    ///
396    /// # Example
397    /// ```ignore,no_run
398    /// # use google_cloud_storage::model::CreateFolderRequest;
399    /// use google_cloud_storage::model::Folder;
400    /// let x = CreateFolderRequest::new().set_folder(Folder::default()/* use setters */);
401    /// ```
402    pub fn set_folder<T>(mut self, v: T) -> Self
403    where
404        T: std::convert::Into<crate::model::Folder>,
405    {
406        self.folder = std::option::Option::Some(v.into());
407        self
408    }
409
410    /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
411    ///
412    /// # Example
413    /// ```ignore,no_run
414    /// # use google_cloud_storage::model::CreateFolderRequest;
415    /// use google_cloud_storage::model::Folder;
416    /// let x = CreateFolderRequest::new().set_or_clear_folder(Some(Folder::default()/* use setters */));
417    /// let x = CreateFolderRequest::new().set_or_clear_folder(None::<Folder>);
418    /// ```
419    pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
420    where
421        T: std::convert::Into<crate::model::Folder>,
422    {
423        self.folder = v.map(|x| x.into());
424        self
425    }
426
427    /// Sets the value of [folder_id][crate::model::CreateFolderRequest::folder_id].
428    ///
429    /// # Example
430    /// ```ignore,no_run
431    /// # use google_cloud_storage::model::CreateFolderRequest;
432    /// let x = CreateFolderRequest::new().set_folder_id("example");
433    /// ```
434    pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
435        self.folder_id = v.into();
436        self
437    }
438
439    /// Sets the value of [recursive][crate::model::CreateFolderRequest::recursive].
440    ///
441    /// # Example
442    /// ```ignore,no_run
443    /// # use google_cloud_storage::model::CreateFolderRequest;
444    /// let x = CreateFolderRequest::new().set_recursive(true);
445    /// ```
446    pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
447        self.recursive = v.into();
448        self
449    }
450
451    /// Sets the value of [request_id][crate::model::CreateFolderRequest::request_id].
452    ///
453    /// # Example
454    /// ```ignore,no_run
455    /// # use google_cloud_storage::model::CreateFolderRequest;
456    /// let x = CreateFolderRequest::new().set_request_id("example");
457    /// ```
458    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
459        self.request_id = v.into();
460        self
461    }
462}
463
464impl wkt::message::Message for CreateFolderRequest {
465    fn typename() -> &'static str {
466        "type.googleapis.com/google.storage.control.v2.CreateFolderRequest"
467    }
468}
469
470/// Request message for DeleteFolder. This operation is only applicable to a
471/// hierarchical namespace enabled bucket.
472#[derive(Clone, Default, PartialEq)]
473#[non_exhaustive]
474pub struct DeleteFolderRequest {
475    /// Required. Name of the folder.
476    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
477    pub name: std::string::String,
478
479    /// Makes the operation only succeed conditional on whether the folder's
480    /// current metageneration matches the given value.
481    pub if_metageneration_match: std::option::Option<i64>,
482
483    /// Makes the operation only succeed conditional on whether the folder's
484    /// current metageneration does not match the given value.
485    pub if_metageneration_not_match: std::option::Option<i64>,
486
487    /// Optional. A unique identifier for this request. UUID is the recommended
488    /// format, but other formats are still accepted.
489    pub request_id: std::string::String,
490
491    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
492}
493
494impl DeleteFolderRequest {
495    pub fn new() -> Self {
496        std::default::Default::default()
497    }
498
499    /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
500    ///
501    /// # Example
502    /// ```ignore,no_run
503    /// # use google_cloud_storage::model::DeleteFolderRequest;
504    /// let x = DeleteFolderRequest::new().set_name("example");
505    /// ```
506    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
507        self.name = v.into();
508        self
509    }
510
511    /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
512    ///
513    /// # Example
514    /// ```ignore,no_run
515    /// # use google_cloud_storage::model::DeleteFolderRequest;
516    /// let x = DeleteFolderRequest::new().set_if_metageneration_match(42);
517    /// ```
518    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
519    where
520        T: std::convert::Into<i64>,
521    {
522        self.if_metageneration_match = std::option::Option::Some(v.into());
523        self
524    }
525
526    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
527    ///
528    /// # Example
529    /// ```ignore,no_run
530    /// # use google_cloud_storage::model::DeleteFolderRequest;
531    /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
532    /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
533    /// ```
534    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
535    where
536        T: std::convert::Into<i64>,
537    {
538        self.if_metageneration_match = v.map(|x| x.into());
539        self
540    }
541
542    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
543    ///
544    /// # Example
545    /// ```ignore,no_run
546    /// # use google_cloud_storage::model::DeleteFolderRequest;
547    /// let x = DeleteFolderRequest::new().set_if_metageneration_not_match(42);
548    /// ```
549    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
550    where
551        T: std::convert::Into<i64>,
552    {
553        self.if_metageneration_not_match = std::option::Option::Some(v.into());
554        self
555    }
556
557    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
558    ///
559    /// # Example
560    /// ```ignore,no_run
561    /// # use google_cloud_storage::model::DeleteFolderRequest;
562    /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
563    /// let x = DeleteFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
564    /// ```
565    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
566    where
567        T: std::convert::Into<i64>,
568    {
569        self.if_metageneration_not_match = v.map(|x| x.into());
570        self
571    }
572
573    /// Sets the value of [request_id][crate::model::DeleteFolderRequest::request_id].
574    ///
575    /// # Example
576    /// ```ignore,no_run
577    /// # use google_cloud_storage::model::DeleteFolderRequest;
578    /// let x = DeleteFolderRequest::new().set_request_id("example");
579    /// ```
580    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
581        self.request_id = v.into();
582        self
583    }
584}
585
586impl wkt::message::Message for DeleteFolderRequest {
587    fn typename() -> &'static str {
588        "type.googleapis.com/google.storage.control.v2.DeleteFolderRequest"
589    }
590}
591
592/// Request message for ListFolders. This operation is only applicable to a
593/// hierarchical namespace enabled bucket.
594#[derive(Clone, Default, PartialEq)]
595#[non_exhaustive]
596pub struct ListFoldersRequest {
597    /// Required. Name of the bucket in which to look for folders. The bucket must
598    /// be a hierarchical namespace enabled bucket.
599    pub parent: std::string::String,
600
601    /// Optional. Maximum number of folders to return in a single response. The
602    /// service will use this parameter or 1,000 items, whichever is smaller.
603    pub page_size: i32,
604
605    /// Optional. A previously-returned page token representing part of the larger
606    /// set of results to view.
607    pub page_token: std::string::String,
608
609    /// Optional. Filter results to folders whose names begin with this prefix.
610    /// If set, the value must either be an empty string or end with a '/'.
611    pub prefix: std::string::String,
612
613    /// Optional. If set, returns results in a directory-like mode. The results
614    /// will only include folders that either exactly match the above prefix, or
615    /// are one level below the prefix. The only supported value is '/'.
616    pub delimiter: std::string::String,
617
618    /// Optional. Filter results to folders whose names are lexicographically equal
619    /// to or after lexicographic_start. If lexicographic_end is also set, the
620    /// folders listed have names between lexicographic_start (inclusive) and
621    /// lexicographic_end (exclusive).
622    pub lexicographic_start: std::string::String,
623
624    /// Optional. Filter results to folders whose names are lexicographically
625    /// before lexicographic_end. If lexicographic_start is also set, the folders
626    /// listed have names between lexicographic_start (inclusive) and
627    /// lexicographic_end (exclusive).
628    pub lexicographic_end: std::string::String,
629
630    /// Optional. A unique identifier for this request. UUID is the recommended
631    /// format, but other formats are still accepted.
632    pub request_id: std::string::String,
633
634    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
635}
636
637impl ListFoldersRequest {
638    pub fn new() -> Self {
639        std::default::Default::default()
640    }
641
642    /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
643    ///
644    /// # Example
645    /// ```ignore,no_run
646    /// # use google_cloud_storage::model::ListFoldersRequest;
647    /// let x = ListFoldersRequest::new().set_parent("example");
648    /// ```
649    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
650        self.parent = v.into();
651        self
652    }
653
654    /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
655    ///
656    /// # Example
657    /// ```ignore,no_run
658    /// # use google_cloud_storage::model::ListFoldersRequest;
659    /// let x = ListFoldersRequest::new().set_page_size(42);
660    /// ```
661    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
662        self.page_size = v.into();
663        self
664    }
665
666    /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
667    ///
668    /// # Example
669    /// ```ignore,no_run
670    /// # use google_cloud_storage::model::ListFoldersRequest;
671    /// let x = ListFoldersRequest::new().set_page_token("example");
672    /// ```
673    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
674        self.page_token = v.into();
675        self
676    }
677
678    /// Sets the value of [prefix][crate::model::ListFoldersRequest::prefix].
679    ///
680    /// # Example
681    /// ```ignore,no_run
682    /// # use google_cloud_storage::model::ListFoldersRequest;
683    /// let x = ListFoldersRequest::new().set_prefix("example");
684    /// ```
685    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
686        self.prefix = v.into();
687        self
688    }
689
690    /// Sets the value of [delimiter][crate::model::ListFoldersRequest::delimiter].
691    ///
692    /// # Example
693    /// ```ignore,no_run
694    /// # use google_cloud_storage::model::ListFoldersRequest;
695    /// let x = ListFoldersRequest::new().set_delimiter("example");
696    /// ```
697    pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
698        self.delimiter = v.into();
699        self
700    }
701
702    /// Sets the value of [lexicographic_start][crate::model::ListFoldersRequest::lexicographic_start].
703    ///
704    /// # Example
705    /// ```ignore,no_run
706    /// # use google_cloud_storage::model::ListFoldersRequest;
707    /// let x = ListFoldersRequest::new().set_lexicographic_start("example");
708    /// ```
709    pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
710        mut self,
711        v: T,
712    ) -> Self {
713        self.lexicographic_start = v.into();
714        self
715    }
716
717    /// Sets the value of [lexicographic_end][crate::model::ListFoldersRequest::lexicographic_end].
718    ///
719    /// # Example
720    /// ```ignore,no_run
721    /// # use google_cloud_storage::model::ListFoldersRequest;
722    /// let x = ListFoldersRequest::new().set_lexicographic_end("example");
723    /// ```
724    pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
725        mut self,
726        v: T,
727    ) -> Self {
728        self.lexicographic_end = v.into();
729        self
730    }
731
732    /// Sets the value of [request_id][crate::model::ListFoldersRequest::request_id].
733    ///
734    /// # Example
735    /// ```ignore,no_run
736    /// # use google_cloud_storage::model::ListFoldersRequest;
737    /// let x = ListFoldersRequest::new().set_request_id("example");
738    /// ```
739    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
740        self.request_id = v.into();
741        self
742    }
743}
744
745impl wkt::message::Message for ListFoldersRequest {
746    fn typename() -> &'static str {
747        "type.googleapis.com/google.storage.control.v2.ListFoldersRequest"
748    }
749}
750
751/// Response message for ListFolders.
752#[derive(Clone, Default, PartialEq)]
753#[non_exhaustive]
754pub struct ListFoldersResponse {
755    /// The list of child folders
756    pub folders: std::vec::Vec<crate::model::Folder>,
757
758    /// The continuation token, used to page through large result sets. Provide
759    /// this value in a subsequent request to return the next page of results.
760    pub next_page_token: std::string::String,
761
762    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
763}
764
765impl ListFoldersResponse {
766    pub fn new() -> Self {
767        std::default::Default::default()
768    }
769
770    /// Sets the value of [folders][crate::model::ListFoldersResponse::folders].
771    ///
772    /// # Example
773    /// ```ignore,no_run
774    /// # use google_cloud_storage::model::ListFoldersResponse;
775    /// use google_cloud_storage::model::Folder;
776    /// let x = ListFoldersResponse::new()
777    ///     .set_folders([
778    ///         Folder::default()/* use setters */,
779    ///         Folder::default()/* use (different) setters */,
780    ///     ]);
781    /// ```
782    pub fn set_folders<T, V>(mut self, v: T) -> Self
783    where
784        T: std::iter::IntoIterator<Item = V>,
785        V: std::convert::Into<crate::model::Folder>,
786    {
787        use std::iter::Iterator;
788        self.folders = v.into_iter().map(|i| i.into()).collect();
789        self
790    }
791
792    /// Sets the value of [next_page_token][crate::model::ListFoldersResponse::next_page_token].
793    ///
794    /// # Example
795    /// ```ignore,no_run
796    /// # use google_cloud_storage::model::ListFoldersResponse;
797    /// let x = ListFoldersResponse::new().set_next_page_token("example");
798    /// ```
799    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
800        self.next_page_token = v.into();
801        self
802    }
803}
804
805impl wkt::message::Message for ListFoldersResponse {
806    fn typename() -> &'static str {
807        "type.googleapis.com/google.storage.control.v2.ListFoldersResponse"
808    }
809}
810
811#[doc(hidden)]
812impl google_cloud_gax::paginator::internal::PageableResponse for ListFoldersResponse {
813    type PageItem = crate::model::Folder;
814
815    fn items(self) -> std::vec::Vec<Self::PageItem> {
816        self.folders
817    }
818
819    fn next_page_token(&self) -> std::string::String {
820        use std::clone::Clone;
821        self.next_page_token.clone()
822    }
823}
824
825/// Request message for RenameFolder. This operation is only applicable to a
826/// hierarchical namespace enabled bucket.
827#[derive(Clone, Default, PartialEq)]
828#[non_exhaustive]
829pub struct RenameFolderRequest {
830    /// Required. Name of the source folder being renamed.
831    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
832    pub name: std::string::String,
833
834    /// Required. The destination folder ID, e.g. `foo/bar/`.
835    pub destination_folder_id: std::string::String,
836
837    /// Makes the operation only succeed conditional on whether the source
838    /// folder's current metageneration matches the given value.
839    pub if_metageneration_match: std::option::Option<i64>,
840
841    /// Makes the operation only succeed conditional on whether the source
842    /// folder's current metageneration does not match the given value.
843    pub if_metageneration_not_match: std::option::Option<i64>,
844
845    /// Optional. A unique identifier for this request. UUID is the recommended
846    /// format, but other formats are still accepted. This request is only
847    /// idempotent if a `request_id` is provided.
848    pub request_id: std::string::String,
849
850    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
851}
852
853impl RenameFolderRequest {
854    pub fn new() -> Self {
855        std::default::Default::default()
856    }
857
858    /// Sets the value of [name][crate::model::RenameFolderRequest::name].
859    ///
860    /// # Example
861    /// ```ignore,no_run
862    /// # use google_cloud_storage::model::RenameFolderRequest;
863    /// let x = RenameFolderRequest::new().set_name("example");
864    /// ```
865    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
866        self.name = v.into();
867        self
868    }
869
870    /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
871    ///
872    /// # Example
873    /// ```ignore,no_run
874    /// # use google_cloud_storage::model::RenameFolderRequest;
875    /// let x = RenameFolderRequest::new().set_destination_folder_id("example");
876    /// ```
877    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
878        mut self,
879        v: T,
880    ) -> Self {
881        self.destination_folder_id = v.into();
882        self
883    }
884
885    /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
886    ///
887    /// # Example
888    /// ```ignore,no_run
889    /// # use google_cloud_storage::model::RenameFolderRequest;
890    /// let x = RenameFolderRequest::new().set_if_metageneration_match(42);
891    /// ```
892    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
893    where
894        T: std::convert::Into<i64>,
895    {
896        self.if_metageneration_match = std::option::Option::Some(v.into());
897        self
898    }
899
900    /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
901    ///
902    /// # Example
903    /// ```ignore,no_run
904    /// # use google_cloud_storage::model::RenameFolderRequest;
905    /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
906    /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
907    /// ```
908    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
909    where
910        T: std::convert::Into<i64>,
911    {
912        self.if_metageneration_match = v.map(|x| x.into());
913        self
914    }
915
916    /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
917    ///
918    /// # Example
919    /// ```ignore,no_run
920    /// # use google_cloud_storage::model::RenameFolderRequest;
921    /// let x = RenameFolderRequest::new().set_if_metageneration_not_match(42);
922    /// ```
923    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
924    where
925        T: std::convert::Into<i64>,
926    {
927        self.if_metageneration_not_match = std::option::Option::Some(v.into());
928        self
929    }
930
931    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
932    ///
933    /// # Example
934    /// ```ignore,no_run
935    /// # use google_cloud_storage::model::RenameFolderRequest;
936    /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
937    /// let x = RenameFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
938    /// ```
939    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
940    where
941        T: std::convert::Into<i64>,
942    {
943        self.if_metageneration_not_match = v.map(|x| x.into());
944        self
945    }
946
947    /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
948    ///
949    /// # Example
950    /// ```ignore,no_run
951    /// # use google_cloud_storage::model::RenameFolderRequest;
952    /// let x = RenameFolderRequest::new().set_request_id("example");
953    /// ```
954    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
955        self.request_id = v.into();
956        self
957    }
958}
959
960impl wkt::message::Message for RenameFolderRequest {
961    fn typename() -> &'static str {
962        "type.googleapis.com/google.storage.control.v2.RenameFolderRequest"
963    }
964}
965
966/// Request message for DeleteFolderRecursive.
967#[derive(Clone, Default, PartialEq)]
968#[non_exhaustive]
969pub struct DeleteFolderRecursiveRequest {
970    /// Required. Name of the folder being deleted, however all of its contents
971    /// will be deleted too. Format:
972    /// `projects/{project}/buckets/{bucket}/folders/{folder}`
973    pub name: std::string::String,
974
975    /// Optional. Makes the operation only succeed conditional on whether the root
976    /// folder's current metageneration matches the given value.
977    pub if_metageneration_match: std::option::Option<i64>,
978
979    /// Optional. Makes the operation only succeed conditional on whether the root
980    /// folder's current metageneration does not match the given value.
981    pub if_metageneration_not_match: std::option::Option<i64>,
982
983    /// Optional. A unique identifier for this request. UUID is the recommended
984    /// format, but other formats are still accepted.
985    pub request_id: std::string::String,
986
987    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
988}
989
990impl DeleteFolderRecursiveRequest {
991    pub fn new() -> Self {
992        std::default::Default::default()
993    }
994
995    /// Sets the value of [name][crate::model::DeleteFolderRecursiveRequest::name].
996    ///
997    /// # Example
998    /// ```ignore,no_run
999    /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1000    /// let x = DeleteFolderRecursiveRequest::new().set_name("example");
1001    /// ```
1002    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1003        self.name = v.into();
1004        self
1005    }
1006
1007    /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_match].
1008    ///
1009    /// # Example
1010    /// ```ignore,no_run
1011    /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1012    /// let x = DeleteFolderRecursiveRequest::new().set_if_metageneration_match(42);
1013    /// ```
1014    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1015    where
1016        T: std::convert::Into<i64>,
1017    {
1018        self.if_metageneration_match = std::option::Option::Some(v.into());
1019        self
1020    }
1021
1022    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_match].
1023    ///
1024    /// # Example
1025    /// ```ignore,no_run
1026    /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1027    /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_match(Some(42));
1028    /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1029    /// ```
1030    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1031    where
1032        T: std::convert::Into<i64>,
1033    {
1034        self.if_metageneration_match = v.map(|x| x.into());
1035        self
1036    }
1037
1038    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_not_match].
1039    ///
1040    /// # Example
1041    /// ```ignore,no_run
1042    /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1043    /// let x = DeleteFolderRecursiveRequest::new().set_if_metageneration_not_match(42);
1044    /// ```
1045    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1046    where
1047        T: std::convert::Into<i64>,
1048    {
1049        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1050        self
1051    }
1052
1053    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRecursiveRequest::if_metageneration_not_match].
1054    ///
1055    /// # Example
1056    /// ```ignore,no_run
1057    /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1058    /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1059    /// let x = DeleteFolderRecursiveRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1060    /// ```
1061    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1062    where
1063        T: std::convert::Into<i64>,
1064    {
1065        self.if_metageneration_not_match = v.map(|x| x.into());
1066        self
1067    }
1068
1069    /// Sets the value of [request_id][crate::model::DeleteFolderRecursiveRequest::request_id].
1070    ///
1071    /// # Example
1072    /// ```ignore,no_run
1073    /// # use google_cloud_storage::model::DeleteFolderRecursiveRequest;
1074    /// let x = DeleteFolderRecursiveRequest::new().set_request_id("example");
1075    /// ```
1076    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1077        self.request_id = v.into();
1078        self
1079    }
1080}
1081
1082impl wkt::message::Message for DeleteFolderRecursiveRequest {
1083    fn typename() -> &'static str {
1084        "type.googleapis.com/google.storage.control.v2.DeleteFolderRecursiveRequest"
1085    }
1086}
1087
1088/// The message contains metadata that is common to all Storage Control
1089/// long-running operations, present in its `google.longrunning.Operation`
1090/// messages, and accessible via `metadata.common_metadata`.
1091#[derive(Clone, Default, PartialEq)]
1092#[non_exhaustive]
1093pub struct CommonLongRunningOperationMetadata {
1094    /// Output only. The time the operation was created.
1095    pub create_time: std::option::Option<wkt::Timestamp>,
1096
1097    /// Output only. The time the operation finished running.
1098    pub end_time: std::option::Option<wkt::Timestamp>,
1099
1100    /// Output only. The time the operation was last modified.
1101    pub update_time: std::option::Option<wkt::Timestamp>,
1102
1103    /// Output only. The type of operation invoked.
1104    pub r#type: std::string::String,
1105
1106    /// Output only. Identifies whether the user has requested cancellation.
1107    pub requested_cancellation: bool,
1108
1109    /// Output only. The estimated progress of the operation in percentage [0,
1110    /// 100]. The value -1 means the progress is unknown.
1111    pub progress_percent: i32,
1112
1113    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1114}
1115
1116impl CommonLongRunningOperationMetadata {
1117    pub fn new() -> Self {
1118        std::default::Default::default()
1119    }
1120
1121    /// Sets the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
1122    ///
1123    /// # Example
1124    /// ```ignore,no_run
1125    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1126    /// use wkt::Timestamp;
1127    /// let x = CommonLongRunningOperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1128    /// ```
1129    pub fn set_create_time<T>(mut self, v: T) -> Self
1130    where
1131        T: std::convert::Into<wkt::Timestamp>,
1132    {
1133        self.create_time = std::option::Option::Some(v.into());
1134        self
1135    }
1136
1137    /// Sets or clears the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
1138    ///
1139    /// # Example
1140    /// ```ignore,no_run
1141    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1142    /// use wkt::Timestamp;
1143    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1144    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1145    /// ```
1146    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1147    where
1148        T: std::convert::Into<wkt::Timestamp>,
1149    {
1150        self.create_time = v.map(|x| x.into());
1151        self
1152    }
1153
1154    /// Sets the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
1155    ///
1156    /// # Example
1157    /// ```ignore,no_run
1158    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1159    /// use wkt::Timestamp;
1160    /// let x = CommonLongRunningOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1161    /// ```
1162    pub fn set_end_time<T>(mut self, v: T) -> Self
1163    where
1164        T: std::convert::Into<wkt::Timestamp>,
1165    {
1166        self.end_time = std::option::Option::Some(v.into());
1167        self
1168    }
1169
1170    /// Sets or clears the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
1171    ///
1172    /// # Example
1173    /// ```ignore,no_run
1174    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1175    /// use wkt::Timestamp;
1176    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1177    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1178    /// ```
1179    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1180    where
1181        T: std::convert::Into<wkt::Timestamp>,
1182    {
1183        self.end_time = v.map(|x| x.into());
1184        self
1185    }
1186
1187    /// Sets the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
1188    ///
1189    /// # Example
1190    /// ```ignore,no_run
1191    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1192    /// use wkt::Timestamp;
1193    /// let x = CommonLongRunningOperationMetadata::new().set_update_time(Timestamp::default()/* use setters */);
1194    /// ```
1195    pub fn set_update_time<T>(mut self, v: T) -> Self
1196    where
1197        T: std::convert::Into<wkt::Timestamp>,
1198    {
1199        self.update_time = std::option::Option::Some(v.into());
1200        self
1201    }
1202
1203    /// Sets or clears the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
1204    ///
1205    /// # Example
1206    /// ```ignore,no_run
1207    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1208    /// use wkt::Timestamp;
1209    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1210    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_update_time(None::<Timestamp>);
1211    /// ```
1212    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1213    where
1214        T: std::convert::Into<wkt::Timestamp>,
1215    {
1216        self.update_time = v.map(|x| x.into());
1217        self
1218    }
1219
1220    /// Sets the value of [r#type][crate::model::CommonLongRunningOperationMetadata::type].
1221    ///
1222    /// # Example
1223    /// ```ignore,no_run
1224    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1225    /// let x = CommonLongRunningOperationMetadata::new().set_type("example");
1226    /// ```
1227    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1228        self.r#type = v.into();
1229        self
1230    }
1231
1232    /// Sets the value of [requested_cancellation][crate::model::CommonLongRunningOperationMetadata::requested_cancellation].
1233    ///
1234    /// # Example
1235    /// ```ignore,no_run
1236    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1237    /// let x = CommonLongRunningOperationMetadata::new().set_requested_cancellation(true);
1238    /// ```
1239    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1240        self.requested_cancellation = v.into();
1241        self
1242    }
1243
1244    /// Sets the value of [progress_percent][crate::model::CommonLongRunningOperationMetadata::progress_percent].
1245    ///
1246    /// # Example
1247    /// ```ignore,no_run
1248    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1249    /// let x = CommonLongRunningOperationMetadata::new().set_progress_percent(42);
1250    /// ```
1251    pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1252        self.progress_percent = v.into();
1253        self
1254    }
1255}
1256
1257impl wkt::message::Message for CommonLongRunningOperationMetadata {
1258    fn typename() -> &'static str {
1259        "type.googleapis.com/google.storage.control.v2.CommonLongRunningOperationMetadata"
1260    }
1261}
1262
1263/// Message returned in the metadata field of the Operation resource for
1264/// RenameFolder operations.
1265#[derive(Clone, Default, PartialEq)]
1266#[non_exhaustive]
1267pub struct RenameFolderMetadata {
1268    /// Generic metadata for the long running operation.
1269    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1270
1271    /// The path of the source folder.
1272    pub source_folder_id: std::string::String,
1273
1274    /// The path of the destination folder.
1275    pub destination_folder_id: std::string::String,
1276
1277    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1278}
1279
1280impl RenameFolderMetadata {
1281    pub fn new() -> Self {
1282        std::default::Default::default()
1283    }
1284
1285    /// Sets the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
1286    ///
1287    /// # Example
1288    /// ```ignore,no_run
1289    /// # use google_cloud_storage::model::RenameFolderMetadata;
1290    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1291    /// let x = RenameFolderMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
1292    /// ```
1293    pub fn set_common_metadata<T>(mut self, v: T) -> Self
1294    where
1295        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1296    {
1297        self.common_metadata = std::option::Option::Some(v.into());
1298        self
1299    }
1300
1301    /// Sets or clears the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
1302    ///
1303    /// # Example
1304    /// ```ignore,no_run
1305    /// # use google_cloud_storage::model::RenameFolderMetadata;
1306    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1307    /// let x = RenameFolderMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
1308    /// let x = RenameFolderMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
1309    /// ```
1310    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1311    where
1312        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1313    {
1314        self.common_metadata = v.map(|x| x.into());
1315        self
1316    }
1317
1318    /// Sets the value of [source_folder_id][crate::model::RenameFolderMetadata::source_folder_id].
1319    ///
1320    /// # Example
1321    /// ```ignore,no_run
1322    /// # use google_cloud_storage::model::RenameFolderMetadata;
1323    /// let x = RenameFolderMetadata::new().set_source_folder_id("example");
1324    /// ```
1325    pub fn set_source_folder_id<T: std::convert::Into<std::string::String>>(
1326        mut self,
1327        v: T,
1328    ) -> Self {
1329        self.source_folder_id = v.into();
1330        self
1331    }
1332
1333    /// Sets the value of [destination_folder_id][crate::model::RenameFolderMetadata::destination_folder_id].
1334    ///
1335    /// # Example
1336    /// ```ignore,no_run
1337    /// # use google_cloud_storage::model::RenameFolderMetadata;
1338    /// let x = RenameFolderMetadata::new().set_destination_folder_id("example");
1339    /// ```
1340    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
1341        mut self,
1342        v: T,
1343    ) -> Self {
1344        self.destination_folder_id = v.into();
1345        self
1346    }
1347}
1348
1349impl wkt::message::Message for RenameFolderMetadata {
1350    fn typename() -> &'static str {
1351        "type.googleapis.com/google.storage.control.v2.RenameFolderMetadata"
1352    }
1353}
1354
1355/// Message returned in the metadata field of the Operation resource for
1356/// DeleteFolderRecursive operations.
1357#[derive(Clone, Default, PartialEq)]
1358#[non_exhaustive]
1359pub struct DeleteFolderRecursiveMetadata {
1360    /// Generic metadata for the long running operation.
1361    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1362
1363    /// The path of the folder recursively deleted.
1364    pub folder_id: std::string::String,
1365
1366    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1367}
1368
1369impl DeleteFolderRecursiveMetadata {
1370    pub fn new() -> Self {
1371        std::default::Default::default()
1372    }
1373
1374    /// Sets the value of [common_metadata][crate::model::DeleteFolderRecursiveMetadata::common_metadata].
1375    ///
1376    /// # Example
1377    /// ```ignore,no_run
1378    /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1379    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1380    /// let x = DeleteFolderRecursiveMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
1381    /// ```
1382    pub fn set_common_metadata<T>(mut self, v: T) -> Self
1383    where
1384        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1385    {
1386        self.common_metadata = std::option::Option::Some(v.into());
1387        self
1388    }
1389
1390    /// Sets or clears the value of [common_metadata][crate::model::DeleteFolderRecursiveMetadata::common_metadata].
1391    ///
1392    /// # Example
1393    /// ```ignore,no_run
1394    /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1395    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1396    /// let x = DeleteFolderRecursiveMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
1397    /// let x = DeleteFolderRecursiveMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
1398    /// ```
1399    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1400    where
1401        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1402    {
1403        self.common_metadata = v.map(|x| x.into());
1404        self
1405    }
1406
1407    /// Sets the value of [folder_id][crate::model::DeleteFolderRecursiveMetadata::folder_id].
1408    ///
1409    /// # Example
1410    /// ```ignore,no_run
1411    /// # use google_cloud_storage::model::DeleteFolderRecursiveMetadata;
1412    /// let x = DeleteFolderRecursiveMetadata::new().set_folder_id("example");
1413    /// ```
1414    pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1415        self.folder_id = v.into();
1416        self
1417    }
1418}
1419
1420impl wkt::message::Message for DeleteFolderRecursiveMetadata {
1421    fn typename() -> &'static str {
1422        "type.googleapis.com/google.storage.control.v2.DeleteFolderRecursiveMetadata"
1423    }
1424}
1425
1426/// The storage layout configuration of a bucket.
1427#[derive(Clone, Default, PartialEq)]
1428#[non_exhaustive]
1429pub struct StorageLayout {
1430    /// Output only. The name of the StorageLayout resource.
1431    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1432    pub name: std::string::String,
1433
1434    /// Output only. The location of the bucket.
1435    pub location: std::string::String,
1436
1437    /// Output only. The location type of the bucket (region, dual-region,
1438    /// multi-region, etc).
1439    pub location_type: std::string::String,
1440
1441    /// Output only. The data placement configuration for custom dual region. If
1442    /// there is no configuration, this is not a custom dual region bucket.
1443    pub custom_placement_config:
1444        std::option::Option<crate::model::storage_layout::CustomPlacementConfig>,
1445
1446    /// Output only. The bucket's hierarchical namespace configuration. If there is
1447    /// no configuration, the hierarchical namespace is disabled.
1448    pub hierarchical_namespace:
1449        std::option::Option<crate::model::storage_layout::HierarchicalNamespace>,
1450
1451    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1452}
1453
1454impl StorageLayout {
1455    pub fn new() -> Self {
1456        std::default::Default::default()
1457    }
1458
1459    /// Sets the value of [name][crate::model::StorageLayout::name].
1460    ///
1461    /// # Example
1462    /// ```ignore,no_run
1463    /// # use google_cloud_storage::model::StorageLayout;
1464    /// let x = StorageLayout::new().set_name("example");
1465    /// ```
1466    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1467        self.name = v.into();
1468        self
1469    }
1470
1471    /// Sets the value of [location][crate::model::StorageLayout::location].
1472    ///
1473    /// # Example
1474    /// ```ignore,no_run
1475    /// # use google_cloud_storage::model::StorageLayout;
1476    /// let x = StorageLayout::new().set_location("example");
1477    /// ```
1478    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1479        self.location = v.into();
1480        self
1481    }
1482
1483    /// Sets the value of [location_type][crate::model::StorageLayout::location_type].
1484    ///
1485    /// # Example
1486    /// ```ignore,no_run
1487    /// # use google_cloud_storage::model::StorageLayout;
1488    /// let x = StorageLayout::new().set_location_type("example");
1489    /// ```
1490    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1491        self.location_type = v.into();
1492        self
1493    }
1494
1495    /// Sets the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
1496    ///
1497    /// # Example
1498    /// ```ignore,no_run
1499    /// # use google_cloud_storage::model::StorageLayout;
1500    /// use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1501    /// let x = StorageLayout::new().set_custom_placement_config(CustomPlacementConfig::default()/* use setters */);
1502    /// ```
1503    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
1504    where
1505        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
1506    {
1507        self.custom_placement_config = std::option::Option::Some(v.into());
1508        self
1509    }
1510
1511    /// Sets or clears the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
1512    ///
1513    /// # Example
1514    /// ```ignore,no_run
1515    /// # use google_cloud_storage::model::StorageLayout;
1516    /// use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1517    /// let x = StorageLayout::new().set_or_clear_custom_placement_config(Some(CustomPlacementConfig::default()/* use setters */));
1518    /// let x = StorageLayout::new().set_or_clear_custom_placement_config(None::<CustomPlacementConfig>);
1519    /// ```
1520    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
1521    where
1522        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
1523    {
1524        self.custom_placement_config = v.map(|x| x.into());
1525        self
1526    }
1527
1528    /// Sets the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
1529    ///
1530    /// # Example
1531    /// ```ignore,no_run
1532    /// # use google_cloud_storage::model::StorageLayout;
1533    /// use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1534    /// let x = StorageLayout::new().set_hierarchical_namespace(HierarchicalNamespace::default()/* use setters */);
1535    /// ```
1536    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
1537    where
1538        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
1539    {
1540        self.hierarchical_namespace = std::option::Option::Some(v.into());
1541        self
1542    }
1543
1544    /// Sets or clears the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
1545    ///
1546    /// # Example
1547    /// ```ignore,no_run
1548    /// # use google_cloud_storage::model::StorageLayout;
1549    /// use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1550    /// let x = StorageLayout::new().set_or_clear_hierarchical_namespace(Some(HierarchicalNamespace::default()/* use setters */));
1551    /// let x = StorageLayout::new().set_or_clear_hierarchical_namespace(None::<HierarchicalNamespace>);
1552    /// ```
1553    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
1554    where
1555        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
1556    {
1557        self.hierarchical_namespace = v.map(|x| x.into());
1558        self
1559    }
1560}
1561
1562impl wkt::message::Message for StorageLayout {
1563    fn typename() -> &'static str {
1564        "type.googleapis.com/google.storage.control.v2.StorageLayout"
1565    }
1566}
1567
1568/// Defines additional types related to [StorageLayout].
1569pub mod storage_layout {
1570    #[allow(unused_imports)]
1571    use super::*;
1572
1573    /// Configuration for Custom Dual Regions.  It should specify precisely two
1574    /// eligible regions within the same Multiregion. More information on regions
1575    /// may be found [here](https://cloud.google.com/storage/docs/locations).
1576    #[derive(Clone, Default, PartialEq)]
1577    #[non_exhaustive]
1578    pub struct CustomPlacementConfig {
1579        /// List of locations to use for data placement.
1580        pub data_locations: std::vec::Vec<std::string::String>,
1581
1582        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1583    }
1584
1585    impl CustomPlacementConfig {
1586        pub fn new() -> Self {
1587            std::default::Default::default()
1588        }
1589
1590        /// Sets the value of [data_locations][crate::model::storage_layout::CustomPlacementConfig::data_locations].
1591        ///
1592        /// # Example
1593        /// ```ignore,no_run
1594        /// # use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1595        /// let x = CustomPlacementConfig::new().set_data_locations(["a", "b", "c"]);
1596        /// ```
1597        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
1598        where
1599            T: std::iter::IntoIterator<Item = V>,
1600            V: std::convert::Into<std::string::String>,
1601        {
1602            use std::iter::Iterator;
1603            self.data_locations = v.into_iter().map(|i| i.into()).collect();
1604            self
1605        }
1606    }
1607
1608    impl wkt::message::Message for CustomPlacementConfig {
1609        fn typename() -> &'static str {
1610            "type.googleapis.com/google.storage.control.v2.StorageLayout.CustomPlacementConfig"
1611        }
1612    }
1613
1614    /// Configuration for a bucket's hierarchical namespace feature.
1615    #[derive(Clone, Default, PartialEq)]
1616    #[non_exhaustive]
1617    pub struct HierarchicalNamespace {
1618        /// Enables the hierarchical namespace feature.
1619        pub enabled: bool,
1620
1621        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1622    }
1623
1624    impl HierarchicalNamespace {
1625        pub fn new() -> Self {
1626            std::default::Default::default()
1627        }
1628
1629        /// Sets the value of [enabled][crate::model::storage_layout::HierarchicalNamespace::enabled].
1630        ///
1631        /// # Example
1632        /// ```ignore,no_run
1633        /// # use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1634        /// let x = HierarchicalNamespace::new().set_enabled(true);
1635        /// ```
1636        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1637            self.enabled = v.into();
1638            self
1639        }
1640    }
1641
1642    impl wkt::message::Message for HierarchicalNamespace {
1643        fn typename() -> &'static str {
1644            "type.googleapis.com/google.storage.control.v2.StorageLayout.HierarchicalNamespace"
1645        }
1646    }
1647}
1648
1649/// Request message for GetStorageLayout.
1650#[derive(Clone, Default, PartialEq)]
1651#[non_exhaustive]
1652pub struct GetStorageLayoutRequest {
1653    /// Required. The name of the StorageLayout resource.
1654    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1655    pub name: std::string::String,
1656
1657    /// An optional prefix used for permission check. It is useful when the caller
1658    /// only has limited permissions under a specific prefix.
1659    pub prefix: std::string::String,
1660
1661    /// Optional. A unique identifier for this request. UUID is the recommended
1662    /// format, but other formats are still accepted.
1663    pub request_id: std::string::String,
1664
1665    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1666}
1667
1668impl GetStorageLayoutRequest {
1669    pub fn new() -> Self {
1670        std::default::Default::default()
1671    }
1672
1673    /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
1674    ///
1675    /// # Example
1676    /// ```ignore,no_run
1677    /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1678    /// let x = GetStorageLayoutRequest::new().set_name("example");
1679    /// ```
1680    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1681        self.name = v.into();
1682        self
1683    }
1684
1685    /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
1686    ///
1687    /// # Example
1688    /// ```ignore,no_run
1689    /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1690    /// let x = GetStorageLayoutRequest::new().set_prefix("example");
1691    /// ```
1692    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1693        self.prefix = v.into();
1694        self
1695    }
1696
1697    /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
1698    ///
1699    /// # Example
1700    /// ```ignore,no_run
1701    /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1702    /// let x = GetStorageLayoutRequest::new().set_request_id("example");
1703    /// ```
1704    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1705        self.request_id = v.into();
1706        self
1707    }
1708}
1709
1710impl wkt::message::Message for GetStorageLayoutRequest {
1711    fn typename() -> &'static str {
1712        "type.googleapis.com/google.storage.control.v2.GetStorageLayoutRequest"
1713    }
1714}
1715
1716/// A managed folder.
1717#[derive(Clone, Default, PartialEq)]
1718#[non_exhaustive]
1719pub struct ManagedFolder {
1720    /// Identifier. The name of this managed folder.
1721    /// Format:
1722    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1723    pub name: std::string::String,
1724
1725    /// Output only. The metadata version of this managed folder. It increases
1726    /// whenever the metadata is updated. Used for preconditions and for detecting
1727    /// changes in metadata. Managed folders don't have a generation number.
1728    pub metageneration: i64,
1729
1730    /// Output only. The creation time of the managed folder.
1731    pub create_time: std::option::Option<wkt::Timestamp>,
1732
1733    /// Output only. The modification time of the managed folder.
1734    pub update_time: std::option::Option<wkt::Timestamp>,
1735
1736    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1737}
1738
1739impl ManagedFolder {
1740    pub fn new() -> Self {
1741        std::default::Default::default()
1742    }
1743
1744    /// Sets the value of [name][crate::model::ManagedFolder::name].
1745    ///
1746    /// # Example
1747    /// ```ignore,no_run
1748    /// # use google_cloud_storage::model::ManagedFolder;
1749    /// let x = ManagedFolder::new().set_name("example");
1750    /// ```
1751    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1752        self.name = v.into();
1753        self
1754    }
1755
1756    /// Sets the value of [metageneration][crate::model::ManagedFolder::metageneration].
1757    ///
1758    /// # Example
1759    /// ```ignore,no_run
1760    /// # use google_cloud_storage::model::ManagedFolder;
1761    /// let x = ManagedFolder::new().set_metageneration(42);
1762    /// ```
1763    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1764        self.metageneration = v.into();
1765        self
1766    }
1767
1768    /// Sets the value of [create_time][crate::model::ManagedFolder::create_time].
1769    ///
1770    /// # Example
1771    /// ```ignore,no_run
1772    /// # use google_cloud_storage::model::ManagedFolder;
1773    /// use wkt::Timestamp;
1774    /// let x = ManagedFolder::new().set_create_time(Timestamp::default()/* use setters */);
1775    /// ```
1776    pub fn set_create_time<T>(mut self, v: T) -> Self
1777    where
1778        T: std::convert::Into<wkt::Timestamp>,
1779    {
1780        self.create_time = std::option::Option::Some(v.into());
1781        self
1782    }
1783
1784    /// Sets or clears the value of [create_time][crate::model::ManagedFolder::create_time].
1785    ///
1786    /// # Example
1787    /// ```ignore,no_run
1788    /// # use google_cloud_storage::model::ManagedFolder;
1789    /// use wkt::Timestamp;
1790    /// let x = ManagedFolder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1791    /// let x = ManagedFolder::new().set_or_clear_create_time(None::<Timestamp>);
1792    /// ```
1793    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1794    where
1795        T: std::convert::Into<wkt::Timestamp>,
1796    {
1797        self.create_time = v.map(|x| x.into());
1798        self
1799    }
1800
1801    /// Sets the value of [update_time][crate::model::ManagedFolder::update_time].
1802    ///
1803    /// # Example
1804    /// ```ignore,no_run
1805    /// # use google_cloud_storage::model::ManagedFolder;
1806    /// use wkt::Timestamp;
1807    /// let x = ManagedFolder::new().set_update_time(Timestamp::default()/* use setters */);
1808    /// ```
1809    pub fn set_update_time<T>(mut self, v: T) -> Self
1810    where
1811        T: std::convert::Into<wkt::Timestamp>,
1812    {
1813        self.update_time = std::option::Option::Some(v.into());
1814        self
1815    }
1816
1817    /// Sets or clears the value of [update_time][crate::model::ManagedFolder::update_time].
1818    ///
1819    /// # Example
1820    /// ```ignore,no_run
1821    /// # use google_cloud_storage::model::ManagedFolder;
1822    /// use wkt::Timestamp;
1823    /// let x = ManagedFolder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1824    /// let x = ManagedFolder::new().set_or_clear_update_time(None::<Timestamp>);
1825    /// ```
1826    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1827    where
1828        T: std::convert::Into<wkt::Timestamp>,
1829    {
1830        self.update_time = v.map(|x| x.into());
1831        self
1832    }
1833}
1834
1835impl wkt::message::Message for ManagedFolder {
1836    fn typename() -> &'static str {
1837        "type.googleapis.com/google.storage.control.v2.ManagedFolder"
1838    }
1839}
1840
1841/// Request message for GetManagedFolder.
1842#[derive(Clone, Default, PartialEq)]
1843#[non_exhaustive]
1844pub struct GetManagedFolderRequest {
1845    /// Required. Name of the managed folder.
1846    /// Format:
1847    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1848    pub name: std::string::String,
1849
1850    /// The operation succeeds conditional on the managed folder's current
1851    /// metageneration matching the value here specified.
1852    pub if_metageneration_match: std::option::Option<i64>,
1853
1854    /// The operation succeeds conditional on the managed folder's current
1855    /// metageneration NOT matching the value here specified.
1856    pub if_metageneration_not_match: std::option::Option<i64>,
1857
1858    /// Optional. A unique identifier for this request. UUID is the recommended
1859    /// format, but other formats are still accepted.
1860    pub request_id: std::string::String,
1861
1862    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1863}
1864
1865impl GetManagedFolderRequest {
1866    pub fn new() -> Self {
1867        std::default::Default::default()
1868    }
1869
1870    /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
1871    ///
1872    /// # Example
1873    /// ```ignore,no_run
1874    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1875    /// let x = GetManagedFolderRequest::new().set_name("example");
1876    /// ```
1877    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1878        self.name = v.into();
1879        self
1880    }
1881
1882    /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1883    ///
1884    /// # Example
1885    /// ```ignore,no_run
1886    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1887    /// let x = GetManagedFolderRequest::new().set_if_metageneration_match(42);
1888    /// ```
1889    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1890    where
1891        T: std::convert::Into<i64>,
1892    {
1893        self.if_metageneration_match = std::option::Option::Some(v.into());
1894        self
1895    }
1896
1897    /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1898    ///
1899    /// # Example
1900    /// ```ignore,no_run
1901    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1902    /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
1903    /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1904    /// ```
1905    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1906    where
1907        T: std::convert::Into<i64>,
1908    {
1909        self.if_metageneration_match = v.map(|x| x.into());
1910        self
1911    }
1912
1913    /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1914    ///
1915    /// # Example
1916    /// ```ignore,no_run
1917    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1918    /// let x = GetManagedFolderRequest::new().set_if_metageneration_not_match(42);
1919    /// ```
1920    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1921    where
1922        T: std::convert::Into<i64>,
1923    {
1924        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1925        self
1926    }
1927
1928    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1929    ///
1930    /// # Example
1931    /// ```ignore,no_run
1932    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1933    /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1934    /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1935    /// ```
1936    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1937    where
1938        T: std::convert::Into<i64>,
1939    {
1940        self.if_metageneration_not_match = v.map(|x| x.into());
1941        self
1942    }
1943
1944    /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
1945    ///
1946    /// # Example
1947    /// ```ignore,no_run
1948    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1949    /// let x = GetManagedFolderRequest::new().set_request_id("example");
1950    /// ```
1951    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1952        self.request_id = v.into();
1953        self
1954    }
1955}
1956
1957impl wkt::message::Message for GetManagedFolderRequest {
1958    fn typename() -> &'static str {
1959        "type.googleapis.com/google.storage.control.v2.GetManagedFolderRequest"
1960    }
1961}
1962
1963/// Request message for CreateManagedFolder.
1964#[derive(Clone, Default, PartialEq)]
1965#[non_exhaustive]
1966pub struct CreateManagedFolderRequest {
1967    /// Required. Name of the bucket this managed folder belongs to.
1968    pub parent: std::string::String,
1969
1970    /// Required. Properties of the managed folder being created.
1971    /// The bucket and managed folder names are specified in the `parent` and
1972    /// `managed_folder_id` fields. Populating these fields in `managed_folder`
1973    /// will result in an error.
1974    pub managed_folder: std::option::Option<crate::model::ManagedFolder>,
1975
1976    /// Required. The name of the managed folder. It uses a single `/` as delimiter
1977    /// and leading and trailing `/` are allowed.
1978    pub managed_folder_id: std::string::String,
1979
1980    /// Optional. A unique identifier for this request. UUID is the recommended
1981    /// format, but other formats are still accepted.
1982    pub request_id: std::string::String,
1983
1984    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1985}
1986
1987impl CreateManagedFolderRequest {
1988    pub fn new() -> Self {
1989        std::default::Default::default()
1990    }
1991
1992    /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
1993    ///
1994    /// # Example
1995    /// ```ignore,no_run
1996    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
1997    /// let x = CreateManagedFolderRequest::new().set_parent("example");
1998    /// ```
1999    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2000        self.parent = v.into();
2001        self
2002    }
2003
2004    /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
2005    ///
2006    /// # Example
2007    /// ```ignore,no_run
2008    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2009    /// use google_cloud_storage::model::ManagedFolder;
2010    /// let x = CreateManagedFolderRequest::new().set_managed_folder(ManagedFolder::default()/* use setters */);
2011    /// ```
2012    pub fn set_managed_folder<T>(mut self, v: T) -> Self
2013    where
2014        T: std::convert::Into<crate::model::ManagedFolder>,
2015    {
2016        self.managed_folder = std::option::Option::Some(v.into());
2017        self
2018    }
2019
2020    /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
2021    ///
2022    /// # Example
2023    /// ```ignore,no_run
2024    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2025    /// use google_cloud_storage::model::ManagedFolder;
2026    /// let x = CreateManagedFolderRequest::new().set_or_clear_managed_folder(Some(ManagedFolder::default()/* use setters */));
2027    /// let x = CreateManagedFolderRequest::new().set_or_clear_managed_folder(None::<ManagedFolder>);
2028    /// ```
2029    pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
2030    where
2031        T: std::convert::Into<crate::model::ManagedFolder>,
2032    {
2033        self.managed_folder = v.map(|x| x.into());
2034        self
2035    }
2036
2037    /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
2038    ///
2039    /// # Example
2040    /// ```ignore,no_run
2041    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2042    /// let x = CreateManagedFolderRequest::new().set_managed_folder_id("example");
2043    /// ```
2044    pub fn set_managed_folder_id<T: std::convert::Into<std::string::String>>(
2045        mut self,
2046        v: T,
2047    ) -> Self {
2048        self.managed_folder_id = v.into();
2049        self
2050    }
2051
2052    /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
2053    ///
2054    /// # Example
2055    /// ```ignore,no_run
2056    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
2057    /// let x = CreateManagedFolderRequest::new().set_request_id("example");
2058    /// ```
2059    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2060        self.request_id = v.into();
2061        self
2062    }
2063}
2064
2065impl wkt::message::Message for CreateManagedFolderRequest {
2066    fn typename() -> &'static str {
2067        "type.googleapis.com/google.storage.control.v2.CreateManagedFolderRequest"
2068    }
2069}
2070
2071/// DeleteManagedFolder RPC request message.
2072#[derive(Clone, Default, PartialEq)]
2073#[non_exhaustive]
2074pub struct DeleteManagedFolderRequest {
2075    /// Required. Name of the managed folder.
2076    /// Format:
2077    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
2078    pub name: std::string::String,
2079
2080    /// The operation succeeds conditional on the managed folder's current
2081    /// metageneration matching the value here specified.
2082    pub if_metageneration_match: std::option::Option<i64>,
2083
2084    /// The operation succeeds conditional on the managed folder's current
2085    /// metageneration NOT matching the value here specified.
2086    pub if_metageneration_not_match: std::option::Option<i64>,
2087
2088    /// Allows deletion of a managed folder even if it is not empty.
2089    /// A managed folder is empty if it manages no child managed folders or
2090    /// objects. Caller must have permission for
2091    /// storage.managedFolders.setIamPolicy.
2092    pub allow_non_empty: bool,
2093
2094    /// Optional. A unique identifier for this request. UUID is the recommended
2095    /// format, but other formats are still accepted.
2096    pub request_id: std::string::String,
2097
2098    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2099}
2100
2101impl DeleteManagedFolderRequest {
2102    pub fn new() -> Self {
2103        std::default::Default::default()
2104    }
2105
2106    /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
2107    ///
2108    /// # Example
2109    /// ```ignore,no_run
2110    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2111    /// let x = DeleteManagedFolderRequest::new().set_name("example");
2112    /// ```
2113    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2114        self.name = v.into();
2115        self
2116    }
2117
2118    /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
2119    ///
2120    /// # Example
2121    /// ```ignore,no_run
2122    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2123    /// let x = DeleteManagedFolderRequest::new().set_if_metageneration_match(42);
2124    /// ```
2125    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
2126    where
2127        T: std::convert::Into<i64>,
2128    {
2129        self.if_metageneration_match = std::option::Option::Some(v.into());
2130        self
2131    }
2132
2133    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
2134    ///
2135    /// # Example
2136    /// ```ignore,no_run
2137    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2138    /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
2139    /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
2140    /// ```
2141    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
2142    where
2143        T: std::convert::Into<i64>,
2144    {
2145        self.if_metageneration_match = v.map(|x| x.into());
2146        self
2147    }
2148
2149    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
2150    ///
2151    /// # Example
2152    /// ```ignore,no_run
2153    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2154    /// let x = DeleteManagedFolderRequest::new().set_if_metageneration_not_match(42);
2155    /// ```
2156    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
2157    where
2158        T: std::convert::Into<i64>,
2159    {
2160        self.if_metageneration_not_match = std::option::Option::Some(v.into());
2161        self
2162    }
2163
2164    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
2165    ///
2166    /// # Example
2167    /// ```ignore,no_run
2168    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2169    /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
2170    /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
2171    /// ```
2172    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
2173    where
2174        T: std::convert::Into<i64>,
2175    {
2176        self.if_metageneration_not_match = v.map(|x| x.into());
2177        self
2178    }
2179
2180    /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
2181    ///
2182    /// # Example
2183    /// ```ignore,no_run
2184    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2185    /// let x = DeleteManagedFolderRequest::new().set_allow_non_empty(true);
2186    /// ```
2187    pub fn set_allow_non_empty<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2188        self.allow_non_empty = v.into();
2189        self
2190    }
2191
2192    /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
2193    ///
2194    /// # Example
2195    /// ```ignore,no_run
2196    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2197    /// let x = DeleteManagedFolderRequest::new().set_request_id("example");
2198    /// ```
2199    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2200        self.request_id = v.into();
2201        self
2202    }
2203}
2204
2205impl wkt::message::Message for DeleteManagedFolderRequest {
2206    fn typename() -> &'static str {
2207        "type.googleapis.com/google.storage.control.v2.DeleteManagedFolderRequest"
2208    }
2209}
2210
2211/// Request message for ListManagedFolders.
2212#[derive(Clone, Default, PartialEq)]
2213#[non_exhaustive]
2214pub struct ListManagedFoldersRequest {
2215    /// Required. Name of the bucket this managed folder belongs to.
2216    pub parent: std::string::String,
2217
2218    /// Optional. Maximum number of managed folders to return in a single response.
2219    /// The service will use this parameter or 1,000 items, whichever is smaller.
2220    pub page_size: i32,
2221
2222    /// Optional. A previously-returned page token representing part of the larger
2223    /// set of results to view.
2224    pub page_token: std::string::String,
2225
2226    /// Optional. Filter results to match managed folders with name starting with
2227    /// this prefix.
2228    pub prefix: std::string::String,
2229
2230    /// Optional. A unique identifier for this request. UUID is the recommended
2231    /// format, but other formats are still accepted.
2232    pub request_id: std::string::String,
2233
2234    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2235}
2236
2237impl ListManagedFoldersRequest {
2238    pub fn new() -> Self {
2239        std::default::Default::default()
2240    }
2241
2242    /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
2243    ///
2244    /// # Example
2245    /// ```ignore,no_run
2246    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2247    /// let x = ListManagedFoldersRequest::new().set_parent("example");
2248    /// ```
2249    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2250        self.parent = v.into();
2251        self
2252    }
2253
2254    /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
2255    ///
2256    /// # Example
2257    /// ```ignore,no_run
2258    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2259    /// let x = ListManagedFoldersRequest::new().set_page_size(42);
2260    /// ```
2261    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2262        self.page_size = v.into();
2263        self
2264    }
2265
2266    /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
2267    ///
2268    /// # Example
2269    /// ```ignore,no_run
2270    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2271    /// let x = ListManagedFoldersRequest::new().set_page_token("example");
2272    /// ```
2273    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2274        self.page_token = v.into();
2275        self
2276    }
2277
2278    /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
2279    ///
2280    /// # Example
2281    /// ```ignore,no_run
2282    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2283    /// let x = ListManagedFoldersRequest::new().set_prefix("example");
2284    /// ```
2285    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2286        self.prefix = v.into();
2287        self
2288    }
2289
2290    /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
2291    ///
2292    /// # Example
2293    /// ```ignore,no_run
2294    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2295    /// let x = ListManagedFoldersRequest::new().set_request_id("example");
2296    /// ```
2297    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2298        self.request_id = v.into();
2299        self
2300    }
2301}
2302
2303impl wkt::message::Message for ListManagedFoldersRequest {
2304    fn typename() -> &'static str {
2305        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersRequest"
2306    }
2307}
2308
2309/// Response message for ListManagedFolders.
2310#[derive(Clone, Default, PartialEq)]
2311#[non_exhaustive]
2312pub struct ListManagedFoldersResponse {
2313    /// The list of matching managed folders
2314    pub managed_folders: std::vec::Vec<crate::model::ManagedFolder>,
2315
2316    /// The continuation token, used to page through large result sets. Provide
2317    /// this value in a subsequent request to return the next page of results.
2318    pub next_page_token: std::string::String,
2319
2320    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2321}
2322
2323impl ListManagedFoldersResponse {
2324    pub fn new() -> Self {
2325        std::default::Default::default()
2326    }
2327
2328    /// Sets the value of [managed_folders][crate::model::ListManagedFoldersResponse::managed_folders].
2329    ///
2330    /// # Example
2331    /// ```ignore,no_run
2332    /// # use google_cloud_storage::model::ListManagedFoldersResponse;
2333    /// use google_cloud_storage::model::ManagedFolder;
2334    /// let x = ListManagedFoldersResponse::new()
2335    ///     .set_managed_folders([
2336    ///         ManagedFolder::default()/* use setters */,
2337    ///         ManagedFolder::default()/* use (different) setters */,
2338    ///     ]);
2339    /// ```
2340    pub fn set_managed_folders<T, V>(mut self, v: T) -> Self
2341    where
2342        T: std::iter::IntoIterator<Item = V>,
2343        V: std::convert::Into<crate::model::ManagedFolder>,
2344    {
2345        use std::iter::Iterator;
2346        self.managed_folders = v.into_iter().map(|i| i.into()).collect();
2347        self
2348    }
2349
2350    /// Sets the value of [next_page_token][crate::model::ListManagedFoldersResponse::next_page_token].
2351    ///
2352    /// # Example
2353    /// ```ignore,no_run
2354    /// # use google_cloud_storage::model::ListManagedFoldersResponse;
2355    /// let x = ListManagedFoldersResponse::new().set_next_page_token("example");
2356    /// ```
2357    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2358        self.next_page_token = v.into();
2359        self
2360    }
2361}
2362
2363impl wkt::message::Message for ListManagedFoldersResponse {
2364    fn typename() -> &'static str {
2365        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersResponse"
2366    }
2367}
2368
2369#[doc(hidden)]
2370impl google_cloud_gax::paginator::internal::PageableResponse for ListManagedFoldersResponse {
2371    type PageItem = crate::model::ManagedFolder;
2372
2373    fn items(self) -> std::vec::Vec<Self::PageItem> {
2374        self.managed_folders
2375    }
2376
2377    fn next_page_token(&self) -> std::string::String {
2378        use std::clone::Clone;
2379        self.next_page_token.clone()
2380    }
2381}
2382
2383/// Message returned in the metadata field of the Operation resource for
2384/// CreateAnywhereCache operations.
2385#[derive(Clone, Default, PartialEq)]
2386#[non_exhaustive]
2387pub struct CreateAnywhereCacheMetadata {
2388    /// Generic metadata for the long running operation.
2389    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
2390
2391    /// Anywhere Cache ID.
2392    pub anywhere_cache_id: std::option::Option<std::string::String>,
2393
2394    /// The zone in which the cache instance is running. For example,
2395    /// us-central1-a.
2396    pub zone: std::option::Option<std::string::String>,
2397
2398    /// Anywhere Cache entry's TTL. A cache-level config that is applied to all new
2399    /// cache entries on admission. Default ttl value (24hrs) is applied if not
2400    /// specified in the create request.
2401    pub ttl: std::option::Option<wkt::Duration>,
2402
2403    /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
2404    /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
2405    /// applied if not specified in the create request.
2406    pub admission_policy: std::option::Option<std::string::String>,
2407
2408    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2409}
2410
2411impl CreateAnywhereCacheMetadata {
2412    pub fn new() -> Self {
2413        std::default::Default::default()
2414    }
2415
2416    /// Sets the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
2417    ///
2418    /// # Example
2419    /// ```ignore,no_run
2420    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2421    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2422    /// let x = CreateAnywhereCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
2423    /// ```
2424    pub fn set_common_metadata<T>(mut self, v: T) -> Self
2425    where
2426        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2427    {
2428        self.common_metadata = std::option::Option::Some(v.into());
2429        self
2430    }
2431
2432    /// Sets or clears the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
2433    ///
2434    /// # Example
2435    /// ```ignore,no_run
2436    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2437    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2438    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
2439    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
2440    /// ```
2441    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2442    where
2443        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2444    {
2445        self.common_metadata = v.map(|x| x.into());
2446        self
2447    }
2448
2449    /// Sets the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
2450    ///
2451    /// # Example
2452    /// ```ignore,no_run
2453    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2454    /// let x = CreateAnywhereCacheMetadata::new().set_anywhere_cache_id("example");
2455    /// ```
2456    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
2457    where
2458        T: std::convert::Into<std::string::String>,
2459    {
2460        self.anywhere_cache_id = std::option::Option::Some(v.into());
2461        self
2462    }
2463
2464    /// Sets or clears the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
2465    ///
2466    /// # Example
2467    /// ```ignore,no_run
2468    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2469    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(Some("example"));
2470    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(None::<String>);
2471    /// ```
2472    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
2473    where
2474        T: std::convert::Into<std::string::String>,
2475    {
2476        self.anywhere_cache_id = v.map(|x| x.into());
2477        self
2478    }
2479
2480    /// Sets the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
2481    ///
2482    /// # Example
2483    /// ```ignore,no_run
2484    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2485    /// let x = CreateAnywhereCacheMetadata::new().set_zone("example");
2486    /// ```
2487    pub fn set_zone<T>(mut self, v: T) -> Self
2488    where
2489        T: std::convert::Into<std::string::String>,
2490    {
2491        self.zone = std::option::Option::Some(v.into());
2492        self
2493    }
2494
2495    /// Sets or clears the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
2496    ///
2497    /// # Example
2498    /// ```ignore,no_run
2499    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2500    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_zone(Some("example"));
2501    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_zone(None::<String>);
2502    /// ```
2503    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
2504    where
2505        T: std::convert::Into<std::string::String>,
2506    {
2507        self.zone = v.map(|x| x.into());
2508        self
2509    }
2510
2511    /// Sets the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
2512    ///
2513    /// # Example
2514    /// ```ignore,no_run
2515    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2516    /// use wkt::Duration;
2517    /// let x = CreateAnywhereCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
2518    /// ```
2519    pub fn set_ttl<T>(mut self, v: T) -> Self
2520    where
2521        T: std::convert::Into<wkt::Duration>,
2522    {
2523        self.ttl = std::option::Option::Some(v.into());
2524        self
2525    }
2526
2527    /// Sets or clears the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
2528    ///
2529    /// # Example
2530    /// ```ignore,no_run
2531    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2532    /// use wkt::Duration;
2533    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2534    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
2535    /// ```
2536    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2537    where
2538        T: std::convert::Into<wkt::Duration>,
2539    {
2540        self.ttl = v.map(|x| x.into());
2541        self
2542    }
2543
2544    /// Sets the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
2545    ///
2546    /// # Example
2547    /// ```ignore,no_run
2548    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2549    /// let x = CreateAnywhereCacheMetadata::new().set_admission_policy("example");
2550    /// ```
2551    pub fn set_admission_policy<T>(mut self, v: T) -> Self
2552    where
2553        T: std::convert::Into<std::string::String>,
2554    {
2555        self.admission_policy = std::option::Option::Some(v.into());
2556        self
2557    }
2558
2559    /// Sets or clears the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
2560    ///
2561    /// # Example
2562    /// ```ignore,no_run
2563    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2564    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
2565    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
2566    /// ```
2567    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
2568    where
2569        T: std::convert::Into<std::string::String>,
2570    {
2571        self.admission_policy = v.map(|x| x.into());
2572        self
2573    }
2574}
2575
2576impl wkt::message::Message for CreateAnywhereCacheMetadata {
2577    fn typename() -> &'static str {
2578        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheMetadata"
2579    }
2580}
2581
2582/// Message returned in the metadata field of the Operation resource for
2583/// UpdateAnywhereCache operation.
2584#[derive(Clone, Default, PartialEq)]
2585#[non_exhaustive]
2586pub struct UpdateAnywhereCacheMetadata {
2587    /// Generic metadata for the long running operation.
2588    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
2589
2590    /// Anywhere Cache ID.
2591    pub anywhere_cache_id: std::option::Option<std::string::String>,
2592
2593    /// The zone in which the cache instance is running. For example,
2594    /// us-central1-a.
2595    pub zone: std::option::Option<std::string::String>,
2596
2597    /// Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that
2598    /// is applied to all new cache entries on admission. If `ttl` is pending
2599    /// update, this field equals to the new value specified in the Update request.
2600    pub ttl: std::option::Option<wkt::Duration>,
2601
2602    /// L4 Cache entry Admission Policy in kebab-case (e.g.,
2603    /// "admit-on-first-miss"). If `admission_policy` is pending
2604    /// update, this field equals to the new value specified in the Update request.
2605    pub admission_policy: std::option::Option<std::string::String>,
2606
2607    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2608}
2609
2610impl UpdateAnywhereCacheMetadata {
2611    pub fn new() -> Self {
2612        std::default::Default::default()
2613    }
2614
2615    /// Sets the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
2616    ///
2617    /// # Example
2618    /// ```ignore,no_run
2619    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2620    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2621    /// let x = UpdateAnywhereCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
2622    /// ```
2623    pub fn set_common_metadata<T>(mut self, v: T) -> Self
2624    where
2625        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2626    {
2627        self.common_metadata = std::option::Option::Some(v.into());
2628        self
2629    }
2630
2631    /// Sets or clears the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
2632    ///
2633    /// # Example
2634    /// ```ignore,no_run
2635    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2636    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2637    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
2638    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
2639    /// ```
2640    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2641    where
2642        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2643    {
2644        self.common_metadata = v.map(|x| x.into());
2645        self
2646    }
2647
2648    /// Sets the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
2649    ///
2650    /// # Example
2651    /// ```ignore,no_run
2652    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2653    /// let x = UpdateAnywhereCacheMetadata::new().set_anywhere_cache_id("example");
2654    /// ```
2655    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
2656    where
2657        T: std::convert::Into<std::string::String>,
2658    {
2659        self.anywhere_cache_id = std::option::Option::Some(v.into());
2660        self
2661    }
2662
2663    /// Sets or clears the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
2664    ///
2665    /// # Example
2666    /// ```ignore,no_run
2667    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2668    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(Some("example"));
2669    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(None::<String>);
2670    /// ```
2671    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
2672    where
2673        T: std::convert::Into<std::string::String>,
2674    {
2675        self.anywhere_cache_id = v.map(|x| x.into());
2676        self
2677    }
2678
2679    /// Sets the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
2680    ///
2681    /// # Example
2682    /// ```ignore,no_run
2683    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2684    /// let x = UpdateAnywhereCacheMetadata::new().set_zone("example");
2685    /// ```
2686    pub fn set_zone<T>(mut self, v: T) -> Self
2687    where
2688        T: std::convert::Into<std::string::String>,
2689    {
2690        self.zone = std::option::Option::Some(v.into());
2691        self
2692    }
2693
2694    /// Sets or clears the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
2695    ///
2696    /// # Example
2697    /// ```ignore,no_run
2698    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2699    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_zone(Some("example"));
2700    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_zone(None::<String>);
2701    /// ```
2702    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
2703    where
2704        T: std::convert::Into<std::string::String>,
2705    {
2706        self.zone = v.map(|x| x.into());
2707        self
2708    }
2709
2710    /// Sets the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
2711    ///
2712    /// # Example
2713    /// ```ignore,no_run
2714    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2715    /// use wkt::Duration;
2716    /// let x = UpdateAnywhereCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
2717    /// ```
2718    pub fn set_ttl<T>(mut self, v: T) -> Self
2719    where
2720        T: std::convert::Into<wkt::Duration>,
2721    {
2722        self.ttl = std::option::Option::Some(v.into());
2723        self
2724    }
2725
2726    /// Sets or clears the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
2727    ///
2728    /// # Example
2729    /// ```ignore,no_run
2730    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2731    /// use wkt::Duration;
2732    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2733    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
2734    /// ```
2735    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2736    where
2737        T: std::convert::Into<wkt::Duration>,
2738    {
2739        self.ttl = v.map(|x| x.into());
2740        self
2741    }
2742
2743    /// Sets the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
2744    ///
2745    /// # Example
2746    /// ```ignore,no_run
2747    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2748    /// let x = UpdateAnywhereCacheMetadata::new().set_admission_policy("example");
2749    /// ```
2750    pub fn set_admission_policy<T>(mut self, v: T) -> Self
2751    where
2752        T: std::convert::Into<std::string::String>,
2753    {
2754        self.admission_policy = std::option::Option::Some(v.into());
2755        self
2756    }
2757
2758    /// Sets or clears the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
2759    ///
2760    /// # Example
2761    /// ```ignore,no_run
2762    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2763    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
2764    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
2765    /// ```
2766    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
2767    where
2768        T: std::convert::Into<std::string::String>,
2769    {
2770        self.admission_policy = v.map(|x| x.into());
2771        self
2772    }
2773}
2774
2775impl wkt::message::Message for UpdateAnywhereCacheMetadata {
2776    fn typename() -> &'static str {
2777        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheMetadata"
2778    }
2779}
2780
2781/// An Anywhere Cache Instance.
2782#[derive(Clone, Default, PartialEq)]
2783#[non_exhaustive]
2784pub struct AnywhereCache {
2785    /// Immutable. The resource name of this AnywhereCache.
2786    /// Format:
2787    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
2788    pub name: std::string::String,
2789
2790    /// Immutable. The zone in which the cache instance is running. For example,
2791    /// us-central1-a.
2792    pub zone: std::string::String,
2793
2794    /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
2795    /// that defines how long a cache entry can live. Default ttl value (24hrs)
2796    /// is applied if not specified in the create request. TTL must be in whole
2797    /// seconds.
2798    pub ttl: std::option::Option<wkt::Duration>,
2799
2800    /// Cache admission policy. Valid policies includes:
2801    /// `admit-on-first-miss` and `admit-on-second-miss`. Defaults to
2802    /// `admit-on-first-miss`. Default value is applied if not specified in the
2803    /// create request.
2804    pub admission_policy: std::string::String,
2805
2806    /// Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED.
2807    pub state: std::string::String,
2808
2809    /// Output only. Time when Anywhere cache instance is allocated.
2810    pub create_time: std::option::Option<wkt::Timestamp>,
2811
2812    /// Output only. Time when Anywhere cache instance is last updated, including
2813    /// creation.
2814    pub update_time: std::option::Option<wkt::Timestamp>,
2815
2816    /// Output only. True if there is an active update operation against this cache
2817    /// instance. Subsequential update requests will be rejected if this field is
2818    /// true. Output only.
2819    pub pending_update: bool,
2820
2821    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2822}
2823
2824impl AnywhereCache {
2825    pub fn new() -> Self {
2826        std::default::Default::default()
2827    }
2828
2829    /// Sets the value of [name][crate::model::AnywhereCache::name].
2830    ///
2831    /// # Example
2832    /// ```ignore,no_run
2833    /// # use google_cloud_storage::model::AnywhereCache;
2834    /// let x = AnywhereCache::new().set_name("example");
2835    /// ```
2836    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2837        self.name = v.into();
2838        self
2839    }
2840
2841    /// Sets the value of [zone][crate::model::AnywhereCache::zone].
2842    ///
2843    /// # Example
2844    /// ```ignore,no_run
2845    /// # use google_cloud_storage::model::AnywhereCache;
2846    /// let x = AnywhereCache::new().set_zone("example");
2847    /// ```
2848    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2849        self.zone = v.into();
2850        self
2851    }
2852
2853    /// Sets the value of [ttl][crate::model::AnywhereCache::ttl].
2854    ///
2855    /// # Example
2856    /// ```ignore,no_run
2857    /// # use google_cloud_storage::model::AnywhereCache;
2858    /// use wkt::Duration;
2859    /// let x = AnywhereCache::new().set_ttl(Duration::default()/* use setters */);
2860    /// ```
2861    pub fn set_ttl<T>(mut self, v: T) -> Self
2862    where
2863        T: std::convert::Into<wkt::Duration>,
2864    {
2865        self.ttl = std::option::Option::Some(v.into());
2866        self
2867    }
2868
2869    /// Sets or clears the value of [ttl][crate::model::AnywhereCache::ttl].
2870    ///
2871    /// # Example
2872    /// ```ignore,no_run
2873    /// # use google_cloud_storage::model::AnywhereCache;
2874    /// use wkt::Duration;
2875    /// let x = AnywhereCache::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2876    /// let x = AnywhereCache::new().set_or_clear_ttl(None::<Duration>);
2877    /// ```
2878    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2879    where
2880        T: std::convert::Into<wkt::Duration>,
2881    {
2882        self.ttl = v.map(|x| x.into());
2883        self
2884    }
2885
2886    /// Sets the value of [admission_policy][crate::model::AnywhereCache::admission_policy].
2887    ///
2888    /// # Example
2889    /// ```ignore,no_run
2890    /// # use google_cloud_storage::model::AnywhereCache;
2891    /// let x = AnywhereCache::new().set_admission_policy("example");
2892    /// ```
2893    pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
2894        mut self,
2895        v: T,
2896    ) -> Self {
2897        self.admission_policy = v.into();
2898        self
2899    }
2900
2901    /// Sets the value of [state][crate::model::AnywhereCache::state].
2902    ///
2903    /// # Example
2904    /// ```ignore,no_run
2905    /// # use google_cloud_storage::model::AnywhereCache;
2906    /// let x = AnywhereCache::new().set_state("example");
2907    /// ```
2908    pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2909        self.state = v.into();
2910        self
2911    }
2912
2913    /// Sets the value of [create_time][crate::model::AnywhereCache::create_time].
2914    ///
2915    /// # Example
2916    /// ```ignore,no_run
2917    /// # use google_cloud_storage::model::AnywhereCache;
2918    /// use wkt::Timestamp;
2919    /// let x = AnywhereCache::new().set_create_time(Timestamp::default()/* use setters */);
2920    /// ```
2921    pub fn set_create_time<T>(mut self, v: T) -> Self
2922    where
2923        T: std::convert::Into<wkt::Timestamp>,
2924    {
2925        self.create_time = std::option::Option::Some(v.into());
2926        self
2927    }
2928
2929    /// Sets or clears the value of [create_time][crate::model::AnywhereCache::create_time].
2930    ///
2931    /// # Example
2932    /// ```ignore,no_run
2933    /// # use google_cloud_storage::model::AnywhereCache;
2934    /// use wkt::Timestamp;
2935    /// let x = AnywhereCache::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2936    /// let x = AnywhereCache::new().set_or_clear_create_time(None::<Timestamp>);
2937    /// ```
2938    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2939    where
2940        T: std::convert::Into<wkt::Timestamp>,
2941    {
2942        self.create_time = v.map(|x| x.into());
2943        self
2944    }
2945
2946    /// Sets the value of [update_time][crate::model::AnywhereCache::update_time].
2947    ///
2948    /// # Example
2949    /// ```ignore,no_run
2950    /// # use google_cloud_storage::model::AnywhereCache;
2951    /// use wkt::Timestamp;
2952    /// let x = AnywhereCache::new().set_update_time(Timestamp::default()/* use setters */);
2953    /// ```
2954    pub fn set_update_time<T>(mut self, v: T) -> Self
2955    where
2956        T: std::convert::Into<wkt::Timestamp>,
2957    {
2958        self.update_time = std::option::Option::Some(v.into());
2959        self
2960    }
2961
2962    /// Sets or clears the value of [update_time][crate::model::AnywhereCache::update_time].
2963    ///
2964    /// # Example
2965    /// ```ignore,no_run
2966    /// # use google_cloud_storage::model::AnywhereCache;
2967    /// use wkt::Timestamp;
2968    /// let x = AnywhereCache::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2969    /// let x = AnywhereCache::new().set_or_clear_update_time(None::<Timestamp>);
2970    /// ```
2971    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2972    where
2973        T: std::convert::Into<wkt::Timestamp>,
2974    {
2975        self.update_time = v.map(|x| x.into());
2976        self
2977    }
2978
2979    /// Sets the value of [pending_update][crate::model::AnywhereCache::pending_update].
2980    ///
2981    /// # Example
2982    /// ```ignore,no_run
2983    /// # use google_cloud_storage::model::AnywhereCache;
2984    /// let x = AnywhereCache::new().set_pending_update(true);
2985    /// ```
2986    pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2987        self.pending_update = v.into();
2988        self
2989    }
2990}
2991
2992impl wkt::message::Message for AnywhereCache {
2993    fn typename() -> &'static str {
2994        "type.googleapis.com/google.storage.control.v2.AnywhereCache"
2995    }
2996}
2997
2998/// Request message for CreateAnywhereCache.
2999#[derive(Clone, Default, PartialEq)]
3000#[non_exhaustive]
3001pub struct CreateAnywhereCacheRequest {
3002    /// Required. The bucket to which this cache belongs.
3003    /// Format: `projects/{project}/buckets/{bucket}`
3004    pub parent: std::string::String,
3005
3006    /// Required. Properties of the Anywhere Cache instance being created.
3007    /// The parent bucket name is specified in the `parent` field. Server uses the
3008    /// default value of `ttl` or `admission_policy` if not specified in
3009    /// request.
3010    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
3011
3012    /// Optional. A unique identifier for this request. UUID is the recommended
3013    /// format, but other formats are still accepted. This request is only
3014    /// idempotent if a `request_id` is provided.
3015    pub request_id: std::string::String,
3016
3017    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3018}
3019
3020impl CreateAnywhereCacheRequest {
3021    pub fn new() -> Self {
3022        std::default::Default::default()
3023    }
3024
3025    /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
3026    ///
3027    /// # Example
3028    /// ```ignore,no_run
3029    /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
3030    /// let x = CreateAnywhereCacheRequest::new().set_parent("example");
3031    /// ```
3032    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3033        self.parent = v.into();
3034        self
3035    }
3036
3037    /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
3038    ///
3039    /// # Example
3040    /// ```ignore,no_run
3041    /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
3042    /// use google_cloud_storage::model::AnywhereCache;
3043    /// let x = CreateAnywhereCacheRequest::new().set_anywhere_cache(AnywhereCache::default()/* use setters */);
3044    /// ```
3045    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
3046    where
3047        T: std::convert::Into<crate::model::AnywhereCache>,
3048    {
3049        self.anywhere_cache = std::option::Option::Some(v.into());
3050        self
3051    }
3052
3053    /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
3054    ///
3055    /// # Example
3056    /// ```ignore,no_run
3057    /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
3058    /// use google_cloud_storage::model::AnywhereCache;
3059    /// let x = CreateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(Some(AnywhereCache::default()/* use setters */));
3060    /// let x = CreateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(None::<AnywhereCache>);
3061    /// ```
3062    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
3063    where
3064        T: std::convert::Into<crate::model::AnywhereCache>,
3065    {
3066        self.anywhere_cache = v.map(|x| x.into());
3067        self
3068    }
3069
3070    /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
3071    ///
3072    /// # Example
3073    /// ```ignore,no_run
3074    /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
3075    /// let x = CreateAnywhereCacheRequest::new().set_request_id("example");
3076    /// ```
3077    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3078        self.request_id = v.into();
3079        self
3080    }
3081}
3082
3083impl wkt::message::Message for CreateAnywhereCacheRequest {
3084    fn typename() -> &'static str {
3085        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheRequest"
3086    }
3087}
3088
3089/// Request message for UpdateAnywhereCache.
3090#[derive(Clone, Default, PartialEq)]
3091#[non_exhaustive]
3092pub struct UpdateAnywhereCacheRequest {
3093    /// Required. The Anywhere Cache instance to be updated.
3094    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
3095
3096    /// Required. List of fields to be updated. Mutable fields of AnywhereCache
3097    /// include `ttl` and `admission_policy`.
3098    ///
3099    /// To specify ALL fields, specify a single field with the value `*`. Note: We
3100    /// recommend against doing this. If a new field is introduced at a later time,
3101    /// an older client updating with the `*` may accidentally reset the new
3102    /// field's value.
3103    ///
3104    /// Not specifying any fields is an error.
3105    pub update_mask: std::option::Option<wkt::FieldMask>,
3106
3107    /// Optional. A unique identifier for this request. UUID is the recommended
3108    /// format, but other formats are still accepted. This request is only
3109    /// idempotent if a `request_id` is provided.
3110    pub request_id: std::string::String,
3111
3112    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3113}
3114
3115impl UpdateAnywhereCacheRequest {
3116    pub fn new() -> Self {
3117        std::default::Default::default()
3118    }
3119
3120    /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
3121    ///
3122    /// # Example
3123    /// ```ignore,no_run
3124    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3125    /// use google_cloud_storage::model::AnywhereCache;
3126    /// let x = UpdateAnywhereCacheRequest::new().set_anywhere_cache(AnywhereCache::default()/* use setters */);
3127    /// ```
3128    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
3129    where
3130        T: std::convert::Into<crate::model::AnywhereCache>,
3131    {
3132        self.anywhere_cache = std::option::Option::Some(v.into());
3133        self
3134    }
3135
3136    /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
3137    ///
3138    /// # Example
3139    /// ```ignore,no_run
3140    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3141    /// use google_cloud_storage::model::AnywhereCache;
3142    /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(Some(AnywhereCache::default()/* use setters */));
3143    /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(None::<AnywhereCache>);
3144    /// ```
3145    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
3146    where
3147        T: std::convert::Into<crate::model::AnywhereCache>,
3148    {
3149        self.anywhere_cache = v.map(|x| x.into());
3150        self
3151    }
3152
3153    /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
3154    ///
3155    /// # Example
3156    /// ```ignore,no_run
3157    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3158    /// use wkt::FieldMask;
3159    /// let x = UpdateAnywhereCacheRequest::new().set_update_mask(FieldMask::default()/* use setters */);
3160    /// ```
3161    pub fn set_update_mask<T>(mut self, v: T) -> Self
3162    where
3163        T: std::convert::Into<wkt::FieldMask>,
3164    {
3165        self.update_mask = std::option::Option::Some(v.into());
3166        self
3167    }
3168
3169    /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
3170    ///
3171    /// # Example
3172    /// ```ignore,no_run
3173    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3174    /// use wkt::FieldMask;
3175    /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
3176    /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_update_mask(None::<FieldMask>);
3177    /// ```
3178    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3179    where
3180        T: std::convert::Into<wkt::FieldMask>,
3181    {
3182        self.update_mask = v.map(|x| x.into());
3183        self
3184    }
3185
3186    /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
3187    ///
3188    /// # Example
3189    /// ```ignore,no_run
3190    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
3191    /// let x = UpdateAnywhereCacheRequest::new().set_request_id("example");
3192    /// ```
3193    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3194        self.request_id = v.into();
3195        self
3196    }
3197}
3198
3199impl wkt::message::Message for UpdateAnywhereCacheRequest {
3200    fn typename() -> &'static str {
3201        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheRequest"
3202    }
3203}
3204
3205/// Request message for DisableAnywhereCache.
3206#[derive(Clone, Default, PartialEq)]
3207#[non_exhaustive]
3208pub struct DisableAnywhereCacheRequest {
3209    /// Required. The name field in the request should be:
3210    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3211    pub name: std::string::String,
3212
3213    /// Optional. A unique identifier for this request. UUID is the recommended
3214    /// format, but other formats are still accepted. This request is only
3215    /// idempotent if a `request_id` is provided.
3216    pub request_id: std::string::String,
3217
3218    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3219}
3220
3221impl DisableAnywhereCacheRequest {
3222    pub fn new() -> Self {
3223        std::default::Default::default()
3224    }
3225
3226    /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
3227    ///
3228    /// # Example
3229    /// ```ignore,no_run
3230    /// # use google_cloud_storage::model::DisableAnywhereCacheRequest;
3231    /// let x = DisableAnywhereCacheRequest::new().set_name("example");
3232    /// ```
3233    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3234        self.name = v.into();
3235        self
3236    }
3237
3238    /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
3239    ///
3240    /// # Example
3241    /// ```ignore,no_run
3242    /// # use google_cloud_storage::model::DisableAnywhereCacheRequest;
3243    /// let x = DisableAnywhereCacheRequest::new().set_request_id("example");
3244    /// ```
3245    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3246        self.request_id = v.into();
3247        self
3248    }
3249}
3250
3251impl wkt::message::Message for DisableAnywhereCacheRequest {
3252    fn typename() -> &'static str {
3253        "type.googleapis.com/google.storage.control.v2.DisableAnywhereCacheRequest"
3254    }
3255}
3256
3257/// Request message for PauseAnywhereCache.
3258#[derive(Clone, Default, PartialEq)]
3259#[non_exhaustive]
3260pub struct PauseAnywhereCacheRequest {
3261    /// Required. The name field in the request should be:
3262    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3263    pub name: std::string::String,
3264
3265    /// Optional. A unique identifier for this request. UUID is the recommended
3266    /// format, but other formats are still accepted. This request is only
3267    /// idempotent if a `request_id` is provided.
3268    pub request_id: std::string::String,
3269
3270    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3271}
3272
3273impl PauseAnywhereCacheRequest {
3274    pub fn new() -> Self {
3275        std::default::Default::default()
3276    }
3277
3278    /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
3279    ///
3280    /// # Example
3281    /// ```ignore,no_run
3282    /// # use google_cloud_storage::model::PauseAnywhereCacheRequest;
3283    /// let x = PauseAnywhereCacheRequest::new().set_name("example");
3284    /// ```
3285    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3286        self.name = v.into();
3287        self
3288    }
3289
3290    /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
3291    ///
3292    /// # Example
3293    /// ```ignore,no_run
3294    /// # use google_cloud_storage::model::PauseAnywhereCacheRequest;
3295    /// let x = PauseAnywhereCacheRequest::new().set_request_id("example");
3296    /// ```
3297    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3298        self.request_id = v.into();
3299        self
3300    }
3301}
3302
3303impl wkt::message::Message for PauseAnywhereCacheRequest {
3304    fn typename() -> &'static str {
3305        "type.googleapis.com/google.storage.control.v2.PauseAnywhereCacheRequest"
3306    }
3307}
3308
3309/// Request message for ResumeAnywhereCache.
3310#[derive(Clone, Default, PartialEq)]
3311#[non_exhaustive]
3312pub struct ResumeAnywhereCacheRequest {
3313    /// Required. The name field in the request should be:
3314    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3315    pub name: std::string::String,
3316
3317    /// Optional. A unique identifier for this request. UUID is the recommended
3318    /// format, but other formats are still accepted. This request is only
3319    /// idempotent if a `request_id` is provided.
3320    pub request_id: std::string::String,
3321
3322    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3323}
3324
3325impl ResumeAnywhereCacheRequest {
3326    pub fn new() -> Self {
3327        std::default::Default::default()
3328    }
3329
3330    /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
3331    ///
3332    /// # Example
3333    /// ```ignore,no_run
3334    /// # use google_cloud_storage::model::ResumeAnywhereCacheRequest;
3335    /// let x = ResumeAnywhereCacheRequest::new().set_name("example");
3336    /// ```
3337    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3338        self.name = v.into();
3339        self
3340    }
3341
3342    /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
3343    ///
3344    /// # Example
3345    /// ```ignore,no_run
3346    /// # use google_cloud_storage::model::ResumeAnywhereCacheRequest;
3347    /// let x = ResumeAnywhereCacheRequest::new().set_request_id("example");
3348    /// ```
3349    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3350        self.request_id = v.into();
3351        self
3352    }
3353}
3354
3355impl wkt::message::Message for ResumeAnywhereCacheRequest {
3356    fn typename() -> &'static str {
3357        "type.googleapis.com/google.storage.control.v2.ResumeAnywhereCacheRequest"
3358    }
3359}
3360
3361/// Request message for GetAnywhereCache.
3362#[derive(Clone, Default, PartialEq)]
3363#[non_exhaustive]
3364pub struct GetAnywhereCacheRequest {
3365    /// Required. The name field in the request should be:
3366    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3367    pub name: std::string::String,
3368
3369    /// Optional. A unique identifier for this request. UUID is the recommended
3370    /// format, but other formats are still accepted.
3371    pub request_id: std::string::String,
3372
3373    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3374}
3375
3376impl GetAnywhereCacheRequest {
3377    pub fn new() -> Self {
3378        std::default::Default::default()
3379    }
3380
3381    /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
3382    ///
3383    /// # Example
3384    /// ```ignore,no_run
3385    /// # use google_cloud_storage::model::GetAnywhereCacheRequest;
3386    /// let x = GetAnywhereCacheRequest::new().set_name("example");
3387    /// ```
3388    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3389        self.name = v.into();
3390        self
3391    }
3392
3393    /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
3394    ///
3395    /// # Example
3396    /// ```ignore,no_run
3397    /// # use google_cloud_storage::model::GetAnywhereCacheRequest;
3398    /// let x = GetAnywhereCacheRequest::new().set_request_id("example");
3399    /// ```
3400    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3401        self.request_id = v.into();
3402        self
3403    }
3404}
3405
3406impl wkt::message::Message for GetAnywhereCacheRequest {
3407    fn typename() -> &'static str {
3408        "type.googleapis.com/google.storage.control.v2.GetAnywhereCacheRequest"
3409    }
3410}
3411
3412/// Request message for ListAnywhereCaches.
3413#[derive(Clone, Default, PartialEq)]
3414#[non_exhaustive]
3415pub struct ListAnywhereCachesRequest {
3416    /// Required. The bucket to which this cache belongs.
3417    pub parent: std::string::String,
3418
3419    /// Maximum number of caches to return in a single response.
3420    /// The service will use this parameter or 1,000 items, whichever is smaller.
3421    pub page_size: i32,
3422
3423    /// A previously-returned page token representing part of the larger set of
3424    /// results to view.
3425    pub page_token: std::string::String,
3426
3427    /// Optional. A unique identifier for this request. UUID is the recommended
3428    /// format, but other formats are still accepted.
3429    pub request_id: std::string::String,
3430
3431    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3432}
3433
3434impl ListAnywhereCachesRequest {
3435    pub fn new() -> Self {
3436        std::default::Default::default()
3437    }
3438
3439    /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
3440    ///
3441    /// # Example
3442    /// ```ignore,no_run
3443    /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3444    /// let x = ListAnywhereCachesRequest::new().set_parent("example");
3445    /// ```
3446    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3447        self.parent = v.into();
3448        self
3449    }
3450
3451    /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
3452    ///
3453    /// # Example
3454    /// ```ignore,no_run
3455    /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3456    /// let x = ListAnywhereCachesRequest::new().set_page_size(42);
3457    /// ```
3458    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3459        self.page_size = v.into();
3460        self
3461    }
3462
3463    /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
3464    ///
3465    /// # Example
3466    /// ```ignore,no_run
3467    /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3468    /// let x = ListAnywhereCachesRequest::new().set_page_token("example");
3469    /// ```
3470    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3471        self.page_token = v.into();
3472        self
3473    }
3474
3475    /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
3476    ///
3477    /// # Example
3478    /// ```ignore,no_run
3479    /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3480    /// let x = ListAnywhereCachesRequest::new().set_request_id("example");
3481    /// ```
3482    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3483        self.request_id = v.into();
3484        self
3485    }
3486}
3487
3488impl wkt::message::Message for ListAnywhereCachesRequest {
3489    fn typename() -> &'static str {
3490        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesRequest"
3491    }
3492}
3493
3494/// Response message for ListAnywhereCaches.
3495#[derive(Clone, Default, PartialEq)]
3496#[non_exhaustive]
3497pub struct ListAnywhereCachesResponse {
3498    /// The list of items.
3499    pub anywhere_caches: std::vec::Vec<crate::model::AnywhereCache>,
3500
3501    /// A token, which can be sent as `page_token` to retrieve the next page.
3502    /// If this field is omitted, there are no subsequent pages.
3503    pub next_page_token: std::string::String,
3504
3505    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3506}
3507
3508impl ListAnywhereCachesResponse {
3509    pub fn new() -> Self {
3510        std::default::Default::default()
3511    }
3512
3513    /// Sets the value of [anywhere_caches][crate::model::ListAnywhereCachesResponse::anywhere_caches].
3514    ///
3515    /// # Example
3516    /// ```ignore,no_run
3517    /// # use google_cloud_storage::model::ListAnywhereCachesResponse;
3518    /// use google_cloud_storage::model::AnywhereCache;
3519    /// let x = ListAnywhereCachesResponse::new()
3520    ///     .set_anywhere_caches([
3521    ///         AnywhereCache::default()/* use setters */,
3522    ///         AnywhereCache::default()/* use (different) setters */,
3523    ///     ]);
3524    /// ```
3525    pub fn set_anywhere_caches<T, V>(mut self, v: T) -> Self
3526    where
3527        T: std::iter::IntoIterator<Item = V>,
3528        V: std::convert::Into<crate::model::AnywhereCache>,
3529    {
3530        use std::iter::Iterator;
3531        self.anywhere_caches = v.into_iter().map(|i| i.into()).collect();
3532        self
3533    }
3534
3535    /// Sets the value of [next_page_token][crate::model::ListAnywhereCachesResponse::next_page_token].
3536    ///
3537    /// # Example
3538    /// ```ignore,no_run
3539    /// # use google_cloud_storage::model::ListAnywhereCachesResponse;
3540    /// let x = ListAnywhereCachesResponse::new().set_next_page_token("example");
3541    /// ```
3542    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3543        self.next_page_token = v.into();
3544        self
3545    }
3546}
3547
3548impl wkt::message::Message for ListAnywhereCachesResponse {
3549    fn typename() -> &'static str {
3550        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesResponse"
3551    }
3552}
3553
3554#[doc(hidden)]
3555impl google_cloud_gax::paginator::internal::PageableResponse for ListAnywhereCachesResponse {
3556    type PageItem = crate::model::AnywhereCache;
3557
3558    fn items(self) -> std::vec::Vec<Self::PageItem> {
3559        self.anywhere_caches
3560    }
3561
3562    fn next_page_token(&self) -> std::string::String {
3563        use std::clone::Clone;
3564        self.next_page_token.clone()
3565    }
3566}
3567
3568/// The `IntelligenceConfig` resource associated with your organization, folder,
3569/// or project.
3570#[derive(Clone, Default, PartialEq)]
3571#[non_exhaustive]
3572pub struct IntelligenceConfig {
3573    /// Identifier. The name of the `IntelligenceConfig` resource associated with
3574    /// your organization, folder, or project.
3575    ///
3576    /// The name format varies based on the GCP resource hierarchy as follows:
3577    ///
3578    /// * For project:
3579    ///   `projects/{project_number}/locations/global/intelligenceConfig`
3580    /// * For organization:
3581    ///   `organizations/{org_id}/locations/global/intelligenceConfig`
3582    /// * For folder: `folders/{folder_id}/locations/global/intelligenceConfig`
3583    pub name: std::string::String,
3584
3585    /// Optional. The edition configuration of the `IntelligenceConfig` resource.
3586    pub edition_config: crate::model::intelligence_config::EditionConfig,
3587
3588    /// Output only. The time at which the `IntelligenceConfig` resource is last
3589    /// updated.
3590    pub update_time: std::option::Option<wkt::Timestamp>,
3591
3592    /// Optional. Filter over location and bucket.
3593    pub filter: std::option::Option<crate::model::intelligence_config::Filter>,
3594
3595    /// Output only. The `IntelligenceConfig` resource that is applicable for the
3596    /// resource.
3597    pub effective_intelligence_config:
3598        std::option::Option<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3599
3600    /// The trial configuration of the `IntelligenceConfig` resource.
3601    pub trial_config: std::option::Option<crate::model::intelligence_config::TrialConfig>,
3602
3603    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3604}
3605
3606impl IntelligenceConfig {
3607    pub fn new() -> Self {
3608        std::default::Default::default()
3609    }
3610
3611    /// Sets the value of [name][crate::model::IntelligenceConfig::name].
3612    ///
3613    /// # Example
3614    /// ```ignore,no_run
3615    /// # use google_cloud_storage::model::IntelligenceConfig;
3616    /// let x = IntelligenceConfig::new().set_name("example");
3617    /// ```
3618    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3619        self.name = v.into();
3620        self
3621    }
3622
3623    /// Sets the value of [edition_config][crate::model::IntelligenceConfig::edition_config].
3624    ///
3625    /// # Example
3626    /// ```ignore,no_run
3627    /// # use google_cloud_storage::model::IntelligenceConfig;
3628    /// use google_cloud_storage::model::intelligence_config::EditionConfig;
3629    /// let x0 = IntelligenceConfig::new().set_edition_config(EditionConfig::Inherit);
3630    /// let x1 = IntelligenceConfig::new().set_edition_config(EditionConfig::Disabled);
3631    /// let x2 = IntelligenceConfig::new().set_edition_config(EditionConfig::Standard);
3632    /// ```
3633    pub fn set_edition_config<
3634        T: std::convert::Into<crate::model::intelligence_config::EditionConfig>,
3635    >(
3636        mut self,
3637        v: T,
3638    ) -> Self {
3639        self.edition_config = v.into();
3640        self
3641    }
3642
3643    /// Sets the value of [update_time][crate::model::IntelligenceConfig::update_time].
3644    ///
3645    /// # Example
3646    /// ```ignore,no_run
3647    /// # use google_cloud_storage::model::IntelligenceConfig;
3648    /// use wkt::Timestamp;
3649    /// let x = IntelligenceConfig::new().set_update_time(Timestamp::default()/* use setters */);
3650    /// ```
3651    pub fn set_update_time<T>(mut self, v: T) -> Self
3652    where
3653        T: std::convert::Into<wkt::Timestamp>,
3654    {
3655        self.update_time = std::option::Option::Some(v.into());
3656        self
3657    }
3658
3659    /// Sets or clears the value of [update_time][crate::model::IntelligenceConfig::update_time].
3660    ///
3661    /// # Example
3662    /// ```ignore,no_run
3663    /// # use google_cloud_storage::model::IntelligenceConfig;
3664    /// use wkt::Timestamp;
3665    /// let x = IntelligenceConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3666    /// let x = IntelligenceConfig::new().set_or_clear_update_time(None::<Timestamp>);
3667    /// ```
3668    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3669    where
3670        T: std::convert::Into<wkt::Timestamp>,
3671    {
3672        self.update_time = v.map(|x| x.into());
3673        self
3674    }
3675
3676    /// Sets the value of [filter][crate::model::IntelligenceConfig::filter].
3677    ///
3678    /// # Example
3679    /// ```ignore,no_run
3680    /// # use google_cloud_storage::model::IntelligenceConfig;
3681    /// use google_cloud_storage::model::intelligence_config::Filter;
3682    /// let x = IntelligenceConfig::new().set_filter(Filter::default()/* use setters */);
3683    /// ```
3684    pub fn set_filter<T>(mut self, v: T) -> Self
3685    where
3686        T: std::convert::Into<crate::model::intelligence_config::Filter>,
3687    {
3688        self.filter = std::option::Option::Some(v.into());
3689        self
3690    }
3691
3692    /// Sets or clears the value of [filter][crate::model::IntelligenceConfig::filter].
3693    ///
3694    /// # Example
3695    /// ```ignore,no_run
3696    /// # use google_cloud_storage::model::IntelligenceConfig;
3697    /// use google_cloud_storage::model::intelligence_config::Filter;
3698    /// let x = IntelligenceConfig::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
3699    /// let x = IntelligenceConfig::new().set_or_clear_filter(None::<Filter>);
3700    /// ```
3701    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3702    where
3703        T: std::convert::Into<crate::model::intelligence_config::Filter>,
3704    {
3705        self.filter = v.map(|x| x.into());
3706        self
3707    }
3708
3709    /// Sets the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
3710    ///
3711    /// # Example
3712    /// ```ignore,no_run
3713    /// # use google_cloud_storage::model::IntelligenceConfig;
3714    /// use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
3715    /// let x = IntelligenceConfig::new().set_effective_intelligence_config(EffectiveIntelligenceConfig::default()/* use setters */);
3716    /// ```
3717    pub fn set_effective_intelligence_config<T>(mut self, v: T) -> Self
3718    where
3719        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3720    {
3721        self.effective_intelligence_config = std::option::Option::Some(v.into());
3722        self
3723    }
3724
3725    /// Sets or clears the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
3726    ///
3727    /// # Example
3728    /// ```ignore,no_run
3729    /// # use google_cloud_storage::model::IntelligenceConfig;
3730    /// use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
3731    /// let x = IntelligenceConfig::new().set_or_clear_effective_intelligence_config(Some(EffectiveIntelligenceConfig::default()/* use setters */));
3732    /// let x = IntelligenceConfig::new().set_or_clear_effective_intelligence_config(None::<EffectiveIntelligenceConfig>);
3733    /// ```
3734    pub fn set_or_clear_effective_intelligence_config<T>(
3735        mut self,
3736        v: std::option::Option<T>,
3737    ) -> Self
3738    where
3739        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3740    {
3741        self.effective_intelligence_config = v.map(|x| x.into());
3742        self
3743    }
3744
3745    /// Sets the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
3746    ///
3747    /// # Example
3748    /// ```ignore,no_run
3749    /// # use google_cloud_storage::model::IntelligenceConfig;
3750    /// use google_cloud_storage::model::intelligence_config::TrialConfig;
3751    /// let x = IntelligenceConfig::new().set_trial_config(TrialConfig::default()/* use setters */);
3752    /// ```
3753    pub fn set_trial_config<T>(mut self, v: T) -> Self
3754    where
3755        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
3756    {
3757        self.trial_config = std::option::Option::Some(v.into());
3758        self
3759    }
3760
3761    /// Sets or clears the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
3762    ///
3763    /// # Example
3764    /// ```ignore,no_run
3765    /// # use google_cloud_storage::model::IntelligenceConfig;
3766    /// use google_cloud_storage::model::intelligence_config::TrialConfig;
3767    /// let x = IntelligenceConfig::new().set_or_clear_trial_config(Some(TrialConfig::default()/* use setters */));
3768    /// let x = IntelligenceConfig::new().set_or_clear_trial_config(None::<TrialConfig>);
3769    /// ```
3770    pub fn set_or_clear_trial_config<T>(mut self, v: std::option::Option<T>) -> Self
3771    where
3772        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
3773    {
3774        self.trial_config = v.map(|x| x.into());
3775        self
3776    }
3777}
3778
3779impl wkt::message::Message for IntelligenceConfig {
3780    fn typename() -> &'static str {
3781        "type.googleapis.com/google.storage.control.v2.IntelligenceConfig"
3782    }
3783}
3784
3785/// Defines additional types related to [IntelligenceConfig].
3786pub mod intelligence_config {
3787    #[allow(unused_imports)]
3788    use super::*;
3789
3790    /// Filter over location and bucket using include or exclude semantics.
3791    /// Resources that match the include or exclude filter are exclusively included
3792    /// or excluded from the Storage Intelligence plan.
3793    #[derive(Clone, Default, PartialEq)]
3794    #[non_exhaustive]
3795    pub struct Filter {
3796        /// Bucket locations to include or exclude.
3797        pub cloud_storage_locations: std::option::Option<
3798            crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
3799        >,
3800
3801        /// Buckets to include or exclude.
3802        pub cloud_storage_buckets: std::option::Option<
3803            crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
3804        >,
3805
3806        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3807    }
3808
3809    impl Filter {
3810        pub fn new() -> Self {
3811            std::default::Default::default()
3812        }
3813
3814        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations].
3815        ///
3816        /// Note that all the setters affecting `cloud_storage_locations` are mutually
3817        /// exclusive.
3818        ///
3819        /// # Example
3820        /// ```ignore,no_run
3821        /// # use google_cloud_storage::model::intelligence_config::Filter;
3822        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3823        /// let x = Filter::new().set_cloud_storage_locations(Some(
3824        ///     google_cloud_storage::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(CloudStorageLocations::default().into())));
3825        /// ```
3826        pub fn set_cloud_storage_locations<
3827            T: std::convert::Into<
3828                    std::option::Option<
3829                        crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
3830                    >,
3831                >,
3832        >(
3833            mut self,
3834            v: T,
3835        ) -> Self {
3836            self.cloud_storage_locations = v.into();
3837            self
3838        }
3839
3840        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3841        /// if it holds a `IncludedCloudStorageLocations`, `None` if the field is not set or
3842        /// holds a different branch.
3843        pub fn included_cloud_storage_locations(
3844            &self,
3845        ) -> std::option::Option<
3846            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
3847        > {
3848            #[allow(unreachable_patterns)]
3849            self.cloud_storage_locations.as_ref().and_then(|v| match v {
3850                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(v) => std::option::Option::Some(v),
3851                _ => std::option::Option::None,
3852            })
3853        }
3854
3855        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3856        /// to hold a `IncludedCloudStorageLocations`.
3857        ///
3858        /// Note that all the setters affecting `cloud_storage_locations` are
3859        /// mutually exclusive.
3860        ///
3861        /// # Example
3862        /// ```ignore,no_run
3863        /// # use google_cloud_storage::model::intelligence_config::Filter;
3864        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3865        /// let x = Filter::new().set_included_cloud_storage_locations(CloudStorageLocations::default()/* use setters */);
3866        /// assert!(x.included_cloud_storage_locations().is_some());
3867        /// assert!(x.excluded_cloud_storage_locations().is_none());
3868        /// ```
3869        pub fn set_included_cloud_storage_locations<
3870            T: std::convert::Into<
3871                    std::boxed::Box<
3872                        crate::model::intelligence_config::filter::CloudStorageLocations,
3873                    >,
3874                >,
3875        >(
3876            mut self,
3877            v: T,
3878        ) -> Self {
3879            self.cloud_storage_locations = std::option::Option::Some(
3880                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
3881                    v.into()
3882                )
3883            );
3884            self
3885        }
3886
3887        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3888        /// if it holds a `ExcludedCloudStorageLocations`, `None` if the field is not set or
3889        /// holds a different branch.
3890        pub fn excluded_cloud_storage_locations(
3891            &self,
3892        ) -> std::option::Option<
3893            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
3894        > {
3895            #[allow(unreachable_patterns)]
3896            self.cloud_storage_locations.as_ref().and_then(|v| match v {
3897                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(v) => std::option::Option::Some(v),
3898                _ => std::option::Option::None,
3899            })
3900        }
3901
3902        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3903        /// to hold a `ExcludedCloudStorageLocations`.
3904        ///
3905        /// Note that all the setters affecting `cloud_storage_locations` are
3906        /// mutually exclusive.
3907        ///
3908        /// # Example
3909        /// ```ignore,no_run
3910        /// # use google_cloud_storage::model::intelligence_config::Filter;
3911        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3912        /// let x = Filter::new().set_excluded_cloud_storage_locations(CloudStorageLocations::default()/* use setters */);
3913        /// assert!(x.excluded_cloud_storage_locations().is_some());
3914        /// assert!(x.included_cloud_storage_locations().is_none());
3915        /// ```
3916        pub fn set_excluded_cloud_storage_locations<
3917            T: std::convert::Into<
3918                    std::boxed::Box<
3919                        crate::model::intelligence_config::filter::CloudStorageLocations,
3920                    >,
3921                >,
3922        >(
3923            mut self,
3924            v: T,
3925        ) -> Self {
3926            self.cloud_storage_locations = std::option::Option::Some(
3927                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
3928                    v.into()
3929                )
3930            );
3931            self
3932        }
3933
3934        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets].
3935        ///
3936        /// Note that all the setters affecting `cloud_storage_buckets` are mutually
3937        /// exclusive.
3938        ///
3939        /// # Example
3940        /// ```ignore,no_run
3941        /// # use google_cloud_storage::model::intelligence_config::Filter;
3942        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
3943        /// let x = Filter::new().set_cloud_storage_buckets(Some(
3944        ///     google_cloud_storage::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(CloudStorageBuckets::default().into())));
3945        /// ```
3946        pub fn set_cloud_storage_buckets<
3947            T: std::convert::Into<
3948                    std::option::Option<
3949                        crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
3950                    >,
3951                >,
3952        >(
3953            mut self,
3954            v: T,
3955        ) -> Self {
3956            self.cloud_storage_buckets = v.into();
3957            self
3958        }
3959
3960        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
3961        /// if it holds a `IncludedCloudStorageBuckets`, `None` if the field is not set or
3962        /// holds a different branch.
3963        pub fn included_cloud_storage_buckets(
3964            &self,
3965        ) -> std::option::Option<
3966            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
3967        > {
3968            #[allow(unreachable_patterns)]
3969            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
3970                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(v) => std::option::Option::Some(v),
3971                _ => std::option::Option::None,
3972            })
3973        }
3974
3975        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
3976        /// to hold a `IncludedCloudStorageBuckets`.
3977        ///
3978        /// Note that all the setters affecting `cloud_storage_buckets` are
3979        /// mutually exclusive.
3980        ///
3981        /// # Example
3982        /// ```ignore,no_run
3983        /// # use google_cloud_storage::model::intelligence_config::Filter;
3984        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
3985        /// let x = Filter::new().set_included_cloud_storage_buckets(CloudStorageBuckets::default()/* use setters */);
3986        /// assert!(x.included_cloud_storage_buckets().is_some());
3987        /// assert!(x.excluded_cloud_storage_buckets().is_none());
3988        /// ```
3989        pub fn set_included_cloud_storage_buckets<
3990            T: std::convert::Into<
3991                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
3992                >,
3993        >(
3994            mut self,
3995            v: T,
3996        ) -> Self {
3997            self.cloud_storage_buckets = std::option::Option::Some(
3998                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
3999                    v.into()
4000                )
4001            );
4002            self
4003        }
4004
4005        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
4006        /// if it holds a `ExcludedCloudStorageBuckets`, `None` if the field is not set or
4007        /// holds a different branch.
4008        pub fn excluded_cloud_storage_buckets(
4009            &self,
4010        ) -> std::option::Option<
4011            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4012        > {
4013            #[allow(unreachable_patterns)]
4014            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
4015                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(v) => std::option::Option::Some(v),
4016                _ => std::option::Option::None,
4017            })
4018        }
4019
4020        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
4021        /// to hold a `ExcludedCloudStorageBuckets`.
4022        ///
4023        /// Note that all the setters affecting `cloud_storage_buckets` are
4024        /// mutually exclusive.
4025        ///
4026        /// # Example
4027        /// ```ignore,no_run
4028        /// # use google_cloud_storage::model::intelligence_config::Filter;
4029        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
4030        /// let x = Filter::new().set_excluded_cloud_storage_buckets(CloudStorageBuckets::default()/* use setters */);
4031        /// assert!(x.excluded_cloud_storage_buckets().is_some());
4032        /// assert!(x.included_cloud_storage_buckets().is_none());
4033        /// ```
4034        pub fn set_excluded_cloud_storage_buckets<
4035            T: std::convert::Into<
4036                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4037                >,
4038        >(
4039            mut self,
4040            v: T,
4041        ) -> Self {
4042            self.cloud_storage_buckets = std::option::Option::Some(
4043                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
4044                    v.into()
4045                )
4046            );
4047            self
4048        }
4049    }
4050
4051    impl wkt::message::Message for Filter {
4052        fn typename() -> &'static str {
4053            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter"
4054        }
4055    }
4056
4057    /// Defines additional types related to [Filter].
4058    pub mod filter {
4059        #[allow(unused_imports)]
4060        use super::*;
4061
4062        /// Collection of bucket locations.
4063        #[derive(Clone, Default, PartialEq)]
4064        #[non_exhaustive]
4065        pub struct CloudStorageLocations {
4066            /// Optional. Bucket locations. Location can be any of the Cloud Storage
4067            /// regions specified in lower case format. For example, `us-east1`,
4068            /// `us-west1`.
4069            pub locations: std::vec::Vec<std::string::String>,
4070
4071            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4072        }
4073
4074        impl CloudStorageLocations {
4075            pub fn new() -> Self {
4076                std::default::Default::default()
4077            }
4078
4079            /// Sets the value of [locations][crate::model::intelligence_config::filter::CloudStorageLocations::locations].
4080            ///
4081            /// # Example
4082            /// ```ignore,no_run
4083            /// # use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
4084            /// let x = CloudStorageLocations::new().set_locations(["a", "b", "c"]);
4085            /// ```
4086            pub fn set_locations<T, V>(mut self, v: T) -> Self
4087            where
4088                T: std::iter::IntoIterator<Item = V>,
4089                V: std::convert::Into<std::string::String>,
4090            {
4091                use std::iter::Iterator;
4092                self.locations = v.into_iter().map(|i| i.into()).collect();
4093                self
4094            }
4095        }
4096
4097        impl wkt::message::Message for CloudStorageLocations {
4098            fn typename() -> &'static str {
4099                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"
4100            }
4101        }
4102
4103        /// Collection of buckets.
4104        #[derive(Clone, Default, PartialEq)]
4105        #[non_exhaustive]
4106        pub struct CloudStorageBuckets {
4107            /// Optional. A regex pattern for matching bucket names. Regex should
4108            /// follow the syntax specified in
4109            /// [google/re2](https://github.com/google/re2). For example,
4110            /// `^sample_.*` matches all buckets of the form
4111            /// `gs://sample_bucket-1`, `gs://sample_bucket-2`,
4112            /// `gs://sample_bucket-n` but not `gs://test_sample_bucket`.
4113            /// If you want to match a single bucket, say `gs://sample_bucket`,
4114            /// use `sample_bucket`.
4115            pub bucket_id_regexes: std::vec::Vec<std::string::String>,
4116
4117            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4118        }
4119
4120        impl CloudStorageBuckets {
4121            pub fn new() -> Self {
4122                std::default::Default::default()
4123            }
4124
4125            /// Sets the value of [bucket_id_regexes][crate::model::intelligence_config::filter::CloudStorageBuckets::bucket_id_regexes].
4126            ///
4127            /// # Example
4128            /// ```ignore,no_run
4129            /// # use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
4130            /// let x = CloudStorageBuckets::new().set_bucket_id_regexes(["a", "b", "c"]);
4131            /// ```
4132            pub fn set_bucket_id_regexes<T, V>(mut self, v: T) -> Self
4133            where
4134                T: std::iter::IntoIterator<Item = V>,
4135                V: std::convert::Into<std::string::String>,
4136            {
4137                use std::iter::Iterator;
4138                self.bucket_id_regexes = v.into_iter().map(|i| i.into()).collect();
4139                self
4140            }
4141        }
4142
4143        impl wkt::message::Message for CloudStorageBuckets {
4144            fn typename() -> &'static str {
4145                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"
4146            }
4147        }
4148
4149        /// Bucket locations to include or exclude.
4150        #[derive(Clone, Debug, PartialEq)]
4151        #[non_exhaustive]
4152        pub enum CloudStorageLocationsOneOf {
4153            /// Bucket locations to include.
4154            IncludedCloudStorageLocations(
4155                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
4156            ),
4157            /// Bucket locations to exclude.
4158            ExcludedCloudStorageLocations(
4159                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
4160            ),
4161        }
4162
4163        impl CloudStorageLocationsOneOf {
4164            /// Initializes the enum to the [IncludedCloudStorageLocations](Self::IncludedCloudStorageLocations) branch.
4165            pub fn from_included_cloud_storage_locations(
4166                value: impl std::convert::Into<
4167                    std::boxed::Box<
4168                        crate::model::intelligence_config::filter::CloudStorageLocations,
4169                    >,
4170                >,
4171            ) -> Self {
4172                Self::IncludedCloudStorageLocations(value.into())
4173            }
4174            /// Initializes the enum to the [ExcludedCloudStorageLocations](Self::ExcludedCloudStorageLocations) branch.
4175            pub fn from_excluded_cloud_storage_locations(
4176                value: impl std::convert::Into<
4177                    std::boxed::Box<
4178                        crate::model::intelligence_config::filter::CloudStorageLocations,
4179                    >,
4180                >,
4181            ) -> Self {
4182                Self::ExcludedCloudStorageLocations(value.into())
4183            }
4184        }
4185
4186        /// Buckets to include or exclude.
4187        #[derive(Clone, Debug, PartialEq)]
4188        #[non_exhaustive]
4189        pub enum CloudStorageBucketsOneOf {
4190            /// Buckets to include.
4191            IncludedCloudStorageBuckets(
4192                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4193            ),
4194            /// Buckets to exclude.
4195            ExcludedCloudStorageBuckets(
4196                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4197            ),
4198        }
4199
4200        impl CloudStorageBucketsOneOf {
4201            /// Initializes the enum to the [IncludedCloudStorageBuckets](Self::IncludedCloudStorageBuckets) branch.
4202            pub fn from_included_cloud_storage_buckets(
4203                value: impl std::convert::Into<
4204                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4205                >,
4206            ) -> Self {
4207                Self::IncludedCloudStorageBuckets(value.into())
4208            }
4209            /// Initializes the enum to the [ExcludedCloudStorageBuckets](Self::ExcludedCloudStorageBuckets) branch.
4210            pub fn from_excluded_cloud_storage_buckets(
4211                value: impl std::convert::Into<
4212                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4213                >,
4214            ) -> Self {
4215                Self::ExcludedCloudStorageBuckets(value.into())
4216            }
4217        }
4218    }
4219
4220    /// The effective `IntelligenceConfig` for the resource.
4221    #[derive(Clone, Default, PartialEq)]
4222    #[non_exhaustive]
4223    pub struct EffectiveIntelligenceConfig {
4224        /// Output only. The `IntelligenceConfig` edition that is applicable for the
4225        /// resource.
4226        pub effective_edition:
4227            crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition,
4228
4229        /// Output only. The `IntelligenceConfig` resource that is applied for the
4230        /// target resource. Format:
4231        /// `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig`
4232        pub intelligence_config: std::string::String,
4233
4234        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4235    }
4236
4237    impl EffectiveIntelligenceConfig {
4238        pub fn new() -> Self {
4239            std::default::Default::default()
4240        }
4241
4242        /// Sets the value of [effective_edition][crate::model::intelligence_config::EffectiveIntelligenceConfig::effective_edition].
4243        ///
4244        /// # Example
4245        /// ```ignore,no_run
4246        /// # use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
4247        /// use google_cloud_storage::model::intelligence_config::effective_intelligence_config::EffectiveEdition;
4248        /// let x0 = EffectiveIntelligenceConfig::new().set_effective_edition(EffectiveEdition::None);
4249        /// let x1 = EffectiveIntelligenceConfig::new().set_effective_edition(EffectiveEdition::Standard);
4250        /// ```
4251        pub fn set_effective_edition<T: std::convert::Into<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>(mut self, v: T) -> Self{
4252            self.effective_edition = v.into();
4253            self
4254        }
4255
4256        /// Sets the value of [intelligence_config][crate::model::intelligence_config::EffectiveIntelligenceConfig::intelligence_config].
4257        ///
4258        /// # Example
4259        /// ```ignore,no_run
4260        /// # use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
4261        /// let x = EffectiveIntelligenceConfig::new().set_intelligence_config("example");
4262        /// ```
4263        pub fn set_intelligence_config<T: std::convert::Into<std::string::String>>(
4264            mut self,
4265            v: T,
4266        ) -> Self {
4267            self.intelligence_config = v.into();
4268            self
4269        }
4270    }
4271
4272    impl wkt::message::Message for EffectiveIntelligenceConfig {
4273        fn typename() -> &'static str {
4274            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"
4275        }
4276    }
4277
4278    /// Defines additional types related to [EffectiveIntelligenceConfig].
4279    pub mod effective_intelligence_config {
4280        #[allow(unused_imports)]
4281        use super::*;
4282
4283        /// The effective edition of the `IntelligenceConfig` resource.
4284        ///
4285        /// # Working with unknown values
4286        ///
4287        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4288        /// additional enum variants at any time. Adding new variants is not considered
4289        /// a breaking change. Applications should write their code in anticipation of:
4290        ///
4291        /// - New values appearing in future releases of the client library, **and**
4292        /// - New values received dynamically, without application changes.
4293        ///
4294        /// Please consult the [Working with enums] section in the user guide for some
4295        /// guidelines.
4296        ///
4297        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4298        #[derive(Clone, Debug, PartialEq)]
4299        #[non_exhaustive]
4300        pub enum EffectiveEdition {
4301            /// This is an unknown edition of the resource.
4302            Unspecified,
4303            /// No edition.
4304            None,
4305            /// The `IntelligenceConfig` resource is of STANDARD edition.
4306            Standard,
4307            /// If set, the enum was initialized with an unknown value.
4308            ///
4309            /// Applications can examine the value using [EffectiveEdition::value] or
4310            /// [EffectiveEdition::name].
4311            UnknownValue(effective_edition::UnknownValue),
4312        }
4313
4314        #[doc(hidden)]
4315        pub mod effective_edition {
4316            #[allow(unused_imports)]
4317            use super::*;
4318            #[derive(Clone, Debug, PartialEq)]
4319            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4320        }
4321
4322        impl EffectiveEdition {
4323            /// Gets the enum value.
4324            ///
4325            /// Returns `None` if the enum contains an unknown value deserialized from
4326            /// the string representation of enums.
4327            pub fn value(&self) -> std::option::Option<i32> {
4328                match self {
4329                    Self::Unspecified => std::option::Option::Some(0),
4330                    Self::None => std::option::Option::Some(1),
4331                    Self::Standard => std::option::Option::Some(2),
4332                    Self::UnknownValue(u) => u.0.value(),
4333                }
4334            }
4335
4336            /// Gets the enum value as a string.
4337            ///
4338            /// Returns `None` if the enum contains an unknown value deserialized from
4339            /// the integer representation of enums.
4340            pub fn name(&self) -> std::option::Option<&str> {
4341                match self {
4342                    Self::Unspecified => std::option::Option::Some("EFFECTIVE_EDITION_UNSPECIFIED"),
4343                    Self::None => std::option::Option::Some("NONE"),
4344                    Self::Standard => std::option::Option::Some("STANDARD"),
4345                    Self::UnknownValue(u) => u.0.name(),
4346                }
4347            }
4348        }
4349
4350        impl std::default::Default for EffectiveEdition {
4351            fn default() -> Self {
4352                use std::convert::From;
4353                Self::from(0)
4354            }
4355        }
4356
4357        impl std::fmt::Display for EffectiveEdition {
4358            fn fmt(
4359                &self,
4360                f: &mut std::fmt::Formatter<'_>,
4361            ) -> std::result::Result<(), std::fmt::Error> {
4362                wkt::internal::display_enum(f, self.name(), self.value())
4363            }
4364        }
4365
4366        impl std::convert::From<i32> for EffectiveEdition {
4367            fn from(value: i32) -> Self {
4368                match value {
4369                    0 => Self::Unspecified,
4370                    1 => Self::None,
4371                    2 => Self::Standard,
4372                    _ => Self::UnknownValue(effective_edition::UnknownValue(
4373                        wkt::internal::UnknownEnumValue::Integer(value),
4374                    )),
4375                }
4376            }
4377        }
4378
4379        impl std::convert::From<&str> for EffectiveEdition {
4380            fn from(value: &str) -> Self {
4381                use std::string::ToString;
4382                match value {
4383                    "EFFECTIVE_EDITION_UNSPECIFIED" => Self::Unspecified,
4384                    "NONE" => Self::None,
4385                    "STANDARD" => Self::Standard,
4386                    _ => Self::UnknownValue(effective_edition::UnknownValue(
4387                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4388                    )),
4389                }
4390            }
4391        }
4392
4393        impl serde::ser::Serialize for EffectiveEdition {
4394            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4395            where
4396                S: serde::Serializer,
4397            {
4398                match self {
4399                    Self::Unspecified => serializer.serialize_i32(0),
4400                    Self::None => serializer.serialize_i32(1),
4401                    Self::Standard => serializer.serialize_i32(2),
4402                    Self::UnknownValue(u) => u.0.serialize(serializer),
4403                }
4404            }
4405        }
4406
4407        impl<'de> serde::de::Deserialize<'de> for EffectiveEdition {
4408            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4409            where
4410                D: serde::Deserializer<'de>,
4411            {
4412                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveEdition>::new(
4413                    ".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition"))
4414            }
4415        }
4416    }
4417
4418    /// The trial configuration of the `IntelligenceConfig` resource.
4419    #[derive(Clone, Default, PartialEq)]
4420    #[non_exhaustive]
4421    pub struct TrialConfig {
4422        /// Output only. The time at which the trial expires.
4423        pub expire_time: std::option::Option<wkt::Timestamp>,
4424
4425        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4426    }
4427
4428    impl TrialConfig {
4429        pub fn new() -> Self {
4430            std::default::Default::default()
4431        }
4432
4433        /// Sets the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
4434        ///
4435        /// # Example
4436        /// ```ignore,no_run
4437        /// # use google_cloud_storage::model::intelligence_config::TrialConfig;
4438        /// use wkt::Timestamp;
4439        /// let x = TrialConfig::new().set_expire_time(Timestamp::default()/* use setters */);
4440        /// ```
4441        pub fn set_expire_time<T>(mut self, v: T) -> Self
4442        where
4443            T: std::convert::Into<wkt::Timestamp>,
4444        {
4445            self.expire_time = std::option::Option::Some(v.into());
4446            self
4447        }
4448
4449        /// Sets or clears the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
4450        ///
4451        /// # Example
4452        /// ```ignore,no_run
4453        /// # use google_cloud_storage::model::intelligence_config::TrialConfig;
4454        /// use wkt::Timestamp;
4455        /// let x = TrialConfig::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
4456        /// let x = TrialConfig::new().set_or_clear_expire_time(None::<Timestamp>);
4457        /// ```
4458        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4459        where
4460            T: std::convert::Into<wkt::Timestamp>,
4461        {
4462            self.expire_time = v.map(|x| x.into());
4463            self
4464        }
4465    }
4466
4467    impl wkt::message::Message for TrialConfig {
4468        fn typename() -> &'static str {
4469            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.TrialConfig"
4470        }
4471    }
4472
4473    /// The edition configuration of the `IntelligenceConfig` resource. This
4474    /// signifies the edition used for configuring the `IntelligenceConfig`
4475    /// resource and can only take the following values:
4476    /// `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and
4477    /// `TRIAL`.
4478    ///
4479    /// # Working with unknown values
4480    ///
4481    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4482    /// additional enum variants at any time. Adding new variants is not considered
4483    /// a breaking change. Applications should write their code in anticipation of:
4484    ///
4485    /// - New values appearing in future releases of the client library, **and**
4486    /// - New values received dynamically, without application changes.
4487    ///
4488    /// Please consult the [Working with enums] section in the user guide for some
4489    /// guidelines.
4490    ///
4491    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4492    #[derive(Clone, Debug, PartialEq)]
4493    #[non_exhaustive]
4494    pub enum EditionConfig {
4495        /// This is an unknown edition of the resource.
4496        Unspecified,
4497        /// The inherited edition from the parent and filters. This is the default
4498        /// edition when there is no `IntelligenceConfig` setup for a GCP resource.
4499        Inherit,
4500        /// The edition configuration is disabled for the `IntelligenceConfig`
4501        /// resource and its children. Filters are not applicable.
4502        Disabled,
4503        /// The `IntelligenceConfig` resource is of STANDARD edition.
4504        Standard,
4505        /// The `IntelligenceConfig` resource is available in `TRIAL` edition. During
4506        /// the trial period, Cloud Storage does not charge for Storage Intelligence
4507        /// usage. You can specify the buckets to include in the trial period by
4508        /// using filters. At the end of the trial period, the `IntelligenceConfig`
4509        /// resource is upgraded to `STANDARD` edition.
4510        Trial,
4511        /// If set, the enum was initialized with an unknown value.
4512        ///
4513        /// Applications can examine the value using [EditionConfig::value] or
4514        /// [EditionConfig::name].
4515        UnknownValue(edition_config::UnknownValue),
4516    }
4517
4518    #[doc(hidden)]
4519    pub mod edition_config {
4520        #[allow(unused_imports)]
4521        use super::*;
4522        #[derive(Clone, Debug, PartialEq)]
4523        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4524    }
4525
4526    impl EditionConfig {
4527        /// Gets the enum value.
4528        ///
4529        /// Returns `None` if the enum contains an unknown value deserialized from
4530        /// the string representation of enums.
4531        pub fn value(&self) -> std::option::Option<i32> {
4532            match self {
4533                Self::Unspecified => std::option::Option::Some(0),
4534                Self::Inherit => std::option::Option::Some(1),
4535                Self::Disabled => std::option::Option::Some(2),
4536                Self::Standard => std::option::Option::Some(3),
4537                Self::Trial => std::option::Option::Some(5),
4538                Self::UnknownValue(u) => u.0.value(),
4539            }
4540        }
4541
4542        /// Gets the enum value as a string.
4543        ///
4544        /// Returns `None` if the enum contains an unknown value deserialized from
4545        /// the integer representation of enums.
4546        pub fn name(&self) -> std::option::Option<&str> {
4547            match self {
4548                Self::Unspecified => std::option::Option::Some("EDITION_CONFIG_UNSPECIFIED"),
4549                Self::Inherit => std::option::Option::Some("INHERIT"),
4550                Self::Disabled => std::option::Option::Some("DISABLED"),
4551                Self::Standard => std::option::Option::Some("STANDARD"),
4552                Self::Trial => std::option::Option::Some("TRIAL"),
4553                Self::UnknownValue(u) => u.0.name(),
4554            }
4555        }
4556    }
4557
4558    impl std::default::Default for EditionConfig {
4559        fn default() -> Self {
4560            use std::convert::From;
4561            Self::from(0)
4562        }
4563    }
4564
4565    impl std::fmt::Display for EditionConfig {
4566        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4567            wkt::internal::display_enum(f, self.name(), self.value())
4568        }
4569    }
4570
4571    impl std::convert::From<i32> for EditionConfig {
4572        fn from(value: i32) -> Self {
4573            match value {
4574                0 => Self::Unspecified,
4575                1 => Self::Inherit,
4576                2 => Self::Disabled,
4577                3 => Self::Standard,
4578                5 => Self::Trial,
4579                _ => Self::UnknownValue(edition_config::UnknownValue(
4580                    wkt::internal::UnknownEnumValue::Integer(value),
4581                )),
4582            }
4583        }
4584    }
4585
4586    impl std::convert::From<&str> for EditionConfig {
4587        fn from(value: &str) -> Self {
4588            use std::string::ToString;
4589            match value {
4590                "EDITION_CONFIG_UNSPECIFIED" => Self::Unspecified,
4591                "INHERIT" => Self::Inherit,
4592                "DISABLED" => Self::Disabled,
4593                "STANDARD" => Self::Standard,
4594                "TRIAL" => Self::Trial,
4595                _ => Self::UnknownValue(edition_config::UnknownValue(
4596                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4597                )),
4598            }
4599        }
4600    }
4601
4602    impl serde::ser::Serialize for EditionConfig {
4603        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4604        where
4605            S: serde::Serializer,
4606        {
4607            match self {
4608                Self::Unspecified => serializer.serialize_i32(0),
4609                Self::Inherit => serializer.serialize_i32(1),
4610                Self::Disabled => serializer.serialize_i32(2),
4611                Self::Standard => serializer.serialize_i32(3),
4612                Self::Trial => serializer.serialize_i32(5),
4613                Self::UnknownValue(u) => u.0.serialize(serializer),
4614            }
4615        }
4616    }
4617
4618    impl<'de> serde::de::Deserialize<'de> for EditionConfig {
4619        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4620        where
4621            D: serde::Deserializer<'de>,
4622        {
4623            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EditionConfig>::new(
4624                ".google.storage.control.v2.IntelligenceConfig.EditionConfig",
4625            ))
4626        }
4627    }
4628}
4629
4630/// Request message to update the `IntelligenceConfig` resource associated with
4631/// your organization.
4632///
4633/// **IAM Permissions**:
4634///
4635/// Requires `storage.intelligenceConfigs.update`
4636/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4637/// the organization.
4638#[derive(Clone, Default, PartialEq)]
4639#[non_exhaustive]
4640pub struct UpdateOrganizationIntelligenceConfigRequest {
4641    /// Required. The `IntelligenceConfig` resource to be updated.
4642    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4643
4644    /// Required. The `update_mask` that specifies the fields within the
4645    /// `IntelligenceConfig` resource that should be modified by this update. Only
4646    /// the listed fields are updated.
4647    pub update_mask: std::option::Option<wkt::FieldMask>,
4648
4649    /// Optional. The ID that uniquely identifies the request, preventing duplicate
4650    /// processing.
4651    pub request_id: std::string::String,
4652
4653    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4654}
4655
4656impl UpdateOrganizationIntelligenceConfigRequest {
4657    pub fn new() -> Self {
4658        std::default::Default::default()
4659    }
4660
4661    /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
4662    ///
4663    /// # Example
4664    /// ```ignore,no_run
4665    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4666    /// use google_cloud_storage::model::IntelligenceConfig;
4667    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
4668    /// ```
4669    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
4670    where
4671        T: std::convert::Into<crate::model::IntelligenceConfig>,
4672    {
4673        self.intelligence_config = std::option::Option::Some(v.into());
4674        self
4675    }
4676
4677    /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
4678    ///
4679    /// # Example
4680    /// ```ignore,no_run
4681    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4682    /// use google_cloud_storage::model::IntelligenceConfig;
4683    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
4684    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
4685    /// ```
4686    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
4687    where
4688        T: std::convert::Into<crate::model::IntelligenceConfig>,
4689    {
4690        self.intelligence_config = v.map(|x| x.into());
4691        self
4692    }
4693
4694    /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
4695    ///
4696    /// # Example
4697    /// ```ignore,no_run
4698    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4699    /// use wkt::FieldMask;
4700    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4701    /// ```
4702    pub fn set_update_mask<T>(mut self, v: T) -> Self
4703    where
4704        T: std::convert::Into<wkt::FieldMask>,
4705    {
4706        self.update_mask = std::option::Option::Some(v.into());
4707        self
4708    }
4709
4710    /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
4711    ///
4712    /// # Example
4713    /// ```ignore,no_run
4714    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4715    /// use wkt::FieldMask;
4716    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4717    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4718    /// ```
4719    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4720    where
4721        T: std::convert::Into<wkt::FieldMask>,
4722    {
4723        self.update_mask = v.map(|x| x.into());
4724        self
4725    }
4726
4727    /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
4728    ///
4729    /// # Example
4730    /// ```ignore,no_run
4731    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4732    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_request_id("example");
4733    /// ```
4734    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4735        self.request_id = v.into();
4736        self
4737    }
4738}
4739
4740impl wkt::message::Message for UpdateOrganizationIntelligenceConfigRequest {
4741    fn typename() -> &'static str {
4742        "type.googleapis.com/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"
4743    }
4744}
4745
4746/// Request message to update the `IntelligenceConfig` resource associated with
4747/// your folder.
4748///
4749/// **IAM Permissions**:
4750///
4751/// Requires `storage.intelligenceConfigs.update`
4752/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4753/// the folder.
4754#[derive(Clone, Default, PartialEq)]
4755#[non_exhaustive]
4756pub struct UpdateFolderIntelligenceConfigRequest {
4757    /// Required. The `IntelligenceConfig` resource to be updated.
4758    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4759
4760    /// Required. The `update_mask` that specifies the fields within the
4761    /// `IntelligenceConfig` resource that should be modified by this update. Only
4762    /// the listed fields are updated.
4763    pub update_mask: std::option::Option<wkt::FieldMask>,
4764
4765    /// Optional. The ID that uniquely identifies the request, preventing duplicate
4766    /// processing.
4767    pub request_id: std::string::String,
4768
4769    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4770}
4771
4772impl UpdateFolderIntelligenceConfigRequest {
4773    pub fn new() -> Self {
4774        std::default::Default::default()
4775    }
4776
4777    /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
4778    ///
4779    /// # Example
4780    /// ```ignore,no_run
4781    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4782    /// use google_cloud_storage::model::IntelligenceConfig;
4783    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
4784    /// ```
4785    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
4786    where
4787        T: std::convert::Into<crate::model::IntelligenceConfig>,
4788    {
4789        self.intelligence_config = std::option::Option::Some(v.into());
4790        self
4791    }
4792
4793    /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
4794    ///
4795    /// # Example
4796    /// ```ignore,no_run
4797    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4798    /// use google_cloud_storage::model::IntelligenceConfig;
4799    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
4800    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
4801    /// ```
4802    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
4803    where
4804        T: std::convert::Into<crate::model::IntelligenceConfig>,
4805    {
4806        self.intelligence_config = v.map(|x| x.into());
4807        self
4808    }
4809
4810    /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
4811    ///
4812    /// # Example
4813    /// ```ignore,no_run
4814    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4815    /// use wkt::FieldMask;
4816    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4817    /// ```
4818    pub fn set_update_mask<T>(mut self, v: T) -> Self
4819    where
4820        T: std::convert::Into<wkt::FieldMask>,
4821    {
4822        self.update_mask = std::option::Option::Some(v.into());
4823        self
4824    }
4825
4826    /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
4827    ///
4828    /// # Example
4829    /// ```ignore,no_run
4830    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4831    /// use wkt::FieldMask;
4832    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4833    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4834    /// ```
4835    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4836    where
4837        T: std::convert::Into<wkt::FieldMask>,
4838    {
4839        self.update_mask = v.map(|x| x.into());
4840        self
4841    }
4842
4843    /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
4844    ///
4845    /// # Example
4846    /// ```ignore,no_run
4847    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4848    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_request_id("example");
4849    /// ```
4850    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4851        self.request_id = v.into();
4852        self
4853    }
4854}
4855
4856impl wkt::message::Message for UpdateFolderIntelligenceConfigRequest {
4857    fn typename() -> &'static str {
4858        "type.googleapis.com/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"
4859    }
4860}
4861
4862/// Request message to update the `IntelligenceConfig` resource associated with
4863/// your project.
4864///
4865/// **IAM Permissions**:
4866///
4867/// Requires `storage.intelligenceConfigs.update`
4868/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4869/// the folder.
4870#[derive(Clone, Default, PartialEq)]
4871#[non_exhaustive]
4872pub struct UpdateProjectIntelligenceConfigRequest {
4873    /// Required. The `IntelligenceConfig` resource to be updated.
4874    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4875
4876    /// Required. The `update_mask` that specifies the fields within the
4877    /// `IntelligenceConfig` resource that should be modified by this update. Only
4878    /// the listed fields are updated.
4879    pub update_mask: std::option::Option<wkt::FieldMask>,
4880
4881    /// Optional. The ID that uniquely identifies the request, preventing duplicate
4882    /// processing.
4883    pub request_id: std::string::String,
4884
4885    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4886}
4887
4888impl UpdateProjectIntelligenceConfigRequest {
4889    pub fn new() -> Self {
4890        std::default::Default::default()
4891    }
4892
4893    /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
4894    ///
4895    /// # Example
4896    /// ```ignore,no_run
4897    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4898    /// use google_cloud_storage::model::IntelligenceConfig;
4899    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
4900    /// ```
4901    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
4902    where
4903        T: std::convert::Into<crate::model::IntelligenceConfig>,
4904    {
4905        self.intelligence_config = std::option::Option::Some(v.into());
4906        self
4907    }
4908
4909    /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
4910    ///
4911    /// # Example
4912    /// ```ignore,no_run
4913    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4914    /// use google_cloud_storage::model::IntelligenceConfig;
4915    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
4916    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
4917    /// ```
4918    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
4919    where
4920        T: std::convert::Into<crate::model::IntelligenceConfig>,
4921    {
4922        self.intelligence_config = v.map(|x| x.into());
4923        self
4924    }
4925
4926    /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
4927    ///
4928    /// # Example
4929    /// ```ignore,no_run
4930    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4931    /// use wkt::FieldMask;
4932    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4933    /// ```
4934    pub fn set_update_mask<T>(mut self, v: T) -> Self
4935    where
4936        T: std::convert::Into<wkt::FieldMask>,
4937    {
4938        self.update_mask = std::option::Option::Some(v.into());
4939        self
4940    }
4941
4942    /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
4943    ///
4944    /// # Example
4945    /// ```ignore,no_run
4946    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4947    /// use wkt::FieldMask;
4948    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4949    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4950    /// ```
4951    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4952    where
4953        T: std::convert::Into<wkt::FieldMask>,
4954    {
4955        self.update_mask = v.map(|x| x.into());
4956        self
4957    }
4958
4959    /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
4960    ///
4961    /// # Example
4962    /// ```ignore,no_run
4963    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4964    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_request_id("example");
4965    /// ```
4966    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4967        self.request_id = v.into();
4968        self
4969    }
4970}
4971
4972impl wkt::message::Message for UpdateProjectIntelligenceConfigRequest {
4973    fn typename() -> &'static str {
4974        "type.googleapis.com/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"
4975    }
4976}
4977
4978/// Request message to get the `IntelligenceConfig` resource associated with your
4979/// organization.
4980///
4981/// **IAM Permissions**
4982///
4983/// Requires `storage.intelligenceConfigs.get`
4984/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4985/// the organization.
4986#[derive(Clone, Default, PartialEq)]
4987#[non_exhaustive]
4988pub struct GetOrganizationIntelligenceConfigRequest {
4989    /// Required. The name of the `IntelligenceConfig` resource associated with
4990    /// your organization.
4991    ///
4992    /// Format: `organizations/{org_id}/locations/global/intelligenceConfig`
4993    pub name: std::string::String,
4994
4995    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4996}
4997
4998impl GetOrganizationIntelligenceConfigRequest {
4999    pub fn new() -> Self {
5000        std::default::Default::default()
5001    }
5002
5003    /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
5004    ///
5005    /// # Example
5006    /// ```ignore,no_run
5007    /// # use google_cloud_storage::model::GetOrganizationIntelligenceConfigRequest;
5008    /// let x = GetOrganizationIntelligenceConfigRequest::new().set_name("example");
5009    /// ```
5010    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5011        self.name = v.into();
5012        self
5013    }
5014}
5015
5016impl wkt::message::Message for GetOrganizationIntelligenceConfigRequest {
5017    fn typename() -> &'static str {
5018        "type.googleapis.com/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"
5019    }
5020}
5021
5022/// Request message to get the `IntelligenceConfig` resource associated with your
5023/// folder.
5024///
5025/// **IAM Permissions**
5026///
5027/// Requires `storage.intelligenceConfigs.get`
5028/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
5029/// the folder.
5030#[derive(Clone, Default, PartialEq)]
5031#[non_exhaustive]
5032pub struct GetFolderIntelligenceConfigRequest {
5033    /// Required. The name of the `IntelligenceConfig` resource associated with
5034    /// your folder.
5035    ///
5036    /// Format: `folders/{id}/locations/global/intelligenceConfig`
5037    pub name: std::string::String,
5038
5039    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5040}
5041
5042impl GetFolderIntelligenceConfigRequest {
5043    pub fn new() -> Self {
5044        std::default::Default::default()
5045    }
5046
5047    /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
5048    ///
5049    /// # Example
5050    /// ```ignore,no_run
5051    /// # use google_cloud_storage::model::GetFolderIntelligenceConfigRequest;
5052    /// let x = GetFolderIntelligenceConfigRequest::new().set_name("example");
5053    /// ```
5054    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5055        self.name = v.into();
5056        self
5057    }
5058}
5059
5060impl wkt::message::Message for GetFolderIntelligenceConfigRequest {
5061    fn typename() -> &'static str {
5062        "type.googleapis.com/google.storage.control.v2.GetFolderIntelligenceConfigRequest"
5063    }
5064}
5065
5066/// Request message to get the `IntelligenceConfig` resource associated with your
5067/// project.
5068///
5069/// **IAM Permissions**:
5070///
5071/// Requires `storage.intelligenceConfigs.get`
5072/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission
5073/// on the project.
5074#[derive(Clone, Default, PartialEq)]
5075#[non_exhaustive]
5076pub struct GetProjectIntelligenceConfigRequest {
5077    /// Required. The name of the `IntelligenceConfig` resource associated with
5078    /// your project.
5079    ///
5080    /// Format: `projects/{id}/locations/global/intelligenceConfig`
5081    pub name: std::string::String,
5082
5083    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5084}
5085
5086impl GetProjectIntelligenceConfigRequest {
5087    pub fn new() -> Self {
5088        std::default::Default::default()
5089    }
5090
5091    /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
5092    ///
5093    /// # Example
5094    /// ```ignore,no_run
5095    /// # use google_cloud_storage::model::GetProjectIntelligenceConfigRequest;
5096    /// let x = GetProjectIntelligenceConfigRequest::new().set_name("example");
5097    /// ```
5098    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5099        self.name = v.into();
5100        self
5101    }
5102}
5103
5104impl wkt::message::Message for GetProjectIntelligenceConfigRequest {
5105    fn typename() -> &'static str {
5106        "type.googleapis.com/google.storage.control.v2.GetProjectIntelligenceConfigRequest"
5107    }
5108}