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
20/// Contains information about a pending rename operation.
21#[derive(Clone, Default, PartialEq)]
22#[non_exhaustive]
23pub struct PendingRenameInfo {
24    /// Output only. The name of the rename operation.
25    pub operation: std::string::String,
26
27    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
28}
29
30impl PendingRenameInfo {
31    pub fn new() -> Self {
32        std::default::Default::default()
33    }
34
35    /// Sets the value of [operation][crate::model::PendingRenameInfo::operation].
36    pub fn set_operation<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
37        self.operation = v.into();
38        self
39    }
40}
41
42impl wkt::message::Message for PendingRenameInfo {
43    fn typename() -> &'static str {
44        "type.googleapis.com/google.storage.control.v2.PendingRenameInfo"
45    }
46}
47
48#[doc(hidden)]
49impl<'de> serde::de::Deserialize<'de> for PendingRenameInfo {
50    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
51    where
52        D: serde::Deserializer<'de>,
53    {
54        #[allow(non_camel_case_types)]
55        #[doc(hidden)]
56        #[derive(PartialEq, Eq, Hash)]
57        enum __FieldTag {
58            __operation,
59            Unknown(std::string::String),
60        }
61        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
62            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
63            where
64                D: serde::Deserializer<'de>,
65            {
66                struct Visitor;
67                impl<'de> serde::de::Visitor<'de> for Visitor {
68                    type Value = __FieldTag;
69                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
70                        formatter.write_str("a field name for PendingRenameInfo")
71                    }
72                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
73                    where
74                        E: serde::de::Error,
75                    {
76                        use std::result::Result::Ok;
77                        use std::string::ToString;
78                        match value {
79                            "operation" => Ok(__FieldTag::__operation),
80                            _ => Ok(__FieldTag::Unknown(value.to_string())),
81                        }
82                    }
83                }
84                deserializer.deserialize_identifier(Visitor)
85            }
86        }
87        struct Visitor;
88        impl<'de> serde::de::Visitor<'de> for Visitor {
89            type Value = PendingRenameInfo;
90            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
91                formatter.write_str("struct PendingRenameInfo")
92            }
93            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
94            where
95                A: serde::de::MapAccess<'de>,
96            {
97                #[allow(unused_imports)]
98                use serde::de::Error;
99                use std::option::Option::Some;
100                let mut fields = std::collections::HashSet::new();
101                let mut result = Self::Value::new();
102                while let Some(tag) = map.next_key::<__FieldTag>()? {
103                    #[allow(clippy::match_single_binding)]
104                    match tag {
105                        __FieldTag::__operation => {
106                            if !fields.insert(__FieldTag::__operation) {
107                                return std::result::Result::Err(A::Error::duplicate_field(
108                                    "multiple values for operation",
109                                ));
110                            }
111                            result.operation = map
112                                .next_value::<std::option::Option<std::string::String>>()?
113                                .unwrap_or_default();
114                        }
115                        __FieldTag::Unknown(key) => {
116                            let value = map.next_value::<serde_json::Value>()?;
117                            result._unknown_fields.insert(key, value);
118                        }
119                    }
120                }
121                std::result::Result::Ok(result)
122            }
123        }
124        deserializer.deserialize_any(Visitor)
125    }
126}
127
128#[doc(hidden)]
129impl serde::ser::Serialize for PendingRenameInfo {
130    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
131    where
132        S: serde::ser::Serializer,
133    {
134        use serde::ser::SerializeMap;
135        #[allow(unused_imports)]
136        use std::option::Option::Some;
137        let mut state = serializer.serialize_map(std::option::Option::None)?;
138        if !self.operation.is_empty() {
139            state.serialize_entry("operation", &self.operation)?;
140        }
141        if !self._unknown_fields.is_empty() {
142            for (key, value) in self._unknown_fields.iter() {
143                state.serialize_entry(key, &value)?;
144            }
145        }
146        state.end()
147    }
148}
149
150impl std::fmt::Debug for PendingRenameInfo {
151    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
152        let mut debug_struct = f.debug_struct("PendingRenameInfo");
153        debug_struct.field("operation", &self.operation);
154        if !self._unknown_fields.is_empty() {
155            debug_struct.field("_unknown_fields", &self._unknown_fields);
156        }
157        debug_struct.finish()
158    }
159}
160
161/// A folder resource. This resource can only exist in a hierarchical namespace
162/// enabled bucket.
163#[derive(Clone, Default, PartialEq)]
164#[non_exhaustive]
165pub struct Folder {
166    /// Identifier. The name of this folder.
167    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
168    pub name: std::string::String,
169
170    /// Output only. The version of the metadata for this folder. Used for
171    /// preconditions and for detecting changes in metadata.
172    pub metageneration: i64,
173
174    /// Output only. The creation time of the folder.
175    pub create_time: std::option::Option<wkt::Timestamp>,
176
177    /// Output only. The modification time of the folder.
178    pub update_time: std::option::Option<wkt::Timestamp>,
179
180    /// Output only. Only present if the folder is part of an ongoing RenameFolder
181    /// operation. Contains information which can be used to query the operation
182    /// status. The presence of this field also indicates all write operations are
183    /// blocked for this folder, including folder, managed folder, and object
184    /// operations.
185    pub pending_rename_info: std::option::Option<crate::model::PendingRenameInfo>,
186
187    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
188}
189
190impl Folder {
191    pub fn new() -> Self {
192        std::default::Default::default()
193    }
194
195    /// Sets the value of [name][crate::model::Folder::name].
196    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
197        self.name = v.into();
198        self
199    }
200
201    /// Sets the value of [metageneration][crate::model::Folder::metageneration].
202    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
203        self.metageneration = v.into();
204        self
205    }
206
207    /// Sets the value of [create_time][crate::model::Folder::create_time].
208    pub fn set_create_time<T>(mut self, v: T) -> Self
209    where
210        T: std::convert::Into<wkt::Timestamp>,
211    {
212        self.create_time = std::option::Option::Some(v.into());
213        self
214    }
215
216    /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
217    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
218    where
219        T: std::convert::Into<wkt::Timestamp>,
220    {
221        self.create_time = v.map(|x| x.into());
222        self
223    }
224
225    /// Sets the value of [update_time][crate::model::Folder::update_time].
226    pub fn set_update_time<T>(mut self, v: T) -> Self
227    where
228        T: std::convert::Into<wkt::Timestamp>,
229    {
230        self.update_time = std::option::Option::Some(v.into());
231        self
232    }
233
234    /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
235    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
236    where
237        T: std::convert::Into<wkt::Timestamp>,
238    {
239        self.update_time = v.map(|x| x.into());
240        self
241    }
242
243    /// Sets the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
244    pub fn set_pending_rename_info<T>(mut self, v: T) -> Self
245    where
246        T: std::convert::Into<crate::model::PendingRenameInfo>,
247    {
248        self.pending_rename_info = std::option::Option::Some(v.into());
249        self
250    }
251
252    /// Sets or clears the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
253    pub fn set_or_clear_pending_rename_info<T>(mut self, v: std::option::Option<T>) -> Self
254    where
255        T: std::convert::Into<crate::model::PendingRenameInfo>,
256    {
257        self.pending_rename_info = v.map(|x| x.into());
258        self
259    }
260}
261
262impl wkt::message::Message for Folder {
263    fn typename() -> &'static str {
264        "type.googleapis.com/google.storage.control.v2.Folder"
265    }
266}
267
268#[doc(hidden)]
269impl<'de> serde::de::Deserialize<'de> for Folder {
270    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
271    where
272        D: serde::Deserializer<'de>,
273    {
274        #[allow(non_camel_case_types)]
275        #[doc(hidden)]
276        #[derive(PartialEq, Eq, Hash)]
277        enum __FieldTag {
278            __name,
279            __metageneration,
280            __create_time,
281            __update_time,
282            __pending_rename_info,
283            Unknown(std::string::String),
284        }
285        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
286            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
287            where
288                D: serde::Deserializer<'de>,
289            {
290                struct Visitor;
291                impl<'de> serde::de::Visitor<'de> for Visitor {
292                    type Value = __FieldTag;
293                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
294                        formatter.write_str("a field name for Folder")
295                    }
296                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
297                    where
298                        E: serde::de::Error,
299                    {
300                        use std::result::Result::Ok;
301                        use std::string::ToString;
302                        match value {
303                            "name" => Ok(__FieldTag::__name),
304                            "metageneration" => Ok(__FieldTag::__metageneration),
305                            "createTime" => Ok(__FieldTag::__create_time),
306                            "create_time" => Ok(__FieldTag::__create_time),
307                            "updateTime" => Ok(__FieldTag::__update_time),
308                            "update_time" => Ok(__FieldTag::__update_time),
309                            "pendingRenameInfo" => Ok(__FieldTag::__pending_rename_info),
310                            "pending_rename_info" => Ok(__FieldTag::__pending_rename_info),
311                            _ => Ok(__FieldTag::Unknown(value.to_string())),
312                        }
313                    }
314                }
315                deserializer.deserialize_identifier(Visitor)
316            }
317        }
318        struct Visitor;
319        impl<'de> serde::de::Visitor<'de> for Visitor {
320            type Value = Folder;
321            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
322                formatter.write_str("struct Folder")
323            }
324            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
325            where
326                A: serde::de::MapAccess<'de>,
327            {
328                #[allow(unused_imports)]
329                use serde::de::Error;
330                use std::option::Option::Some;
331                let mut fields = std::collections::HashSet::new();
332                let mut result = Self::Value::new();
333                while let Some(tag) = map.next_key::<__FieldTag>()? {
334                    #[allow(clippy::match_single_binding)]
335                    match tag {
336                        __FieldTag::__name => {
337                            if !fields.insert(__FieldTag::__name) {
338                                return std::result::Result::Err(A::Error::duplicate_field(
339                                    "multiple values for name",
340                                ));
341                            }
342                            result.name = map
343                                .next_value::<std::option::Option<std::string::String>>()?
344                                .unwrap_or_default();
345                        }
346                        __FieldTag::__metageneration => {
347                            if !fields.insert(__FieldTag::__metageneration) {
348                                return std::result::Result::Err(A::Error::duplicate_field(
349                                    "multiple values for metageneration",
350                                ));
351                            }
352                            struct __With(std::option::Option<i64>);
353                            impl<'de> serde::de::Deserialize<'de> for __With {
354                                fn deserialize<D>(
355                                    deserializer: D,
356                                ) -> std::result::Result<Self, D::Error>
357                                where
358                                    D: serde::de::Deserializer<'de>,
359                                {
360                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
361                                }
362                            }
363                            result.metageneration =
364                                map.next_value::<__With>()?.0.unwrap_or_default();
365                        }
366                        __FieldTag::__create_time => {
367                            if !fields.insert(__FieldTag::__create_time) {
368                                return std::result::Result::Err(A::Error::duplicate_field(
369                                    "multiple values for create_time",
370                                ));
371                            }
372                            result.create_time =
373                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
374                        }
375                        __FieldTag::__update_time => {
376                            if !fields.insert(__FieldTag::__update_time) {
377                                return std::result::Result::Err(A::Error::duplicate_field(
378                                    "multiple values for update_time",
379                                ));
380                            }
381                            result.update_time =
382                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
383                        }
384                        __FieldTag::__pending_rename_info => {
385                            if !fields.insert(__FieldTag::__pending_rename_info) {
386                                return std::result::Result::Err(A::Error::duplicate_field(
387                                    "multiple values for pending_rename_info",
388                                ));
389                            }
390                            result.pending_rename_info = map
391                                .next_value::<std::option::Option<crate::model::PendingRenameInfo>>(
392                                )?;
393                        }
394                        __FieldTag::Unknown(key) => {
395                            let value = map.next_value::<serde_json::Value>()?;
396                            result._unknown_fields.insert(key, value);
397                        }
398                    }
399                }
400                std::result::Result::Ok(result)
401            }
402        }
403        deserializer.deserialize_any(Visitor)
404    }
405}
406
407#[doc(hidden)]
408impl serde::ser::Serialize for Folder {
409    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
410    where
411        S: serde::ser::Serializer,
412    {
413        use serde::ser::SerializeMap;
414        #[allow(unused_imports)]
415        use std::option::Option::Some;
416        let mut state = serializer.serialize_map(std::option::Option::None)?;
417        if !self.name.is_empty() {
418            state.serialize_entry("name", &self.name)?;
419        }
420        if !wkt::internal::is_default(&self.metageneration) {
421            struct __With<'a>(&'a i64);
422            impl<'a> serde::ser::Serialize for __With<'a> {
423                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
424                where
425                    S: serde::ser::Serializer,
426                {
427                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
428                }
429            }
430            state.serialize_entry("metageneration", &__With(&self.metageneration))?;
431        }
432        if self.create_time.is_some() {
433            state.serialize_entry("createTime", &self.create_time)?;
434        }
435        if self.update_time.is_some() {
436            state.serialize_entry("updateTime", &self.update_time)?;
437        }
438        if self.pending_rename_info.is_some() {
439            state.serialize_entry("pendingRenameInfo", &self.pending_rename_info)?;
440        }
441        if !self._unknown_fields.is_empty() {
442            for (key, value) in self._unknown_fields.iter() {
443                state.serialize_entry(key, &value)?;
444            }
445        }
446        state.end()
447    }
448}
449
450impl std::fmt::Debug for Folder {
451    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
452        let mut debug_struct = f.debug_struct("Folder");
453        debug_struct.field("name", &self.name);
454        debug_struct.field("metageneration", &self.metageneration);
455        debug_struct.field("create_time", &self.create_time);
456        debug_struct.field("update_time", &self.update_time);
457        debug_struct.field("pending_rename_info", &self.pending_rename_info);
458        if !self._unknown_fields.is_empty() {
459            debug_struct.field("_unknown_fields", &self._unknown_fields);
460        }
461        debug_struct.finish()
462    }
463}
464
465/// Request message for GetFolder. This operation is only applicable to a
466/// hierarchical namespace enabled bucket.
467#[derive(Clone, Default, PartialEq)]
468#[non_exhaustive]
469pub struct GetFolderRequest {
470    /// Required. Name of the folder.
471    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
472    pub name: std::string::String,
473
474    /// Makes the operation only succeed conditional on whether the folder's
475    /// current metageneration matches the given value.
476    pub if_metageneration_match: std::option::Option<i64>,
477
478    /// Makes the operation only succeed conditional on whether the folder's
479    /// current metageneration does not match the given value.
480    pub if_metageneration_not_match: std::option::Option<i64>,
481
482    /// Optional. A unique identifier for this request. UUID is the recommended
483    /// format, but other formats are still accepted.
484    pub request_id: std::string::String,
485
486    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
487}
488
489impl GetFolderRequest {
490    pub fn new() -> Self {
491        std::default::Default::default()
492    }
493
494    /// Sets the value of [name][crate::model::GetFolderRequest::name].
495    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
496        self.name = v.into();
497        self
498    }
499
500    /// Sets the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
501    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
502    where
503        T: std::convert::Into<i64>,
504    {
505        self.if_metageneration_match = std::option::Option::Some(v.into());
506        self
507    }
508
509    /// Sets or clears the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
510    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
511    where
512        T: std::convert::Into<i64>,
513    {
514        self.if_metageneration_match = v.map(|x| x.into());
515        self
516    }
517
518    /// Sets the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
519    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
520    where
521        T: std::convert::Into<i64>,
522    {
523        self.if_metageneration_not_match = std::option::Option::Some(v.into());
524        self
525    }
526
527    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
528    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
529    where
530        T: std::convert::Into<i64>,
531    {
532        self.if_metageneration_not_match = v.map(|x| x.into());
533        self
534    }
535
536    /// Sets the value of [request_id][crate::model::GetFolderRequest::request_id].
537    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
538        self.request_id = v.into();
539        self
540    }
541}
542
543impl wkt::message::Message for GetFolderRequest {
544    fn typename() -> &'static str {
545        "type.googleapis.com/google.storage.control.v2.GetFolderRequest"
546    }
547}
548
549#[doc(hidden)]
550impl<'de> serde::de::Deserialize<'de> for GetFolderRequest {
551    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
552    where
553        D: serde::Deserializer<'de>,
554    {
555        #[allow(non_camel_case_types)]
556        #[doc(hidden)]
557        #[derive(PartialEq, Eq, Hash)]
558        enum __FieldTag {
559            __name,
560            __if_metageneration_match,
561            __if_metageneration_not_match,
562            __request_id,
563            Unknown(std::string::String),
564        }
565        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
566            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
567            where
568                D: serde::Deserializer<'de>,
569            {
570                struct Visitor;
571                impl<'de> serde::de::Visitor<'de> for Visitor {
572                    type Value = __FieldTag;
573                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
574                        formatter.write_str("a field name for GetFolderRequest")
575                    }
576                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
577                    where
578                        E: serde::de::Error,
579                    {
580                        use std::result::Result::Ok;
581                        use std::string::ToString;
582                        match value {
583                            "name" => Ok(__FieldTag::__name),
584                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
585                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
586                            "ifMetagenerationNotMatch" => {
587                                Ok(__FieldTag::__if_metageneration_not_match)
588                            }
589                            "if_metageneration_not_match" => {
590                                Ok(__FieldTag::__if_metageneration_not_match)
591                            }
592                            "requestId" => Ok(__FieldTag::__request_id),
593                            "request_id" => Ok(__FieldTag::__request_id),
594                            _ => Ok(__FieldTag::Unknown(value.to_string())),
595                        }
596                    }
597                }
598                deserializer.deserialize_identifier(Visitor)
599            }
600        }
601        struct Visitor;
602        impl<'de> serde::de::Visitor<'de> for Visitor {
603            type Value = GetFolderRequest;
604            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
605                formatter.write_str("struct GetFolderRequest")
606            }
607            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
608            where
609                A: serde::de::MapAccess<'de>,
610            {
611                #[allow(unused_imports)]
612                use serde::de::Error;
613                use std::option::Option::Some;
614                let mut fields = std::collections::HashSet::new();
615                let mut result = Self::Value::new();
616                while let Some(tag) = map.next_key::<__FieldTag>()? {
617                    #[allow(clippy::match_single_binding)]
618                    match tag {
619                        __FieldTag::__name => {
620                            if !fields.insert(__FieldTag::__name) {
621                                return std::result::Result::Err(A::Error::duplicate_field(
622                                    "multiple values for name",
623                                ));
624                            }
625                            result.name = map
626                                .next_value::<std::option::Option<std::string::String>>()?
627                                .unwrap_or_default();
628                        }
629                        __FieldTag::__if_metageneration_match => {
630                            if !fields.insert(__FieldTag::__if_metageneration_match) {
631                                return std::result::Result::Err(A::Error::duplicate_field(
632                                    "multiple values for if_metageneration_match",
633                                ));
634                            }
635                            struct __With(std::option::Option<i64>);
636                            impl<'de> serde::de::Deserialize<'de> for __With {
637                                fn deserialize<D>(
638                                    deserializer: D,
639                                ) -> std::result::Result<Self, D::Error>
640                                where
641                                    D: serde::de::Deserializer<'de>,
642                                {
643                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
644                                }
645                            }
646                            result.if_metageneration_match = map.next_value::<__With>()?.0;
647                        }
648                        __FieldTag::__if_metageneration_not_match => {
649                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
650                                return std::result::Result::Err(A::Error::duplicate_field(
651                                    "multiple values for if_metageneration_not_match",
652                                ));
653                            }
654                            struct __With(std::option::Option<i64>);
655                            impl<'de> serde::de::Deserialize<'de> for __With {
656                                fn deserialize<D>(
657                                    deserializer: D,
658                                ) -> std::result::Result<Self, D::Error>
659                                where
660                                    D: serde::de::Deserializer<'de>,
661                                {
662                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
663                                }
664                            }
665                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
666                        }
667                        __FieldTag::__request_id => {
668                            if !fields.insert(__FieldTag::__request_id) {
669                                return std::result::Result::Err(A::Error::duplicate_field(
670                                    "multiple values for request_id",
671                                ));
672                            }
673                            result.request_id = map
674                                .next_value::<std::option::Option<std::string::String>>()?
675                                .unwrap_or_default();
676                        }
677                        __FieldTag::Unknown(key) => {
678                            let value = map.next_value::<serde_json::Value>()?;
679                            result._unknown_fields.insert(key, value);
680                        }
681                    }
682                }
683                std::result::Result::Ok(result)
684            }
685        }
686        deserializer.deserialize_any(Visitor)
687    }
688}
689
690#[doc(hidden)]
691impl serde::ser::Serialize for GetFolderRequest {
692    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
693    where
694        S: serde::ser::Serializer,
695    {
696        use serde::ser::SerializeMap;
697        #[allow(unused_imports)]
698        use std::option::Option::Some;
699        let mut state = serializer.serialize_map(std::option::Option::None)?;
700        if !self.name.is_empty() {
701            state.serialize_entry("name", &self.name)?;
702        }
703        if self.if_metageneration_match.is_some() {
704            struct __With<'a>(&'a std::option::Option<i64>);
705            impl<'a> serde::ser::Serialize for __With<'a> {
706                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
707                where
708                    S: serde::ser::Serializer,
709                {
710                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
711                        self.0, serializer,
712                    )
713                }
714            }
715            state.serialize_entry(
716                "ifMetagenerationMatch",
717                &__With(&self.if_metageneration_match),
718            )?;
719        }
720        if self.if_metageneration_not_match.is_some() {
721            struct __With<'a>(&'a std::option::Option<i64>);
722            impl<'a> serde::ser::Serialize for __With<'a> {
723                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
724                where
725                    S: serde::ser::Serializer,
726                {
727                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
728                        self.0, serializer,
729                    )
730                }
731            }
732            state.serialize_entry(
733                "ifMetagenerationNotMatch",
734                &__With(&self.if_metageneration_not_match),
735            )?;
736        }
737        if !self.request_id.is_empty() {
738            state.serialize_entry("requestId", &self.request_id)?;
739        }
740        if !self._unknown_fields.is_empty() {
741            for (key, value) in self._unknown_fields.iter() {
742                state.serialize_entry(key, &value)?;
743            }
744        }
745        state.end()
746    }
747}
748
749impl std::fmt::Debug for GetFolderRequest {
750    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
751        let mut debug_struct = f.debug_struct("GetFolderRequest");
752        debug_struct.field("name", &self.name);
753        debug_struct.field("if_metageneration_match", &self.if_metageneration_match);
754        debug_struct.field(
755            "if_metageneration_not_match",
756            &self.if_metageneration_not_match,
757        );
758        debug_struct.field("request_id", &self.request_id);
759        if !self._unknown_fields.is_empty() {
760            debug_struct.field("_unknown_fields", &self._unknown_fields);
761        }
762        debug_struct.finish()
763    }
764}
765
766/// Request message for CreateFolder. This operation is only applicable to a
767/// hierarchical namespace enabled bucket.
768#[derive(Clone, Default, PartialEq)]
769#[non_exhaustive]
770pub struct CreateFolderRequest {
771    /// Required. Name of the bucket in which the folder will reside. The bucket
772    /// must be a hierarchical namespace enabled bucket.
773    pub parent: std::string::String,
774
775    /// Required. Properties of the new folder being created.
776    /// The bucket and name of the folder are specified in the parent and folder_id
777    /// fields, respectively. Populating those fields in `folder` will result in an
778    /// error.
779    pub folder: std::option::Option<crate::model::Folder>,
780
781    /// Required. The full name of a folder, including all its parent folders.
782    /// Folders use single '/' characters as a delimiter.
783    /// The folder_id must end with a slash.
784    /// For example, the folder_id of "books/biographies/" would create a new
785    /// "biographies/" folder under the "books/" folder.
786    pub folder_id: std::string::String,
787
788    /// Optional. If true, parent folder doesn't have to be present and all missing
789    /// ancestor folders will be created atomically.
790    pub recursive: bool,
791
792    /// Optional. A unique identifier for this request. UUID is the recommended
793    /// format, but other formats are still accepted.
794    pub request_id: std::string::String,
795
796    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
797}
798
799impl CreateFolderRequest {
800    pub fn new() -> Self {
801        std::default::Default::default()
802    }
803
804    /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
805    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
806        self.parent = v.into();
807        self
808    }
809
810    /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
811    pub fn set_folder<T>(mut self, v: T) -> Self
812    where
813        T: std::convert::Into<crate::model::Folder>,
814    {
815        self.folder = std::option::Option::Some(v.into());
816        self
817    }
818
819    /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
820    pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
821    where
822        T: std::convert::Into<crate::model::Folder>,
823    {
824        self.folder = v.map(|x| x.into());
825        self
826    }
827
828    /// Sets the value of [folder_id][crate::model::CreateFolderRequest::folder_id].
829    pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
830        self.folder_id = v.into();
831        self
832    }
833
834    /// Sets the value of [recursive][crate::model::CreateFolderRequest::recursive].
835    pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
836        self.recursive = v.into();
837        self
838    }
839
840    /// Sets the value of [request_id][crate::model::CreateFolderRequest::request_id].
841    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
842        self.request_id = v.into();
843        self
844    }
845}
846
847impl wkt::message::Message for CreateFolderRequest {
848    fn typename() -> &'static str {
849        "type.googleapis.com/google.storage.control.v2.CreateFolderRequest"
850    }
851}
852
853#[doc(hidden)]
854impl<'de> serde::de::Deserialize<'de> for CreateFolderRequest {
855    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
856    where
857        D: serde::Deserializer<'de>,
858    {
859        #[allow(non_camel_case_types)]
860        #[doc(hidden)]
861        #[derive(PartialEq, Eq, Hash)]
862        enum __FieldTag {
863            __parent,
864            __folder,
865            __folder_id,
866            __recursive,
867            __request_id,
868            Unknown(std::string::String),
869        }
870        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
871            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
872            where
873                D: serde::Deserializer<'de>,
874            {
875                struct Visitor;
876                impl<'de> serde::de::Visitor<'de> for Visitor {
877                    type Value = __FieldTag;
878                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
879                        formatter.write_str("a field name for CreateFolderRequest")
880                    }
881                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
882                    where
883                        E: serde::de::Error,
884                    {
885                        use std::result::Result::Ok;
886                        use std::string::ToString;
887                        match value {
888                            "parent" => Ok(__FieldTag::__parent),
889                            "folder" => Ok(__FieldTag::__folder),
890                            "folderId" => Ok(__FieldTag::__folder_id),
891                            "folder_id" => Ok(__FieldTag::__folder_id),
892                            "recursive" => Ok(__FieldTag::__recursive),
893                            "requestId" => Ok(__FieldTag::__request_id),
894                            "request_id" => Ok(__FieldTag::__request_id),
895                            _ => Ok(__FieldTag::Unknown(value.to_string())),
896                        }
897                    }
898                }
899                deserializer.deserialize_identifier(Visitor)
900            }
901        }
902        struct Visitor;
903        impl<'de> serde::de::Visitor<'de> for Visitor {
904            type Value = CreateFolderRequest;
905            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
906                formatter.write_str("struct CreateFolderRequest")
907            }
908            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
909            where
910                A: serde::de::MapAccess<'de>,
911            {
912                #[allow(unused_imports)]
913                use serde::de::Error;
914                use std::option::Option::Some;
915                let mut fields = std::collections::HashSet::new();
916                let mut result = Self::Value::new();
917                while let Some(tag) = map.next_key::<__FieldTag>()? {
918                    #[allow(clippy::match_single_binding)]
919                    match tag {
920                        __FieldTag::__parent => {
921                            if !fields.insert(__FieldTag::__parent) {
922                                return std::result::Result::Err(A::Error::duplicate_field(
923                                    "multiple values for parent",
924                                ));
925                            }
926                            result.parent = map
927                                .next_value::<std::option::Option<std::string::String>>()?
928                                .unwrap_or_default();
929                        }
930                        __FieldTag::__folder => {
931                            if !fields.insert(__FieldTag::__folder) {
932                                return std::result::Result::Err(A::Error::duplicate_field(
933                                    "multiple values for folder",
934                                ));
935                            }
936                            result.folder =
937                                map.next_value::<std::option::Option<crate::model::Folder>>()?;
938                        }
939                        __FieldTag::__folder_id => {
940                            if !fields.insert(__FieldTag::__folder_id) {
941                                return std::result::Result::Err(A::Error::duplicate_field(
942                                    "multiple values for folder_id",
943                                ));
944                            }
945                            result.folder_id = map
946                                .next_value::<std::option::Option<std::string::String>>()?
947                                .unwrap_or_default();
948                        }
949                        __FieldTag::__recursive => {
950                            if !fields.insert(__FieldTag::__recursive) {
951                                return std::result::Result::Err(A::Error::duplicate_field(
952                                    "multiple values for recursive",
953                                ));
954                            }
955                            result.recursive = map
956                                .next_value::<std::option::Option<bool>>()?
957                                .unwrap_or_default();
958                        }
959                        __FieldTag::__request_id => {
960                            if !fields.insert(__FieldTag::__request_id) {
961                                return std::result::Result::Err(A::Error::duplicate_field(
962                                    "multiple values for request_id",
963                                ));
964                            }
965                            result.request_id = map
966                                .next_value::<std::option::Option<std::string::String>>()?
967                                .unwrap_or_default();
968                        }
969                        __FieldTag::Unknown(key) => {
970                            let value = map.next_value::<serde_json::Value>()?;
971                            result._unknown_fields.insert(key, value);
972                        }
973                    }
974                }
975                std::result::Result::Ok(result)
976            }
977        }
978        deserializer.deserialize_any(Visitor)
979    }
980}
981
982#[doc(hidden)]
983impl serde::ser::Serialize for CreateFolderRequest {
984    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
985    where
986        S: serde::ser::Serializer,
987    {
988        use serde::ser::SerializeMap;
989        #[allow(unused_imports)]
990        use std::option::Option::Some;
991        let mut state = serializer.serialize_map(std::option::Option::None)?;
992        if !self.parent.is_empty() {
993            state.serialize_entry("parent", &self.parent)?;
994        }
995        if self.folder.is_some() {
996            state.serialize_entry("folder", &self.folder)?;
997        }
998        if !self.folder_id.is_empty() {
999            state.serialize_entry("folderId", &self.folder_id)?;
1000        }
1001        if !wkt::internal::is_default(&self.recursive) {
1002            state.serialize_entry("recursive", &self.recursive)?;
1003        }
1004        if !self.request_id.is_empty() {
1005            state.serialize_entry("requestId", &self.request_id)?;
1006        }
1007        if !self._unknown_fields.is_empty() {
1008            for (key, value) in self._unknown_fields.iter() {
1009                state.serialize_entry(key, &value)?;
1010            }
1011        }
1012        state.end()
1013    }
1014}
1015
1016impl std::fmt::Debug for CreateFolderRequest {
1017    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1018        let mut debug_struct = f.debug_struct("CreateFolderRequest");
1019        debug_struct.field("parent", &self.parent);
1020        debug_struct.field("folder", &self.folder);
1021        debug_struct.field("folder_id", &self.folder_id);
1022        debug_struct.field("recursive", &self.recursive);
1023        debug_struct.field("request_id", &self.request_id);
1024        if !self._unknown_fields.is_empty() {
1025            debug_struct.field("_unknown_fields", &self._unknown_fields);
1026        }
1027        debug_struct.finish()
1028    }
1029}
1030
1031/// Request message for DeleteFolder. This operation is only applicable to a
1032/// hierarchical namespace enabled bucket.
1033#[derive(Clone, Default, PartialEq)]
1034#[non_exhaustive]
1035pub struct DeleteFolderRequest {
1036    /// Required. Name of the folder.
1037    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
1038    pub name: std::string::String,
1039
1040    /// Makes the operation only succeed conditional on whether the folder's
1041    /// current metageneration matches the given value.
1042    pub if_metageneration_match: std::option::Option<i64>,
1043
1044    /// Makes the operation only succeed conditional on whether the folder's
1045    /// current metageneration does not match the given value.
1046    pub if_metageneration_not_match: std::option::Option<i64>,
1047
1048    /// Optional. A unique identifier for this request. UUID is the recommended
1049    /// format, but other formats are still accepted.
1050    pub request_id: std::string::String,
1051
1052    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1053}
1054
1055impl DeleteFolderRequest {
1056    pub fn new() -> Self {
1057        std::default::Default::default()
1058    }
1059
1060    /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
1061    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1062        self.name = v.into();
1063        self
1064    }
1065
1066    /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
1067    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1068    where
1069        T: std::convert::Into<i64>,
1070    {
1071        self.if_metageneration_match = std::option::Option::Some(v.into());
1072        self
1073    }
1074
1075    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
1076    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1077    where
1078        T: std::convert::Into<i64>,
1079    {
1080        self.if_metageneration_match = v.map(|x| x.into());
1081        self
1082    }
1083
1084    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
1085    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1086    where
1087        T: std::convert::Into<i64>,
1088    {
1089        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1090        self
1091    }
1092
1093    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
1094    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1095    where
1096        T: std::convert::Into<i64>,
1097    {
1098        self.if_metageneration_not_match = v.map(|x| x.into());
1099        self
1100    }
1101
1102    /// Sets the value of [request_id][crate::model::DeleteFolderRequest::request_id].
1103    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1104        self.request_id = v.into();
1105        self
1106    }
1107}
1108
1109impl wkt::message::Message for DeleteFolderRequest {
1110    fn typename() -> &'static str {
1111        "type.googleapis.com/google.storage.control.v2.DeleteFolderRequest"
1112    }
1113}
1114
1115#[doc(hidden)]
1116impl<'de> serde::de::Deserialize<'de> for DeleteFolderRequest {
1117    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1118    where
1119        D: serde::Deserializer<'de>,
1120    {
1121        #[allow(non_camel_case_types)]
1122        #[doc(hidden)]
1123        #[derive(PartialEq, Eq, Hash)]
1124        enum __FieldTag {
1125            __name,
1126            __if_metageneration_match,
1127            __if_metageneration_not_match,
1128            __request_id,
1129            Unknown(std::string::String),
1130        }
1131        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1132            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1133            where
1134                D: serde::Deserializer<'de>,
1135            {
1136                struct Visitor;
1137                impl<'de> serde::de::Visitor<'de> for Visitor {
1138                    type Value = __FieldTag;
1139                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1140                        formatter.write_str("a field name for DeleteFolderRequest")
1141                    }
1142                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1143                    where
1144                        E: serde::de::Error,
1145                    {
1146                        use std::result::Result::Ok;
1147                        use std::string::ToString;
1148                        match value {
1149                            "name" => Ok(__FieldTag::__name),
1150                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
1151                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
1152                            "ifMetagenerationNotMatch" => {
1153                                Ok(__FieldTag::__if_metageneration_not_match)
1154                            }
1155                            "if_metageneration_not_match" => {
1156                                Ok(__FieldTag::__if_metageneration_not_match)
1157                            }
1158                            "requestId" => Ok(__FieldTag::__request_id),
1159                            "request_id" => Ok(__FieldTag::__request_id),
1160                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1161                        }
1162                    }
1163                }
1164                deserializer.deserialize_identifier(Visitor)
1165            }
1166        }
1167        struct Visitor;
1168        impl<'de> serde::de::Visitor<'de> for Visitor {
1169            type Value = DeleteFolderRequest;
1170            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1171                formatter.write_str("struct DeleteFolderRequest")
1172            }
1173            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1174            where
1175                A: serde::de::MapAccess<'de>,
1176            {
1177                #[allow(unused_imports)]
1178                use serde::de::Error;
1179                use std::option::Option::Some;
1180                let mut fields = std::collections::HashSet::new();
1181                let mut result = Self::Value::new();
1182                while let Some(tag) = map.next_key::<__FieldTag>()? {
1183                    #[allow(clippy::match_single_binding)]
1184                    match tag {
1185                        __FieldTag::__name => {
1186                            if !fields.insert(__FieldTag::__name) {
1187                                return std::result::Result::Err(A::Error::duplicate_field(
1188                                    "multiple values for name",
1189                                ));
1190                            }
1191                            result.name = map
1192                                .next_value::<std::option::Option<std::string::String>>()?
1193                                .unwrap_or_default();
1194                        }
1195                        __FieldTag::__if_metageneration_match => {
1196                            if !fields.insert(__FieldTag::__if_metageneration_match) {
1197                                return std::result::Result::Err(A::Error::duplicate_field(
1198                                    "multiple values for if_metageneration_match",
1199                                ));
1200                            }
1201                            struct __With(std::option::Option<i64>);
1202                            impl<'de> serde::de::Deserialize<'de> for __With {
1203                                fn deserialize<D>(
1204                                    deserializer: D,
1205                                ) -> std::result::Result<Self, D::Error>
1206                                where
1207                                    D: serde::de::Deserializer<'de>,
1208                                {
1209                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
1210                                }
1211                            }
1212                            result.if_metageneration_match = map.next_value::<__With>()?.0;
1213                        }
1214                        __FieldTag::__if_metageneration_not_match => {
1215                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
1216                                return std::result::Result::Err(A::Error::duplicate_field(
1217                                    "multiple values for if_metageneration_not_match",
1218                                ));
1219                            }
1220                            struct __With(std::option::Option<i64>);
1221                            impl<'de> serde::de::Deserialize<'de> for __With {
1222                                fn deserialize<D>(
1223                                    deserializer: D,
1224                                ) -> std::result::Result<Self, D::Error>
1225                                where
1226                                    D: serde::de::Deserializer<'de>,
1227                                {
1228                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
1229                                }
1230                            }
1231                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
1232                        }
1233                        __FieldTag::__request_id => {
1234                            if !fields.insert(__FieldTag::__request_id) {
1235                                return std::result::Result::Err(A::Error::duplicate_field(
1236                                    "multiple values for request_id",
1237                                ));
1238                            }
1239                            result.request_id = map
1240                                .next_value::<std::option::Option<std::string::String>>()?
1241                                .unwrap_or_default();
1242                        }
1243                        __FieldTag::Unknown(key) => {
1244                            let value = map.next_value::<serde_json::Value>()?;
1245                            result._unknown_fields.insert(key, value);
1246                        }
1247                    }
1248                }
1249                std::result::Result::Ok(result)
1250            }
1251        }
1252        deserializer.deserialize_any(Visitor)
1253    }
1254}
1255
1256#[doc(hidden)]
1257impl serde::ser::Serialize for DeleteFolderRequest {
1258    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1259    where
1260        S: serde::ser::Serializer,
1261    {
1262        use serde::ser::SerializeMap;
1263        #[allow(unused_imports)]
1264        use std::option::Option::Some;
1265        let mut state = serializer.serialize_map(std::option::Option::None)?;
1266        if !self.name.is_empty() {
1267            state.serialize_entry("name", &self.name)?;
1268        }
1269        if self.if_metageneration_match.is_some() {
1270            struct __With<'a>(&'a std::option::Option<i64>);
1271            impl<'a> serde::ser::Serialize for __With<'a> {
1272                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1273                where
1274                    S: serde::ser::Serializer,
1275                {
1276                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
1277                        self.0, serializer,
1278                    )
1279                }
1280            }
1281            state.serialize_entry(
1282                "ifMetagenerationMatch",
1283                &__With(&self.if_metageneration_match),
1284            )?;
1285        }
1286        if self.if_metageneration_not_match.is_some() {
1287            struct __With<'a>(&'a std::option::Option<i64>);
1288            impl<'a> serde::ser::Serialize for __With<'a> {
1289                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1290                where
1291                    S: serde::ser::Serializer,
1292                {
1293                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
1294                        self.0, serializer,
1295                    )
1296                }
1297            }
1298            state.serialize_entry(
1299                "ifMetagenerationNotMatch",
1300                &__With(&self.if_metageneration_not_match),
1301            )?;
1302        }
1303        if !self.request_id.is_empty() {
1304            state.serialize_entry("requestId", &self.request_id)?;
1305        }
1306        if !self._unknown_fields.is_empty() {
1307            for (key, value) in self._unknown_fields.iter() {
1308                state.serialize_entry(key, &value)?;
1309            }
1310        }
1311        state.end()
1312    }
1313}
1314
1315impl std::fmt::Debug for DeleteFolderRequest {
1316    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1317        let mut debug_struct = f.debug_struct("DeleteFolderRequest");
1318        debug_struct.field("name", &self.name);
1319        debug_struct.field("if_metageneration_match", &self.if_metageneration_match);
1320        debug_struct.field(
1321            "if_metageneration_not_match",
1322            &self.if_metageneration_not_match,
1323        );
1324        debug_struct.field("request_id", &self.request_id);
1325        if !self._unknown_fields.is_empty() {
1326            debug_struct.field("_unknown_fields", &self._unknown_fields);
1327        }
1328        debug_struct.finish()
1329    }
1330}
1331
1332/// Request message for ListFolders. This operation is only applicable to a
1333/// hierarchical namespace enabled bucket.
1334#[derive(Clone, Default, PartialEq)]
1335#[non_exhaustive]
1336pub struct ListFoldersRequest {
1337    /// Required. Name of the bucket in which to look for folders. The bucket must
1338    /// be a hierarchical namespace enabled bucket.
1339    pub parent: std::string::String,
1340
1341    /// Optional. Maximum number of folders to return in a single response. The
1342    /// service will use this parameter or 1,000 items, whichever is smaller.
1343    pub page_size: i32,
1344
1345    /// Optional. A previously-returned page token representing part of the larger
1346    /// set of results to view.
1347    pub page_token: std::string::String,
1348
1349    /// Optional. Filter results to folders whose names begin with this prefix.
1350    /// If set, the value must either be an empty string or end with a '/'.
1351    pub prefix: std::string::String,
1352
1353    /// Optional. If set, returns results in a directory-like mode. The results
1354    /// will only include folders that either exactly match the above prefix, or
1355    /// are one level below the prefix. The only supported value is '/'.
1356    pub delimiter: std::string::String,
1357
1358    /// Optional. Filter results to folders whose names are lexicographically equal
1359    /// to or after lexicographic_start. If lexicographic_end is also set, the
1360    /// folders listed have names between lexicographic_start (inclusive) and
1361    /// lexicographic_end (exclusive).
1362    pub lexicographic_start: std::string::String,
1363
1364    /// Optional. Filter results to folders whose names are lexicographically
1365    /// before lexicographic_end. If lexicographic_start is also set, the folders
1366    /// listed have names between lexicographic_start (inclusive) and
1367    /// lexicographic_end (exclusive).
1368    pub lexicographic_end: std::string::String,
1369
1370    /// Optional. A unique identifier for this request. UUID is the recommended
1371    /// format, but other formats are still accepted.
1372    pub request_id: std::string::String,
1373
1374    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1375}
1376
1377impl ListFoldersRequest {
1378    pub fn new() -> Self {
1379        std::default::Default::default()
1380    }
1381
1382    /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
1383    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1384        self.parent = v.into();
1385        self
1386    }
1387
1388    /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
1389    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1390        self.page_size = v.into();
1391        self
1392    }
1393
1394    /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
1395    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1396        self.page_token = v.into();
1397        self
1398    }
1399
1400    /// Sets the value of [prefix][crate::model::ListFoldersRequest::prefix].
1401    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1402        self.prefix = v.into();
1403        self
1404    }
1405
1406    /// Sets the value of [delimiter][crate::model::ListFoldersRequest::delimiter].
1407    pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1408        self.delimiter = v.into();
1409        self
1410    }
1411
1412    /// Sets the value of [lexicographic_start][crate::model::ListFoldersRequest::lexicographic_start].
1413    pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
1414        mut self,
1415        v: T,
1416    ) -> Self {
1417        self.lexicographic_start = v.into();
1418        self
1419    }
1420
1421    /// Sets the value of [lexicographic_end][crate::model::ListFoldersRequest::lexicographic_end].
1422    pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
1423        mut self,
1424        v: T,
1425    ) -> Self {
1426        self.lexicographic_end = v.into();
1427        self
1428    }
1429
1430    /// Sets the value of [request_id][crate::model::ListFoldersRequest::request_id].
1431    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1432        self.request_id = v.into();
1433        self
1434    }
1435}
1436
1437impl wkt::message::Message for ListFoldersRequest {
1438    fn typename() -> &'static str {
1439        "type.googleapis.com/google.storage.control.v2.ListFoldersRequest"
1440    }
1441}
1442
1443#[doc(hidden)]
1444impl<'de> serde::de::Deserialize<'de> for ListFoldersRequest {
1445    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1446    where
1447        D: serde::Deserializer<'de>,
1448    {
1449        #[allow(non_camel_case_types)]
1450        #[doc(hidden)]
1451        #[derive(PartialEq, Eq, Hash)]
1452        enum __FieldTag {
1453            __parent,
1454            __page_size,
1455            __page_token,
1456            __prefix,
1457            __delimiter,
1458            __lexicographic_start,
1459            __lexicographic_end,
1460            __request_id,
1461            Unknown(std::string::String),
1462        }
1463        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1464            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1465            where
1466                D: serde::Deserializer<'de>,
1467            {
1468                struct Visitor;
1469                impl<'de> serde::de::Visitor<'de> for Visitor {
1470                    type Value = __FieldTag;
1471                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1472                        formatter.write_str("a field name for ListFoldersRequest")
1473                    }
1474                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1475                    where
1476                        E: serde::de::Error,
1477                    {
1478                        use std::result::Result::Ok;
1479                        use std::string::ToString;
1480                        match value {
1481                            "parent" => Ok(__FieldTag::__parent),
1482                            "pageSize" => Ok(__FieldTag::__page_size),
1483                            "page_size" => Ok(__FieldTag::__page_size),
1484                            "pageToken" => Ok(__FieldTag::__page_token),
1485                            "page_token" => Ok(__FieldTag::__page_token),
1486                            "prefix" => Ok(__FieldTag::__prefix),
1487                            "delimiter" => Ok(__FieldTag::__delimiter),
1488                            "lexicographicStart" => Ok(__FieldTag::__lexicographic_start),
1489                            "lexicographic_start" => Ok(__FieldTag::__lexicographic_start),
1490                            "lexicographicEnd" => Ok(__FieldTag::__lexicographic_end),
1491                            "lexicographic_end" => Ok(__FieldTag::__lexicographic_end),
1492                            "requestId" => Ok(__FieldTag::__request_id),
1493                            "request_id" => Ok(__FieldTag::__request_id),
1494                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1495                        }
1496                    }
1497                }
1498                deserializer.deserialize_identifier(Visitor)
1499            }
1500        }
1501        struct Visitor;
1502        impl<'de> serde::de::Visitor<'de> for Visitor {
1503            type Value = ListFoldersRequest;
1504            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1505                formatter.write_str("struct ListFoldersRequest")
1506            }
1507            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1508            where
1509                A: serde::de::MapAccess<'de>,
1510            {
1511                #[allow(unused_imports)]
1512                use serde::de::Error;
1513                use std::option::Option::Some;
1514                let mut fields = std::collections::HashSet::new();
1515                let mut result = Self::Value::new();
1516                while let Some(tag) = map.next_key::<__FieldTag>()? {
1517                    #[allow(clippy::match_single_binding)]
1518                    match tag {
1519                        __FieldTag::__parent => {
1520                            if !fields.insert(__FieldTag::__parent) {
1521                                return std::result::Result::Err(A::Error::duplicate_field(
1522                                    "multiple values for parent",
1523                                ));
1524                            }
1525                            result.parent = map
1526                                .next_value::<std::option::Option<std::string::String>>()?
1527                                .unwrap_or_default();
1528                        }
1529                        __FieldTag::__page_size => {
1530                            if !fields.insert(__FieldTag::__page_size) {
1531                                return std::result::Result::Err(A::Error::duplicate_field(
1532                                    "multiple values for page_size",
1533                                ));
1534                            }
1535                            struct __With(std::option::Option<i32>);
1536                            impl<'de> serde::de::Deserialize<'de> for __With {
1537                                fn deserialize<D>(
1538                                    deserializer: D,
1539                                ) -> std::result::Result<Self, D::Error>
1540                                where
1541                                    D: serde::de::Deserializer<'de>,
1542                                {
1543                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1544                                }
1545                            }
1546                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
1547                        }
1548                        __FieldTag::__page_token => {
1549                            if !fields.insert(__FieldTag::__page_token) {
1550                                return std::result::Result::Err(A::Error::duplicate_field(
1551                                    "multiple values for page_token",
1552                                ));
1553                            }
1554                            result.page_token = map
1555                                .next_value::<std::option::Option<std::string::String>>()?
1556                                .unwrap_or_default();
1557                        }
1558                        __FieldTag::__prefix => {
1559                            if !fields.insert(__FieldTag::__prefix) {
1560                                return std::result::Result::Err(A::Error::duplicate_field(
1561                                    "multiple values for prefix",
1562                                ));
1563                            }
1564                            result.prefix = map
1565                                .next_value::<std::option::Option<std::string::String>>()?
1566                                .unwrap_or_default();
1567                        }
1568                        __FieldTag::__delimiter => {
1569                            if !fields.insert(__FieldTag::__delimiter) {
1570                                return std::result::Result::Err(A::Error::duplicate_field(
1571                                    "multiple values for delimiter",
1572                                ));
1573                            }
1574                            result.delimiter = map
1575                                .next_value::<std::option::Option<std::string::String>>()?
1576                                .unwrap_or_default();
1577                        }
1578                        __FieldTag::__lexicographic_start => {
1579                            if !fields.insert(__FieldTag::__lexicographic_start) {
1580                                return std::result::Result::Err(A::Error::duplicate_field(
1581                                    "multiple values for lexicographic_start",
1582                                ));
1583                            }
1584                            result.lexicographic_start = map
1585                                .next_value::<std::option::Option<std::string::String>>()?
1586                                .unwrap_or_default();
1587                        }
1588                        __FieldTag::__lexicographic_end => {
1589                            if !fields.insert(__FieldTag::__lexicographic_end) {
1590                                return std::result::Result::Err(A::Error::duplicate_field(
1591                                    "multiple values for lexicographic_end",
1592                                ));
1593                            }
1594                            result.lexicographic_end = map
1595                                .next_value::<std::option::Option<std::string::String>>()?
1596                                .unwrap_or_default();
1597                        }
1598                        __FieldTag::__request_id => {
1599                            if !fields.insert(__FieldTag::__request_id) {
1600                                return std::result::Result::Err(A::Error::duplicate_field(
1601                                    "multiple values for request_id",
1602                                ));
1603                            }
1604                            result.request_id = map
1605                                .next_value::<std::option::Option<std::string::String>>()?
1606                                .unwrap_or_default();
1607                        }
1608                        __FieldTag::Unknown(key) => {
1609                            let value = map.next_value::<serde_json::Value>()?;
1610                            result._unknown_fields.insert(key, value);
1611                        }
1612                    }
1613                }
1614                std::result::Result::Ok(result)
1615            }
1616        }
1617        deserializer.deserialize_any(Visitor)
1618    }
1619}
1620
1621#[doc(hidden)]
1622impl serde::ser::Serialize for ListFoldersRequest {
1623    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1624    where
1625        S: serde::ser::Serializer,
1626    {
1627        use serde::ser::SerializeMap;
1628        #[allow(unused_imports)]
1629        use std::option::Option::Some;
1630        let mut state = serializer.serialize_map(std::option::Option::None)?;
1631        if !self.parent.is_empty() {
1632            state.serialize_entry("parent", &self.parent)?;
1633        }
1634        if !wkt::internal::is_default(&self.page_size) {
1635            struct __With<'a>(&'a i32);
1636            impl<'a> serde::ser::Serialize for __With<'a> {
1637                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1638                where
1639                    S: serde::ser::Serializer,
1640                {
1641                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1642                }
1643            }
1644            state.serialize_entry("pageSize", &__With(&self.page_size))?;
1645        }
1646        if !self.page_token.is_empty() {
1647            state.serialize_entry("pageToken", &self.page_token)?;
1648        }
1649        if !self.prefix.is_empty() {
1650            state.serialize_entry("prefix", &self.prefix)?;
1651        }
1652        if !self.delimiter.is_empty() {
1653            state.serialize_entry("delimiter", &self.delimiter)?;
1654        }
1655        if !self.lexicographic_start.is_empty() {
1656            state.serialize_entry("lexicographicStart", &self.lexicographic_start)?;
1657        }
1658        if !self.lexicographic_end.is_empty() {
1659            state.serialize_entry("lexicographicEnd", &self.lexicographic_end)?;
1660        }
1661        if !self.request_id.is_empty() {
1662            state.serialize_entry("requestId", &self.request_id)?;
1663        }
1664        if !self._unknown_fields.is_empty() {
1665            for (key, value) in self._unknown_fields.iter() {
1666                state.serialize_entry(key, &value)?;
1667            }
1668        }
1669        state.end()
1670    }
1671}
1672
1673impl std::fmt::Debug for ListFoldersRequest {
1674    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1675        let mut debug_struct = f.debug_struct("ListFoldersRequest");
1676        debug_struct.field("parent", &self.parent);
1677        debug_struct.field("page_size", &self.page_size);
1678        debug_struct.field("page_token", &self.page_token);
1679        debug_struct.field("prefix", &self.prefix);
1680        debug_struct.field("delimiter", &self.delimiter);
1681        debug_struct.field("lexicographic_start", &self.lexicographic_start);
1682        debug_struct.field("lexicographic_end", &self.lexicographic_end);
1683        debug_struct.field("request_id", &self.request_id);
1684        if !self._unknown_fields.is_empty() {
1685            debug_struct.field("_unknown_fields", &self._unknown_fields);
1686        }
1687        debug_struct.finish()
1688    }
1689}
1690
1691/// Response message for ListFolders.
1692#[derive(Clone, Default, PartialEq)]
1693#[non_exhaustive]
1694pub struct ListFoldersResponse {
1695    /// The list of child folders
1696    pub folders: std::vec::Vec<crate::model::Folder>,
1697
1698    /// The continuation token, used to page through large result sets. Provide
1699    /// this value in a subsequent request to return the next page of results.
1700    pub next_page_token: std::string::String,
1701
1702    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1703}
1704
1705impl ListFoldersResponse {
1706    pub fn new() -> Self {
1707        std::default::Default::default()
1708    }
1709
1710    /// Sets the value of [folders][crate::model::ListFoldersResponse::folders].
1711    pub fn set_folders<T, V>(mut self, v: T) -> Self
1712    where
1713        T: std::iter::IntoIterator<Item = V>,
1714        V: std::convert::Into<crate::model::Folder>,
1715    {
1716        use std::iter::Iterator;
1717        self.folders = v.into_iter().map(|i| i.into()).collect();
1718        self
1719    }
1720
1721    /// Sets the value of [next_page_token][crate::model::ListFoldersResponse::next_page_token].
1722    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1723        self.next_page_token = v.into();
1724        self
1725    }
1726}
1727
1728impl wkt::message::Message for ListFoldersResponse {
1729    fn typename() -> &'static str {
1730        "type.googleapis.com/google.storage.control.v2.ListFoldersResponse"
1731    }
1732}
1733
1734#[doc(hidden)]
1735impl gax::paginator::internal::PageableResponse for ListFoldersResponse {
1736    type PageItem = crate::model::Folder;
1737
1738    fn items(self) -> std::vec::Vec<Self::PageItem> {
1739        self.folders
1740    }
1741
1742    fn next_page_token(&self) -> std::string::String {
1743        use std::clone::Clone;
1744        self.next_page_token.clone()
1745    }
1746}
1747
1748#[doc(hidden)]
1749impl<'de> serde::de::Deserialize<'de> for ListFoldersResponse {
1750    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1751    where
1752        D: serde::Deserializer<'de>,
1753    {
1754        #[allow(non_camel_case_types)]
1755        #[doc(hidden)]
1756        #[derive(PartialEq, Eq, Hash)]
1757        enum __FieldTag {
1758            __folders,
1759            __next_page_token,
1760            Unknown(std::string::String),
1761        }
1762        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1763            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1764            where
1765                D: serde::Deserializer<'de>,
1766            {
1767                struct Visitor;
1768                impl<'de> serde::de::Visitor<'de> for Visitor {
1769                    type Value = __FieldTag;
1770                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1771                        formatter.write_str("a field name for ListFoldersResponse")
1772                    }
1773                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1774                    where
1775                        E: serde::de::Error,
1776                    {
1777                        use std::result::Result::Ok;
1778                        use std::string::ToString;
1779                        match value {
1780                            "folders" => Ok(__FieldTag::__folders),
1781                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
1782                            "next_page_token" => Ok(__FieldTag::__next_page_token),
1783                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1784                        }
1785                    }
1786                }
1787                deserializer.deserialize_identifier(Visitor)
1788            }
1789        }
1790        struct Visitor;
1791        impl<'de> serde::de::Visitor<'de> for Visitor {
1792            type Value = ListFoldersResponse;
1793            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1794                formatter.write_str("struct ListFoldersResponse")
1795            }
1796            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1797            where
1798                A: serde::de::MapAccess<'de>,
1799            {
1800                #[allow(unused_imports)]
1801                use serde::de::Error;
1802                use std::option::Option::Some;
1803                let mut fields = std::collections::HashSet::new();
1804                let mut result = Self::Value::new();
1805                while let Some(tag) = map.next_key::<__FieldTag>()? {
1806                    #[allow(clippy::match_single_binding)]
1807                    match tag {
1808                        __FieldTag::__folders => {
1809                            if !fields.insert(__FieldTag::__folders) {
1810                                return std::result::Result::Err(A::Error::duplicate_field(
1811                                    "multiple values for folders",
1812                                ));
1813                            }
1814                            result.folders = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Folder>>>()?.unwrap_or_default();
1815                        }
1816                        __FieldTag::__next_page_token => {
1817                            if !fields.insert(__FieldTag::__next_page_token) {
1818                                return std::result::Result::Err(A::Error::duplicate_field(
1819                                    "multiple values for next_page_token",
1820                                ));
1821                            }
1822                            result.next_page_token = map
1823                                .next_value::<std::option::Option<std::string::String>>()?
1824                                .unwrap_or_default();
1825                        }
1826                        __FieldTag::Unknown(key) => {
1827                            let value = map.next_value::<serde_json::Value>()?;
1828                            result._unknown_fields.insert(key, value);
1829                        }
1830                    }
1831                }
1832                std::result::Result::Ok(result)
1833            }
1834        }
1835        deserializer.deserialize_any(Visitor)
1836    }
1837}
1838
1839#[doc(hidden)]
1840impl serde::ser::Serialize for ListFoldersResponse {
1841    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1842    where
1843        S: serde::ser::Serializer,
1844    {
1845        use serde::ser::SerializeMap;
1846        #[allow(unused_imports)]
1847        use std::option::Option::Some;
1848        let mut state = serializer.serialize_map(std::option::Option::None)?;
1849        if !self.folders.is_empty() {
1850            state.serialize_entry("folders", &self.folders)?;
1851        }
1852        if !self.next_page_token.is_empty() {
1853            state.serialize_entry("nextPageToken", &self.next_page_token)?;
1854        }
1855        if !self._unknown_fields.is_empty() {
1856            for (key, value) in self._unknown_fields.iter() {
1857                state.serialize_entry(key, &value)?;
1858            }
1859        }
1860        state.end()
1861    }
1862}
1863
1864impl std::fmt::Debug for ListFoldersResponse {
1865    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
1866        let mut debug_struct = f.debug_struct("ListFoldersResponse");
1867        debug_struct.field("folders", &self.folders);
1868        debug_struct.field("next_page_token", &self.next_page_token);
1869        if !self._unknown_fields.is_empty() {
1870            debug_struct.field("_unknown_fields", &self._unknown_fields);
1871        }
1872        debug_struct.finish()
1873    }
1874}
1875
1876/// Request message for RenameFolder. This operation is only applicable to a
1877/// hierarchical namespace enabled bucket.
1878#[derive(Clone, Default, PartialEq)]
1879#[non_exhaustive]
1880pub struct RenameFolderRequest {
1881    /// Required. Name of the source folder being renamed.
1882    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
1883    pub name: std::string::String,
1884
1885    /// Required. The destination folder ID, e.g. `foo/bar/`.
1886    pub destination_folder_id: std::string::String,
1887
1888    /// Makes the operation only succeed conditional on whether the source
1889    /// folder's current metageneration matches the given value.
1890    pub if_metageneration_match: std::option::Option<i64>,
1891
1892    /// Makes the operation only succeed conditional on whether the source
1893    /// folder's current metageneration does not match the given value.
1894    pub if_metageneration_not_match: std::option::Option<i64>,
1895
1896    /// Optional. A unique identifier for this request. UUID is the recommended
1897    /// format, but other formats are still accepted. This request is only
1898    /// idempotent if a `request_id` is provided.
1899    pub request_id: std::string::String,
1900
1901    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1902}
1903
1904impl RenameFolderRequest {
1905    pub fn new() -> Self {
1906        std::default::Default::default()
1907    }
1908
1909    /// Sets the value of [name][crate::model::RenameFolderRequest::name].
1910    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1911        self.name = v.into();
1912        self
1913    }
1914
1915    /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
1916    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
1917        mut self,
1918        v: T,
1919    ) -> Self {
1920        self.destination_folder_id = v.into();
1921        self
1922    }
1923
1924    /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
1925    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1926    where
1927        T: std::convert::Into<i64>,
1928    {
1929        self.if_metageneration_match = std::option::Option::Some(v.into());
1930        self
1931    }
1932
1933    /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
1934    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1935    where
1936        T: std::convert::Into<i64>,
1937    {
1938        self.if_metageneration_match = v.map(|x| x.into());
1939        self
1940    }
1941
1942    /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
1943    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1944    where
1945        T: std::convert::Into<i64>,
1946    {
1947        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1948        self
1949    }
1950
1951    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
1952    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1953    where
1954        T: std::convert::Into<i64>,
1955    {
1956        self.if_metageneration_not_match = v.map(|x| x.into());
1957        self
1958    }
1959
1960    /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
1961    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1962        self.request_id = v.into();
1963        self
1964    }
1965}
1966
1967impl wkt::message::Message for RenameFolderRequest {
1968    fn typename() -> &'static str {
1969        "type.googleapis.com/google.storage.control.v2.RenameFolderRequest"
1970    }
1971}
1972
1973#[doc(hidden)]
1974impl<'de> serde::de::Deserialize<'de> for RenameFolderRequest {
1975    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1976    where
1977        D: serde::Deserializer<'de>,
1978    {
1979        #[allow(non_camel_case_types)]
1980        #[doc(hidden)]
1981        #[derive(PartialEq, Eq, Hash)]
1982        enum __FieldTag {
1983            __name,
1984            __destination_folder_id,
1985            __if_metageneration_match,
1986            __if_metageneration_not_match,
1987            __request_id,
1988            Unknown(std::string::String),
1989        }
1990        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1991            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1992            where
1993                D: serde::Deserializer<'de>,
1994            {
1995                struct Visitor;
1996                impl<'de> serde::de::Visitor<'de> for Visitor {
1997                    type Value = __FieldTag;
1998                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1999                        formatter.write_str("a field name for RenameFolderRequest")
2000                    }
2001                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2002                    where
2003                        E: serde::de::Error,
2004                    {
2005                        use std::result::Result::Ok;
2006                        use std::string::ToString;
2007                        match value {
2008                            "name" => Ok(__FieldTag::__name),
2009                            "destinationFolderId" => Ok(__FieldTag::__destination_folder_id),
2010                            "destination_folder_id" => Ok(__FieldTag::__destination_folder_id),
2011                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
2012                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
2013                            "ifMetagenerationNotMatch" => {
2014                                Ok(__FieldTag::__if_metageneration_not_match)
2015                            }
2016                            "if_metageneration_not_match" => {
2017                                Ok(__FieldTag::__if_metageneration_not_match)
2018                            }
2019                            "requestId" => Ok(__FieldTag::__request_id),
2020                            "request_id" => Ok(__FieldTag::__request_id),
2021                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2022                        }
2023                    }
2024                }
2025                deserializer.deserialize_identifier(Visitor)
2026            }
2027        }
2028        struct Visitor;
2029        impl<'de> serde::de::Visitor<'de> for Visitor {
2030            type Value = RenameFolderRequest;
2031            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2032                formatter.write_str("struct RenameFolderRequest")
2033            }
2034            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2035            where
2036                A: serde::de::MapAccess<'de>,
2037            {
2038                #[allow(unused_imports)]
2039                use serde::de::Error;
2040                use std::option::Option::Some;
2041                let mut fields = std::collections::HashSet::new();
2042                let mut result = Self::Value::new();
2043                while let Some(tag) = map.next_key::<__FieldTag>()? {
2044                    #[allow(clippy::match_single_binding)]
2045                    match tag {
2046                        __FieldTag::__name => {
2047                            if !fields.insert(__FieldTag::__name) {
2048                                return std::result::Result::Err(A::Error::duplicate_field(
2049                                    "multiple values for name",
2050                                ));
2051                            }
2052                            result.name = map
2053                                .next_value::<std::option::Option<std::string::String>>()?
2054                                .unwrap_or_default();
2055                        }
2056                        __FieldTag::__destination_folder_id => {
2057                            if !fields.insert(__FieldTag::__destination_folder_id) {
2058                                return std::result::Result::Err(A::Error::duplicate_field(
2059                                    "multiple values for destination_folder_id",
2060                                ));
2061                            }
2062                            result.destination_folder_id = map
2063                                .next_value::<std::option::Option<std::string::String>>()?
2064                                .unwrap_or_default();
2065                        }
2066                        __FieldTag::__if_metageneration_match => {
2067                            if !fields.insert(__FieldTag::__if_metageneration_match) {
2068                                return std::result::Result::Err(A::Error::duplicate_field(
2069                                    "multiple values for if_metageneration_match",
2070                                ));
2071                            }
2072                            struct __With(std::option::Option<i64>);
2073                            impl<'de> serde::de::Deserialize<'de> for __With {
2074                                fn deserialize<D>(
2075                                    deserializer: D,
2076                                ) -> std::result::Result<Self, D::Error>
2077                                where
2078                                    D: serde::de::Deserializer<'de>,
2079                                {
2080                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2081                                }
2082                            }
2083                            result.if_metageneration_match = map.next_value::<__With>()?.0;
2084                        }
2085                        __FieldTag::__if_metageneration_not_match => {
2086                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
2087                                return std::result::Result::Err(A::Error::duplicate_field(
2088                                    "multiple values for if_metageneration_not_match",
2089                                ));
2090                            }
2091                            struct __With(std::option::Option<i64>);
2092                            impl<'de> serde::de::Deserialize<'de> for __With {
2093                                fn deserialize<D>(
2094                                    deserializer: D,
2095                                ) -> std::result::Result<Self, D::Error>
2096                                where
2097                                    D: serde::de::Deserializer<'de>,
2098                                {
2099                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
2100                                }
2101                            }
2102                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
2103                        }
2104                        __FieldTag::__request_id => {
2105                            if !fields.insert(__FieldTag::__request_id) {
2106                                return std::result::Result::Err(A::Error::duplicate_field(
2107                                    "multiple values for request_id",
2108                                ));
2109                            }
2110                            result.request_id = map
2111                                .next_value::<std::option::Option<std::string::String>>()?
2112                                .unwrap_or_default();
2113                        }
2114                        __FieldTag::Unknown(key) => {
2115                            let value = map.next_value::<serde_json::Value>()?;
2116                            result._unknown_fields.insert(key, value);
2117                        }
2118                    }
2119                }
2120                std::result::Result::Ok(result)
2121            }
2122        }
2123        deserializer.deserialize_any(Visitor)
2124    }
2125}
2126
2127#[doc(hidden)]
2128impl serde::ser::Serialize for RenameFolderRequest {
2129    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2130    where
2131        S: serde::ser::Serializer,
2132    {
2133        use serde::ser::SerializeMap;
2134        #[allow(unused_imports)]
2135        use std::option::Option::Some;
2136        let mut state = serializer.serialize_map(std::option::Option::None)?;
2137        if !self.name.is_empty() {
2138            state.serialize_entry("name", &self.name)?;
2139        }
2140        if !self.destination_folder_id.is_empty() {
2141            state.serialize_entry("destinationFolderId", &self.destination_folder_id)?;
2142        }
2143        if self.if_metageneration_match.is_some() {
2144            struct __With<'a>(&'a std::option::Option<i64>);
2145            impl<'a> serde::ser::Serialize for __With<'a> {
2146                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2147                where
2148                    S: serde::ser::Serializer,
2149                {
2150                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
2151                        self.0, serializer,
2152                    )
2153                }
2154            }
2155            state.serialize_entry(
2156                "ifMetagenerationMatch",
2157                &__With(&self.if_metageneration_match),
2158            )?;
2159        }
2160        if self.if_metageneration_not_match.is_some() {
2161            struct __With<'a>(&'a std::option::Option<i64>);
2162            impl<'a> serde::ser::Serialize for __With<'a> {
2163                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2164                where
2165                    S: serde::ser::Serializer,
2166                {
2167                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
2168                        self.0, serializer,
2169                    )
2170                }
2171            }
2172            state.serialize_entry(
2173                "ifMetagenerationNotMatch",
2174                &__With(&self.if_metageneration_not_match),
2175            )?;
2176        }
2177        if !self.request_id.is_empty() {
2178            state.serialize_entry("requestId", &self.request_id)?;
2179        }
2180        if !self._unknown_fields.is_empty() {
2181            for (key, value) in self._unknown_fields.iter() {
2182                state.serialize_entry(key, &value)?;
2183            }
2184        }
2185        state.end()
2186    }
2187}
2188
2189impl std::fmt::Debug for RenameFolderRequest {
2190    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2191        let mut debug_struct = f.debug_struct("RenameFolderRequest");
2192        debug_struct.field("name", &self.name);
2193        debug_struct.field("destination_folder_id", &self.destination_folder_id);
2194        debug_struct.field("if_metageneration_match", &self.if_metageneration_match);
2195        debug_struct.field(
2196            "if_metageneration_not_match",
2197            &self.if_metageneration_not_match,
2198        );
2199        debug_struct.field("request_id", &self.request_id);
2200        if !self._unknown_fields.is_empty() {
2201            debug_struct.field("_unknown_fields", &self._unknown_fields);
2202        }
2203        debug_struct.finish()
2204    }
2205}
2206
2207/// The message contains metadata that is common to all Storage Control
2208/// long-running operations, present in its `google.longrunning.Operation`
2209/// messages, and accessible via `metadata.common_metadata`.
2210#[derive(Clone, Default, PartialEq)]
2211#[non_exhaustive]
2212pub struct CommonLongRunningOperationMetadata {
2213    /// Output only. The time the operation was created.
2214    pub create_time: std::option::Option<wkt::Timestamp>,
2215
2216    /// Output only. The time the operation finished running.
2217    pub end_time: std::option::Option<wkt::Timestamp>,
2218
2219    /// Output only. The time the operation was last modified.
2220    pub update_time: std::option::Option<wkt::Timestamp>,
2221
2222    /// Output only. The type of operation invoked.
2223    pub r#type: std::string::String,
2224
2225    /// Output only. Identifies whether the user has requested cancellation.
2226    pub requested_cancellation: bool,
2227
2228    /// Output only. The estimated progress of the operation in percentage [0,
2229    /// 100]. The value -1 means the progress is unknown.
2230    pub progress_percent: i32,
2231
2232    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2233}
2234
2235impl CommonLongRunningOperationMetadata {
2236    pub fn new() -> Self {
2237        std::default::Default::default()
2238    }
2239
2240    /// Sets the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
2241    pub fn set_create_time<T>(mut self, v: T) -> Self
2242    where
2243        T: std::convert::Into<wkt::Timestamp>,
2244    {
2245        self.create_time = std::option::Option::Some(v.into());
2246        self
2247    }
2248
2249    /// Sets or clears the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
2250    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2251    where
2252        T: std::convert::Into<wkt::Timestamp>,
2253    {
2254        self.create_time = v.map(|x| x.into());
2255        self
2256    }
2257
2258    /// Sets the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
2259    pub fn set_end_time<T>(mut self, v: T) -> Self
2260    where
2261        T: std::convert::Into<wkt::Timestamp>,
2262    {
2263        self.end_time = std::option::Option::Some(v.into());
2264        self
2265    }
2266
2267    /// Sets or clears the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
2268    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2269    where
2270        T: std::convert::Into<wkt::Timestamp>,
2271    {
2272        self.end_time = v.map(|x| x.into());
2273        self
2274    }
2275
2276    /// Sets the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
2277    pub fn set_update_time<T>(mut self, v: T) -> Self
2278    where
2279        T: std::convert::Into<wkt::Timestamp>,
2280    {
2281        self.update_time = std::option::Option::Some(v.into());
2282        self
2283    }
2284
2285    /// Sets or clears the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
2286    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2287    where
2288        T: std::convert::Into<wkt::Timestamp>,
2289    {
2290        self.update_time = v.map(|x| x.into());
2291        self
2292    }
2293
2294    /// Sets the value of [r#type][crate::model::CommonLongRunningOperationMetadata::type].
2295    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2296        self.r#type = v.into();
2297        self
2298    }
2299
2300    /// Sets the value of [requested_cancellation][crate::model::CommonLongRunningOperationMetadata::requested_cancellation].
2301    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2302        self.requested_cancellation = v.into();
2303        self
2304    }
2305
2306    /// Sets the value of [progress_percent][crate::model::CommonLongRunningOperationMetadata::progress_percent].
2307    pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2308        self.progress_percent = v.into();
2309        self
2310    }
2311}
2312
2313impl wkt::message::Message for CommonLongRunningOperationMetadata {
2314    fn typename() -> &'static str {
2315        "type.googleapis.com/google.storage.control.v2.CommonLongRunningOperationMetadata"
2316    }
2317}
2318
2319#[doc(hidden)]
2320impl<'de> serde::de::Deserialize<'de> for CommonLongRunningOperationMetadata {
2321    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2322    where
2323        D: serde::Deserializer<'de>,
2324    {
2325        #[allow(non_camel_case_types)]
2326        #[doc(hidden)]
2327        #[derive(PartialEq, Eq, Hash)]
2328        enum __FieldTag {
2329            __create_time,
2330            __end_time,
2331            __update_time,
2332            __type,
2333            __requested_cancellation,
2334            __progress_percent,
2335            Unknown(std::string::String),
2336        }
2337        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2338            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2339            where
2340                D: serde::Deserializer<'de>,
2341            {
2342                struct Visitor;
2343                impl<'de> serde::de::Visitor<'de> for Visitor {
2344                    type Value = __FieldTag;
2345                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2346                        formatter.write_str("a field name for CommonLongRunningOperationMetadata")
2347                    }
2348                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2349                    where
2350                        E: serde::de::Error,
2351                    {
2352                        use std::result::Result::Ok;
2353                        use std::string::ToString;
2354                        match value {
2355                            "createTime" => Ok(__FieldTag::__create_time),
2356                            "create_time" => Ok(__FieldTag::__create_time),
2357                            "endTime" => Ok(__FieldTag::__end_time),
2358                            "end_time" => Ok(__FieldTag::__end_time),
2359                            "updateTime" => Ok(__FieldTag::__update_time),
2360                            "update_time" => Ok(__FieldTag::__update_time),
2361                            "type" => Ok(__FieldTag::__type),
2362                            "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
2363                            "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
2364                            "progressPercent" => Ok(__FieldTag::__progress_percent),
2365                            "progress_percent" => Ok(__FieldTag::__progress_percent),
2366                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2367                        }
2368                    }
2369                }
2370                deserializer.deserialize_identifier(Visitor)
2371            }
2372        }
2373        struct Visitor;
2374        impl<'de> serde::de::Visitor<'de> for Visitor {
2375            type Value = CommonLongRunningOperationMetadata;
2376            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2377                formatter.write_str("struct CommonLongRunningOperationMetadata")
2378            }
2379            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2380            where
2381                A: serde::de::MapAccess<'de>,
2382            {
2383                #[allow(unused_imports)]
2384                use serde::de::Error;
2385                use std::option::Option::Some;
2386                let mut fields = std::collections::HashSet::new();
2387                let mut result = Self::Value::new();
2388                while let Some(tag) = map.next_key::<__FieldTag>()? {
2389                    #[allow(clippy::match_single_binding)]
2390                    match tag {
2391                        __FieldTag::__create_time => {
2392                            if !fields.insert(__FieldTag::__create_time) {
2393                                return std::result::Result::Err(A::Error::duplicate_field(
2394                                    "multiple values for create_time",
2395                                ));
2396                            }
2397                            result.create_time =
2398                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2399                        }
2400                        __FieldTag::__end_time => {
2401                            if !fields.insert(__FieldTag::__end_time) {
2402                                return std::result::Result::Err(A::Error::duplicate_field(
2403                                    "multiple values for end_time",
2404                                ));
2405                            }
2406                            result.end_time =
2407                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2408                        }
2409                        __FieldTag::__update_time => {
2410                            if !fields.insert(__FieldTag::__update_time) {
2411                                return std::result::Result::Err(A::Error::duplicate_field(
2412                                    "multiple values for update_time",
2413                                ));
2414                            }
2415                            result.update_time =
2416                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2417                        }
2418                        __FieldTag::__type => {
2419                            if !fields.insert(__FieldTag::__type) {
2420                                return std::result::Result::Err(A::Error::duplicate_field(
2421                                    "multiple values for type",
2422                                ));
2423                            }
2424                            result.r#type = map
2425                                .next_value::<std::option::Option<std::string::String>>()?
2426                                .unwrap_or_default();
2427                        }
2428                        __FieldTag::__requested_cancellation => {
2429                            if !fields.insert(__FieldTag::__requested_cancellation) {
2430                                return std::result::Result::Err(A::Error::duplicate_field(
2431                                    "multiple values for requested_cancellation",
2432                                ));
2433                            }
2434                            result.requested_cancellation = map
2435                                .next_value::<std::option::Option<bool>>()?
2436                                .unwrap_or_default();
2437                        }
2438                        __FieldTag::__progress_percent => {
2439                            if !fields.insert(__FieldTag::__progress_percent) {
2440                                return std::result::Result::Err(A::Error::duplicate_field(
2441                                    "multiple values for progress_percent",
2442                                ));
2443                            }
2444                            struct __With(std::option::Option<i32>);
2445                            impl<'de> serde::de::Deserialize<'de> for __With {
2446                                fn deserialize<D>(
2447                                    deserializer: D,
2448                                ) -> std::result::Result<Self, D::Error>
2449                                where
2450                                    D: serde::de::Deserializer<'de>,
2451                                {
2452                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
2453                                }
2454                            }
2455                            result.progress_percent =
2456                                map.next_value::<__With>()?.0.unwrap_or_default();
2457                        }
2458                        __FieldTag::Unknown(key) => {
2459                            let value = map.next_value::<serde_json::Value>()?;
2460                            result._unknown_fields.insert(key, value);
2461                        }
2462                    }
2463                }
2464                std::result::Result::Ok(result)
2465            }
2466        }
2467        deserializer.deserialize_any(Visitor)
2468    }
2469}
2470
2471#[doc(hidden)]
2472impl serde::ser::Serialize for CommonLongRunningOperationMetadata {
2473    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2474    where
2475        S: serde::ser::Serializer,
2476    {
2477        use serde::ser::SerializeMap;
2478        #[allow(unused_imports)]
2479        use std::option::Option::Some;
2480        let mut state = serializer.serialize_map(std::option::Option::None)?;
2481        if self.create_time.is_some() {
2482            state.serialize_entry("createTime", &self.create_time)?;
2483        }
2484        if self.end_time.is_some() {
2485            state.serialize_entry("endTime", &self.end_time)?;
2486        }
2487        if self.update_time.is_some() {
2488            state.serialize_entry("updateTime", &self.update_time)?;
2489        }
2490        if !self.r#type.is_empty() {
2491            state.serialize_entry("type", &self.r#type)?;
2492        }
2493        if !wkt::internal::is_default(&self.requested_cancellation) {
2494            state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
2495        }
2496        if !wkt::internal::is_default(&self.progress_percent) {
2497            struct __With<'a>(&'a i32);
2498            impl<'a> serde::ser::Serialize for __With<'a> {
2499                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2500                where
2501                    S: serde::ser::Serializer,
2502                {
2503                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
2504                }
2505            }
2506            state.serialize_entry("progressPercent", &__With(&self.progress_percent))?;
2507        }
2508        if !self._unknown_fields.is_empty() {
2509            for (key, value) in self._unknown_fields.iter() {
2510                state.serialize_entry(key, &value)?;
2511            }
2512        }
2513        state.end()
2514    }
2515}
2516
2517impl std::fmt::Debug for CommonLongRunningOperationMetadata {
2518    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2519        let mut debug_struct = f.debug_struct("CommonLongRunningOperationMetadata");
2520        debug_struct.field("create_time", &self.create_time);
2521        debug_struct.field("end_time", &self.end_time);
2522        debug_struct.field("update_time", &self.update_time);
2523        debug_struct.field("r#type", &self.r#type);
2524        debug_struct.field("requested_cancellation", &self.requested_cancellation);
2525        debug_struct.field("progress_percent", &self.progress_percent);
2526        if !self._unknown_fields.is_empty() {
2527            debug_struct.field("_unknown_fields", &self._unknown_fields);
2528        }
2529        debug_struct.finish()
2530    }
2531}
2532
2533/// Message returned in the metadata field of the Operation resource for
2534/// RenameFolder operations.
2535#[derive(Clone, Default, PartialEq)]
2536#[non_exhaustive]
2537pub struct RenameFolderMetadata {
2538    /// Generic metadata for the long running operation.
2539    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
2540
2541    /// The path of the source folder.
2542    pub source_folder_id: std::string::String,
2543
2544    /// The path of the destination folder.
2545    pub destination_folder_id: std::string::String,
2546
2547    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2548}
2549
2550impl RenameFolderMetadata {
2551    pub fn new() -> Self {
2552        std::default::Default::default()
2553    }
2554
2555    /// Sets the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
2556    pub fn set_common_metadata<T>(mut self, v: T) -> Self
2557    where
2558        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2559    {
2560        self.common_metadata = std::option::Option::Some(v.into());
2561        self
2562    }
2563
2564    /// Sets or clears the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
2565    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2566    where
2567        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2568    {
2569        self.common_metadata = v.map(|x| x.into());
2570        self
2571    }
2572
2573    /// Sets the value of [source_folder_id][crate::model::RenameFolderMetadata::source_folder_id].
2574    pub fn set_source_folder_id<T: std::convert::Into<std::string::String>>(
2575        mut self,
2576        v: T,
2577    ) -> Self {
2578        self.source_folder_id = v.into();
2579        self
2580    }
2581
2582    /// Sets the value of [destination_folder_id][crate::model::RenameFolderMetadata::destination_folder_id].
2583    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
2584        mut self,
2585        v: T,
2586    ) -> Self {
2587        self.destination_folder_id = v.into();
2588        self
2589    }
2590}
2591
2592impl wkt::message::Message for RenameFolderMetadata {
2593    fn typename() -> &'static str {
2594        "type.googleapis.com/google.storage.control.v2.RenameFolderMetadata"
2595    }
2596}
2597
2598#[doc(hidden)]
2599impl<'de> serde::de::Deserialize<'de> for RenameFolderMetadata {
2600    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2601    where
2602        D: serde::Deserializer<'de>,
2603    {
2604        #[allow(non_camel_case_types)]
2605        #[doc(hidden)]
2606        #[derive(PartialEq, Eq, Hash)]
2607        enum __FieldTag {
2608            __common_metadata,
2609            __source_folder_id,
2610            __destination_folder_id,
2611            Unknown(std::string::String),
2612        }
2613        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2614            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2615            where
2616                D: serde::Deserializer<'de>,
2617            {
2618                struct Visitor;
2619                impl<'de> serde::de::Visitor<'de> for Visitor {
2620                    type Value = __FieldTag;
2621                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2622                        formatter.write_str("a field name for RenameFolderMetadata")
2623                    }
2624                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2625                    where
2626                        E: serde::de::Error,
2627                    {
2628                        use std::result::Result::Ok;
2629                        use std::string::ToString;
2630                        match value {
2631                            "commonMetadata" => Ok(__FieldTag::__common_metadata),
2632                            "common_metadata" => Ok(__FieldTag::__common_metadata),
2633                            "sourceFolderId" => Ok(__FieldTag::__source_folder_id),
2634                            "source_folder_id" => Ok(__FieldTag::__source_folder_id),
2635                            "destinationFolderId" => Ok(__FieldTag::__destination_folder_id),
2636                            "destination_folder_id" => Ok(__FieldTag::__destination_folder_id),
2637                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2638                        }
2639                    }
2640                }
2641                deserializer.deserialize_identifier(Visitor)
2642            }
2643        }
2644        struct Visitor;
2645        impl<'de> serde::de::Visitor<'de> for Visitor {
2646            type Value = RenameFolderMetadata;
2647            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2648                formatter.write_str("struct RenameFolderMetadata")
2649            }
2650            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2651            where
2652                A: serde::de::MapAccess<'de>,
2653            {
2654                #[allow(unused_imports)]
2655                use serde::de::Error;
2656                use std::option::Option::Some;
2657                let mut fields = std::collections::HashSet::new();
2658                let mut result = Self::Value::new();
2659                while let Some(tag) = map.next_key::<__FieldTag>()? {
2660                    #[allow(clippy::match_single_binding)]
2661                    match tag {
2662                        __FieldTag::__common_metadata => {
2663                            if !fields.insert(__FieldTag::__common_metadata) {
2664                                return std::result::Result::Err(A::Error::duplicate_field(
2665                                    "multiple values for common_metadata",
2666                                ));
2667                            }
2668                            result.common_metadata = map.next_value::<std::option::Option<
2669                                crate::model::CommonLongRunningOperationMetadata,
2670                            >>()?;
2671                        }
2672                        __FieldTag::__source_folder_id => {
2673                            if !fields.insert(__FieldTag::__source_folder_id) {
2674                                return std::result::Result::Err(A::Error::duplicate_field(
2675                                    "multiple values for source_folder_id",
2676                                ));
2677                            }
2678                            result.source_folder_id = map
2679                                .next_value::<std::option::Option<std::string::String>>()?
2680                                .unwrap_or_default();
2681                        }
2682                        __FieldTag::__destination_folder_id => {
2683                            if !fields.insert(__FieldTag::__destination_folder_id) {
2684                                return std::result::Result::Err(A::Error::duplicate_field(
2685                                    "multiple values for destination_folder_id",
2686                                ));
2687                            }
2688                            result.destination_folder_id = map
2689                                .next_value::<std::option::Option<std::string::String>>()?
2690                                .unwrap_or_default();
2691                        }
2692                        __FieldTag::Unknown(key) => {
2693                            let value = map.next_value::<serde_json::Value>()?;
2694                            result._unknown_fields.insert(key, value);
2695                        }
2696                    }
2697                }
2698                std::result::Result::Ok(result)
2699            }
2700        }
2701        deserializer.deserialize_any(Visitor)
2702    }
2703}
2704
2705#[doc(hidden)]
2706impl serde::ser::Serialize for RenameFolderMetadata {
2707    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2708    where
2709        S: serde::ser::Serializer,
2710    {
2711        use serde::ser::SerializeMap;
2712        #[allow(unused_imports)]
2713        use std::option::Option::Some;
2714        let mut state = serializer.serialize_map(std::option::Option::None)?;
2715        if self.common_metadata.is_some() {
2716            state.serialize_entry("commonMetadata", &self.common_metadata)?;
2717        }
2718        if !self.source_folder_id.is_empty() {
2719            state.serialize_entry("sourceFolderId", &self.source_folder_id)?;
2720        }
2721        if !self.destination_folder_id.is_empty() {
2722            state.serialize_entry("destinationFolderId", &self.destination_folder_id)?;
2723        }
2724        if !self._unknown_fields.is_empty() {
2725            for (key, value) in self._unknown_fields.iter() {
2726                state.serialize_entry(key, &value)?;
2727            }
2728        }
2729        state.end()
2730    }
2731}
2732
2733impl std::fmt::Debug for RenameFolderMetadata {
2734    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2735        let mut debug_struct = f.debug_struct("RenameFolderMetadata");
2736        debug_struct.field("common_metadata", &self.common_metadata);
2737        debug_struct.field("source_folder_id", &self.source_folder_id);
2738        debug_struct.field("destination_folder_id", &self.destination_folder_id);
2739        if !self._unknown_fields.is_empty() {
2740            debug_struct.field("_unknown_fields", &self._unknown_fields);
2741        }
2742        debug_struct.finish()
2743    }
2744}
2745
2746/// The storage layout configuration of a bucket.
2747#[derive(Clone, Default, PartialEq)]
2748#[non_exhaustive]
2749pub struct StorageLayout {
2750    /// Output only. The name of the StorageLayout resource.
2751    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
2752    pub name: std::string::String,
2753
2754    /// Output only. The location of the bucket.
2755    pub location: std::string::String,
2756
2757    /// Output only. The location type of the bucket (region, dual-region,
2758    /// multi-region, etc).
2759    pub location_type: std::string::String,
2760
2761    /// Output only. The data placement configuration for custom dual region. If
2762    /// there is no configuration, this is not a custom dual region bucket.
2763    pub custom_placement_config:
2764        std::option::Option<crate::model::storage_layout::CustomPlacementConfig>,
2765
2766    /// Output only. The bucket's hierarchical namespace configuration. If there is
2767    /// no configuration, the hierarchical namespace is disabled.
2768    pub hierarchical_namespace:
2769        std::option::Option<crate::model::storage_layout::HierarchicalNamespace>,
2770
2771    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2772}
2773
2774impl StorageLayout {
2775    pub fn new() -> Self {
2776        std::default::Default::default()
2777    }
2778
2779    /// Sets the value of [name][crate::model::StorageLayout::name].
2780    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2781        self.name = v.into();
2782        self
2783    }
2784
2785    /// Sets the value of [location][crate::model::StorageLayout::location].
2786    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2787        self.location = v.into();
2788        self
2789    }
2790
2791    /// Sets the value of [location_type][crate::model::StorageLayout::location_type].
2792    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2793        self.location_type = v.into();
2794        self
2795    }
2796
2797    /// Sets the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
2798    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
2799    where
2800        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
2801    {
2802        self.custom_placement_config = std::option::Option::Some(v.into());
2803        self
2804    }
2805
2806    /// Sets or clears the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
2807    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
2808    where
2809        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
2810    {
2811        self.custom_placement_config = v.map(|x| x.into());
2812        self
2813    }
2814
2815    /// Sets the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
2816    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
2817    where
2818        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
2819    {
2820        self.hierarchical_namespace = std::option::Option::Some(v.into());
2821        self
2822    }
2823
2824    /// Sets or clears the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
2825    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
2826    where
2827        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
2828    {
2829        self.hierarchical_namespace = v.map(|x| x.into());
2830        self
2831    }
2832}
2833
2834impl wkt::message::Message for StorageLayout {
2835    fn typename() -> &'static str {
2836        "type.googleapis.com/google.storage.control.v2.StorageLayout"
2837    }
2838}
2839
2840#[doc(hidden)]
2841impl<'de> serde::de::Deserialize<'de> for StorageLayout {
2842    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2843    where
2844        D: serde::Deserializer<'de>,
2845    {
2846        #[allow(non_camel_case_types)]
2847        #[doc(hidden)]
2848        #[derive(PartialEq, Eq, Hash)]
2849        enum __FieldTag {
2850            __name,
2851            __location,
2852            __location_type,
2853            __custom_placement_config,
2854            __hierarchical_namespace,
2855            Unknown(std::string::String),
2856        }
2857        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2858            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2859            where
2860                D: serde::Deserializer<'de>,
2861            {
2862                struct Visitor;
2863                impl<'de> serde::de::Visitor<'de> for Visitor {
2864                    type Value = __FieldTag;
2865                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2866                        formatter.write_str("a field name for StorageLayout")
2867                    }
2868                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2869                    where
2870                        E: serde::de::Error,
2871                    {
2872                        use std::result::Result::Ok;
2873                        use std::string::ToString;
2874                        match value {
2875                            "name" => Ok(__FieldTag::__name),
2876                            "location" => Ok(__FieldTag::__location),
2877                            "locationType" => Ok(__FieldTag::__location_type),
2878                            "location_type" => Ok(__FieldTag::__location_type),
2879                            "customPlacementConfig" => Ok(__FieldTag::__custom_placement_config),
2880                            "custom_placement_config" => Ok(__FieldTag::__custom_placement_config),
2881                            "hierarchicalNamespace" => Ok(__FieldTag::__hierarchical_namespace),
2882                            "hierarchical_namespace" => Ok(__FieldTag::__hierarchical_namespace),
2883                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2884                        }
2885                    }
2886                }
2887                deserializer.deserialize_identifier(Visitor)
2888            }
2889        }
2890        struct Visitor;
2891        impl<'de> serde::de::Visitor<'de> for Visitor {
2892            type Value = StorageLayout;
2893            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2894                formatter.write_str("struct StorageLayout")
2895            }
2896            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2897            where
2898                A: serde::de::MapAccess<'de>,
2899            {
2900                #[allow(unused_imports)]
2901                use serde::de::Error;
2902                use std::option::Option::Some;
2903                let mut fields = std::collections::HashSet::new();
2904                let mut result = Self::Value::new();
2905                while let Some(tag) = map.next_key::<__FieldTag>()? {
2906                    #[allow(clippy::match_single_binding)]
2907                    match tag {
2908                        __FieldTag::__name => {
2909                            if !fields.insert(__FieldTag::__name) {
2910                                return std::result::Result::Err(A::Error::duplicate_field(
2911                                    "multiple values for name",
2912                                ));
2913                            }
2914                            result.name = map
2915                                .next_value::<std::option::Option<std::string::String>>()?
2916                                .unwrap_or_default();
2917                        }
2918                        __FieldTag::__location => {
2919                            if !fields.insert(__FieldTag::__location) {
2920                                return std::result::Result::Err(A::Error::duplicate_field(
2921                                    "multiple values for location",
2922                                ));
2923                            }
2924                            result.location = map
2925                                .next_value::<std::option::Option<std::string::String>>()?
2926                                .unwrap_or_default();
2927                        }
2928                        __FieldTag::__location_type => {
2929                            if !fields.insert(__FieldTag::__location_type) {
2930                                return std::result::Result::Err(A::Error::duplicate_field(
2931                                    "multiple values for location_type",
2932                                ));
2933                            }
2934                            result.location_type = map
2935                                .next_value::<std::option::Option<std::string::String>>()?
2936                                .unwrap_or_default();
2937                        }
2938                        __FieldTag::__custom_placement_config => {
2939                            if !fields.insert(__FieldTag::__custom_placement_config) {
2940                                return std::result::Result::Err(A::Error::duplicate_field(
2941                                    "multiple values for custom_placement_config",
2942                                ));
2943                            }
2944                            result.custom_placement_config = map.next_value::<std::option::Option<
2945                                crate::model::storage_layout::CustomPlacementConfig,
2946                            >>()?;
2947                        }
2948                        __FieldTag::__hierarchical_namespace => {
2949                            if !fields.insert(__FieldTag::__hierarchical_namespace) {
2950                                return std::result::Result::Err(A::Error::duplicate_field(
2951                                    "multiple values for hierarchical_namespace",
2952                                ));
2953                            }
2954                            result.hierarchical_namespace = map.next_value::<std::option::Option<
2955                                crate::model::storage_layout::HierarchicalNamespace,
2956                            >>()?;
2957                        }
2958                        __FieldTag::Unknown(key) => {
2959                            let value = map.next_value::<serde_json::Value>()?;
2960                            result._unknown_fields.insert(key, value);
2961                        }
2962                    }
2963                }
2964                std::result::Result::Ok(result)
2965            }
2966        }
2967        deserializer.deserialize_any(Visitor)
2968    }
2969}
2970
2971#[doc(hidden)]
2972impl serde::ser::Serialize for StorageLayout {
2973    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2974    where
2975        S: serde::ser::Serializer,
2976    {
2977        use serde::ser::SerializeMap;
2978        #[allow(unused_imports)]
2979        use std::option::Option::Some;
2980        let mut state = serializer.serialize_map(std::option::Option::None)?;
2981        if !self.name.is_empty() {
2982            state.serialize_entry("name", &self.name)?;
2983        }
2984        if !self.location.is_empty() {
2985            state.serialize_entry("location", &self.location)?;
2986        }
2987        if !self.location_type.is_empty() {
2988            state.serialize_entry("locationType", &self.location_type)?;
2989        }
2990        if self.custom_placement_config.is_some() {
2991            state.serialize_entry("customPlacementConfig", &self.custom_placement_config)?;
2992        }
2993        if self.hierarchical_namespace.is_some() {
2994            state.serialize_entry("hierarchicalNamespace", &self.hierarchical_namespace)?;
2995        }
2996        if !self._unknown_fields.is_empty() {
2997            for (key, value) in self._unknown_fields.iter() {
2998                state.serialize_entry(key, &value)?;
2999            }
3000        }
3001        state.end()
3002    }
3003}
3004
3005impl std::fmt::Debug for StorageLayout {
3006    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3007        let mut debug_struct = f.debug_struct("StorageLayout");
3008        debug_struct.field("name", &self.name);
3009        debug_struct.field("location", &self.location);
3010        debug_struct.field("location_type", &self.location_type);
3011        debug_struct.field("custom_placement_config", &self.custom_placement_config);
3012        debug_struct.field("hierarchical_namespace", &self.hierarchical_namespace);
3013        if !self._unknown_fields.is_empty() {
3014            debug_struct.field("_unknown_fields", &self._unknown_fields);
3015        }
3016        debug_struct.finish()
3017    }
3018}
3019
3020/// Defines additional types related to [StorageLayout].
3021pub mod storage_layout {
3022    #[allow(unused_imports)]
3023    use super::*;
3024
3025    /// Configuration for Custom Dual Regions.  It should specify precisely two
3026    /// eligible regions within the same Multiregion. More information on regions
3027    /// may be found [here](https://cloud.google.com/storage/docs/locations).
3028    #[derive(Clone, Default, PartialEq)]
3029    #[non_exhaustive]
3030    pub struct CustomPlacementConfig {
3031        /// List of locations to use for data placement.
3032        pub data_locations: std::vec::Vec<std::string::String>,
3033
3034        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3035    }
3036
3037    impl CustomPlacementConfig {
3038        pub fn new() -> Self {
3039            std::default::Default::default()
3040        }
3041
3042        /// Sets the value of [data_locations][crate::model::storage_layout::CustomPlacementConfig::data_locations].
3043        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
3044        where
3045            T: std::iter::IntoIterator<Item = V>,
3046            V: std::convert::Into<std::string::String>,
3047        {
3048            use std::iter::Iterator;
3049            self.data_locations = v.into_iter().map(|i| i.into()).collect();
3050            self
3051        }
3052    }
3053
3054    impl wkt::message::Message for CustomPlacementConfig {
3055        fn typename() -> &'static str {
3056            "type.googleapis.com/google.storage.control.v2.StorageLayout.CustomPlacementConfig"
3057        }
3058    }
3059
3060    #[doc(hidden)]
3061    impl<'de> serde::de::Deserialize<'de> for CustomPlacementConfig {
3062        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3063        where
3064            D: serde::Deserializer<'de>,
3065        {
3066            #[allow(non_camel_case_types)]
3067            #[doc(hidden)]
3068            #[derive(PartialEq, Eq, Hash)]
3069            enum __FieldTag {
3070                __data_locations,
3071                Unknown(std::string::String),
3072            }
3073            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3074                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3075                where
3076                    D: serde::Deserializer<'de>,
3077                {
3078                    struct Visitor;
3079                    impl<'de> serde::de::Visitor<'de> for Visitor {
3080                        type Value = __FieldTag;
3081                        fn expecting(
3082                            &self,
3083                            formatter: &mut std::fmt::Formatter,
3084                        ) -> std::fmt::Result {
3085                            formatter.write_str("a field name for CustomPlacementConfig")
3086                        }
3087                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3088                        where
3089                            E: serde::de::Error,
3090                        {
3091                            use std::result::Result::Ok;
3092                            use std::string::ToString;
3093                            match value {
3094                                "dataLocations" => Ok(__FieldTag::__data_locations),
3095                                "data_locations" => Ok(__FieldTag::__data_locations),
3096                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3097                            }
3098                        }
3099                    }
3100                    deserializer.deserialize_identifier(Visitor)
3101                }
3102            }
3103            struct Visitor;
3104            impl<'de> serde::de::Visitor<'de> for Visitor {
3105                type Value = CustomPlacementConfig;
3106                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3107                    formatter.write_str("struct CustomPlacementConfig")
3108                }
3109                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3110                where
3111                    A: serde::de::MapAccess<'de>,
3112                {
3113                    #[allow(unused_imports)]
3114                    use serde::de::Error;
3115                    use std::option::Option::Some;
3116                    let mut fields = std::collections::HashSet::new();
3117                    let mut result = Self::Value::new();
3118                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3119                        #[allow(clippy::match_single_binding)]
3120                        match tag {
3121                            __FieldTag::__data_locations => {
3122                                if !fields.insert(__FieldTag::__data_locations) {
3123                                    return std::result::Result::Err(A::Error::duplicate_field(
3124                                        "multiple values for data_locations",
3125                                    ));
3126                                }
3127                                result.data_locations = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
3128                            }
3129                            __FieldTag::Unknown(key) => {
3130                                let value = map.next_value::<serde_json::Value>()?;
3131                                result._unknown_fields.insert(key, value);
3132                            }
3133                        }
3134                    }
3135                    std::result::Result::Ok(result)
3136                }
3137            }
3138            deserializer.deserialize_any(Visitor)
3139        }
3140    }
3141
3142    #[doc(hidden)]
3143    impl serde::ser::Serialize for CustomPlacementConfig {
3144        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3145        where
3146            S: serde::ser::Serializer,
3147        {
3148            use serde::ser::SerializeMap;
3149            #[allow(unused_imports)]
3150            use std::option::Option::Some;
3151            let mut state = serializer.serialize_map(std::option::Option::None)?;
3152            if !self.data_locations.is_empty() {
3153                state.serialize_entry("dataLocations", &self.data_locations)?;
3154            }
3155            if !self._unknown_fields.is_empty() {
3156                for (key, value) in self._unknown_fields.iter() {
3157                    state.serialize_entry(key, &value)?;
3158                }
3159            }
3160            state.end()
3161        }
3162    }
3163
3164    impl std::fmt::Debug for CustomPlacementConfig {
3165        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3166            let mut debug_struct = f.debug_struct("CustomPlacementConfig");
3167            debug_struct.field("data_locations", &self.data_locations);
3168            if !self._unknown_fields.is_empty() {
3169                debug_struct.field("_unknown_fields", &self._unknown_fields);
3170            }
3171            debug_struct.finish()
3172        }
3173    }
3174
3175    /// Configuration for a bucket's hierarchical namespace feature.
3176    #[derive(Clone, Default, PartialEq)]
3177    #[non_exhaustive]
3178    pub struct HierarchicalNamespace {
3179        /// Enables the hierarchical namespace feature.
3180        pub enabled: bool,
3181
3182        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3183    }
3184
3185    impl HierarchicalNamespace {
3186        pub fn new() -> Self {
3187            std::default::Default::default()
3188        }
3189
3190        /// Sets the value of [enabled][crate::model::storage_layout::HierarchicalNamespace::enabled].
3191        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3192            self.enabled = v.into();
3193            self
3194        }
3195    }
3196
3197    impl wkt::message::Message for HierarchicalNamespace {
3198        fn typename() -> &'static str {
3199            "type.googleapis.com/google.storage.control.v2.StorageLayout.HierarchicalNamespace"
3200        }
3201    }
3202
3203    #[doc(hidden)]
3204    impl<'de> serde::de::Deserialize<'de> for HierarchicalNamespace {
3205        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3206        where
3207            D: serde::Deserializer<'de>,
3208        {
3209            #[allow(non_camel_case_types)]
3210            #[doc(hidden)]
3211            #[derive(PartialEq, Eq, Hash)]
3212            enum __FieldTag {
3213                __enabled,
3214                Unknown(std::string::String),
3215            }
3216            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3217                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3218                where
3219                    D: serde::Deserializer<'de>,
3220                {
3221                    struct Visitor;
3222                    impl<'de> serde::de::Visitor<'de> for Visitor {
3223                        type Value = __FieldTag;
3224                        fn expecting(
3225                            &self,
3226                            formatter: &mut std::fmt::Formatter,
3227                        ) -> std::fmt::Result {
3228                            formatter.write_str("a field name for HierarchicalNamespace")
3229                        }
3230                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3231                        where
3232                            E: serde::de::Error,
3233                        {
3234                            use std::result::Result::Ok;
3235                            use std::string::ToString;
3236                            match value {
3237                                "enabled" => Ok(__FieldTag::__enabled),
3238                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3239                            }
3240                        }
3241                    }
3242                    deserializer.deserialize_identifier(Visitor)
3243                }
3244            }
3245            struct Visitor;
3246            impl<'de> serde::de::Visitor<'de> for Visitor {
3247                type Value = HierarchicalNamespace;
3248                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3249                    formatter.write_str("struct HierarchicalNamespace")
3250                }
3251                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3252                where
3253                    A: serde::de::MapAccess<'de>,
3254                {
3255                    #[allow(unused_imports)]
3256                    use serde::de::Error;
3257                    use std::option::Option::Some;
3258                    let mut fields = std::collections::HashSet::new();
3259                    let mut result = Self::Value::new();
3260                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3261                        #[allow(clippy::match_single_binding)]
3262                        match tag {
3263                            __FieldTag::__enabled => {
3264                                if !fields.insert(__FieldTag::__enabled) {
3265                                    return std::result::Result::Err(A::Error::duplicate_field(
3266                                        "multiple values for enabled",
3267                                    ));
3268                                }
3269                                result.enabled = map
3270                                    .next_value::<std::option::Option<bool>>()?
3271                                    .unwrap_or_default();
3272                            }
3273                            __FieldTag::Unknown(key) => {
3274                                let value = map.next_value::<serde_json::Value>()?;
3275                                result._unknown_fields.insert(key, value);
3276                            }
3277                        }
3278                    }
3279                    std::result::Result::Ok(result)
3280                }
3281            }
3282            deserializer.deserialize_any(Visitor)
3283        }
3284    }
3285
3286    #[doc(hidden)]
3287    impl serde::ser::Serialize for HierarchicalNamespace {
3288        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3289        where
3290            S: serde::ser::Serializer,
3291        {
3292            use serde::ser::SerializeMap;
3293            #[allow(unused_imports)]
3294            use std::option::Option::Some;
3295            let mut state = serializer.serialize_map(std::option::Option::None)?;
3296            if !wkt::internal::is_default(&self.enabled) {
3297                state.serialize_entry("enabled", &self.enabled)?;
3298            }
3299            if !self._unknown_fields.is_empty() {
3300                for (key, value) in self._unknown_fields.iter() {
3301                    state.serialize_entry(key, &value)?;
3302                }
3303            }
3304            state.end()
3305        }
3306    }
3307
3308    impl std::fmt::Debug for HierarchicalNamespace {
3309        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3310            let mut debug_struct = f.debug_struct("HierarchicalNamespace");
3311            debug_struct.field("enabled", &self.enabled);
3312            if !self._unknown_fields.is_empty() {
3313                debug_struct.field("_unknown_fields", &self._unknown_fields);
3314            }
3315            debug_struct.finish()
3316        }
3317    }
3318}
3319
3320/// Request message for GetStorageLayout.
3321#[derive(Clone, Default, PartialEq)]
3322#[non_exhaustive]
3323pub struct GetStorageLayoutRequest {
3324    /// Required. The name of the StorageLayout resource.
3325    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
3326    pub name: std::string::String,
3327
3328    /// An optional prefix used for permission check. It is useful when the caller
3329    /// only has limited permissions under a specific prefix.
3330    pub prefix: std::string::String,
3331
3332    /// Optional. A unique identifier for this request. UUID is the recommended
3333    /// format, but other formats are still accepted.
3334    pub request_id: std::string::String,
3335
3336    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3337}
3338
3339impl GetStorageLayoutRequest {
3340    pub fn new() -> Self {
3341        std::default::Default::default()
3342    }
3343
3344    /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
3345    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3346        self.name = v.into();
3347        self
3348    }
3349
3350    /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
3351    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3352        self.prefix = v.into();
3353        self
3354    }
3355
3356    /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
3357    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3358        self.request_id = v.into();
3359        self
3360    }
3361}
3362
3363impl wkt::message::Message for GetStorageLayoutRequest {
3364    fn typename() -> &'static str {
3365        "type.googleapis.com/google.storage.control.v2.GetStorageLayoutRequest"
3366    }
3367}
3368
3369#[doc(hidden)]
3370impl<'de> serde::de::Deserialize<'de> for GetStorageLayoutRequest {
3371    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3372    where
3373        D: serde::Deserializer<'de>,
3374    {
3375        #[allow(non_camel_case_types)]
3376        #[doc(hidden)]
3377        #[derive(PartialEq, Eq, Hash)]
3378        enum __FieldTag {
3379            __name,
3380            __prefix,
3381            __request_id,
3382            Unknown(std::string::String),
3383        }
3384        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3385            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3386            where
3387                D: serde::Deserializer<'de>,
3388            {
3389                struct Visitor;
3390                impl<'de> serde::de::Visitor<'de> for Visitor {
3391                    type Value = __FieldTag;
3392                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3393                        formatter.write_str("a field name for GetStorageLayoutRequest")
3394                    }
3395                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3396                    where
3397                        E: serde::de::Error,
3398                    {
3399                        use std::result::Result::Ok;
3400                        use std::string::ToString;
3401                        match value {
3402                            "name" => Ok(__FieldTag::__name),
3403                            "prefix" => Ok(__FieldTag::__prefix),
3404                            "requestId" => Ok(__FieldTag::__request_id),
3405                            "request_id" => Ok(__FieldTag::__request_id),
3406                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3407                        }
3408                    }
3409                }
3410                deserializer.deserialize_identifier(Visitor)
3411            }
3412        }
3413        struct Visitor;
3414        impl<'de> serde::de::Visitor<'de> for Visitor {
3415            type Value = GetStorageLayoutRequest;
3416            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3417                formatter.write_str("struct GetStorageLayoutRequest")
3418            }
3419            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3420            where
3421                A: serde::de::MapAccess<'de>,
3422            {
3423                #[allow(unused_imports)]
3424                use serde::de::Error;
3425                use std::option::Option::Some;
3426                let mut fields = std::collections::HashSet::new();
3427                let mut result = Self::Value::new();
3428                while let Some(tag) = map.next_key::<__FieldTag>()? {
3429                    #[allow(clippy::match_single_binding)]
3430                    match tag {
3431                        __FieldTag::__name => {
3432                            if !fields.insert(__FieldTag::__name) {
3433                                return std::result::Result::Err(A::Error::duplicate_field(
3434                                    "multiple values for name",
3435                                ));
3436                            }
3437                            result.name = map
3438                                .next_value::<std::option::Option<std::string::String>>()?
3439                                .unwrap_or_default();
3440                        }
3441                        __FieldTag::__prefix => {
3442                            if !fields.insert(__FieldTag::__prefix) {
3443                                return std::result::Result::Err(A::Error::duplicate_field(
3444                                    "multiple values for prefix",
3445                                ));
3446                            }
3447                            result.prefix = map
3448                                .next_value::<std::option::Option<std::string::String>>()?
3449                                .unwrap_or_default();
3450                        }
3451                        __FieldTag::__request_id => {
3452                            if !fields.insert(__FieldTag::__request_id) {
3453                                return std::result::Result::Err(A::Error::duplicate_field(
3454                                    "multiple values for request_id",
3455                                ));
3456                            }
3457                            result.request_id = map
3458                                .next_value::<std::option::Option<std::string::String>>()?
3459                                .unwrap_or_default();
3460                        }
3461                        __FieldTag::Unknown(key) => {
3462                            let value = map.next_value::<serde_json::Value>()?;
3463                            result._unknown_fields.insert(key, value);
3464                        }
3465                    }
3466                }
3467                std::result::Result::Ok(result)
3468            }
3469        }
3470        deserializer.deserialize_any(Visitor)
3471    }
3472}
3473
3474#[doc(hidden)]
3475impl serde::ser::Serialize for GetStorageLayoutRequest {
3476    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3477    where
3478        S: serde::ser::Serializer,
3479    {
3480        use serde::ser::SerializeMap;
3481        #[allow(unused_imports)]
3482        use std::option::Option::Some;
3483        let mut state = serializer.serialize_map(std::option::Option::None)?;
3484        if !self.name.is_empty() {
3485            state.serialize_entry("name", &self.name)?;
3486        }
3487        if !self.prefix.is_empty() {
3488            state.serialize_entry("prefix", &self.prefix)?;
3489        }
3490        if !self.request_id.is_empty() {
3491            state.serialize_entry("requestId", &self.request_id)?;
3492        }
3493        if !self._unknown_fields.is_empty() {
3494            for (key, value) in self._unknown_fields.iter() {
3495                state.serialize_entry(key, &value)?;
3496            }
3497        }
3498        state.end()
3499    }
3500}
3501
3502impl std::fmt::Debug for GetStorageLayoutRequest {
3503    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3504        let mut debug_struct = f.debug_struct("GetStorageLayoutRequest");
3505        debug_struct.field("name", &self.name);
3506        debug_struct.field("prefix", &self.prefix);
3507        debug_struct.field("request_id", &self.request_id);
3508        if !self._unknown_fields.is_empty() {
3509            debug_struct.field("_unknown_fields", &self._unknown_fields);
3510        }
3511        debug_struct.finish()
3512    }
3513}
3514
3515/// A managed folder.
3516#[derive(Clone, Default, PartialEq)]
3517#[non_exhaustive]
3518pub struct ManagedFolder {
3519    /// Identifier. The name of this managed folder.
3520    /// Format:
3521    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
3522    pub name: std::string::String,
3523
3524    /// Output only. The metadata version of this managed folder. It increases
3525    /// whenever the metadata is updated. Used for preconditions and for detecting
3526    /// changes in metadata. Managed folders don't have a generation number.
3527    pub metageneration: i64,
3528
3529    /// Output only. The creation time of the managed folder.
3530    pub create_time: std::option::Option<wkt::Timestamp>,
3531
3532    /// Output only. The modification time of the managed folder.
3533    pub update_time: std::option::Option<wkt::Timestamp>,
3534
3535    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3536}
3537
3538impl ManagedFolder {
3539    pub fn new() -> Self {
3540        std::default::Default::default()
3541    }
3542
3543    /// Sets the value of [name][crate::model::ManagedFolder::name].
3544    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3545        self.name = v.into();
3546        self
3547    }
3548
3549    /// Sets the value of [metageneration][crate::model::ManagedFolder::metageneration].
3550    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3551        self.metageneration = v.into();
3552        self
3553    }
3554
3555    /// Sets the value of [create_time][crate::model::ManagedFolder::create_time].
3556    pub fn set_create_time<T>(mut self, v: T) -> Self
3557    where
3558        T: std::convert::Into<wkt::Timestamp>,
3559    {
3560        self.create_time = std::option::Option::Some(v.into());
3561        self
3562    }
3563
3564    /// Sets or clears the value of [create_time][crate::model::ManagedFolder::create_time].
3565    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3566    where
3567        T: std::convert::Into<wkt::Timestamp>,
3568    {
3569        self.create_time = v.map(|x| x.into());
3570        self
3571    }
3572
3573    /// Sets the value of [update_time][crate::model::ManagedFolder::update_time].
3574    pub fn set_update_time<T>(mut self, v: T) -> Self
3575    where
3576        T: std::convert::Into<wkt::Timestamp>,
3577    {
3578        self.update_time = std::option::Option::Some(v.into());
3579        self
3580    }
3581
3582    /// Sets or clears the value of [update_time][crate::model::ManagedFolder::update_time].
3583    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3584    where
3585        T: std::convert::Into<wkt::Timestamp>,
3586    {
3587        self.update_time = v.map(|x| x.into());
3588        self
3589    }
3590}
3591
3592impl wkt::message::Message for ManagedFolder {
3593    fn typename() -> &'static str {
3594        "type.googleapis.com/google.storage.control.v2.ManagedFolder"
3595    }
3596}
3597
3598#[doc(hidden)]
3599impl<'de> serde::de::Deserialize<'de> for ManagedFolder {
3600    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3601    where
3602        D: serde::Deserializer<'de>,
3603    {
3604        #[allow(non_camel_case_types)]
3605        #[doc(hidden)]
3606        #[derive(PartialEq, Eq, Hash)]
3607        enum __FieldTag {
3608            __name,
3609            __metageneration,
3610            __create_time,
3611            __update_time,
3612            Unknown(std::string::String),
3613        }
3614        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3615            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3616            where
3617                D: serde::Deserializer<'de>,
3618            {
3619                struct Visitor;
3620                impl<'de> serde::de::Visitor<'de> for Visitor {
3621                    type Value = __FieldTag;
3622                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3623                        formatter.write_str("a field name for ManagedFolder")
3624                    }
3625                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3626                    where
3627                        E: serde::de::Error,
3628                    {
3629                        use std::result::Result::Ok;
3630                        use std::string::ToString;
3631                        match value {
3632                            "name" => Ok(__FieldTag::__name),
3633                            "metageneration" => Ok(__FieldTag::__metageneration),
3634                            "createTime" => Ok(__FieldTag::__create_time),
3635                            "create_time" => Ok(__FieldTag::__create_time),
3636                            "updateTime" => Ok(__FieldTag::__update_time),
3637                            "update_time" => Ok(__FieldTag::__update_time),
3638                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3639                        }
3640                    }
3641                }
3642                deserializer.deserialize_identifier(Visitor)
3643            }
3644        }
3645        struct Visitor;
3646        impl<'de> serde::de::Visitor<'de> for Visitor {
3647            type Value = ManagedFolder;
3648            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3649                formatter.write_str("struct ManagedFolder")
3650            }
3651            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3652            where
3653                A: serde::de::MapAccess<'de>,
3654            {
3655                #[allow(unused_imports)]
3656                use serde::de::Error;
3657                use std::option::Option::Some;
3658                let mut fields = std::collections::HashSet::new();
3659                let mut result = Self::Value::new();
3660                while let Some(tag) = map.next_key::<__FieldTag>()? {
3661                    #[allow(clippy::match_single_binding)]
3662                    match tag {
3663                        __FieldTag::__name => {
3664                            if !fields.insert(__FieldTag::__name) {
3665                                return std::result::Result::Err(A::Error::duplicate_field(
3666                                    "multiple values for name",
3667                                ));
3668                            }
3669                            result.name = map
3670                                .next_value::<std::option::Option<std::string::String>>()?
3671                                .unwrap_or_default();
3672                        }
3673                        __FieldTag::__metageneration => {
3674                            if !fields.insert(__FieldTag::__metageneration) {
3675                                return std::result::Result::Err(A::Error::duplicate_field(
3676                                    "multiple values for metageneration",
3677                                ));
3678                            }
3679                            struct __With(std::option::Option<i64>);
3680                            impl<'de> serde::de::Deserialize<'de> for __With {
3681                                fn deserialize<D>(
3682                                    deserializer: D,
3683                                ) -> std::result::Result<Self, D::Error>
3684                                where
3685                                    D: serde::de::Deserializer<'de>,
3686                                {
3687                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
3688                                }
3689                            }
3690                            result.metageneration =
3691                                map.next_value::<__With>()?.0.unwrap_or_default();
3692                        }
3693                        __FieldTag::__create_time => {
3694                            if !fields.insert(__FieldTag::__create_time) {
3695                                return std::result::Result::Err(A::Error::duplicate_field(
3696                                    "multiple values for create_time",
3697                                ));
3698                            }
3699                            result.create_time =
3700                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
3701                        }
3702                        __FieldTag::__update_time => {
3703                            if !fields.insert(__FieldTag::__update_time) {
3704                                return std::result::Result::Err(A::Error::duplicate_field(
3705                                    "multiple values for update_time",
3706                                ));
3707                            }
3708                            result.update_time =
3709                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
3710                        }
3711                        __FieldTag::Unknown(key) => {
3712                            let value = map.next_value::<serde_json::Value>()?;
3713                            result._unknown_fields.insert(key, value);
3714                        }
3715                    }
3716                }
3717                std::result::Result::Ok(result)
3718            }
3719        }
3720        deserializer.deserialize_any(Visitor)
3721    }
3722}
3723
3724#[doc(hidden)]
3725impl serde::ser::Serialize for ManagedFolder {
3726    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3727    where
3728        S: serde::ser::Serializer,
3729    {
3730        use serde::ser::SerializeMap;
3731        #[allow(unused_imports)]
3732        use std::option::Option::Some;
3733        let mut state = serializer.serialize_map(std::option::Option::None)?;
3734        if !self.name.is_empty() {
3735            state.serialize_entry("name", &self.name)?;
3736        }
3737        if !wkt::internal::is_default(&self.metageneration) {
3738            struct __With<'a>(&'a i64);
3739            impl<'a> serde::ser::Serialize for __With<'a> {
3740                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3741                where
3742                    S: serde::ser::Serializer,
3743                {
3744                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
3745                }
3746            }
3747            state.serialize_entry("metageneration", &__With(&self.metageneration))?;
3748        }
3749        if self.create_time.is_some() {
3750            state.serialize_entry("createTime", &self.create_time)?;
3751        }
3752        if self.update_time.is_some() {
3753            state.serialize_entry("updateTime", &self.update_time)?;
3754        }
3755        if !self._unknown_fields.is_empty() {
3756            for (key, value) in self._unknown_fields.iter() {
3757                state.serialize_entry(key, &value)?;
3758            }
3759        }
3760        state.end()
3761    }
3762}
3763
3764impl std::fmt::Debug for ManagedFolder {
3765    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
3766        let mut debug_struct = f.debug_struct("ManagedFolder");
3767        debug_struct.field("name", &self.name);
3768        debug_struct.field("metageneration", &self.metageneration);
3769        debug_struct.field("create_time", &self.create_time);
3770        debug_struct.field("update_time", &self.update_time);
3771        if !self._unknown_fields.is_empty() {
3772            debug_struct.field("_unknown_fields", &self._unknown_fields);
3773        }
3774        debug_struct.finish()
3775    }
3776}
3777
3778/// Request message for GetManagedFolder.
3779#[derive(Clone, Default, PartialEq)]
3780#[non_exhaustive]
3781pub struct GetManagedFolderRequest {
3782    /// Required. Name of the managed folder.
3783    /// Format:
3784    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
3785    pub name: std::string::String,
3786
3787    /// The operation succeeds conditional on the managed folder's current
3788    /// metageneration matching the value here specified.
3789    pub if_metageneration_match: std::option::Option<i64>,
3790
3791    /// The operation succeeds conditional on the managed folder's current
3792    /// metageneration NOT matching the value here specified.
3793    pub if_metageneration_not_match: std::option::Option<i64>,
3794
3795    /// Optional. A unique identifier for this request. UUID is the recommended
3796    /// format, but other formats are still accepted.
3797    pub request_id: std::string::String,
3798
3799    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3800}
3801
3802impl GetManagedFolderRequest {
3803    pub fn new() -> Self {
3804        std::default::Default::default()
3805    }
3806
3807    /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
3808    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3809        self.name = v.into();
3810        self
3811    }
3812
3813    /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
3814    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
3815    where
3816        T: std::convert::Into<i64>,
3817    {
3818        self.if_metageneration_match = std::option::Option::Some(v.into());
3819        self
3820    }
3821
3822    /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
3823    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
3824    where
3825        T: std::convert::Into<i64>,
3826    {
3827        self.if_metageneration_match = v.map(|x| x.into());
3828        self
3829    }
3830
3831    /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
3832    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
3833    where
3834        T: std::convert::Into<i64>,
3835    {
3836        self.if_metageneration_not_match = std::option::Option::Some(v.into());
3837        self
3838    }
3839
3840    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
3841    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
3842    where
3843        T: std::convert::Into<i64>,
3844    {
3845        self.if_metageneration_not_match = v.map(|x| x.into());
3846        self
3847    }
3848
3849    /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
3850    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3851        self.request_id = v.into();
3852        self
3853    }
3854}
3855
3856impl wkt::message::Message for GetManagedFolderRequest {
3857    fn typename() -> &'static str {
3858        "type.googleapis.com/google.storage.control.v2.GetManagedFolderRequest"
3859    }
3860}
3861
3862#[doc(hidden)]
3863impl<'de> serde::de::Deserialize<'de> for GetManagedFolderRequest {
3864    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3865    where
3866        D: serde::Deserializer<'de>,
3867    {
3868        #[allow(non_camel_case_types)]
3869        #[doc(hidden)]
3870        #[derive(PartialEq, Eq, Hash)]
3871        enum __FieldTag {
3872            __name,
3873            __if_metageneration_match,
3874            __if_metageneration_not_match,
3875            __request_id,
3876            Unknown(std::string::String),
3877        }
3878        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3879            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3880            where
3881                D: serde::Deserializer<'de>,
3882            {
3883                struct Visitor;
3884                impl<'de> serde::de::Visitor<'de> for Visitor {
3885                    type Value = __FieldTag;
3886                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3887                        formatter.write_str("a field name for GetManagedFolderRequest")
3888                    }
3889                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3890                    where
3891                        E: serde::de::Error,
3892                    {
3893                        use std::result::Result::Ok;
3894                        use std::string::ToString;
3895                        match value {
3896                            "name" => Ok(__FieldTag::__name),
3897                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
3898                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
3899                            "ifMetagenerationNotMatch" => {
3900                                Ok(__FieldTag::__if_metageneration_not_match)
3901                            }
3902                            "if_metageneration_not_match" => {
3903                                Ok(__FieldTag::__if_metageneration_not_match)
3904                            }
3905                            "requestId" => Ok(__FieldTag::__request_id),
3906                            "request_id" => Ok(__FieldTag::__request_id),
3907                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3908                        }
3909                    }
3910                }
3911                deserializer.deserialize_identifier(Visitor)
3912            }
3913        }
3914        struct Visitor;
3915        impl<'de> serde::de::Visitor<'de> for Visitor {
3916            type Value = GetManagedFolderRequest;
3917            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3918                formatter.write_str("struct GetManagedFolderRequest")
3919            }
3920            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3921            where
3922                A: serde::de::MapAccess<'de>,
3923            {
3924                #[allow(unused_imports)]
3925                use serde::de::Error;
3926                use std::option::Option::Some;
3927                let mut fields = std::collections::HashSet::new();
3928                let mut result = Self::Value::new();
3929                while let Some(tag) = map.next_key::<__FieldTag>()? {
3930                    #[allow(clippy::match_single_binding)]
3931                    match tag {
3932                        __FieldTag::__name => {
3933                            if !fields.insert(__FieldTag::__name) {
3934                                return std::result::Result::Err(A::Error::duplicate_field(
3935                                    "multiple values for name",
3936                                ));
3937                            }
3938                            result.name = map
3939                                .next_value::<std::option::Option<std::string::String>>()?
3940                                .unwrap_or_default();
3941                        }
3942                        __FieldTag::__if_metageneration_match => {
3943                            if !fields.insert(__FieldTag::__if_metageneration_match) {
3944                                return std::result::Result::Err(A::Error::duplicate_field(
3945                                    "multiple values for if_metageneration_match",
3946                                ));
3947                            }
3948                            struct __With(std::option::Option<i64>);
3949                            impl<'de> serde::de::Deserialize<'de> for __With {
3950                                fn deserialize<D>(
3951                                    deserializer: D,
3952                                ) -> std::result::Result<Self, D::Error>
3953                                where
3954                                    D: serde::de::Deserializer<'de>,
3955                                {
3956                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
3957                                }
3958                            }
3959                            result.if_metageneration_match = map.next_value::<__With>()?.0;
3960                        }
3961                        __FieldTag::__if_metageneration_not_match => {
3962                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
3963                                return std::result::Result::Err(A::Error::duplicate_field(
3964                                    "multiple values for if_metageneration_not_match",
3965                                ));
3966                            }
3967                            struct __With(std::option::Option<i64>);
3968                            impl<'de> serde::de::Deserialize<'de> for __With {
3969                                fn deserialize<D>(
3970                                    deserializer: D,
3971                                ) -> std::result::Result<Self, D::Error>
3972                                where
3973                                    D: serde::de::Deserializer<'de>,
3974                                {
3975                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
3976                                }
3977                            }
3978                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
3979                        }
3980                        __FieldTag::__request_id => {
3981                            if !fields.insert(__FieldTag::__request_id) {
3982                                return std::result::Result::Err(A::Error::duplicate_field(
3983                                    "multiple values for request_id",
3984                                ));
3985                            }
3986                            result.request_id = map
3987                                .next_value::<std::option::Option<std::string::String>>()?
3988                                .unwrap_or_default();
3989                        }
3990                        __FieldTag::Unknown(key) => {
3991                            let value = map.next_value::<serde_json::Value>()?;
3992                            result._unknown_fields.insert(key, value);
3993                        }
3994                    }
3995                }
3996                std::result::Result::Ok(result)
3997            }
3998        }
3999        deserializer.deserialize_any(Visitor)
4000    }
4001}
4002
4003#[doc(hidden)]
4004impl serde::ser::Serialize for GetManagedFolderRequest {
4005    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4006    where
4007        S: serde::ser::Serializer,
4008    {
4009        use serde::ser::SerializeMap;
4010        #[allow(unused_imports)]
4011        use std::option::Option::Some;
4012        let mut state = serializer.serialize_map(std::option::Option::None)?;
4013        if !self.name.is_empty() {
4014            state.serialize_entry("name", &self.name)?;
4015        }
4016        if self.if_metageneration_match.is_some() {
4017            struct __With<'a>(&'a std::option::Option<i64>);
4018            impl<'a> serde::ser::Serialize for __With<'a> {
4019                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4020                where
4021                    S: serde::ser::Serializer,
4022                {
4023                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
4024                        self.0, serializer,
4025                    )
4026                }
4027            }
4028            state.serialize_entry(
4029                "ifMetagenerationMatch",
4030                &__With(&self.if_metageneration_match),
4031            )?;
4032        }
4033        if self.if_metageneration_not_match.is_some() {
4034            struct __With<'a>(&'a std::option::Option<i64>);
4035            impl<'a> serde::ser::Serialize for __With<'a> {
4036                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4037                where
4038                    S: serde::ser::Serializer,
4039                {
4040                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
4041                        self.0, serializer,
4042                    )
4043                }
4044            }
4045            state.serialize_entry(
4046                "ifMetagenerationNotMatch",
4047                &__With(&self.if_metageneration_not_match),
4048            )?;
4049        }
4050        if !self.request_id.is_empty() {
4051            state.serialize_entry("requestId", &self.request_id)?;
4052        }
4053        if !self._unknown_fields.is_empty() {
4054            for (key, value) in self._unknown_fields.iter() {
4055                state.serialize_entry(key, &value)?;
4056            }
4057        }
4058        state.end()
4059    }
4060}
4061
4062impl std::fmt::Debug for GetManagedFolderRequest {
4063    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4064        let mut debug_struct = f.debug_struct("GetManagedFolderRequest");
4065        debug_struct.field("name", &self.name);
4066        debug_struct.field("if_metageneration_match", &self.if_metageneration_match);
4067        debug_struct.field(
4068            "if_metageneration_not_match",
4069            &self.if_metageneration_not_match,
4070        );
4071        debug_struct.field("request_id", &self.request_id);
4072        if !self._unknown_fields.is_empty() {
4073            debug_struct.field("_unknown_fields", &self._unknown_fields);
4074        }
4075        debug_struct.finish()
4076    }
4077}
4078
4079/// Request message for CreateManagedFolder.
4080#[derive(Clone, Default, PartialEq)]
4081#[non_exhaustive]
4082pub struct CreateManagedFolderRequest {
4083    /// Required. Name of the bucket this managed folder belongs to.
4084    pub parent: std::string::String,
4085
4086    /// Required. Properties of the managed folder being created.
4087    /// The bucket and managed folder names are specified in the `parent` and
4088    /// `managed_folder_id` fields. Populating these fields in `managed_folder`
4089    /// will result in an error.
4090    pub managed_folder: std::option::Option<crate::model::ManagedFolder>,
4091
4092    /// Required. The name of the managed folder. It uses a single `/` as delimiter
4093    /// and leading and trailing `/` are allowed.
4094    pub managed_folder_id: std::string::String,
4095
4096    /// Optional. A unique identifier for this request. UUID is the recommended
4097    /// format, but other formats are still accepted.
4098    pub request_id: std::string::String,
4099
4100    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4101}
4102
4103impl CreateManagedFolderRequest {
4104    pub fn new() -> Self {
4105        std::default::Default::default()
4106    }
4107
4108    /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
4109    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4110        self.parent = v.into();
4111        self
4112    }
4113
4114    /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
4115    pub fn set_managed_folder<T>(mut self, v: T) -> Self
4116    where
4117        T: std::convert::Into<crate::model::ManagedFolder>,
4118    {
4119        self.managed_folder = std::option::Option::Some(v.into());
4120        self
4121    }
4122
4123    /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
4124    pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
4125    where
4126        T: std::convert::Into<crate::model::ManagedFolder>,
4127    {
4128        self.managed_folder = v.map(|x| x.into());
4129        self
4130    }
4131
4132    /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
4133    pub fn set_managed_folder_id<T: std::convert::Into<std::string::String>>(
4134        mut self,
4135        v: T,
4136    ) -> Self {
4137        self.managed_folder_id = v.into();
4138        self
4139    }
4140
4141    /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
4142    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4143        self.request_id = v.into();
4144        self
4145    }
4146}
4147
4148impl wkt::message::Message for CreateManagedFolderRequest {
4149    fn typename() -> &'static str {
4150        "type.googleapis.com/google.storage.control.v2.CreateManagedFolderRequest"
4151    }
4152}
4153
4154#[doc(hidden)]
4155impl<'de> serde::de::Deserialize<'de> for CreateManagedFolderRequest {
4156    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4157    where
4158        D: serde::Deserializer<'de>,
4159    {
4160        #[allow(non_camel_case_types)]
4161        #[doc(hidden)]
4162        #[derive(PartialEq, Eq, Hash)]
4163        enum __FieldTag {
4164            __parent,
4165            __managed_folder,
4166            __managed_folder_id,
4167            __request_id,
4168            Unknown(std::string::String),
4169        }
4170        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4171            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4172            where
4173                D: serde::Deserializer<'de>,
4174            {
4175                struct Visitor;
4176                impl<'de> serde::de::Visitor<'de> for Visitor {
4177                    type Value = __FieldTag;
4178                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4179                        formatter.write_str("a field name for CreateManagedFolderRequest")
4180                    }
4181                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4182                    where
4183                        E: serde::de::Error,
4184                    {
4185                        use std::result::Result::Ok;
4186                        use std::string::ToString;
4187                        match value {
4188                            "parent" => Ok(__FieldTag::__parent),
4189                            "managedFolder" => Ok(__FieldTag::__managed_folder),
4190                            "managed_folder" => Ok(__FieldTag::__managed_folder),
4191                            "managedFolderId" => Ok(__FieldTag::__managed_folder_id),
4192                            "managed_folder_id" => Ok(__FieldTag::__managed_folder_id),
4193                            "requestId" => Ok(__FieldTag::__request_id),
4194                            "request_id" => Ok(__FieldTag::__request_id),
4195                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4196                        }
4197                    }
4198                }
4199                deserializer.deserialize_identifier(Visitor)
4200            }
4201        }
4202        struct Visitor;
4203        impl<'de> serde::de::Visitor<'de> for Visitor {
4204            type Value = CreateManagedFolderRequest;
4205            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4206                formatter.write_str("struct CreateManagedFolderRequest")
4207            }
4208            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4209            where
4210                A: serde::de::MapAccess<'de>,
4211            {
4212                #[allow(unused_imports)]
4213                use serde::de::Error;
4214                use std::option::Option::Some;
4215                let mut fields = std::collections::HashSet::new();
4216                let mut result = Self::Value::new();
4217                while let Some(tag) = map.next_key::<__FieldTag>()? {
4218                    #[allow(clippy::match_single_binding)]
4219                    match tag {
4220                        __FieldTag::__parent => {
4221                            if !fields.insert(__FieldTag::__parent) {
4222                                return std::result::Result::Err(A::Error::duplicate_field(
4223                                    "multiple values for parent",
4224                                ));
4225                            }
4226                            result.parent = map
4227                                .next_value::<std::option::Option<std::string::String>>()?
4228                                .unwrap_or_default();
4229                        }
4230                        __FieldTag::__managed_folder => {
4231                            if !fields.insert(__FieldTag::__managed_folder) {
4232                                return std::result::Result::Err(A::Error::duplicate_field(
4233                                    "multiple values for managed_folder",
4234                                ));
4235                            }
4236                            result.managed_folder = map
4237                                .next_value::<std::option::Option<crate::model::ManagedFolder>>()?;
4238                        }
4239                        __FieldTag::__managed_folder_id => {
4240                            if !fields.insert(__FieldTag::__managed_folder_id) {
4241                                return std::result::Result::Err(A::Error::duplicate_field(
4242                                    "multiple values for managed_folder_id",
4243                                ));
4244                            }
4245                            result.managed_folder_id = map
4246                                .next_value::<std::option::Option<std::string::String>>()?
4247                                .unwrap_or_default();
4248                        }
4249                        __FieldTag::__request_id => {
4250                            if !fields.insert(__FieldTag::__request_id) {
4251                                return std::result::Result::Err(A::Error::duplicate_field(
4252                                    "multiple values for request_id",
4253                                ));
4254                            }
4255                            result.request_id = map
4256                                .next_value::<std::option::Option<std::string::String>>()?
4257                                .unwrap_or_default();
4258                        }
4259                        __FieldTag::Unknown(key) => {
4260                            let value = map.next_value::<serde_json::Value>()?;
4261                            result._unknown_fields.insert(key, value);
4262                        }
4263                    }
4264                }
4265                std::result::Result::Ok(result)
4266            }
4267        }
4268        deserializer.deserialize_any(Visitor)
4269    }
4270}
4271
4272#[doc(hidden)]
4273impl serde::ser::Serialize for CreateManagedFolderRequest {
4274    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4275    where
4276        S: serde::ser::Serializer,
4277    {
4278        use serde::ser::SerializeMap;
4279        #[allow(unused_imports)]
4280        use std::option::Option::Some;
4281        let mut state = serializer.serialize_map(std::option::Option::None)?;
4282        if !self.parent.is_empty() {
4283            state.serialize_entry("parent", &self.parent)?;
4284        }
4285        if self.managed_folder.is_some() {
4286            state.serialize_entry("managedFolder", &self.managed_folder)?;
4287        }
4288        if !self.managed_folder_id.is_empty() {
4289            state.serialize_entry("managedFolderId", &self.managed_folder_id)?;
4290        }
4291        if !self.request_id.is_empty() {
4292            state.serialize_entry("requestId", &self.request_id)?;
4293        }
4294        if !self._unknown_fields.is_empty() {
4295            for (key, value) in self._unknown_fields.iter() {
4296                state.serialize_entry(key, &value)?;
4297            }
4298        }
4299        state.end()
4300    }
4301}
4302
4303impl std::fmt::Debug for CreateManagedFolderRequest {
4304    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4305        let mut debug_struct = f.debug_struct("CreateManagedFolderRequest");
4306        debug_struct.field("parent", &self.parent);
4307        debug_struct.field("managed_folder", &self.managed_folder);
4308        debug_struct.field("managed_folder_id", &self.managed_folder_id);
4309        debug_struct.field("request_id", &self.request_id);
4310        if !self._unknown_fields.is_empty() {
4311            debug_struct.field("_unknown_fields", &self._unknown_fields);
4312        }
4313        debug_struct.finish()
4314    }
4315}
4316
4317/// DeleteManagedFolder RPC request message.
4318#[derive(Clone, Default, PartialEq)]
4319#[non_exhaustive]
4320pub struct DeleteManagedFolderRequest {
4321    /// Required. Name of the managed folder.
4322    /// Format:
4323    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
4324    pub name: std::string::String,
4325
4326    /// The operation succeeds conditional on the managed folder's current
4327    /// metageneration matching the value here specified.
4328    pub if_metageneration_match: std::option::Option<i64>,
4329
4330    /// The operation succeeds conditional on the managed folder's current
4331    /// metageneration NOT matching the value here specified.
4332    pub if_metageneration_not_match: std::option::Option<i64>,
4333
4334    /// Allows deletion of a managed folder even if it is not empty.
4335    /// A managed folder is empty if it manages no child managed folders or
4336    /// objects. Caller must have permission for
4337    /// storage.managedFolders.setIamPolicy.
4338    pub allow_non_empty: bool,
4339
4340    /// Optional. A unique identifier for this request. UUID is the recommended
4341    /// format, but other formats are still accepted.
4342    pub request_id: std::string::String,
4343
4344    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4345}
4346
4347impl DeleteManagedFolderRequest {
4348    pub fn new() -> Self {
4349        std::default::Default::default()
4350    }
4351
4352    /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
4353    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4354        self.name = v.into();
4355        self
4356    }
4357
4358    /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
4359    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
4360    where
4361        T: std::convert::Into<i64>,
4362    {
4363        self.if_metageneration_match = std::option::Option::Some(v.into());
4364        self
4365    }
4366
4367    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
4368    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
4369    where
4370        T: std::convert::Into<i64>,
4371    {
4372        self.if_metageneration_match = v.map(|x| x.into());
4373        self
4374    }
4375
4376    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
4377    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
4378    where
4379        T: std::convert::Into<i64>,
4380    {
4381        self.if_metageneration_not_match = std::option::Option::Some(v.into());
4382        self
4383    }
4384
4385    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
4386    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
4387    where
4388        T: std::convert::Into<i64>,
4389    {
4390        self.if_metageneration_not_match = v.map(|x| x.into());
4391        self
4392    }
4393
4394    /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
4395    pub fn set_allow_non_empty<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4396        self.allow_non_empty = v.into();
4397        self
4398    }
4399
4400    /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
4401    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4402        self.request_id = v.into();
4403        self
4404    }
4405}
4406
4407impl wkt::message::Message for DeleteManagedFolderRequest {
4408    fn typename() -> &'static str {
4409        "type.googleapis.com/google.storage.control.v2.DeleteManagedFolderRequest"
4410    }
4411}
4412
4413#[doc(hidden)]
4414impl<'de> serde::de::Deserialize<'de> for DeleteManagedFolderRequest {
4415    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4416    where
4417        D: serde::Deserializer<'de>,
4418    {
4419        #[allow(non_camel_case_types)]
4420        #[doc(hidden)]
4421        #[derive(PartialEq, Eq, Hash)]
4422        enum __FieldTag {
4423            __name,
4424            __if_metageneration_match,
4425            __if_metageneration_not_match,
4426            __allow_non_empty,
4427            __request_id,
4428            Unknown(std::string::String),
4429        }
4430        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4431            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4432            where
4433                D: serde::Deserializer<'de>,
4434            {
4435                struct Visitor;
4436                impl<'de> serde::de::Visitor<'de> for Visitor {
4437                    type Value = __FieldTag;
4438                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4439                        formatter.write_str("a field name for DeleteManagedFolderRequest")
4440                    }
4441                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4442                    where
4443                        E: serde::de::Error,
4444                    {
4445                        use std::result::Result::Ok;
4446                        use std::string::ToString;
4447                        match value {
4448                            "name" => Ok(__FieldTag::__name),
4449                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
4450                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
4451                            "ifMetagenerationNotMatch" => {
4452                                Ok(__FieldTag::__if_metageneration_not_match)
4453                            }
4454                            "if_metageneration_not_match" => {
4455                                Ok(__FieldTag::__if_metageneration_not_match)
4456                            }
4457                            "allowNonEmpty" => Ok(__FieldTag::__allow_non_empty),
4458                            "allow_non_empty" => Ok(__FieldTag::__allow_non_empty),
4459                            "requestId" => Ok(__FieldTag::__request_id),
4460                            "request_id" => Ok(__FieldTag::__request_id),
4461                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4462                        }
4463                    }
4464                }
4465                deserializer.deserialize_identifier(Visitor)
4466            }
4467        }
4468        struct Visitor;
4469        impl<'de> serde::de::Visitor<'de> for Visitor {
4470            type Value = DeleteManagedFolderRequest;
4471            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4472                formatter.write_str("struct DeleteManagedFolderRequest")
4473            }
4474            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4475            where
4476                A: serde::de::MapAccess<'de>,
4477            {
4478                #[allow(unused_imports)]
4479                use serde::de::Error;
4480                use std::option::Option::Some;
4481                let mut fields = std::collections::HashSet::new();
4482                let mut result = Self::Value::new();
4483                while let Some(tag) = map.next_key::<__FieldTag>()? {
4484                    #[allow(clippy::match_single_binding)]
4485                    match tag {
4486                        __FieldTag::__name => {
4487                            if !fields.insert(__FieldTag::__name) {
4488                                return std::result::Result::Err(A::Error::duplicate_field(
4489                                    "multiple values for name",
4490                                ));
4491                            }
4492                            result.name = map
4493                                .next_value::<std::option::Option<std::string::String>>()?
4494                                .unwrap_or_default();
4495                        }
4496                        __FieldTag::__if_metageneration_match => {
4497                            if !fields.insert(__FieldTag::__if_metageneration_match) {
4498                                return std::result::Result::Err(A::Error::duplicate_field(
4499                                    "multiple values for if_metageneration_match",
4500                                ));
4501                            }
4502                            struct __With(std::option::Option<i64>);
4503                            impl<'de> serde::de::Deserialize<'de> for __With {
4504                                fn deserialize<D>(
4505                                    deserializer: D,
4506                                ) -> std::result::Result<Self, D::Error>
4507                                where
4508                                    D: serde::de::Deserializer<'de>,
4509                                {
4510                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
4511                                }
4512                            }
4513                            result.if_metageneration_match = map.next_value::<__With>()?.0;
4514                        }
4515                        __FieldTag::__if_metageneration_not_match => {
4516                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
4517                                return std::result::Result::Err(A::Error::duplicate_field(
4518                                    "multiple values for if_metageneration_not_match",
4519                                ));
4520                            }
4521                            struct __With(std::option::Option<i64>);
4522                            impl<'de> serde::de::Deserialize<'de> for __With {
4523                                fn deserialize<D>(
4524                                    deserializer: D,
4525                                ) -> std::result::Result<Self, D::Error>
4526                                where
4527                                    D: serde::de::Deserializer<'de>,
4528                                {
4529                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
4530                                }
4531                            }
4532                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
4533                        }
4534                        __FieldTag::__allow_non_empty => {
4535                            if !fields.insert(__FieldTag::__allow_non_empty) {
4536                                return std::result::Result::Err(A::Error::duplicate_field(
4537                                    "multiple values for allow_non_empty",
4538                                ));
4539                            }
4540                            result.allow_non_empty = map
4541                                .next_value::<std::option::Option<bool>>()?
4542                                .unwrap_or_default();
4543                        }
4544                        __FieldTag::__request_id => {
4545                            if !fields.insert(__FieldTag::__request_id) {
4546                                return std::result::Result::Err(A::Error::duplicate_field(
4547                                    "multiple values for request_id",
4548                                ));
4549                            }
4550                            result.request_id = map
4551                                .next_value::<std::option::Option<std::string::String>>()?
4552                                .unwrap_or_default();
4553                        }
4554                        __FieldTag::Unknown(key) => {
4555                            let value = map.next_value::<serde_json::Value>()?;
4556                            result._unknown_fields.insert(key, value);
4557                        }
4558                    }
4559                }
4560                std::result::Result::Ok(result)
4561            }
4562        }
4563        deserializer.deserialize_any(Visitor)
4564    }
4565}
4566
4567#[doc(hidden)]
4568impl serde::ser::Serialize for DeleteManagedFolderRequest {
4569    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4570    where
4571        S: serde::ser::Serializer,
4572    {
4573        use serde::ser::SerializeMap;
4574        #[allow(unused_imports)]
4575        use std::option::Option::Some;
4576        let mut state = serializer.serialize_map(std::option::Option::None)?;
4577        if !self.name.is_empty() {
4578            state.serialize_entry("name", &self.name)?;
4579        }
4580        if self.if_metageneration_match.is_some() {
4581            struct __With<'a>(&'a std::option::Option<i64>);
4582            impl<'a> serde::ser::Serialize for __With<'a> {
4583                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4584                where
4585                    S: serde::ser::Serializer,
4586                {
4587                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
4588                        self.0, serializer,
4589                    )
4590                }
4591            }
4592            state.serialize_entry(
4593                "ifMetagenerationMatch",
4594                &__With(&self.if_metageneration_match),
4595            )?;
4596        }
4597        if self.if_metageneration_not_match.is_some() {
4598            struct __With<'a>(&'a std::option::Option<i64>);
4599            impl<'a> serde::ser::Serialize for __With<'a> {
4600                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4601                where
4602                    S: serde::ser::Serializer,
4603                {
4604                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
4605                        self.0, serializer,
4606                    )
4607                }
4608            }
4609            state.serialize_entry(
4610                "ifMetagenerationNotMatch",
4611                &__With(&self.if_metageneration_not_match),
4612            )?;
4613        }
4614        if !wkt::internal::is_default(&self.allow_non_empty) {
4615            state.serialize_entry("allowNonEmpty", &self.allow_non_empty)?;
4616        }
4617        if !self.request_id.is_empty() {
4618            state.serialize_entry("requestId", &self.request_id)?;
4619        }
4620        if !self._unknown_fields.is_empty() {
4621            for (key, value) in self._unknown_fields.iter() {
4622                state.serialize_entry(key, &value)?;
4623            }
4624        }
4625        state.end()
4626    }
4627}
4628
4629impl std::fmt::Debug for DeleteManagedFolderRequest {
4630    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4631        let mut debug_struct = f.debug_struct("DeleteManagedFolderRequest");
4632        debug_struct.field("name", &self.name);
4633        debug_struct.field("if_metageneration_match", &self.if_metageneration_match);
4634        debug_struct.field(
4635            "if_metageneration_not_match",
4636            &self.if_metageneration_not_match,
4637        );
4638        debug_struct.field("allow_non_empty", &self.allow_non_empty);
4639        debug_struct.field("request_id", &self.request_id);
4640        if !self._unknown_fields.is_empty() {
4641            debug_struct.field("_unknown_fields", &self._unknown_fields);
4642        }
4643        debug_struct.finish()
4644    }
4645}
4646
4647/// Request message for ListManagedFolders.
4648#[derive(Clone, Default, PartialEq)]
4649#[non_exhaustive]
4650pub struct ListManagedFoldersRequest {
4651    /// Required. Name of the bucket this managed folder belongs to.
4652    pub parent: std::string::String,
4653
4654    /// Optional. Maximum number of managed folders to return in a single response.
4655    /// The service will use this parameter or 1,000 items, whichever is smaller.
4656    pub page_size: i32,
4657
4658    /// Optional. A previously-returned page token representing part of the larger
4659    /// set of results to view.
4660    pub page_token: std::string::String,
4661
4662    /// Optional. Filter results to match managed folders with name starting with
4663    /// this prefix.
4664    pub prefix: std::string::String,
4665
4666    /// Optional. A unique identifier for this request. UUID is the recommended
4667    /// format, but other formats are still accepted.
4668    pub request_id: std::string::String,
4669
4670    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4671}
4672
4673impl ListManagedFoldersRequest {
4674    pub fn new() -> Self {
4675        std::default::Default::default()
4676    }
4677
4678    /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
4679    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4680        self.parent = v.into();
4681        self
4682    }
4683
4684    /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
4685    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4686        self.page_size = v.into();
4687        self
4688    }
4689
4690    /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
4691    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4692        self.page_token = v.into();
4693        self
4694    }
4695
4696    /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
4697    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4698        self.prefix = v.into();
4699        self
4700    }
4701
4702    /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
4703    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4704        self.request_id = v.into();
4705        self
4706    }
4707}
4708
4709impl wkt::message::Message for ListManagedFoldersRequest {
4710    fn typename() -> &'static str {
4711        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersRequest"
4712    }
4713}
4714
4715#[doc(hidden)]
4716impl<'de> serde::de::Deserialize<'de> for ListManagedFoldersRequest {
4717    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4718    where
4719        D: serde::Deserializer<'de>,
4720    {
4721        #[allow(non_camel_case_types)]
4722        #[doc(hidden)]
4723        #[derive(PartialEq, Eq, Hash)]
4724        enum __FieldTag {
4725            __parent,
4726            __page_size,
4727            __page_token,
4728            __prefix,
4729            __request_id,
4730            Unknown(std::string::String),
4731        }
4732        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4733            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4734            where
4735                D: serde::Deserializer<'de>,
4736            {
4737                struct Visitor;
4738                impl<'de> serde::de::Visitor<'de> for Visitor {
4739                    type Value = __FieldTag;
4740                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4741                        formatter.write_str("a field name for ListManagedFoldersRequest")
4742                    }
4743                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4744                    where
4745                        E: serde::de::Error,
4746                    {
4747                        use std::result::Result::Ok;
4748                        use std::string::ToString;
4749                        match value {
4750                            "parent" => Ok(__FieldTag::__parent),
4751                            "pageSize" => Ok(__FieldTag::__page_size),
4752                            "page_size" => Ok(__FieldTag::__page_size),
4753                            "pageToken" => Ok(__FieldTag::__page_token),
4754                            "page_token" => Ok(__FieldTag::__page_token),
4755                            "prefix" => Ok(__FieldTag::__prefix),
4756                            "requestId" => Ok(__FieldTag::__request_id),
4757                            "request_id" => Ok(__FieldTag::__request_id),
4758                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4759                        }
4760                    }
4761                }
4762                deserializer.deserialize_identifier(Visitor)
4763            }
4764        }
4765        struct Visitor;
4766        impl<'de> serde::de::Visitor<'de> for Visitor {
4767            type Value = ListManagedFoldersRequest;
4768            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4769                formatter.write_str("struct ListManagedFoldersRequest")
4770            }
4771            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4772            where
4773                A: serde::de::MapAccess<'de>,
4774            {
4775                #[allow(unused_imports)]
4776                use serde::de::Error;
4777                use std::option::Option::Some;
4778                let mut fields = std::collections::HashSet::new();
4779                let mut result = Self::Value::new();
4780                while let Some(tag) = map.next_key::<__FieldTag>()? {
4781                    #[allow(clippy::match_single_binding)]
4782                    match tag {
4783                        __FieldTag::__parent => {
4784                            if !fields.insert(__FieldTag::__parent) {
4785                                return std::result::Result::Err(A::Error::duplicate_field(
4786                                    "multiple values for parent",
4787                                ));
4788                            }
4789                            result.parent = map
4790                                .next_value::<std::option::Option<std::string::String>>()?
4791                                .unwrap_or_default();
4792                        }
4793                        __FieldTag::__page_size => {
4794                            if !fields.insert(__FieldTag::__page_size) {
4795                                return std::result::Result::Err(A::Error::duplicate_field(
4796                                    "multiple values for page_size",
4797                                ));
4798                            }
4799                            struct __With(std::option::Option<i32>);
4800                            impl<'de> serde::de::Deserialize<'de> for __With {
4801                                fn deserialize<D>(
4802                                    deserializer: D,
4803                                ) -> std::result::Result<Self, D::Error>
4804                                where
4805                                    D: serde::de::Deserializer<'de>,
4806                                {
4807                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4808                                }
4809                            }
4810                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
4811                        }
4812                        __FieldTag::__page_token => {
4813                            if !fields.insert(__FieldTag::__page_token) {
4814                                return std::result::Result::Err(A::Error::duplicate_field(
4815                                    "multiple values for page_token",
4816                                ));
4817                            }
4818                            result.page_token = map
4819                                .next_value::<std::option::Option<std::string::String>>()?
4820                                .unwrap_or_default();
4821                        }
4822                        __FieldTag::__prefix => {
4823                            if !fields.insert(__FieldTag::__prefix) {
4824                                return std::result::Result::Err(A::Error::duplicate_field(
4825                                    "multiple values for prefix",
4826                                ));
4827                            }
4828                            result.prefix = map
4829                                .next_value::<std::option::Option<std::string::String>>()?
4830                                .unwrap_or_default();
4831                        }
4832                        __FieldTag::__request_id => {
4833                            if !fields.insert(__FieldTag::__request_id) {
4834                                return std::result::Result::Err(A::Error::duplicate_field(
4835                                    "multiple values for request_id",
4836                                ));
4837                            }
4838                            result.request_id = map
4839                                .next_value::<std::option::Option<std::string::String>>()?
4840                                .unwrap_or_default();
4841                        }
4842                        __FieldTag::Unknown(key) => {
4843                            let value = map.next_value::<serde_json::Value>()?;
4844                            result._unknown_fields.insert(key, value);
4845                        }
4846                    }
4847                }
4848                std::result::Result::Ok(result)
4849            }
4850        }
4851        deserializer.deserialize_any(Visitor)
4852    }
4853}
4854
4855#[doc(hidden)]
4856impl serde::ser::Serialize for ListManagedFoldersRequest {
4857    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4858    where
4859        S: serde::ser::Serializer,
4860    {
4861        use serde::ser::SerializeMap;
4862        #[allow(unused_imports)]
4863        use std::option::Option::Some;
4864        let mut state = serializer.serialize_map(std::option::Option::None)?;
4865        if !self.parent.is_empty() {
4866            state.serialize_entry("parent", &self.parent)?;
4867        }
4868        if !wkt::internal::is_default(&self.page_size) {
4869            struct __With<'a>(&'a i32);
4870            impl<'a> serde::ser::Serialize for __With<'a> {
4871                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4872                where
4873                    S: serde::ser::Serializer,
4874                {
4875                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4876                }
4877            }
4878            state.serialize_entry("pageSize", &__With(&self.page_size))?;
4879        }
4880        if !self.page_token.is_empty() {
4881            state.serialize_entry("pageToken", &self.page_token)?;
4882        }
4883        if !self.prefix.is_empty() {
4884            state.serialize_entry("prefix", &self.prefix)?;
4885        }
4886        if !self.request_id.is_empty() {
4887            state.serialize_entry("requestId", &self.request_id)?;
4888        }
4889        if !self._unknown_fields.is_empty() {
4890            for (key, value) in self._unknown_fields.iter() {
4891                state.serialize_entry(key, &value)?;
4892            }
4893        }
4894        state.end()
4895    }
4896}
4897
4898impl std::fmt::Debug for ListManagedFoldersRequest {
4899    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
4900        let mut debug_struct = f.debug_struct("ListManagedFoldersRequest");
4901        debug_struct.field("parent", &self.parent);
4902        debug_struct.field("page_size", &self.page_size);
4903        debug_struct.field("page_token", &self.page_token);
4904        debug_struct.field("prefix", &self.prefix);
4905        debug_struct.field("request_id", &self.request_id);
4906        if !self._unknown_fields.is_empty() {
4907            debug_struct.field("_unknown_fields", &self._unknown_fields);
4908        }
4909        debug_struct.finish()
4910    }
4911}
4912
4913/// Response message for ListManagedFolders.
4914#[derive(Clone, Default, PartialEq)]
4915#[non_exhaustive]
4916pub struct ListManagedFoldersResponse {
4917    /// The list of matching managed folders
4918    pub managed_folders: std::vec::Vec<crate::model::ManagedFolder>,
4919
4920    /// The continuation token, used to page through large result sets. Provide
4921    /// this value in a subsequent request to return the next page of results.
4922    pub next_page_token: std::string::String,
4923
4924    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4925}
4926
4927impl ListManagedFoldersResponse {
4928    pub fn new() -> Self {
4929        std::default::Default::default()
4930    }
4931
4932    /// Sets the value of [managed_folders][crate::model::ListManagedFoldersResponse::managed_folders].
4933    pub fn set_managed_folders<T, V>(mut self, v: T) -> Self
4934    where
4935        T: std::iter::IntoIterator<Item = V>,
4936        V: std::convert::Into<crate::model::ManagedFolder>,
4937    {
4938        use std::iter::Iterator;
4939        self.managed_folders = v.into_iter().map(|i| i.into()).collect();
4940        self
4941    }
4942
4943    /// Sets the value of [next_page_token][crate::model::ListManagedFoldersResponse::next_page_token].
4944    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4945        self.next_page_token = v.into();
4946        self
4947    }
4948}
4949
4950impl wkt::message::Message for ListManagedFoldersResponse {
4951    fn typename() -> &'static str {
4952        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersResponse"
4953    }
4954}
4955
4956#[doc(hidden)]
4957impl gax::paginator::internal::PageableResponse for ListManagedFoldersResponse {
4958    type PageItem = crate::model::ManagedFolder;
4959
4960    fn items(self) -> std::vec::Vec<Self::PageItem> {
4961        self.managed_folders
4962    }
4963
4964    fn next_page_token(&self) -> std::string::String {
4965        use std::clone::Clone;
4966        self.next_page_token.clone()
4967    }
4968}
4969
4970#[doc(hidden)]
4971impl<'de> serde::de::Deserialize<'de> for ListManagedFoldersResponse {
4972    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4973    where
4974        D: serde::Deserializer<'de>,
4975    {
4976        #[allow(non_camel_case_types)]
4977        #[doc(hidden)]
4978        #[derive(PartialEq, Eq, Hash)]
4979        enum __FieldTag {
4980            __managed_folders,
4981            __next_page_token,
4982            Unknown(std::string::String),
4983        }
4984        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4985            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4986            where
4987                D: serde::Deserializer<'de>,
4988            {
4989                struct Visitor;
4990                impl<'de> serde::de::Visitor<'de> for Visitor {
4991                    type Value = __FieldTag;
4992                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4993                        formatter.write_str("a field name for ListManagedFoldersResponse")
4994                    }
4995                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4996                    where
4997                        E: serde::de::Error,
4998                    {
4999                        use std::result::Result::Ok;
5000                        use std::string::ToString;
5001                        match value {
5002                            "managedFolders" => Ok(__FieldTag::__managed_folders),
5003                            "managed_folders" => Ok(__FieldTag::__managed_folders),
5004                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
5005                            "next_page_token" => Ok(__FieldTag::__next_page_token),
5006                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5007                        }
5008                    }
5009                }
5010                deserializer.deserialize_identifier(Visitor)
5011            }
5012        }
5013        struct Visitor;
5014        impl<'de> serde::de::Visitor<'de> for Visitor {
5015            type Value = ListManagedFoldersResponse;
5016            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5017                formatter.write_str("struct ListManagedFoldersResponse")
5018            }
5019            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5020            where
5021                A: serde::de::MapAccess<'de>,
5022            {
5023                #[allow(unused_imports)]
5024                use serde::de::Error;
5025                use std::option::Option::Some;
5026                let mut fields = std::collections::HashSet::new();
5027                let mut result = Self::Value::new();
5028                while let Some(tag) = map.next_key::<__FieldTag>()? {
5029                    #[allow(clippy::match_single_binding)]
5030                    match tag {
5031                        __FieldTag::__managed_folders => {
5032                            if !fields.insert(__FieldTag::__managed_folders) {
5033                                return std::result::Result::Err(A::Error::duplicate_field(
5034                                    "multiple values for managed_folders",
5035                                ));
5036                            }
5037                            result.managed_folders = map.next_value::<std::option::Option<std::vec::Vec<crate::model::ManagedFolder>>>()?.unwrap_or_default();
5038                        }
5039                        __FieldTag::__next_page_token => {
5040                            if !fields.insert(__FieldTag::__next_page_token) {
5041                                return std::result::Result::Err(A::Error::duplicate_field(
5042                                    "multiple values for next_page_token",
5043                                ));
5044                            }
5045                            result.next_page_token = map
5046                                .next_value::<std::option::Option<std::string::String>>()?
5047                                .unwrap_or_default();
5048                        }
5049                        __FieldTag::Unknown(key) => {
5050                            let value = map.next_value::<serde_json::Value>()?;
5051                            result._unknown_fields.insert(key, value);
5052                        }
5053                    }
5054                }
5055                std::result::Result::Ok(result)
5056            }
5057        }
5058        deserializer.deserialize_any(Visitor)
5059    }
5060}
5061
5062#[doc(hidden)]
5063impl serde::ser::Serialize for ListManagedFoldersResponse {
5064    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5065    where
5066        S: serde::ser::Serializer,
5067    {
5068        use serde::ser::SerializeMap;
5069        #[allow(unused_imports)]
5070        use std::option::Option::Some;
5071        let mut state = serializer.serialize_map(std::option::Option::None)?;
5072        if !self.managed_folders.is_empty() {
5073            state.serialize_entry("managedFolders", &self.managed_folders)?;
5074        }
5075        if !self.next_page_token.is_empty() {
5076            state.serialize_entry("nextPageToken", &self.next_page_token)?;
5077        }
5078        if !self._unknown_fields.is_empty() {
5079            for (key, value) in self._unknown_fields.iter() {
5080                state.serialize_entry(key, &value)?;
5081            }
5082        }
5083        state.end()
5084    }
5085}
5086
5087impl std::fmt::Debug for ListManagedFoldersResponse {
5088    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5089        let mut debug_struct = f.debug_struct("ListManagedFoldersResponse");
5090        debug_struct.field("managed_folders", &self.managed_folders);
5091        debug_struct.field("next_page_token", &self.next_page_token);
5092        if !self._unknown_fields.is_empty() {
5093            debug_struct.field("_unknown_fields", &self._unknown_fields);
5094        }
5095        debug_struct.finish()
5096    }
5097}
5098
5099/// Message returned in the metadata field of the Operation resource for
5100/// CreateAnywhereCache operations.
5101#[derive(Clone, Default, PartialEq)]
5102#[non_exhaustive]
5103pub struct CreateAnywhereCacheMetadata {
5104    /// Generic metadata for the long running operation.
5105    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
5106
5107    /// Anywhere Cache ID.
5108    pub anywhere_cache_id: std::option::Option<std::string::String>,
5109
5110    /// The zone in which the cache instance is running. For example,
5111    /// us-central1-a.
5112    pub zone: std::option::Option<std::string::String>,
5113
5114    /// Anywhere Cache entry's TTL. A cache-level config that is applied to all new
5115    /// cache entries on admission. Default ttl value (24hrs) is applied if not
5116    /// specified in the create request.
5117    pub ttl: std::option::Option<wkt::Duration>,
5118
5119    /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
5120    /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
5121    /// applied if not specified in the create request.
5122    pub admission_policy: std::option::Option<std::string::String>,
5123
5124    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5125}
5126
5127impl CreateAnywhereCacheMetadata {
5128    pub fn new() -> Self {
5129        std::default::Default::default()
5130    }
5131
5132    /// Sets the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
5133    pub fn set_common_metadata<T>(mut self, v: T) -> Self
5134    where
5135        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
5136    {
5137        self.common_metadata = std::option::Option::Some(v.into());
5138        self
5139    }
5140
5141    /// Sets or clears the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
5142    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
5143    where
5144        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
5145    {
5146        self.common_metadata = v.map(|x| x.into());
5147        self
5148    }
5149
5150    /// Sets the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
5151    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
5152    where
5153        T: std::convert::Into<std::string::String>,
5154    {
5155        self.anywhere_cache_id = std::option::Option::Some(v.into());
5156        self
5157    }
5158
5159    /// Sets or clears the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
5160    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
5161    where
5162        T: std::convert::Into<std::string::String>,
5163    {
5164        self.anywhere_cache_id = v.map(|x| x.into());
5165        self
5166    }
5167
5168    /// Sets the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
5169    pub fn set_zone<T>(mut self, v: T) -> Self
5170    where
5171        T: std::convert::Into<std::string::String>,
5172    {
5173        self.zone = std::option::Option::Some(v.into());
5174        self
5175    }
5176
5177    /// Sets or clears the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
5178    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
5179    where
5180        T: std::convert::Into<std::string::String>,
5181    {
5182        self.zone = v.map(|x| x.into());
5183        self
5184    }
5185
5186    /// Sets the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
5187    pub fn set_ttl<T>(mut self, v: T) -> Self
5188    where
5189        T: std::convert::Into<wkt::Duration>,
5190    {
5191        self.ttl = std::option::Option::Some(v.into());
5192        self
5193    }
5194
5195    /// Sets or clears the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
5196    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5197    where
5198        T: std::convert::Into<wkt::Duration>,
5199    {
5200        self.ttl = v.map(|x| x.into());
5201        self
5202    }
5203
5204    /// Sets the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
5205    pub fn set_admission_policy<T>(mut self, v: T) -> Self
5206    where
5207        T: std::convert::Into<std::string::String>,
5208    {
5209        self.admission_policy = std::option::Option::Some(v.into());
5210        self
5211    }
5212
5213    /// Sets or clears the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
5214    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
5215    where
5216        T: std::convert::Into<std::string::String>,
5217    {
5218        self.admission_policy = v.map(|x| x.into());
5219        self
5220    }
5221}
5222
5223impl wkt::message::Message for CreateAnywhereCacheMetadata {
5224    fn typename() -> &'static str {
5225        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheMetadata"
5226    }
5227}
5228
5229#[doc(hidden)]
5230impl<'de> serde::de::Deserialize<'de> for CreateAnywhereCacheMetadata {
5231    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5232    where
5233        D: serde::Deserializer<'de>,
5234    {
5235        #[allow(non_camel_case_types)]
5236        #[doc(hidden)]
5237        #[derive(PartialEq, Eq, Hash)]
5238        enum __FieldTag {
5239            __common_metadata,
5240            __anywhere_cache_id,
5241            __zone,
5242            __ttl,
5243            __admission_policy,
5244            Unknown(std::string::String),
5245        }
5246        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5247            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5248            where
5249                D: serde::Deserializer<'de>,
5250            {
5251                struct Visitor;
5252                impl<'de> serde::de::Visitor<'de> for Visitor {
5253                    type Value = __FieldTag;
5254                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5255                        formatter.write_str("a field name for CreateAnywhereCacheMetadata")
5256                    }
5257                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5258                    where
5259                        E: serde::de::Error,
5260                    {
5261                        use std::result::Result::Ok;
5262                        use std::string::ToString;
5263                        match value {
5264                            "commonMetadata" => Ok(__FieldTag::__common_metadata),
5265                            "common_metadata" => Ok(__FieldTag::__common_metadata),
5266                            "anywhereCacheId" => Ok(__FieldTag::__anywhere_cache_id),
5267                            "anywhere_cache_id" => Ok(__FieldTag::__anywhere_cache_id),
5268                            "zone" => Ok(__FieldTag::__zone),
5269                            "ttl" => Ok(__FieldTag::__ttl),
5270                            "admissionPolicy" => Ok(__FieldTag::__admission_policy),
5271                            "admission_policy" => Ok(__FieldTag::__admission_policy),
5272                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5273                        }
5274                    }
5275                }
5276                deserializer.deserialize_identifier(Visitor)
5277            }
5278        }
5279        struct Visitor;
5280        impl<'de> serde::de::Visitor<'de> for Visitor {
5281            type Value = CreateAnywhereCacheMetadata;
5282            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5283                formatter.write_str("struct CreateAnywhereCacheMetadata")
5284            }
5285            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5286            where
5287                A: serde::de::MapAccess<'de>,
5288            {
5289                #[allow(unused_imports)]
5290                use serde::de::Error;
5291                use std::option::Option::Some;
5292                let mut fields = std::collections::HashSet::new();
5293                let mut result = Self::Value::new();
5294                while let Some(tag) = map.next_key::<__FieldTag>()? {
5295                    #[allow(clippy::match_single_binding)]
5296                    match tag {
5297                        __FieldTag::__common_metadata => {
5298                            if !fields.insert(__FieldTag::__common_metadata) {
5299                                return std::result::Result::Err(A::Error::duplicate_field(
5300                                    "multiple values for common_metadata",
5301                                ));
5302                            }
5303                            result.common_metadata = map.next_value::<std::option::Option<
5304                                crate::model::CommonLongRunningOperationMetadata,
5305                            >>()?;
5306                        }
5307                        __FieldTag::__anywhere_cache_id => {
5308                            if !fields.insert(__FieldTag::__anywhere_cache_id) {
5309                                return std::result::Result::Err(A::Error::duplicate_field(
5310                                    "multiple values for anywhere_cache_id",
5311                                ));
5312                            }
5313                            result.anywhere_cache_id =
5314                                map.next_value::<std::option::Option<std::string::String>>()?;
5315                        }
5316                        __FieldTag::__zone => {
5317                            if !fields.insert(__FieldTag::__zone) {
5318                                return std::result::Result::Err(A::Error::duplicate_field(
5319                                    "multiple values for zone",
5320                                ));
5321                            }
5322                            result.zone =
5323                                map.next_value::<std::option::Option<std::string::String>>()?;
5324                        }
5325                        __FieldTag::__ttl => {
5326                            if !fields.insert(__FieldTag::__ttl) {
5327                                return std::result::Result::Err(A::Error::duplicate_field(
5328                                    "multiple values for ttl",
5329                                ));
5330                            }
5331                            result.ttl = map.next_value::<std::option::Option<wkt::Duration>>()?;
5332                        }
5333                        __FieldTag::__admission_policy => {
5334                            if !fields.insert(__FieldTag::__admission_policy) {
5335                                return std::result::Result::Err(A::Error::duplicate_field(
5336                                    "multiple values for admission_policy",
5337                                ));
5338                            }
5339                            result.admission_policy =
5340                                map.next_value::<std::option::Option<std::string::String>>()?;
5341                        }
5342                        __FieldTag::Unknown(key) => {
5343                            let value = map.next_value::<serde_json::Value>()?;
5344                            result._unknown_fields.insert(key, value);
5345                        }
5346                    }
5347                }
5348                std::result::Result::Ok(result)
5349            }
5350        }
5351        deserializer.deserialize_any(Visitor)
5352    }
5353}
5354
5355#[doc(hidden)]
5356impl serde::ser::Serialize for CreateAnywhereCacheMetadata {
5357    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5358    where
5359        S: serde::ser::Serializer,
5360    {
5361        use serde::ser::SerializeMap;
5362        #[allow(unused_imports)]
5363        use std::option::Option::Some;
5364        let mut state = serializer.serialize_map(std::option::Option::None)?;
5365        if self.common_metadata.is_some() {
5366            state.serialize_entry("commonMetadata", &self.common_metadata)?;
5367        }
5368        if self.anywhere_cache_id.is_some() {
5369            state.serialize_entry("anywhereCacheId", &self.anywhere_cache_id)?;
5370        }
5371        if self.zone.is_some() {
5372            state.serialize_entry("zone", &self.zone)?;
5373        }
5374        if self.ttl.is_some() {
5375            state.serialize_entry("ttl", &self.ttl)?;
5376        }
5377        if self.admission_policy.is_some() {
5378            state.serialize_entry("admissionPolicy", &self.admission_policy)?;
5379        }
5380        if !self._unknown_fields.is_empty() {
5381            for (key, value) in self._unknown_fields.iter() {
5382                state.serialize_entry(key, &value)?;
5383            }
5384        }
5385        state.end()
5386    }
5387}
5388
5389impl std::fmt::Debug for CreateAnywhereCacheMetadata {
5390    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5391        let mut debug_struct = f.debug_struct("CreateAnywhereCacheMetadata");
5392        debug_struct.field("common_metadata", &self.common_metadata);
5393        debug_struct.field("anywhere_cache_id", &self.anywhere_cache_id);
5394        debug_struct.field("zone", &self.zone);
5395        debug_struct.field("ttl", &self.ttl);
5396        debug_struct.field("admission_policy", &self.admission_policy);
5397        if !self._unknown_fields.is_empty() {
5398            debug_struct.field("_unknown_fields", &self._unknown_fields);
5399        }
5400        debug_struct.finish()
5401    }
5402}
5403
5404/// Message returned in the metadata field of the Operation resource for
5405/// UpdateAnywhereCache operation.
5406#[derive(Clone, Default, PartialEq)]
5407#[non_exhaustive]
5408pub struct UpdateAnywhereCacheMetadata {
5409    /// Generic metadata for the long running operation.
5410    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
5411
5412    /// Anywhere Cache ID.
5413    pub anywhere_cache_id: std::option::Option<std::string::String>,
5414
5415    /// The zone in which the cache instance is running. For example,
5416    /// us-central1-a.
5417    pub zone: std::option::Option<std::string::String>,
5418
5419    /// Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that
5420    /// is applied to all new cache entries on admission. If `ttl` is pending
5421    /// update, this field equals to the new value specified in the Update request.
5422    pub ttl: std::option::Option<wkt::Duration>,
5423
5424    /// L4 Cache entry Admission Policy in kebab-case (e.g.,
5425    /// "admit-on-first-miss"). If `admission_policy` is pending
5426    /// update, this field equals to the new value specified in the Update request.
5427    pub admission_policy: std::option::Option<std::string::String>,
5428
5429    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5430}
5431
5432impl UpdateAnywhereCacheMetadata {
5433    pub fn new() -> Self {
5434        std::default::Default::default()
5435    }
5436
5437    /// Sets the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
5438    pub fn set_common_metadata<T>(mut self, v: T) -> Self
5439    where
5440        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
5441    {
5442        self.common_metadata = std::option::Option::Some(v.into());
5443        self
5444    }
5445
5446    /// Sets or clears the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
5447    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
5448    where
5449        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
5450    {
5451        self.common_metadata = v.map(|x| x.into());
5452        self
5453    }
5454
5455    /// Sets the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
5456    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
5457    where
5458        T: std::convert::Into<std::string::String>,
5459    {
5460        self.anywhere_cache_id = std::option::Option::Some(v.into());
5461        self
5462    }
5463
5464    /// Sets or clears the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
5465    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
5466    where
5467        T: std::convert::Into<std::string::String>,
5468    {
5469        self.anywhere_cache_id = v.map(|x| x.into());
5470        self
5471    }
5472
5473    /// Sets the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
5474    pub fn set_zone<T>(mut self, v: T) -> Self
5475    where
5476        T: std::convert::Into<std::string::String>,
5477    {
5478        self.zone = std::option::Option::Some(v.into());
5479        self
5480    }
5481
5482    /// Sets or clears the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
5483    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
5484    where
5485        T: std::convert::Into<std::string::String>,
5486    {
5487        self.zone = v.map(|x| x.into());
5488        self
5489    }
5490
5491    /// Sets the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
5492    pub fn set_ttl<T>(mut self, v: T) -> Self
5493    where
5494        T: std::convert::Into<wkt::Duration>,
5495    {
5496        self.ttl = std::option::Option::Some(v.into());
5497        self
5498    }
5499
5500    /// Sets or clears the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
5501    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5502    where
5503        T: std::convert::Into<wkt::Duration>,
5504    {
5505        self.ttl = v.map(|x| x.into());
5506        self
5507    }
5508
5509    /// Sets the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
5510    pub fn set_admission_policy<T>(mut self, v: T) -> Self
5511    where
5512        T: std::convert::Into<std::string::String>,
5513    {
5514        self.admission_policy = std::option::Option::Some(v.into());
5515        self
5516    }
5517
5518    /// Sets or clears the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
5519    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
5520    where
5521        T: std::convert::Into<std::string::String>,
5522    {
5523        self.admission_policy = v.map(|x| x.into());
5524        self
5525    }
5526}
5527
5528impl wkt::message::Message for UpdateAnywhereCacheMetadata {
5529    fn typename() -> &'static str {
5530        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheMetadata"
5531    }
5532}
5533
5534#[doc(hidden)]
5535impl<'de> serde::de::Deserialize<'de> for UpdateAnywhereCacheMetadata {
5536    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5537    where
5538        D: serde::Deserializer<'de>,
5539    {
5540        #[allow(non_camel_case_types)]
5541        #[doc(hidden)]
5542        #[derive(PartialEq, Eq, Hash)]
5543        enum __FieldTag {
5544            __common_metadata,
5545            __anywhere_cache_id,
5546            __zone,
5547            __ttl,
5548            __admission_policy,
5549            Unknown(std::string::String),
5550        }
5551        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5552            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5553            where
5554                D: serde::Deserializer<'de>,
5555            {
5556                struct Visitor;
5557                impl<'de> serde::de::Visitor<'de> for Visitor {
5558                    type Value = __FieldTag;
5559                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5560                        formatter.write_str("a field name for UpdateAnywhereCacheMetadata")
5561                    }
5562                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5563                    where
5564                        E: serde::de::Error,
5565                    {
5566                        use std::result::Result::Ok;
5567                        use std::string::ToString;
5568                        match value {
5569                            "commonMetadata" => Ok(__FieldTag::__common_metadata),
5570                            "common_metadata" => Ok(__FieldTag::__common_metadata),
5571                            "anywhereCacheId" => Ok(__FieldTag::__anywhere_cache_id),
5572                            "anywhere_cache_id" => Ok(__FieldTag::__anywhere_cache_id),
5573                            "zone" => Ok(__FieldTag::__zone),
5574                            "ttl" => Ok(__FieldTag::__ttl),
5575                            "admissionPolicy" => Ok(__FieldTag::__admission_policy),
5576                            "admission_policy" => Ok(__FieldTag::__admission_policy),
5577                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5578                        }
5579                    }
5580                }
5581                deserializer.deserialize_identifier(Visitor)
5582            }
5583        }
5584        struct Visitor;
5585        impl<'de> serde::de::Visitor<'de> for Visitor {
5586            type Value = UpdateAnywhereCacheMetadata;
5587            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5588                formatter.write_str("struct UpdateAnywhereCacheMetadata")
5589            }
5590            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5591            where
5592                A: serde::de::MapAccess<'de>,
5593            {
5594                #[allow(unused_imports)]
5595                use serde::de::Error;
5596                use std::option::Option::Some;
5597                let mut fields = std::collections::HashSet::new();
5598                let mut result = Self::Value::new();
5599                while let Some(tag) = map.next_key::<__FieldTag>()? {
5600                    #[allow(clippy::match_single_binding)]
5601                    match tag {
5602                        __FieldTag::__common_metadata => {
5603                            if !fields.insert(__FieldTag::__common_metadata) {
5604                                return std::result::Result::Err(A::Error::duplicate_field(
5605                                    "multiple values for common_metadata",
5606                                ));
5607                            }
5608                            result.common_metadata = map.next_value::<std::option::Option<
5609                                crate::model::CommonLongRunningOperationMetadata,
5610                            >>()?;
5611                        }
5612                        __FieldTag::__anywhere_cache_id => {
5613                            if !fields.insert(__FieldTag::__anywhere_cache_id) {
5614                                return std::result::Result::Err(A::Error::duplicate_field(
5615                                    "multiple values for anywhere_cache_id",
5616                                ));
5617                            }
5618                            result.anywhere_cache_id =
5619                                map.next_value::<std::option::Option<std::string::String>>()?;
5620                        }
5621                        __FieldTag::__zone => {
5622                            if !fields.insert(__FieldTag::__zone) {
5623                                return std::result::Result::Err(A::Error::duplicate_field(
5624                                    "multiple values for zone",
5625                                ));
5626                            }
5627                            result.zone =
5628                                map.next_value::<std::option::Option<std::string::String>>()?;
5629                        }
5630                        __FieldTag::__ttl => {
5631                            if !fields.insert(__FieldTag::__ttl) {
5632                                return std::result::Result::Err(A::Error::duplicate_field(
5633                                    "multiple values for ttl",
5634                                ));
5635                            }
5636                            result.ttl = map.next_value::<std::option::Option<wkt::Duration>>()?;
5637                        }
5638                        __FieldTag::__admission_policy => {
5639                            if !fields.insert(__FieldTag::__admission_policy) {
5640                                return std::result::Result::Err(A::Error::duplicate_field(
5641                                    "multiple values for admission_policy",
5642                                ));
5643                            }
5644                            result.admission_policy =
5645                                map.next_value::<std::option::Option<std::string::String>>()?;
5646                        }
5647                        __FieldTag::Unknown(key) => {
5648                            let value = map.next_value::<serde_json::Value>()?;
5649                            result._unknown_fields.insert(key, value);
5650                        }
5651                    }
5652                }
5653                std::result::Result::Ok(result)
5654            }
5655        }
5656        deserializer.deserialize_any(Visitor)
5657    }
5658}
5659
5660#[doc(hidden)]
5661impl serde::ser::Serialize for UpdateAnywhereCacheMetadata {
5662    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5663    where
5664        S: serde::ser::Serializer,
5665    {
5666        use serde::ser::SerializeMap;
5667        #[allow(unused_imports)]
5668        use std::option::Option::Some;
5669        let mut state = serializer.serialize_map(std::option::Option::None)?;
5670        if self.common_metadata.is_some() {
5671            state.serialize_entry("commonMetadata", &self.common_metadata)?;
5672        }
5673        if self.anywhere_cache_id.is_some() {
5674            state.serialize_entry("anywhereCacheId", &self.anywhere_cache_id)?;
5675        }
5676        if self.zone.is_some() {
5677            state.serialize_entry("zone", &self.zone)?;
5678        }
5679        if self.ttl.is_some() {
5680            state.serialize_entry("ttl", &self.ttl)?;
5681        }
5682        if self.admission_policy.is_some() {
5683            state.serialize_entry("admissionPolicy", &self.admission_policy)?;
5684        }
5685        if !self._unknown_fields.is_empty() {
5686            for (key, value) in self._unknown_fields.iter() {
5687                state.serialize_entry(key, &value)?;
5688            }
5689        }
5690        state.end()
5691    }
5692}
5693
5694impl std::fmt::Debug for UpdateAnywhereCacheMetadata {
5695    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
5696        let mut debug_struct = f.debug_struct("UpdateAnywhereCacheMetadata");
5697        debug_struct.field("common_metadata", &self.common_metadata);
5698        debug_struct.field("anywhere_cache_id", &self.anywhere_cache_id);
5699        debug_struct.field("zone", &self.zone);
5700        debug_struct.field("ttl", &self.ttl);
5701        debug_struct.field("admission_policy", &self.admission_policy);
5702        if !self._unknown_fields.is_empty() {
5703            debug_struct.field("_unknown_fields", &self._unknown_fields);
5704        }
5705        debug_struct.finish()
5706    }
5707}
5708
5709/// An Anywhere Cache Instance.
5710#[derive(Clone, Default, PartialEq)]
5711#[non_exhaustive]
5712pub struct AnywhereCache {
5713    /// Immutable. The resource name of this AnywhereCache.
5714    /// Format:
5715    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
5716    pub name: std::string::String,
5717
5718    /// Immutable. The zone in which the cache instance is running. For example,
5719    /// us-central1-a.
5720    pub zone: std::string::String,
5721
5722    /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
5723    /// that defines how long a cache entry can live. Default ttl value (24hrs)
5724    /// is applied if not specified in the create request. TTL must be in whole
5725    /// seconds.
5726    pub ttl: std::option::Option<wkt::Duration>,
5727
5728    /// Cache admission policy. Valid policies includes:
5729    /// `admit-on-first-miss` and `admit-on-second-miss`. Defaults to
5730    /// `admit-on-first-miss`. Default value is applied if not specified in the
5731    /// create request.
5732    pub admission_policy: std::string::String,
5733
5734    /// Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED.
5735    pub state: std::string::String,
5736
5737    /// Output only. Time when Anywhere cache instance is allocated.
5738    pub create_time: std::option::Option<wkt::Timestamp>,
5739
5740    /// Output only. Time when Anywhere cache instance is last updated, including
5741    /// creation.
5742    pub update_time: std::option::Option<wkt::Timestamp>,
5743
5744    /// Output only. True if there is an active update operation against this cache
5745    /// instance. Subsequential update requests will be rejected if this field is
5746    /// true. Output only.
5747    pub pending_update: bool,
5748
5749    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5750}
5751
5752impl AnywhereCache {
5753    pub fn new() -> Self {
5754        std::default::Default::default()
5755    }
5756
5757    /// Sets the value of [name][crate::model::AnywhereCache::name].
5758    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5759        self.name = v.into();
5760        self
5761    }
5762
5763    /// Sets the value of [zone][crate::model::AnywhereCache::zone].
5764    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5765        self.zone = v.into();
5766        self
5767    }
5768
5769    /// Sets the value of [ttl][crate::model::AnywhereCache::ttl].
5770    pub fn set_ttl<T>(mut self, v: T) -> Self
5771    where
5772        T: std::convert::Into<wkt::Duration>,
5773    {
5774        self.ttl = std::option::Option::Some(v.into());
5775        self
5776    }
5777
5778    /// Sets or clears the value of [ttl][crate::model::AnywhereCache::ttl].
5779    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5780    where
5781        T: std::convert::Into<wkt::Duration>,
5782    {
5783        self.ttl = v.map(|x| x.into());
5784        self
5785    }
5786
5787    /// Sets the value of [admission_policy][crate::model::AnywhereCache::admission_policy].
5788    pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
5789        mut self,
5790        v: T,
5791    ) -> Self {
5792        self.admission_policy = v.into();
5793        self
5794    }
5795
5796    /// Sets the value of [state][crate::model::AnywhereCache::state].
5797    pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5798        self.state = v.into();
5799        self
5800    }
5801
5802    /// Sets the value of [create_time][crate::model::AnywhereCache::create_time].
5803    pub fn set_create_time<T>(mut self, v: T) -> Self
5804    where
5805        T: std::convert::Into<wkt::Timestamp>,
5806    {
5807        self.create_time = std::option::Option::Some(v.into());
5808        self
5809    }
5810
5811    /// Sets or clears the value of [create_time][crate::model::AnywhereCache::create_time].
5812    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5813    where
5814        T: std::convert::Into<wkt::Timestamp>,
5815    {
5816        self.create_time = v.map(|x| x.into());
5817        self
5818    }
5819
5820    /// Sets the value of [update_time][crate::model::AnywhereCache::update_time].
5821    pub fn set_update_time<T>(mut self, v: T) -> Self
5822    where
5823        T: std::convert::Into<wkt::Timestamp>,
5824    {
5825        self.update_time = std::option::Option::Some(v.into());
5826        self
5827    }
5828
5829    /// Sets or clears the value of [update_time][crate::model::AnywhereCache::update_time].
5830    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5831    where
5832        T: std::convert::Into<wkt::Timestamp>,
5833    {
5834        self.update_time = v.map(|x| x.into());
5835        self
5836    }
5837
5838    /// Sets the value of [pending_update][crate::model::AnywhereCache::pending_update].
5839    pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5840        self.pending_update = v.into();
5841        self
5842    }
5843}
5844
5845impl wkt::message::Message for AnywhereCache {
5846    fn typename() -> &'static str {
5847        "type.googleapis.com/google.storage.control.v2.AnywhereCache"
5848    }
5849}
5850
5851#[doc(hidden)]
5852impl<'de> serde::de::Deserialize<'de> for AnywhereCache {
5853    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5854    where
5855        D: serde::Deserializer<'de>,
5856    {
5857        #[allow(non_camel_case_types)]
5858        #[doc(hidden)]
5859        #[derive(PartialEq, Eq, Hash)]
5860        enum __FieldTag {
5861            __name,
5862            __zone,
5863            __ttl,
5864            __admission_policy,
5865            __state,
5866            __create_time,
5867            __update_time,
5868            __pending_update,
5869            Unknown(std::string::String),
5870        }
5871        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5872            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5873            where
5874                D: serde::Deserializer<'de>,
5875            {
5876                struct Visitor;
5877                impl<'de> serde::de::Visitor<'de> for Visitor {
5878                    type Value = __FieldTag;
5879                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5880                        formatter.write_str("a field name for AnywhereCache")
5881                    }
5882                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5883                    where
5884                        E: serde::de::Error,
5885                    {
5886                        use std::result::Result::Ok;
5887                        use std::string::ToString;
5888                        match value {
5889                            "name" => Ok(__FieldTag::__name),
5890                            "zone" => Ok(__FieldTag::__zone),
5891                            "ttl" => Ok(__FieldTag::__ttl),
5892                            "admissionPolicy" => Ok(__FieldTag::__admission_policy),
5893                            "admission_policy" => Ok(__FieldTag::__admission_policy),
5894                            "state" => Ok(__FieldTag::__state),
5895                            "createTime" => Ok(__FieldTag::__create_time),
5896                            "create_time" => Ok(__FieldTag::__create_time),
5897                            "updateTime" => Ok(__FieldTag::__update_time),
5898                            "update_time" => Ok(__FieldTag::__update_time),
5899                            "pendingUpdate" => Ok(__FieldTag::__pending_update),
5900                            "pending_update" => Ok(__FieldTag::__pending_update),
5901                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5902                        }
5903                    }
5904                }
5905                deserializer.deserialize_identifier(Visitor)
5906            }
5907        }
5908        struct Visitor;
5909        impl<'de> serde::de::Visitor<'de> for Visitor {
5910            type Value = AnywhereCache;
5911            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5912                formatter.write_str("struct AnywhereCache")
5913            }
5914            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5915            where
5916                A: serde::de::MapAccess<'de>,
5917            {
5918                #[allow(unused_imports)]
5919                use serde::de::Error;
5920                use std::option::Option::Some;
5921                let mut fields = std::collections::HashSet::new();
5922                let mut result = Self::Value::new();
5923                while let Some(tag) = map.next_key::<__FieldTag>()? {
5924                    #[allow(clippy::match_single_binding)]
5925                    match tag {
5926                        __FieldTag::__name => {
5927                            if !fields.insert(__FieldTag::__name) {
5928                                return std::result::Result::Err(A::Error::duplicate_field(
5929                                    "multiple values for name",
5930                                ));
5931                            }
5932                            result.name = map
5933                                .next_value::<std::option::Option<std::string::String>>()?
5934                                .unwrap_or_default();
5935                        }
5936                        __FieldTag::__zone => {
5937                            if !fields.insert(__FieldTag::__zone) {
5938                                return std::result::Result::Err(A::Error::duplicate_field(
5939                                    "multiple values for zone",
5940                                ));
5941                            }
5942                            result.zone = map
5943                                .next_value::<std::option::Option<std::string::String>>()?
5944                                .unwrap_or_default();
5945                        }
5946                        __FieldTag::__ttl => {
5947                            if !fields.insert(__FieldTag::__ttl) {
5948                                return std::result::Result::Err(A::Error::duplicate_field(
5949                                    "multiple values for ttl",
5950                                ));
5951                            }
5952                            result.ttl = map.next_value::<std::option::Option<wkt::Duration>>()?;
5953                        }
5954                        __FieldTag::__admission_policy => {
5955                            if !fields.insert(__FieldTag::__admission_policy) {
5956                                return std::result::Result::Err(A::Error::duplicate_field(
5957                                    "multiple values for admission_policy",
5958                                ));
5959                            }
5960                            result.admission_policy = map
5961                                .next_value::<std::option::Option<std::string::String>>()?
5962                                .unwrap_or_default();
5963                        }
5964                        __FieldTag::__state => {
5965                            if !fields.insert(__FieldTag::__state) {
5966                                return std::result::Result::Err(A::Error::duplicate_field(
5967                                    "multiple values for state",
5968                                ));
5969                            }
5970                            result.state = map
5971                                .next_value::<std::option::Option<std::string::String>>()?
5972                                .unwrap_or_default();
5973                        }
5974                        __FieldTag::__create_time => {
5975                            if !fields.insert(__FieldTag::__create_time) {
5976                                return std::result::Result::Err(A::Error::duplicate_field(
5977                                    "multiple values for create_time",
5978                                ));
5979                            }
5980                            result.create_time =
5981                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5982                        }
5983                        __FieldTag::__update_time => {
5984                            if !fields.insert(__FieldTag::__update_time) {
5985                                return std::result::Result::Err(A::Error::duplicate_field(
5986                                    "multiple values for update_time",
5987                                ));
5988                            }
5989                            result.update_time =
5990                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5991                        }
5992                        __FieldTag::__pending_update => {
5993                            if !fields.insert(__FieldTag::__pending_update) {
5994                                return std::result::Result::Err(A::Error::duplicate_field(
5995                                    "multiple values for pending_update",
5996                                ));
5997                            }
5998                            result.pending_update = map
5999                                .next_value::<std::option::Option<bool>>()?
6000                                .unwrap_or_default();
6001                        }
6002                        __FieldTag::Unknown(key) => {
6003                            let value = map.next_value::<serde_json::Value>()?;
6004                            result._unknown_fields.insert(key, value);
6005                        }
6006                    }
6007                }
6008                std::result::Result::Ok(result)
6009            }
6010        }
6011        deserializer.deserialize_any(Visitor)
6012    }
6013}
6014
6015#[doc(hidden)]
6016impl serde::ser::Serialize for AnywhereCache {
6017    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6018    where
6019        S: serde::ser::Serializer,
6020    {
6021        use serde::ser::SerializeMap;
6022        #[allow(unused_imports)]
6023        use std::option::Option::Some;
6024        let mut state = serializer.serialize_map(std::option::Option::None)?;
6025        if !self.name.is_empty() {
6026            state.serialize_entry("name", &self.name)?;
6027        }
6028        if !self.zone.is_empty() {
6029            state.serialize_entry("zone", &self.zone)?;
6030        }
6031        if self.ttl.is_some() {
6032            state.serialize_entry("ttl", &self.ttl)?;
6033        }
6034        if !self.admission_policy.is_empty() {
6035            state.serialize_entry("admissionPolicy", &self.admission_policy)?;
6036        }
6037        if !self.state.is_empty() {
6038            state.serialize_entry("state", &self.state)?;
6039        }
6040        if self.create_time.is_some() {
6041            state.serialize_entry("createTime", &self.create_time)?;
6042        }
6043        if self.update_time.is_some() {
6044            state.serialize_entry("updateTime", &self.update_time)?;
6045        }
6046        if !wkt::internal::is_default(&self.pending_update) {
6047            state.serialize_entry("pendingUpdate", &self.pending_update)?;
6048        }
6049        if !self._unknown_fields.is_empty() {
6050            for (key, value) in self._unknown_fields.iter() {
6051                state.serialize_entry(key, &value)?;
6052            }
6053        }
6054        state.end()
6055    }
6056}
6057
6058impl std::fmt::Debug for AnywhereCache {
6059    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6060        let mut debug_struct = f.debug_struct("AnywhereCache");
6061        debug_struct.field("name", &self.name);
6062        debug_struct.field("zone", &self.zone);
6063        debug_struct.field("ttl", &self.ttl);
6064        debug_struct.field("admission_policy", &self.admission_policy);
6065        debug_struct.field("state", &self.state);
6066        debug_struct.field("create_time", &self.create_time);
6067        debug_struct.field("update_time", &self.update_time);
6068        debug_struct.field("pending_update", &self.pending_update);
6069        if !self._unknown_fields.is_empty() {
6070            debug_struct.field("_unknown_fields", &self._unknown_fields);
6071        }
6072        debug_struct.finish()
6073    }
6074}
6075
6076/// Request message for CreateAnywhereCache.
6077#[derive(Clone, Default, PartialEq)]
6078#[non_exhaustive]
6079pub struct CreateAnywhereCacheRequest {
6080    /// Required. The bucket to which this cache belongs.
6081    /// Format: `projects/{project}/buckets/{bucket}`
6082    pub parent: std::string::String,
6083
6084    /// Required. Properties of the Anywhere Cache instance being created.
6085    /// The parent bucket name is specified in the `parent` field. Server uses the
6086    /// default value of `ttl` or `admission_policy` if not specified in
6087    /// request.
6088    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
6089
6090    /// Optional. A unique identifier for this request. UUID is the recommended
6091    /// format, but other formats are still accepted. This request is only
6092    /// idempotent if a `request_id` is provided.
6093    pub request_id: std::string::String,
6094
6095    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6096}
6097
6098impl CreateAnywhereCacheRequest {
6099    pub fn new() -> Self {
6100        std::default::Default::default()
6101    }
6102
6103    /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
6104    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6105        self.parent = v.into();
6106        self
6107    }
6108
6109    /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
6110    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
6111    where
6112        T: std::convert::Into<crate::model::AnywhereCache>,
6113    {
6114        self.anywhere_cache = std::option::Option::Some(v.into());
6115        self
6116    }
6117
6118    /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
6119    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
6120    where
6121        T: std::convert::Into<crate::model::AnywhereCache>,
6122    {
6123        self.anywhere_cache = v.map(|x| x.into());
6124        self
6125    }
6126
6127    /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
6128    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6129        self.request_id = v.into();
6130        self
6131    }
6132}
6133
6134impl wkt::message::Message for CreateAnywhereCacheRequest {
6135    fn typename() -> &'static str {
6136        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheRequest"
6137    }
6138}
6139
6140#[doc(hidden)]
6141impl<'de> serde::de::Deserialize<'de> for CreateAnywhereCacheRequest {
6142    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6143    where
6144        D: serde::Deserializer<'de>,
6145    {
6146        #[allow(non_camel_case_types)]
6147        #[doc(hidden)]
6148        #[derive(PartialEq, Eq, Hash)]
6149        enum __FieldTag {
6150            __parent,
6151            __anywhere_cache,
6152            __request_id,
6153            Unknown(std::string::String),
6154        }
6155        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6156            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6157            where
6158                D: serde::Deserializer<'de>,
6159            {
6160                struct Visitor;
6161                impl<'de> serde::de::Visitor<'de> for Visitor {
6162                    type Value = __FieldTag;
6163                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6164                        formatter.write_str("a field name for CreateAnywhereCacheRequest")
6165                    }
6166                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6167                    where
6168                        E: serde::de::Error,
6169                    {
6170                        use std::result::Result::Ok;
6171                        use std::string::ToString;
6172                        match value {
6173                            "parent" => Ok(__FieldTag::__parent),
6174                            "anywhereCache" => Ok(__FieldTag::__anywhere_cache),
6175                            "anywhere_cache" => Ok(__FieldTag::__anywhere_cache),
6176                            "requestId" => Ok(__FieldTag::__request_id),
6177                            "request_id" => Ok(__FieldTag::__request_id),
6178                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6179                        }
6180                    }
6181                }
6182                deserializer.deserialize_identifier(Visitor)
6183            }
6184        }
6185        struct Visitor;
6186        impl<'de> serde::de::Visitor<'de> for Visitor {
6187            type Value = CreateAnywhereCacheRequest;
6188            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6189                formatter.write_str("struct CreateAnywhereCacheRequest")
6190            }
6191            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6192            where
6193                A: serde::de::MapAccess<'de>,
6194            {
6195                #[allow(unused_imports)]
6196                use serde::de::Error;
6197                use std::option::Option::Some;
6198                let mut fields = std::collections::HashSet::new();
6199                let mut result = Self::Value::new();
6200                while let Some(tag) = map.next_key::<__FieldTag>()? {
6201                    #[allow(clippy::match_single_binding)]
6202                    match tag {
6203                        __FieldTag::__parent => {
6204                            if !fields.insert(__FieldTag::__parent) {
6205                                return std::result::Result::Err(A::Error::duplicate_field(
6206                                    "multiple values for parent",
6207                                ));
6208                            }
6209                            result.parent = map
6210                                .next_value::<std::option::Option<std::string::String>>()?
6211                                .unwrap_or_default();
6212                        }
6213                        __FieldTag::__anywhere_cache => {
6214                            if !fields.insert(__FieldTag::__anywhere_cache) {
6215                                return std::result::Result::Err(A::Error::duplicate_field(
6216                                    "multiple values for anywhere_cache",
6217                                ));
6218                            }
6219                            result.anywhere_cache = map
6220                                .next_value::<std::option::Option<crate::model::AnywhereCache>>()?;
6221                        }
6222                        __FieldTag::__request_id => {
6223                            if !fields.insert(__FieldTag::__request_id) {
6224                                return std::result::Result::Err(A::Error::duplicate_field(
6225                                    "multiple values for request_id",
6226                                ));
6227                            }
6228                            result.request_id = map
6229                                .next_value::<std::option::Option<std::string::String>>()?
6230                                .unwrap_or_default();
6231                        }
6232                        __FieldTag::Unknown(key) => {
6233                            let value = map.next_value::<serde_json::Value>()?;
6234                            result._unknown_fields.insert(key, value);
6235                        }
6236                    }
6237                }
6238                std::result::Result::Ok(result)
6239            }
6240        }
6241        deserializer.deserialize_any(Visitor)
6242    }
6243}
6244
6245#[doc(hidden)]
6246impl serde::ser::Serialize for CreateAnywhereCacheRequest {
6247    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6248    where
6249        S: serde::ser::Serializer,
6250    {
6251        use serde::ser::SerializeMap;
6252        #[allow(unused_imports)]
6253        use std::option::Option::Some;
6254        let mut state = serializer.serialize_map(std::option::Option::None)?;
6255        if !self.parent.is_empty() {
6256            state.serialize_entry("parent", &self.parent)?;
6257        }
6258        if self.anywhere_cache.is_some() {
6259            state.serialize_entry("anywhereCache", &self.anywhere_cache)?;
6260        }
6261        if !self.request_id.is_empty() {
6262            state.serialize_entry("requestId", &self.request_id)?;
6263        }
6264        if !self._unknown_fields.is_empty() {
6265            for (key, value) in self._unknown_fields.iter() {
6266                state.serialize_entry(key, &value)?;
6267            }
6268        }
6269        state.end()
6270    }
6271}
6272
6273impl std::fmt::Debug for CreateAnywhereCacheRequest {
6274    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6275        let mut debug_struct = f.debug_struct("CreateAnywhereCacheRequest");
6276        debug_struct.field("parent", &self.parent);
6277        debug_struct.field("anywhere_cache", &self.anywhere_cache);
6278        debug_struct.field("request_id", &self.request_id);
6279        if !self._unknown_fields.is_empty() {
6280            debug_struct.field("_unknown_fields", &self._unknown_fields);
6281        }
6282        debug_struct.finish()
6283    }
6284}
6285
6286/// Request message for UpdateAnywhereCache.
6287#[derive(Clone, Default, PartialEq)]
6288#[non_exhaustive]
6289pub struct UpdateAnywhereCacheRequest {
6290    /// Required. The Anywhere Cache instance to be updated.
6291    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
6292
6293    /// Required. List of fields to be updated. Mutable fields of AnywhereCache
6294    /// include `ttl` and `admission_policy`.
6295    ///
6296    /// To specify ALL fields, specify a single field with the value `*`. Note: We
6297    /// recommend against doing this. If a new field is introduced at a later time,
6298    /// an older client updating with the `*` may accidentally reset the new
6299    /// field's value.
6300    ///
6301    /// Not specifying any fields is an error.
6302    pub update_mask: std::option::Option<wkt::FieldMask>,
6303
6304    /// Optional. A unique identifier for this request. UUID is the recommended
6305    /// format, but other formats are still accepted. This request is only
6306    /// idempotent if a `request_id` is provided.
6307    pub request_id: std::string::String,
6308
6309    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6310}
6311
6312impl UpdateAnywhereCacheRequest {
6313    pub fn new() -> Self {
6314        std::default::Default::default()
6315    }
6316
6317    /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
6318    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
6319    where
6320        T: std::convert::Into<crate::model::AnywhereCache>,
6321    {
6322        self.anywhere_cache = std::option::Option::Some(v.into());
6323        self
6324    }
6325
6326    /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
6327    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
6328    where
6329        T: std::convert::Into<crate::model::AnywhereCache>,
6330    {
6331        self.anywhere_cache = v.map(|x| x.into());
6332        self
6333    }
6334
6335    /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
6336    pub fn set_update_mask<T>(mut self, v: T) -> Self
6337    where
6338        T: std::convert::Into<wkt::FieldMask>,
6339    {
6340        self.update_mask = std::option::Option::Some(v.into());
6341        self
6342    }
6343
6344    /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
6345    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6346    where
6347        T: std::convert::Into<wkt::FieldMask>,
6348    {
6349        self.update_mask = v.map(|x| x.into());
6350        self
6351    }
6352
6353    /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
6354    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6355        self.request_id = v.into();
6356        self
6357    }
6358}
6359
6360impl wkt::message::Message for UpdateAnywhereCacheRequest {
6361    fn typename() -> &'static str {
6362        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheRequest"
6363    }
6364}
6365
6366#[doc(hidden)]
6367impl<'de> serde::de::Deserialize<'de> for UpdateAnywhereCacheRequest {
6368    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6369    where
6370        D: serde::Deserializer<'de>,
6371    {
6372        #[allow(non_camel_case_types)]
6373        #[doc(hidden)]
6374        #[derive(PartialEq, Eq, Hash)]
6375        enum __FieldTag {
6376            __anywhere_cache,
6377            __update_mask,
6378            __request_id,
6379            Unknown(std::string::String),
6380        }
6381        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6382            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6383            where
6384                D: serde::Deserializer<'de>,
6385            {
6386                struct Visitor;
6387                impl<'de> serde::de::Visitor<'de> for Visitor {
6388                    type Value = __FieldTag;
6389                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6390                        formatter.write_str("a field name for UpdateAnywhereCacheRequest")
6391                    }
6392                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6393                    where
6394                        E: serde::de::Error,
6395                    {
6396                        use std::result::Result::Ok;
6397                        use std::string::ToString;
6398                        match value {
6399                            "anywhereCache" => Ok(__FieldTag::__anywhere_cache),
6400                            "anywhere_cache" => Ok(__FieldTag::__anywhere_cache),
6401                            "updateMask" => Ok(__FieldTag::__update_mask),
6402                            "update_mask" => Ok(__FieldTag::__update_mask),
6403                            "requestId" => Ok(__FieldTag::__request_id),
6404                            "request_id" => Ok(__FieldTag::__request_id),
6405                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6406                        }
6407                    }
6408                }
6409                deserializer.deserialize_identifier(Visitor)
6410            }
6411        }
6412        struct Visitor;
6413        impl<'de> serde::de::Visitor<'de> for Visitor {
6414            type Value = UpdateAnywhereCacheRequest;
6415            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6416                formatter.write_str("struct UpdateAnywhereCacheRequest")
6417            }
6418            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6419            where
6420                A: serde::de::MapAccess<'de>,
6421            {
6422                #[allow(unused_imports)]
6423                use serde::de::Error;
6424                use std::option::Option::Some;
6425                let mut fields = std::collections::HashSet::new();
6426                let mut result = Self::Value::new();
6427                while let Some(tag) = map.next_key::<__FieldTag>()? {
6428                    #[allow(clippy::match_single_binding)]
6429                    match tag {
6430                        __FieldTag::__anywhere_cache => {
6431                            if !fields.insert(__FieldTag::__anywhere_cache) {
6432                                return std::result::Result::Err(A::Error::duplicate_field(
6433                                    "multiple values for anywhere_cache",
6434                                ));
6435                            }
6436                            result.anywhere_cache = map
6437                                .next_value::<std::option::Option<crate::model::AnywhereCache>>()?;
6438                        }
6439                        __FieldTag::__update_mask => {
6440                            if !fields.insert(__FieldTag::__update_mask) {
6441                                return std::result::Result::Err(A::Error::duplicate_field(
6442                                    "multiple values for update_mask",
6443                                ));
6444                            }
6445                            result.update_mask =
6446                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
6447                        }
6448                        __FieldTag::__request_id => {
6449                            if !fields.insert(__FieldTag::__request_id) {
6450                                return std::result::Result::Err(A::Error::duplicate_field(
6451                                    "multiple values for request_id",
6452                                ));
6453                            }
6454                            result.request_id = map
6455                                .next_value::<std::option::Option<std::string::String>>()?
6456                                .unwrap_or_default();
6457                        }
6458                        __FieldTag::Unknown(key) => {
6459                            let value = map.next_value::<serde_json::Value>()?;
6460                            result._unknown_fields.insert(key, value);
6461                        }
6462                    }
6463                }
6464                std::result::Result::Ok(result)
6465            }
6466        }
6467        deserializer.deserialize_any(Visitor)
6468    }
6469}
6470
6471#[doc(hidden)]
6472impl serde::ser::Serialize for UpdateAnywhereCacheRequest {
6473    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6474    where
6475        S: serde::ser::Serializer,
6476    {
6477        use serde::ser::SerializeMap;
6478        #[allow(unused_imports)]
6479        use std::option::Option::Some;
6480        let mut state = serializer.serialize_map(std::option::Option::None)?;
6481        if self.anywhere_cache.is_some() {
6482            state.serialize_entry("anywhereCache", &self.anywhere_cache)?;
6483        }
6484        if self.update_mask.is_some() {
6485            state.serialize_entry("updateMask", &self.update_mask)?;
6486        }
6487        if !self.request_id.is_empty() {
6488            state.serialize_entry("requestId", &self.request_id)?;
6489        }
6490        if !self._unknown_fields.is_empty() {
6491            for (key, value) in self._unknown_fields.iter() {
6492                state.serialize_entry(key, &value)?;
6493            }
6494        }
6495        state.end()
6496    }
6497}
6498
6499impl std::fmt::Debug for UpdateAnywhereCacheRequest {
6500    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6501        let mut debug_struct = f.debug_struct("UpdateAnywhereCacheRequest");
6502        debug_struct.field("anywhere_cache", &self.anywhere_cache);
6503        debug_struct.field("update_mask", &self.update_mask);
6504        debug_struct.field("request_id", &self.request_id);
6505        if !self._unknown_fields.is_empty() {
6506            debug_struct.field("_unknown_fields", &self._unknown_fields);
6507        }
6508        debug_struct.finish()
6509    }
6510}
6511
6512/// Request message for DisableAnywhereCache.
6513#[derive(Clone, Default, PartialEq)]
6514#[non_exhaustive]
6515pub struct DisableAnywhereCacheRequest {
6516    /// Required. The name field in the request should be:
6517    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
6518    pub name: std::string::String,
6519
6520    /// Optional. A unique identifier for this request. UUID is the recommended
6521    /// format, but other formats are still accepted. This request is only
6522    /// idempotent if a `request_id` is provided.
6523    pub request_id: std::string::String,
6524
6525    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6526}
6527
6528impl DisableAnywhereCacheRequest {
6529    pub fn new() -> Self {
6530        std::default::Default::default()
6531    }
6532
6533    /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
6534    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6535        self.name = v.into();
6536        self
6537    }
6538
6539    /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
6540    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6541        self.request_id = v.into();
6542        self
6543    }
6544}
6545
6546impl wkt::message::Message for DisableAnywhereCacheRequest {
6547    fn typename() -> &'static str {
6548        "type.googleapis.com/google.storage.control.v2.DisableAnywhereCacheRequest"
6549    }
6550}
6551
6552#[doc(hidden)]
6553impl<'de> serde::de::Deserialize<'de> for DisableAnywhereCacheRequest {
6554    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6555    where
6556        D: serde::Deserializer<'de>,
6557    {
6558        #[allow(non_camel_case_types)]
6559        #[doc(hidden)]
6560        #[derive(PartialEq, Eq, Hash)]
6561        enum __FieldTag {
6562            __name,
6563            __request_id,
6564            Unknown(std::string::String),
6565        }
6566        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6567            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6568            where
6569                D: serde::Deserializer<'de>,
6570            {
6571                struct Visitor;
6572                impl<'de> serde::de::Visitor<'de> for Visitor {
6573                    type Value = __FieldTag;
6574                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6575                        formatter.write_str("a field name for DisableAnywhereCacheRequest")
6576                    }
6577                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6578                    where
6579                        E: serde::de::Error,
6580                    {
6581                        use std::result::Result::Ok;
6582                        use std::string::ToString;
6583                        match value {
6584                            "name" => Ok(__FieldTag::__name),
6585                            "requestId" => Ok(__FieldTag::__request_id),
6586                            "request_id" => Ok(__FieldTag::__request_id),
6587                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6588                        }
6589                    }
6590                }
6591                deserializer.deserialize_identifier(Visitor)
6592            }
6593        }
6594        struct Visitor;
6595        impl<'de> serde::de::Visitor<'de> for Visitor {
6596            type Value = DisableAnywhereCacheRequest;
6597            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6598                formatter.write_str("struct DisableAnywhereCacheRequest")
6599            }
6600            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6601            where
6602                A: serde::de::MapAccess<'de>,
6603            {
6604                #[allow(unused_imports)]
6605                use serde::de::Error;
6606                use std::option::Option::Some;
6607                let mut fields = std::collections::HashSet::new();
6608                let mut result = Self::Value::new();
6609                while let Some(tag) = map.next_key::<__FieldTag>()? {
6610                    #[allow(clippy::match_single_binding)]
6611                    match tag {
6612                        __FieldTag::__name => {
6613                            if !fields.insert(__FieldTag::__name) {
6614                                return std::result::Result::Err(A::Error::duplicate_field(
6615                                    "multiple values for name",
6616                                ));
6617                            }
6618                            result.name = map
6619                                .next_value::<std::option::Option<std::string::String>>()?
6620                                .unwrap_or_default();
6621                        }
6622                        __FieldTag::__request_id => {
6623                            if !fields.insert(__FieldTag::__request_id) {
6624                                return std::result::Result::Err(A::Error::duplicate_field(
6625                                    "multiple values for request_id",
6626                                ));
6627                            }
6628                            result.request_id = map
6629                                .next_value::<std::option::Option<std::string::String>>()?
6630                                .unwrap_or_default();
6631                        }
6632                        __FieldTag::Unknown(key) => {
6633                            let value = map.next_value::<serde_json::Value>()?;
6634                            result._unknown_fields.insert(key, value);
6635                        }
6636                    }
6637                }
6638                std::result::Result::Ok(result)
6639            }
6640        }
6641        deserializer.deserialize_any(Visitor)
6642    }
6643}
6644
6645#[doc(hidden)]
6646impl serde::ser::Serialize for DisableAnywhereCacheRequest {
6647    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6648    where
6649        S: serde::ser::Serializer,
6650    {
6651        use serde::ser::SerializeMap;
6652        #[allow(unused_imports)]
6653        use std::option::Option::Some;
6654        let mut state = serializer.serialize_map(std::option::Option::None)?;
6655        if !self.name.is_empty() {
6656            state.serialize_entry("name", &self.name)?;
6657        }
6658        if !self.request_id.is_empty() {
6659            state.serialize_entry("requestId", &self.request_id)?;
6660        }
6661        if !self._unknown_fields.is_empty() {
6662            for (key, value) in self._unknown_fields.iter() {
6663                state.serialize_entry(key, &value)?;
6664            }
6665        }
6666        state.end()
6667    }
6668}
6669
6670impl std::fmt::Debug for DisableAnywhereCacheRequest {
6671    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6672        let mut debug_struct = f.debug_struct("DisableAnywhereCacheRequest");
6673        debug_struct.field("name", &self.name);
6674        debug_struct.field("request_id", &self.request_id);
6675        if !self._unknown_fields.is_empty() {
6676            debug_struct.field("_unknown_fields", &self._unknown_fields);
6677        }
6678        debug_struct.finish()
6679    }
6680}
6681
6682/// Request message for PauseAnywhereCache.
6683#[derive(Clone, Default, PartialEq)]
6684#[non_exhaustive]
6685pub struct PauseAnywhereCacheRequest {
6686    /// Required. The name field in the request should be:
6687    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
6688    pub name: std::string::String,
6689
6690    /// Optional. A unique identifier for this request. UUID is the recommended
6691    /// format, but other formats are still accepted. This request is only
6692    /// idempotent if a `request_id` is provided.
6693    pub request_id: std::string::String,
6694
6695    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6696}
6697
6698impl PauseAnywhereCacheRequest {
6699    pub fn new() -> Self {
6700        std::default::Default::default()
6701    }
6702
6703    /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
6704    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6705        self.name = v.into();
6706        self
6707    }
6708
6709    /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
6710    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6711        self.request_id = v.into();
6712        self
6713    }
6714}
6715
6716impl wkt::message::Message for PauseAnywhereCacheRequest {
6717    fn typename() -> &'static str {
6718        "type.googleapis.com/google.storage.control.v2.PauseAnywhereCacheRequest"
6719    }
6720}
6721
6722#[doc(hidden)]
6723impl<'de> serde::de::Deserialize<'de> for PauseAnywhereCacheRequest {
6724    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6725    where
6726        D: serde::Deserializer<'de>,
6727    {
6728        #[allow(non_camel_case_types)]
6729        #[doc(hidden)]
6730        #[derive(PartialEq, Eq, Hash)]
6731        enum __FieldTag {
6732            __name,
6733            __request_id,
6734            Unknown(std::string::String),
6735        }
6736        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6737            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6738            where
6739                D: serde::Deserializer<'de>,
6740            {
6741                struct Visitor;
6742                impl<'de> serde::de::Visitor<'de> for Visitor {
6743                    type Value = __FieldTag;
6744                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6745                        formatter.write_str("a field name for PauseAnywhereCacheRequest")
6746                    }
6747                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6748                    where
6749                        E: serde::de::Error,
6750                    {
6751                        use std::result::Result::Ok;
6752                        use std::string::ToString;
6753                        match value {
6754                            "name" => Ok(__FieldTag::__name),
6755                            "requestId" => Ok(__FieldTag::__request_id),
6756                            "request_id" => Ok(__FieldTag::__request_id),
6757                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6758                        }
6759                    }
6760                }
6761                deserializer.deserialize_identifier(Visitor)
6762            }
6763        }
6764        struct Visitor;
6765        impl<'de> serde::de::Visitor<'de> for Visitor {
6766            type Value = PauseAnywhereCacheRequest;
6767            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6768                formatter.write_str("struct PauseAnywhereCacheRequest")
6769            }
6770            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6771            where
6772                A: serde::de::MapAccess<'de>,
6773            {
6774                #[allow(unused_imports)]
6775                use serde::de::Error;
6776                use std::option::Option::Some;
6777                let mut fields = std::collections::HashSet::new();
6778                let mut result = Self::Value::new();
6779                while let Some(tag) = map.next_key::<__FieldTag>()? {
6780                    #[allow(clippy::match_single_binding)]
6781                    match tag {
6782                        __FieldTag::__name => {
6783                            if !fields.insert(__FieldTag::__name) {
6784                                return std::result::Result::Err(A::Error::duplicate_field(
6785                                    "multiple values for name",
6786                                ));
6787                            }
6788                            result.name = map
6789                                .next_value::<std::option::Option<std::string::String>>()?
6790                                .unwrap_or_default();
6791                        }
6792                        __FieldTag::__request_id => {
6793                            if !fields.insert(__FieldTag::__request_id) {
6794                                return std::result::Result::Err(A::Error::duplicate_field(
6795                                    "multiple values for request_id",
6796                                ));
6797                            }
6798                            result.request_id = map
6799                                .next_value::<std::option::Option<std::string::String>>()?
6800                                .unwrap_or_default();
6801                        }
6802                        __FieldTag::Unknown(key) => {
6803                            let value = map.next_value::<serde_json::Value>()?;
6804                            result._unknown_fields.insert(key, value);
6805                        }
6806                    }
6807                }
6808                std::result::Result::Ok(result)
6809            }
6810        }
6811        deserializer.deserialize_any(Visitor)
6812    }
6813}
6814
6815#[doc(hidden)]
6816impl serde::ser::Serialize for PauseAnywhereCacheRequest {
6817    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6818    where
6819        S: serde::ser::Serializer,
6820    {
6821        use serde::ser::SerializeMap;
6822        #[allow(unused_imports)]
6823        use std::option::Option::Some;
6824        let mut state = serializer.serialize_map(std::option::Option::None)?;
6825        if !self.name.is_empty() {
6826            state.serialize_entry("name", &self.name)?;
6827        }
6828        if !self.request_id.is_empty() {
6829            state.serialize_entry("requestId", &self.request_id)?;
6830        }
6831        if !self._unknown_fields.is_empty() {
6832            for (key, value) in self._unknown_fields.iter() {
6833                state.serialize_entry(key, &value)?;
6834            }
6835        }
6836        state.end()
6837    }
6838}
6839
6840impl std::fmt::Debug for PauseAnywhereCacheRequest {
6841    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
6842        let mut debug_struct = f.debug_struct("PauseAnywhereCacheRequest");
6843        debug_struct.field("name", &self.name);
6844        debug_struct.field("request_id", &self.request_id);
6845        if !self._unknown_fields.is_empty() {
6846            debug_struct.field("_unknown_fields", &self._unknown_fields);
6847        }
6848        debug_struct.finish()
6849    }
6850}
6851
6852/// Request message for ResumeAnywhereCache.
6853#[derive(Clone, Default, PartialEq)]
6854#[non_exhaustive]
6855pub struct ResumeAnywhereCacheRequest {
6856    /// Required. The name field in the request should be:
6857    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
6858    pub name: std::string::String,
6859
6860    /// Optional. A unique identifier for this request. UUID is the recommended
6861    /// format, but other formats are still accepted. This request is only
6862    /// idempotent if a `request_id` is provided.
6863    pub request_id: std::string::String,
6864
6865    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6866}
6867
6868impl ResumeAnywhereCacheRequest {
6869    pub fn new() -> Self {
6870        std::default::Default::default()
6871    }
6872
6873    /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
6874    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6875        self.name = v.into();
6876        self
6877    }
6878
6879    /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
6880    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6881        self.request_id = v.into();
6882        self
6883    }
6884}
6885
6886impl wkt::message::Message for ResumeAnywhereCacheRequest {
6887    fn typename() -> &'static str {
6888        "type.googleapis.com/google.storage.control.v2.ResumeAnywhereCacheRequest"
6889    }
6890}
6891
6892#[doc(hidden)]
6893impl<'de> serde::de::Deserialize<'de> for ResumeAnywhereCacheRequest {
6894    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6895    where
6896        D: serde::Deserializer<'de>,
6897    {
6898        #[allow(non_camel_case_types)]
6899        #[doc(hidden)]
6900        #[derive(PartialEq, Eq, Hash)]
6901        enum __FieldTag {
6902            __name,
6903            __request_id,
6904            Unknown(std::string::String),
6905        }
6906        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6907            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6908            where
6909                D: serde::Deserializer<'de>,
6910            {
6911                struct Visitor;
6912                impl<'de> serde::de::Visitor<'de> for Visitor {
6913                    type Value = __FieldTag;
6914                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6915                        formatter.write_str("a field name for ResumeAnywhereCacheRequest")
6916                    }
6917                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6918                    where
6919                        E: serde::de::Error,
6920                    {
6921                        use std::result::Result::Ok;
6922                        use std::string::ToString;
6923                        match value {
6924                            "name" => Ok(__FieldTag::__name),
6925                            "requestId" => Ok(__FieldTag::__request_id),
6926                            "request_id" => Ok(__FieldTag::__request_id),
6927                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6928                        }
6929                    }
6930                }
6931                deserializer.deserialize_identifier(Visitor)
6932            }
6933        }
6934        struct Visitor;
6935        impl<'de> serde::de::Visitor<'de> for Visitor {
6936            type Value = ResumeAnywhereCacheRequest;
6937            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6938                formatter.write_str("struct ResumeAnywhereCacheRequest")
6939            }
6940            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6941            where
6942                A: serde::de::MapAccess<'de>,
6943            {
6944                #[allow(unused_imports)]
6945                use serde::de::Error;
6946                use std::option::Option::Some;
6947                let mut fields = std::collections::HashSet::new();
6948                let mut result = Self::Value::new();
6949                while let Some(tag) = map.next_key::<__FieldTag>()? {
6950                    #[allow(clippy::match_single_binding)]
6951                    match tag {
6952                        __FieldTag::__name => {
6953                            if !fields.insert(__FieldTag::__name) {
6954                                return std::result::Result::Err(A::Error::duplicate_field(
6955                                    "multiple values for name",
6956                                ));
6957                            }
6958                            result.name = map
6959                                .next_value::<std::option::Option<std::string::String>>()?
6960                                .unwrap_or_default();
6961                        }
6962                        __FieldTag::__request_id => {
6963                            if !fields.insert(__FieldTag::__request_id) {
6964                                return std::result::Result::Err(A::Error::duplicate_field(
6965                                    "multiple values for request_id",
6966                                ));
6967                            }
6968                            result.request_id = map
6969                                .next_value::<std::option::Option<std::string::String>>()?
6970                                .unwrap_or_default();
6971                        }
6972                        __FieldTag::Unknown(key) => {
6973                            let value = map.next_value::<serde_json::Value>()?;
6974                            result._unknown_fields.insert(key, value);
6975                        }
6976                    }
6977                }
6978                std::result::Result::Ok(result)
6979            }
6980        }
6981        deserializer.deserialize_any(Visitor)
6982    }
6983}
6984
6985#[doc(hidden)]
6986impl serde::ser::Serialize for ResumeAnywhereCacheRequest {
6987    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6988    where
6989        S: serde::ser::Serializer,
6990    {
6991        use serde::ser::SerializeMap;
6992        #[allow(unused_imports)]
6993        use std::option::Option::Some;
6994        let mut state = serializer.serialize_map(std::option::Option::None)?;
6995        if !self.name.is_empty() {
6996            state.serialize_entry("name", &self.name)?;
6997        }
6998        if !self.request_id.is_empty() {
6999            state.serialize_entry("requestId", &self.request_id)?;
7000        }
7001        if !self._unknown_fields.is_empty() {
7002            for (key, value) in self._unknown_fields.iter() {
7003                state.serialize_entry(key, &value)?;
7004            }
7005        }
7006        state.end()
7007    }
7008}
7009
7010impl std::fmt::Debug for ResumeAnywhereCacheRequest {
7011    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7012        let mut debug_struct = f.debug_struct("ResumeAnywhereCacheRequest");
7013        debug_struct.field("name", &self.name);
7014        debug_struct.field("request_id", &self.request_id);
7015        if !self._unknown_fields.is_empty() {
7016            debug_struct.field("_unknown_fields", &self._unknown_fields);
7017        }
7018        debug_struct.finish()
7019    }
7020}
7021
7022/// Request message for GetAnywhereCache.
7023#[derive(Clone, Default, PartialEq)]
7024#[non_exhaustive]
7025pub struct GetAnywhereCacheRequest {
7026    /// Required. The name field in the request should be:
7027    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
7028    pub name: std::string::String,
7029
7030    /// Optional. A unique identifier for this request. UUID is the recommended
7031    /// format, but other formats are still accepted.
7032    pub request_id: std::string::String,
7033
7034    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7035}
7036
7037impl GetAnywhereCacheRequest {
7038    pub fn new() -> Self {
7039        std::default::Default::default()
7040    }
7041
7042    /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
7043    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7044        self.name = v.into();
7045        self
7046    }
7047
7048    /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
7049    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7050        self.request_id = v.into();
7051        self
7052    }
7053}
7054
7055impl wkt::message::Message for GetAnywhereCacheRequest {
7056    fn typename() -> &'static str {
7057        "type.googleapis.com/google.storage.control.v2.GetAnywhereCacheRequest"
7058    }
7059}
7060
7061#[doc(hidden)]
7062impl<'de> serde::de::Deserialize<'de> for GetAnywhereCacheRequest {
7063    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7064    where
7065        D: serde::Deserializer<'de>,
7066    {
7067        #[allow(non_camel_case_types)]
7068        #[doc(hidden)]
7069        #[derive(PartialEq, Eq, Hash)]
7070        enum __FieldTag {
7071            __name,
7072            __request_id,
7073            Unknown(std::string::String),
7074        }
7075        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7076            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7077            where
7078                D: serde::Deserializer<'de>,
7079            {
7080                struct Visitor;
7081                impl<'de> serde::de::Visitor<'de> for Visitor {
7082                    type Value = __FieldTag;
7083                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7084                        formatter.write_str("a field name for GetAnywhereCacheRequest")
7085                    }
7086                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7087                    where
7088                        E: serde::de::Error,
7089                    {
7090                        use std::result::Result::Ok;
7091                        use std::string::ToString;
7092                        match value {
7093                            "name" => Ok(__FieldTag::__name),
7094                            "requestId" => Ok(__FieldTag::__request_id),
7095                            "request_id" => Ok(__FieldTag::__request_id),
7096                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7097                        }
7098                    }
7099                }
7100                deserializer.deserialize_identifier(Visitor)
7101            }
7102        }
7103        struct Visitor;
7104        impl<'de> serde::de::Visitor<'de> for Visitor {
7105            type Value = GetAnywhereCacheRequest;
7106            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7107                formatter.write_str("struct GetAnywhereCacheRequest")
7108            }
7109            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7110            where
7111                A: serde::de::MapAccess<'de>,
7112            {
7113                #[allow(unused_imports)]
7114                use serde::de::Error;
7115                use std::option::Option::Some;
7116                let mut fields = std::collections::HashSet::new();
7117                let mut result = Self::Value::new();
7118                while let Some(tag) = map.next_key::<__FieldTag>()? {
7119                    #[allow(clippy::match_single_binding)]
7120                    match tag {
7121                        __FieldTag::__name => {
7122                            if !fields.insert(__FieldTag::__name) {
7123                                return std::result::Result::Err(A::Error::duplicate_field(
7124                                    "multiple values for name",
7125                                ));
7126                            }
7127                            result.name = map
7128                                .next_value::<std::option::Option<std::string::String>>()?
7129                                .unwrap_or_default();
7130                        }
7131                        __FieldTag::__request_id => {
7132                            if !fields.insert(__FieldTag::__request_id) {
7133                                return std::result::Result::Err(A::Error::duplicate_field(
7134                                    "multiple values for request_id",
7135                                ));
7136                            }
7137                            result.request_id = map
7138                                .next_value::<std::option::Option<std::string::String>>()?
7139                                .unwrap_or_default();
7140                        }
7141                        __FieldTag::Unknown(key) => {
7142                            let value = map.next_value::<serde_json::Value>()?;
7143                            result._unknown_fields.insert(key, value);
7144                        }
7145                    }
7146                }
7147                std::result::Result::Ok(result)
7148            }
7149        }
7150        deserializer.deserialize_any(Visitor)
7151    }
7152}
7153
7154#[doc(hidden)]
7155impl serde::ser::Serialize for GetAnywhereCacheRequest {
7156    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7157    where
7158        S: serde::ser::Serializer,
7159    {
7160        use serde::ser::SerializeMap;
7161        #[allow(unused_imports)]
7162        use std::option::Option::Some;
7163        let mut state = serializer.serialize_map(std::option::Option::None)?;
7164        if !self.name.is_empty() {
7165            state.serialize_entry("name", &self.name)?;
7166        }
7167        if !self.request_id.is_empty() {
7168            state.serialize_entry("requestId", &self.request_id)?;
7169        }
7170        if !self._unknown_fields.is_empty() {
7171            for (key, value) in self._unknown_fields.iter() {
7172                state.serialize_entry(key, &value)?;
7173            }
7174        }
7175        state.end()
7176    }
7177}
7178
7179impl std::fmt::Debug for GetAnywhereCacheRequest {
7180    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7181        let mut debug_struct = f.debug_struct("GetAnywhereCacheRequest");
7182        debug_struct.field("name", &self.name);
7183        debug_struct.field("request_id", &self.request_id);
7184        if !self._unknown_fields.is_empty() {
7185            debug_struct.field("_unknown_fields", &self._unknown_fields);
7186        }
7187        debug_struct.finish()
7188    }
7189}
7190
7191/// Request message for ListAnywhereCaches.
7192#[derive(Clone, Default, PartialEq)]
7193#[non_exhaustive]
7194pub struct ListAnywhereCachesRequest {
7195    /// Required. The bucket to which this cache belongs.
7196    pub parent: std::string::String,
7197
7198    /// Maximum number of caches to return in a single response.
7199    /// The service will use this parameter or 1,000 items, whichever is smaller.
7200    pub page_size: i32,
7201
7202    /// A previously-returned page token representing part of the larger set of
7203    /// results to view.
7204    pub page_token: std::string::String,
7205
7206    /// Optional. A unique identifier for this request. UUID is the recommended
7207    /// format, but other formats are still accepted.
7208    pub request_id: std::string::String,
7209
7210    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7211}
7212
7213impl ListAnywhereCachesRequest {
7214    pub fn new() -> Self {
7215        std::default::Default::default()
7216    }
7217
7218    /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
7219    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7220        self.parent = v.into();
7221        self
7222    }
7223
7224    /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
7225    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
7226        self.page_size = v.into();
7227        self
7228    }
7229
7230    /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
7231    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7232        self.page_token = v.into();
7233        self
7234    }
7235
7236    /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
7237    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7238        self.request_id = v.into();
7239        self
7240    }
7241}
7242
7243impl wkt::message::Message for ListAnywhereCachesRequest {
7244    fn typename() -> &'static str {
7245        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesRequest"
7246    }
7247}
7248
7249#[doc(hidden)]
7250impl<'de> serde::de::Deserialize<'de> for ListAnywhereCachesRequest {
7251    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7252    where
7253        D: serde::Deserializer<'de>,
7254    {
7255        #[allow(non_camel_case_types)]
7256        #[doc(hidden)]
7257        #[derive(PartialEq, Eq, Hash)]
7258        enum __FieldTag {
7259            __parent,
7260            __page_size,
7261            __page_token,
7262            __request_id,
7263            Unknown(std::string::String),
7264        }
7265        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7266            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7267            where
7268                D: serde::Deserializer<'de>,
7269            {
7270                struct Visitor;
7271                impl<'de> serde::de::Visitor<'de> for Visitor {
7272                    type Value = __FieldTag;
7273                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7274                        formatter.write_str("a field name for ListAnywhereCachesRequest")
7275                    }
7276                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7277                    where
7278                        E: serde::de::Error,
7279                    {
7280                        use std::result::Result::Ok;
7281                        use std::string::ToString;
7282                        match value {
7283                            "parent" => Ok(__FieldTag::__parent),
7284                            "pageSize" => Ok(__FieldTag::__page_size),
7285                            "page_size" => Ok(__FieldTag::__page_size),
7286                            "pageToken" => Ok(__FieldTag::__page_token),
7287                            "page_token" => Ok(__FieldTag::__page_token),
7288                            "requestId" => Ok(__FieldTag::__request_id),
7289                            "request_id" => Ok(__FieldTag::__request_id),
7290                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7291                        }
7292                    }
7293                }
7294                deserializer.deserialize_identifier(Visitor)
7295            }
7296        }
7297        struct Visitor;
7298        impl<'de> serde::de::Visitor<'de> for Visitor {
7299            type Value = ListAnywhereCachesRequest;
7300            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7301                formatter.write_str("struct ListAnywhereCachesRequest")
7302            }
7303            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7304            where
7305                A: serde::de::MapAccess<'de>,
7306            {
7307                #[allow(unused_imports)]
7308                use serde::de::Error;
7309                use std::option::Option::Some;
7310                let mut fields = std::collections::HashSet::new();
7311                let mut result = Self::Value::new();
7312                while let Some(tag) = map.next_key::<__FieldTag>()? {
7313                    #[allow(clippy::match_single_binding)]
7314                    match tag {
7315                        __FieldTag::__parent => {
7316                            if !fields.insert(__FieldTag::__parent) {
7317                                return std::result::Result::Err(A::Error::duplicate_field(
7318                                    "multiple values for parent",
7319                                ));
7320                            }
7321                            result.parent = map
7322                                .next_value::<std::option::Option<std::string::String>>()?
7323                                .unwrap_or_default();
7324                        }
7325                        __FieldTag::__page_size => {
7326                            if !fields.insert(__FieldTag::__page_size) {
7327                                return std::result::Result::Err(A::Error::duplicate_field(
7328                                    "multiple values for page_size",
7329                                ));
7330                            }
7331                            struct __With(std::option::Option<i32>);
7332                            impl<'de> serde::de::Deserialize<'de> for __With {
7333                                fn deserialize<D>(
7334                                    deserializer: D,
7335                                ) -> std::result::Result<Self, D::Error>
7336                                where
7337                                    D: serde::de::Deserializer<'de>,
7338                                {
7339                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
7340                                }
7341                            }
7342                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
7343                        }
7344                        __FieldTag::__page_token => {
7345                            if !fields.insert(__FieldTag::__page_token) {
7346                                return std::result::Result::Err(A::Error::duplicate_field(
7347                                    "multiple values for page_token",
7348                                ));
7349                            }
7350                            result.page_token = map
7351                                .next_value::<std::option::Option<std::string::String>>()?
7352                                .unwrap_or_default();
7353                        }
7354                        __FieldTag::__request_id => {
7355                            if !fields.insert(__FieldTag::__request_id) {
7356                                return std::result::Result::Err(A::Error::duplicate_field(
7357                                    "multiple values for request_id",
7358                                ));
7359                            }
7360                            result.request_id = map
7361                                .next_value::<std::option::Option<std::string::String>>()?
7362                                .unwrap_or_default();
7363                        }
7364                        __FieldTag::Unknown(key) => {
7365                            let value = map.next_value::<serde_json::Value>()?;
7366                            result._unknown_fields.insert(key, value);
7367                        }
7368                    }
7369                }
7370                std::result::Result::Ok(result)
7371            }
7372        }
7373        deserializer.deserialize_any(Visitor)
7374    }
7375}
7376
7377#[doc(hidden)]
7378impl serde::ser::Serialize for ListAnywhereCachesRequest {
7379    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7380    where
7381        S: serde::ser::Serializer,
7382    {
7383        use serde::ser::SerializeMap;
7384        #[allow(unused_imports)]
7385        use std::option::Option::Some;
7386        let mut state = serializer.serialize_map(std::option::Option::None)?;
7387        if !self.parent.is_empty() {
7388            state.serialize_entry("parent", &self.parent)?;
7389        }
7390        if !wkt::internal::is_default(&self.page_size) {
7391            struct __With<'a>(&'a i32);
7392            impl<'a> serde::ser::Serialize for __With<'a> {
7393                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7394                where
7395                    S: serde::ser::Serializer,
7396                {
7397                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
7398                }
7399            }
7400            state.serialize_entry("pageSize", &__With(&self.page_size))?;
7401        }
7402        if !self.page_token.is_empty() {
7403            state.serialize_entry("pageToken", &self.page_token)?;
7404        }
7405        if !self.request_id.is_empty() {
7406            state.serialize_entry("requestId", &self.request_id)?;
7407        }
7408        if !self._unknown_fields.is_empty() {
7409            for (key, value) in self._unknown_fields.iter() {
7410                state.serialize_entry(key, &value)?;
7411            }
7412        }
7413        state.end()
7414    }
7415}
7416
7417impl std::fmt::Debug for ListAnywhereCachesRequest {
7418    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7419        let mut debug_struct = f.debug_struct("ListAnywhereCachesRequest");
7420        debug_struct.field("parent", &self.parent);
7421        debug_struct.field("page_size", &self.page_size);
7422        debug_struct.field("page_token", &self.page_token);
7423        debug_struct.field("request_id", &self.request_id);
7424        if !self._unknown_fields.is_empty() {
7425            debug_struct.field("_unknown_fields", &self._unknown_fields);
7426        }
7427        debug_struct.finish()
7428    }
7429}
7430
7431/// Response message for ListAnywhereCaches.
7432#[derive(Clone, Default, PartialEq)]
7433#[non_exhaustive]
7434pub struct ListAnywhereCachesResponse {
7435    /// The list of items.
7436    pub anywhere_caches: std::vec::Vec<crate::model::AnywhereCache>,
7437
7438    /// A token, which can be sent as `page_token` to retrieve the next page.
7439    /// If this field is omitted, there are no subsequent pages.
7440    pub next_page_token: std::string::String,
7441
7442    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7443}
7444
7445impl ListAnywhereCachesResponse {
7446    pub fn new() -> Self {
7447        std::default::Default::default()
7448    }
7449
7450    /// Sets the value of [anywhere_caches][crate::model::ListAnywhereCachesResponse::anywhere_caches].
7451    pub fn set_anywhere_caches<T, V>(mut self, v: T) -> Self
7452    where
7453        T: std::iter::IntoIterator<Item = V>,
7454        V: std::convert::Into<crate::model::AnywhereCache>,
7455    {
7456        use std::iter::Iterator;
7457        self.anywhere_caches = v.into_iter().map(|i| i.into()).collect();
7458        self
7459    }
7460
7461    /// Sets the value of [next_page_token][crate::model::ListAnywhereCachesResponse::next_page_token].
7462    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7463        self.next_page_token = v.into();
7464        self
7465    }
7466}
7467
7468impl wkt::message::Message for ListAnywhereCachesResponse {
7469    fn typename() -> &'static str {
7470        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesResponse"
7471    }
7472}
7473
7474#[doc(hidden)]
7475impl gax::paginator::internal::PageableResponse for ListAnywhereCachesResponse {
7476    type PageItem = crate::model::AnywhereCache;
7477
7478    fn items(self) -> std::vec::Vec<Self::PageItem> {
7479        self.anywhere_caches
7480    }
7481
7482    fn next_page_token(&self) -> std::string::String {
7483        use std::clone::Clone;
7484        self.next_page_token.clone()
7485    }
7486}
7487
7488#[doc(hidden)]
7489impl<'de> serde::de::Deserialize<'de> for ListAnywhereCachesResponse {
7490    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7491    where
7492        D: serde::Deserializer<'de>,
7493    {
7494        #[allow(non_camel_case_types)]
7495        #[doc(hidden)]
7496        #[derive(PartialEq, Eq, Hash)]
7497        enum __FieldTag {
7498            __anywhere_caches,
7499            __next_page_token,
7500            Unknown(std::string::String),
7501        }
7502        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7503            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7504            where
7505                D: serde::Deserializer<'de>,
7506            {
7507                struct Visitor;
7508                impl<'de> serde::de::Visitor<'de> for Visitor {
7509                    type Value = __FieldTag;
7510                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7511                        formatter.write_str("a field name for ListAnywhereCachesResponse")
7512                    }
7513                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7514                    where
7515                        E: serde::de::Error,
7516                    {
7517                        use std::result::Result::Ok;
7518                        use std::string::ToString;
7519                        match value {
7520                            "anywhereCaches" => Ok(__FieldTag::__anywhere_caches),
7521                            "anywhere_caches" => Ok(__FieldTag::__anywhere_caches),
7522                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
7523                            "next_page_token" => Ok(__FieldTag::__next_page_token),
7524                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7525                        }
7526                    }
7527                }
7528                deserializer.deserialize_identifier(Visitor)
7529            }
7530        }
7531        struct Visitor;
7532        impl<'de> serde::de::Visitor<'de> for Visitor {
7533            type Value = ListAnywhereCachesResponse;
7534            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7535                formatter.write_str("struct ListAnywhereCachesResponse")
7536            }
7537            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7538            where
7539                A: serde::de::MapAccess<'de>,
7540            {
7541                #[allow(unused_imports)]
7542                use serde::de::Error;
7543                use std::option::Option::Some;
7544                let mut fields = std::collections::HashSet::new();
7545                let mut result = Self::Value::new();
7546                while let Some(tag) = map.next_key::<__FieldTag>()? {
7547                    #[allow(clippy::match_single_binding)]
7548                    match tag {
7549                        __FieldTag::__anywhere_caches => {
7550                            if !fields.insert(__FieldTag::__anywhere_caches) {
7551                                return std::result::Result::Err(A::Error::duplicate_field(
7552                                    "multiple values for anywhere_caches",
7553                                ));
7554                            }
7555                            result.anywhere_caches = map.next_value::<std::option::Option<std::vec::Vec<crate::model::AnywhereCache>>>()?.unwrap_or_default();
7556                        }
7557                        __FieldTag::__next_page_token => {
7558                            if !fields.insert(__FieldTag::__next_page_token) {
7559                                return std::result::Result::Err(A::Error::duplicate_field(
7560                                    "multiple values for next_page_token",
7561                                ));
7562                            }
7563                            result.next_page_token = map
7564                                .next_value::<std::option::Option<std::string::String>>()?
7565                                .unwrap_or_default();
7566                        }
7567                        __FieldTag::Unknown(key) => {
7568                            let value = map.next_value::<serde_json::Value>()?;
7569                            result._unknown_fields.insert(key, value);
7570                        }
7571                    }
7572                }
7573                std::result::Result::Ok(result)
7574            }
7575        }
7576        deserializer.deserialize_any(Visitor)
7577    }
7578}
7579
7580#[doc(hidden)]
7581impl serde::ser::Serialize for ListAnywhereCachesResponse {
7582    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7583    where
7584        S: serde::ser::Serializer,
7585    {
7586        use serde::ser::SerializeMap;
7587        #[allow(unused_imports)]
7588        use std::option::Option::Some;
7589        let mut state = serializer.serialize_map(std::option::Option::None)?;
7590        if !self.anywhere_caches.is_empty() {
7591            state.serialize_entry("anywhereCaches", &self.anywhere_caches)?;
7592        }
7593        if !self.next_page_token.is_empty() {
7594            state.serialize_entry("nextPageToken", &self.next_page_token)?;
7595        }
7596        if !self._unknown_fields.is_empty() {
7597            for (key, value) in self._unknown_fields.iter() {
7598                state.serialize_entry(key, &value)?;
7599            }
7600        }
7601        state.end()
7602    }
7603}
7604
7605impl std::fmt::Debug for ListAnywhereCachesResponse {
7606    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7607        let mut debug_struct = f.debug_struct("ListAnywhereCachesResponse");
7608        debug_struct.field("anywhere_caches", &self.anywhere_caches);
7609        debug_struct.field("next_page_token", &self.next_page_token);
7610        if !self._unknown_fields.is_empty() {
7611            debug_struct.field("_unknown_fields", &self._unknown_fields);
7612        }
7613        debug_struct.finish()
7614    }
7615}
7616
7617/// The `IntelligenceConfig` resource associated with your organization, folder,
7618/// or project.
7619#[derive(Clone, Default, PartialEq)]
7620#[non_exhaustive]
7621pub struct IntelligenceConfig {
7622    /// Identifier. The name of the `IntelligenceConfig` resource associated with
7623    /// your organization, folder, or project.
7624    ///
7625    /// The name format varies based on the GCP resource hierarchy as follows:
7626    ///
7627    /// * For project:
7628    ///   `projects/{project_number}/locations/global/intelligenceConfig`
7629    /// * For organization:
7630    ///   `organizations/{org_id}/locations/global/intelligenceConfig`
7631    /// * For folder: `folders/{folder_id}/locations/global/intelligenceConfig`
7632    pub name: std::string::String,
7633
7634    /// Optional. The edition configuration of the `IntelligenceConfig` resource.
7635    pub edition_config: crate::model::intelligence_config::EditionConfig,
7636
7637    /// Output only. The time at which the `IntelligenceConfig` resource is last
7638    /// updated.
7639    pub update_time: std::option::Option<wkt::Timestamp>,
7640
7641    /// Optional. Filter over location and bucket.
7642    pub filter: std::option::Option<crate::model::intelligence_config::Filter>,
7643
7644    /// Output only. The `IntelligenceConfig` resource that is applicable for the
7645    /// resource.
7646    pub effective_intelligence_config:
7647        std::option::Option<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
7648
7649    /// The trial configuration of the `IntelligenceConfig` resource.
7650    pub trial_config: std::option::Option<crate::model::intelligence_config::TrialConfig>,
7651
7652    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7653}
7654
7655impl IntelligenceConfig {
7656    pub fn new() -> Self {
7657        std::default::Default::default()
7658    }
7659
7660    /// Sets the value of [name][crate::model::IntelligenceConfig::name].
7661    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7662        self.name = v.into();
7663        self
7664    }
7665
7666    /// Sets the value of [edition_config][crate::model::IntelligenceConfig::edition_config].
7667    pub fn set_edition_config<
7668        T: std::convert::Into<crate::model::intelligence_config::EditionConfig>,
7669    >(
7670        mut self,
7671        v: T,
7672    ) -> Self {
7673        self.edition_config = v.into();
7674        self
7675    }
7676
7677    /// Sets the value of [update_time][crate::model::IntelligenceConfig::update_time].
7678    pub fn set_update_time<T>(mut self, v: T) -> Self
7679    where
7680        T: std::convert::Into<wkt::Timestamp>,
7681    {
7682        self.update_time = std::option::Option::Some(v.into());
7683        self
7684    }
7685
7686    /// Sets or clears the value of [update_time][crate::model::IntelligenceConfig::update_time].
7687    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7688    where
7689        T: std::convert::Into<wkt::Timestamp>,
7690    {
7691        self.update_time = v.map(|x| x.into());
7692        self
7693    }
7694
7695    /// Sets the value of [filter][crate::model::IntelligenceConfig::filter].
7696    pub fn set_filter<T>(mut self, v: T) -> Self
7697    where
7698        T: std::convert::Into<crate::model::intelligence_config::Filter>,
7699    {
7700        self.filter = std::option::Option::Some(v.into());
7701        self
7702    }
7703
7704    /// Sets or clears the value of [filter][crate::model::IntelligenceConfig::filter].
7705    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
7706    where
7707        T: std::convert::Into<crate::model::intelligence_config::Filter>,
7708    {
7709        self.filter = v.map(|x| x.into());
7710        self
7711    }
7712
7713    /// Sets the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
7714    pub fn set_effective_intelligence_config<T>(mut self, v: T) -> Self
7715    where
7716        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
7717    {
7718        self.effective_intelligence_config = std::option::Option::Some(v.into());
7719        self
7720    }
7721
7722    /// Sets or clears the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
7723    pub fn set_or_clear_effective_intelligence_config<T>(
7724        mut self,
7725        v: std::option::Option<T>,
7726    ) -> Self
7727    where
7728        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
7729    {
7730        self.effective_intelligence_config = v.map(|x| x.into());
7731        self
7732    }
7733
7734    /// Sets the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
7735    pub fn set_trial_config<T>(mut self, v: T) -> Self
7736    where
7737        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
7738    {
7739        self.trial_config = std::option::Option::Some(v.into());
7740        self
7741    }
7742
7743    /// Sets or clears the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
7744    pub fn set_or_clear_trial_config<T>(mut self, v: std::option::Option<T>) -> Self
7745    where
7746        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
7747    {
7748        self.trial_config = v.map(|x| x.into());
7749        self
7750    }
7751}
7752
7753impl wkt::message::Message for IntelligenceConfig {
7754    fn typename() -> &'static str {
7755        "type.googleapis.com/google.storage.control.v2.IntelligenceConfig"
7756    }
7757}
7758
7759#[doc(hidden)]
7760impl<'de> serde::de::Deserialize<'de> for IntelligenceConfig {
7761    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7762    where
7763        D: serde::Deserializer<'de>,
7764    {
7765        #[allow(non_camel_case_types)]
7766        #[doc(hidden)]
7767        #[derive(PartialEq, Eq, Hash)]
7768        enum __FieldTag {
7769            __name,
7770            __edition_config,
7771            __update_time,
7772            __filter,
7773            __effective_intelligence_config,
7774            __trial_config,
7775            Unknown(std::string::String),
7776        }
7777        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7778            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7779            where
7780                D: serde::Deserializer<'de>,
7781            {
7782                struct Visitor;
7783                impl<'de> serde::de::Visitor<'de> for Visitor {
7784                    type Value = __FieldTag;
7785                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7786                        formatter.write_str("a field name for IntelligenceConfig")
7787                    }
7788                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7789                    where
7790                        E: serde::de::Error,
7791                    {
7792                        use std::result::Result::Ok;
7793                        use std::string::ToString;
7794                        match value {
7795                            "name" => Ok(__FieldTag::__name),
7796                            "editionConfig" => Ok(__FieldTag::__edition_config),
7797                            "edition_config" => Ok(__FieldTag::__edition_config),
7798                            "updateTime" => Ok(__FieldTag::__update_time),
7799                            "update_time" => Ok(__FieldTag::__update_time),
7800                            "filter" => Ok(__FieldTag::__filter),
7801                            "effectiveIntelligenceConfig" => {
7802                                Ok(__FieldTag::__effective_intelligence_config)
7803                            }
7804                            "effective_intelligence_config" => {
7805                                Ok(__FieldTag::__effective_intelligence_config)
7806                            }
7807                            "trialConfig" => Ok(__FieldTag::__trial_config),
7808                            "trial_config" => Ok(__FieldTag::__trial_config),
7809                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7810                        }
7811                    }
7812                }
7813                deserializer.deserialize_identifier(Visitor)
7814            }
7815        }
7816        struct Visitor;
7817        impl<'de> serde::de::Visitor<'de> for Visitor {
7818            type Value = IntelligenceConfig;
7819            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7820                formatter.write_str("struct IntelligenceConfig")
7821            }
7822            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7823            where
7824                A: serde::de::MapAccess<'de>,
7825            {
7826                #[allow(unused_imports)]
7827                use serde::de::Error;
7828                use std::option::Option::Some;
7829                let mut fields = std::collections::HashSet::new();
7830                let mut result = Self::Value::new();
7831                while let Some(tag) = map.next_key::<__FieldTag>()? {
7832                    #[allow(clippy::match_single_binding)]
7833                    match tag {
7834                        __FieldTag::__name => {
7835                            if !fields.insert(__FieldTag::__name) {
7836                                return std::result::Result::Err(A::Error::duplicate_field(
7837                                    "multiple values for name",
7838                                ));
7839                            }
7840                            result.name = map
7841                                .next_value::<std::option::Option<std::string::String>>()?
7842                                .unwrap_or_default();
7843                        }
7844                        __FieldTag::__edition_config => {
7845                            if !fields.insert(__FieldTag::__edition_config) {
7846                                return std::result::Result::Err(A::Error::duplicate_field(
7847                                    "multiple values for edition_config",
7848                                ));
7849                            }
7850                            result.edition_config = map
7851                                .next_value::<std::option::Option<
7852                                    crate::model::intelligence_config::EditionConfig,
7853                                >>()?
7854                                .unwrap_or_default();
7855                        }
7856                        __FieldTag::__update_time => {
7857                            if !fields.insert(__FieldTag::__update_time) {
7858                                return std::result::Result::Err(A::Error::duplicate_field(
7859                                    "multiple values for update_time",
7860                                ));
7861                            }
7862                            result.update_time =
7863                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7864                        }
7865                        __FieldTag::__filter => {
7866                            if !fields.insert(__FieldTag::__filter) {
7867                                return std::result::Result::Err(A::Error::duplicate_field(
7868                                    "multiple values for filter",
7869                                ));
7870                            }
7871                            result.filter = map.next_value::<std::option::Option<crate::model::intelligence_config::Filter>>()?
7872                                ;
7873                        }
7874                        __FieldTag::__effective_intelligence_config => {
7875                            if !fields.insert(__FieldTag::__effective_intelligence_config) {
7876                                return std::result::Result::Err(A::Error::duplicate_field(
7877                                    "multiple values for effective_intelligence_config",
7878                                ));
7879                            }
7880                            result.effective_intelligence_config = map
7881                                .next_value::<std::option::Option<
7882                                    crate::model::intelligence_config::EffectiveIntelligenceConfig,
7883                                >>()?;
7884                        }
7885                        __FieldTag::__trial_config => {
7886                            if !fields.insert(__FieldTag::__trial_config) {
7887                                return std::result::Result::Err(A::Error::duplicate_field(
7888                                    "multiple values for trial_config",
7889                                ));
7890                            }
7891                            result.trial_config = map.next_value::<std::option::Option<
7892                                crate::model::intelligence_config::TrialConfig,
7893                            >>()?;
7894                        }
7895                        __FieldTag::Unknown(key) => {
7896                            let value = map.next_value::<serde_json::Value>()?;
7897                            result._unknown_fields.insert(key, value);
7898                        }
7899                    }
7900                }
7901                std::result::Result::Ok(result)
7902            }
7903        }
7904        deserializer.deserialize_any(Visitor)
7905    }
7906}
7907
7908#[doc(hidden)]
7909impl serde::ser::Serialize for IntelligenceConfig {
7910    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7911    where
7912        S: serde::ser::Serializer,
7913    {
7914        use serde::ser::SerializeMap;
7915        #[allow(unused_imports)]
7916        use std::option::Option::Some;
7917        let mut state = serializer.serialize_map(std::option::Option::None)?;
7918        if !self.name.is_empty() {
7919            state.serialize_entry("name", &self.name)?;
7920        }
7921        if !wkt::internal::is_default(&self.edition_config) {
7922            state.serialize_entry("editionConfig", &self.edition_config)?;
7923        }
7924        if self.update_time.is_some() {
7925            state.serialize_entry("updateTime", &self.update_time)?;
7926        }
7927        if self.filter.is_some() {
7928            state.serialize_entry("filter", &self.filter)?;
7929        }
7930        if self.effective_intelligence_config.is_some() {
7931            state.serialize_entry(
7932                "effectiveIntelligenceConfig",
7933                &self.effective_intelligence_config,
7934            )?;
7935        }
7936        if self.trial_config.is_some() {
7937            state.serialize_entry("trialConfig", &self.trial_config)?;
7938        }
7939        if !self._unknown_fields.is_empty() {
7940            for (key, value) in self._unknown_fields.iter() {
7941                state.serialize_entry(key, &value)?;
7942            }
7943        }
7944        state.end()
7945    }
7946}
7947
7948impl std::fmt::Debug for IntelligenceConfig {
7949    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7950        let mut debug_struct = f.debug_struct("IntelligenceConfig");
7951        debug_struct.field("name", &self.name);
7952        debug_struct.field("edition_config", &self.edition_config);
7953        debug_struct.field("update_time", &self.update_time);
7954        debug_struct.field("filter", &self.filter);
7955        debug_struct.field(
7956            "effective_intelligence_config",
7957            &self.effective_intelligence_config,
7958        );
7959        debug_struct.field("trial_config", &self.trial_config);
7960        if !self._unknown_fields.is_empty() {
7961            debug_struct.field("_unknown_fields", &self._unknown_fields);
7962        }
7963        debug_struct.finish()
7964    }
7965}
7966
7967/// Defines additional types related to [IntelligenceConfig].
7968pub mod intelligence_config {
7969    #[allow(unused_imports)]
7970    use super::*;
7971
7972    /// Filter over location and bucket using include or exclude semantics.
7973    /// Resources that match the include or exclude filter are exclusively included
7974    /// or excluded from the Storage Intelligence plan.
7975    #[derive(Clone, Default, PartialEq)]
7976    #[non_exhaustive]
7977    pub struct Filter {
7978        /// Bucket locations to include or exclude.
7979        pub cloud_storage_locations: std::option::Option<
7980            crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
7981        >,
7982
7983        /// Buckets to include or exclude.
7984        pub cloud_storage_buckets: std::option::Option<
7985            crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
7986        >,
7987
7988        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7989    }
7990
7991    impl Filter {
7992        pub fn new() -> Self {
7993            std::default::Default::default()
7994        }
7995
7996        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations].
7997        ///
7998        /// Note that all the setters affecting `cloud_storage_locations` are mutually
7999        /// exclusive.
8000        pub fn set_cloud_storage_locations<
8001            T: std::convert::Into<
8002                    std::option::Option<
8003                        crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
8004                    >,
8005                >,
8006        >(
8007            mut self,
8008            v: T,
8009        ) -> Self {
8010            self.cloud_storage_locations = v.into();
8011            self
8012        }
8013
8014        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
8015        /// if it holds a `IncludedCloudStorageLocations`, `None` if the field is not set or
8016        /// holds a different branch.
8017        pub fn included_cloud_storage_locations(
8018            &self,
8019        ) -> std::option::Option<
8020            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
8021        > {
8022            #[allow(unreachable_patterns)]
8023            self.cloud_storage_locations.as_ref().and_then(|v| match v {
8024                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(v) => std::option::Option::Some(v),
8025                _ => std::option::Option::None,
8026            })
8027        }
8028
8029        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
8030        /// to hold a `IncludedCloudStorageLocations`.
8031        ///
8032        /// Note that all the setters affecting `cloud_storage_locations` are
8033        /// mutually exclusive.
8034        pub fn set_included_cloud_storage_locations<
8035            T: std::convert::Into<
8036                    std::boxed::Box<
8037                        crate::model::intelligence_config::filter::CloudStorageLocations,
8038                    >,
8039                >,
8040        >(
8041            mut self,
8042            v: T,
8043        ) -> Self {
8044            self.cloud_storage_locations = std::option::Option::Some(
8045                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
8046                    v.into()
8047                )
8048            );
8049            self
8050        }
8051
8052        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
8053        /// if it holds a `ExcludedCloudStorageLocations`, `None` if the field is not set or
8054        /// holds a different branch.
8055        pub fn excluded_cloud_storage_locations(
8056            &self,
8057        ) -> std::option::Option<
8058            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
8059        > {
8060            #[allow(unreachable_patterns)]
8061            self.cloud_storage_locations.as_ref().and_then(|v| match v {
8062                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(v) => std::option::Option::Some(v),
8063                _ => std::option::Option::None,
8064            })
8065        }
8066
8067        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
8068        /// to hold a `ExcludedCloudStorageLocations`.
8069        ///
8070        /// Note that all the setters affecting `cloud_storage_locations` are
8071        /// mutually exclusive.
8072        pub fn set_excluded_cloud_storage_locations<
8073            T: std::convert::Into<
8074                    std::boxed::Box<
8075                        crate::model::intelligence_config::filter::CloudStorageLocations,
8076                    >,
8077                >,
8078        >(
8079            mut self,
8080            v: T,
8081        ) -> Self {
8082            self.cloud_storage_locations = std::option::Option::Some(
8083                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
8084                    v.into()
8085                )
8086            );
8087            self
8088        }
8089
8090        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets].
8091        ///
8092        /// Note that all the setters affecting `cloud_storage_buckets` are mutually
8093        /// exclusive.
8094        pub fn set_cloud_storage_buckets<
8095            T: std::convert::Into<
8096                    std::option::Option<
8097                        crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
8098                    >,
8099                >,
8100        >(
8101            mut self,
8102            v: T,
8103        ) -> Self {
8104            self.cloud_storage_buckets = v.into();
8105            self
8106        }
8107
8108        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
8109        /// if it holds a `IncludedCloudStorageBuckets`, `None` if the field is not set or
8110        /// holds a different branch.
8111        pub fn included_cloud_storage_buckets(
8112            &self,
8113        ) -> std::option::Option<
8114            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8115        > {
8116            #[allow(unreachable_patterns)]
8117            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
8118                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(v) => std::option::Option::Some(v),
8119                _ => std::option::Option::None,
8120            })
8121        }
8122
8123        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
8124        /// to hold a `IncludedCloudStorageBuckets`.
8125        ///
8126        /// Note that all the setters affecting `cloud_storage_buckets` are
8127        /// mutually exclusive.
8128        pub fn set_included_cloud_storage_buckets<
8129            T: std::convert::Into<
8130                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8131                >,
8132        >(
8133            mut self,
8134            v: T,
8135        ) -> Self {
8136            self.cloud_storage_buckets = std::option::Option::Some(
8137                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
8138                    v.into()
8139                )
8140            );
8141            self
8142        }
8143
8144        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
8145        /// if it holds a `ExcludedCloudStorageBuckets`, `None` if the field is not set or
8146        /// holds a different branch.
8147        pub fn excluded_cloud_storage_buckets(
8148            &self,
8149        ) -> std::option::Option<
8150            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8151        > {
8152            #[allow(unreachable_patterns)]
8153            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
8154                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(v) => std::option::Option::Some(v),
8155                _ => std::option::Option::None,
8156            })
8157        }
8158
8159        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
8160        /// to hold a `ExcludedCloudStorageBuckets`.
8161        ///
8162        /// Note that all the setters affecting `cloud_storage_buckets` are
8163        /// mutually exclusive.
8164        pub fn set_excluded_cloud_storage_buckets<
8165            T: std::convert::Into<
8166                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8167                >,
8168        >(
8169            mut self,
8170            v: T,
8171        ) -> Self {
8172            self.cloud_storage_buckets = std::option::Option::Some(
8173                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
8174                    v.into()
8175                )
8176            );
8177            self
8178        }
8179    }
8180
8181    impl wkt::message::Message for Filter {
8182        fn typename() -> &'static str {
8183            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter"
8184        }
8185    }
8186
8187    #[doc(hidden)]
8188    impl<'de> serde::de::Deserialize<'de> for Filter {
8189        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8190        where
8191            D: serde::Deserializer<'de>,
8192        {
8193            #[allow(non_camel_case_types)]
8194            #[doc(hidden)]
8195            #[derive(PartialEq, Eq, Hash)]
8196            enum __FieldTag {
8197                __included_cloud_storage_locations,
8198                __excluded_cloud_storage_locations,
8199                __included_cloud_storage_buckets,
8200                __excluded_cloud_storage_buckets,
8201                Unknown(std::string::String),
8202            }
8203            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8204                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8205                where
8206                    D: serde::Deserializer<'de>,
8207                {
8208                    struct Visitor;
8209                    impl<'de> serde::de::Visitor<'de> for Visitor {
8210                        type Value = __FieldTag;
8211                        fn expecting(
8212                            &self,
8213                            formatter: &mut std::fmt::Formatter,
8214                        ) -> std::fmt::Result {
8215                            formatter.write_str("a field name for Filter")
8216                        }
8217                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8218                        where
8219                            E: serde::de::Error,
8220                        {
8221                            use std::result::Result::Ok;
8222                            use std::string::ToString;
8223                            match value {
8224                                "includedCloudStorageLocations" => {
8225                                    Ok(__FieldTag::__included_cloud_storage_locations)
8226                                }
8227                                "included_cloud_storage_locations" => {
8228                                    Ok(__FieldTag::__included_cloud_storage_locations)
8229                                }
8230                                "excludedCloudStorageLocations" => {
8231                                    Ok(__FieldTag::__excluded_cloud_storage_locations)
8232                                }
8233                                "excluded_cloud_storage_locations" => {
8234                                    Ok(__FieldTag::__excluded_cloud_storage_locations)
8235                                }
8236                                "includedCloudStorageBuckets" => {
8237                                    Ok(__FieldTag::__included_cloud_storage_buckets)
8238                                }
8239                                "included_cloud_storage_buckets" => {
8240                                    Ok(__FieldTag::__included_cloud_storage_buckets)
8241                                }
8242                                "excludedCloudStorageBuckets" => {
8243                                    Ok(__FieldTag::__excluded_cloud_storage_buckets)
8244                                }
8245                                "excluded_cloud_storage_buckets" => {
8246                                    Ok(__FieldTag::__excluded_cloud_storage_buckets)
8247                                }
8248                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8249                            }
8250                        }
8251                    }
8252                    deserializer.deserialize_identifier(Visitor)
8253                }
8254            }
8255            struct Visitor;
8256            impl<'de> serde::de::Visitor<'de> for Visitor {
8257                type Value = Filter;
8258                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8259                    formatter.write_str("struct Filter")
8260                }
8261                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8262                where
8263                    A: serde::de::MapAccess<'de>,
8264                {
8265                    #[allow(unused_imports)]
8266                    use serde::de::Error;
8267                    use std::option::Option::Some;
8268                    let mut fields = std::collections::HashSet::new();
8269                    let mut result = Self::Value::new();
8270                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8271                        #[allow(clippy::match_single_binding)]
8272                        match tag {
8273                            __FieldTag::__included_cloud_storage_locations => {
8274                                if !fields.insert(__FieldTag::__included_cloud_storage_locations) {
8275                                    return std::result::Result::Err(A::Error::duplicate_field(
8276                                        "multiple values for included_cloud_storage_locations",
8277                                    ));
8278                                }
8279                                if result.cloud_storage_locations.is_some() {
8280                                    return std::result::Result::Err(A::Error::duplicate_field(
8281                                        "multiple values for `cloud_storage_locations`, a oneof with full ID .google.storage.control.v2.IntelligenceConfig.Filter.included_cloud_storage_locations, latest field was includedCloudStorageLocations",
8282                                    ));
8283                                }
8284                                result.cloud_storage_locations = std::option::Option::Some(
8285                                    crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
8286                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>>>()?.unwrap_or_default()
8287                                    ),
8288                                );
8289                            }
8290                            __FieldTag::__excluded_cloud_storage_locations => {
8291                                if !fields.insert(__FieldTag::__excluded_cloud_storage_locations) {
8292                                    return std::result::Result::Err(A::Error::duplicate_field(
8293                                        "multiple values for excluded_cloud_storage_locations",
8294                                    ));
8295                                }
8296                                if result.cloud_storage_locations.is_some() {
8297                                    return std::result::Result::Err(A::Error::duplicate_field(
8298                                        "multiple values for `cloud_storage_locations`, a oneof with full ID .google.storage.control.v2.IntelligenceConfig.Filter.excluded_cloud_storage_locations, latest field was excludedCloudStorageLocations",
8299                                    ));
8300                                }
8301                                result.cloud_storage_locations = std::option::Option::Some(
8302                                    crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
8303                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>>>()?.unwrap_or_default()
8304                                    ),
8305                                );
8306                            }
8307                            __FieldTag::__included_cloud_storage_buckets => {
8308                                if !fields.insert(__FieldTag::__included_cloud_storage_buckets) {
8309                                    return std::result::Result::Err(A::Error::duplicate_field(
8310                                        "multiple values for included_cloud_storage_buckets",
8311                                    ));
8312                                }
8313                                if result.cloud_storage_buckets.is_some() {
8314                                    return std::result::Result::Err(A::Error::duplicate_field(
8315                                        "multiple values for `cloud_storage_buckets`, a oneof with full ID .google.storage.control.v2.IntelligenceConfig.Filter.included_cloud_storage_buckets, latest field was includedCloudStorageBuckets",
8316                                    ));
8317                                }
8318                                result.cloud_storage_buckets = std::option::Option::Some(
8319                                    crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
8320                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>>>()?.unwrap_or_default()
8321                                    ),
8322                                );
8323                            }
8324                            __FieldTag::__excluded_cloud_storage_buckets => {
8325                                if !fields.insert(__FieldTag::__excluded_cloud_storage_buckets) {
8326                                    return std::result::Result::Err(A::Error::duplicate_field(
8327                                        "multiple values for excluded_cloud_storage_buckets",
8328                                    ));
8329                                }
8330                                if result.cloud_storage_buckets.is_some() {
8331                                    return std::result::Result::Err(A::Error::duplicate_field(
8332                                        "multiple values for `cloud_storage_buckets`, a oneof with full ID .google.storage.control.v2.IntelligenceConfig.Filter.excluded_cloud_storage_buckets, latest field was excludedCloudStorageBuckets",
8333                                    ));
8334                                }
8335                                result.cloud_storage_buckets = std::option::Option::Some(
8336                                    crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
8337                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>>>()?.unwrap_or_default()
8338                                    ),
8339                                );
8340                            }
8341                            __FieldTag::Unknown(key) => {
8342                                let value = map.next_value::<serde_json::Value>()?;
8343                                result._unknown_fields.insert(key, value);
8344                            }
8345                        }
8346                    }
8347                    std::result::Result::Ok(result)
8348                }
8349            }
8350            deserializer.deserialize_any(Visitor)
8351        }
8352    }
8353
8354    #[doc(hidden)]
8355    impl serde::ser::Serialize for Filter {
8356        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8357        where
8358            S: serde::ser::Serializer,
8359        {
8360            use serde::ser::SerializeMap;
8361            #[allow(unused_imports)]
8362            use std::option::Option::Some;
8363            let mut state = serializer.serialize_map(std::option::Option::None)?;
8364            if let Some(value) = self.included_cloud_storage_locations() {
8365                state.serialize_entry("includedCloudStorageLocations", value)?;
8366            }
8367            if let Some(value) = self.excluded_cloud_storage_locations() {
8368                state.serialize_entry("excludedCloudStorageLocations", value)?;
8369            }
8370            if let Some(value) = self.included_cloud_storage_buckets() {
8371                state.serialize_entry("includedCloudStorageBuckets", value)?;
8372            }
8373            if let Some(value) = self.excluded_cloud_storage_buckets() {
8374                state.serialize_entry("excludedCloudStorageBuckets", value)?;
8375            }
8376            if !self._unknown_fields.is_empty() {
8377                for (key, value) in self._unknown_fields.iter() {
8378                    state.serialize_entry(key, &value)?;
8379                }
8380            }
8381            state.end()
8382        }
8383    }
8384
8385    impl std::fmt::Debug for Filter {
8386        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8387            let mut debug_struct = f.debug_struct("Filter");
8388            debug_struct.field("cloud_storage_locations", &self.cloud_storage_locations);
8389            debug_struct.field("cloud_storage_buckets", &self.cloud_storage_buckets);
8390            if !self._unknown_fields.is_empty() {
8391                debug_struct.field("_unknown_fields", &self._unknown_fields);
8392            }
8393            debug_struct.finish()
8394        }
8395    }
8396
8397    /// Defines additional types related to [Filter].
8398    pub mod filter {
8399        #[allow(unused_imports)]
8400        use super::*;
8401
8402        /// Collection of bucket locations.
8403        #[derive(Clone, Default, PartialEq)]
8404        #[non_exhaustive]
8405        pub struct CloudStorageLocations {
8406            /// Optional. Bucket locations. Location can be any of the Cloud Storage
8407            /// regions specified in lower case format. For example, `us-east1`,
8408            /// `us-west1`.
8409            pub locations: std::vec::Vec<std::string::String>,
8410
8411            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8412        }
8413
8414        impl CloudStorageLocations {
8415            pub fn new() -> Self {
8416                std::default::Default::default()
8417            }
8418
8419            /// Sets the value of [locations][crate::model::intelligence_config::filter::CloudStorageLocations::locations].
8420            pub fn set_locations<T, V>(mut self, v: T) -> Self
8421            where
8422                T: std::iter::IntoIterator<Item = V>,
8423                V: std::convert::Into<std::string::String>,
8424            {
8425                use std::iter::Iterator;
8426                self.locations = v.into_iter().map(|i| i.into()).collect();
8427                self
8428            }
8429        }
8430
8431        impl wkt::message::Message for CloudStorageLocations {
8432            fn typename() -> &'static str {
8433                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"
8434            }
8435        }
8436
8437        #[doc(hidden)]
8438        impl<'de> serde::de::Deserialize<'de> for CloudStorageLocations {
8439            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8440            where
8441                D: serde::Deserializer<'de>,
8442            {
8443                #[allow(non_camel_case_types)]
8444                #[doc(hidden)]
8445                #[derive(PartialEq, Eq, Hash)]
8446                enum __FieldTag {
8447                    __locations,
8448                    Unknown(std::string::String),
8449                }
8450                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8451                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8452                    where
8453                        D: serde::Deserializer<'de>,
8454                    {
8455                        struct Visitor;
8456                        impl<'de> serde::de::Visitor<'de> for Visitor {
8457                            type Value = __FieldTag;
8458                            fn expecting(
8459                                &self,
8460                                formatter: &mut std::fmt::Formatter,
8461                            ) -> std::fmt::Result {
8462                                formatter.write_str("a field name for CloudStorageLocations")
8463                            }
8464                            fn visit_str<E>(
8465                                self,
8466                                value: &str,
8467                            ) -> std::result::Result<Self::Value, E>
8468                            where
8469                                E: serde::de::Error,
8470                            {
8471                                use std::result::Result::Ok;
8472                                use std::string::ToString;
8473                                match value {
8474                                    "locations" => Ok(__FieldTag::__locations),
8475                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
8476                                }
8477                            }
8478                        }
8479                        deserializer.deserialize_identifier(Visitor)
8480                    }
8481                }
8482                struct Visitor;
8483                impl<'de> serde::de::Visitor<'de> for Visitor {
8484                    type Value = CloudStorageLocations;
8485                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8486                        formatter.write_str("struct CloudStorageLocations")
8487                    }
8488                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8489                    where
8490                        A: serde::de::MapAccess<'de>,
8491                    {
8492                        #[allow(unused_imports)]
8493                        use serde::de::Error;
8494                        use std::option::Option::Some;
8495                        let mut fields = std::collections::HashSet::new();
8496                        let mut result = Self::Value::new();
8497                        while let Some(tag) = map.next_key::<__FieldTag>()? {
8498                            #[allow(clippy::match_single_binding)]
8499                            match tag {
8500                                __FieldTag::__locations => {
8501                                    if !fields.insert(__FieldTag::__locations) {
8502                                        return std::result::Result::Err(
8503                                            A::Error::duplicate_field(
8504                                                "multiple values for locations",
8505                                            ),
8506                                        );
8507                                    }
8508                                    result.locations = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8509                                }
8510                                __FieldTag::Unknown(key) => {
8511                                    let value = map.next_value::<serde_json::Value>()?;
8512                                    result._unknown_fields.insert(key, value);
8513                                }
8514                            }
8515                        }
8516                        std::result::Result::Ok(result)
8517                    }
8518                }
8519                deserializer.deserialize_any(Visitor)
8520            }
8521        }
8522
8523        #[doc(hidden)]
8524        impl serde::ser::Serialize for CloudStorageLocations {
8525            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8526            where
8527                S: serde::ser::Serializer,
8528            {
8529                use serde::ser::SerializeMap;
8530                #[allow(unused_imports)]
8531                use std::option::Option::Some;
8532                let mut state = serializer.serialize_map(std::option::Option::None)?;
8533                if !self.locations.is_empty() {
8534                    state.serialize_entry("locations", &self.locations)?;
8535                }
8536                if !self._unknown_fields.is_empty() {
8537                    for (key, value) in self._unknown_fields.iter() {
8538                        state.serialize_entry(key, &value)?;
8539                    }
8540                }
8541                state.end()
8542            }
8543        }
8544
8545        impl std::fmt::Debug for CloudStorageLocations {
8546            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8547                let mut debug_struct = f.debug_struct("CloudStorageLocations");
8548                debug_struct.field("locations", &self.locations);
8549                if !self._unknown_fields.is_empty() {
8550                    debug_struct.field("_unknown_fields", &self._unknown_fields);
8551                }
8552                debug_struct.finish()
8553            }
8554        }
8555
8556        /// Collection of buckets.
8557        #[derive(Clone, Default, PartialEq)]
8558        #[non_exhaustive]
8559        pub struct CloudStorageBuckets {
8560            /// Optional. A regex pattern for matching bucket names. Regex should
8561            /// follow the syntax specified in
8562            /// [google/re2](https://github.com/google/re2). For example,
8563            /// `^sample_.*` matches all buckets of the form
8564            /// `gs://sample_bucket-1`, `gs://sample_bucket-2`,
8565            /// `gs://sample_bucket-n` but not `gs://test_sample_bucket`.
8566            /// If you want to match a single bucket, say `gs://sample_bucket`,
8567            /// use `sample_bucket`.
8568            pub bucket_id_regexes: std::vec::Vec<std::string::String>,
8569
8570            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8571        }
8572
8573        impl CloudStorageBuckets {
8574            pub fn new() -> Self {
8575                std::default::Default::default()
8576            }
8577
8578            /// Sets the value of [bucket_id_regexes][crate::model::intelligence_config::filter::CloudStorageBuckets::bucket_id_regexes].
8579            pub fn set_bucket_id_regexes<T, V>(mut self, v: T) -> Self
8580            where
8581                T: std::iter::IntoIterator<Item = V>,
8582                V: std::convert::Into<std::string::String>,
8583            {
8584                use std::iter::Iterator;
8585                self.bucket_id_regexes = v.into_iter().map(|i| i.into()).collect();
8586                self
8587            }
8588        }
8589
8590        impl wkt::message::Message for CloudStorageBuckets {
8591            fn typename() -> &'static str {
8592                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"
8593            }
8594        }
8595
8596        #[doc(hidden)]
8597        impl<'de> serde::de::Deserialize<'de> for CloudStorageBuckets {
8598            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8599            where
8600                D: serde::Deserializer<'de>,
8601            {
8602                #[allow(non_camel_case_types)]
8603                #[doc(hidden)]
8604                #[derive(PartialEq, Eq, Hash)]
8605                enum __FieldTag {
8606                    __bucket_id_regexes,
8607                    Unknown(std::string::String),
8608                }
8609                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8610                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8611                    where
8612                        D: serde::Deserializer<'de>,
8613                    {
8614                        struct Visitor;
8615                        impl<'de> serde::de::Visitor<'de> for Visitor {
8616                            type Value = __FieldTag;
8617                            fn expecting(
8618                                &self,
8619                                formatter: &mut std::fmt::Formatter,
8620                            ) -> std::fmt::Result {
8621                                formatter.write_str("a field name for CloudStorageBuckets")
8622                            }
8623                            fn visit_str<E>(
8624                                self,
8625                                value: &str,
8626                            ) -> std::result::Result<Self::Value, E>
8627                            where
8628                                E: serde::de::Error,
8629                            {
8630                                use std::result::Result::Ok;
8631                                use std::string::ToString;
8632                                match value {
8633                                    "bucketIdRegexes" => Ok(__FieldTag::__bucket_id_regexes),
8634                                    "bucket_id_regexes" => Ok(__FieldTag::__bucket_id_regexes),
8635                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
8636                                }
8637                            }
8638                        }
8639                        deserializer.deserialize_identifier(Visitor)
8640                    }
8641                }
8642                struct Visitor;
8643                impl<'de> serde::de::Visitor<'de> for Visitor {
8644                    type Value = CloudStorageBuckets;
8645                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8646                        formatter.write_str("struct CloudStorageBuckets")
8647                    }
8648                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8649                    where
8650                        A: serde::de::MapAccess<'de>,
8651                    {
8652                        #[allow(unused_imports)]
8653                        use serde::de::Error;
8654                        use std::option::Option::Some;
8655                        let mut fields = std::collections::HashSet::new();
8656                        let mut result = Self::Value::new();
8657                        while let Some(tag) = map.next_key::<__FieldTag>()? {
8658                            #[allow(clippy::match_single_binding)]
8659                            match tag {
8660                                __FieldTag::__bucket_id_regexes => {
8661                                    if !fields.insert(__FieldTag::__bucket_id_regexes) {
8662                                        return std::result::Result::Err(
8663                                            A::Error::duplicate_field(
8664                                                "multiple values for bucket_id_regexes",
8665                                            ),
8666                                        );
8667                                    }
8668                                    result.bucket_id_regexes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8669                                }
8670                                __FieldTag::Unknown(key) => {
8671                                    let value = map.next_value::<serde_json::Value>()?;
8672                                    result._unknown_fields.insert(key, value);
8673                                }
8674                            }
8675                        }
8676                        std::result::Result::Ok(result)
8677                    }
8678                }
8679                deserializer.deserialize_any(Visitor)
8680            }
8681        }
8682
8683        #[doc(hidden)]
8684        impl serde::ser::Serialize for CloudStorageBuckets {
8685            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8686            where
8687                S: serde::ser::Serializer,
8688            {
8689                use serde::ser::SerializeMap;
8690                #[allow(unused_imports)]
8691                use std::option::Option::Some;
8692                let mut state = serializer.serialize_map(std::option::Option::None)?;
8693                if !self.bucket_id_regexes.is_empty() {
8694                    state.serialize_entry("bucketIdRegexes", &self.bucket_id_regexes)?;
8695                }
8696                if !self._unknown_fields.is_empty() {
8697                    for (key, value) in self._unknown_fields.iter() {
8698                        state.serialize_entry(key, &value)?;
8699                    }
8700                }
8701                state.end()
8702            }
8703        }
8704
8705        impl std::fmt::Debug for CloudStorageBuckets {
8706            fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8707                let mut debug_struct = f.debug_struct("CloudStorageBuckets");
8708                debug_struct.field("bucket_id_regexes", &self.bucket_id_regexes);
8709                if !self._unknown_fields.is_empty() {
8710                    debug_struct.field("_unknown_fields", &self._unknown_fields);
8711                }
8712                debug_struct.finish()
8713            }
8714        }
8715
8716        /// Bucket locations to include or exclude.
8717        #[derive(Clone, Debug, PartialEq)]
8718        #[non_exhaustive]
8719        pub enum CloudStorageLocationsOneOf {
8720            /// Bucket locations to include.
8721            IncludedCloudStorageLocations(
8722                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
8723            ),
8724            /// Bucket locations to exclude.
8725            ExcludedCloudStorageLocations(
8726                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
8727            ),
8728        }
8729
8730        impl CloudStorageLocationsOneOf {
8731            /// Initializes the enum to the [IncludedCloudStorageLocations](Self::IncludedCloudStorageLocations) branch.
8732            pub fn from_included_cloud_storage_locations(
8733                value: impl std::convert::Into<
8734                    std::boxed::Box<
8735                        crate::model::intelligence_config::filter::CloudStorageLocations,
8736                    >,
8737                >,
8738            ) -> Self {
8739                Self::IncludedCloudStorageLocations(value.into())
8740            }
8741            /// Initializes the enum to the [ExcludedCloudStorageLocations](Self::ExcludedCloudStorageLocations) branch.
8742            pub fn from_excluded_cloud_storage_locations(
8743                value: impl std::convert::Into<
8744                    std::boxed::Box<
8745                        crate::model::intelligence_config::filter::CloudStorageLocations,
8746                    >,
8747                >,
8748            ) -> Self {
8749                Self::ExcludedCloudStorageLocations(value.into())
8750            }
8751        }
8752
8753        /// Buckets to include or exclude.
8754        #[derive(Clone, Debug, PartialEq)]
8755        #[non_exhaustive]
8756        pub enum CloudStorageBucketsOneOf {
8757            /// Buckets to include.
8758            IncludedCloudStorageBuckets(
8759                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8760            ),
8761            /// Buckets to exclude.
8762            ExcludedCloudStorageBuckets(
8763                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8764            ),
8765        }
8766
8767        impl CloudStorageBucketsOneOf {
8768            /// Initializes the enum to the [IncludedCloudStorageBuckets](Self::IncludedCloudStorageBuckets) branch.
8769            pub fn from_included_cloud_storage_buckets(
8770                value: impl std::convert::Into<
8771                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8772                >,
8773            ) -> Self {
8774                Self::IncludedCloudStorageBuckets(value.into())
8775            }
8776            /// Initializes the enum to the [ExcludedCloudStorageBuckets](Self::ExcludedCloudStorageBuckets) branch.
8777            pub fn from_excluded_cloud_storage_buckets(
8778                value: impl std::convert::Into<
8779                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8780                >,
8781            ) -> Self {
8782                Self::ExcludedCloudStorageBuckets(value.into())
8783            }
8784        }
8785    }
8786
8787    /// The effective `IntelligenceConfig` for the resource.
8788    #[derive(Clone, Default, PartialEq)]
8789    #[non_exhaustive]
8790    pub struct EffectiveIntelligenceConfig {
8791        /// Output only. The `IntelligenceConfig` edition that is applicable for the
8792        /// resource.
8793        pub effective_edition:
8794            crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition,
8795
8796        /// Output only. The `IntelligenceConfig` resource that is applied for the
8797        /// target resource. Format:
8798        /// `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig`
8799        pub intelligence_config: std::string::String,
8800
8801        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8802    }
8803
8804    impl EffectiveIntelligenceConfig {
8805        pub fn new() -> Self {
8806            std::default::Default::default()
8807        }
8808
8809        /// Sets the value of [effective_edition][crate::model::intelligence_config::EffectiveIntelligenceConfig::effective_edition].
8810        pub fn set_effective_edition<T: std::convert::Into<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>(mut self, v: T) -> Self{
8811            self.effective_edition = v.into();
8812            self
8813        }
8814
8815        /// Sets the value of [intelligence_config][crate::model::intelligence_config::EffectiveIntelligenceConfig::intelligence_config].
8816        pub fn set_intelligence_config<T: std::convert::Into<std::string::String>>(
8817            mut self,
8818            v: T,
8819        ) -> Self {
8820            self.intelligence_config = v.into();
8821            self
8822        }
8823    }
8824
8825    impl wkt::message::Message for EffectiveIntelligenceConfig {
8826        fn typename() -> &'static str {
8827            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"
8828        }
8829    }
8830
8831    #[doc(hidden)]
8832    impl<'de> serde::de::Deserialize<'de> for EffectiveIntelligenceConfig {
8833        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8834        where
8835            D: serde::Deserializer<'de>,
8836        {
8837            #[allow(non_camel_case_types)]
8838            #[doc(hidden)]
8839            #[derive(PartialEq, Eq, Hash)]
8840            enum __FieldTag {
8841                __effective_edition,
8842                __intelligence_config,
8843                Unknown(std::string::String),
8844            }
8845            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8846                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8847                where
8848                    D: serde::Deserializer<'de>,
8849                {
8850                    struct Visitor;
8851                    impl<'de> serde::de::Visitor<'de> for Visitor {
8852                        type Value = __FieldTag;
8853                        fn expecting(
8854                            &self,
8855                            formatter: &mut std::fmt::Formatter,
8856                        ) -> std::fmt::Result {
8857                            formatter.write_str("a field name for EffectiveIntelligenceConfig")
8858                        }
8859                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8860                        where
8861                            E: serde::de::Error,
8862                        {
8863                            use std::result::Result::Ok;
8864                            use std::string::ToString;
8865                            match value {
8866                                "effectiveEdition" => Ok(__FieldTag::__effective_edition),
8867                                "effective_edition" => Ok(__FieldTag::__effective_edition),
8868                                "intelligenceConfig" => Ok(__FieldTag::__intelligence_config),
8869                                "intelligence_config" => Ok(__FieldTag::__intelligence_config),
8870                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8871                            }
8872                        }
8873                    }
8874                    deserializer.deserialize_identifier(Visitor)
8875                }
8876            }
8877            struct Visitor;
8878            impl<'de> serde::de::Visitor<'de> for Visitor {
8879                type Value = EffectiveIntelligenceConfig;
8880                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8881                    formatter.write_str("struct EffectiveIntelligenceConfig")
8882                }
8883                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8884                where
8885                    A: serde::de::MapAccess<'de>,
8886                {
8887                    #[allow(unused_imports)]
8888                    use serde::de::Error;
8889                    use std::option::Option::Some;
8890                    let mut fields = std::collections::HashSet::new();
8891                    let mut result = Self::Value::new();
8892                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8893                        #[allow(clippy::match_single_binding)]
8894                        match tag {
8895                            __FieldTag::__effective_edition => {
8896                                if !fields.insert(__FieldTag::__effective_edition) {
8897                                    return std::result::Result::Err(A::Error::duplicate_field(
8898                                        "multiple values for effective_edition",
8899                                    ));
8900                                }
8901                                result.effective_edition = map.next_value::<std::option::Option<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>()?.unwrap_or_default();
8902                            }
8903                            __FieldTag::__intelligence_config => {
8904                                if !fields.insert(__FieldTag::__intelligence_config) {
8905                                    return std::result::Result::Err(A::Error::duplicate_field(
8906                                        "multiple values for intelligence_config",
8907                                    ));
8908                                }
8909                                result.intelligence_config = map
8910                                    .next_value::<std::option::Option<std::string::String>>()?
8911                                    .unwrap_or_default();
8912                            }
8913                            __FieldTag::Unknown(key) => {
8914                                let value = map.next_value::<serde_json::Value>()?;
8915                                result._unknown_fields.insert(key, value);
8916                            }
8917                        }
8918                    }
8919                    std::result::Result::Ok(result)
8920                }
8921            }
8922            deserializer.deserialize_any(Visitor)
8923        }
8924    }
8925
8926    #[doc(hidden)]
8927    impl serde::ser::Serialize for EffectiveIntelligenceConfig {
8928        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8929        where
8930            S: serde::ser::Serializer,
8931        {
8932            use serde::ser::SerializeMap;
8933            #[allow(unused_imports)]
8934            use std::option::Option::Some;
8935            let mut state = serializer.serialize_map(std::option::Option::None)?;
8936            if !wkt::internal::is_default(&self.effective_edition) {
8937                state.serialize_entry("effectiveEdition", &self.effective_edition)?;
8938            }
8939            if !self.intelligence_config.is_empty() {
8940                state.serialize_entry("intelligenceConfig", &self.intelligence_config)?;
8941            }
8942            if !self._unknown_fields.is_empty() {
8943                for (key, value) in self._unknown_fields.iter() {
8944                    state.serialize_entry(key, &value)?;
8945                }
8946            }
8947            state.end()
8948        }
8949    }
8950
8951    impl std::fmt::Debug for EffectiveIntelligenceConfig {
8952        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
8953            let mut debug_struct = f.debug_struct("EffectiveIntelligenceConfig");
8954            debug_struct.field("effective_edition", &self.effective_edition);
8955            debug_struct.field("intelligence_config", &self.intelligence_config);
8956            if !self._unknown_fields.is_empty() {
8957                debug_struct.field("_unknown_fields", &self._unknown_fields);
8958            }
8959            debug_struct.finish()
8960        }
8961    }
8962
8963    /// Defines additional types related to [EffectiveIntelligenceConfig].
8964    pub mod effective_intelligence_config {
8965        #[allow(unused_imports)]
8966        use super::*;
8967
8968        /// The effective edition of the `IntelligenceConfig` resource.
8969        ///
8970        /// # Working with unknown values
8971        ///
8972        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8973        /// additional enum variants at any time. Adding new variants is not considered
8974        /// a breaking change. Applications should write their code in anticipation of:
8975        ///
8976        /// - New values appearing in future releases of the client library, **and**
8977        /// - New values received dynamically, without application changes.
8978        ///
8979        /// Please consult the [Working with enums] section in the user guide for some
8980        /// guidelines.
8981        ///
8982        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8983        #[derive(Clone, Debug, PartialEq)]
8984        #[non_exhaustive]
8985        pub enum EffectiveEdition {
8986            /// This is an unknown edition of the resource.
8987            Unspecified,
8988            /// No edition.
8989            None,
8990            /// The `IntelligenceConfig` resource is of STANDARD edition.
8991            Standard,
8992            /// If set, the enum was initialized with an unknown value.
8993            ///
8994            /// Applications can examine the value using [EffectiveEdition::value] or
8995            /// [EffectiveEdition::name].
8996            UnknownValue(effective_edition::UnknownValue),
8997        }
8998
8999        #[doc(hidden)]
9000        pub mod effective_edition {
9001            #[allow(unused_imports)]
9002            use super::*;
9003            #[derive(Clone, Debug, PartialEq)]
9004            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9005        }
9006
9007        impl EffectiveEdition {
9008            /// Gets the enum value.
9009            ///
9010            /// Returns `None` if the enum contains an unknown value deserialized from
9011            /// the string representation of enums.
9012            pub fn value(&self) -> std::option::Option<i32> {
9013                match self {
9014                    Self::Unspecified => std::option::Option::Some(0),
9015                    Self::None => std::option::Option::Some(1),
9016                    Self::Standard => std::option::Option::Some(2),
9017                    Self::UnknownValue(u) => u.0.value(),
9018                }
9019            }
9020
9021            /// Gets the enum value as a string.
9022            ///
9023            /// Returns `None` if the enum contains an unknown value deserialized from
9024            /// the integer representation of enums.
9025            pub fn name(&self) -> std::option::Option<&str> {
9026                match self {
9027                    Self::Unspecified => std::option::Option::Some("EFFECTIVE_EDITION_UNSPECIFIED"),
9028                    Self::None => std::option::Option::Some("NONE"),
9029                    Self::Standard => std::option::Option::Some("STANDARD"),
9030                    Self::UnknownValue(u) => u.0.name(),
9031                }
9032            }
9033        }
9034
9035        impl std::default::Default for EffectiveEdition {
9036            fn default() -> Self {
9037                use std::convert::From;
9038                Self::from(0)
9039            }
9040        }
9041
9042        impl std::fmt::Display for EffectiveEdition {
9043            fn fmt(
9044                &self,
9045                f: &mut std::fmt::Formatter<'_>,
9046            ) -> std::result::Result<(), std::fmt::Error> {
9047                wkt::internal::display_enum(f, self.name(), self.value())
9048            }
9049        }
9050
9051        impl std::convert::From<i32> for EffectiveEdition {
9052            fn from(value: i32) -> Self {
9053                match value {
9054                    0 => Self::Unspecified,
9055                    1 => Self::None,
9056                    2 => Self::Standard,
9057                    _ => Self::UnknownValue(effective_edition::UnknownValue(
9058                        wkt::internal::UnknownEnumValue::Integer(value),
9059                    )),
9060                }
9061            }
9062        }
9063
9064        impl std::convert::From<&str> for EffectiveEdition {
9065            fn from(value: &str) -> Self {
9066                use std::string::ToString;
9067                match value {
9068                    "EFFECTIVE_EDITION_UNSPECIFIED" => Self::Unspecified,
9069                    "NONE" => Self::None,
9070                    "STANDARD" => Self::Standard,
9071                    _ => Self::UnknownValue(effective_edition::UnknownValue(
9072                        wkt::internal::UnknownEnumValue::String(value.to_string()),
9073                    )),
9074                }
9075            }
9076        }
9077
9078        impl serde::ser::Serialize for EffectiveEdition {
9079            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9080            where
9081                S: serde::Serializer,
9082            {
9083                match self {
9084                    Self::Unspecified => serializer.serialize_i32(0),
9085                    Self::None => serializer.serialize_i32(1),
9086                    Self::Standard => serializer.serialize_i32(2),
9087                    Self::UnknownValue(u) => u.0.serialize(serializer),
9088                }
9089            }
9090        }
9091
9092        impl<'de> serde::de::Deserialize<'de> for EffectiveEdition {
9093            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9094            where
9095                D: serde::Deserializer<'de>,
9096            {
9097                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveEdition>::new(
9098                    ".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition"))
9099            }
9100        }
9101    }
9102
9103    /// The trial configuration of the `IntelligenceConfig` resource.
9104    #[derive(Clone, Default, PartialEq)]
9105    #[non_exhaustive]
9106    pub struct TrialConfig {
9107        /// Output only. The time at which the trial expires.
9108        pub expire_time: std::option::Option<wkt::Timestamp>,
9109
9110        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9111    }
9112
9113    impl TrialConfig {
9114        pub fn new() -> Self {
9115            std::default::Default::default()
9116        }
9117
9118        /// Sets the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
9119        pub fn set_expire_time<T>(mut self, v: T) -> Self
9120        where
9121            T: std::convert::Into<wkt::Timestamp>,
9122        {
9123            self.expire_time = std::option::Option::Some(v.into());
9124            self
9125        }
9126
9127        /// Sets or clears the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
9128        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
9129        where
9130            T: std::convert::Into<wkt::Timestamp>,
9131        {
9132            self.expire_time = v.map(|x| x.into());
9133            self
9134        }
9135    }
9136
9137    impl wkt::message::Message for TrialConfig {
9138        fn typename() -> &'static str {
9139            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.TrialConfig"
9140        }
9141    }
9142
9143    #[doc(hidden)]
9144    impl<'de> serde::de::Deserialize<'de> for TrialConfig {
9145        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9146        where
9147            D: serde::Deserializer<'de>,
9148        {
9149            #[allow(non_camel_case_types)]
9150            #[doc(hidden)]
9151            #[derive(PartialEq, Eq, Hash)]
9152            enum __FieldTag {
9153                __expire_time,
9154                Unknown(std::string::String),
9155            }
9156            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9157                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9158                where
9159                    D: serde::Deserializer<'de>,
9160                {
9161                    struct Visitor;
9162                    impl<'de> serde::de::Visitor<'de> for Visitor {
9163                        type Value = __FieldTag;
9164                        fn expecting(
9165                            &self,
9166                            formatter: &mut std::fmt::Formatter,
9167                        ) -> std::fmt::Result {
9168                            formatter.write_str("a field name for TrialConfig")
9169                        }
9170                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9171                        where
9172                            E: serde::de::Error,
9173                        {
9174                            use std::result::Result::Ok;
9175                            use std::string::ToString;
9176                            match value {
9177                                "expireTime" => Ok(__FieldTag::__expire_time),
9178                                "expire_time" => Ok(__FieldTag::__expire_time),
9179                                _ => Ok(__FieldTag::Unknown(value.to_string())),
9180                            }
9181                        }
9182                    }
9183                    deserializer.deserialize_identifier(Visitor)
9184                }
9185            }
9186            struct Visitor;
9187            impl<'de> serde::de::Visitor<'de> for Visitor {
9188                type Value = TrialConfig;
9189                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9190                    formatter.write_str("struct TrialConfig")
9191                }
9192                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9193                where
9194                    A: serde::de::MapAccess<'de>,
9195                {
9196                    #[allow(unused_imports)]
9197                    use serde::de::Error;
9198                    use std::option::Option::Some;
9199                    let mut fields = std::collections::HashSet::new();
9200                    let mut result = Self::Value::new();
9201                    while let Some(tag) = map.next_key::<__FieldTag>()? {
9202                        #[allow(clippy::match_single_binding)]
9203                        match tag {
9204                            __FieldTag::__expire_time => {
9205                                if !fields.insert(__FieldTag::__expire_time) {
9206                                    return std::result::Result::Err(A::Error::duplicate_field(
9207                                        "multiple values for expire_time",
9208                                    ));
9209                                }
9210                                result.expire_time =
9211                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
9212                            }
9213                            __FieldTag::Unknown(key) => {
9214                                let value = map.next_value::<serde_json::Value>()?;
9215                                result._unknown_fields.insert(key, value);
9216                            }
9217                        }
9218                    }
9219                    std::result::Result::Ok(result)
9220                }
9221            }
9222            deserializer.deserialize_any(Visitor)
9223        }
9224    }
9225
9226    #[doc(hidden)]
9227    impl serde::ser::Serialize for TrialConfig {
9228        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9229        where
9230            S: serde::ser::Serializer,
9231        {
9232            use serde::ser::SerializeMap;
9233            #[allow(unused_imports)]
9234            use std::option::Option::Some;
9235            let mut state = serializer.serialize_map(std::option::Option::None)?;
9236            if self.expire_time.is_some() {
9237                state.serialize_entry("expireTime", &self.expire_time)?;
9238            }
9239            if !self._unknown_fields.is_empty() {
9240                for (key, value) in self._unknown_fields.iter() {
9241                    state.serialize_entry(key, &value)?;
9242                }
9243            }
9244            state.end()
9245        }
9246    }
9247
9248    impl std::fmt::Debug for TrialConfig {
9249        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9250            let mut debug_struct = f.debug_struct("TrialConfig");
9251            debug_struct.field("expire_time", &self.expire_time);
9252            if !self._unknown_fields.is_empty() {
9253                debug_struct.field("_unknown_fields", &self._unknown_fields);
9254            }
9255            debug_struct.finish()
9256        }
9257    }
9258
9259    /// The edition configuration of the `IntelligenceConfig` resource. This
9260    /// signifies the edition used for configuring the `IntelligenceConfig`
9261    /// resource and can only take the following values:
9262    /// `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and
9263    /// `TRIAL`.
9264    ///
9265    /// # Working with unknown values
9266    ///
9267    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
9268    /// additional enum variants at any time. Adding new variants is not considered
9269    /// a breaking change. Applications should write their code in anticipation of:
9270    ///
9271    /// - New values appearing in future releases of the client library, **and**
9272    /// - New values received dynamically, without application changes.
9273    ///
9274    /// Please consult the [Working with enums] section in the user guide for some
9275    /// guidelines.
9276    ///
9277    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
9278    #[derive(Clone, Debug, PartialEq)]
9279    #[non_exhaustive]
9280    pub enum EditionConfig {
9281        /// This is an unknown edition of the resource.
9282        Unspecified,
9283        /// The inherited edition from the parent and filters. This is the default
9284        /// edition when there is no `IntelligenceConfig` setup for a GCP resource.
9285        Inherit,
9286        /// The edition configuration is disabled for the `IntelligenceConfig`
9287        /// resource and its children. Filters are not applicable.
9288        Disabled,
9289        /// The `IntelligenceConfig` resource is of STANDARD edition.
9290        Standard,
9291        /// The `IntelligenceConfig` resource is available in `TRIAL` edition. During
9292        /// the trial period, Cloud Storage does not charge for Storage Intelligence
9293        /// usage. You can specify the buckets to include in the trial period by
9294        /// using filters. At the end of the trial period, the `IntelligenceConfig`
9295        /// resource is upgraded to `STANDARD` edition.
9296        Trial,
9297        /// If set, the enum was initialized with an unknown value.
9298        ///
9299        /// Applications can examine the value using [EditionConfig::value] or
9300        /// [EditionConfig::name].
9301        UnknownValue(edition_config::UnknownValue),
9302    }
9303
9304    #[doc(hidden)]
9305    pub mod edition_config {
9306        #[allow(unused_imports)]
9307        use super::*;
9308        #[derive(Clone, Debug, PartialEq)]
9309        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
9310    }
9311
9312    impl EditionConfig {
9313        /// Gets the enum value.
9314        ///
9315        /// Returns `None` if the enum contains an unknown value deserialized from
9316        /// the string representation of enums.
9317        pub fn value(&self) -> std::option::Option<i32> {
9318            match self {
9319                Self::Unspecified => std::option::Option::Some(0),
9320                Self::Inherit => std::option::Option::Some(1),
9321                Self::Disabled => std::option::Option::Some(2),
9322                Self::Standard => std::option::Option::Some(3),
9323                Self::Trial => std::option::Option::Some(5),
9324                Self::UnknownValue(u) => u.0.value(),
9325            }
9326        }
9327
9328        /// Gets the enum value as a string.
9329        ///
9330        /// Returns `None` if the enum contains an unknown value deserialized from
9331        /// the integer representation of enums.
9332        pub fn name(&self) -> std::option::Option<&str> {
9333            match self {
9334                Self::Unspecified => std::option::Option::Some("EDITION_CONFIG_UNSPECIFIED"),
9335                Self::Inherit => std::option::Option::Some("INHERIT"),
9336                Self::Disabled => std::option::Option::Some("DISABLED"),
9337                Self::Standard => std::option::Option::Some("STANDARD"),
9338                Self::Trial => std::option::Option::Some("TRIAL"),
9339                Self::UnknownValue(u) => u.0.name(),
9340            }
9341        }
9342    }
9343
9344    impl std::default::Default for EditionConfig {
9345        fn default() -> Self {
9346            use std::convert::From;
9347            Self::from(0)
9348        }
9349    }
9350
9351    impl std::fmt::Display for EditionConfig {
9352        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
9353            wkt::internal::display_enum(f, self.name(), self.value())
9354        }
9355    }
9356
9357    impl std::convert::From<i32> for EditionConfig {
9358        fn from(value: i32) -> Self {
9359            match value {
9360                0 => Self::Unspecified,
9361                1 => Self::Inherit,
9362                2 => Self::Disabled,
9363                3 => Self::Standard,
9364                5 => Self::Trial,
9365                _ => Self::UnknownValue(edition_config::UnknownValue(
9366                    wkt::internal::UnknownEnumValue::Integer(value),
9367                )),
9368            }
9369        }
9370    }
9371
9372    impl std::convert::From<&str> for EditionConfig {
9373        fn from(value: &str) -> Self {
9374            use std::string::ToString;
9375            match value {
9376                "EDITION_CONFIG_UNSPECIFIED" => Self::Unspecified,
9377                "INHERIT" => Self::Inherit,
9378                "DISABLED" => Self::Disabled,
9379                "STANDARD" => Self::Standard,
9380                "TRIAL" => Self::Trial,
9381                _ => Self::UnknownValue(edition_config::UnknownValue(
9382                    wkt::internal::UnknownEnumValue::String(value.to_string()),
9383                )),
9384            }
9385        }
9386    }
9387
9388    impl serde::ser::Serialize for EditionConfig {
9389        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9390        where
9391            S: serde::Serializer,
9392        {
9393            match self {
9394                Self::Unspecified => serializer.serialize_i32(0),
9395                Self::Inherit => serializer.serialize_i32(1),
9396                Self::Disabled => serializer.serialize_i32(2),
9397                Self::Standard => serializer.serialize_i32(3),
9398                Self::Trial => serializer.serialize_i32(5),
9399                Self::UnknownValue(u) => u.0.serialize(serializer),
9400            }
9401        }
9402    }
9403
9404    impl<'de> serde::de::Deserialize<'de> for EditionConfig {
9405        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9406        where
9407            D: serde::Deserializer<'de>,
9408        {
9409            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EditionConfig>::new(
9410                ".google.storage.control.v2.IntelligenceConfig.EditionConfig",
9411            ))
9412        }
9413    }
9414}
9415
9416/// Request message to update the `IntelligenceConfig` resource associated with
9417/// your organization.
9418///
9419/// **IAM Permissions**:
9420///
9421/// Requires `storage.intelligenceConfigs.update`
9422/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
9423/// the organization.
9424#[derive(Clone, Default, PartialEq)]
9425#[non_exhaustive]
9426pub struct UpdateOrganizationIntelligenceConfigRequest {
9427    /// Required. The `IntelligenceConfig` resource to be updated.
9428    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
9429
9430    /// Required. The `update_mask` that specifies the fields within the
9431    /// `IntelligenceConfig` resource that should be modified by this update. Only
9432    /// the listed fields are updated.
9433    pub update_mask: std::option::Option<wkt::FieldMask>,
9434
9435    /// Optional. The ID that uniquely identifies the request, preventing duplicate
9436    /// processing.
9437    pub request_id: std::string::String,
9438
9439    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9440}
9441
9442impl UpdateOrganizationIntelligenceConfigRequest {
9443    pub fn new() -> Self {
9444        std::default::Default::default()
9445    }
9446
9447    /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
9448    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
9449    where
9450        T: std::convert::Into<crate::model::IntelligenceConfig>,
9451    {
9452        self.intelligence_config = std::option::Option::Some(v.into());
9453        self
9454    }
9455
9456    /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
9457    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
9458    where
9459        T: std::convert::Into<crate::model::IntelligenceConfig>,
9460    {
9461        self.intelligence_config = v.map(|x| x.into());
9462        self
9463    }
9464
9465    /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
9466    pub fn set_update_mask<T>(mut self, v: T) -> Self
9467    where
9468        T: std::convert::Into<wkt::FieldMask>,
9469    {
9470        self.update_mask = std::option::Option::Some(v.into());
9471        self
9472    }
9473
9474    /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
9475    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9476    where
9477        T: std::convert::Into<wkt::FieldMask>,
9478    {
9479        self.update_mask = v.map(|x| x.into());
9480        self
9481    }
9482
9483    /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
9484    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9485        self.request_id = v.into();
9486        self
9487    }
9488}
9489
9490impl wkt::message::Message for UpdateOrganizationIntelligenceConfigRequest {
9491    fn typename() -> &'static str {
9492        "type.googleapis.com/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"
9493    }
9494}
9495
9496#[doc(hidden)]
9497impl<'de> serde::de::Deserialize<'de> for UpdateOrganizationIntelligenceConfigRequest {
9498    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9499    where
9500        D: serde::Deserializer<'de>,
9501    {
9502        #[allow(non_camel_case_types)]
9503        #[doc(hidden)]
9504        #[derive(PartialEq, Eq, Hash)]
9505        enum __FieldTag {
9506            __intelligence_config,
9507            __update_mask,
9508            __request_id,
9509            Unknown(std::string::String),
9510        }
9511        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9512            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9513            where
9514                D: serde::Deserializer<'de>,
9515            {
9516                struct Visitor;
9517                impl<'de> serde::de::Visitor<'de> for Visitor {
9518                    type Value = __FieldTag;
9519                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9520                        formatter.write_str(
9521                            "a field name for UpdateOrganizationIntelligenceConfigRequest",
9522                        )
9523                    }
9524                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9525                    where
9526                        E: serde::de::Error,
9527                    {
9528                        use std::result::Result::Ok;
9529                        use std::string::ToString;
9530                        match value {
9531                            "intelligenceConfig" => Ok(__FieldTag::__intelligence_config),
9532                            "intelligence_config" => Ok(__FieldTag::__intelligence_config),
9533                            "updateMask" => Ok(__FieldTag::__update_mask),
9534                            "update_mask" => Ok(__FieldTag::__update_mask),
9535                            "requestId" => Ok(__FieldTag::__request_id),
9536                            "request_id" => Ok(__FieldTag::__request_id),
9537                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9538                        }
9539                    }
9540                }
9541                deserializer.deserialize_identifier(Visitor)
9542            }
9543        }
9544        struct Visitor;
9545        impl<'de> serde::de::Visitor<'de> for Visitor {
9546            type Value = UpdateOrganizationIntelligenceConfigRequest;
9547            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9548                formatter.write_str("struct UpdateOrganizationIntelligenceConfigRequest")
9549            }
9550            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9551            where
9552                A: serde::de::MapAccess<'de>,
9553            {
9554                #[allow(unused_imports)]
9555                use serde::de::Error;
9556                use std::option::Option::Some;
9557                let mut fields = std::collections::HashSet::new();
9558                let mut result = Self::Value::new();
9559                while let Some(tag) = map.next_key::<__FieldTag>()? {
9560                    #[allow(clippy::match_single_binding)]
9561                    match tag {
9562                        __FieldTag::__intelligence_config => {
9563                            if !fields.insert(__FieldTag::__intelligence_config) {
9564                                return std::result::Result::Err(A::Error::duplicate_field(
9565                                    "multiple values for intelligence_config",
9566                                ));
9567                            }
9568                            result.intelligence_config = map.next_value::<std::option::Option<crate::model::IntelligenceConfig>>()?
9569                                ;
9570                        }
9571                        __FieldTag::__update_mask => {
9572                            if !fields.insert(__FieldTag::__update_mask) {
9573                                return std::result::Result::Err(A::Error::duplicate_field(
9574                                    "multiple values for update_mask",
9575                                ));
9576                            }
9577                            result.update_mask =
9578                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
9579                        }
9580                        __FieldTag::__request_id => {
9581                            if !fields.insert(__FieldTag::__request_id) {
9582                                return std::result::Result::Err(A::Error::duplicate_field(
9583                                    "multiple values for request_id",
9584                                ));
9585                            }
9586                            result.request_id = map
9587                                .next_value::<std::option::Option<std::string::String>>()?
9588                                .unwrap_or_default();
9589                        }
9590                        __FieldTag::Unknown(key) => {
9591                            let value = map.next_value::<serde_json::Value>()?;
9592                            result._unknown_fields.insert(key, value);
9593                        }
9594                    }
9595                }
9596                std::result::Result::Ok(result)
9597            }
9598        }
9599        deserializer.deserialize_any(Visitor)
9600    }
9601}
9602
9603#[doc(hidden)]
9604impl serde::ser::Serialize for UpdateOrganizationIntelligenceConfigRequest {
9605    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9606    where
9607        S: serde::ser::Serializer,
9608    {
9609        use serde::ser::SerializeMap;
9610        #[allow(unused_imports)]
9611        use std::option::Option::Some;
9612        let mut state = serializer.serialize_map(std::option::Option::None)?;
9613        if self.intelligence_config.is_some() {
9614            state.serialize_entry("intelligenceConfig", &self.intelligence_config)?;
9615        }
9616        if self.update_mask.is_some() {
9617            state.serialize_entry("updateMask", &self.update_mask)?;
9618        }
9619        if !self.request_id.is_empty() {
9620            state.serialize_entry("requestId", &self.request_id)?;
9621        }
9622        if !self._unknown_fields.is_empty() {
9623            for (key, value) in self._unknown_fields.iter() {
9624                state.serialize_entry(key, &value)?;
9625            }
9626        }
9627        state.end()
9628    }
9629}
9630
9631impl std::fmt::Debug for UpdateOrganizationIntelligenceConfigRequest {
9632    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9633        let mut debug_struct = f.debug_struct("UpdateOrganizationIntelligenceConfigRequest");
9634        debug_struct.field("intelligence_config", &self.intelligence_config);
9635        debug_struct.field("update_mask", &self.update_mask);
9636        debug_struct.field("request_id", &self.request_id);
9637        if !self._unknown_fields.is_empty() {
9638            debug_struct.field("_unknown_fields", &self._unknown_fields);
9639        }
9640        debug_struct.finish()
9641    }
9642}
9643
9644/// Request message to update the `IntelligenceConfig` resource associated with
9645/// your folder.
9646///
9647/// **IAM Permissions**:
9648///
9649/// Requires `storage.intelligenceConfigs.update`
9650/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
9651/// the folder.
9652#[derive(Clone, Default, PartialEq)]
9653#[non_exhaustive]
9654pub struct UpdateFolderIntelligenceConfigRequest {
9655    /// Required. The `IntelligenceConfig` resource to be updated.
9656    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
9657
9658    /// Required. The `update_mask` that specifies the fields within the
9659    /// `IntelligenceConfig` resource that should be modified by this update. Only
9660    /// the listed fields are updated.
9661    pub update_mask: std::option::Option<wkt::FieldMask>,
9662
9663    /// Optional. The ID that uniquely identifies the request, preventing duplicate
9664    /// processing.
9665    pub request_id: std::string::String,
9666
9667    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9668}
9669
9670impl UpdateFolderIntelligenceConfigRequest {
9671    pub fn new() -> Self {
9672        std::default::Default::default()
9673    }
9674
9675    /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
9676    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
9677    where
9678        T: std::convert::Into<crate::model::IntelligenceConfig>,
9679    {
9680        self.intelligence_config = std::option::Option::Some(v.into());
9681        self
9682    }
9683
9684    /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
9685    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
9686    where
9687        T: std::convert::Into<crate::model::IntelligenceConfig>,
9688    {
9689        self.intelligence_config = v.map(|x| x.into());
9690        self
9691    }
9692
9693    /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
9694    pub fn set_update_mask<T>(mut self, v: T) -> Self
9695    where
9696        T: std::convert::Into<wkt::FieldMask>,
9697    {
9698        self.update_mask = std::option::Option::Some(v.into());
9699        self
9700    }
9701
9702    /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
9703    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9704    where
9705        T: std::convert::Into<wkt::FieldMask>,
9706    {
9707        self.update_mask = v.map(|x| x.into());
9708        self
9709    }
9710
9711    /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
9712    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9713        self.request_id = v.into();
9714        self
9715    }
9716}
9717
9718impl wkt::message::Message for UpdateFolderIntelligenceConfigRequest {
9719    fn typename() -> &'static str {
9720        "type.googleapis.com/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"
9721    }
9722}
9723
9724#[doc(hidden)]
9725impl<'de> serde::de::Deserialize<'de> for UpdateFolderIntelligenceConfigRequest {
9726    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9727    where
9728        D: serde::Deserializer<'de>,
9729    {
9730        #[allow(non_camel_case_types)]
9731        #[doc(hidden)]
9732        #[derive(PartialEq, Eq, Hash)]
9733        enum __FieldTag {
9734            __intelligence_config,
9735            __update_mask,
9736            __request_id,
9737            Unknown(std::string::String),
9738        }
9739        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9740            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9741            where
9742                D: serde::Deserializer<'de>,
9743            {
9744                struct Visitor;
9745                impl<'de> serde::de::Visitor<'de> for Visitor {
9746                    type Value = __FieldTag;
9747                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9748                        formatter
9749                            .write_str("a field name for UpdateFolderIntelligenceConfigRequest")
9750                    }
9751                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9752                    where
9753                        E: serde::de::Error,
9754                    {
9755                        use std::result::Result::Ok;
9756                        use std::string::ToString;
9757                        match value {
9758                            "intelligenceConfig" => Ok(__FieldTag::__intelligence_config),
9759                            "intelligence_config" => Ok(__FieldTag::__intelligence_config),
9760                            "updateMask" => Ok(__FieldTag::__update_mask),
9761                            "update_mask" => Ok(__FieldTag::__update_mask),
9762                            "requestId" => Ok(__FieldTag::__request_id),
9763                            "request_id" => Ok(__FieldTag::__request_id),
9764                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9765                        }
9766                    }
9767                }
9768                deserializer.deserialize_identifier(Visitor)
9769            }
9770        }
9771        struct Visitor;
9772        impl<'de> serde::de::Visitor<'de> for Visitor {
9773            type Value = UpdateFolderIntelligenceConfigRequest;
9774            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9775                formatter.write_str("struct UpdateFolderIntelligenceConfigRequest")
9776            }
9777            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9778            where
9779                A: serde::de::MapAccess<'de>,
9780            {
9781                #[allow(unused_imports)]
9782                use serde::de::Error;
9783                use std::option::Option::Some;
9784                let mut fields = std::collections::HashSet::new();
9785                let mut result = Self::Value::new();
9786                while let Some(tag) = map.next_key::<__FieldTag>()? {
9787                    #[allow(clippy::match_single_binding)]
9788                    match tag {
9789                        __FieldTag::__intelligence_config => {
9790                            if !fields.insert(__FieldTag::__intelligence_config) {
9791                                return std::result::Result::Err(A::Error::duplicate_field(
9792                                    "multiple values for intelligence_config",
9793                                ));
9794                            }
9795                            result.intelligence_config = map.next_value::<std::option::Option<crate::model::IntelligenceConfig>>()?
9796                                ;
9797                        }
9798                        __FieldTag::__update_mask => {
9799                            if !fields.insert(__FieldTag::__update_mask) {
9800                                return std::result::Result::Err(A::Error::duplicate_field(
9801                                    "multiple values for update_mask",
9802                                ));
9803                            }
9804                            result.update_mask =
9805                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
9806                        }
9807                        __FieldTag::__request_id => {
9808                            if !fields.insert(__FieldTag::__request_id) {
9809                                return std::result::Result::Err(A::Error::duplicate_field(
9810                                    "multiple values for request_id",
9811                                ));
9812                            }
9813                            result.request_id = map
9814                                .next_value::<std::option::Option<std::string::String>>()?
9815                                .unwrap_or_default();
9816                        }
9817                        __FieldTag::Unknown(key) => {
9818                            let value = map.next_value::<serde_json::Value>()?;
9819                            result._unknown_fields.insert(key, value);
9820                        }
9821                    }
9822                }
9823                std::result::Result::Ok(result)
9824            }
9825        }
9826        deserializer.deserialize_any(Visitor)
9827    }
9828}
9829
9830#[doc(hidden)]
9831impl serde::ser::Serialize for UpdateFolderIntelligenceConfigRequest {
9832    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9833    where
9834        S: serde::ser::Serializer,
9835    {
9836        use serde::ser::SerializeMap;
9837        #[allow(unused_imports)]
9838        use std::option::Option::Some;
9839        let mut state = serializer.serialize_map(std::option::Option::None)?;
9840        if self.intelligence_config.is_some() {
9841            state.serialize_entry("intelligenceConfig", &self.intelligence_config)?;
9842        }
9843        if self.update_mask.is_some() {
9844            state.serialize_entry("updateMask", &self.update_mask)?;
9845        }
9846        if !self.request_id.is_empty() {
9847            state.serialize_entry("requestId", &self.request_id)?;
9848        }
9849        if !self._unknown_fields.is_empty() {
9850            for (key, value) in self._unknown_fields.iter() {
9851                state.serialize_entry(key, &value)?;
9852            }
9853        }
9854        state.end()
9855    }
9856}
9857
9858impl std::fmt::Debug for UpdateFolderIntelligenceConfigRequest {
9859    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
9860        let mut debug_struct = f.debug_struct("UpdateFolderIntelligenceConfigRequest");
9861        debug_struct.field("intelligence_config", &self.intelligence_config);
9862        debug_struct.field("update_mask", &self.update_mask);
9863        debug_struct.field("request_id", &self.request_id);
9864        if !self._unknown_fields.is_empty() {
9865            debug_struct.field("_unknown_fields", &self._unknown_fields);
9866        }
9867        debug_struct.finish()
9868    }
9869}
9870
9871/// Request message to update the `IntelligenceConfig` resource associated with
9872/// your project.
9873///
9874/// **IAM Permissions**:
9875///
9876/// Requires `storage.intelligenceConfigs.update`
9877/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
9878/// the folder.
9879#[derive(Clone, Default, PartialEq)]
9880#[non_exhaustive]
9881pub struct UpdateProjectIntelligenceConfigRequest {
9882    /// Required. The `IntelligenceConfig` resource to be updated.
9883    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
9884
9885    /// Required. The `update_mask` that specifies the fields within the
9886    /// `IntelligenceConfig` resource that should be modified by this update. Only
9887    /// the listed fields are updated.
9888    pub update_mask: std::option::Option<wkt::FieldMask>,
9889
9890    /// Optional. The ID that uniquely identifies the request, preventing duplicate
9891    /// processing.
9892    pub request_id: std::string::String,
9893
9894    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9895}
9896
9897impl UpdateProjectIntelligenceConfigRequest {
9898    pub fn new() -> Self {
9899        std::default::Default::default()
9900    }
9901
9902    /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
9903    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
9904    where
9905        T: std::convert::Into<crate::model::IntelligenceConfig>,
9906    {
9907        self.intelligence_config = std::option::Option::Some(v.into());
9908        self
9909    }
9910
9911    /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
9912    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
9913    where
9914        T: std::convert::Into<crate::model::IntelligenceConfig>,
9915    {
9916        self.intelligence_config = v.map(|x| x.into());
9917        self
9918    }
9919
9920    /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
9921    pub fn set_update_mask<T>(mut self, v: T) -> Self
9922    where
9923        T: std::convert::Into<wkt::FieldMask>,
9924    {
9925        self.update_mask = std::option::Option::Some(v.into());
9926        self
9927    }
9928
9929    /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
9930    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9931    where
9932        T: std::convert::Into<wkt::FieldMask>,
9933    {
9934        self.update_mask = v.map(|x| x.into());
9935        self
9936    }
9937
9938    /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
9939    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9940        self.request_id = v.into();
9941        self
9942    }
9943}
9944
9945impl wkt::message::Message for UpdateProjectIntelligenceConfigRequest {
9946    fn typename() -> &'static str {
9947        "type.googleapis.com/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"
9948    }
9949}
9950
9951#[doc(hidden)]
9952impl<'de> serde::de::Deserialize<'de> for UpdateProjectIntelligenceConfigRequest {
9953    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9954    where
9955        D: serde::Deserializer<'de>,
9956    {
9957        #[allow(non_camel_case_types)]
9958        #[doc(hidden)]
9959        #[derive(PartialEq, Eq, Hash)]
9960        enum __FieldTag {
9961            __intelligence_config,
9962            __update_mask,
9963            __request_id,
9964            Unknown(std::string::String),
9965        }
9966        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9967            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9968            where
9969                D: serde::Deserializer<'de>,
9970            {
9971                struct Visitor;
9972                impl<'de> serde::de::Visitor<'de> for Visitor {
9973                    type Value = __FieldTag;
9974                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9975                        formatter
9976                            .write_str("a field name for UpdateProjectIntelligenceConfigRequest")
9977                    }
9978                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9979                    where
9980                        E: serde::de::Error,
9981                    {
9982                        use std::result::Result::Ok;
9983                        use std::string::ToString;
9984                        match value {
9985                            "intelligenceConfig" => Ok(__FieldTag::__intelligence_config),
9986                            "intelligence_config" => Ok(__FieldTag::__intelligence_config),
9987                            "updateMask" => Ok(__FieldTag::__update_mask),
9988                            "update_mask" => Ok(__FieldTag::__update_mask),
9989                            "requestId" => Ok(__FieldTag::__request_id),
9990                            "request_id" => Ok(__FieldTag::__request_id),
9991                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9992                        }
9993                    }
9994                }
9995                deserializer.deserialize_identifier(Visitor)
9996            }
9997        }
9998        struct Visitor;
9999        impl<'de> serde::de::Visitor<'de> for Visitor {
10000            type Value = UpdateProjectIntelligenceConfigRequest;
10001            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10002                formatter.write_str("struct UpdateProjectIntelligenceConfigRequest")
10003            }
10004            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10005            where
10006                A: serde::de::MapAccess<'de>,
10007            {
10008                #[allow(unused_imports)]
10009                use serde::de::Error;
10010                use std::option::Option::Some;
10011                let mut fields = std::collections::HashSet::new();
10012                let mut result = Self::Value::new();
10013                while let Some(tag) = map.next_key::<__FieldTag>()? {
10014                    #[allow(clippy::match_single_binding)]
10015                    match tag {
10016                        __FieldTag::__intelligence_config => {
10017                            if !fields.insert(__FieldTag::__intelligence_config) {
10018                                return std::result::Result::Err(A::Error::duplicate_field(
10019                                    "multiple values for intelligence_config",
10020                                ));
10021                            }
10022                            result.intelligence_config = map.next_value::<std::option::Option<crate::model::IntelligenceConfig>>()?
10023                                ;
10024                        }
10025                        __FieldTag::__update_mask => {
10026                            if !fields.insert(__FieldTag::__update_mask) {
10027                                return std::result::Result::Err(A::Error::duplicate_field(
10028                                    "multiple values for update_mask",
10029                                ));
10030                            }
10031                            result.update_mask =
10032                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
10033                        }
10034                        __FieldTag::__request_id => {
10035                            if !fields.insert(__FieldTag::__request_id) {
10036                                return std::result::Result::Err(A::Error::duplicate_field(
10037                                    "multiple values for request_id",
10038                                ));
10039                            }
10040                            result.request_id = map
10041                                .next_value::<std::option::Option<std::string::String>>()?
10042                                .unwrap_or_default();
10043                        }
10044                        __FieldTag::Unknown(key) => {
10045                            let value = map.next_value::<serde_json::Value>()?;
10046                            result._unknown_fields.insert(key, value);
10047                        }
10048                    }
10049                }
10050                std::result::Result::Ok(result)
10051            }
10052        }
10053        deserializer.deserialize_any(Visitor)
10054    }
10055}
10056
10057#[doc(hidden)]
10058impl serde::ser::Serialize for UpdateProjectIntelligenceConfigRequest {
10059    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10060    where
10061        S: serde::ser::Serializer,
10062    {
10063        use serde::ser::SerializeMap;
10064        #[allow(unused_imports)]
10065        use std::option::Option::Some;
10066        let mut state = serializer.serialize_map(std::option::Option::None)?;
10067        if self.intelligence_config.is_some() {
10068            state.serialize_entry("intelligenceConfig", &self.intelligence_config)?;
10069        }
10070        if self.update_mask.is_some() {
10071            state.serialize_entry("updateMask", &self.update_mask)?;
10072        }
10073        if !self.request_id.is_empty() {
10074            state.serialize_entry("requestId", &self.request_id)?;
10075        }
10076        if !self._unknown_fields.is_empty() {
10077            for (key, value) in self._unknown_fields.iter() {
10078                state.serialize_entry(key, &value)?;
10079            }
10080        }
10081        state.end()
10082    }
10083}
10084
10085impl std::fmt::Debug for UpdateProjectIntelligenceConfigRequest {
10086    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10087        let mut debug_struct = f.debug_struct("UpdateProjectIntelligenceConfigRequest");
10088        debug_struct.field("intelligence_config", &self.intelligence_config);
10089        debug_struct.field("update_mask", &self.update_mask);
10090        debug_struct.field("request_id", &self.request_id);
10091        if !self._unknown_fields.is_empty() {
10092            debug_struct.field("_unknown_fields", &self._unknown_fields);
10093        }
10094        debug_struct.finish()
10095    }
10096}
10097
10098/// Request message to get the `IntelligenceConfig` resource associated with your
10099/// organization.
10100///
10101/// **IAM Permissions**
10102///
10103/// Requires `storage.intelligenceConfigs.get`
10104/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
10105/// the organization.
10106#[derive(Clone, Default, PartialEq)]
10107#[non_exhaustive]
10108pub struct GetOrganizationIntelligenceConfigRequest {
10109    /// Required. The name of the `IntelligenceConfig` resource associated with
10110    /// your organization.
10111    ///
10112    /// Format: `organizations/{org_id}/locations/global/intelligenceConfig`
10113    pub name: std::string::String,
10114
10115    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10116}
10117
10118impl GetOrganizationIntelligenceConfigRequest {
10119    pub fn new() -> Self {
10120        std::default::Default::default()
10121    }
10122
10123    /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
10124    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10125        self.name = v.into();
10126        self
10127    }
10128}
10129
10130impl wkt::message::Message for GetOrganizationIntelligenceConfigRequest {
10131    fn typename() -> &'static str {
10132        "type.googleapis.com/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"
10133    }
10134}
10135
10136#[doc(hidden)]
10137impl<'de> serde::de::Deserialize<'de> for GetOrganizationIntelligenceConfigRequest {
10138    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10139    where
10140        D: serde::Deserializer<'de>,
10141    {
10142        #[allow(non_camel_case_types)]
10143        #[doc(hidden)]
10144        #[derive(PartialEq, Eq, Hash)]
10145        enum __FieldTag {
10146            __name,
10147            Unknown(std::string::String),
10148        }
10149        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10150            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10151            where
10152                D: serde::Deserializer<'de>,
10153            {
10154                struct Visitor;
10155                impl<'de> serde::de::Visitor<'de> for Visitor {
10156                    type Value = __FieldTag;
10157                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10158                        formatter
10159                            .write_str("a field name for GetOrganizationIntelligenceConfigRequest")
10160                    }
10161                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10162                    where
10163                        E: serde::de::Error,
10164                    {
10165                        use std::result::Result::Ok;
10166                        use std::string::ToString;
10167                        match value {
10168                            "name" => Ok(__FieldTag::__name),
10169                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10170                        }
10171                    }
10172                }
10173                deserializer.deserialize_identifier(Visitor)
10174            }
10175        }
10176        struct Visitor;
10177        impl<'de> serde::de::Visitor<'de> for Visitor {
10178            type Value = GetOrganizationIntelligenceConfigRequest;
10179            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10180                formatter.write_str("struct GetOrganizationIntelligenceConfigRequest")
10181            }
10182            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10183            where
10184                A: serde::de::MapAccess<'de>,
10185            {
10186                #[allow(unused_imports)]
10187                use serde::de::Error;
10188                use std::option::Option::Some;
10189                let mut fields = std::collections::HashSet::new();
10190                let mut result = Self::Value::new();
10191                while let Some(tag) = map.next_key::<__FieldTag>()? {
10192                    #[allow(clippy::match_single_binding)]
10193                    match tag {
10194                        __FieldTag::__name => {
10195                            if !fields.insert(__FieldTag::__name) {
10196                                return std::result::Result::Err(A::Error::duplicate_field(
10197                                    "multiple values for name",
10198                                ));
10199                            }
10200                            result.name = map
10201                                .next_value::<std::option::Option<std::string::String>>()?
10202                                .unwrap_or_default();
10203                        }
10204                        __FieldTag::Unknown(key) => {
10205                            let value = map.next_value::<serde_json::Value>()?;
10206                            result._unknown_fields.insert(key, value);
10207                        }
10208                    }
10209                }
10210                std::result::Result::Ok(result)
10211            }
10212        }
10213        deserializer.deserialize_any(Visitor)
10214    }
10215}
10216
10217#[doc(hidden)]
10218impl serde::ser::Serialize for GetOrganizationIntelligenceConfigRequest {
10219    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10220    where
10221        S: serde::ser::Serializer,
10222    {
10223        use serde::ser::SerializeMap;
10224        #[allow(unused_imports)]
10225        use std::option::Option::Some;
10226        let mut state = serializer.serialize_map(std::option::Option::None)?;
10227        if !self.name.is_empty() {
10228            state.serialize_entry("name", &self.name)?;
10229        }
10230        if !self._unknown_fields.is_empty() {
10231            for (key, value) in self._unknown_fields.iter() {
10232                state.serialize_entry(key, &value)?;
10233            }
10234        }
10235        state.end()
10236    }
10237}
10238
10239impl std::fmt::Debug for GetOrganizationIntelligenceConfigRequest {
10240    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10241        let mut debug_struct = f.debug_struct("GetOrganizationIntelligenceConfigRequest");
10242        debug_struct.field("name", &self.name);
10243        if !self._unknown_fields.is_empty() {
10244            debug_struct.field("_unknown_fields", &self._unknown_fields);
10245        }
10246        debug_struct.finish()
10247    }
10248}
10249
10250/// Request message to get the `IntelligenceConfig` resource associated with your
10251/// folder.
10252///
10253/// **IAM Permissions**
10254///
10255/// Requires `storage.intelligenceConfigs.get`
10256/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
10257/// the folder.
10258#[derive(Clone, Default, PartialEq)]
10259#[non_exhaustive]
10260pub struct GetFolderIntelligenceConfigRequest {
10261    /// Required. The name of the `IntelligenceConfig` resource associated with
10262    /// your folder.
10263    ///
10264    /// Format: `folders/{id}/locations/global/intelligenceConfig`
10265    pub name: std::string::String,
10266
10267    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10268}
10269
10270impl GetFolderIntelligenceConfigRequest {
10271    pub fn new() -> Self {
10272        std::default::Default::default()
10273    }
10274
10275    /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
10276    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10277        self.name = v.into();
10278        self
10279    }
10280}
10281
10282impl wkt::message::Message for GetFolderIntelligenceConfigRequest {
10283    fn typename() -> &'static str {
10284        "type.googleapis.com/google.storage.control.v2.GetFolderIntelligenceConfigRequest"
10285    }
10286}
10287
10288#[doc(hidden)]
10289impl<'de> serde::de::Deserialize<'de> for GetFolderIntelligenceConfigRequest {
10290    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10291    where
10292        D: serde::Deserializer<'de>,
10293    {
10294        #[allow(non_camel_case_types)]
10295        #[doc(hidden)]
10296        #[derive(PartialEq, Eq, Hash)]
10297        enum __FieldTag {
10298            __name,
10299            Unknown(std::string::String),
10300        }
10301        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10302            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10303            where
10304                D: serde::Deserializer<'de>,
10305            {
10306                struct Visitor;
10307                impl<'de> serde::de::Visitor<'de> for Visitor {
10308                    type Value = __FieldTag;
10309                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10310                        formatter.write_str("a field name for GetFolderIntelligenceConfigRequest")
10311                    }
10312                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10313                    where
10314                        E: serde::de::Error,
10315                    {
10316                        use std::result::Result::Ok;
10317                        use std::string::ToString;
10318                        match value {
10319                            "name" => Ok(__FieldTag::__name),
10320                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10321                        }
10322                    }
10323                }
10324                deserializer.deserialize_identifier(Visitor)
10325            }
10326        }
10327        struct Visitor;
10328        impl<'de> serde::de::Visitor<'de> for Visitor {
10329            type Value = GetFolderIntelligenceConfigRequest;
10330            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10331                formatter.write_str("struct GetFolderIntelligenceConfigRequest")
10332            }
10333            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10334            where
10335                A: serde::de::MapAccess<'de>,
10336            {
10337                #[allow(unused_imports)]
10338                use serde::de::Error;
10339                use std::option::Option::Some;
10340                let mut fields = std::collections::HashSet::new();
10341                let mut result = Self::Value::new();
10342                while let Some(tag) = map.next_key::<__FieldTag>()? {
10343                    #[allow(clippy::match_single_binding)]
10344                    match tag {
10345                        __FieldTag::__name => {
10346                            if !fields.insert(__FieldTag::__name) {
10347                                return std::result::Result::Err(A::Error::duplicate_field(
10348                                    "multiple values for name",
10349                                ));
10350                            }
10351                            result.name = map
10352                                .next_value::<std::option::Option<std::string::String>>()?
10353                                .unwrap_or_default();
10354                        }
10355                        __FieldTag::Unknown(key) => {
10356                            let value = map.next_value::<serde_json::Value>()?;
10357                            result._unknown_fields.insert(key, value);
10358                        }
10359                    }
10360                }
10361                std::result::Result::Ok(result)
10362            }
10363        }
10364        deserializer.deserialize_any(Visitor)
10365    }
10366}
10367
10368#[doc(hidden)]
10369impl serde::ser::Serialize for GetFolderIntelligenceConfigRequest {
10370    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10371    where
10372        S: serde::ser::Serializer,
10373    {
10374        use serde::ser::SerializeMap;
10375        #[allow(unused_imports)]
10376        use std::option::Option::Some;
10377        let mut state = serializer.serialize_map(std::option::Option::None)?;
10378        if !self.name.is_empty() {
10379            state.serialize_entry("name", &self.name)?;
10380        }
10381        if !self._unknown_fields.is_empty() {
10382            for (key, value) in self._unknown_fields.iter() {
10383                state.serialize_entry(key, &value)?;
10384            }
10385        }
10386        state.end()
10387    }
10388}
10389
10390impl std::fmt::Debug for GetFolderIntelligenceConfigRequest {
10391    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10392        let mut debug_struct = f.debug_struct("GetFolderIntelligenceConfigRequest");
10393        debug_struct.field("name", &self.name);
10394        if !self._unknown_fields.is_empty() {
10395            debug_struct.field("_unknown_fields", &self._unknown_fields);
10396        }
10397        debug_struct.finish()
10398    }
10399}
10400
10401/// Request message to get the `IntelligenceConfig` resource associated with your
10402/// project.
10403///
10404/// **IAM Permissions**:
10405///
10406/// Requires `storage.intelligenceConfigs.get`
10407/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission
10408/// on the project.
10409#[derive(Clone, Default, PartialEq)]
10410#[non_exhaustive]
10411pub struct GetProjectIntelligenceConfigRequest {
10412    /// Required. The name of the `IntelligenceConfig` resource associated with
10413    /// your project.
10414    ///
10415    /// Format: `projects/{id}/locations/global/intelligenceConfig`
10416    pub name: std::string::String,
10417
10418    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
10419}
10420
10421impl GetProjectIntelligenceConfigRequest {
10422    pub fn new() -> Self {
10423        std::default::Default::default()
10424    }
10425
10426    /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
10427    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10428        self.name = v.into();
10429        self
10430    }
10431}
10432
10433impl wkt::message::Message for GetProjectIntelligenceConfigRequest {
10434    fn typename() -> &'static str {
10435        "type.googleapis.com/google.storage.control.v2.GetProjectIntelligenceConfigRequest"
10436    }
10437}
10438
10439#[doc(hidden)]
10440impl<'de> serde::de::Deserialize<'de> for GetProjectIntelligenceConfigRequest {
10441    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10442    where
10443        D: serde::Deserializer<'de>,
10444    {
10445        #[allow(non_camel_case_types)]
10446        #[doc(hidden)]
10447        #[derive(PartialEq, Eq, Hash)]
10448        enum __FieldTag {
10449            __name,
10450            Unknown(std::string::String),
10451        }
10452        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
10453            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
10454            where
10455                D: serde::Deserializer<'de>,
10456            {
10457                struct Visitor;
10458                impl<'de> serde::de::Visitor<'de> for Visitor {
10459                    type Value = __FieldTag;
10460                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10461                        formatter.write_str("a field name for GetProjectIntelligenceConfigRequest")
10462                    }
10463                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
10464                    where
10465                        E: serde::de::Error,
10466                    {
10467                        use std::result::Result::Ok;
10468                        use std::string::ToString;
10469                        match value {
10470                            "name" => Ok(__FieldTag::__name),
10471                            _ => Ok(__FieldTag::Unknown(value.to_string())),
10472                        }
10473                    }
10474                }
10475                deserializer.deserialize_identifier(Visitor)
10476            }
10477        }
10478        struct Visitor;
10479        impl<'de> serde::de::Visitor<'de> for Visitor {
10480            type Value = GetProjectIntelligenceConfigRequest;
10481            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
10482                formatter.write_str("struct GetProjectIntelligenceConfigRequest")
10483            }
10484            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
10485            where
10486                A: serde::de::MapAccess<'de>,
10487            {
10488                #[allow(unused_imports)]
10489                use serde::de::Error;
10490                use std::option::Option::Some;
10491                let mut fields = std::collections::HashSet::new();
10492                let mut result = Self::Value::new();
10493                while let Some(tag) = map.next_key::<__FieldTag>()? {
10494                    #[allow(clippy::match_single_binding)]
10495                    match tag {
10496                        __FieldTag::__name => {
10497                            if !fields.insert(__FieldTag::__name) {
10498                                return std::result::Result::Err(A::Error::duplicate_field(
10499                                    "multiple values for name",
10500                                ));
10501                            }
10502                            result.name = map
10503                                .next_value::<std::option::Option<std::string::String>>()?
10504                                .unwrap_or_default();
10505                        }
10506                        __FieldTag::Unknown(key) => {
10507                            let value = map.next_value::<serde_json::Value>()?;
10508                            result._unknown_fields.insert(key, value);
10509                        }
10510                    }
10511                }
10512                std::result::Result::Ok(result)
10513            }
10514        }
10515        deserializer.deserialize_any(Visitor)
10516    }
10517}
10518
10519#[doc(hidden)]
10520impl serde::ser::Serialize for GetProjectIntelligenceConfigRequest {
10521    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
10522    where
10523        S: serde::ser::Serializer,
10524    {
10525        use serde::ser::SerializeMap;
10526        #[allow(unused_imports)]
10527        use std::option::Option::Some;
10528        let mut state = serializer.serialize_map(std::option::Option::None)?;
10529        if !self.name.is_empty() {
10530            state.serialize_entry("name", &self.name)?;
10531        }
10532        if !self._unknown_fields.is_empty() {
10533            for (key, value) in self._unknown_fields.iter() {
10534                state.serialize_entry(key, &value)?;
10535            }
10536        }
10537        state.end()
10538    }
10539}
10540
10541impl std::fmt::Debug for GetProjectIntelligenceConfigRequest {
10542    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
10543        let mut debug_struct = f.debug_struct("GetProjectIntelligenceConfigRequest");
10544        debug_struct.field("name", &self.name);
10545        if !self._unknown_fields.is_empty() {
10546            debug_struct.field("_unknown_fields", &self._unknown_fields);
10547        }
10548        debug_struct.finish()
10549    }
10550}