Skip to main content

google_cloud_storage/generated/gapic_control/
model.rs

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