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 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/// The message contains metadata that is common to all Storage Control
967/// long-running operations, present in its `google.longrunning.Operation`
968/// messages, and accessible via `metadata.common_metadata`.
969#[derive(Clone, Default, PartialEq)]
970#[non_exhaustive]
971pub struct CommonLongRunningOperationMetadata {
972    /// Output only. The time the operation was created.
973    pub create_time: std::option::Option<wkt::Timestamp>,
974
975    /// Output only. The time the operation finished running.
976    pub end_time: std::option::Option<wkt::Timestamp>,
977
978    /// Output only. The time the operation was last modified.
979    pub update_time: std::option::Option<wkt::Timestamp>,
980
981    /// Output only. The type of operation invoked.
982    pub r#type: std::string::String,
983
984    /// Output only. Identifies whether the user has requested cancellation.
985    pub requested_cancellation: bool,
986
987    /// Output only. The estimated progress of the operation in percentage [0,
988    /// 100]. The value -1 means the progress is unknown.
989    pub progress_percent: i32,
990
991    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
992}
993
994impl CommonLongRunningOperationMetadata {
995    pub fn new() -> Self {
996        std::default::Default::default()
997    }
998
999    /// Sets the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
1000    ///
1001    /// # Example
1002    /// ```ignore,no_run
1003    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1004    /// use wkt::Timestamp;
1005    /// let x = CommonLongRunningOperationMetadata::new().set_create_time(Timestamp::default()/* use setters */);
1006    /// ```
1007    pub fn set_create_time<T>(mut self, v: T) -> Self
1008    where
1009        T: std::convert::Into<wkt::Timestamp>,
1010    {
1011        self.create_time = std::option::Option::Some(v.into());
1012        self
1013    }
1014
1015    /// Sets or clears the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
1016    ///
1017    /// # Example
1018    /// ```ignore,no_run
1019    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1020    /// use wkt::Timestamp;
1021    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1022    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_create_time(None::<Timestamp>);
1023    /// ```
1024    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1025    where
1026        T: std::convert::Into<wkt::Timestamp>,
1027    {
1028        self.create_time = v.map(|x| x.into());
1029        self
1030    }
1031
1032    /// Sets the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
1033    ///
1034    /// # Example
1035    /// ```ignore,no_run
1036    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1037    /// use wkt::Timestamp;
1038    /// let x = CommonLongRunningOperationMetadata::new().set_end_time(Timestamp::default()/* use setters */);
1039    /// ```
1040    pub fn set_end_time<T>(mut self, v: T) -> Self
1041    where
1042        T: std::convert::Into<wkt::Timestamp>,
1043    {
1044        self.end_time = std::option::Option::Some(v.into());
1045        self
1046    }
1047
1048    /// Sets or clears the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
1049    ///
1050    /// # Example
1051    /// ```ignore,no_run
1052    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1053    /// use wkt::Timestamp;
1054    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
1055    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_end_time(None::<Timestamp>);
1056    /// ```
1057    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
1058    where
1059        T: std::convert::Into<wkt::Timestamp>,
1060    {
1061        self.end_time = v.map(|x| x.into());
1062        self
1063    }
1064
1065    /// Sets the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
1066    ///
1067    /// # Example
1068    /// ```ignore,no_run
1069    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1070    /// use wkt::Timestamp;
1071    /// let x = CommonLongRunningOperationMetadata::new().set_update_time(Timestamp::default()/* use setters */);
1072    /// ```
1073    pub fn set_update_time<T>(mut self, v: T) -> Self
1074    where
1075        T: std::convert::Into<wkt::Timestamp>,
1076    {
1077        self.update_time = std::option::Option::Some(v.into());
1078        self
1079    }
1080
1081    /// Sets or clears the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
1082    ///
1083    /// # Example
1084    /// ```ignore,no_run
1085    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1086    /// use wkt::Timestamp;
1087    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1088    /// let x = CommonLongRunningOperationMetadata::new().set_or_clear_update_time(None::<Timestamp>);
1089    /// ```
1090    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1091    where
1092        T: std::convert::Into<wkt::Timestamp>,
1093    {
1094        self.update_time = v.map(|x| x.into());
1095        self
1096    }
1097
1098    /// Sets the value of [r#type][crate::model::CommonLongRunningOperationMetadata::type].
1099    ///
1100    /// # Example
1101    /// ```ignore,no_run
1102    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1103    /// let x = CommonLongRunningOperationMetadata::new().set_type("example");
1104    /// ```
1105    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1106        self.r#type = v.into();
1107        self
1108    }
1109
1110    /// Sets the value of [requested_cancellation][crate::model::CommonLongRunningOperationMetadata::requested_cancellation].
1111    ///
1112    /// # Example
1113    /// ```ignore,no_run
1114    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1115    /// let x = CommonLongRunningOperationMetadata::new().set_requested_cancellation(true);
1116    /// ```
1117    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1118        self.requested_cancellation = v.into();
1119        self
1120    }
1121
1122    /// Sets the value of [progress_percent][crate::model::CommonLongRunningOperationMetadata::progress_percent].
1123    ///
1124    /// # Example
1125    /// ```ignore,no_run
1126    /// # use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1127    /// let x = CommonLongRunningOperationMetadata::new().set_progress_percent(42);
1128    /// ```
1129    pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1130        self.progress_percent = v.into();
1131        self
1132    }
1133}
1134
1135impl wkt::message::Message for CommonLongRunningOperationMetadata {
1136    fn typename() -> &'static str {
1137        "type.googleapis.com/google.storage.control.v2.CommonLongRunningOperationMetadata"
1138    }
1139}
1140
1141/// Message returned in the metadata field of the Operation resource for
1142/// RenameFolder operations.
1143#[derive(Clone, Default, PartialEq)]
1144#[non_exhaustive]
1145pub struct RenameFolderMetadata {
1146    /// Generic metadata for the long running operation.
1147    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1148
1149    /// The path of the source folder.
1150    pub source_folder_id: std::string::String,
1151
1152    /// The path of the destination folder.
1153    pub destination_folder_id: std::string::String,
1154
1155    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1156}
1157
1158impl RenameFolderMetadata {
1159    pub fn new() -> Self {
1160        std::default::Default::default()
1161    }
1162
1163    /// Sets the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
1164    ///
1165    /// # Example
1166    /// ```ignore,no_run
1167    /// # use google_cloud_storage::model::RenameFolderMetadata;
1168    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1169    /// let x = RenameFolderMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
1170    /// ```
1171    pub fn set_common_metadata<T>(mut self, v: T) -> Self
1172    where
1173        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1174    {
1175        self.common_metadata = std::option::Option::Some(v.into());
1176        self
1177    }
1178
1179    /// Sets or clears the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
1180    ///
1181    /// # Example
1182    /// ```ignore,no_run
1183    /// # use google_cloud_storage::model::RenameFolderMetadata;
1184    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
1185    /// let x = RenameFolderMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
1186    /// let x = RenameFolderMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
1187    /// ```
1188    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1189    where
1190        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1191    {
1192        self.common_metadata = v.map(|x| x.into());
1193        self
1194    }
1195
1196    /// Sets the value of [source_folder_id][crate::model::RenameFolderMetadata::source_folder_id].
1197    ///
1198    /// # Example
1199    /// ```ignore,no_run
1200    /// # use google_cloud_storage::model::RenameFolderMetadata;
1201    /// let x = RenameFolderMetadata::new().set_source_folder_id("example");
1202    /// ```
1203    pub fn set_source_folder_id<T: std::convert::Into<std::string::String>>(
1204        mut self,
1205        v: T,
1206    ) -> Self {
1207        self.source_folder_id = v.into();
1208        self
1209    }
1210
1211    /// Sets the value of [destination_folder_id][crate::model::RenameFolderMetadata::destination_folder_id].
1212    ///
1213    /// # Example
1214    /// ```ignore,no_run
1215    /// # use google_cloud_storage::model::RenameFolderMetadata;
1216    /// let x = RenameFolderMetadata::new().set_destination_folder_id("example");
1217    /// ```
1218    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
1219        mut self,
1220        v: T,
1221    ) -> Self {
1222        self.destination_folder_id = v.into();
1223        self
1224    }
1225}
1226
1227impl wkt::message::Message for RenameFolderMetadata {
1228    fn typename() -> &'static str {
1229        "type.googleapis.com/google.storage.control.v2.RenameFolderMetadata"
1230    }
1231}
1232
1233/// The storage layout configuration of a bucket.
1234#[derive(Clone, Default, PartialEq)]
1235#[non_exhaustive]
1236pub struct StorageLayout {
1237    /// Output only. The name of the StorageLayout resource.
1238    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1239    pub name: std::string::String,
1240
1241    /// Output only. The location of the bucket.
1242    pub location: std::string::String,
1243
1244    /// Output only. The location type of the bucket (region, dual-region,
1245    /// multi-region, etc).
1246    pub location_type: std::string::String,
1247
1248    /// Output only. The data placement configuration for custom dual region. If
1249    /// there is no configuration, this is not a custom dual region bucket.
1250    pub custom_placement_config:
1251        std::option::Option<crate::model::storage_layout::CustomPlacementConfig>,
1252
1253    /// Output only. The bucket's hierarchical namespace configuration. If there is
1254    /// no configuration, the hierarchical namespace is disabled.
1255    pub hierarchical_namespace:
1256        std::option::Option<crate::model::storage_layout::HierarchicalNamespace>,
1257
1258    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1259}
1260
1261impl StorageLayout {
1262    pub fn new() -> Self {
1263        std::default::Default::default()
1264    }
1265
1266    /// Sets the value of [name][crate::model::StorageLayout::name].
1267    ///
1268    /// # Example
1269    /// ```ignore,no_run
1270    /// # use google_cloud_storage::model::StorageLayout;
1271    /// let x = StorageLayout::new().set_name("example");
1272    /// ```
1273    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1274        self.name = v.into();
1275        self
1276    }
1277
1278    /// Sets the value of [location][crate::model::StorageLayout::location].
1279    ///
1280    /// # Example
1281    /// ```ignore,no_run
1282    /// # use google_cloud_storage::model::StorageLayout;
1283    /// let x = StorageLayout::new().set_location("example");
1284    /// ```
1285    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1286        self.location = v.into();
1287        self
1288    }
1289
1290    /// Sets the value of [location_type][crate::model::StorageLayout::location_type].
1291    ///
1292    /// # Example
1293    /// ```ignore,no_run
1294    /// # use google_cloud_storage::model::StorageLayout;
1295    /// let x = StorageLayout::new().set_location_type("example");
1296    /// ```
1297    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1298        self.location_type = v.into();
1299        self
1300    }
1301
1302    /// Sets the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
1303    ///
1304    /// # Example
1305    /// ```ignore,no_run
1306    /// # use google_cloud_storage::model::StorageLayout;
1307    /// use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1308    /// let x = StorageLayout::new().set_custom_placement_config(CustomPlacementConfig::default()/* use setters */);
1309    /// ```
1310    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
1311    where
1312        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
1313    {
1314        self.custom_placement_config = std::option::Option::Some(v.into());
1315        self
1316    }
1317
1318    /// Sets or clears the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
1319    ///
1320    /// # Example
1321    /// ```ignore,no_run
1322    /// # use google_cloud_storage::model::StorageLayout;
1323    /// use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1324    /// let x = StorageLayout::new().set_or_clear_custom_placement_config(Some(CustomPlacementConfig::default()/* use setters */));
1325    /// let x = StorageLayout::new().set_or_clear_custom_placement_config(None::<CustomPlacementConfig>);
1326    /// ```
1327    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
1328    where
1329        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
1330    {
1331        self.custom_placement_config = v.map(|x| x.into());
1332        self
1333    }
1334
1335    /// Sets the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
1336    ///
1337    /// # Example
1338    /// ```ignore,no_run
1339    /// # use google_cloud_storage::model::StorageLayout;
1340    /// use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1341    /// let x = StorageLayout::new().set_hierarchical_namespace(HierarchicalNamespace::default()/* use setters */);
1342    /// ```
1343    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
1344    where
1345        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
1346    {
1347        self.hierarchical_namespace = std::option::Option::Some(v.into());
1348        self
1349    }
1350
1351    /// Sets or clears the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
1352    ///
1353    /// # Example
1354    /// ```ignore,no_run
1355    /// # use google_cloud_storage::model::StorageLayout;
1356    /// use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1357    /// let x = StorageLayout::new().set_or_clear_hierarchical_namespace(Some(HierarchicalNamespace::default()/* use setters */));
1358    /// let x = StorageLayout::new().set_or_clear_hierarchical_namespace(None::<HierarchicalNamespace>);
1359    /// ```
1360    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
1361    where
1362        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
1363    {
1364        self.hierarchical_namespace = v.map(|x| x.into());
1365        self
1366    }
1367}
1368
1369impl wkt::message::Message for StorageLayout {
1370    fn typename() -> &'static str {
1371        "type.googleapis.com/google.storage.control.v2.StorageLayout"
1372    }
1373}
1374
1375/// Defines additional types related to [StorageLayout].
1376pub mod storage_layout {
1377    #[allow(unused_imports)]
1378    use super::*;
1379
1380    /// Configuration for Custom Dual Regions.  It should specify precisely two
1381    /// eligible regions within the same Multiregion. More information on regions
1382    /// may be found [here](https://cloud.google.com/storage/docs/locations).
1383    #[derive(Clone, Default, PartialEq)]
1384    #[non_exhaustive]
1385    pub struct CustomPlacementConfig {
1386        /// List of locations to use for data placement.
1387        pub data_locations: std::vec::Vec<std::string::String>,
1388
1389        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1390    }
1391
1392    impl CustomPlacementConfig {
1393        pub fn new() -> Self {
1394            std::default::Default::default()
1395        }
1396
1397        /// Sets the value of [data_locations][crate::model::storage_layout::CustomPlacementConfig::data_locations].
1398        ///
1399        /// # Example
1400        /// ```ignore,no_run
1401        /// # use google_cloud_storage::model::storage_layout::CustomPlacementConfig;
1402        /// let x = CustomPlacementConfig::new().set_data_locations(["a", "b", "c"]);
1403        /// ```
1404        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
1405        where
1406            T: std::iter::IntoIterator<Item = V>,
1407            V: std::convert::Into<std::string::String>,
1408        {
1409            use std::iter::Iterator;
1410            self.data_locations = v.into_iter().map(|i| i.into()).collect();
1411            self
1412        }
1413    }
1414
1415    impl wkt::message::Message for CustomPlacementConfig {
1416        fn typename() -> &'static str {
1417            "type.googleapis.com/google.storage.control.v2.StorageLayout.CustomPlacementConfig"
1418        }
1419    }
1420
1421    /// Configuration for a bucket's hierarchical namespace feature.
1422    #[derive(Clone, Default, PartialEq)]
1423    #[non_exhaustive]
1424    pub struct HierarchicalNamespace {
1425        /// Enables the hierarchical namespace feature.
1426        pub enabled: bool,
1427
1428        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1429    }
1430
1431    impl HierarchicalNamespace {
1432        pub fn new() -> Self {
1433            std::default::Default::default()
1434        }
1435
1436        /// Sets the value of [enabled][crate::model::storage_layout::HierarchicalNamespace::enabled].
1437        ///
1438        /// # Example
1439        /// ```ignore,no_run
1440        /// # use google_cloud_storage::model::storage_layout::HierarchicalNamespace;
1441        /// let x = HierarchicalNamespace::new().set_enabled(true);
1442        /// ```
1443        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1444            self.enabled = v.into();
1445            self
1446        }
1447    }
1448
1449    impl wkt::message::Message for HierarchicalNamespace {
1450        fn typename() -> &'static str {
1451            "type.googleapis.com/google.storage.control.v2.StorageLayout.HierarchicalNamespace"
1452        }
1453    }
1454}
1455
1456/// Request message for GetStorageLayout.
1457#[derive(Clone, Default, PartialEq)]
1458#[non_exhaustive]
1459pub struct GetStorageLayoutRequest {
1460    /// Required. The name of the StorageLayout resource.
1461    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1462    pub name: std::string::String,
1463
1464    /// An optional prefix used for permission check. It is useful when the caller
1465    /// only has limited permissions under a specific prefix.
1466    pub prefix: std::string::String,
1467
1468    /// Optional. A unique identifier for this request. UUID is the recommended
1469    /// format, but other formats are still accepted.
1470    pub request_id: std::string::String,
1471
1472    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1473}
1474
1475impl GetStorageLayoutRequest {
1476    pub fn new() -> Self {
1477        std::default::Default::default()
1478    }
1479
1480    /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
1481    ///
1482    /// # Example
1483    /// ```ignore,no_run
1484    /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1485    /// let x = GetStorageLayoutRequest::new().set_name("example");
1486    /// ```
1487    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1488        self.name = v.into();
1489        self
1490    }
1491
1492    /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
1493    ///
1494    /// # Example
1495    /// ```ignore,no_run
1496    /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1497    /// let x = GetStorageLayoutRequest::new().set_prefix("example");
1498    /// ```
1499    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1500        self.prefix = v.into();
1501        self
1502    }
1503
1504    /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
1505    ///
1506    /// # Example
1507    /// ```ignore,no_run
1508    /// # use google_cloud_storage::model::GetStorageLayoutRequest;
1509    /// let x = GetStorageLayoutRequest::new().set_request_id("example");
1510    /// ```
1511    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1512        self.request_id = v.into();
1513        self
1514    }
1515}
1516
1517impl wkt::message::Message for GetStorageLayoutRequest {
1518    fn typename() -> &'static str {
1519        "type.googleapis.com/google.storage.control.v2.GetStorageLayoutRequest"
1520    }
1521}
1522
1523/// A managed folder.
1524#[derive(Clone, Default, PartialEq)]
1525#[non_exhaustive]
1526pub struct ManagedFolder {
1527    /// Identifier. The name of this managed folder.
1528    /// Format:
1529    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1530    pub name: std::string::String,
1531
1532    /// Output only. The metadata version of this managed folder. It increases
1533    /// whenever the metadata is updated. Used for preconditions and for detecting
1534    /// changes in metadata. Managed folders don't have a generation number.
1535    pub metageneration: i64,
1536
1537    /// Output only. The creation time of the managed folder.
1538    pub create_time: std::option::Option<wkt::Timestamp>,
1539
1540    /// Output only. The modification time of the managed folder.
1541    pub update_time: std::option::Option<wkt::Timestamp>,
1542
1543    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1544}
1545
1546impl ManagedFolder {
1547    pub fn new() -> Self {
1548        std::default::Default::default()
1549    }
1550
1551    /// Sets the value of [name][crate::model::ManagedFolder::name].
1552    ///
1553    /// # Example
1554    /// ```ignore,no_run
1555    /// # use google_cloud_storage::model::ManagedFolder;
1556    /// let x = ManagedFolder::new().set_name("example");
1557    /// ```
1558    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1559        self.name = v.into();
1560        self
1561    }
1562
1563    /// Sets the value of [metageneration][crate::model::ManagedFolder::metageneration].
1564    ///
1565    /// # Example
1566    /// ```ignore,no_run
1567    /// # use google_cloud_storage::model::ManagedFolder;
1568    /// let x = ManagedFolder::new().set_metageneration(42);
1569    /// ```
1570    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1571        self.metageneration = v.into();
1572        self
1573    }
1574
1575    /// Sets the value of [create_time][crate::model::ManagedFolder::create_time].
1576    ///
1577    /// # Example
1578    /// ```ignore,no_run
1579    /// # use google_cloud_storage::model::ManagedFolder;
1580    /// use wkt::Timestamp;
1581    /// let x = ManagedFolder::new().set_create_time(Timestamp::default()/* use setters */);
1582    /// ```
1583    pub fn set_create_time<T>(mut self, v: T) -> Self
1584    where
1585        T: std::convert::Into<wkt::Timestamp>,
1586    {
1587        self.create_time = std::option::Option::Some(v.into());
1588        self
1589    }
1590
1591    /// Sets or clears the value of [create_time][crate::model::ManagedFolder::create_time].
1592    ///
1593    /// # Example
1594    /// ```ignore,no_run
1595    /// # use google_cloud_storage::model::ManagedFolder;
1596    /// use wkt::Timestamp;
1597    /// let x = ManagedFolder::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
1598    /// let x = ManagedFolder::new().set_or_clear_create_time(None::<Timestamp>);
1599    /// ```
1600    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1601    where
1602        T: std::convert::Into<wkt::Timestamp>,
1603    {
1604        self.create_time = v.map(|x| x.into());
1605        self
1606    }
1607
1608    /// Sets the value of [update_time][crate::model::ManagedFolder::update_time].
1609    ///
1610    /// # Example
1611    /// ```ignore,no_run
1612    /// # use google_cloud_storage::model::ManagedFolder;
1613    /// use wkt::Timestamp;
1614    /// let x = ManagedFolder::new().set_update_time(Timestamp::default()/* use setters */);
1615    /// ```
1616    pub fn set_update_time<T>(mut self, v: T) -> Self
1617    where
1618        T: std::convert::Into<wkt::Timestamp>,
1619    {
1620        self.update_time = std::option::Option::Some(v.into());
1621        self
1622    }
1623
1624    /// Sets or clears the value of [update_time][crate::model::ManagedFolder::update_time].
1625    ///
1626    /// # Example
1627    /// ```ignore,no_run
1628    /// # use google_cloud_storage::model::ManagedFolder;
1629    /// use wkt::Timestamp;
1630    /// let x = ManagedFolder::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
1631    /// let x = ManagedFolder::new().set_or_clear_update_time(None::<Timestamp>);
1632    /// ```
1633    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1634    where
1635        T: std::convert::Into<wkt::Timestamp>,
1636    {
1637        self.update_time = v.map(|x| x.into());
1638        self
1639    }
1640}
1641
1642impl wkt::message::Message for ManagedFolder {
1643    fn typename() -> &'static str {
1644        "type.googleapis.com/google.storage.control.v2.ManagedFolder"
1645    }
1646}
1647
1648/// Request message for GetManagedFolder.
1649#[derive(Clone, Default, PartialEq)]
1650#[non_exhaustive]
1651pub struct GetManagedFolderRequest {
1652    /// Required. Name of the managed folder.
1653    /// Format:
1654    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1655    pub name: std::string::String,
1656
1657    /// The operation succeeds conditional on the managed folder's current
1658    /// metageneration matching the value here specified.
1659    pub if_metageneration_match: std::option::Option<i64>,
1660
1661    /// The operation succeeds conditional on the managed folder's current
1662    /// metageneration NOT matching the value here specified.
1663    pub if_metageneration_not_match: std::option::Option<i64>,
1664
1665    /// Optional. A unique identifier for this request. UUID is the recommended
1666    /// format, but other formats are still accepted.
1667    pub request_id: std::string::String,
1668
1669    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1670}
1671
1672impl GetManagedFolderRequest {
1673    pub fn new() -> Self {
1674        std::default::Default::default()
1675    }
1676
1677    /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
1678    ///
1679    /// # Example
1680    /// ```ignore,no_run
1681    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1682    /// let x = GetManagedFolderRequest::new().set_name("example");
1683    /// ```
1684    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1685        self.name = v.into();
1686        self
1687    }
1688
1689    /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1690    ///
1691    /// # Example
1692    /// ```ignore,no_run
1693    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1694    /// let x = GetManagedFolderRequest::new().set_if_metageneration_match(42);
1695    /// ```
1696    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1697    where
1698        T: std::convert::Into<i64>,
1699    {
1700        self.if_metageneration_match = std::option::Option::Some(v.into());
1701        self
1702    }
1703
1704    /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1705    ///
1706    /// # Example
1707    /// ```ignore,no_run
1708    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1709    /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
1710    /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1711    /// ```
1712    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1713    where
1714        T: std::convert::Into<i64>,
1715    {
1716        self.if_metageneration_match = v.map(|x| x.into());
1717        self
1718    }
1719
1720    /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1721    ///
1722    /// # Example
1723    /// ```ignore,no_run
1724    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1725    /// let x = GetManagedFolderRequest::new().set_if_metageneration_not_match(42);
1726    /// ```
1727    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1728    where
1729        T: std::convert::Into<i64>,
1730    {
1731        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1732        self
1733    }
1734
1735    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1736    ///
1737    /// # Example
1738    /// ```ignore,no_run
1739    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1740    /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1741    /// let x = GetManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1742    /// ```
1743    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1744    where
1745        T: std::convert::Into<i64>,
1746    {
1747        self.if_metageneration_not_match = v.map(|x| x.into());
1748        self
1749    }
1750
1751    /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
1752    ///
1753    /// # Example
1754    /// ```ignore,no_run
1755    /// # use google_cloud_storage::model::GetManagedFolderRequest;
1756    /// let x = GetManagedFolderRequest::new().set_request_id("example");
1757    /// ```
1758    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1759        self.request_id = v.into();
1760        self
1761    }
1762}
1763
1764impl wkt::message::Message for GetManagedFolderRequest {
1765    fn typename() -> &'static str {
1766        "type.googleapis.com/google.storage.control.v2.GetManagedFolderRequest"
1767    }
1768}
1769
1770/// Request message for CreateManagedFolder.
1771#[derive(Clone, Default, PartialEq)]
1772#[non_exhaustive]
1773pub struct CreateManagedFolderRequest {
1774    /// Required. Name of the bucket this managed folder belongs to.
1775    pub parent: std::string::String,
1776
1777    /// Required. Properties of the managed folder being created.
1778    /// The bucket and managed folder names are specified in the `parent` and
1779    /// `managed_folder_id` fields. Populating these fields in `managed_folder`
1780    /// will result in an error.
1781    pub managed_folder: std::option::Option<crate::model::ManagedFolder>,
1782
1783    /// Required. The name of the managed folder. It uses a single `/` as delimiter
1784    /// and leading and trailing `/` are allowed.
1785    pub managed_folder_id: std::string::String,
1786
1787    /// Optional. A unique identifier for this request. UUID is the recommended
1788    /// format, but other formats are still accepted.
1789    pub request_id: std::string::String,
1790
1791    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1792}
1793
1794impl CreateManagedFolderRequest {
1795    pub fn new() -> Self {
1796        std::default::Default::default()
1797    }
1798
1799    /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
1800    ///
1801    /// # Example
1802    /// ```ignore,no_run
1803    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
1804    /// let x = CreateManagedFolderRequest::new().set_parent("example");
1805    /// ```
1806    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1807        self.parent = v.into();
1808        self
1809    }
1810
1811    /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
1812    ///
1813    /// # Example
1814    /// ```ignore,no_run
1815    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
1816    /// use google_cloud_storage::model::ManagedFolder;
1817    /// let x = CreateManagedFolderRequest::new().set_managed_folder(ManagedFolder::default()/* use setters */);
1818    /// ```
1819    pub fn set_managed_folder<T>(mut self, v: T) -> Self
1820    where
1821        T: std::convert::Into<crate::model::ManagedFolder>,
1822    {
1823        self.managed_folder = std::option::Option::Some(v.into());
1824        self
1825    }
1826
1827    /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
1828    ///
1829    /// # Example
1830    /// ```ignore,no_run
1831    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
1832    /// use google_cloud_storage::model::ManagedFolder;
1833    /// let x = CreateManagedFolderRequest::new().set_or_clear_managed_folder(Some(ManagedFolder::default()/* use setters */));
1834    /// let x = CreateManagedFolderRequest::new().set_or_clear_managed_folder(None::<ManagedFolder>);
1835    /// ```
1836    pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1837    where
1838        T: std::convert::Into<crate::model::ManagedFolder>,
1839    {
1840        self.managed_folder = v.map(|x| x.into());
1841        self
1842    }
1843
1844    /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
1845    ///
1846    /// # Example
1847    /// ```ignore,no_run
1848    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
1849    /// let x = CreateManagedFolderRequest::new().set_managed_folder_id("example");
1850    /// ```
1851    pub fn set_managed_folder_id<T: std::convert::Into<std::string::String>>(
1852        mut self,
1853        v: T,
1854    ) -> Self {
1855        self.managed_folder_id = v.into();
1856        self
1857    }
1858
1859    /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
1860    ///
1861    /// # Example
1862    /// ```ignore,no_run
1863    /// # use google_cloud_storage::model::CreateManagedFolderRequest;
1864    /// let x = CreateManagedFolderRequest::new().set_request_id("example");
1865    /// ```
1866    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1867        self.request_id = v.into();
1868        self
1869    }
1870}
1871
1872impl wkt::message::Message for CreateManagedFolderRequest {
1873    fn typename() -> &'static str {
1874        "type.googleapis.com/google.storage.control.v2.CreateManagedFolderRequest"
1875    }
1876}
1877
1878/// DeleteManagedFolder RPC request message.
1879#[derive(Clone, Default, PartialEq)]
1880#[non_exhaustive]
1881pub struct DeleteManagedFolderRequest {
1882    /// Required. Name of the managed folder.
1883    /// Format:
1884    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1885    pub name: std::string::String,
1886
1887    /// The operation succeeds conditional on the managed folder's current
1888    /// metageneration matching the value here specified.
1889    pub if_metageneration_match: std::option::Option<i64>,
1890
1891    /// The operation succeeds conditional on the managed folder's current
1892    /// metageneration NOT matching the value here specified.
1893    pub if_metageneration_not_match: std::option::Option<i64>,
1894
1895    /// Allows deletion of a managed folder even if it is not empty.
1896    /// A managed folder is empty if it manages no child managed folders or
1897    /// objects. Caller must have permission for
1898    /// storage.managedFolders.setIamPolicy.
1899    pub allow_non_empty: bool,
1900
1901    /// Optional. A unique identifier for this request. UUID is the recommended
1902    /// format, but other formats are still accepted.
1903    pub request_id: std::string::String,
1904
1905    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1906}
1907
1908impl DeleteManagedFolderRequest {
1909    pub fn new() -> Self {
1910        std::default::Default::default()
1911    }
1912
1913    /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
1914    ///
1915    /// # Example
1916    /// ```ignore,no_run
1917    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
1918    /// let x = DeleteManagedFolderRequest::new().set_name("example");
1919    /// ```
1920    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1921        self.name = v.into();
1922        self
1923    }
1924
1925    /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
1926    ///
1927    /// # Example
1928    /// ```ignore,no_run
1929    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
1930    /// let x = DeleteManagedFolderRequest::new().set_if_metageneration_match(42);
1931    /// ```
1932    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1933    where
1934        T: std::convert::Into<i64>,
1935    {
1936        self.if_metageneration_match = std::option::Option::Some(v.into());
1937        self
1938    }
1939
1940    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
1941    ///
1942    /// # Example
1943    /// ```ignore,no_run
1944    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
1945    /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_match(Some(42));
1946    /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_match(None::<i32>);
1947    /// ```
1948    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1949    where
1950        T: std::convert::Into<i64>,
1951    {
1952        self.if_metageneration_match = v.map(|x| x.into());
1953        self
1954    }
1955
1956    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
1957    ///
1958    /// # Example
1959    /// ```ignore,no_run
1960    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
1961    /// let x = DeleteManagedFolderRequest::new().set_if_metageneration_not_match(42);
1962    /// ```
1963    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1964    where
1965        T: std::convert::Into<i64>,
1966    {
1967        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1968        self
1969    }
1970
1971    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
1972    ///
1973    /// # Example
1974    /// ```ignore,no_run
1975    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
1976    /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(Some(42));
1977    /// let x = DeleteManagedFolderRequest::new().set_or_clear_if_metageneration_not_match(None::<i32>);
1978    /// ```
1979    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1980    where
1981        T: std::convert::Into<i64>,
1982    {
1983        self.if_metageneration_not_match = v.map(|x| x.into());
1984        self
1985    }
1986
1987    /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
1988    ///
1989    /// # Example
1990    /// ```ignore,no_run
1991    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
1992    /// let x = DeleteManagedFolderRequest::new().set_allow_non_empty(true);
1993    /// ```
1994    pub fn set_allow_non_empty<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1995        self.allow_non_empty = v.into();
1996        self
1997    }
1998
1999    /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
2000    ///
2001    /// # Example
2002    /// ```ignore,no_run
2003    /// # use google_cloud_storage::model::DeleteManagedFolderRequest;
2004    /// let x = DeleteManagedFolderRequest::new().set_request_id("example");
2005    /// ```
2006    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2007        self.request_id = v.into();
2008        self
2009    }
2010}
2011
2012impl wkt::message::Message for DeleteManagedFolderRequest {
2013    fn typename() -> &'static str {
2014        "type.googleapis.com/google.storage.control.v2.DeleteManagedFolderRequest"
2015    }
2016}
2017
2018/// Request message for ListManagedFolders.
2019#[derive(Clone, Default, PartialEq)]
2020#[non_exhaustive]
2021pub struct ListManagedFoldersRequest {
2022    /// Required. Name of the bucket this managed folder belongs to.
2023    pub parent: std::string::String,
2024
2025    /// Optional. Maximum number of managed folders to return in a single response.
2026    /// The service will use this parameter or 1,000 items, whichever is smaller.
2027    pub page_size: i32,
2028
2029    /// Optional. A previously-returned page token representing part of the larger
2030    /// set of results to view.
2031    pub page_token: std::string::String,
2032
2033    /// Optional. Filter results to match managed folders with name starting with
2034    /// this prefix.
2035    pub prefix: std::string::String,
2036
2037    /// Optional. A unique identifier for this request. UUID is the recommended
2038    /// format, but other formats are still accepted.
2039    pub request_id: std::string::String,
2040
2041    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2042}
2043
2044impl ListManagedFoldersRequest {
2045    pub fn new() -> Self {
2046        std::default::Default::default()
2047    }
2048
2049    /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
2050    ///
2051    /// # Example
2052    /// ```ignore,no_run
2053    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2054    /// let x = ListManagedFoldersRequest::new().set_parent("example");
2055    /// ```
2056    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2057        self.parent = v.into();
2058        self
2059    }
2060
2061    /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
2062    ///
2063    /// # Example
2064    /// ```ignore,no_run
2065    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2066    /// let x = ListManagedFoldersRequest::new().set_page_size(42);
2067    /// ```
2068    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2069        self.page_size = v.into();
2070        self
2071    }
2072
2073    /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
2074    ///
2075    /// # Example
2076    /// ```ignore,no_run
2077    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2078    /// let x = ListManagedFoldersRequest::new().set_page_token("example");
2079    /// ```
2080    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2081        self.page_token = v.into();
2082        self
2083    }
2084
2085    /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
2086    ///
2087    /// # Example
2088    /// ```ignore,no_run
2089    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2090    /// let x = ListManagedFoldersRequest::new().set_prefix("example");
2091    /// ```
2092    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2093        self.prefix = v.into();
2094        self
2095    }
2096
2097    /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
2098    ///
2099    /// # Example
2100    /// ```ignore,no_run
2101    /// # use google_cloud_storage::model::ListManagedFoldersRequest;
2102    /// let x = ListManagedFoldersRequest::new().set_request_id("example");
2103    /// ```
2104    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2105        self.request_id = v.into();
2106        self
2107    }
2108}
2109
2110impl wkt::message::Message for ListManagedFoldersRequest {
2111    fn typename() -> &'static str {
2112        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersRequest"
2113    }
2114}
2115
2116/// Response message for ListManagedFolders.
2117#[derive(Clone, Default, PartialEq)]
2118#[non_exhaustive]
2119pub struct ListManagedFoldersResponse {
2120    /// The list of matching managed folders
2121    pub managed_folders: std::vec::Vec<crate::model::ManagedFolder>,
2122
2123    /// The continuation token, used to page through large result sets. Provide
2124    /// this value in a subsequent request to return the next page of results.
2125    pub next_page_token: std::string::String,
2126
2127    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2128}
2129
2130impl ListManagedFoldersResponse {
2131    pub fn new() -> Self {
2132        std::default::Default::default()
2133    }
2134
2135    /// Sets the value of [managed_folders][crate::model::ListManagedFoldersResponse::managed_folders].
2136    ///
2137    /// # Example
2138    /// ```ignore,no_run
2139    /// # use google_cloud_storage::model::ListManagedFoldersResponse;
2140    /// use google_cloud_storage::model::ManagedFolder;
2141    /// let x = ListManagedFoldersResponse::new()
2142    ///     .set_managed_folders([
2143    ///         ManagedFolder::default()/* use setters */,
2144    ///         ManagedFolder::default()/* use (different) setters */,
2145    ///     ]);
2146    /// ```
2147    pub fn set_managed_folders<T, V>(mut self, v: T) -> Self
2148    where
2149        T: std::iter::IntoIterator<Item = V>,
2150        V: std::convert::Into<crate::model::ManagedFolder>,
2151    {
2152        use std::iter::Iterator;
2153        self.managed_folders = v.into_iter().map(|i| i.into()).collect();
2154        self
2155    }
2156
2157    /// Sets the value of [next_page_token][crate::model::ListManagedFoldersResponse::next_page_token].
2158    ///
2159    /// # Example
2160    /// ```ignore,no_run
2161    /// # use google_cloud_storage::model::ListManagedFoldersResponse;
2162    /// let x = ListManagedFoldersResponse::new().set_next_page_token("example");
2163    /// ```
2164    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2165        self.next_page_token = v.into();
2166        self
2167    }
2168}
2169
2170impl wkt::message::Message for ListManagedFoldersResponse {
2171    fn typename() -> &'static str {
2172        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersResponse"
2173    }
2174}
2175
2176#[doc(hidden)]
2177impl gax::paginator::internal::PageableResponse for ListManagedFoldersResponse {
2178    type PageItem = crate::model::ManagedFolder;
2179
2180    fn items(self) -> std::vec::Vec<Self::PageItem> {
2181        self.managed_folders
2182    }
2183
2184    fn next_page_token(&self) -> std::string::String {
2185        use std::clone::Clone;
2186        self.next_page_token.clone()
2187    }
2188}
2189
2190/// Message returned in the metadata field of the Operation resource for
2191/// CreateAnywhereCache operations.
2192#[derive(Clone, Default, PartialEq)]
2193#[non_exhaustive]
2194pub struct CreateAnywhereCacheMetadata {
2195    /// Generic metadata for the long running operation.
2196    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
2197
2198    /// Anywhere Cache ID.
2199    pub anywhere_cache_id: std::option::Option<std::string::String>,
2200
2201    /// The zone in which the cache instance is running. For example,
2202    /// us-central1-a.
2203    pub zone: std::option::Option<std::string::String>,
2204
2205    /// Anywhere Cache entry's TTL. A cache-level config that is applied to all new
2206    /// cache entries on admission. Default ttl value (24hrs) is applied if not
2207    /// specified in the create request.
2208    pub ttl: std::option::Option<wkt::Duration>,
2209
2210    /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
2211    /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
2212    /// applied if not specified in the create request.
2213    pub admission_policy: std::option::Option<std::string::String>,
2214
2215    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2216}
2217
2218impl CreateAnywhereCacheMetadata {
2219    pub fn new() -> Self {
2220        std::default::Default::default()
2221    }
2222
2223    /// Sets the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
2224    ///
2225    /// # Example
2226    /// ```ignore,no_run
2227    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2228    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2229    /// let x = CreateAnywhereCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
2230    /// ```
2231    pub fn set_common_metadata<T>(mut self, v: T) -> Self
2232    where
2233        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2234    {
2235        self.common_metadata = std::option::Option::Some(v.into());
2236        self
2237    }
2238
2239    /// Sets or clears the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
2240    ///
2241    /// # Example
2242    /// ```ignore,no_run
2243    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2244    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2245    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
2246    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
2247    /// ```
2248    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2249    where
2250        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2251    {
2252        self.common_metadata = v.map(|x| x.into());
2253        self
2254    }
2255
2256    /// Sets the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
2257    ///
2258    /// # Example
2259    /// ```ignore,no_run
2260    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2261    /// let x = CreateAnywhereCacheMetadata::new().set_anywhere_cache_id("example");
2262    /// ```
2263    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
2264    where
2265        T: std::convert::Into<std::string::String>,
2266    {
2267        self.anywhere_cache_id = std::option::Option::Some(v.into());
2268        self
2269    }
2270
2271    /// Sets or clears the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
2272    ///
2273    /// # Example
2274    /// ```ignore,no_run
2275    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2276    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(Some("example"));
2277    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(None::<String>);
2278    /// ```
2279    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
2280    where
2281        T: std::convert::Into<std::string::String>,
2282    {
2283        self.anywhere_cache_id = v.map(|x| x.into());
2284        self
2285    }
2286
2287    /// Sets the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
2288    ///
2289    /// # Example
2290    /// ```ignore,no_run
2291    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2292    /// let x = CreateAnywhereCacheMetadata::new().set_zone("example");
2293    /// ```
2294    pub fn set_zone<T>(mut self, v: T) -> Self
2295    where
2296        T: std::convert::Into<std::string::String>,
2297    {
2298        self.zone = std::option::Option::Some(v.into());
2299        self
2300    }
2301
2302    /// Sets or clears the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
2303    ///
2304    /// # Example
2305    /// ```ignore,no_run
2306    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2307    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_zone(Some("example"));
2308    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_zone(None::<String>);
2309    /// ```
2310    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
2311    where
2312        T: std::convert::Into<std::string::String>,
2313    {
2314        self.zone = v.map(|x| x.into());
2315        self
2316    }
2317
2318    /// Sets the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
2319    ///
2320    /// # Example
2321    /// ```ignore,no_run
2322    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2323    /// use wkt::Duration;
2324    /// let x = CreateAnywhereCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
2325    /// ```
2326    pub fn set_ttl<T>(mut self, v: T) -> Self
2327    where
2328        T: std::convert::Into<wkt::Duration>,
2329    {
2330        self.ttl = std::option::Option::Some(v.into());
2331        self
2332    }
2333
2334    /// Sets or clears the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
2335    ///
2336    /// # Example
2337    /// ```ignore,no_run
2338    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2339    /// use wkt::Duration;
2340    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2341    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
2342    /// ```
2343    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2344    where
2345        T: std::convert::Into<wkt::Duration>,
2346    {
2347        self.ttl = v.map(|x| x.into());
2348        self
2349    }
2350
2351    /// Sets the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
2352    ///
2353    /// # Example
2354    /// ```ignore,no_run
2355    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2356    /// let x = CreateAnywhereCacheMetadata::new().set_admission_policy("example");
2357    /// ```
2358    pub fn set_admission_policy<T>(mut self, v: T) -> Self
2359    where
2360        T: std::convert::Into<std::string::String>,
2361    {
2362        self.admission_policy = std::option::Option::Some(v.into());
2363        self
2364    }
2365
2366    /// Sets or clears the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
2367    ///
2368    /// # Example
2369    /// ```ignore,no_run
2370    /// # use google_cloud_storage::model::CreateAnywhereCacheMetadata;
2371    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
2372    /// let x = CreateAnywhereCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
2373    /// ```
2374    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
2375    where
2376        T: std::convert::Into<std::string::String>,
2377    {
2378        self.admission_policy = v.map(|x| x.into());
2379        self
2380    }
2381}
2382
2383impl wkt::message::Message for CreateAnywhereCacheMetadata {
2384    fn typename() -> &'static str {
2385        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheMetadata"
2386    }
2387}
2388
2389/// Message returned in the metadata field of the Operation resource for
2390/// UpdateAnywhereCache operation.
2391#[derive(Clone, Default, PartialEq)]
2392#[non_exhaustive]
2393pub struct UpdateAnywhereCacheMetadata {
2394    /// Generic metadata for the long running operation.
2395    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
2396
2397    /// Anywhere Cache ID.
2398    pub anywhere_cache_id: std::option::Option<std::string::String>,
2399
2400    /// The zone in which the cache instance is running. For example,
2401    /// us-central1-a.
2402    pub zone: std::option::Option<std::string::String>,
2403
2404    /// Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that
2405    /// is applied to all new cache entries on admission. If `ttl` is pending
2406    /// update, this field equals to the new value specified in the Update request.
2407    pub ttl: std::option::Option<wkt::Duration>,
2408
2409    /// L4 Cache entry Admission Policy in kebab-case (e.g.,
2410    /// "admit-on-first-miss"). If `admission_policy` is pending
2411    /// update, this field equals to the new value specified in the Update request.
2412    pub admission_policy: std::option::Option<std::string::String>,
2413
2414    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2415}
2416
2417impl UpdateAnywhereCacheMetadata {
2418    pub fn new() -> Self {
2419        std::default::Default::default()
2420    }
2421
2422    /// Sets the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
2423    ///
2424    /// # Example
2425    /// ```ignore,no_run
2426    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2427    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2428    /// let x = UpdateAnywhereCacheMetadata::new().set_common_metadata(CommonLongRunningOperationMetadata::default()/* use setters */);
2429    /// ```
2430    pub fn set_common_metadata<T>(mut self, v: T) -> Self
2431    where
2432        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2433    {
2434        self.common_metadata = std::option::Option::Some(v.into());
2435        self
2436    }
2437
2438    /// Sets or clears the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
2439    ///
2440    /// # Example
2441    /// ```ignore,no_run
2442    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2443    /// use google_cloud_storage::model::CommonLongRunningOperationMetadata;
2444    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_common_metadata(Some(CommonLongRunningOperationMetadata::default()/* use setters */));
2445    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_common_metadata(None::<CommonLongRunningOperationMetadata>);
2446    /// ```
2447    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2448    where
2449        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2450    {
2451        self.common_metadata = v.map(|x| x.into());
2452        self
2453    }
2454
2455    /// Sets the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
2456    ///
2457    /// # Example
2458    /// ```ignore,no_run
2459    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2460    /// let x = UpdateAnywhereCacheMetadata::new().set_anywhere_cache_id("example");
2461    /// ```
2462    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
2463    where
2464        T: std::convert::Into<std::string::String>,
2465    {
2466        self.anywhere_cache_id = std::option::Option::Some(v.into());
2467        self
2468    }
2469
2470    /// Sets or clears the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
2471    ///
2472    /// # Example
2473    /// ```ignore,no_run
2474    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2475    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(Some("example"));
2476    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_anywhere_cache_id(None::<String>);
2477    /// ```
2478    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
2479    where
2480        T: std::convert::Into<std::string::String>,
2481    {
2482        self.anywhere_cache_id = v.map(|x| x.into());
2483        self
2484    }
2485
2486    /// Sets the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
2487    ///
2488    /// # Example
2489    /// ```ignore,no_run
2490    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2491    /// let x = UpdateAnywhereCacheMetadata::new().set_zone("example");
2492    /// ```
2493    pub fn set_zone<T>(mut self, v: T) -> Self
2494    where
2495        T: std::convert::Into<std::string::String>,
2496    {
2497        self.zone = std::option::Option::Some(v.into());
2498        self
2499    }
2500
2501    /// Sets or clears the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
2502    ///
2503    /// # Example
2504    /// ```ignore,no_run
2505    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2506    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_zone(Some("example"));
2507    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_zone(None::<String>);
2508    /// ```
2509    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
2510    where
2511        T: std::convert::Into<std::string::String>,
2512    {
2513        self.zone = v.map(|x| x.into());
2514        self
2515    }
2516
2517    /// Sets the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
2518    ///
2519    /// # Example
2520    /// ```ignore,no_run
2521    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2522    /// use wkt::Duration;
2523    /// let x = UpdateAnywhereCacheMetadata::new().set_ttl(Duration::default()/* use setters */);
2524    /// ```
2525    pub fn set_ttl<T>(mut self, v: T) -> Self
2526    where
2527        T: std::convert::Into<wkt::Duration>,
2528    {
2529        self.ttl = std::option::Option::Some(v.into());
2530        self
2531    }
2532
2533    /// Sets or clears the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
2534    ///
2535    /// # Example
2536    /// ```ignore,no_run
2537    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2538    /// use wkt::Duration;
2539    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2540    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_ttl(None::<Duration>);
2541    /// ```
2542    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2543    where
2544        T: std::convert::Into<wkt::Duration>,
2545    {
2546        self.ttl = v.map(|x| x.into());
2547        self
2548    }
2549
2550    /// Sets the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
2551    ///
2552    /// # Example
2553    /// ```ignore,no_run
2554    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2555    /// let x = UpdateAnywhereCacheMetadata::new().set_admission_policy("example");
2556    /// ```
2557    pub fn set_admission_policy<T>(mut self, v: T) -> Self
2558    where
2559        T: std::convert::Into<std::string::String>,
2560    {
2561        self.admission_policy = std::option::Option::Some(v.into());
2562        self
2563    }
2564
2565    /// Sets or clears the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
2566    ///
2567    /// # Example
2568    /// ```ignore,no_run
2569    /// # use google_cloud_storage::model::UpdateAnywhereCacheMetadata;
2570    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_admission_policy(Some("example"));
2571    /// let x = UpdateAnywhereCacheMetadata::new().set_or_clear_admission_policy(None::<String>);
2572    /// ```
2573    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
2574    where
2575        T: std::convert::Into<std::string::String>,
2576    {
2577        self.admission_policy = v.map(|x| x.into());
2578        self
2579    }
2580}
2581
2582impl wkt::message::Message for UpdateAnywhereCacheMetadata {
2583    fn typename() -> &'static str {
2584        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheMetadata"
2585    }
2586}
2587
2588/// An Anywhere Cache Instance.
2589#[derive(Clone, Default, PartialEq)]
2590#[non_exhaustive]
2591pub struct AnywhereCache {
2592    /// Immutable. The resource name of this AnywhereCache.
2593    /// Format:
2594    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
2595    pub name: std::string::String,
2596
2597    /// Immutable. The zone in which the cache instance is running. For example,
2598    /// us-central1-a.
2599    pub zone: std::string::String,
2600
2601    /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
2602    /// that defines how long a cache entry can live. Default ttl value (24hrs)
2603    /// is applied if not specified in the create request. TTL must be in whole
2604    /// seconds.
2605    pub ttl: std::option::Option<wkt::Duration>,
2606
2607    /// Cache admission policy. Valid policies includes:
2608    /// `admit-on-first-miss` and `admit-on-second-miss`. Defaults to
2609    /// `admit-on-first-miss`. Default value is applied if not specified in the
2610    /// create request.
2611    pub admission_policy: std::string::String,
2612
2613    /// Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED.
2614    pub state: std::string::String,
2615
2616    /// Output only. Time when Anywhere cache instance is allocated.
2617    pub create_time: std::option::Option<wkt::Timestamp>,
2618
2619    /// Output only. Time when Anywhere cache instance is last updated, including
2620    /// creation.
2621    pub update_time: std::option::Option<wkt::Timestamp>,
2622
2623    /// Output only. True if there is an active update operation against this cache
2624    /// instance. Subsequential update requests will be rejected if this field is
2625    /// true. Output only.
2626    pub pending_update: bool,
2627
2628    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2629}
2630
2631impl AnywhereCache {
2632    pub fn new() -> Self {
2633        std::default::Default::default()
2634    }
2635
2636    /// Sets the value of [name][crate::model::AnywhereCache::name].
2637    ///
2638    /// # Example
2639    /// ```ignore,no_run
2640    /// # use google_cloud_storage::model::AnywhereCache;
2641    /// let x = AnywhereCache::new().set_name("example");
2642    /// ```
2643    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2644        self.name = v.into();
2645        self
2646    }
2647
2648    /// Sets the value of [zone][crate::model::AnywhereCache::zone].
2649    ///
2650    /// # Example
2651    /// ```ignore,no_run
2652    /// # use google_cloud_storage::model::AnywhereCache;
2653    /// let x = AnywhereCache::new().set_zone("example");
2654    /// ```
2655    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2656        self.zone = v.into();
2657        self
2658    }
2659
2660    /// Sets the value of [ttl][crate::model::AnywhereCache::ttl].
2661    ///
2662    /// # Example
2663    /// ```ignore,no_run
2664    /// # use google_cloud_storage::model::AnywhereCache;
2665    /// use wkt::Duration;
2666    /// let x = AnywhereCache::new().set_ttl(Duration::default()/* use setters */);
2667    /// ```
2668    pub fn set_ttl<T>(mut self, v: T) -> Self
2669    where
2670        T: std::convert::Into<wkt::Duration>,
2671    {
2672        self.ttl = std::option::Option::Some(v.into());
2673        self
2674    }
2675
2676    /// Sets or clears the value of [ttl][crate::model::AnywhereCache::ttl].
2677    ///
2678    /// # Example
2679    /// ```ignore,no_run
2680    /// # use google_cloud_storage::model::AnywhereCache;
2681    /// use wkt::Duration;
2682    /// let x = AnywhereCache::new().set_or_clear_ttl(Some(Duration::default()/* use setters */));
2683    /// let x = AnywhereCache::new().set_or_clear_ttl(None::<Duration>);
2684    /// ```
2685    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
2686    where
2687        T: std::convert::Into<wkt::Duration>,
2688    {
2689        self.ttl = v.map(|x| x.into());
2690        self
2691    }
2692
2693    /// Sets the value of [admission_policy][crate::model::AnywhereCache::admission_policy].
2694    ///
2695    /// # Example
2696    /// ```ignore,no_run
2697    /// # use google_cloud_storage::model::AnywhereCache;
2698    /// let x = AnywhereCache::new().set_admission_policy("example");
2699    /// ```
2700    pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
2701        mut self,
2702        v: T,
2703    ) -> Self {
2704        self.admission_policy = v.into();
2705        self
2706    }
2707
2708    /// Sets the value of [state][crate::model::AnywhereCache::state].
2709    ///
2710    /// # Example
2711    /// ```ignore,no_run
2712    /// # use google_cloud_storage::model::AnywhereCache;
2713    /// let x = AnywhereCache::new().set_state("example");
2714    /// ```
2715    pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2716        self.state = v.into();
2717        self
2718    }
2719
2720    /// Sets the value of [create_time][crate::model::AnywhereCache::create_time].
2721    ///
2722    /// # Example
2723    /// ```ignore,no_run
2724    /// # use google_cloud_storage::model::AnywhereCache;
2725    /// use wkt::Timestamp;
2726    /// let x = AnywhereCache::new().set_create_time(Timestamp::default()/* use setters */);
2727    /// ```
2728    pub fn set_create_time<T>(mut self, v: T) -> Self
2729    where
2730        T: std::convert::Into<wkt::Timestamp>,
2731    {
2732        self.create_time = std::option::Option::Some(v.into());
2733        self
2734    }
2735
2736    /// Sets or clears the value of [create_time][crate::model::AnywhereCache::create_time].
2737    ///
2738    /// # Example
2739    /// ```ignore,no_run
2740    /// # use google_cloud_storage::model::AnywhereCache;
2741    /// use wkt::Timestamp;
2742    /// let x = AnywhereCache::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
2743    /// let x = AnywhereCache::new().set_or_clear_create_time(None::<Timestamp>);
2744    /// ```
2745    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2746    where
2747        T: std::convert::Into<wkt::Timestamp>,
2748    {
2749        self.create_time = v.map(|x| x.into());
2750        self
2751    }
2752
2753    /// Sets the value of [update_time][crate::model::AnywhereCache::update_time].
2754    ///
2755    /// # Example
2756    /// ```ignore,no_run
2757    /// # use google_cloud_storage::model::AnywhereCache;
2758    /// use wkt::Timestamp;
2759    /// let x = AnywhereCache::new().set_update_time(Timestamp::default()/* use setters */);
2760    /// ```
2761    pub fn set_update_time<T>(mut self, v: T) -> Self
2762    where
2763        T: std::convert::Into<wkt::Timestamp>,
2764    {
2765        self.update_time = std::option::Option::Some(v.into());
2766        self
2767    }
2768
2769    /// Sets or clears the value of [update_time][crate::model::AnywhereCache::update_time].
2770    ///
2771    /// # Example
2772    /// ```ignore,no_run
2773    /// # use google_cloud_storage::model::AnywhereCache;
2774    /// use wkt::Timestamp;
2775    /// let x = AnywhereCache::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
2776    /// let x = AnywhereCache::new().set_or_clear_update_time(None::<Timestamp>);
2777    /// ```
2778    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2779    where
2780        T: std::convert::Into<wkt::Timestamp>,
2781    {
2782        self.update_time = v.map(|x| x.into());
2783        self
2784    }
2785
2786    /// Sets the value of [pending_update][crate::model::AnywhereCache::pending_update].
2787    ///
2788    /// # Example
2789    /// ```ignore,no_run
2790    /// # use google_cloud_storage::model::AnywhereCache;
2791    /// let x = AnywhereCache::new().set_pending_update(true);
2792    /// ```
2793    pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2794        self.pending_update = v.into();
2795        self
2796    }
2797}
2798
2799impl wkt::message::Message for AnywhereCache {
2800    fn typename() -> &'static str {
2801        "type.googleapis.com/google.storage.control.v2.AnywhereCache"
2802    }
2803}
2804
2805/// Request message for CreateAnywhereCache.
2806#[derive(Clone, Default, PartialEq)]
2807#[non_exhaustive]
2808pub struct CreateAnywhereCacheRequest {
2809    /// Required. The bucket to which this cache belongs.
2810    /// Format: `projects/{project}/buckets/{bucket}`
2811    pub parent: std::string::String,
2812
2813    /// Required. Properties of the Anywhere Cache instance being created.
2814    /// The parent bucket name is specified in the `parent` field. Server uses the
2815    /// default value of `ttl` or `admission_policy` if not specified in
2816    /// request.
2817    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
2818
2819    /// Optional. A unique identifier for this request. UUID is the recommended
2820    /// format, but other formats are still accepted. This request is only
2821    /// idempotent if a `request_id` is provided.
2822    pub request_id: std::string::String,
2823
2824    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2825}
2826
2827impl CreateAnywhereCacheRequest {
2828    pub fn new() -> Self {
2829        std::default::Default::default()
2830    }
2831
2832    /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
2833    ///
2834    /// # Example
2835    /// ```ignore,no_run
2836    /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
2837    /// let x = CreateAnywhereCacheRequest::new().set_parent("example");
2838    /// ```
2839    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2840        self.parent = v.into();
2841        self
2842    }
2843
2844    /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
2845    ///
2846    /// # Example
2847    /// ```ignore,no_run
2848    /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
2849    /// use google_cloud_storage::model::AnywhereCache;
2850    /// let x = CreateAnywhereCacheRequest::new().set_anywhere_cache(AnywhereCache::default()/* use setters */);
2851    /// ```
2852    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
2853    where
2854        T: std::convert::Into<crate::model::AnywhereCache>,
2855    {
2856        self.anywhere_cache = std::option::Option::Some(v.into());
2857        self
2858    }
2859
2860    /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
2861    ///
2862    /// # Example
2863    /// ```ignore,no_run
2864    /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
2865    /// use google_cloud_storage::model::AnywhereCache;
2866    /// let x = CreateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(Some(AnywhereCache::default()/* use setters */));
2867    /// let x = CreateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(None::<AnywhereCache>);
2868    /// ```
2869    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
2870    where
2871        T: std::convert::Into<crate::model::AnywhereCache>,
2872    {
2873        self.anywhere_cache = v.map(|x| x.into());
2874        self
2875    }
2876
2877    /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
2878    ///
2879    /// # Example
2880    /// ```ignore,no_run
2881    /// # use google_cloud_storage::model::CreateAnywhereCacheRequest;
2882    /// let x = CreateAnywhereCacheRequest::new().set_request_id("example");
2883    /// ```
2884    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2885        self.request_id = v.into();
2886        self
2887    }
2888}
2889
2890impl wkt::message::Message for CreateAnywhereCacheRequest {
2891    fn typename() -> &'static str {
2892        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheRequest"
2893    }
2894}
2895
2896/// Request message for UpdateAnywhereCache.
2897#[derive(Clone, Default, PartialEq)]
2898#[non_exhaustive]
2899pub struct UpdateAnywhereCacheRequest {
2900    /// Required. The Anywhere Cache instance to be updated.
2901    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
2902
2903    /// Required. List of fields to be updated. Mutable fields of AnywhereCache
2904    /// include `ttl` and `admission_policy`.
2905    ///
2906    /// To specify ALL fields, specify a single field with the value `*`. Note: We
2907    /// recommend against doing this. If a new field is introduced at a later time,
2908    /// an older client updating with the `*` may accidentally reset the new
2909    /// field's value.
2910    ///
2911    /// Not specifying any fields is an error.
2912    pub update_mask: std::option::Option<wkt::FieldMask>,
2913
2914    /// Optional. A unique identifier for this request. UUID is the recommended
2915    /// format, but other formats are still accepted. This request is only
2916    /// idempotent if a `request_id` is provided.
2917    pub request_id: std::string::String,
2918
2919    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2920}
2921
2922impl UpdateAnywhereCacheRequest {
2923    pub fn new() -> Self {
2924        std::default::Default::default()
2925    }
2926
2927    /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
2928    ///
2929    /// # Example
2930    /// ```ignore,no_run
2931    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
2932    /// use google_cloud_storage::model::AnywhereCache;
2933    /// let x = UpdateAnywhereCacheRequest::new().set_anywhere_cache(AnywhereCache::default()/* use setters */);
2934    /// ```
2935    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
2936    where
2937        T: std::convert::Into<crate::model::AnywhereCache>,
2938    {
2939        self.anywhere_cache = std::option::Option::Some(v.into());
2940        self
2941    }
2942
2943    /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
2944    ///
2945    /// # Example
2946    /// ```ignore,no_run
2947    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
2948    /// use google_cloud_storage::model::AnywhereCache;
2949    /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(Some(AnywhereCache::default()/* use setters */));
2950    /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_anywhere_cache(None::<AnywhereCache>);
2951    /// ```
2952    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
2953    where
2954        T: std::convert::Into<crate::model::AnywhereCache>,
2955    {
2956        self.anywhere_cache = v.map(|x| x.into());
2957        self
2958    }
2959
2960    /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
2961    ///
2962    /// # Example
2963    /// ```ignore,no_run
2964    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
2965    /// use wkt::FieldMask;
2966    /// let x = UpdateAnywhereCacheRequest::new().set_update_mask(FieldMask::default()/* use setters */);
2967    /// ```
2968    pub fn set_update_mask<T>(mut self, v: T) -> Self
2969    where
2970        T: std::convert::Into<wkt::FieldMask>,
2971    {
2972        self.update_mask = std::option::Option::Some(v.into());
2973        self
2974    }
2975
2976    /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
2977    ///
2978    /// # Example
2979    /// ```ignore,no_run
2980    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
2981    /// use wkt::FieldMask;
2982    /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
2983    /// let x = UpdateAnywhereCacheRequest::new().set_or_clear_update_mask(None::<FieldMask>);
2984    /// ```
2985    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2986    where
2987        T: std::convert::Into<wkt::FieldMask>,
2988    {
2989        self.update_mask = v.map(|x| x.into());
2990        self
2991    }
2992
2993    /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
2994    ///
2995    /// # Example
2996    /// ```ignore,no_run
2997    /// # use google_cloud_storage::model::UpdateAnywhereCacheRequest;
2998    /// let x = UpdateAnywhereCacheRequest::new().set_request_id("example");
2999    /// ```
3000    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3001        self.request_id = v.into();
3002        self
3003    }
3004}
3005
3006impl wkt::message::Message for UpdateAnywhereCacheRequest {
3007    fn typename() -> &'static str {
3008        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheRequest"
3009    }
3010}
3011
3012/// Request message for DisableAnywhereCache.
3013#[derive(Clone, Default, PartialEq)]
3014#[non_exhaustive]
3015pub struct DisableAnywhereCacheRequest {
3016    /// Required. The name field in the request should be:
3017    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3018    pub name: std::string::String,
3019
3020    /// Optional. A unique identifier for this request. UUID is the recommended
3021    /// format, but other formats are still accepted. This request is only
3022    /// idempotent if a `request_id` is provided.
3023    pub request_id: std::string::String,
3024
3025    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3026}
3027
3028impl DisableAnywhereCacheRequest {
3029    pub fn new() -> Self {
3030        std::default::Default::default()
3031    }
3032
3033    /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
3034    ///
3035    /// # Example
3036    /// ```ignore,no_run
3037    /// # use google_cloud_storage::model::DisableAnywhereCacheRequest;
3038    /// let x = DisableAnywhereCacheRequest::new().set_name("example");
3039    /// ```
3040    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3041        self.name = v.into();
3042        self
3043    }
3044
3045    /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
3046    ///
3047    /// # Example
3048    /// ```ignore,no_run
3049    /// # use google_cloud_storage::model::DisableAnywhereCacheRequest;
3050    /// let x = DisableAnywhereCacheRequest::new().set_request_id("example");
3051    /// ```
3052    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3053        self.request_id = v.into();
3054        self
3055    }
3056}
3057
3058impl wkt::message::Message for DisableAnywhereCacheRequest {
3059    fn typename() -> &'static str {
3060        "type.googleapis.com/google.storage.control.v2.DisableAnywhereCacheRequest"
3061    }
3062}
3063
3064/// Request message for PauseAnywhereCache.
3065#[derive(Clone, Default, PartialEq)]
3066#[non_exhaustive]
3067pub struct PauseAnywhereCacheRequest {
3068    /// Required. The name field in the request should be:
3069    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3070    pub name: std::string::String,
3071
3072    /// Optional. A unique identifier for this request. UUID is the recommended
3073    /// format, but other formats are still accepted. This request is only
3074    /// idempotent if a `request_id` is provided.
3075    pub request_id: std::string::String,
3076
3077    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3078}
3079
3080impl PauseAnywhereCacheRequest {
3081    pub fn new() -> Self {
3082        std::default::Default::default()
3083    }
3084
3085    /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
3086    ///
3087    /// # Example
3088    /// ```ignore,no_run
3089    /// # use google_cloud_storage::model::PauseAnywhereCacheRequest;
3090    /// let x = PauseAnywhereCacheRequest::new().set_name("example");
3091    /// ```
3092    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3093        self.name = v.into();
3094        self
3095    }
3096
3097    /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
3098    ///
3099    /// # Example
3100    /// ```ignore,no_run
3101    /// # use google_cloud_storage::model::PauseAnywhereCacheRequest;
3102    /// let x = PauseAnywhereCacheRequest::new().set_request_id("example");
3103    /// ```
3104    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3105        self.request_id = v.into();
3106        self
3107    }
3108}
3109
3110impl wkt::message::Message for PauseAnywhereCacheRequest {
3111    fn typename() -> &'static str {
3112        "type.googleapis.com/google.storage.control.v2.PauseAnywhereCacheRequest"
3113    }
3114}
3115
3116/// Request message for ResumeAnywhereCache.
3117#[derive(Clone, Default, PartialEq)]
3118#[non_exhaustive]
3119pub struct ResumeAnywhereCacheRequest {
3120    /// Required. The name field in the request should be:
3121    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3122    pub name: std::string::String,
3123
3124    /// Optional. A unique identifier for this request. UUID is the recommended
3125    /// format, but other formats are still accepted. This request is only
3126    /// idempotent if a `request_id` is provided.
3127    pub request_id: std::string::String,
3128
3129    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3130}
3131
3132impl ResumeAnywhereCacheRequest {
3133    pub fn new() -> Self {
3134        std::default::Default::default()
3135    }
3136
3137    /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
3138    ///
3139    /// # Example
3140    /// ```ignore,no_run
3141    /// # use google_cloud_storage::model::ResumeAnywhereCacheRequest;
3142    /// let x = ResumeAnywhereCacheRequest::new().set_name("example");
3143    /// ```
3144    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3145        self.name = v.into();
3146        self
3147    }
3148
3149    /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
3150    ///
3151    /// # Example
3152    /// ```ignore,no_run
3153    /// # use google_cloud_storage::model::ResumeAnywhereCacheRequest;
3154    /// let x = ResumeAnywhereCacheRequest::new().set_request_id("example");
3155    /// ```
3156    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3157        self.request_id = v.into();
3158        self
3159    }
3160}
3161
3162impl wkt::message::Message for ResumeAnywhereCacheRequest {
3163    fn typename() -> &'static str {
3164        "type.googleapis.com/google.storage.control.v2.ResumeAnywhereCacheRequest"
3165    }
3166}
3167
3168/// Request message for GetAnywhereCache.
3169#[derive(Clone, Default, PartialEq)]
3170#[non_exhaustive]
3171pub struct GetAnywhereCacheRequest {
3172    /// Required. The name field in the request should be:
3173    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
3174    pub name: std::string::String,
3175
3176    /// Optional. A unique identifier for this request. UUID is the recommended
3177    /// format, but other formats are still accepted.
3178    pub request_id: std::string::String,
3179
3180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3181}
3182
3183impl GetAnywhereCacheRequest {
3184    pub fn new() -> Self {
3185        std::default::Default::default()
3186    }
3187
3188    /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
3189    ///
3190    /// # Example
3191    /// ```ignore,no_run
3192    /// # use google_cloud_storage::model::GetAnywhereCacheRequest;
3193    /// let x = GetAnywhereCacheRequest::new().set_name("example");
3194    /// ```
3195    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3196        self.name = v.into();
3197        self
3198    }
3199
3200    /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
3201    ///
3202    /// # Example
3203    /// ```ignore,no_run
3204    /// # use google_cloud_storage::model::GetAnywhereCacheRequest;
3205    /// let x = GetAnywhereCacheRequest::new().set_request_id("example");
3206    /// ```
3207    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3208        self.request_id = v.into();
3209        self
3210    }
3211}
3212
3213impl wkt::message::Message for GetAnywhereCacheRequest {
3214    fn typename() -> &'static str {
3215        "type.googleapis.com/google.storage.control.v2.GetAnywhereCacheRequest"
3216    }
3217}
3218
3219/// Request message for ListAnywhereCaches.
3220#[derive(Clone, Default, PartialEq)]
3221#[non_exhaustive]
3222pub struct ListAnywhereCachesRequest {
3223    /// Required. The bucket to which this cache belongs.
3224    pub parent: std::string::String,
3225
3226    /// Maximum number of caches to return in a single response.
3227    /// The service will use this parameter or 1,000 items, whichever is smaller.
3228    pub page_size: i32,
3229
3230    /// A previously-returned page token representing part of the larger set of
3231    /// results to view.
3232    pub page_token: std::string::String,
3233
3234    /// Optional. A unique identifier for this request. UUID is the recommended
3235    /// format, but other formats are still accepted.
3236    pub request_id: std::string::String,
3237
3238    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3239}
3240
3241impl ListAnywhereCachesRequest {
3242    pub fn new() -> Self {
3243        std::default::Default::default()
3244    }
3245
3246    /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
3247    ///
3248    /// # Example
3249    /// ```ignore,no_run
3250    /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3251    /// let x = ListAnywhereCachesRequest::new().set_parent("example");
3252    /// ```
3253    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3254        self.parent = v.into();
3255        self
3256    }
3257
3258    /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
3259    ///
3260    /// # Example
3261    /// ```ignore,no_run
3262    /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3263    /// let x = ListAnywhereCachesRequest::new().set_page_size(42);
3264    /// ```
3265    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
3266        self.page_size = v.into();
3267        self
3268    }
3269
3270    /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
3271    ///
3272    /// # Example
3273    /// ```ignore,no_run
3274    /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3275    /// let x = ListAnywhereCachesRequest::new().set_page_token("example");
3276    /// ```
3277    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3278        self.page_token = v.into();
3279        self
3280    }
3281
3282    /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
3283    ///
3284    /// # Example
3285    /// ```ignore,no_run
3286    /// # use google_cloud_storage::model::ListAnywhereCachesRequest;
3287    /// let x = ListAnywhereCachesRequest::new().set_request_id("example");
3288    /// ```
3289    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3290        self.request_id = v.into();
3291        self
3292    }
3293}
3294
3295impl wkt::message::Message for ListAnywhereCachesRequest {
3296    fn typename() -> &'static str {
3297        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesRequest"
3298    }
3299}
3300
3301/// Response message for ListAnywhereCaches.
3302#[derive(Clone, Default, PartialEq)]
3303#[non_exhaustive]
3304pub struct ListAnywhereCachesResponse {
3305    /// The list of items.
3306    pub anywhere_caches: std::vec::Vec<crate::model::AnywhereCache>,
3307
3308    /// A token, which can be sent as `page_token` to retrieve the next page.
3309    /// If this field is omitted, there are no subsequent pages.
3310    pub next_page_token: std::string::String,
3311
3312    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3313}
3314
3315impl ListAnywhereCachesResponse {
3316    pub fn new() -> Self {
3317        std::default::Default::default()
3318    }
3319
3320    /// Sets the value of [anywhere_caches][crate::model::ListAnywhereCachesResponse::anywhere_caches].
3321    ///
3322    /// # Example
3323    /// ```ignore,no_run
3324    /// # use google_cloud_storage::model::ListAnywhereCachesResponse;
3325    /// use google_cloud_storage::model::AnywhereCache;
3326    /// let x = ListAnywhereCachesResponse::new()
3327    ///     .set_anywhere_caches([
3328    ///         AnywhereCache::default()/* use setters */,
3329    ///         AnywhereCache::default()/* use (different) setters */,
3330    ///     ]);
3331    /// ```
3332    pub fn set_anywhere_caches<T, V>(mut self, v: T) -> Self
3333    where
3334        T: std::iter::IntoIterator<Item = V>,
3335        V: std::convert::Into<crate::model::AnywhereCache>,
3336    {
3337        use std::iter::Iterator;
3338        self.anywhere_caches = v.into_iter().map(|i| i.into()).collect();
3339        self
3340    }
3341
3342    /// Sets the value of [next_page_token][crate::model::ListAnywhereCachesResponse::next_page_token].
3343    ///
3344    /// # Example
3345    /// ```ignore,no_run
3346    /// # use google_cloud_storage::model::ListAnywhereCachesResponse;
3347    /// let x = ListAnywhereCachesResponse::new().set_next_page_token("example");
3348    /// ```
3349    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3350        self.next_page_token = v.into();
3351        self
3352    }
3353}
3354
3355impl wkt::message::Message for ListAnywhereCachesResponse {
3356    fn typename() -> &'static str {
3357        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesResponse"
3358    }
3359}
3360
3361#[doc(hidden)]
3362impl gax::paginator::internal::PageableResponse for ListAnywhereCachesResponse {
3363    type PageItem = crate::model::AnywhereCache;
3364
3365    fn items(self) -> std::vec::Vec<Self::PageItem> {
3366        self.anywhere_caches
3367    }
3368
3369    fn next_page_token(&self) -> std::string::String {
3370        use std::clone::Clone;
3371        self.next_page_token.clone()
3372    }
3373}
3374
3375/// The `IntelligenceConfig` resource associated with your organization, folder,
3376/// or project.
3377#[derive(Clone, Default, PartialEq)]
3378#[non_exhaustive]
3379pub struct IntelligenceConfig {
3380    /// Identifier. The name of the `IntelligenceConfig` resource associated with
3381    /// your organization, folder, or project.
3382    ///
3383    /// The name format varies based on the GCP resource hierarchy as follows:
3384    ///
3385    /// * For project:
3386    ///   `projects/{project_number}/locations/global/intelligenceConfig`
3387    /// * For organization:
3388    ///   `organizations/{org_id}/locations/global/intelligenceConfig`
3389    /// * For folder: `folders/{folder_id}/locations/global/intelligenceConfig`
3390    pub name: std::string::String,
3391
3392    /// Optional. The edition configuration of the `IntelligenceConfig` resource.
3393    pub edition_config: crate::model::intelligence_config::EditionConfig,
3394
3395    /// Output only. The time at which the `IntelligenceConfig` resource is last
3396    /// updated.
3397    pub update_time: std::option::Option<wkt::Timestamp>,
3398
3399    /// Optional. Filter over location and bucket.
3400    pub filter: std::option::Option<crate::model::intelligence_config::Filter>,
3401
3402    /// Output only. The `IntelligenceConfig` resource that is applicable for the
3403    /// resource.
3404    pub effective_intelligence_config:
3405        std::option::Option<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3406
3407    /// The trial configuration of the `IntelligenceConfig` resource.
3408    pub trial_config: std::option::Option<crate::model::intelligence_config::TrialConfig>,
3409
3410    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3411}
3412
3413impl IntelligenceConfig {
3414    pub fn new() -> Self {
3415        std::default::Default::default()
3416    }
3417
3418    /// Sets the value of [name][crate::model::IntelligenceConfig::name].
3419    ///
3420    /// # Example
3421    /// ```ignore,no_run
3422    /// # use google_cloud_storage::model::IntelligenceConfig;
3423    /// let x = IntelligenceConfig::new().set_name("example");
3424    /// ```
3425    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3426        self.name = v.into();
3427        self
3428    }
3429
3430    /// Sets the value of [edition_config][crate::model::IntelligenceConfig::edition_config].
3431    ///
3432    /// # Example
3433    /// ```ignore,no_run
3434    /// # use google_cloud_storage::model::IntelligenceConfig;
3435    /// use google_cloud_storage::model::intelligence_config::EditionConfig;
3436    /// let x0 = IntelligenceConfig::new().set_edition_config(EditionConfig::Inherit);
3437    /// let x1 = IntelligenceConfig::new().set_edition_config(EditionConfig::Disabled);
3438    /// let x2 = IntelligenceConfig::new().set_edition_config(EditionConfig::Standard);
3439    /// ```
3440    pub fn set_edition_config<
3441        T: std::convert::Into<crate::model::intelligence_config::EditionConfig>,
3442    >(
3443        mut self,
3444        v: T,
3445    ) -> Self {
3446        self.edition_config = v.into();
3447        self
3448    }
3449
3450    /// Sets the value of [update_time][crate::model::IntelligenceConfig::update_time].
3451    ///
3452    /// # Example
3453    /// ```ignore,no_run
3454    /// # use google_cloud_storage::model::IntelligenceConfig;
3455    /// use wkt::Timestamp;
3456    /// let x = IntelligenceConfig::new().set_update_time(Timestamp::default()/* use setters */);
3457    /// ```
3458    pub fn set_update_time<T>(mut self, v: T) -> Self
3459    where
3460        T: std::convert::Into<wkt::Timestamp>,
3461    {
3462        self.update_time = std::option::Option::Some(v.into());
3463        self
3464    }
3465
3466    /// Sets or clears the value of [update_time][crate::model::IntelligenceConfig::update_time].
3467    ///
3468    /// # Example
3469    /// ```ignore,no_run
3470    /// # use google_cloud_storage::model::IntelligenceConfig;
3471    /// use wkt::Timestamp;
3472    /// let x = IntelligenceConfig::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
3473    /// let x = IntelligenceConfig::new().set_or_clear_update_time(None::<Timestamp>);
3474    /// ```
3475    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3476    where
3477        T: std::convert::Into<wkt::Timestamp>,
3478    {
3479        self.update_time = v.map(|x| x.into());
3480        self
3481    }
3482
3483    /// Sets the value of [filter][crate::model::IntelligenceConfig::filter].
3484    ///
3485    /// # Example
3486    /// ```ignore,no_run
3487    /// # use google_cloud_storage::model::IntelligenceConfig;
3488    /// use google_cloud_storage::model::intelligence_config::Filter;
3489    /// let x = IntelligenceConfig::new().set_filter(Filter::default()/* use setters */);
3490    /// ```
3491    pub fn set_filter<T>(mut self, v: T) -> Self
3492    where
3493        T: std::convert::Into<crate::model::intelligence_config::Filter>,
3494    {
3495        self.filter = std::option::Option::Some(v.into());
3496        self
3497    }
3498
3499    /// Sets or clears the value of [filter][crate::model::IntelligenceConfig::filter].
3500    ///
3501    /// # Example
3502    /// ```ignore,no_run
3503    /// # use google_cloud_storage::model::IntelligenceConfig;
3504    /// use google_cloud_storage::model::intelligence_config::Filter;
3505    /// let x = IntelligenceConfig::new().set_or_clear_filter(Some(Filter::default()/* use setters */));
3506    /// let x = IntelligenceConfig::new().set_or_clear_filter(None::<Filter>);
3507    /// ```
3508    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
3509    where
3510        T: std::convert::Into<crate::model::intelligence_config::Filter>,
3511    {
3512        self.filter = v.map(|x| x.into());
3513        self
3514    }
3515
3516    /// Sets the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
3517    ///
3518    /// # Example
3519    /// ```ignore,no_run
3520    /// # use google_cloud_storage::model::IntelligenceConfig;
3521    /// use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
3522    /// let x = IntelligenceConfig::new().set_effective_intelligence_config(EffectiveIntelligenceConfig::default()/* use setters */);
3523    /// ```
3524    pub fn set_effective_intelligence_config<T>(mut self, v: T) -> Self
3525    where
3526        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3527    {
3528        self.effective_intelligence_config = std::option::Option::Some(v.into());
3529        self
3530    }
3531
3532    /// Sets or clears the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
3533    ///
3534    /// # Example
3535    /// ```ignore,no_run
3536    /// # use google_cloud_storage::model::IntelligenceConfig;
3537    /// use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
3538    /// let x = IntelligenceConfig::new().set_or_clear_effective_intelligence_config(Some(EffectiveIntelligenceConfig::default()/* use setters */));
3539    /// let x = IntelligenceConfig::new().set_or_clear_effective_intelligence_config(None::<EffectiveIntelligenceConfig>);
3540    /// ```
3541    pub fn set_or_clear_effective_intelligence_config<T>(
3542        mut self,
3543        v: std::option::Option<T>,
3544    ) -> Self
3545    where
3546        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
3547    {
3548        self.effective_intelligence_config = v.map(|x| x.into());
3549        self
3550    }
3551
3552    /// Sets the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
3553    ///
3554    /// # Example
3555    /// ```ignore,no_run
3556    /// # use google_cloud_storage::model::IntelligenceConfig;
3557    /// use google_cloud_storage::model::intelligence_config::TrialConfig;
3558    /// let x = IntelligenceConfig::new().set_trial_config(TrialConfig::default()/* use setters */);
3559    /// ```
3560    pub fn set_trial_config<T>(mut self, v: T) -> Self
3561    where
3562        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
3563    {
3564        self.trial_config = std::option::Option::Some(v.into());
3565        self
3566    }
3567
3568    /// Sets or clears the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
3569    ///
3570    /// # Example
3571    /// ```ignore,no_run
3572    /// # use google_cloud_storage::model::IntelligenceConfig;
3573    /// use google_cloud_storage::model::intelligence_config::TrialConfig;
3574    /// let x = IntelligenceConfig::new().set_or_clear_trial_config(Some(TrialConfig::default()/* use setters */));
3575    /// let x = IntelligenceConfig::new().set_or_clear_trial_config(None::<TrialConfig>);
3576    /// ```
3577    pub fn set_or_clear_trial_config<T>(mut self, v: std::option::Option<T>) -> Self
3578    where
3579        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
3580    {
3581        self.trial_config = v.map(|x| x.into());
3582        self
3583    }
3584}
3585
3586impl wkt::message::Message for IntelligenceConfig {
3587    fn typename() -> &'static str {
3588        "type.googleapis.com/google.storage.control.v2.IntelligenceConfig"
3589    }
3590}
3591
3592/// Defines additional types related to [IntelligenceConfig].
3593pub mod intelligence_config {
3594    #[allow(unused_imports)]
3595    use super::*;
3596
3597    /// Filter over location and bucket using include or exclude semantics.
3598    /// Resources that match the include or exclude filter are exclusively included
3599    /// or excluded from the Storage Intelligence plan.
3600    #[derive(Clone, Default, PartialEq)]
3601    #[non_exhaustive]
3602    pub struct Filter {
3603        /// Bucket locations to include or exclude.
3604        pub cloud_storage_locations: std::option::Option<
3605            crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
3606        >,
3607
3608        /// Buckets to include or exclude.
3609        pub cloud_storage_buckets: std::option::Option<
3610            crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
3611        >,
3612
3613        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3614    }
3615
3616    impl Filter {
3617        pub fn new() -> Self {
3618            std::default::Default::default()
3619        }
3620
3621        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations].
3622        ///
3623        /// Note that all the setters affecting `cloud_storage_locations` are mutually
3624        /// exclusive.
3625        ///
3626        /// # Example
3627        /// ```ignore,no_run
3628        /// # use google_cloud_storage::model::intelligence_config::Filter;
3629        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3630        /// let x = Filter::new().set_cloud_storage_locations(Some(
3631        ///     google_cloud_storage::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(CloudStorageLocations::default().into())));
3632        /// ```
3633        pub fn set_cloud_storage_locations<
3634            T: std::convert::Into<
3635                    std::option::Option<
3636                        crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
3637                    >,
3638                >,
3639        >(
3640            mut self,
3641            v: T,
3642        ) -> Self {
3643            self.cloud_storage_locations = v.into();
3644            self
3645        }
3646
3647        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3648        /// if it holds a `IncludedCloudStorageLocations`, `None` if the field is not set or
3649        /// holds a different branch.
3650        pub fn included_cloud_storage_locations(
3651            &self,
3652        ) -> std::option::Option<
3653            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
3654        > {
3655            #[allow(unreachable_patterns)]
3656            self.cloud_storage_locations.as_ref().and_then(|v| match v {
3657                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(v) => std::option::Option::Some(v),
3658                _ => std::option::Option::None,
3659            })
3660        }
3661
3662        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3663        /// to hold a `IncludedCloudStorageLocations`.
3664        ///
3665        /// Note that all the setters affecting `cloud_storage_locations` are
3666        /// mutually exclusive.
3667        ///
3668        /// # Example
3669        /// ```ignore,no_run
3670        /// # use google_cloud_storage::model::intelligence_config::Filter;
3671        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3672        /// let x = Filter::new().set_included_cloud_storage_locations(CloudStorageLocations::default()/* use setters */);
3673        /// assert!(x.included_cloud_storage_locations().is_some());
3674        /// assert!(x.excluded_cloud_storage_locations().is_none());
3675        /// ```
3676        pub fn set_included_cloud_storage_locations<
3677            T: std::convert::Into<
3678                    std::boxed::Box<
3679                        crate::model::intelligence_config::filter::CloudStorageLocations,
3680                    >,
3681                >,
3682        >(
3683            mut self,
3684            v: T,
3685        ) -> Self {
3686            self.cloud_storage_locations = std::option::Option::Some(
3687                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
3688                    v.into()
3689                )
3690            );
3691            self
3692        }
3693
3694        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3695        /// if it holds a `ExcludedCloudStorageLocations`, `None` if the field is not set or
3696        /// holds a different branch.
3697        pub fn excluded_cloud_storage_locations(
3698            &self,
3699        ) -> std::option::Option<
3700            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
3701        > {
3702            #[allow(unreachable_patterns)]
3703            self.cloud_storage_locations.as_ref().and_then(|v| match v {
3704                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(v) => std::option::Option::Some(v),
3705                _ => std::option::Option::None,
3706            })
3707        }
3708
3709        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
3710        /// to hold a `ExcludedCloudStorageLocations`.
3711        ///
3712        /// Note that all the setters affecting `cloud_storage_locations` are
3713        /// mutually exclusive.
3714        ///
3715        /// # Example
3716        /// ```ignore,no_run
3717        /// # use google_cloud_storage::model::intelligence_config::Filter;
3718        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3719        /// let x = Filter::new().set_excluded_cloud_storage_locations(CloudStorageLocations::default()/* use setters */);
3720        /// assert!(x.excluded_cloud_storage_locations().is_some());
3721        /// assert!(x.included_cloud_storage_locations().is_none());
3722        /// ```
3723        pub fn set_excluded_cloud_storage_locations<
3724            T: std::convert::Into<
3725                    std::boxed::Box<
3726                        crate::model::intelligence_config::filter::CloudStorageLocations,
3727                    >,
3728                >,
3729        >(
3730            mut self,
3731            v: T,
3732        ) -> Self {
3733            self.cloud_storage_locations = std::option::Option::Some(
3734                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
3735                    v.into()
3736                )
3737            );
3738            self
3739        }
3740
3741        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets].
3742        ///
3743        /// Note that all the setters affecting `cloud_storage_buckets` are mutually
3744        /// exclusive.
3745        ///
3746        /// # Example
3747        /// ```ignore,no_run
3748        /// # use google_cloud_storage::model::intelligence_config::Filter;
3749        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
3750        /// let x = Filter::new().set_cloud_storage_buckets(Some(
3751        ///     google_cloud_storage::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(CloudStorageBuckets::default().into())));
3752        /// ```
3753        pub fn set_cloud_storage_buckets<
3754            T: std::convert::Into<
3755                    std::option::Option<
3756                        crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
3757                    >,
3758                >,
3759        >(
3760            mut self,
3761            v: T,
3762        ) -> Self {
3763            self.cloud_storage_buckets = v.into();
3764            self
3765        }
3766
3767        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
3768        /// if it holds a `IncludedCloudStorageBuckets`, `None` if the field is not set or
3769        /// holds a different branch.
3770        pub fn included_cloud_storage_buckets(
3771            &self,
3772        ) -> std::option::Option<
3773            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
3774        > {
3775            #[allow(unreachable_patterns)]
3776            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
3777                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(v) => std::option::Option::Some(v),
3778                _ => std::option::Option::None,
3779            })
3780        }
3781
3782        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
3783        /// to hold a `IncludedCloudStorageBuckets`.
3784        ///
3785        /// Note that all the setters affecting `cloud_storage_buckets` are
3786        /// mutually exclusive.
3787        ///
3788        /// # Example
3789        /// ```ignore,no_run
3790        /// # use google_cloud_storage::model::intelligence_config::Filter;
3791        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
3792        /// let x = Filter::new().set_included_cloud_storage_buckets(CloudStorageBuckets::default()/* use setters */);
3793        /// assert!(x.included_cloud_storage_buckets().is_some());
3794        /// assert!(x.excluded_cloud_storage_buckets().is_none());
3795        /// ```
3796        pub fn set_included_cloud_storage_buckets<
3797            T: std::convert::Into<
3798                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
3799                >,
3800        >(
3801            mut self,
3802            v: T,
3803        ) -> Self {
3804            self.cloud_storage_buckets = std::option::Option::Some(
3805                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
3806                    v.into()
3807                )
3808            );
3809            self
3810        }
3811
3812        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
3813        /// if it holds a `ExcludedCloudStorageBuckets`, `None` if the field is not set or
3814        /// holds a different branch.
3815        pub fn excluded_cloud_storage_buckets(
3816            &self,
3817        ) -> std::option::Option<
3818            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
3819        > {
3820            #[allow(unreachable_patterns)]
3821            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
3822                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(v) => std::option::Option::Some(v),
3823                _ => std::option::Option::None,
3824            })
3825        }
3826
3827        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
3828        /// to hold a `ExcludedCloudStorageBuckets`.
3829        ///
3830        /// Note that all the setters affecting `cloud_storage_buckets` are
3831        /// mutually exclusive.
3832        ///
3833        /// # Example
3834        /// ```ignore,no_run
3835        /// # use google_cloud_storage::model::intelligence_config::Filter;
3836        /// use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
3837        /// let x = Filter::new().set_excluded_cloud_storage_buckets(CloudStorageBuckets::default()/* use setters */);
3838        /// assert!(x.excluded_cloud_storage_buckets().is_some());
3839        /// assert!(x.included_cloud_storage_buckets().is_none());
3840        /// ```
3841        pub fn set_excluded_cloud_storage_buckets<
3842            T: std::convert::Into<
3843                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
3844                >,
3845        >(
3846            mut self,
3847            v: T,
3848        ) -> Self {
3849            self.cloud_storage_buckets = std::option::Option::Some(
3850                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
3851                    v.into()
3852                )
3853            );
3854            self
3855        }
3856    }
3857
3858    impl wkt::message::Message for Filter {
3859        fn typename() -> &'static str {
3860            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter"
3861        }
3862    }
3863
3864    /// Defines additional types related to [Filter].
3865    pub mod filter {
3866        #[allow(unused_imports)]
3867        use super::*;
3868
3869        /// Collection of bucket locations.
3870        #[derive(Clone, Default, PartialEq)]
3871        #[non_exhaustive]
3872        pub struct CloudStorageLocations {
3873            /// Optional. Bucket locations. Location can be any of the Cloud Storage
3874            /// regions specified in lower case format. For example, `us-east1`,
3875            /// `us-west1`.
3876            pub locations: std::vec::Vec<std::string::String>,
3877
3878            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3879        }
3880
3881        impl CloudStorageLocations {
3882            pub fn new() -> Self {
3883                std::default::Default::default()
3884            }
3885
3886            /// Sets the value of [locations][crate::model::intelligence_config::filter::CloudStorageLocations::locations].
3887            ///
3888            /// # Example
3889            /// ```ignore,no_run
3890            /// # use google_cloud_storage::model::intelligence_config::filter::CloudStorageLocations;
3891            /// let x = CloudStorageLocations::new().set_locations(["a", "b", "c"]);
3892            /// ```
3893            pub fn set_locations<T, V>(mut self, v: T) -> Self
3894            where
3895                T: std::iter::IntoIterator<Item = V>,
3896                V: std::convert::Into<std::string::String>,
3897            {
3898                use std::iter::Iterator;
3899                self.locations = v.into_iter().map(|i| i.into()).collect();
3900                self
3901            }
3902        }
3903
3904        impl wkt::message::Message for CloudStorageLocations {
3905            fn typename() -> &'static str {
3906                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"
3907            }
3908        }
3909
3910        /// Collection of buckets.
3911        #[derive(Clone, Default, PartialEq)]
3912        #[non_exhaustive]
3913        pub struct CloudStorageBuckets {
3914            /// Optional. A regex pattern for matching bucket names. Regex should
3915            /// follow the syntax specified in
3916            /// [google/re2](https://github.com/google/re2). For example,
3917            /// `^sample_.*` matches all buckets of the form
3918            /// `gs://sample_bucket-1`, `gs://sample_bucket-2`,
3919            /// `gs://sample_bucket-n` but not `gs://test_sample_bucket`.
3920            /// If you want to match a single bucket, say `gs://sample_bucket`,
3921            /// use `sample_bucket`.
3922            pub bucket_id_regexes: std::vec::Vec<std::string::String>,
3923
3924            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3925        }
3926
3927        impl CloudStorageBuckets {
3928            pub fn new() -> Self {
3929                std::default::Default::default()
3930            }
3931
3932            /// Sets the value of [bucket_id_regexes][crate::model::intelligence_config::filter::CloudStorageBuckets::bucket_id_regexes].
3933            ///
3934            /// # Example
3935            /// ```ignore,no_run
3936            /// # use google_cloud_storage::model::intelligence_config::filter::CloudStorageBuckets;
3937            /// let x = CloudStorageBuckets::new().set_bucket_id_regexes(["a", "b", "c"]);
3938            /// ```
3939            pub fn set_bucket_id_regexes<T, V>(mut self, v: T) -> Self
3940            where
3941                T: std::iter::IntoIterator<Item = V>,
3942                V: std::convert::Into<std::string::String>,
3943            {
3944                use std::iter::Iterator;
3945                self.bucket_id_regexes = v.into_iter().map(|i| i.into()).collect();
3946                self
3947            }
3948        }
3949
3950        impl wkt::message::Message for CloudStorageBuckets {
3951            fn typename() -> &'static str {
3952                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"
3953            }
3954        }
3955
3956        /// Bucket locations to include or exclude.
3957        #[derive(Clone, Debug, PartialEq)]
3958        #[non_exhaustive]
3959        pub enum CloudStorageLocationsOneOf {
3960            /// Bucket locations to include.
3961            IncludedCloudStorageLocations(
3962                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
3963            ),
3964            /// Bucket locations to exclude.
3965            ExcludedCloudStorageLocations(
3966                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
3967            ),
3968        }
3969
3970        impl CloudStorageLocationsOneOf {
3971            /// Initializes the enum to the [IncludedCloudStorageLocations](Self::IncludedCloudStorageLocations) branch.
3972            pub fn from_included_cloud_storage_locations(
3973                value: impl std::convert::Into<
3974                    std::boxed::Box<
3975                        crate::model::intelligence_config::filter::CloudStorageLocations,
3976                    >,
3977                >,
3978            ) -> Self {
3979                Self::IncludedCloudStorageLocations(value.into())
3980            }
3981            /// Initializes the enum to the [ExcludedCloudStorageLocations](Self::ExcludedCloudStorageLocations) branch.
3982            pub fn from_excluded_cloud_storage_locations(
3983                value: impl std::convert::Into<
3984                    std::boxed::Box<
3985                        crate::model::intelligence_config::filter::CloudStorageLocations,
3986                    >,
3987                >,
3988            ) -> Self {
3989                Self::ExcludedCloudStorageLocations(value.into())
3990            }
3991        }
3992
3993        /// Buckets to include or exclude.
3994        #[derive(Clone, Debug, PartialEq)]
3995        #[non_exhaustive]
3996        pub enum CloudStorageBucketsOneOf {
3997            /// Buckets to include.
3998            IncludedCloudStorageBuckets(
3999                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4000            ),
4001            /// Buckets to exclude.
4002            ExcludedCloudStorageBuckets(
4003                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4004            ),
4005        }
4006
4007        impl CloudStorageBucketsOneOf {
4008            /// Initializes the enum to the [IncludedCloudStorageBuckets](Self::IncludedCloudStorageBuckets) branch.
4009            pub fn from_included_cloud_storage_buckets(
4010                value: impl std::convert::Into<
4011                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4012                >,
4013            ) -> Self {
4014                Self::IncludedCloudStorageBuckets(value.into())
4015            }
4016            /// Initializes the enum to the [ExcludedCloudStorageBuckets](Self::ExcludedCloudStorageBuckets) branch.
4017            pub fn from_excluded_cloud_storage_buckets(
4018                value: impl std::convert::Into<
4019                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
4020                >,
4021            ) -> Self {
4022                Self::ExcludedCloudStorageBuckets(value.into())
4023            }
4024        }
4025    }
4026
4027    /// The effective `IntelligenceConfig` for the resource.
4028    #[derive(Clone, Default, PartialEq)]
4029    #[non_exhaustive]
4030    pub struct EffectiveIntelligenceConfig {
4031        /// Output only. The `IntelligenceConfig` edition that is applicable for the
4032        /// resource.
4033        pub effective_edition:
4034            crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition,
4035
4036        /// Output only. The `IntelligenceConfig` resource that is applied for the
4037        /// target resource. Format:
4038        /// `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig`
4039        pub intelligence_config: std::string::String,
4040
4041        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4042    }
4043
4044    impl EffectiveIntelligenceConfig {
4045        pub fn new() -> Self {
4046            std::default::Default::default()
4047        }
4048
4049        /// Sets the value of [effective_edition][crate::model::intelligence_config::EffectiveIntelligenceConfig::effective_edition].
4050        ///
4051        /// # Example
4052        /// ```ignore,no_run
4053        /// # use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
4054        /// use google_cloud_storage::model::intelligence_config::effective_intelligence_config::EffectiveEdition;
4055        /// let x0 = EffectiveIntelligenceConfig::new().set_effective_edition(EffectiveEdition::None);
4056        /// let x1 = EffectiveIntelligenceConfig::new().set_effective_edition(EffectiveEdition::Standard);
4057        /// ```
4058        pub fn set_effective_edition<T: std::convert::Into<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>(mut self, v: T) -> Self{
4059            self.effective_edition = v.into();
4060            self
4061        }
4062
4063        /// Sets the value of [intelligence_config][crate::model::intelligence_config::EffectiveIntelligenceConfig::intelligence_config].
4064        ///
4065        /// # Example
4066        /// ```ignore,no_run
4067        /// # use google_cloud_storage::model::intelligence_config::EffectiveIntelligenceConfig;
4068        /// let x = EffectiveIntelligenceConfig::new().set_intelligence_config("example");
4069        /// ```
4070        pub fn set_intelligence_config<T: std::convert::Into<std::string::String>>(
4071            mut self,
4072            v: T,
4073        ) -> Self {
4074            self.intelligence_config = v.into();
4075            self
4076        }
4077    }
4078
4079    impl wkt::message::Message for EffectiveIntelligenceConfig {
4080        fn typename() -> &'static str {
4081            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"
4082        }
4083    }
4084
4085    /// Defines additional types related to [EffectiveIntelligenceConfig].
4086    pub mod effective_intelligence_config {
4087        #[allow(unused_imports)]
4088        use super::*;
4089
4090        /// The effective edition of the `IntelligenceConfig` resource.
4091        ///
4092        /// # Working with unknown values
4093        ///
4094        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4095        /// additional enum variants at any time. Adding new variants is not considered
4096        /// a breaking change. Applications should write their code in anticipation of:
4097        ///
4098        /// - New values appearing in future releases of the client library, **and**
4099        /// - New values received dynamically, without application changes.
4100        ///
4101        /// Please consult the [Working with enums] section in the user guide for some
4102        /// guidelines.
4103        ///
4104        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4105        #[derive(Clone, Debug, PartialEq)]
4106        #[non_exhaustive]
4107        pub enum EffectiveEdition {
4108            /// This is an unknown edition of the resource.
4109            Unspecified,
4110            /// No edition.
4111            None,
4112            /// The `IntelligenceConfig` resource is of STANDARD edition.
4113            Standard,
4114            /// If set, the enum was initialized with an unknown value.
4115            ///
4116            /// Applications can examine the value using [EffectiveEdition::value] or
4117            /// [EffectiveEdition::name].
4118            UnknownValue(effective_edition::UnknownValue),
4119        }
4120
4121        #[doc(hidden)]
4122        pub mod effective_edition {
4123            #[allow(unused_imports)]
4124            use super::*;
4125            #[derive(Clone, Debug, PartialEq)]
4126            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4127        }
4128
4129        impl EffectiveEdition {
4130            /// Gets the enum value.
4131            ///
4132            /// Returns `None` if the enum contains an unknown value deserialized from
4133            /// the string representation of enums.
4134            pub fn value(&self) -> std::option::Option<i32> {
4135                match self {
4136                    Self::Unspecified => std::option::Option::Some(0),
4137                    Self::None => std::option::Option::Some(1),
4138                    Self::Standard => std::option::Option::Some(2),
4139                    Self::UnknownValue(u) => u.0.value(),
4140                }
4141            }
4142
4143            /// Gets the enum value as a string.
4144            ///
4145            /// Returns `None` if the enum contains an unknown value deserialized from
4146            /// the integer representation of enums.
4147            pub fn name(&self) -> std::option::Option<&str> {
4148                match self {
4149                    Self::Unspecified => std::option::Option::Some("EFFECTIVE_EDITION_UNSPECIFIED"),
4150                    Self::None => std::option::Option::Some("NONE"),
4151                    Self::Standard => std::option::Option::Some("STANDARD"),
4152                    Self::UnknownValue(u) => u.0.name(),
4153                }
4154            }
4155        }
4156
4157        impl std::default::Default for EffectiveEdition {
4158            fn default() -> Self {
4159                use std::convert::From;
4160                Self::from(0)
4161            }
4162        }
4163
4164        impl std::fmt::Display for EffectiveEdition {
4165            fn fmt(
4166                &self,
4167                f: &mut std::fmt::Formatter<'_>,
4168            ) -> std::result::Result<(), std::fmt::Error> {
4169                wkt::internal::display_enum(f, self.name(), self.value())
4170            }
4171        }
4172
4173        impl std::convert::From<i32> for EffectiveEdition {
4174            fn from(value: i32) -> Self {
4175                match value {
4176                    0 => Self::Unspecified,
4177                    1 => Self::None,
4178                    2 => Self::Standard,
4179                    _ => Self::UnknownValue(effective_edition::UnknownValue(
4180                        wkt::internal::UnknownEnumValue::Integer(value),
4181                    )),
4182                }
4183            }
4184        }
4185
4186        impl std::convert::From<&str> for EffectiveEdition {
4187            fn from(value: &str) -> Self {
4188                use std::string::ToString;
4189                match value {
4190                    "EFFECTIVE_EDITION_UNSPECIFIED" => Self::Unspecified,
4191                    "NONE" => Self::None,
4192                    "STANDARD" => Self::Standard,
4193                    _ => Self::UnknownValue(effective_edition::UnknownValue(
4194                        wkt::internal::UnknownEnumValue::String(value.to_string()),
4195                    )),
4196                }
4197            }
4198        }
4199
4200        impl serde::ser::Serialize for EffectiveEdition {
4201            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4202            where
4203                S: serde::Serializer,
4204            {
4205                match self {
4206                    Self::Unspecified => serializer.serialize_i32(0),
4207                    Self::None => serializer.serialize_i32(1),
4208                    Self::Standard => serializer.serialize_i32(2),
4209                    Self::UnknownValue(u) => u.0.serialize(serializer),
4210                }
4211            }
4212        }
4213
4214        impl<'de> serde::de::Deserialize<'de> for EffectiveEdition {
4215            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4216            where
4217                D: serde::Deserializer<'de>,
4218            {
4219                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveEdition>::new(
4220                    ".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition"))
4221            }
4222        }
4223    }
4224
4225    /// The trial configuration of the `IntelligenceConfig` resource.
4226    #[derive(Clone, Default, PartialEq)]
4227    #[non_exhaustive]
4228    pub struct TrialConfig {
4229        /// Output only. The time at which the trial expires.
4230        pub expire_time: std::option::Option<wkt::Timestamp>,
4231
4232        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4233    }
4234
4235    impl TrialConfig {
4236        pub fn new() -> Self {
4237            std::default::Default::default()
4238        }
4239
4240        /// Sets the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
4241        ///
4242        /// # Example
4243        /// ```ignore,no_run
4244        /// # use google_cloud_storage::model::intelligence_config::TrialConfig;
4245        /// use wkt::Timestamp;
4246        /// let x = TrialConfig::new().set_expire_time(Timestamp::default()/* use setters */);
4247        /// ```
4248        pub fn set_expire_time<T>(mut self, v: T) -> Self
4249        where
4250            T: std::convert::Into<wkt::Timestamp>,
4251        {
4252            self.expire_time = std::option::Option::Some(v.into());
4253            self
4254        }
4255
4256        /// Sets or clears the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
4257        ///
4258        /// # Example
4259        /// ```ignore,no_run
4260        /// # use google_cloud_storage::model::intelligence_config::TrialConfig;
4261        /// use wkt::Timestamp;
4262        /// let x = TrialConfig::new().set_or_clear_expire_time(Some(Timestamp::default()/* use setters */));
4263        /// let x = TrialConfig::new().set_or_clear_expire_time(None::<Timestamp>);
4264        /// ```
4265        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
4266        where
4267            T: std::convert::Into<wkt::Timestamp>,
4268        {
4269            self.expire_time = v.map(|x| x.into());
4270            self
4271        }
4272    }
4273
4274    impl wkt::message::Message for TrialConfig {
4275        fn typename() -> &'static str {
4276            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.TrialConfig"
4277        }
4278    }
4279
4280    /// The edition configuration of the `IntelligenceConfig` resource. This
4281    /// signifies the edition used for configuring the `IntelligenceConfig`
4282    /// resource and can only take the following values:
4283    /// `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and
4284    /// `TRIAL`.
4285    ///
4286    /// # Working with unknown values
4287    ///
4288    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
4289    /// additional enum variants at any time. Adding new variants is not considered
4290    /// a breaking change. Applications should write their code in anticipation of:
4291    ///
4292    /// - New values appearing in future releases of the client library, **and**
4293    /// - New values received dynamically, without application changes.
4294    ///
4295    /// Please consult the [Working with enums] section in the user guide for some
4296    /// guidelines.
4297    ///
4298    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
4299    #[derive(Clone, Debug, PartialEq)]
4300    #[non_exhaustive]
4301    pub enum EditionConfig {
4302        /// This is an unknown edition of the resource.
4303        Unspecified,
4304        /// The inherited edition from the parent and filters. This is the default
4305        /// edition when there is no `IntelligenceConfig` setup for a GCP resource.
4306        Inherit,
4307        /// The edition configuration is disabled for the `IntelligenceConfig`
4308        /// resource and its children. Filters are not applicable.
4309        Disabled,
4310        /// The `IntelligenceConfig` resource is of STANDARD edition.
4311        Standard,
4312        /// The `IntelligenceConfig` resource is available in `TRIAL` edition. During
4313        /// the trial period, Cloud Storage does not charge for Storage Intelligence
4314        /// usage. You can specify the buckets to include in the trial period by
4315        /// using filters. At the end of the trial period, the `IntelligenceConfig`
4316        /// resource is upgraded to `STANDARD` edition.
4317        Trial,
4318        /// If set, the enum was initialized with an unknown value.
4319        ///
4320        /// Applications can examine the value using [EditionConfig::value] or
4321        /// [EditionConfig::name].
4322        UnknownValue(edition_config::UnknownValue),
4323    }
4324
4325    #[doc(hidden)]
4326    pub mod edition_config {
4327        #[allow(unused_imports)]
4328        use super::*;
4329        #[derive(Clone, Debug, PartialEq)]
4330        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
4331    }
4332
4333    impl EditionConfig {
4334        /// Gets the enum value.
4335        ///
4336        /// Returns `None` if the enum contains an unknown value deserialized from
4337        /// the string representation of enums.
4338        pub fn value(&self) -> std::option::Option<i32> {
4339            match self {
4340                Self::Unspecified => std::option::Option::Some(0),
4341                Self::Inherit => std::option::Option::Some(1),
4342                Self::Disabled => std::option::Option::Some(2),
4343                Self::Standard => std::option::Option::Some(3),
4344                Self::Trial => std::option::Option::Some(5),
4345                Self::UnknownValue(u) => u.0.value(),
4346            }
4347        }
4348
4349        /// Gets the enum value as a string.
4350        ///
4351        /// Returns `None` if the enum contains an unknown value deserialized from
4352        /// the integer representation of enums.
4353        pub fn name(&self) -> std::option::Option<&str> {
4354            match self {
4355                Self::Unspecified => std::option::Option::Some("EDITION_CONFIG_UNSPECIFIED"),
4356                Self::Inherit => std::option::Option::Some("INHERIT"),
4357                Self::Disabled => std::option::Option::Some("DISABLED"),
4358                Self::Standard => std::option::Option::Some("STANDARD"),
4359                Self::Trial => std::option::Option::Some("TRIAL"),
4360                Self::UnknownValue(u) => u.0.name(),
4361            }
4362        }
4363    }
4364
4365    impl std::default::Default for EditionConfig {
4366        fn default() -> Self {
4367            use std::convert::From;
4368            Self::from(0)
4369        }
4370    }
4371
4372    impl std::fmt::Display for EditionConfig {
4373        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
4374            wkt::internal::display_enum(f, self.name(), self.value())
4375        }
4376    }
4377
4378    impl std::convert::From<i32> for EditionConfig {
4379        fn from(value: i32) -> Self {
4380            match value {
4381                0 => Self::Unspecified,
4382                1 => Self::Inherit,
4383                2 => Self::Disabled,
4384                3 => Self::Standard,
4385                5 => Self::Trial,
4386                _ => Self::UnknownValue(edition_config::UnknownValue(
4387                    wkt::internal::UnknownEnumValue::Integer(value),
4388                )),
4389            }
4390        }
4391    }
4392
4393    impl std::convert::From<&str> for EditionConfig {
4394        fn from(value: &str) -> Self {
4395            use std::string::ToString;
4396            match value {
4397                "EDITION_CONFIG_UNSPECIFIED" => Self::Unspecified,
4398                "INHERIT" => Self::Inherit,
4399                "DISABLED" => Self::Disabled,
4400                "STANDARD" => Self::Standard,
4401                "TRIAL" => Self::Trial,
4402                _ => Self::UnknownValue(edition_config::UnknownValue(
4403                    wkt::internal::UnknownEnumValue::String(value.to_string()),
4404                )),
4405            }
4406        }
4407    }
4408
4409    impl serde::ser::Serialize for EditionConfig {
4410        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4411        where
4412            S: serde::Serializer,
4413        {
4414            match self {
4415                Self::Unspecified => serializer.serialize_i32(0),
4416                Self::Inherit => serializer.serialize_i32(1),
4417                Self::Disabled => serializer.serialize_i32(2),
4418                Self::Standard => serializer.serialize_i32(3),
4419                Self::Trial => serializer.serialize_i32(5),
4420                Self::UnknownValue(u) => u.0.serialize(serializer),
4421            }
4422        }
4423    }
4424
4425    impl<'de> serde::de::Deserialize<'de> for EditionConfig {
4426        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4427        where
4428            D: serde::Deserializer<'de>,
4429        {
4430            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EditionConfig>::new(
4431                ".google.storage.control.v2.IntelligenceConfig.EditionConfig",
4432            ))
4433        }
4434    }
4435}
4436
4437/// Request message to update the `IntelligenceConfig` resource associated with
4438/// your organization.
4439///
4440/// **IAM Permissions**:
4441///
4442/// Requires `storage.intelligenceConfigs.update`
4443/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4444/// the organization.
4445#[derive(Clone, Default, PartialEq)]
4446#[non_exhaustive]
4447pub struct UpdateOrganizationIntelligenceConfigRequest {
4448    /// Required. The `IntelligenceConfig` resource to be updated.
4449    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4450
4451    /// Required. The `update_mask` that specifies the fields within the
4452    /// `IntelligenceConfig` resource that should be modified by this update. Only
4453    /// the listed fields are updated.
4454    pub update_mask: std::option::Option<wkt::FieldMask>,
4455
4456    /// Optional. The ID that uniquely identifies the request, preventing duplicate
4457    /// processing.
4458    pub request_id: std::string::String,
4459
4460    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4461}
4462
4463impl UpdateOrganizationIntelligenceConfigRequest {
4464    pub fn new() -> Self {
4465        std::default::Default::default()
4466    }
4467
4468    /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
4469    ///
4470    /// # Example
4471    /// ```ignore,no_run
4472    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4473    /// use google_cloud_storage::model::IntelligenceConfig;
4474    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
4475    /// ```
4476    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
4477    where
4478        T: std::convert::Into<crate::model::IntelligenceConfig>,
4479    {
4480        self.intelligence_config = std::option::Option::Some(v.into());
4481        self
4482    }
4483
4484    /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
4485    ///
4486    /// # Example
4487    /// ```ignore,no_run
4488    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4489    /// use google_cloud_storage::model::IntelligenceConfig;
4490    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
4491    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
4492    /// ```
4493    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
4494    where
4495        T: std::convert::Into<crate::model::IntelligenceConfig>,
4496    {
4497        self.intelligence_config = v.map(|x| x.into());
4498        self
4499    }
4500
4501    /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
4502    ///
4503    /// # Example
4504    /// ```ignore,no_run
4505    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4506    /// use wkt::FieldMask;
4507    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4508    /// ```
4509    pub fn set_update_mask<T>(mut self, v: T) -> Self
4510    where
4511        T: std::convert::Into<wkt::FieldMask>,
4512    {
4513        self.update_mask = std::option::Option::Some(v.into());
4514        self
4515    }
4516
4517    /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
4518    ///
4519    /// # Example
4520    /// ```ignore,no_run
4521    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4522    /// use wkt::FieldMask;
4523    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4524    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4525    /// ```
4526    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4527    where
4528        T: std::convert::Into<wkt::FieldMask>,
4529    {
4530        self.update_mask = v.map(|x| x.into());
4531        self
4532    }
4533
4534    /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
4535    ///
4536    /// # Example
4537    /// ```ignore,no_run
4538    /// # use google_cloud_storage::model::UpdateOrganizationIntelligenceConfigRequest;
4539    /// let x = UpdateOrganizationIntelligenceConfigRequest::new().set_request_id("example");
4540    /// ```
4541    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4542        self.request_id = v.into();
4543        self
4544    }
4545}
4546
4547impl wkt::message::Message for UpdateOrganizationIntelligenceConfigRequest {
4548    fn typename() -> &'static str {
4549        "type.googleapis.com/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"
4550    }
4551}
4552
4553/// Request message to update the `IntelligenceConfig` resource associated with
4554/// your folder.
4555///
4556/// **IAM Permissions**:
4557///
4558/// Requires `storage.intelligenceConfigs.update`
4559/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4560/// the folder.
4561#[derive(Clone, Default, PartialEq)]
4562#[non_exhaustive]
4563pub struct UpdateFolderIntelligenceConfigRequest {
4564    /// Required. The `IntelligenceConfig` resource to be updated.
4565    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4566
4567    /// Required. The `update_mask` that specifies the fields within the
4568    /// `IntelligenceConfig` resource that should be modified by this update. Only
4569    /// the listed fields are updated.
4570    pub update_mask: std::option::Option<wkt::FieldMask>,
4571
4572    /// Optional. The ID that uniquely identifies the request, preventing duplicate
4573    /// processing.
4574    pub request_id: std::string::String,
4575
4576    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4577}
4578
4579impl UpdateFolderIntelligenceConfigRequest {
4580    pub fn new() -> Self {
4581        std::default::Default::default()
4582    }
4583
4584    /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
4585    ///
4586    /// # Example
4587    /// ```ignore,no_run
4588    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4589    /// use google_cloud_storage::model::IntelligenceConfig;
4590    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
4591    /// ```
4592    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
4593    where
4594        T: std::convert::Into<crate::model::IntelligenceConfig>,
4595    {
4596        self.intelligence_config = std::option::Option::Some(v.into());
4597        self
4598    }
4599
4600    /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
4601    ///
4602    /// # Example
4603    /// ```ignore,no_run
4604    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4605    /// use google_cloud_storage::model::IntelligenceConfig;
4606    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
4607    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
4608    /// ```
4609    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
4610    where
4611        T: std::convert::Into<crate::model::IntelligenceConfig>,
4612    {
4613        self.intelligence_config = v.map(|x| x.into());
4614        self
4615    }
4616
4617    /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
4618    ///
4619    /// # Example
4620    /// ```ignore,no_run
4621    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4622    /// use wkt::FieldMask;
4623    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4624    /// ```
4625    pub fn set_update_mask<T>(mut self, v: T) -> Self
4626    where
4627        T: std::convert::Into<wkt::FieldMask>,
4628    {
4629        self.update_mask = std::option::Option::Some(v.into());
4630        self
4631    }
4632
4633    /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
4634    ///
4635    /// # Example
4636    /// ```ignore,no_run
4637    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4638    /// use wkt::FieldMask;
4639    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4640    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4641    /// ```
4642    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4643    where
4644        T: std::convert::Into<wkt::FieldMask>,
4645    {
4646        self.update_mask = v.map(|x| x.into());
4647        self
4648    }
4649
4650    /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
4651    ///
4652    /// # Example
4653    /// ```ignore,no_run
4654    /// # use google_cloud_storage::model::UpdateFolderIntelligenceConfigRequest;
4655    /// let x = UpdateFolderIntelligenceConfigRequest::new().set_request_id("example");
4656    /// ```
4657    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4658        self.request_id = v.into();
4659        self
4660    }
4661}
4662
4663impl wkt::message::Message for UpdateFolderIntelligenceConfigRequest {
4664    fn typename() -> &'static str {
4665        "type.googleapis.com/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"
4666    }
4667}
4668
4669/// Request message to update the `IntelligenceConfig` resource associated with
4670/// your project.
4671///
4672/// **IAM Permissions**:
4673///
4674/// Requires `storage.intelligenceConfigs.update`
4675/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4676/// the folder.
4677#[derive(Clone, Default, PartialEq)]
4678#[non_exhaustive]
4679pub struct UpdateProjectIntelligenceConfigRequest {
4680    /// Required. The `IntelligenceConfig` resource to be updated.
4681    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
4682
4683    /// Required. The `update_mask` that specifies the fields within the
4684    /// `IntelligenceConfig` resource that should be modified by this update. Only
4685    /// the listed fields are updated.
4686    pub update_mask: std::option::Option<wkt::FieldMask>,
4687
4688    /// Optional. The ID that uniquely identifies the request, preventing duplicate
4689    /// processing.
4690    pub request_id: std::string::String,
4691
4692    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4693}
4694
4695impl UpdateProjectIntelligenceConfigRequest {
4696    pub fn new() -> Self {
4697        std::default::Default::default()
4698    }
4699
4700    /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
4701    ///
4702    /// # Example
4703    /// ```ignore,no_run
4704    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4705    /// use google_cloud_storage::model::IntelligenceConfig;
4706    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_intelligence_config(IntelligenceConfig::default()/* use setters */);
4707    /// ```
4708    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
4709    where
4710        T: std::convert::Into<crate::model::IntelligenceConfig>,
4711    {
4712        self.intelligence_config = std::option::Option::Some(v.into());
4713        self
4714    }
4715
4716    /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
4717    ///
4718    /// # Example
4719    /// ```ignore,no_run
4720    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4721    /// use google_cloud_storage::model::IntelligenceConfig;
4722    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_intelligence_config(Some(IntelligenceConfig::default()/* use setters */));
4723    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_intelligence_config(None::<IntelligenceConfig>);
4724    /// ```
4725    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
4726    where
4727        T: std::convert::Into<crate::model::IntelligenceConfig>,
4728    {
4729        self.intelligence_config = v.map(|x| x.into());
4730        self
4731    }
4732
4733    /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
4734    ///
4735    /// # Example
4736    /// ```ignore,no_run
4737    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4738    /// use wkt::FieldMask;
4739    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_update_mask(FieldMask::default()/* use setters */);
4740    /// ```
4741    pub fn set_update_mask<T>(mut self, v: T) -> Self
4742    where
4743        T: std::convert::Into<wkt::FieldMask>,
4744    {
4745        self.update_mask = std::option::Option::Some(v.into());
4746        self
4747    }
4748
4749    /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
4750    ///
4751    /// # Example
4752    /// ```ignore,no_run
4753    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4754    /// use wkt::FieldMask;
4755    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_update_mask(Some(FieldMask::default()/* use setters */));
4756    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_or_clear_update_mask(None::<FieldMask>);
4757    /// ```
4758    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4759    where
4760        T: std::convert::Into<wkt::FieldMask>,
4761    {
4762        self.update_mask = v.map(|x| x.into());
4763        self
4764    }
4765
4766    /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
4767    ///
4768    /// # Example
4769    /// ```ignore,no_run
4770    /// # use google_cloud_storage::model::UpdateProjectIntelligenceConfigRequest;
4771    /// let x = UpdateProjectIntelligenceConfigRequest::new().set_request_id("example");
4772    /// ```
4773    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4774        self.request_id = v.into();
4775        self
4776    }
4777}
4778
4779impl wkt::message::Message for UpdateProjectIntelligenceConfigRequest {
4780    fn typename() -> &'static str {
4781        "type.googleapis.com/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"
4782    }
4783}
4784
4785/// Request message to get the `IntelligenceConfig` resource associated with your
4786/// organization.
4787///
4788/// **IAM Permissions**
4789///
4790/// Requires `storage.intelligenceConfigs.get`
4791/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4792/// the organization.
4793#[derive(Clone, Default, PartialEq)]
4794#[non_exhaustive]
4795pub struct GetOrganizationIntelligenceConfigRequest {
4796    /// Required. The name of the `IntelligenceConfig` resource associated with
4797    /// your organization.
4798    ///
4799    /// Format: `organizations/{org_id}/locations/global/intelligenceConfig`
4800    pub name: std::string::String,
4801
4802    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4803}
4804
4805impl GetOrganizationIntelligenceConfigRequest {
4806    pub fn new() -> Self {
4807        std::default::Default::default()
4808    }
4809
4810    /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
4811    ///
4812    /// # Example
4813    /// ```ignore,no_run
4814    /// # use google_cloud_storage::model::GetOrganizationIntelligenceConfigRequest;
4815    /// let x = GetOrganizationIntelligenceConfigRequest::new().set_name("example");
4816    /// ```
4817    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4818        self.name = v.into();
4819        self
4820    }
4821}
4822
4823impl wkt::message::Message for GetOrganizationIntelligenceConfigRequest {
4824    fn typename() -> &'static str {
4825        "type.googleapis.com/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"
4826    }
4827}
4828
4829/// Request message to get the `IntelligenceConfig` resource associated with your
4830/// folder.
4831///
4832/// **IAM Permissions**
4833///
4834/// Requires `storage.intelligenceConfigs.get`
4835/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
4836/// the folder.
4837#[derive(Clone, Default, PartialEq)]
4838#[non_exhaustive]
4839pub struct GetFolderIntelligenceConfigRequest {
4840    /// Required. The name of the `IntelligenceConfig` resource associated with
4841    /// your folder.
4842    ///
4843    /// Format: `folders/{id}/locations/global/intelligenceConfig`
4844    pub name: std::string::String,
4845
4846    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4847}
4848
4849impl GetFolderIntelligenceConfigRequest {
4850    pub fn new() -> Self {
4851        std::default::Default::default()
4852    }
4853
4854    /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
4855    ///
4856    /// # Example
4857    /// ```ignore,no_run
4858    /// # use google_cloud_storage::model::GetFolderIntelligenceConfigRequest;
4859    /// let x = GetFolderIntelligenceConfigRequest::new().set_name("example");
4860    /// ```
4861    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4862        self.name = v.into();
4863        self
4864    }
4865}
4866
4867impl wkt::message::Message for GetFolderIntelligenceConfigRequest {
4868    fn typename() -> &'static str {
4869        "type.googleapis.com/google.storage.control.v2.GetFolderIntelligenceConfigRequest"
4870    }
4871}
4872
4873/// Request message to get the `IntelligenceConfig` resource associated with your
4874/// project.
4875///
4876/// **IAM Permissions**:
4877///
4878/// Requires `storage.intelligenceConfigs.get`
4879/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission
4880/// on the project.
4881#[derive(Clone, Default, PartialEq)]
4882#[non_exhaustive]
4883pub struct GetProjectIntelligenceConfigRequest {
4884    /// Required. The name of the `IntelligenceConfig` resource associated with
4885    /// your project.
4886    ///
4887    /// Format: `projects/{id}/locations/global/intelligenceConfig`
4888    pub name: std::string::String,
4889
4890    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4891}
4892
4893impl GetProjectIntelligenceConfigRequest {
4894    pub fn new() -> Self {
4895        std::default::Default::default()
4896    }
4897
4898    /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
4899    ///
4900    /// # Example
4901    /// ```ignore,no_run
4902    /// # use google_cloud_storage::model::GetProjectIntelligenceConfigRequest;
4903    /// let x = GetProjectIntelligenceConfigRequest::new().set_name("example");
4904    /// ```
4905    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4906        self.name = v.into();
4907        self
4908    }
4909}
4910
4911impl wkt::message::Message for GetProjectIntelligenceConfigRequest {
4912    fn typename() -> &'static str {
4913        "type.googleapis.com/google.storage.control.v2.GetProjectIntelligenceConfigRequest"
4914    }
4915}