google_cloud_storage/generated/gapic_control/
model.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17#![allow(rustdoc::redundant_explicit_links)]
18#![allow(rustdoc::broken_intra_doc_links)]
19
20mod debug;
21mod deserialize;
22mod serialize;
23
24/// Contains information about a pending rename operation.
25#[derive(Clone, Default, PartialEq)]
26#[non_exhaustive]
27pub struct PendingRenameInfo {
28    /// Output only. The name of the rename operation.
29    pub operation: std::string::String,
30
31    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
32}
33
34impl PendingRenameInfo {
35    pub fn new() -> Self {
36        std::default::Default::default()
37    }
38
39    /// Sets the value of [operation][crate::model::PendingRenameInfo::operation].
40    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
41        self.operation = v.into();
42        self
43    }
44}
45
46impl wkt::message::Message for PendingRenameInfo {
47    fn typename() -> &'static str {
48        "type.googleapis.com/google.storage.control.v2.PendingRenameInfo"
49    }
50}
51
52/// A folder resource. This resource can only exist in a hierarchical namespace
53/// enabled bucket.
54#[derive(Clone, Default, PartialEq)]
55#[non_exhaustive]
56pub struct Folder {
57    /// Identifier. The name of this folder.
58    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
59    pub name: std::string::String,
60
61    /// Output only. The version of the metadata for this folder. Used for
62    /// preconditions and for detecting changes in metadata.
63    pub metageneration: i64,
64
65    /// Output only. The creation time of the folder.
66    pub create_time: std::option::Option<wkt::Timestamp>,
67
68    /// Output only. The modification time of the folder.
69    pub update_time: std::option::Option<wkt::Timestamp>,
70
71    /// Output only. Only present if the folder is part of an ongoing RenameFolder
72    /// operation. Contains information which can be used to query the operation
73    /// status. The presence of this field also indicates all write operations are
74    /// blocked for this folder, including folder, managed folder, and object
75    /// operations.
76    pub pending_rename_info: std::option::Option<crate::model::PendingRenameInfo>,
77
78    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
79}
80
81impl Folder {
82    pub fn new() -> Self {
83        std::default::Default::default()
84    }
85
86    /// Sets the value of [name][crate::model::Folder::name].
87    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
88        self.name = v.into();
89        self
90    }
91
92    /// Sets the value of [metageneration][crate::model::Folder::metageneration].
93    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
94        self.metageneration = v.into();
95        self
96    }
97
98    /// Sets the value of [create_time][crate::model::Folder::create_time].
99    pub fn set_create_time<T>(mut self, v: T) -> Self
100    where
101        T: std::convert::Into<wkt::Timestamp>,
102    {
103        self.create_time = std::option::Option::Some(v.into());
104        self
105    }
106
107    /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
108    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
109    where
110        T: std::convert::Into<wkt::Timestamp>,
111    {
112        self.create_time = v.map(|x| x.into());
113        self
114    }
115
116    /// Sets the value of [update_time][crate::model::Folder::update_time].
117    pub fn set_update_time<T>(mut self, v: T) -> Self
118    where
119        T: std::convert::Into<wkt::Timestamp>,
120    {
121        self.update_time = std::option::Option::Some(v.into());
122        self
123    }
124
125    /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
126    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
127    where
128        T: std::convert::Into<wkt::Timestamp>,
129    {
130        self.update_time = v.map(|x| x.into());
131        self
132    }
133
134    /// Sets the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
135    pub fn set_pending_rename_info<T>(mut self, v: T) -> Self
136    where
137        T: std::convert::Into<crate::model::PendingRenameInfo>,
138    {
139        self.pending_rename_info = std::option::Option::Some(v.into());
140        self
141    }
142
143    /// Sets or clears the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
144    pub fn set_or_clear_pending_rename_info<T>(mut self, v: std::option::Option<T>) -> Self
145    where
146        T: std::convert::Into<crate::model::PendingRenameInfo>,
147    {
148        self.pending_rename_info = v.map(|x| x.into());
149        self
150    }
151}
152
153impl wkt::message::Message for Folder {
154    fn typename() -> &'static str {
155        "type.googleapis.com/google.storage.control.v2.Folder"
156    }
157}
158
159/// Request message for GetFolder. This operation is only applicable to a
160/// hierarchical namespace enabled bucket.
161#[derive(Clone, Default, PartialEq)]
162#[non_exhaustive]
163pub struct GetFolderRequest {
164    /// Required. Name of the folder.
165    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
166    pub name: std::string::String,
167
168    /// Makes the operation only succeed conditional on whether the folder's
169    /// current metageneration matches the given value.
170    pub if_metageneration_match: std::option::Option<i64>,
171
172    /// Makes the operation only succeed conditional on whether the folder's
173    /// current metageneration does not match the given value.
174    pub if_metageneration_not_match: std::option::Option<i64>,
175
176    /// Optional. A unique identifier for this request. UUID is the recommended
177    /// format, but other formats are still accepted.
178    pub request_id: std::string::String,
179
180    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
181}
182
183impl GetFolderRequest {
184    pub fn new() -> Self {
185        std::default::Default::default()
186    }
187
188    /// Sets the value of [name][crate::model::GetFolderRequest::name].
189    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
190        self.name = v.into();
191        self
192    }
193
194    /// Sets the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
195    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
196    where
197        T: std::convert::Into<i64>,
198    {
199        self.if_metageneration_match = std::option::Option::Some(v.into());
200        self
201    }
202
203    /// Sets or clears the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
204    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
205    where
206        T: std::convert::Into<i64>,
207    {
208        self.if_metageneration_match = v.map(|x| x.into());
209        self
210    }
211
212    /// Sets the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
213    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
214    where
215        T: std::convert::Into<i64>,
216    {
217        self.if_metageneration_not_match = std::option::Option::Some(v.into());
218        self
219    }
220
221    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
222    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
223    where
224        T: std::convert::Into<i64>,
225    {
226        self.if_metageneration_not_match = v.map(|x| x.into());
227        self
228    }
229
230    /// Sets the value of [request_id][crate::model::GetFolderRequest::request_id].
231    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
232        self.request_id = v.into();
233        self
234    }
235}
236
237impl wkt::message::Message for GetFolderRequest {
238    fn typename() -> &'static str {
239        "type.googleapis.com/google.storage.control.v2.GetFolderRequest"
240    }
241}
242
243/// Request message for CreateFolder. This operation is only applicable to a
244/// hierarchical namespace enabled bucket.
245#[derive(Clone, Default, PartialEq)]
246#[non_exhaustive]
247pub struct CreateFolderRequest {
248    /// Required. Name of the bucket in which the folder will reside. The bucket
249    /// must be a hierarchical namespace enabled bucket.
250    pub parent: std::string::String,
251
252    /// Required. Properties of the new folder being created.
253    /// The bucket and name of the folder are specified in the parent and folder_id
254    /// fields, respectively. Populating those fields in `folder` will result in an
255    /// error.
256    pub folder: std::option::Option<crate::model::Folder>,
257
258    /// Required. The full name of a folder, including all its parent folders.
259    /// Folders use single '/' characters as a delimiter.
260    /// The folder_id must end with a slash.
261    /// For example, the folder_id of "books/biographies/" would create a new
262    /// "biographies/" folder under the "books/" folder.
263    pub folder_id: std::string::String,
264
265    /// Optional. If true, parent folder doesn't have to be present and all missing
266    /// ancestor folders will be created atomically.
267    pub recursive: bool,
268
269    /// Optional. A unique identifier for this request. UUID is the recommended
270    /// format, but other formats are still accepted.
271    pub request_id: std::string::String,
272
273    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
274}
275
276impl CreateFolderRequest {
277    pub fn new() -> Self {
278        std::default::Default::default()
279    }
280
281    /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
282    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
283        self.parent = v.into();
284        self
285    }
286
287    /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
288    pub fn set_folder<T>(mut self, v: T) -> Self
289    where
290        T: std::convert::Into<crate::model::Folder>,
291    {
292        self.folder = std::option::Option::Some(v.into());
293        self
294    }
295
296    /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
297    pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
298    where
299        T: std::convert::Into<crate::model::Folder>,
300    {
301        self.folder = v.map(|x| x.into());
302        self
303    }
304
305    /// Sets the value of [folder_id][crate::model::CreateFolderRequest::folder_id].
306    pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
307        self.folder_id = v.into();
308        self
309    }
310
311    /// Sets the value of [recursive][crate::model::CreateFolderRequest::recursive].
312    pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
313        self.recursive = v.into();
314        self
315    }
316
317    /// Sets the value of [request_id][crate::model::CreateFolderRequest::request_id].
318    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
319        self.request_id = v.into();
320        self
321    }
322}
323
324impl wkt::message::Message for CreateFolderRequest {
325    fn typename() -> &'static str {
326        "type.googleapis.com/google.storage.control.v2.CreateFolderRequest"
327    }
328}
329
330/// Request message for DeleteFolder. This operation is only applicable to a
331/// hierarchical namespace enabled bucket.
332#[derive(Clone, Default, PartialEq)]
333#[non_exhaustive]
334pub struct DeleteFolderRequest {
335    /// Required. Name of the folder.
336    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
337    pub name: std::string::String,
338
339    /// Makes the operation only succeed conditional on whether the folder's
340    /// current metageneration matches the given value.
341    pub if_metageneration_match: std::option::Option<i64>,
342
343    /// Makes the operation only succeed conditional on whether the folder's
344    /// current metageneration does not match the given value.
345    pub if_metageneration_not_match: std::option::Option<i64>,
346
347    /// Optional. A unique identifier for this request. UUID is the recommended
348    /// format, but other formats are still accepted.
349    pub request_id: std::string::String,
350
351    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
352}
353
354impl DeleteFolderRequest {
355    pub fn new() -> Self {
356        std::default::Default::default()
357    }
358
359    /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
360    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
361        self.name = v.into();
362        self
363    }
364
365    /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
366    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
367    where
368        T: std::convert::Into<i64>,
369    {
370        self.if_metageneration_match = std::option::Option::Some(v.into());
371        self
372    }
373
374    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
375    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
376    where
377        T: std::convert::Into<i64>,
378    {
379        self.if_metageneration_match = v.map(|x| x.into());
380        self
381    }
382
383    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
384    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
385    where
386        T: std::convert::Into<i64>,
387    {
388        self.if_metageneration_not_match = std::option::Option::Some(v.into());
389        self
390    }
391
392    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
393    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
394    where
395        T: std::convert::Into<i64>,
396    {
397        self.if_metageneration_not_match = v.map(|x| x.into());
398        self
399    }
400
401    /// Sets the value of [request_id][crate::model::DeleteFolderRequest::request_id].
402    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
403        self.request_id = v.into();
404        self
405    }
406}
407
408impl wkt::message::Message for DeleteFolderRequest {
409    fn typename() -> &'static str {
410        "type.googleapis.com/google.storage.control.v2.DeleteFolderRequest"
411    }
412}
413
414/// Request message for ListFolders. This operation is only applicable to a
415/// hierarchical namespace enabled bucket.
416#[derive(Clone, Default, PartialEq)]
417#[non_exhaustive]
418pub struct ListFoldersRequest {
419    /// Required. Name of the bucket in which to look for folders. The bucket must
420    /// be a hierarchical namespace enabled bucket.
421    pub parent: std::string::String,
422
423    /// Optional. Maximum number of folders to return in a single response. The
424    /// service will use this parameter or 1,000 items, whichever is smaller.
425    pub page_size: i32,
426
427    /// Optional. A previously-returned page token representing part of the larger
428    /// set of results to view.
429    pub page_token: std::string::String,
430
431    /// Optional. Filter results to folders whose names begin with this prefix.
432    /// If set, the value must either be an empty string or end with a '/'.
433    pub prefix: std::string::String,
434
435    /// Optional. If set, returns results in a directory-like mode. The results
436    /// will only include folders that either exactly match the above prefix, or
437    /// are one level below the prefix. The only supported value is '/'.
438    pub delimiter: std::string::String,
439
440    /// Optional. Filter results to folders whose names are lexicographically equal
441    /// to or after lexicographic_start. If lexicographic_end is also set, the
442    /// folders listed have names between lexicographic_start (inclusive) and
443    /// lexicographic_end (exclusive).
444    pub lexicographic_start: std::string::String,
445
446    /// Optional. Filter results to folders whose names are lexicographically
447    /// before lexicographic_end. If lexicographic_start is also set, the folders
448    /// listed have names between lexicographic_start (inclusive) and
449    /// lexicographic_end (exclusive).
450    pub lexicographic_end: std::string::String,
451
452    /// Optional. A unique identifier for this request. UUID is the recommended
453    /// format, but other formats are still accepted.
454    pub request_id: std::string::String,
455
456    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
457}
458
459impl ListFoldersRequest {
460    pub fn new() -> Self {
461        std::default::Default::default()
462    }
463
464    /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
465    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
466        self.parent = v.into();
467        self
468    }
469
470    /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
471    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
472        self.page_size = v.into();
473        self
474    }
475
476    /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
477    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
478        self.page_token = v.into();
479        self
480    }
481
482    /// Sets the value of [prefix][crate::model::ListFoldersRequest::prefix].
483    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
484        self.prefix = v.into();
485        self
486    }
487
488    /// Sets the value of [delimiter][crate::model::ListFoldersRequest::delimiter].
489    pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
490        self.delimiter = v.into();
491        self
492    }
493
494    /// Sets the value of [lexicographic_start][crate::model::ListFoldersRequest::lexicographic_start].
495    pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
496        mut self,
497        v: T,
498    ) -> Self {
499        self.lexicographic_start = v.into();
500        self
501    }
502
503    /// Sets the value of [lexicographic_end][crate::model::ListFoldersRequest::lexicographic_end].
504    pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
505        mut self,
506        v: T,
507    ) -> Self {
508        self.lexicographic_end = v.into();
509        self
510    }
511
512    /// Sets the value of [request_id][crate::model::ListFoldersRequest::request_id].
513    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
514        self.request_id = v.into();
515        self
516    }
517}
518
519impl wkt::message::Message for ListFoldersRequest {
520    fn typename() -> &'static str {
521        "type.googleapis.com/google.storage.control.v2.ListFoldersRequest"
522    }
523}
524
525/// Response message for ListFolders.
526#[derive(Clone, Default, PartialEq)]
527#[non_exhaustive]
528pub struct ListFoldersResponse {
529    /// The list of child folders
530    pub folders: std::vec::Vec<crate::model::Folder>,
531
532    /// The continuation token, used to page through large result sets. Provide
533    /// this value in a subsequent request to return the next page of results.
534    pub next_page_token: std::string::String,
535
536    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
537}
538
539impl ListFoldersResponse {
540    pub fn new() -> Self {
541        std::default::Default::default()
542    }
543
544    /// Sets the value of [folders][crate::model::ListFoldersResponse::folders].
545    pub fn set_folders<T, V>(mut self, v: T) -> Self
546    where
547        T: std::iter::IntoIterator<Item = V>,
548        V: std::convert::Into<crate::model::Folder>,
549    {
550        use std::iter::Iterator;
551        self.folders = v.into_iter().map(|i| i.into()).collect();
552        self
553    }
554
555    /// Sets the value of [next_page_token][crate::model::ListFoldersResponse::next_page_token].
556    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
557        self.next_page_token = v.into();
558        self
559    }
560}
561
562impl wkt::message::Message for ListFoldersResponse {
563    fn typename() -> &'static str {
564        "type.googleapis.com/google.storage.control.v2.ListFoldersResponse"
565    }
566}
567
568#[doc(hidden)]
569impl gax::paginator::internal::PageableResponse for ListFoldersResponse {
570    type PageItem = crate::model::Folder;
571
572    fn items(self) -> std::vec::Vec<Self::PageItem> {
573        self.folders
574    }
575
576    fn next_page_token(&self) -> std::string::String {
577        use std::clone::Clone;
578        self.next_page_token.clone()
579    }
580}
581
582/// Request message for RenameFolder. This operation is only applicable to a
583/// hierarchical namespace enabled bucket.
584#[derive(Clone, Default, PartialEq)]
585#[non_exhaustive]
586pub struct RenameFolderRequest {
587    /// Required. Name of the source folder being renamed.
588    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
589    pub name: std::string::String,
590
591    /// Required. The destination folder ID, e.g. `foo/bar/`.
592    pub destination_folder_id: std::string::String,
593
594    /// Makes the operation only succeed conditional on whether the source
595    /// folder's current metageneration matches the given value.
596    pub if_metageneration_match: std::option::Option<i64>,
597
598    /// Makes the operation only succeed conditional on whether the source
599    /// folder's current metageneration does not match the given value.
600    pub if_metageneration_not_match: std::option::Option<i64>,
601
602    /// Optional. A unique identifier for this request. UUID is the recommended
603    /// format, but other formats are still accepted. This request is only
604    /// idempotent if a `request_id` is provided.
605    pub request_id: std::string::String,
606
607    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
608}
609
610impl RenameFolderRequest {
611    pub fn new() -> Self {
612        std::default::Default::default()
613    }
614
615    /// Sets the value of [name][crate::model::RenameFolderRequest::name].
616    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
617        self.name = v.into();
618        self
619    }
620
621    /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
622    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
623        mut self,
624        v: T,
625    ) -> Self {
626        self.destination_folder_id = v.into();
627        self
628    }
629
630    /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
631    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
632    where
633        T: std::convert::Into<i64>,
634    {
635        self.if_metageneration_match = std::option::Option::Some(v.into());
636        self
637    }
638
639    /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
640    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
641    where
642        T: std::convert::Into<i64>,
643    {
644        self.if_metageneration_match = v.map(|x| x.into());
645        self
646    }
647
648    /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
649    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
650    where
651        T: std::convert::Into<i64>,
652    {
653        self.if_metageneration_not_match = std::option::Option::Some(v.into());
654        self
655    }
656
657    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
658    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
659    where
660        T: std::convert::Into<i64>,
661    {
662        self.if_metageneration_not_match = v.map(|x| x.into());
663        self
664    }
665
666    /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
667    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
668        self.request_id = v.into();
669        self
670    }
671}
672
673impl wkt::message::Message for RenameFolderRequest {
674    fn typename() -> &'static str {
675        "type.googleapis.com/google.storage.control.v2.RenameFolderRequest"
676    }
677}
678
679/// The message contains metadata that is common to all Storage Control
680/// long-running operations, present in its `google.longrunning.Operation`
681/// messages, and accessible via `metadata.common_metadata`.
682#[derive(Clone, Default, PartialEq)]
683#[non_exhaustive]
684pub struct CommonLongRunningOperationMetadata {
685    /// Output only. The time the operation was created.
686    pub create_time: std::option::Option<wkt::Timestamp>,
687
688    /// Output only. The time the operation finished running.
689    pub end_time: std::option::Option<wkt::Timestamp>,
690
691    /// Output only. The time the operation was last modified.
692    pub update_time: std::option::Option<wkt::Timestamp>,
693
694    /// Output only. The type of operation invoked.
695    pub r#type: std::string::String,
696
697    /// Output only. Identifies whether the user has requested cancellation.
698    pub requested_cancellation: bool,
699
700    /// Output only. The estimated progress of the operation in percentage [0,
701    /// 100]. The value -1 means the progress is unknown.
702    pub progress_percent: i32,
703
704    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
705}
706
707impl CommonLongRunningOperationMetadata {
708    pub fn new() -> Self {
709        std::default::Default::default()
710    }
711
712    /// Sets the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
713    pub fn set_create_time<T>(mut self, v: T) -> Self
714    where
715        T: std::convert::Into<wkt::Timestamp>,
716    {
717        self.create_time = std::option::Option::Some(v.into());
718        self
719    }
720
721    /// Sets or clears the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
722    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
723    where
724        T: std::convert::Into<wkt::Timestamp>,
725    {
726        self.create_time = v.map(|x| x.into());
727        self
728    }
729
730    /// Sets the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
731    pub fn set_end_time<T>(mut self, v: T) -> Self
732    where
733        T: std::convert::Into<wkt::Timestamp>,
734    {
735        self.end_time = std::option::Option::Some(v.into());
736        self
737    }
738
739    /// Sets or clears the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
740    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
741    where
742        T: std::convert::Into<wkt::Timestamp>,
743    {
744        self.end_time = v.map(|x| x.into());
745        self
746    }
747
748    /// Sets the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
749    pub fn set_update_time<T>(mut self, v: T) -> Self
750    where
751        T: std::convert::Into<wkt::Timestamp>,
752    {
753        self.update_time = std::option::Option::Some(v.into());
754        self
755    }
756
757    /// Sets or clears the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
758    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
759    where
760        T: std::convert::Into<wkt::Timestamp>,
761    {
762        self.update_time = v.map(|x| x.into());
763        self
764    }
765
766    /// Sets the value of [r#type][crate::model::CommonLongRunningOperationMetadata::type].
767    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
768        self.r#type = v.into();
769        self
770    }
771
772    /// Sets the value of [requested_cancellation][crate::model::CommonLongRunningOperationMetadata::requested_cancellation].
773    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
774        self.requested_cancellation = v.into();
775        self
776    }
777
778    /// Sets the value of [progress_percent][crate::model::CommonLongRunningOperationMetadata::progress_percent].
779    pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
780        self.progress_percent = v.into();
781        self
782    }
783}
784
785impl wkt::message::Message for CommonLongRunningOperationMetadata {
786    fn typename() -> &'static str {
787        "type.googleapis.com/google.storage.control.v2.CommonLongRunningOperationMetadata"
788    }
789}
790
791/// Message returned in the metadata field of the Operation resource for
792/// RenameFolder operations.
793#[derive(Clone, Default, PartialEq)]
794#[non_exhaustive]
795pub struct RenameFolderMetadata {
796    /// Generic metadata for the long running operation.
797    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
798
799    /// The path of the source folder.
800    pub source_folder_id: std::string::String,
801
802    /// The path of the destination folder.
803    pub destination_folder_id: std::string::String,
804
805    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
806}
807
808impl RenameFolderMetadata {
809    pub fn new() -> Self {
810        std::default::Default::default()
811    }
812
813    /// Sets the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
814    pub fn set_common_metadata<T>(mut self, v: T) -> Self
815    where
816        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
817    {
818        self.common_metadata = std::option::Option::Some(v.into());
819        self
820    }
821
822    /// Sets or clears the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
823    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
824    where
825        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
826    {
827        self.common_metadata = v.map(|x| x.into());
828        self
829    }
830
831    /// Sets the value of [source_folder_id][crate::model::RenameFolderMetadata::source_folder_id].
832    pub fn set_source_folder_id<T: std::convert::Into<std::string::String>>(
833        mut self,
834        v: T,
835    ) -> Self {
836        self.source_folder_id = v.into();
837        self
838    }
839
840    /// Sets the value of [destination_folder_id][crate::model::RenameFolderMetadata::destination_folder_id].
841    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
842        mut self,
843        v: T,
844    ) -> Self {
845        self.destination_folder_id = v.into();
846        self
847    }
848}
849
850impl wkt::message::Message for RenameFolderMetadata {
851    fn typename() -> &'static str {
852        "type.googleapis.com/google.storage.control.v2.RenameFolderMetadata"
853    }
854}
855
856/// The storage layout configuration of a bucket.
857#[derive(Clone, Default, PartialEq)]
858#[non_exhaustive]
859pub struct StorageLayout {
860    /// Output only. The name of the StorageLayout resource.
861    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
862    pub name: std::string::String,
863
864    /// Output only. The location of the bucket.
865    pub location: std::string::String,
866
867    /// Output only. The location type of the bucket (region, dual-region,
868    /// multi-region, etc).
869    pub location_type: std::string::String,
870
871    /// Output only. The data placement configuration for custom dual region. If
872    /// there is no configuration, this is not a custom dual region bucket.
873    pub custom_placement_config:
874        std::option::Option<crate::model::storage_layout::CustomPlacementConfig>,
875
876    /// Output only. The bucket's hierarchical namespace configuration. If there is
877    /// no configuration, the hierarchical namespace is disabled.
878    pub hierarchical_namespace:
879        std::option::Option<crate::model::storage_layout::HierarchicalNamespace>,
880
881    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
882}
883
884impl StorageLayout {
885    pub fn new() -> Self {
886        std::default::Default::default()
887    }
888
889    /// Sets the value of [name][crate::model::StorageLayout::name].
890    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
891        self.name = v.into();
892        self
893    }
894
895    /// Sets the value of [location][crate::model::StorageLayout::location].
896    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
897        self.location = v.into();
898        self
899    }
900
901    /// Sets the value of [location_type][crate::model::StorageLayout::location_type].
902    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
903        self.location_type = v.into();
904        self
905    }
906
907    /// Sets the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
908    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
909    where
910        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
911    {
912        self.custom_placement_config = std::option::Option::Some(v.into());
913        self
914    }
915
916    /// Sets or clears the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
917    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
918    where
919        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
920    {
921        self.custom_placement_config = v.map(|x| x.into());
922        self
923    }
924
925    /// Sets the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
926    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
927    where
928        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
929    {
930        self.hierarchical_namespace = std::option::Option::Some(v.into());
931        self
932    }
933
934    /// Sets or clears the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
935    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
936    where
937        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
938    {
939        self.hierarchical_namespace = v.map(|x| x.into());
940        self
941    }
942}
943
944impl wkt::message::Message for StorageLayout {
945    fn typename() -> &'static str {
946        "type.googleapis.com/google.storage.control.v2.StorageLayout"
947    }
948}
949
950/// Defines additional types related to [StorageLayout].
951pub mod storage_layout {
952    #[allow(unused_imports)]
953    use super::*;
954
955    /// Configuration for Custom Dual Regions.  It should specify precisely two
956    /// eligible regions within the same Multiregion. More information on regions
957    /// may be found [here](https://cloud.google.com/storage/docs/locations).
958    #[derive(Clone, Default, PartialEq)]
959    #[non_exhaustive]
960    pub struct CustomPlacementConfig {
961        /// List of locations to use for data placement.
962        pub data_locations: std::vec::Vec<std::string::String>,
963
964        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
965    }
966
967    impl CustomPlacementConfig {
968        pub fn new() -> Self {
969            std::default::Default::default()
970        }
971
972        /// Sets the value of [data_locations][crate::model::storage_layout::CustomPlacementConfig::data_locations].
973        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
974        where
975            T: std::iter::IntoIterator<Item = V>,
976            V: std::convert::Into<std::string::String>,
977        {
978            use std::iter::Iterator;
979            self.data_locations = v.into_iter().map(|i| i.into()).collect();
980            self
981        }
982    }
983
984    impl wkt::message::Message for CustomPlacementConfig {
985        fn typename() -> &'static str {
986            "type.googleapis.com/google.storage.control.v2.StorageLayout.CustomPlacementConfig"
987        }
988    }
989
990    /// Configuration for a bucket's hierarchical namespace feature.
991    #[derive(Clone, Default, PartialEq)]
992    #[non_exhaustive]
993    pub struct HierarchicalNamespace {
994        /// Enables the hierarchical namespace feature.
995        pub enabled: bool,
996
997        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
998    }
999
1000    impl HierarchicalNamespace {
1001        pub fn new() -> Self {
1002            std::default::Default::default()
1003        }
1004
1005        /// Sets the value of [enabled][crate::model::storage_layout::HierarchicalNamespace::enabled].
1006        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1007            self.enabled = v.into();
1008            self
1009        }
1010    }
1011
1012    impl wkt::message::Message for HierarchicalNamespace {
1013        fn typename() -> &'static str {
1014            "type.googleapis.com/google.storage.control.v2.StorageLayout.HierarchicalNamespace"
1015        }
1016    }
1017}
1018
1019/// Request message for GetStorageLayout.
1020#[derive(Clone, Default, PartialEq)]
1021#[non_exhaustive]
1022pub struct GetStorageLayoutRequest {
1023    /// Required. The name of the StorageLayout resource.
1024    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
1025    pub name: std::string::String,
1026
1027    /// An optional prefix used for permission check. It is useful when the caller
1028    /// only has limited permissions under a specific prefix.
1029    pub prefix: std::string::String,
1030
1031    /// Optional. A unique identifier for this request. UUID is the recommended
1032    /// format, but other formats are still accepted.
1033    pub request_id: std::string::String,
1034
1035    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1036}
1037
1038impl GetStorageLayoutRequest {
1039    pub fn new() -> Self {
1040        std::default::Default::default()
1041    }
1042
1043    /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
1044    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1045        self.name = v.into();
1046        self
1047    }
1048
1049    /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
1050    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1051        self.prefix = v.into();
1052        self
1053    }
1054
1055    /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
1056    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1057        self.request_id = v.into();
1058        self
1059    }
1060}
1061
1062impl wkt::message::Message for GetStorageLayoutRequest {
1063    fn typename() -> &'static str {
1064        "type.googleapis.com/google.storage.control.v2.GetStorageLayoutRequest"
1065    }
1066}
1067
1068/// A managed folder.
1069#[derive(Clone, Default, PartialEq)]
1070#[non_exhaustive]
1071pub struct ManagedFolder {
1072    /// Identifier. The name of this managed folder.
1073    /// Format:
1074    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1075    pub name: std::string::String,
1076
1077    /// Output only. The metadata version of this managed folder. It increases
1078    /// whenever the metadata is updated. Used for preconditions and for detecting
1079    /// changes in metadata. Managed folders don't have a generation number.
1080    pub metageneration: i64,
1081
1082    /// Output only. The creation time of the managed folder.
1083    pub create_time: std::option::Option<wkt::Timestamp>,
1084
1085    /// Output only. The modification time of the managed folder.
1086    pub update_time: std::option::Option<wkt::Timestamp>,
1087
1088    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1089}
1090
1091impl ManagedFolder {
1092    pub fn new() -> Self {
1093        std::default::Default::default()
1094    }
1095
1096    /// Sets the value of [name][crate::model::ManagedFolder::name].
1097    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1098        self.name = v.into();
1099        self
1100    }
1101
1102    /// Sets the value of [metageneration][crate::model::ManagedFolder::metageneration].
1103    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
1104        self.metageneration = v.into();
1105        self
1106    }
1107
1108    /// Sets the value of [create_time][crate::model::ManagedFolder::create_time].
1109    pub fn set_create_time<T>(mut self, v: T) -> Self
1110    where
1111        T: std::convert::Into<wkt::Timestamp>,
1112    {
1113        self.create_time = std::option::Option::Some(v.into());
1114        self
1115    }
1116
1117    /// Sets or clears the value of [create_time][crate::model::ManagedFolder::create_time].
1118    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1119    where
1120        T: std::convert::Into<wkt::Timestamp>,
1121    {
1122        self.create_time = v.map(|x| x.into());
1123        self
1124    }
1125
1126    /// Sets the value of [update_time][crate::model::ManagedFolder::update_time].
1127    pub fn set_update_time<T>(mut self, v: T) -> Self
1128    where
1129        T: std::convert::Into<wkt::Timestamp>,
1130    {
1131        self.update_time = std::option::Option::Some(v.into());
1132        self
1133    }
1134
1135    /// Sets or clears the value of [update_time][crate::model::ManagedFolder::update_time].
1136    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1137    where
1138        T: std::convert::Into<wkt::Timestamp>,
1139    {
1140        self.update_time = v.map(|x| x.into());
1141        self
1142    }
1143}
1144
1145impl wkt::message::Message for ManagedFolder {
1146    fn typename() -> &'static str {
1147        "type.googleapis.com/google.storage.control.v2.ManagedFolder"
1148    }
1149}
1150
1151/// Request message for GetManagedFolder.
1152#[derive(Clone, Default, PartialEq)]
1153#[non_exhaustive]
1154pub struct GetManagedFolderRequest {
1155    /// Required. Name of the managed folder.
1156    /// Format:
1157    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1158    pub name: std::string::String,
1159
1160    /// The operation succeeds conditional on the managed folder's current
1161    /// metageneration matching the value here specified.
1162    pub if_metageneration_match: std::option::Option<i64>,
1163
1164    /// The operation succeeds conditional on the managed folder's current
1165    /// metageneration NOT matching the value here specified.
1166    pub if_metageneration_not_match: std::option::Option<i64>,
1167
1168    /// Optional. A unique identifier for this request. UUID is the recommended
1169    /// format, but other formats are still accepted.
1170    pub request_id: std::string::String,
1171
1172    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1173}
1174
1175impl GetManagedFolderRequest {
1176    pub fn new() -> Self {
1177        std::default::Default::default()
1178    }
1179
1180    /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
1181    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1182        self.name = v.into();
1183        self
1184    }
1185
1186    /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1187    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1188    where
1189        T: std::convert::Into<i64>,
1190    {
1191        self.if_metageneration_match = std::option::Option::Some(v.into());
1192        self
1193    }
1194
1195    /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
1196    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1197    where
1198        T: std::convert::Into<i64>,
1199    {
1200        self.if_metageneration_match = v.map(|x| x.into());
1201        self
1202    }
1203
1204    /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1205    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1206    where
1207        T: std::convert::Into<i64>,
1208    {
1209        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1210        self
1211    }
1212
1213    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
1214    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1215    where
1216        T: std::convert::Into<i64>,
1217    {
1218        self.if_metageneration_not_match = v.map(|x| x.into());
1219        self
1220    }
1221
1222    /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
1223    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1224        self.request_id = v.into();
1225        self
1226    }
1227}
1228
1229impl wkt::message::Message for GetManagedFolderRequest {
1230    fn typename() -> &'static str {
1231        "type.googleapis.com/google.storage.control.v2.GetManagedFolderRequest"
1232    }
1233}
1234
1235/// Request message for CreateManagedFolder.
1236#[derive(Clone, Default, PartialEq)]
1237#[non_exhaustive]
1238pub struct CreateManagedFolderRequest {
1239    /// Required. Name of the bucket this managed folder belongs to.
1240    pub parent: std::string::String,
1241
1242    /// Required. Properties of the managed folder being created.
1243    /// The bucket and managed folder names are specified in the `parent` and
1244    /// `managed_folder_id` fields. Populating these fields in `managed_folder`
1245    /// will result in an error.
1246    pub managed_folder: std::option::Option<crate::model::ManagedFolder>,
1247
1248    /// Required. The name of the managed folder. It uses a single `/` as delimiter
1249    /// and leading and trailing `/` are allowed.
1250    pub managed_folder_id: std::string::String,
1251
1252    /// Optional. A unique identifier for this request. UUID is the recommended
1253    /// format, but other formats are still accepted.
1254    pub request_id: std::string::String,
1255
1256    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1257}
1258
1259impl CreateManagedFolderRequest {
1260    pub fn new() -> Self {
1261        std::default::Default::default()
1262    }
1263
1264    /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
1265    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1266        self.parent = v.into();
1267        self
1268    }
1269
1270    /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
1271    pub fn set_managed_folder<T>(mut self, v: T) -> Self
1272    where
1273        T: std::convert::Into<crate::model::ManagedFolder>,
1274    {
1275        self.managed_folder = std::option::Option::Some(v.into());
1276        self
1277    }
1278
1279    /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
1280    pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
1281    where
1282        T: std::convert::Into<crate::model::ManagedFolder>,
1283    {
1284        self.managed_folder = v.map(|x| x.into());
1285        self
1286    }
1287
1288    /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
1289    pub fn set_managed_folder_id<T: std::convert::Into<std::string::String>>(
1290        mut self,
1291        v: T,
1292    ) -> Self {
1293        self.managed_folder_id = v.into();
1294        self
1295    }
1296
1297    /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
1298    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1299        self.request_id = v.into();
1300        self
1301    }
1302}
1303
1304impl wkt::message::Message for CreateManagedFolderRequest {
1305    fn typename() -> &'static str {
1306        "type.googleapis.com/google.storage.control.v2.CreateManagedFolderRequest"
1307    }
1308}
1309
1310/// DeleteManagedFolder RPC request message.
1311#[derive(Clone, Default, PartialEq)]
1312#[non_exhaustive]
1313pub struct DeleteManagedFolderRequest {
1314    /// Required. Name of the managed folder.
1315    /// Format:
1316    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
1317    pub name: std::string::String,
1318
1319    /// The operation succeeds conditional on the managed folder's current
1320    /// metageneration matching the value here specified.
1321    pub if_metageneration_match: std::option::Option<i64>,
1322
1323    /// The operation succeeds conditional on the managed folder's current
1324    /// metageneration NOT matching the value here specified.
1325    pub if_metageneration_not_match: std::option::Option<i64>,
1326
1327    /// Allows deletion of a managed folder even if it is not empty.
1328    /// A managed folder is empty if it manages no child managed folders or
1329    /// objects. Caller must have permission for
1330    /// storage.managedFolders.setIamPolicy.
1331    pub allow_non_empty: bool,
1332
1333    /// Optional. A unique identifier for this request. UUID is the recommended
1334    /// format, but other formats are still accepted.
1335    pub request_id: std::string::String,
1336
1337    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1338}
1339
1340impl DeleteManagedFolderRequest {
1341    pub fn new() -> Self {
1342        std::default::Default::default()
1343    }
1344
1345    /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
1346    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1347        self.name = v.into();
1348        self
1349    }
1350
1351    /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
1352    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1353    where
1354        T: std::convert::Into<i64>,
1355    {
1356        self.if_metageneration_match = std::option::Option::Some(v.into());
1357        self
1358    }
1359
1360    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
1361    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1362    where
1363        T: std::convert::Into<i64>,
1364    {
1365        self.if_metageneration_match = v.map(|x| x.into());
1366        self
1367    }
1368
1369    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
1370    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1371    where
1372        T: std::convert::Into<i64>,
1373    {
1374        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1375        self
1376    }
1377
1378    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
1379    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1380    where
1381        T: std::convert::Into<i64>,
1382    {
1383        self.if_metageneration_not_match = v.map(|x| x.into());
1384        self
1385    }
1386
1387    /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
1388    pub fn set_allow_non_empty<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1389        self.allow_non_empty = v.into();
1390        self
1391    }
1392
1393    /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
1394    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1395        self.request_id = v.into();
1396        self
1397    }
1398}
1399
1400impl wkt::message::Message for DeleteManagedFolderRequest {
1401    fn typename() -> &'static str {
1402        "type.googleapis.com/google.storage.control.v2.DeleteManagedFolderRequest"
1403    }
1404}
1405
1406/// Request message for ListManagedFolders.
1407#[derive(Clone, Default, PartialEq)]
1408#[non_exhaustive]
1409pub struct ListManagedFoldersRequest {
1410    /// Required. Name of the bucket this managed folder belongs to.
1411    pub parent: std::string::String,
1412
1413    /// Optional. Maximum number of managed folders to return in a single response.
1414    /// The service will use this parameter or 1,000 items, whichever is smaller.
1415    pub page_size: i32,
1416
1417    /// Optional. A previously-returned page token representing part of the larger
1418    /// set of results to view.
1419    pub page_token: std::string::String,
1420
1421    /// Optional. Filter results to match managed folders with name starting with
1422    /// this prefix.
1423    pub prefix: std::string::String,
1424
1425    /// Optional. A unique identifier for this request. UUID is the recommended
1426    /// format, but other formats are still accepted.
1427    pub request_id: std::string::String,
1428
1429    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1430}
1431
1432impl ListManagedFoldersRequest {
1433    pub fn new() -> Self {
1434        std::default::Default::default()
1435    }
1436
1437    /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
1438    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1439        self.parent = v.into();
1440        self
1441    }
1442
1443    /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
1444    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1445        self.page_size = v.into();
1446        self
1447    }
1448
1449    /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
1450    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1451        self.page_token = v.into();
1452        self
1453    }
1454
1455    /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
1456    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1457        self.prefix = v.into();
1458        self
1459    }
1460
1461    /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
1462    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1463        self.request_id = v.into();
1464        self
1465    }
1466}
1467
1468impl wkt::message::Message for ListManagedFoldersRequest {
1469    fn typename() -> &'static str {
1470        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersRequest"
1471    }
1472}
1473
1474/// Response message for ListManagedFolders.
1475#[derive(Clone, Default, PartialEq)]
1476#[non_exhaustive]
1477pub struct ListManagedFoldersResponse {
1478    /// The list of matching managed folders
1479    pub managed_folders: std::vec::Vec<crate::model::ManagedFolder>,
1480
1481    /// The continuation token, used to page through large result sets. Provide
1482    /// this value in a subsequent request to return the next page of results.
1483    pub next_page_token: std::string::String,
1484
1485    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1486}
1487
1488impl ListManagedFoldersResponse {
1489    pub fn new() -> Self {
1490        std::default::Default::default()
1491    }
1492
1493    /// Sets the value of [managed_folders][crate::model::ListManagedFoldersResponse::managed_folders].
1494    pub fn set_managed_folders<T, V>(mut self, v: T) -> Self
1495    where
1496        T: std::iter::IntoIterator<Item = V>,
1497        V: std::convert::Into<crate::model::ManagedFolder>,
1498    {
1499        use std::iter::Iterator;
1500        self.managed_folders = v.into_iter().map(|i| i.into()).collect();
1501        self
1502    }
1503
1504    /// Sets the value of [next_page_token][crate::model::ListManagedFoldersResponse::next_page_token].
1505    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1506        self.next_page_token = v.into();
1507        self
1508    }
1509}
1510
1511impl wkt::message::Message for ListManagedFoldersResponse {
1512    fn typename() -> &'static str {
1513        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersResponse"
1514    }
1515}
1516
1517#[doc(hidden)]
1518impl gax::paginator::internal::PageableResponse for ListManagedFoldersResponse {
1519    type PageItem = crate::model::ManagedFolder;
1520
1521    fn items(self) -> std::vec::Vec<Self::PageItem> {
1522        self.managed_folders
1523    }
1524
1525    fn next_page_token(&self) -> std::string::String {
1526        use std::clone::Clone;
1527        self.next_page_token.clone()
1528    }
1529}
1530
1531/// Message returned in the metadata field of the Operation resource for
1532/// CreateAnywhereCache operations.
1533#[derive(Clone, Default, PartialEq)]
1534#[non_exhaustive]
1535pub struct CreateAnywhereCacheMetadata {
1536    /// Generic metadata for the long running operation.
1537    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1538
1539    /// Anywhere Cache ID.
1540    pub anywhere_cache_id: std::option::Option<std::string::String>,
1541
1542    /// The zone in which the cache instance is running. For example,
1543    /// us-central1-a.
1544    pub zone: std::option::Option<std::string::String>,
1545
1546    /// Anywhere Cache entry's TTL. A cache-level config that is applied to all new
1547    /// cache entries on admission. Default ttl value (24hrs) is applied if not
1548    /// specified in the create request.
1549    pub ttl: std::option::Option<wkt::Duration>,
1550
1551    /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
1552    /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
1553    /// applied if not specified in the create request.
1554    pub admission_policy: std::option::Option<std::string::String>,
1555
1556    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1557}
1558
1559impl CreateAnywhereCacheMetadata {
1560    pub fn new() -> Self {
1561        std::default::Default::default()
1562    }
1563
1564    /// Sets the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
1565    pub fn set_common_metadata<T>(mut self, v: T) -> Self
1566    where
1567        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1568    {
1569        self.common_metadata = std::option::Option::Some(v.into());
1570        self
1571    }
1572
1573    /// Sets or clears the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
1574    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1575    where
1576        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1577    {
1578        self.common_metadata = v.map(|x| x.into());
1579        self
1580    }
1581
1582    /// Sets the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
1583    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
1584    where
1585        T: std::convert::Into<std::string::String>,
1586    {
1587        self.anywhere_cache_id = std::option::Option::Some(v.into());
1588        self
1589    }
1590
1591    /// Sets or clears the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
1592    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
1593    where
1594        T: std::convert::Into<std::string::String>,
1595    {
1596        self.anywhere_cache_id = v.map(|x| x.into());
1597        self
1598    }
1599
1600    /// Sets the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
1601    pub fn set_zone<T>(mut self, v: T) -> Self
1602    where
1603        T: std::convert::Into<std::string::String>,
1604    {
1605        self.zone = std::option::Option::Some(v.into());
1606        self
1607    }
1608
1609    /// Sets or clears the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
1610    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
1611    where
1612        T: std::convert::Into<std::string::String>,
1613    {
1614        self.zone = v.map(|x| x.into());
1615        self
1616    }
1617
1618    /// Sets the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
1619    pub fn set_ttl<T>(mut self, v: T) -> Self
1620    where
1621        T: std::convert::Into<wkt::Duration>,
1622    {
1623        self.ttl = std::option::Option::Some(v.into());
1624        self
1625    }
1626
1627    /// Sets or clears the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
1628    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
1629    where
1630        T: std::convert::Into<wkt::Duration>,
1631    {
1632        self.ttl = v.map(|x| x.into());
1633        self
1634    }
1635
1636    /// Sets the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
1637    pub fn set_admission_policy<T>(mut self, v: T) -> Self
1638    where
1639        T: std::convert::Into<std::string::String>,
1640    {
1641        self.admission_policy = std::option::Option::Some(v.into());
1642        self
1643    }
1644
1645    /// Sets or clears the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
1646    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
1647    where
1648        T: std::convert::Into<std::string::String>,
1649    {
1650        self.admission_policy = v.map(|x| x.into());
1651        self
1652    }
1653}
1654
1655impl wkt::message::Message for CreateAnywhereCacheMetadata {
1656    fn typename() -> &'static str {
1657        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheMetadata"
1658    }
1659}
1660
1661/// Message returned in the metadata field of the Operation resource for
1662/// UpdateAnywhereCache operation.
1663#[derive(Clone, Default, PartialEq)]
1664#[non_exhaustive]
1665pub struct UpdateAnywhereCacheMetadata {
1666    /// Generic metadata for the long running operation.
1667    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
1668
1669    /// Anywhere Cache ID.
1670    pub anywhere_cache_id: std::option::Option<std::string::String>,
1671
1672    /// The zone in which the cache instance is running. For example,
1673    /// us-central1-a.
1674    pub zone: std::option::Option<std::string::String>,
1675
1676    /// Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that
1677    /// is applied to all new cache entries on admission. If `ttl` is pending
1678    /// update, this field equals to the new value specified in the Update request.
1679    pub ttl: std::option::Option<wkt::Duration>,
1680
1681    /// L4 Cache entry Admission Policy in kebab-case (e.g.,
1682    /// "admit-on-first-miss"). If `admission_policy` is pending
1683    /// update, this field equals to the new value specified in the Update request.
1684    pub admission_policy: std::option::Option<std::string::String>,
1685
1686    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1687}
1688
1689impl UpdateAnywhereCacheMetadata {
1690    pub fn new() -> Self {
1691        std::default::Default::default()
1692    }
1693
1694    /// Sets the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
1695    pub fn set_common_metadata<T>(mut self, v: T) -> Self
1696    where
1697        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1698    {
1699        self.common_metadata = std::option::Option::Some(v.into());
1700        self
1701    }
1702
1703    /// Sets or clears the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
1704    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
1705    where
1706        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
1707    {
1708        self.common_metadata = v.map(|x| x.into());
1709        self
1710    }
1711
1712    /// Sets the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
1713    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
1714    where
1715        T: std::convert::Into<std::string::String>,
1716    {
1717        self.anywhere_cache_id = std::option::Option::Some(v.into());
1718        self
1719    }
1720
1721    /// Sets or clears the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
1722    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
1723    where
1724        T: std::convert::Into<std::string::String>,
1725    {
1726        self.anywhere_cache_id = v.map(|x| x.into());
1727        self
1728    }
1729
1730    /// Sets the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
1731    pub fn set_zone<T>(mut self, v: T) -> Self
1732    where
1733        T: std::convert::Into<std::string::String>,
1734    {
1735        self.zone = std::option::Option::Some(v.into());
1736        self
1737    }
1738
1739    /// Sets or clears the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
1740    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
1741    where
1742        T: std::convert::Into<std::string::String>,
1743    {
1744        self.zone = v.map(|x| x.into());
1745        self
1746    }
1747
1748    /// Sets the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
1749    pub fn set_ttl<T>(mut self, v: T) -> Self
1750    where
1751        T: std::convert::Into<wkt::Duration>,
1752    {
1753        self.ttl = std::option::Option::Some(v.into());
1754        self
1755    }
1756
1757    /// Sets or clears the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
1758    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
1759    where
1760        T: std::convert::Into<wkt::Duration>,
1761    {
1762        self.ttl = v.map(|x| x.into());
1763        self
1764    }
1765
1766    /// Sets the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
1767    pub fn set_admission_policy<T>(mut self, v: T) -> Self
1768    where
1769        T: std::convert::Into<std::string::String>,
1770    {
1771        self.admission_policy = std::option::Option::Some(v.into());
1772        self
1773    }
1774
1775    /// Sets or clears the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
1776    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
1777    where
1778        T: std::convert::Into<std::string::String>,
1779    {
1780        self.admission_policy = v.map(|x| x.into());
1781        self
1782    }
1783}
1784
1785impl wkt::message::Message for UpdateAnywhereCacheMetadata {
1786    fn typename() -> &'static str {
1787        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheMetadata"
1788    }
1789}
1790
1791/// An Anywhere Cache Instance.
1792#[derive(Clone, Default, PartialEq)]
1793#[non_exhaustive]
1794pub struct AnywhereCache {
1795    /// Immutable. The resource name of this AnywhereCache.
1796    /// Format:
1797    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
1798    pub name: std::string::String,
1799
1800    /// Immutable. The zone in which the cache instance is running. For example,
1801    /// us-central1-a.
1802    pub zone: std::string::String,
1803
1804    /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
1805    /// that defines how long a cache entry can live. Default ttl value (24hrs)
1806    /// is applied if not specified in the create request. TTL must be in whole
1807    /// seconds.
1808    pub ttl: std::option::Option<wkt::Duration>,
1809
1810    /// Cache admission policy. Valid policies includes:
1811    /// `admit-on-first-miss` and `admit-on-second-miss`. Defaults to
1812    /// `admit-on-first-miss`. Default value is applied if not specified in the
1813    /// create request.
1814    pub admission_policy: std::string::String,
1815
1816    /// Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED.
1817    pub state: std::string::String,
1818
1819    /// Output only. Time when Anywhere cache instance is allocated.
1820    pub create_time: std::option::Option<wkt::Timestamp>,
1821
1822    /// Output only. Time when Anywhere cache instance is last updated, including
1823    /// creation.
1824    pub update_time: std::option::Option<wkt::Timestamp>,
1825
1826    /// Output only. True if there is an active update operation against this cache
1827    /// instance. Subsequential update requests will be rejected if this field is
1828    /// true. Output only.
1829    pub pending_update: bool,
1830
1831    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1832}
1833
1834impl AnywhereCache {
1835    pub fn new() -> Self {
1836        std::default::Default::default()
1837    }
1838
1839    /// Sets the value of [name][crate::model::AnywhereCache::name].
1840    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1841        self.name = v.into();
1842        self
1843    }
1844
1845    /// Sets the value of [zone][crate::model::AnywhereCache::zone].
1846    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1847        self.zone = v.into();
1848        self
1849    }
1850
1851    /// Sets the value of [ttl][crate::model::AnywhereCache::ttl].
1852    pub fn set_ttl<T>(mut self, v: T) -> Self
1853    where
1854        T: std::convert::Into<wkt::Duration>,
1855    {
1856        self.ttl = std::option::Option::Some(v.into());
1857        self
1858    }
1859
1860    /// Sets or clears the value of [ttl][crate::model::AnywhereCache::ttl].
1861    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
1862    where
1863        T: std::convert::Into<wkt::Duration>,
1864    {
1865        self.ttl = v.map(|x| x.into());
1866        self
1867    }
1868
1869    /// Sets the value of [admission_policy][crate::model::AnywhereCache::admission_policy].
1870    pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
1871        mut self,
1872        v: T,
1873    ) -> Self {
1874        self.admission_policy = v.into();
1875        self
1876    }
1877
1878    /// Sets the value of [state][crate::model::AnywhereCache::state].
1879    pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1880        self.state = v.into();
1881        self
1882    }
1883
1884    /// Sets the value of [create_time][crate::model::AnywhereCache::create_time].
1885    pub fn set_create_time<T>(mut self, v: T) -> Self
1886    where
1887        T: std::convert::Into<wkt::Timestamp>,
1888    {
1889        self.create_time = std::option::Option::Some(v.into());
1890        self
1891    }
1892
1893    /// Sets or clears the value of [create_time][crate::model::AnywhereCache::create_time].
1894    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
1895    where
1896        T: std::convert::Into<wkt::Timestamp>,
1897    {
1898        self.create_time = v.map(|x| x.into());
1899        self
1900    }
1901
1902    /// Sets the value of [update_time][crate::model::AnywhereCache::update_time].
1903    pub fn set_update_time<T>(mut self, v: T) -> Self
1904    where
1905        T: std::convert::Into<wkt::Timestamp>,
1906    {
1907        self.update_time = std::option::Option::Some(v.into());
1908        self
1909    }
1910
1911    /// Sets or clears the value of [update_time][crate::model::AnywhereCache::update_time].
1912    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
1913    where
1914        T: std::convert::Into<wkt::Timestamp>,
1915    {
1916        self.update_time = v.map(|x| x.into());
1917        self
1918    }
1919
1920    /// Sets the value of [pending_update][crate::model::AnywhereCache::pending_update].
1921    pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
1922        self.pending_update = v.into();
1923        self
1924    }
1925}
1926
1927impl wkt::message::Message for AnywhereCache {
1928    fn typename() -> &'static str {
1929        "type.googleapis.com/google.storage.control.v2.AnywhereCache"
1930    }
1931}
1932
1933/// Request message for CreateAnywhereCache.
1934#[derive(Clone, Default, PartialEq)]
1935#[non_exhaustive]
1936pub struct CreateAnywhereCacheRequest {
1937    /// Required. The bucket to which this cache belongs.
1938    /// Format: `projects/{project}/buckets/{bucket}`
1939    pub parent: std::string::String,
1940
1941    /// Required. Properties of the Anywhere Cache instance being created.
1942    /// The parent bucket name is specified in the `parent` field. Server uses the
1943    /// default value of `ttl` or `admission_policy` if not specified in
1944    /// request.
1945    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
1946
1947    /// Optional. A unique identifier for this request. UUID is the recommended
1948    /// format, but other formats are still accepted. This request is only
1949    /// idempotent if a `request_id` is provided.
1950    pub request_id: std::string::String,
1951
1952    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1953}
1954
1955impl CreateAnywhereCacheRequest {
1956    pub fn new() -> Self {
1957        std::default::Default::default()
1958    }
1959
1960    /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
1961    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1962        self.parent = v.into();
1963        self
1964    }
1965
1966    /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
1967    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
1968    where
1969        T: std::convert::Into<crate::model::AnywhereCache>,
1970    {
1971        self.anywhere_cache = std::option::Option::Some(v.into());
1972        self
1973    }
1974
1975    /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
1976    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
1977    where
1978        T: std::convert::Into<crate::model::AnywhereCache>,
1979    {
1980        self.anywhere_cache = v.map(|x| x.into());
1981        self
1982    }
1983
1984    /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
1985    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1986        self.request_id = v.into();
1987        self
1988    }
1989}
1990
1991impl wkt::message::Message for CreateAnywhereCacheRequest {
1992    fn typename() -> &'static str {
1993        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheRequest"
1994    }
1995}
1996
1997/// Request message for UpdateAnywhereCache.
1998#[derive(Clone, Default, PartialEq)]
1999#[non_exhaustive]
2000pub struct UpdateAnywhereCacheRequest {
2001    /// Required. The Anywhere Cache instance to be updated.
2002    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
2003
2004    /// Required. List of fields to be updated. Mutable fields of AnywhereCache
2005    /// include `ttl` and `admission_policy`.
2006    ///
2007    /// To specify ALL fields, specify a single field with the value `*`. Note: We
2008    /// recommend against doing this. If a new field is introduced at a later time,
2009    /// an older client updating with the `*` may accidentally reset the new
2010    /// field's value.
2011    ///
2012    /// Not specifying any fields is an error.
2013    pub update_mask: std::option::Option<wkt::FieldMask>,
2014
2015    /// Optional. A unique identifier for this request. UUID is the recommended
2016    /// format, but other formats are still accepted. This request is only
2017    /// idempotent if a `request_id` is provided.
2018    pub request_id: std::string::String,
2019
2020    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2021}
2022
2023impl UpdateAnywhereCacheRequest {
2024    pub fn new() -> Self {
2025        std::default::Default::default()
2026    }
2027
2028    /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
2029    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
2030    where
2031        T: std::convert::Into<crate::model::AnywhereCache>,
2032    {
2033        self.anywhere_cache = std::option::Option::Some(v.into());
2034        self
2035    }
2036
2037    /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
2038    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
2039    where
2040        T: std::convert::Into<crate::model::AnywhereCache>,
2041    {
2042        self.anywhere_cache = v.map(|x| x.into());
2043        self
2044    }
2045
2046    /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
2047    pub fn set_update_mask<T>(mut self, v: T) -> Self
2048    where
2049        T: std::convert::Into<wkt::FieldMask>,
2050    {
2051        self.update_mask = std::option::Option::Some(v.into());
2052        self
2053    }
2054
2055    /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
2056    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2057    where
2058        T: std::convert::Into<wkt::FieldMask>,
2059    {
2060        self.update_mask = v.map(|x| x.into());
2061        self
2062    }
2063
2064    /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
2065    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2066        self.request_id = v.into();
2067        self
2068    }
2069}
2070
2071impl wkt::message::Message for UpdateAnywhereCacheRequest {
2072    fn typename() -> &'static str {
2073        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheRequest"
2074    }
2075}
2076
2077/// Request message for DisableAnywhereCache.
2078#[derive(Clone, Default, PartialEq)]
2079#[non_exhaustive]
2080pub struct DisableAnywhereCacheRequest {
2081    /// Required. The name field in the request should be:
2082    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
2083    pub name: std::string::String,
2084
2085    /// Optional. A unique identifier for this request. UUID is the recommended
2086    /// format, but other formats are still accepted. This request is only
2087    /// idempotent if a `request_id` is provided.
2088    pub request_id: std::string::String,
2089
2090    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2091}
2092
2093impl DisableAnywhereCacheRequest {
2094    pub fn new() -> Self {
2095        std::default::Default::default()
2096    }
2097
2098    /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
2099    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2100        self.name = v.into();
2101        self
2102    }
2103
2104    /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
2105    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2106        self.request_id = v.into();
2107        self
2108    }
2109}
2110
2111impl wkt::message::Message for DisableAnywhereCacheRequest {
2112    fn typename() -> &'static str {
2113        "type.googleapis.com/google.storage.control.v2.DisableAnywhereCacheRequest"
2114    }
2115}
2116
2117/// Request message for PauseAnywhereCache.
2118#[derive(Clone, Default, PartialEq)]
2119#[non_exhaustive]
2120pub struct PauseAnywhereCacheRequest {
2121    /// Required. The name field in the request should be:
2122    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
2123    pub name: std::string::String,
2124
2125    /// Optional. A unique identifier for this request. UUID is the recommended
2126    /// format, but other formats are still accepted. This request is only
2127    /// idempotent if a `request_id` is provided.
2128    pub request_id: std::string::String,
2129
2130    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2131}
2132
2133impl PauseAnywhereCacheRequest {
2134    pub fn new() -> Self {
2135        std::default::Default::default()
2136    }
2137
2138    /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
2139    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2140        self.name = v.into();
2141        self
2142    }
2143
2144    /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
2145    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2146        self.request_id = v.into();
2147        self
2148    }
2149}
2150
2151impl wkt::message::Message for PauseAnywhereCacheRequest {
2152    fn typename() -> &'static str {
2153        "type.googleapis.com/google.storage.control.v2.PauseAnywhereCacheRequest"
2154    }
2155}
2156
2157/// Request message for ResumeAnywhereCache.
2158#[derive(Clone, Default, PartialEq)]
2159#[non_exhaustive]
2160pub struct ResumeAnywhereCacheRequest {
2161    /// Required. The name field in the request should be:
2162    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
2163    pub name: std::string::String,
2164
2165    /// Optional. A unique identifier for this request. UUID is the recommended
2166    /// format, but other formats are still accepted. This request is only
2167    /// idempotent if a `request_id` is provided.
2168    pub request_id: std::string::String,
2169
2170    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2171}
2172
2173impl ResumeAnywhereCacheRequest {
2174    pub fn new() -> Self {
2175        std::default::Default::default()
2176    }
2177
2178    /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
2179    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2180        self.name = v.into();
2181        self
2182    }
2183
2184    /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
2185    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2186        self.request_id = v.into();
2187        self
2188    }
2189}
2190
2191impl wkt::message::Message for ResumeAnywhereCacheRequest {
2192    fn typename() -> &'static str {
2193        "type.googleapis.com/google.storage.control.v2.ResumeAnywhereCacheRequest"
2194    }
2195}
2196
2197/// Request message for GetAnywhereCache.
2198#[derive(Clone, Default, PartialEq)]
2199#[non_exhaustive]
2200pub struct GetAnywhereCacheRequest {
2201    /// Required. The name field in the request should be:
2202    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
2203    pub name: std::string::String,
2204
2205    /// Optional. A unique identifier for this request. UUID is the recommended
2206    /// format, but other formats are still accepted.
2207    pub request_id: std::string::String,
2208
2209    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2210}
2211
2212impl GetAnywhereCacheRequest {
2213    pub fn new() -> Self {
2214        std::default::Default::default()
2215    }
2216
2217    /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
2218    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2219        self.name = v.into();
2220        self
2221    }
2222
2223    /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
2224    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2225        self.request_id = v.into();
2226        self
2227    }
2228}
2229
2230impl wkt::message::Message for GetAnywhereCacheRequest {
2231    fn typename() -> &'static str {
2232        "type.googleapis.com/google.storage.control.v2.GetAnywhereCacheRequest"
2233    }
2234}
2235
2236/// Request message for ListAnywhereCaches.
2237#[derive(Clone, Default, PartialEq)]
2238#[non_exhaustive]
2239pub struct ListAnywhereCachesRequest {
2240    /// Required. The bucket to which this cache belongs.
2241    pub parent: std::string::String,
2242
2243    /// Maximum number of caches to return in a single response.
2244    /// The service will use this parameter or 1,000 items, whichever is smaller.
2245    pub page_size: i32,
2246
2247    /// A previously-returned page token representing part of the larger set of
2248    /// results to view.
2249    pub page_token: std::string::String,
2250
2251    /// Optional. A unique identifier for this request. UUID is the recommended
2252    /// format, but other formats are still accepted.
2253    pub request_id: std::string::String,
2254
2255    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2256}
2257
2258impl ListAnywhereCachesRequest {
2259    pub fn new() -> Self {
2260        std::default::Default::default()
2261    }
2262
2263    /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
2264    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2265        self.parent = v.into();
2266        self
2267    }
2268
2269    /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
2270    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2271        self.page_size = v.into();
2272        self
2273    }
2274
2275    /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
2276    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2277        self.page_token = v.into();
2278        self
2279    }
2280
2281    /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
2282    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2283        self.request_id = v.into();
2284        self
2285    }
2286}
2287
2288impl wkt::message::Message for ListAnywhereCachesRequest {
2289    fn typename() -> &'static str {
2290        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesRequest"
2291    }
2292}
2293
2294/// Response message for ListAnywhereCaches.
2295#[derive(Clone, Default, PartialEq)]
2296#[non_exhaustive]
2297pub struct ListAnywhereCachesResponse {
2298    /// The list of items.
2299    pub anywhere_caches: std::vec::Vec<crate::model::AnywhereCache>,
2300
2301    /// A token, which can be sent as `page_token` to retrieve the next page.
2302    /// If this field is omitted, there are no subsequent pages.
2303    pub next_page_token: std::string::String,
2304
2305    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2306}
2307
2308impl ListAnywhereCachesResponse {
2309    pub fn new() -> Self {
2310        std::default::Default::default()
2311    }
2312
2313    /// Sets the value of [anywhere_caches][crate::model::ListAnywhereCachesResponse::anywhere_caches].
2314    pub fn set_anywhere_caches<T, V>(mut self, v: T) -> Self
2315    where
2316        T: std::iter::IntoIterator<Item = V>,
2317        V: std::convert::Into<crate::model::AnywhereCache>,
2318    {
2319        use std::iter::Iterator;
2320        self.anywhere_caches = v.into_iter().map(|i| i.into()).collect();
2321        self
2322    }
2323
2324    /// Sets the value of [next_page_token][crate::model::ListAnywhereCachesResponse::next_page_token].
2325    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2326        self.next_page_token = v.into();
2327        self
2328    }
2329}
2330
2331impl wkt::message::Message for ListAnywhereCachesResponse {
2332    fn typename() -> &'static str {
2333        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesResponse"
2334    }
2335}
2336
2337#[doc(hidden)]
2338impl gax::paginator::internal::PageableResponse for ListAnywhereCachesResponse {
2339    type PageItem = crate::model::AnywhereCache;
2340
2341    fn items(self) -> std::vec::Vec<Self::PageItem> {
2342        self.anywhere_caches
2343    }
2344
2345    fn next_page_token(&self) -> std::string::String {
2346        use std::clone::Clone;
2347        self.next_page_token.clone()
2348    }
2349}
2350
2351/// The `IntelligenceConfig` resource associated with your organization, folder,
2352/// or project.
2353#[derive(Clone, Default, PartialEq)]
2354#[non_exhaustive]
2355pub struct IntelligenceConfig {
2356    /// Identifier. The name of the `IntelligenceConfig` resource associated with
2357    /// your organization, folder, or project.
2358    ///
2359    /// The name format varies based on the GCP resource hierarchy as follows:
2360    ///
2361    /// * For project:
2362    ///   `projects/{project_number}/locations/global/intelligenceConfig`
2363    /// * For organization:
2364    ///   `organizations/{org_id}/locations/global/intelligenceConfig`
2365    /// * For folder: `folders/{folder_id}/locations/global/intelligenceConfig`
2366    pub name: std::string::String,
2367
2368    /// Optional. The edition configuration of the `IntelligenceConfig` resource.
2369    pub edition_config: crate::model::intelligence_config::EditionConfig,
2370
2371    /// Output only. The time at which the `IntelligenceConfig` resource is last
2372    /// updated.
2373    pub update_time: std::option::Option<wkt::Timestamp>,
2374
2375    /// Optional. Filter over location and bucket.
2376    pub filter: std::option::Option<crate::model::intelligence_config::Filter>,
2377
2378    /// Output only. The `IntelligenceConfig` resource that is applicable for the
2379    /// resource.
2380    pub effective_intelligence_config:
2381        std::option::Option<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
2382
2383    /// The trial configuration of the `IntelligenceConfig` resource.
2384    pub trial_config: std::option::Option<crate::model::intelligence_config::TrialConfig>,
2385
2386    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2387}
2388
2389impl IntelligenceConfig {
2390    pub fn new() -> Self {
2391        std::default::Default::default()
2392    }
2393
2394    /// Sets the value of [name][crate::model::IntelligenceConfig::name].
2395    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2396        self.name = v.into();
2397        self
2398    }
2399
2400    /// Sets the value of [edition_config][crate::model::IntelligenceConfig::edition_config].
2401    pub fn set_edition_config<
2402        T: std::convert::Into<crate::model::intelligence_config::EditionConfig>,
2403    >(
2404        mut self,
2405        v: T,
2406    ) -> Self {
2407        self.edition_config = v.into();
2408        self
2409    }
2410
2411    /// Sets the value of [update_time][crate::model::IntelligenceConfig::update_time].
2412    pub fn set_update_time<T>(mut self, v: T) -> Self
2413    where
2414        T: std::convert::Into<wkt::Timestamp>,
2415    {
2416        self.update_time = std::option::Option::Some(v.into());
2417        self
2418    }
2419
2420    /// Sets or clears the value of [update_time][crate::model::IntelligenceConfig::update_time].
2421    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2422    where
2423        T: std::convert::Into<wkt::Timestamp>,
2424    {
2425        self.update_time = v.map(|x| x.into());
2426        self
2427    }
2428
2429    /// Sets the value of [filter][crate::model::IntelligenceConfig::filter].
2430    pub fn set_filter<T>(mut self, v: T) -> Self
2431    where
2432        T: std::convert::Into<crate::model::intelligence_config::Filter>,
2433    {
2434        self.filter = std::option::Option::Some(v.into());
2435        self
2436    }
2437
2438    /// Sets or clears the value of [filter][crate::model::IntelligenceConfig::filter].
2439    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
2440    where
2441        T: std::convert::Into<crate::model::intelligence_config::Filter>,
2442    {
2443        self.filter = v.map(|x| x.into());
2444        self
2445    }
2446
2447    /// Sets the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
2448    pub fn set_effective_intelligence_config<T>(mut self, v: T) -> Self
2449    where
2450        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
2451    {
2452        self.effective_intelligence_config = std::option::Option::Some(v.into());
2453        self
2454    }
2455
2456    /// Sets or clears the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
2457    pub fn set_or_clear_effective_intelligence_config<T>(
2458        mut self,
2459        v: std::option::Option<T>,
2460    ) -> Self
2461    where
2462        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
2463    {
2464        self.effective_intelligence_config = v.map(|x| x.into());
2465        self
2466    }
2467
2468    /// Sets the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
2469    pub fn set_trial_config<T>(mut self, v: T) -> Self
2470    where
2471        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
2472    {
2473        self.trial_config = std::option::Option::Some(v.into());
2474        self
2475    }
2476
2477    /// Sets or clears the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
2478    pub fn set_or_clear_trial_config<T>(mut self, v: std::option::Option<T>) -> Self
2479    where
2480        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
2481    {
2482        self.trial_config = v.map(|x| x.into());
2483        self
2484    }
2485}
2486
2487impl wkt::message::Message for IntelligenceConfig {
2488    fn typename() -> &'static str {
2489        "type.googleapis.com/google.storage.control.v2.IntelligenceConfig"
2490    }
2491}
2492
2493/// Defines additional types related to [IntelligenceConfig].
2494pub mod intelligence_config {
2495    #[allow(unused_imports)]
2496    use super::*;
2497
2498    /// Filter over location and bucket using include or exclude semantics.
2499    /// Resources that match the include or exclude filter are exclusively included
2500    /// or excluded from the Storage Intelligence plan.
2501    #[derive(Clone, Default, PartialEq)]
2502    #[non_exhaustive]
2503    pub struct Filter {
2504        /// Bucket locations to include or exclude.
2505        pub cloud_storage_locations: std::option::Option<
2506            crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
2507        >,
2508
2509        /// Buckets to include or exclude.
2510        pub cloud_storage_buckets: std::option::Option<
2511            crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
2512        >,
2513
2514        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2515    }
2516
2517    impl Filter {
2518        pub fn new() -> Self {
2519            std::default::Default::default()
2520        }
2521
2522        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations].
2523        ///
2524        /// Note that all the setters affecting `cloud_storage_locations` are mutually
2525        /// exclusive.
2526        pub fn set_cloud_storage_locations<
2527            T: std::convert::Into<
2528                    std::option::Option<
2529                        crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
2530                    >,
2531                >,
2532        >(
2533            mut self,
2534            v: T,
2535        ) -> Self {
2536            self.cloud_storage_locations = v.into();
2537            self
2538        }
2539
2540        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
2541        /// if it holds a `IncludedCloudStorageLocations`, `None` if the field is not set or
2542        /// holds a different branch.
2543        pub fn included_cloud_storage_locations(
2544            &self,
2545        ) -> std::option::Option<
2546            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
2547        > {
2548            #[allow(unreachable_patterns)]
2549            self.cloud_storage_locations.as_ref().and_then(|v| match v {
2550                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(v) => std::option::Option::Some(v),
2551                _ => std::option::Option::None,
2552            })
2553        }
2554
2555        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
2556        /// to hold a `IncludedCloudStorageLocations`.
2557        ///
2558        /// Note that all the setters affecting `cloud_storage_locations` are
2559        /// mutually exclusive.
2560        pub fn set_included_cloud_storage_locations<
2561            T: std::convert::Into<
2562                    std::boxed::Box<
2563                        crate::model::intelligence_config::filter::CloudStorageLocations,
2564                    >,
2565                >,
2566        >(
2567            mut self,
2568            v: T,
2569        ) -> Self {
2570            self.cloud_storage_locations = std::option::Option::Some(
2571                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
2572                    v.into()
2573                )
2574            );
2575            self
2576        }
2577
2578        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
2579        /// if it holds a `ExcludedCloudStorageLocations`, `None` if the field is not set or
2580        /// holds a different branch.
2581        pub fn excluded_cloud_storage_locations(
2582            &self,
2583        ) -> std::option::Option<
2584            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
2585        > {
2586            #[allow(unreachable_patterns)]
2587            self.cloud_storage_locations.as_ref().and_then(|v| match v {
2588                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(v) => std::option::Option::Some(v),
2589                _ => std::option::Option::None,
2590            })
2591        }
2592
2593        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
2594        /// to hold a `ExcludedCloudStorageLocations`.
2595        ///
2596        /// Note that all the setters affecting `cloud_storage_locations` are
2597        /// mutually exclusive.
2598        pub fn set_excluded_cloud_storage_locations<
2599            T: std::convert::Into<
2600                    std::boxed::Box<
2601                        crate::model::intelligence_config::filter::CloudStorageLocations,
2602                    >,
2603                >,
2604        >(
2605            mut self,
2606            v: T,
2607        ) -> Self {
2608            self.cloud_storage_locations = std::option::Option::Some(
2609                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
2610                    v.into()
2611                )
2612            );
2613            self
2614        }
2615
2616        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets].
2617        ///
2618        /// Note that all the setters affecting `cloud_storage_buckets` are mutually
2619        /// exclusive.
2620        pub fn set_cloud_storage_buckets<
2621            T: std::convert::Into<
2622                    std::option::Option<
2623                        crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
2624                    >,
2625                >,
2626        >(
2627            mut self,
2628            v: T,
2629        ) -> Self {
2630            self.cloud_storage_buckets = v.into();
2631            self
2632        }
2633
2634        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
2635        /// if it holds a `IncludedCloudStorageBuckets`, `None` if the field is not set or
2636        /// holds a different branch.
2637        pub fn included_cloud_storage_buckets(
2638            &self,
2639        ) -> std::option::Option<
2640            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
2641        > {
2642            #[allow(unreachable_patterns)]
2643            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
2644                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(v) => std::option::Option::Some(v),
2645                _ => std::option::Option::None,
2646            })
2647        }
2648
2649        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
2650        /// to hold a `IncludedCloudStorageBuckets`.
2651        ///
2652        /// Note that all the setters affecting `cloud_storage_buckets` are
2653        /// mutually exclusive.
2654        pub fn set_included_cloud_storage_buckets<
2655            T: std::convert::Into<
2656                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
2657                >,
2658        >(
2659            mut self,
2660            v: T,
2661        ) -> Self {
2662            self.cloud_storage_buckets = std::option::Option::Some(
2663                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
2664                    v.into()
2665                )
2666            );
2667            self
2668        }
2669
2670        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
2671        /// if it holds a `ExcludedCloudStorageBuckets`, `None` if the field is not set or
2672        /// holds a different branch.
2673        pub fn excluded_cloud_storage_buckets(
2674            &self,
2675        ) -> std::option::Option<
2676            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
2677        > {
2678            #[allow(unreachable_patterns)]
2679            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
2680                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(v) => std::option::Option::Some(v),
2681                _ => std::option::Option::None,
2682            })
2683        }
2684
2685        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
2686        /// to hold a `ExcludedCloudStorageBuckets`.
2687        ///
2688        /// Note that all the setters affecting `cloud_storage_buckets` are
2689        /// mutually exclusive.
2690        pub fn set_excluded_cloud_storage_buckets<
2691            T: std::convert::Into<
2692                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
2693                >,
2694        >(
2695            mut self,
2696            v: T,
2697        ) -> Self {
2698            self.cloud_storage_buckets = std::option::Option::Some(
2699                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
2700                    v.into()
2701                )
2702            );
2703            self
2704        }
2705    }
2706
2707    impl wkt::message::Message for Filter {
2708        fn typename() -> &'static str {
2709            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter"
2710        }
2711    }
2712
2713    /// Defines additional types related to [Filter].
2714    pub mod filter {
2715        #[allow(unused_imports)]
2716        use super::*;
2717
2718        /// Collection of bucket locations.
2719        #[derive(Clone, Default, PartialEq)]
2720        #[non_exhaustive]
2721        pub struct CloudStorageLocations {
2722            /// Optional. Bucket locations. Location can be any of the Cloud Storage
2723            /// regions specified in lower case format. For example, `us-east1`,
2724            /// `us-west1`.
2725            pub locations: std::vec::Vec<std::string::String>,
2726
2727            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2728        }
2729
2730        impl CloudStorageLocations {
2731            pub fn new() -> Self {
2732                std::default::Default::default()
2733            }
2734
2735            /// Sets the value of [locations][crate::model::intelligence_config::filter::CloudStorageLocations::locations].
2736            pub fn set_locations<T, V>(mut self, v: T) -> Self
2737            where
2738                T: std::iter::IntoIterator<Item = V>,
2739                V: std::convert::Into<std::string::String>,
2740            {
2741                use std::iter::Iterator;
2742                self.locations = v.into_iter().map(|i| i.into()).collect();
2743                self
2744            }
2745        }
2746
2747        impl wkt::message::Message for CloudStorageLocations {
2748            fn typename() -> &'static str {
2749                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"
2750            }
2751        }
2752
2753        /// Collection of buckets.
2754        #[derive(Clone, Default, PartialEq)]
2755        #[non_exhaustive]
2756        pub struct CloudStorageBuckets {
2757            /// Optional. A regex pattern for matching bucket names. Regex should
2758            /// follow the syntax specified in
2759            /// [google/re2](https://github.com/google/re2). For example,
2760            /// `^sample_.*` matches all buckets of the form
2761            /// `gs://sample_bucket-1`, `gs://sample_bucket-2`,
2762            /// `gs://sample_bucket-n` but not `gs://test_sample_bucket`.
2763            /// If you want to match a single bucket, say `gs://sample_bucket`,
2764            /// use `sample_bucket`.
2765            pub bucket_id_regexes: std::vec::Vec<std::string::String>,
2766
2767            pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2768        }
2769
2770        impl CloudStorageBuckets {
2771            pub fn new() -> Self {
2772                std::default::Default::default()
2773            }
2774
2775            /// Sets the value of [bucket_id_regexes][crate::model::intelligence_config::filter::CloudStorageBuckets::bucket_id_regexes].
2776            pub fn set_bucket_id_regexes<T, V>(mut self, v: T) -> Self
2777            where
2778                T: std::iter::IntoIterator<Item = V>,
2779                V: std::convert::Into<std::string::String>,
2780            {
2781                use std::iter::Iterator;
2782                self.bucket_id_regexes = v.into_iter().map(|i| i.into()).collect();
2783                self
2784            }
2785        }
2786
2787        impl wkt::message::Message for CloudStorageBuckets {
2788            fn typename() -> &'static str {
2789                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"
2790            }
2791        }
2792
2793        /// Bucket locations to include or exclude.
2794        #[derive(Clone, Debug, PartialEq)]
2795        #[non_exhaustive]
2796        pub enum CloudStorageLocationsOneOf {
2797            /// Bucket locations to include.
2798            IncludedCloudStorageLocations(
2799                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
2800            ),
2801            /// Bucket locations to exclude.
2802            ExcludedCloudStorageLocations(
2803                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
2804            ),
2805        }
2806
2807        impl CloudStorageLocationsOneOf {
2808            /// Initializes the enum to the [IncludedCloudStorageLocations](Self::IncludedCloudStorageLocations) branch.
2809            pub fn from_included_cloud_storage_locations(
2810                value: impl std::convert::Into<
2811                    std::boxed::Box<
2812                        crate::model::intelligence_config::filter::CloudStorageLocations,
2813                    >,
2814                >,
2815            ) -> Self {
2816                Self::IncludedCloudStorageLocations(value.into())
2817            }
2818            /// Initializes the enum to the [ExcludedCloudStorageLocations](Self::ExcludedCloudStorageLocations) branch.
2819            pub fn from_excluded_cloud_storage_locations(
2820                value: impl std::convert::Into<
2821                    std::boxed::Box<
2822                        crate::model::intelligence_config::filter::CloudStorageLocations,
2823                    >,
2824                >,
2825            ) -> Self {
2826                Self::ExcludedCloudStorageLocations(value.into())
2827            }
2828        }
2829
2830        /// Buckets to include or exclude.
2831        #[derive(Clone, Debug, PartialEq)]
2832        #[non_exhaustive]
2833        pub enum CloudStorageBucketsOneOf {
2834            /// Buckets to include.
2835            IncludedCloudStorageBuckets(
2836                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
2837            ),
2838            /// Buckets to exclude.
2839            ExcludedCloudStorageBuckets(
2840                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
2841            ),
2842        }
2843
2844        impl CloudStorageBucketsOneOf {
2845            /// Initializes the enum to the [IncludedCloudStorageBuckets](Self::IncludedCloudStorageBuckets) branch.
2846            pub fn from_included_cloud_storage_buckets(
2847                value: impl std::convert::Into<
2848                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
2849                >,
2850            ) -> Self {
2851                Self::IncludedCloudStorageBuckets(value.into())
2852            }
2853            /// Initializes the enum to the [ExcludedCloudStorageBuckets](Self::ExcludedCloudStorageBuckets) branch.
2854            pub fn from_excluded_cloud_storage_buckets(
2855                value: impl std::convert::Into<
2856                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
2857                >,
2858            ) -> Self {
2859                Self::ExcludedCloudStorageBuckets(value.into())
2860            }
2861        }
2862    }
2863
2864    /// The effective `IntelligenceConfig` for the resource.
2865    #[derive(Clone, Default, PartialEq)]
2866    #[non_exhaustive]
2867    pub struct EffectiveIntelligenceConfig {
2868        /// Output only. The `IntelligenceConfig` edition that is applicable for the
2869        /// resource.
2870        pub effective_edition:
2871            crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition,
2872
2873        /// Output only. The `IntelligenceConfig` resource that is applied for the
2874        /// target resource. Format:
2875        /// `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig`
2876        pub intelligence_config: std::string::String,
2877
2878        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2879    }
2880
2881    impl EffectiveIntelligenceConfig {
2882        pub fn new() -> Self {
2883            std::default::Default::default()
2884        }
2885
2886        /// Sets the value of [effective_edition][crate::model::intelligence_config::EffectiveIntelligenceConfig::effective_edition].
2887        pub fn set_effective_edition<T: std::convert::Into<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>(mut self, v: T) -> Self{
2888            self.effective_edition = v.into();
2889            self
2890        }
2891
2892        /// Sets the value of [intelligence_config][crate::model::intelligence_config::EffectiveIntelligenceConfig::intelligence_config].
2893        pub fn set_intelligence_config<T: std::convert::Into<std::string::String>>(
2894            mut self,
2895            v: T,
2896        ) -> Self {
2897            self.intelligence_config = v.into();
2898            self
2899        }
2900    }
2901
2902    impl wkt::message::Message for EffectiveIntelligenceConfig {
2903        fn typename() -> &'static str {
2904            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"
2905        }
2906    }
2907
2908    /// Defines additional types related to [EffectiveIntelligenceConfig].
2909    pub mod effective_intelligence_config {
2910        #[allow(unused_imports)]
2911        use super::*;
2912
2913        /// The effective edition of the `IntelligenceConfig` resource.
2914        ///
2915        /// # Working with unknown values
2916        ///
2917        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
2918        /// additional enum variants at any time. Adding new variants is not considered
2919        /// a breaking change. Applications should write their code in anticipation of:
2920        ///
2921        /// - New values appearing in future releases of the client library, **and**
2922        /// - New values received dynamically, without application changes.
2923        ///
2924        /// Please consult the [Working with enums] section in the user guide for some
2925        /// guidelines.
2926        ///
2927        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
2928        #[derive(Clone, Debug, PartialEq)]
2929        #[non_exhaustive]
2930        pub enum EffectiveEdition {
2931            /// This is an unknown edition of the resource.
2932            Unspecified,
2933            /// No edition.
2934            None,
2935            /// The `IntelligenceConfig` resource is of STANDARD edition.
2936            Standard,
2937            /// If set, the enum was initialized with an unknown value.
2938            ///
2939            /// Applications can examine the value using [EffectiveEdition::value] or
2940            /// [EffectiveEdition::name].
2941            UnknownValue(effective_edition::UnknownValue),
2942        }
2943
2944        #[doc(hidden)]
2945        pub mod effective_edition {
2946            #[allow(unused_imports)]
2947            use super::*;
2948            #[derive(Clone, Debug, PartialEq)]
2949            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
2950        }
2951
2952        impl EffectiveEdition {
2953            /// Gets the enum value.
2954            ///
2955            /// Returns `None` if the enum contains an unknown value deserialized from
2956            /// the string representation of enums.
2957            pub fn value(&self) -> std::option::Option<i32> {
2958                match self {
2959                    Self::Unspecified => std::option::Option::Some(0),
2960                    Self::None => std::option::Option::Some(1),
2961                    Self::Standard => std::option::Option::Some(2),
2962                    Self::UnknownValue(u) => u.0.value(),
2963                }
2964            }
2965
2966            /// Gets the enum value as a string.
2967            ///
2968            /// Returns `None` if the enum contains an unknown value deserialized from
2969            /// the integer representation of enums.
2970            pub fn name(&self) -> std::option::Option<&str> {
2971                match self {
2972                    Self::Unspecified => std::option::Option::Some("EFFECTIVE_EDITION_UNSPECIFIED"),
2973                    Self::None => std::option::Option::Some("NONE"),
2974                    Self::Standard => std::option::Option::Some("STANDARD"),
2975                    Self::UnknownValue(u) => u.0.name(),
2976                }
2977            }
2978        }
2979
2980        impl std::default::Default for EffectiveEdition {
2981            fn default() -> Self {
2982                use std::convert::From;
2983                Self::from(0)
2984            }
2985        }
2986
2987        impl std::fmt::Display for EffectiveEdition {
2988            fn fmt(
2989                &self,
2990                f: &mut std::fmt::Formatter<'_>,
2991            ) -> std::result::Result<(), std::fmt::Error> {
2992                wkt::internal::display_enum(f, self.name(), self.value())
2993            }
2994        }
2995
2996        impl std::convert::From<i32> for EffectiveEdition {
2997            fn from(value: i32) -> Self {
2998                match value {
2999                    0 => Self::Unspecified,
3000                    1 => Self::None,
3001                    2 => Self::Standard,
3002                    _ => Self::UnknownValue(effective_edition::UnknownValue(
3003                        wkt::internal::UnknownEnumValue::Integer(value),
3004                    )),
3005                }
3006            }
3007        }
3008
3009        impl std::convert::From<&str> for EffectiveEdition {
3010            fn from(value: &str) -> Self {
3011                use std::string::ToString;
3012                match value {
3013                    "EFFECTIVE_EDITION_UNSPECIFIED" => Self::Unspecified,
3014                    "NONE" => Self::None,
3015                    "STANDARD" => Self::Standard,
3016                    _ => Self::UnknownValue(effective_edition::UnknownValue(
3017                        wkt::internal::UnknownEnumValue::String(value.to_string()),
3018                    )),
3019                }
3020            }
3021        }
3022
3023        impl serde::ser::Serialize for EffectiveEdition {
3024            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3025            where
3026                S: serde::Serializer,
3027            {
3028                match self {
3029                    Self::Unspecified => serializer.serialize_i32(0),
3030                    Self::None => serializer.serialize_i32(1),
3031                    Self::Standard => serializer.serialize_i32(2),
3032                    Self::UnknownValue(u) => u.0.serialize(serializer),
3033                }
3034            }
3035        }
3036
3037        impl<'de> serde::de::Deserialize<'de> for EffectiveEdition {
3038            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3039            where
3040                D: serde::Deserializer<'de>,
3041            {
3042                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveEdition>::new(
3043                    ".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition"))
3044            }
3045        }
3046    }
3047
3048    /// The trial configuration of the `IntelligenceConfig` resource.
3049    #[derive(Clone, Default, PartialEq)]
3050    #[non_exhaustive]
3051    pub struct TrialConfig {
3052        /// Output only. The time at which the trial expires.
3053        pub expire_time: std::option::Option<wkt::Timestamp>,
3054
3055        pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3056    }
3057
3058    impl TrialConfig {
3059        pub fn new() -> Self {
3060            std::default::Default::default()
3061        }
3062
3063        /// Sets the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
3064        pub fn set_expire_time<T>(mut self, v: T) -> Self
3065        where
3066            T: std::convert::Into<wkt::Timestamp>,
3067        {
3068            self.expire_time = std::option::Option::Some(v.into());
3069            self
3070        }
3071
3072        /// Sets or clears the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
3073        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
3074        where
3075            T: std::convert::Into<wkt::Timestamp>,
3076        {
3077            self.expire_time = v.map(|x| x.into());
3078            self
3079        }
3080    }
3081
3082    impl wkt::message::Message for TrialConfig {
3083        fn typename() -> &'static str {
3084            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.TrialConfig"
3085        }
3086    }
3087
3088    /// The edition configuration of the `IntelligenceConfig` resource. This
3089    /// signifies the edition used for configuring the `IntelligenceConfig`
3090    /// resource and can only take the following values:
3091    /// `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and
3092    /// `TRIAL`.
3093    ///
3094    /// # Working with unknown values
3095    ///
3096    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
3097    /// additional enum variants at any time. Adding new variants is not considered
3098    /// a breaking change. Applications should write their code in anticipation of:
3099    ///
3100    /// - New values appearing in future releases of the client library, **and**
3101    /// - New values received dynamically, without application changes.
3102    ///
3103    /// Please consult the [Working with enums] section in the user guide for some
3104    /// guidelines.
3105    ///
3106    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
3107    #[derive(Clone, Debug, PartialEq)]
3108    #[non_exhaustive]
3109    pub enum EditionConfig {
3110        /// This is an unknown edition of the resource.
3111        Unspecified,
3112        /// The inherited edition from the parent and filters. This is the default
3113        /// edition when there is no `IntelligenceConfig` setup for a GCP resource.
3114        Inherit,
3115        /// The edition configuration is disabled for the `IntelligenceConfig`
3116        /// resource and its children. Filters are not applicable.
3117        Disabled,
3118        /// The `IntelligenceConfig` resource is of STANDARD edition.
3119        Standard,
3120        /// The `IntelligenceConfig` resource is available in `TRIAL` edition. During
3121        /// the trial period, Cloud Storage does not charge for Storage Intelligence
3122        /// usage. You can specify the buckets to include in the trial period by
3123        /// using filters. At the end of the trial period, the `IntelligenceConfig`
3124        /// resource is upgraded to `STANDARD` edition.
3125        Trial,
3126        /// If set, the enum was initialized with an unknown value.
3127        ///
3128        /// Applications can examine the value using [EditionConfig::value] or
3129        /// [EditionConfig::name].
3130        UnknownValue(edition_config::UnknownValue),
3131    }
3132
3133    #[doc(hidden)]
3134    pub mod edition_config {
3135        #[allow(unused_imports)]
3136        use super::*;
3137        #[derive(Clone, Debug, PartialEq)]
3138        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
3139    }
3140
3141    impl EditionConfig {
3142        /// Gets the enum value.
3143        ///
3144        /// Returns `None` if the enum contains an unknown value deserialized from
3145        /// the string representation of enums.
3146        pub fn value(&self) -> std::option::Option<i32> {
3147            match self {
3148                Self::Unspecified => std::option::Option::Some(0),
3149                Self::Inherit => std::option::Option::Some(1),
3150                Self::Disabled => std::option::Option::Some(2),
3151                Self::Standard => std::option::Option::Some(3),
3152                Self::Trial => std::option::Option::Some(5),
3153                Self::UnknownValue(u) => u.0.value(),
3154            }
3155        }
3156
3157        /// Gets the enum value as a string.
3158        ///
3159        /// Returns `None` if the enum contains an unknown value deserialized from
3160        /// the integer representation of enums.
3161        pub fn name(&self) -> std::option::Option<&str> {
3162            match self {
3163                Self::Unspecified => std::option::Option::Some("EDITION_CONFIG_UNSPECIFIED"),
3164                Self::Inherit => std::option::Option::Some("INHERIT"),
3165                Self::Disabled => std::option::Option::Some("DISABLED"),
3166                Self::Standard => std::option::Option::Some("STANDARD"),
3167                Self::Trial => std::option::Option::Some("TRIAL"),
3168                Self::UnknownValue(u) => u.0.name(),
3169            }
3170        }
3171    }
3172
3173    impl std::default::Default for EditionConfig {
3174        fn default() -> Self {
3175            use std::convert::From;
3176            Self::from(0)
3177        }
3178    }
3179
3180    impl std::fmt::Display for EditionConfig {
3181        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
3182            wkt::internal::display_enum(f, self.name(), self.value())
3183        }
3184    }
3185
3186    impl std::convert::From<i32> for EditionConfig {
3187        fn from(value: i32) -> Self {
3188            match value {
3189                0 => Self::Unspecified,
3190                1 => Self::Inherit,
3191                2 => Self::Disabled,
3192                3 => Self::Standard,
3193                5 => Self::Trial,
3194                _ => Self::UnknownValue(edition_config::UnknownValue(
3195                    wkt::internal::UnknownEnumValue::Integer(value),
3196                )),
3197            }
3198        }
3199    }
3200
3201    impl std::convert::From<&str> for EditionConfig {
3202        fn from(value: &str) -> Self {
3203            use std::string::ToString;
3204            match value {
3205                "EDITION_CONFIG_UNSPECIFIED" => Self::Unspecified,
3206                "INHERIT" => Self::Inherit,
3207                "DISABLED" => Self::Disabled,
3208                "STANDARD" => Self::Standard,
3209                "TRIAL" => Self::Trial,
3210                _ => Self::UnknownValue(edition_config::UnknownValue(
3211                    wkt::internal::UnknownEnumValue::String(value.to_string()),
3212                )),
3213            }
3214        }
3215    }
3216
3217    impl serde::ser::Serialize for EditionConfig {
3218        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3219        where
3220            S: serde::Serializer,
3221        {
3222            match self {
3223                Self::Unspecified => serializer.serialize_i32(0),
3224                Self::Inherit => serializer.serialize_i32(1),
3225                Self::Disabled => serializer.serialize_i32(2),
3226                Self::Standard => serializer.serialize_i32(3),
3227                Self::Trial => serializer.serialize_i32(5),
3228                Self::UnknownValue(u) => u.0.serialize(serializer),
3229            }
3230        }
3231    }
3232
3233    impl<'de> serde::de::Deserialize<'de> for EditionConfig {
3234        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3235        where
3236            D: serde::Deserializer<'de>,
3237        {
3238            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EditionConfig>::new(
3239                ".google.storage.control.v2.IntelligenceConfig.EditionConfig",
3240            ))
3241        }
3242    }
3243}
3244
3245/// Request message to update the `IntelligenceConfig` resource associated with
3246/// your organization.
3247///
3248/// **IAM Permissions**:
3249///
3250/// Requires `storage.intelligenceConfigs.update`
3251/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
3252/// the organization.
3253#[derive(Clone, Default, PartialEq)]
3254#[non_exhaustive]
3255pub struct UpdateOrganizationIntelligenceConfigRequest {
3256    /// Required. The `IntelligenceConfig` resource to be updated.
3257    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
3258
3259    /// Required. The `update_mask` that specifies the fields within the
3260    /// `IntelligenceConfig` resource that should be modified by this update. Only
3261    /// the listed fields are updated.
3262    pub update_mask: std::option::Option<wkt::FieldMask>,
3263
3264    /// Optional. The ID that uniquely identifies the request, preventing duplicate
3265    /// processing.
3266    pub request_id: std::string::String,
3267
3268    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3269}
3270
3271impl UpdateOrganizationIntelligenceConfigRequest {
3272    pub fn new() -> Self {
3273        std::default::Default::default()
3274    }
3275
3276    /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
3277    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3278    where
3279        T: std::convert::Into<crate::model::IntelligenceConfig>,
3280    {
3281        self.intelligence_config = std::option::Option::Some(v.into());
3282        self
3283    }
3284
3285    /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
3286    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3287    where
3288        T: std::convert::Into<crate::model::IntelligenceConfig>,
3289    {
3290        self.intelligence_config = v.map(|x| x.into());
3291        self
3292    }
3293
3294    /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
3295    pub fn set_update_mask<T>(mut self, v: T) -> Self
3296    where
3297        T: std::convert::Into<wkt::FieldMask>,
3298    {
3299        self.update_mask = std::option::Option::Some(v.into());
3300        self
3301    }
3302
3303    /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
3304    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3305    where
3306        T: std::convert::Into<wkt::FieldMask>,
3307    {
3308        self.update_mask = v.map(|x| x.into());
3309        self
3310    }
3311
3312    /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
3313    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3314        self.request_id = v.into();
3315        self
3316    }
3317}
3318
3319impl wkt::message::Message for UpdateOrganizationIntelligenceConfigRequest {
3320    fn typename() -> &'static str {
3321        "type.googleapis.com/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"
3322    }
3323}
3324
3325/// Request message to update the `IntelligenceConfig` resource associated with
3326/// your folder.
3327///
3328/// **IAM Permissions**:
3329///
3330/// Requires `storage.intelligenceConfigs.update`
3331/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
3332/// the folder.
3333#[derive(Clone, Default, PartialEq)]
3334#[non_exhaustive]
3335pub struct UpdateFolderIntelligenceConfigRequest {
3336    /// Required. The `IntelligenceConfig` resource to be updated.
3337    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
3338
3339    /// Required. The `update_mask` that specifies the fields within the
3340    /// `IntelligenceConfig` resource that should be modified by this update. Only
3341    /// the listed fields are updated.
3342    pub update_mask: std::option::Option<wkt::FieldMask>,
3343
3344    /// Optional. The ID that uniquely identifies the request, preventing duplicate
3345    /// processing.
3346    pub request_id: std::string::String,
3347
3348    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3349}
3350
3351impl UpdateFolderIntelligenceConfigRequest {
3352    pub fn new() -> Self {
3353        std::default::Default::default()
3354    }
3355
3356    /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
3357    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3358    where
3359        T: std::convert::Into<crate::model::IntelligenceConfig>,
3360    {
3361        self.intelligence_config = std::option::Option::Some(v.into());
3362        self
3363    }
3364
3365    /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
3366    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3367    where
3368        T: std::convert::Into<crate::model::IntelligenceConfig>,
3369    {
3370        self.intelligence_config = v.map(|x| x.into());
3371        self
3372    }
3373
3374    /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
3375    pub fn set_update_mask<T>(mut self, v: T) -> Self
3376    where
3377        T: std::convert::Into<wkt::FieldMask>,
3378    {
3379        self.update_mask = std::option::Option::Some(v.into());
3380        self
3381    }
3382
3383    /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
3384    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3385    where
3386        T: std::convert::Into<wkt::FieldMask>,
3387    {
3388        self.update_mask = v.map(|x| x.into());
3389        self
3390    }
3391
3392    /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
3393    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3394        self.request_id = v.into();
3395        self
3396    }
3397}
3398
3399impl wkt::message::Message for UpdateFolderIntelligenceConfigRequest {
3400    fn typename() -> &'static str {
3401        "type.googleapis.com/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"
3402    }
3403}
3404
3405/// Request message to update the `IntelligenceConfig` resource associated with
3406/// your project.
3407///
3408/// **IAM Permissions**:
3409///
3410/// Requires `storage.intelligenceConfigs.update`
3411/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
3412/// the folder.
3413#[derive(Clone, Default, PartialEq)]
3414#[non_exhaustive]
3415pub struct UpdateProjectIntelligenceConfigRequest {
3416    /// Required. The `IntelligenceConfig` resource to be updated.
3417    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
3418
3419    /// Required. The `update_mask` that specifies the fields within the
3420    /// `IntelligenceConfig` resource that should be modified by this update. Only
3421    /// the listed fields are updated.
3422    pub update_mask: std::option::Option<wkt::FieldMask>,
3423
3424    /// Optional. The ID that uniquely identifies the request, preventing duplicate
3425    /// processing.
3426    pub request_id: std::string::String,
3427
3428    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3429}
3430
3431impl UpdateProjectIntelligenceConfigRequest {
3432    pub fn new() -> Self {
3433        std::default::Default::default()
3434    }
3435
3436    /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
3437    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
3438    where
3439        T: std::convert::Into<crate::model::IntelligenceConfig>,
3440    {
3441        self.intelligence_config = std::option::Option::Some(v.into());
3442        self
3443    }
3444
3445    /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
3446    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
3447    where
3448        T: std::convert::Into<crate::model::IntelligenceConfig>,
3449    {
3450        self.intelligence_config = v.map(|x| x.into());
3451        self
3452    }
3453
3454    /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
3455    pub fn set_update_mask<T>(mut self, v: T) -> Self
3456    where
3457        T: std::convert::Into<wkt::FieldMask>,
3458    {
3459        self.update_mask = std::option::Option::Some(v.into());
3460        self
3461    }
3462
3463    /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
3464    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3465    where
3466        T: std::convert::Into<wkt::FieldMask>,
3467    {
3468        self.update_mask = v.map(|x| x.into());
3469        self
3470    }
3471
3472    /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
3473    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3474        self.request_id = v.into();
3475        self
3476    }
3477}
3478
3479impl wkt::message::Message for UpdateProjectIntelligenceConfigRequest {
3480    fn typename() -> &'static str {
3481        "type.googleapis.com/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"
3482    }
3483}
3484
3485/// Request message to get the `IntelligenceConfig` resource associated with your
3486/// organization.
3487///
3488/// **IAM Permissions**
3489///
3490/// Requires `storage.intelligenceConfigs.get`
3491/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
3492/// the organization.
3493#[derive(Clone, Default, PartialEq)]
3494#[non_exhaustive]
3495pub struct GetOrganizationIntelligenceConfigRequest {
3496    /// Required. The name of the `IntelligenceConfig` resource associated with
3497    /// your organization.
3498    ///
3499    /// Format: `organizations/{org_id}/locations/global/intelligenceConfig`
3500    pub name: std::string::String,
3501
3502    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3503}
3504
3505impl GetOrganizationIntelligenceConfigRequest {
3506    pub fn new() -> Self {
3507        std::default::Default::default()
3508    }
3509
3510    /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
3511    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3512        self.name = v.into();
3513        self
3514    }
3515}
3516
3517impl wkt::message::Message for GetOrganizationIntelligenceConfigRequest {
3518    fn typename() -> &'static str {
3519        "type.googleapis.com/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"
3520    }
3521}
3522
3523/// Request message to get the `IntelligenceConfig` resource associated with your
3524/// folder.
3525///
3526/// **IAM Permissions**
3527///
3528/// Requires `storage.intelligenceConfigs.get`
3529/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
3530/// the folder.
3531#[derive(Clone, Default, PartialEq)]
3532#[non_exhaustive]
3533pub struct GetFolderIntelligenceConfigRequest {
3534    /// Required. The name of the `IntelligenceConfig` resource associated with
3535    /// your folder.
3536    ///
3537    /// Format: `folders/{id}/locations/global/intelligenceConfig`
3538    pub name: std::string::String,
3539
3540    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3541}
3542
3543impl GetFolderIntelligenceConfigRequest {
3544    pub fn new() -> Self {
3545        std::default::Default::default()
3546    }
3547
3548    /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
3549    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3550        self.name = v.into();
3551        self
3552    }
3553}
3554
3555impl wkt::message::Message for GetFolderIntelligenceConfigRequest {
3556    fn typename() -> &'static str {
3557        "type.googleapis.com/google.storage.control.v2.GetFolderIntelligenceConfigRequest"
3558    }
3559}
3560
3561/// Request message to get the `IntelligenceConfig` resource associated with your
3562/// project.
3563///
3564/// **IAM Permissions**:
3565///
3566/// Requires `storage.intelligenceConfigs.get`
3567/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission
3568/// on the project.
3569#[derive(Clone, Default, PartialEq)]
3570#[non_exhaustive]
3571pub struct GetProjectIntelligenceConfigRequest {
3572    /// Required. The name of the `IntelligenceConfig` resource associated with
3573    /// your project.
3574    ///
3575    /// Format: `projects/{id}/locations/global/intelligenceConfig`
3576    pub name: std::string::String,
3577
3578    pub(crate) _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3579}
3580
3581impl GetProjectIntelligenceConfigRequest {
3582    pub fn new() -> Self {
3583        std::default::Default::default()
3584    }
3585
3586    /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
3587    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3588        self.name = v.into();
3589        self
3590    }
3591}
3592
3593impl wkt::message::Message for GetProjectIntelligenceConfigRequest {
3594    fn typename() -> &'static str {
3595        "type.googleapis.com/google.storage.control.v2.GetProjectIntelligenceConfigRequest"
3596    }
3597}