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, Debug, 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
150/// A folder resource. This resource can only exist in a hierarchical namespace
151/// enabled bucket.
152#[derive(Clone, Debug, Default, PartialEq)]
153#[non_exhaustive]
154pub struct Folder {
155    /// Identifier. The name of this folder.
156    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
157    pub name: std::string::String,
158
159    /// Output only. The version of the metadata for this folder. Used for
160    /// preconditions and for detecting changes in metadata.
161    pub metageneration: i64,
162
163    /// Output only. The creation time of the folder.
164    pub create_time: std::option::Option<wkt::Timestamp>,
165
166    /// Output only. The modification time of the folder.
167    pub update_time: std::option::Option<wkt::Timestamp>,
168
169    /// Output only. Only present if the folder is part of an ongoing RenameFolder
170    /// operation. Contains information which can be used to query the operation
171    /// status. The presence of this field also indicates all write operations are
172    /// blocked for this folder, including folder, managed folder, and object
173    /// operations.
174    pub pending_rename_info: std::option::Option<crate::model::PendingRenameInfo>,
175
176    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
177}
178
179impl Folder {
180    pub fn new() -> Self {
181        std::default::Default::default()
182    }
183
184    /// Sets the value of [name][crate::model::Folder::name].
185    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
186        self.name = v.into();
187        self
188    }
189
190    /// Sets the value of [metageneration][crate::model::Folder::metageneration].
191    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
192        self.metageneration = v.into();
193        self
194    }
195
196    /// Sets the value of [create_time][crate::model::Folder::create_time].
197    pub fn set_create_time<T>(mut self, v: T) -> Self
198    where
199        T: std::convert::Into<wkt::Timestamp>,
200    {
201        self.create_time = std::option::Option::Some(v.into());
202        self
203    }
204
205    /// Sets or clears the value of [create_time][crate::model::Folder::create_time].
206    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
207    where
208        T: std::convert::Into<wkt::Timestamp>,
209    {
210        self.create_time = v.map(|x| x.into());
211        self
212    }
213
214    /// Sets the value of [update_time][crate::model::Folder::update_time].
215    pub fn set_update_time<T>(mut self, v: T) -> Self
216    where
217        T: std::convert::Into<wkt::Timestamp>,
218    {
219        self.update_time = std::option::Option::Some(v.into());
220        self
221    }
222
223    /// Sets or clears the value of [update_time][crate::model::Folder::update_time].
224    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
225    where
226        T: std::convert::Into<wkt::Timestamp>,
227    {
228        self.update_time = v.map(|x| x.into());
229        self
230    }
231
232    /// Sets the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
233    pub fn set_pending_rename_info<T>(mut self, v: T) -> Self
234    where
235        T: std::convert::Into<crate::model::PendingRenameInfo>,
236    {
237        self.pending_rename_info = std::option::Option::Some(v.into());
238        self
239    }
240
241    /// Sets or clears the value of [pending_rename_info][crate::model::Folder::pending_rename_info].
242    pub fn set_or_clear_pending_rename_info<T>(mut self, v: std::option::Option<T>) -> Self
243    where
244        T: std::convert::Into<crate::model::PendingRenameInfo>,
245    {
246        self.pending_rename_info = v.map(|x| x.into());
247        self
248    }
249}
250
251impl wkt::message::Message for Folder {
252    fn typename() -> &'static str {
253        "type.googleapis.com/google.storage.control.v2.Folder"
254    }
255}
256
257#[doc(hidden)]
258impl<'de> serde::de::Deserialize<'de> for Folder {
259    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
260    where
261        D: serde::Deserializer<'de>,
262    {
263        #[allow(non_camel_case_types)]
264        #[doc(hidden)]
265        #[derive(PartialEq, Eq, Hash)]
266        enum __FieldTag {
267            __name,
268            __metageneration,
269            __create_time,
270            __update_time,
271            __pending_rename_info,
272            Unknown(std::string::String),
273        }
274        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
275            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
276            where
277                D: serde::Deserializer<'de>,
278            {
279                struct Visitor;
280                impl<'de> serde::de::Visitor<'de> for Visitor {
281                    type Value = __FieldTag;
282                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
283                        formatter.write_str("a field name for Folder")
284                    }
285                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
286                    where
287                        E: serde::de::Error,
288                    {
289                        use std::result::Result::Ok;
290                        use std::string::ToString;
291                        match value {
292                            "name" => Ok(__FieldTag::__name),
293                            "metageneration" => Ok(__FieldTag::__metageneration),
294                            "createTime" => Ok(__FieldTag::__create_time),
295                            "create_time" => Ok(__FieldTag::__create_time),
296                            "updateTime" => Ok(__FieldTag::__update_time),
297                            "update_time" => Ok(__FieldTag::__update_time),
298                            "pendingRenameInfo" => Ok(__FieldTag::__pending_rename_info),
299                            "pending_rename_info" => Ok(__FieldTag::__pending_rename_info),
300                            _ => Ok(__FieldTag::Unknown(value.to_string())),
301                        }
302                    }
303                }
304                deserializer.deserialize_identifier(Visitor)
305            }
306        }
307        struct Visitor;
308        impl<'de> serde::de::Visitor<'de> for Visitor {
309            type Value = Folder;
310            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
311                formatter.write_str("struct Folder")
312            }
313            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
314            where
315                A: serde::de::MapAccess<'de>,
316            {
317                #[allow(unused_imports)]
318                use serde::de::Error;
319                use std::option::Option::Some;
320                let mut fields = std::collections::HashSet::new();
321                let mut result = Self::Value::new();
322                while let Some(tag) = map.next_key::<__FieldTag>()? {
323                    #[allow(clippy::match_single_binding)]
324                    match tag {
325                        __FieldTag::__name => {
326                            if !fields.insert(__FieldTag::__name) {
327                                return std::result::Result::Err(A::Error::duplicate_field(
328                                    "multiple values for name",
329                                ));
330                            }
331                            result.name = map
332                                .next_value::<std::option::Option<std::string::String>>()?
333                                .unwrap_or_default();
334                        }
335                        __FieldTag::__metageneration => {
336                            if !fields.insert(__FieldTag::__metageneration) {
337                                return std::result::Result::Err(A::Error::duplicate_field(
338                                    "multiple values for metageneration",
339                                ));
340                            }
341                            struct __With(std::option::Option<i64>);
342                            impl<'de> serde::de::Deserialize<'de> for __With {
343                                fn deserialize<D>(
344                                    deserializer: D,
345                                ) -> std::result::Result<Self, D::Error>
346                                where
347                                    D: serde::de::Deserializer<'de>,
348                                {
349                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
350                                }
351                            }
352                            result.metageneration =
353                                map.next_value::<__With>()?.0.unwrap_or_default();
354                        }
355                        __FieldTag::__create_time => {
356                            if !fields.insert(__FieldTag::__create_time) {
357                                return std::result::Result::Err(A::Error::duplicate_field(
358                                    "multiple values for create_time",
359                                ));
360                            }
361                            result.create_time =
362                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
363                        }
364                        __FieldTag::__update_time => {
365                            if !fields.insert(__FieldTag::__update_time) {
366                                return std::result::Result::Err(A::Error::duplicate_field(
367                                    "multiple values for update_time",
368                                ));
369                            }
370                            result.update_time =
371                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
372                        }
373                        __FieldTag::__pending_rename_info => {
374                            if !fields.insert(__FieldTag::__pending_rename_info) {
375                                return std::result::Result::Err(A::Error::duplicate_field(
376                                    "multiple values for pending_rename_info",
377                                ));
378                            }
379                            result.pending_rename_info = map
380                                .next_value::<std::option::Option<crate::model::PendingRenameInfo>>(
381                                )?;
382                        }
383                        __FieldTag::Unknown(key) => {
384                            let value = map.next_value::<serde_json::Value>()?;
385                            result._unknown_fields.insert(key, value);
386                        }
387                    }
388                }
389                std::result::Result::Ok(result)
390            }
391        }
392        deserializer.deserialize_any(Visitor)
393    }
394}
395
396#[doc(hidden)]
397impl serde::ser::Serialize for Folder {
398    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
399    where
400        S: serde::ser::Serializer,
401    {
402        use serde::ser::SerializeMap;
403        #[allow(unused_imports)]
404        use std::option::Option::Some;
405        let mut state = serializer.serialize_map(std::option::Option::None)?;
406        if !self.name.is_empty() {
407            state.serialize_entry("name", &self.name)?;
408        }
409        if !wkt::internal::is_default(&self.metageneration) {
410            struct __With<'a>(&'a i64);
411            impl<'a> serde::ser::Serialize for __With<'a> {
412                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
413                where
414                    S: serde::ser::Serializer,
415                {
416                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
417                }
418            }
419            state.serialize_entry("metageneration", &__With(&self.metageneration))?;
420        }
421        if self.create_time.is_some() {
422            state.serialize_entry("createTime", &self.create_time)?;
423        }
424        if self.update_time.is_some() {
425            state.serialize_entry("updateTime", &self.update_time)?;
426        }
427        if self.pending_rename_info.is_some() {
428            state.serialize_entry("pendingRenameInfo", &self.pending_rename_info)?;
429        }
430        if !self._unknown_fields.is_empty() {
431            for (key, value) in self._unknown_fields.iter() {
432                state.serialize_entry(key, &value)?;
433            }
434        }
435        state.end()
436    }
437}
438
439/// Request message for GetFolder. This operation is only applicable to a
440/// hierarchical namespace enabled bucket.
441#[derive(Clone, Debug, Default, PartialEq)]
442#[non_exhaustive]
443pub struct GetFolderRequest {
444    /// Required. Name of the folder.
445    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
446    pub name: std::string::String,
447
448    /// Makes the operation only succeed conditional on whether the folder's
449    /// current metageneration matches the given value.
450    pub if_metageneration_match: std::option::Option<i64>,
451
452    /// Makes the operation only succeed conditional on whether the folder's
453    /// current metageneration does not match the given value.
454    pub if_metageneration_not_match: std::option::Option<i64>,
455
456    /// Optional. A unique identifier for this request. UUID is the recommended
457    /// format, but other formats are still accepted.
458    pub request_id: std::string::String,
459
460    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
461}
462
463impl GetFolderRequest {
464    pub fn new() -> Self {
465        std::default::Default::default()
466    }
467
468    /// Sets the value of [name][crate::model::GetFolderRequest::name].
469    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
470        self.name = v.into();
471        self
472    }
473
474    /// Sets the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
475    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
476    where
477        T: std::convert::Into<i64>,
478    {
479        self.if_metageneration_match = std::option::Option::Some(v.into());
480        self
481    }
482
483    /// Sets or clears the value of [if_metageneration_match][crate::model::GetFolderRequest::if_metageneration_match].
484    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
485    where
486        T: std::convert::Into<i64>,
487    {
488        self.if_metageneration_match = v.map(|x| x.into());
489        self
490    }
491
492    /// Sets the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
493    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
494    where
495        T: std::convert::Into<i64>,
496    {
497        self.if_metageneration_not_match = std::option::Option::Some(v.into());
498        self
499    }
500
501    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetFolderRequest::if_metageneration_not_match].
502    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
503    where
504        T: std::convert::Into<i64>,
505    {
506        self.if_metageneration_not_match = v.map(|x| x.into());
507        self
508    }
509
510    /// Sets the value of [request_id][crate::model::GetFolderRequest::request_id].
511    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
512        self.request_id = v.into();
513        self
514    }
515}
516
517impl wkt::message::Message for GetFolderRequest {
518    fn typename() -> &'static str {
519        "type.googleapis.com/google.storage.control.v2.GetFolderRequest"
520    }
521}
522
523#[doc(hidden)]
524impl<'de> serde::de::Deserialize<'de> for GetFolderRequest {
525    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
526    where
527        D: serde::Deserializer<'de>,
528    {
529        #[allow(non_camel_case_types)]
530        #[doc(hidden)]
531        #[derive(PartialEq, Eq, Hash)]
532        enum __FieldTag {
533            __name,
534            __if_metageneration_match,
535            __if_metageneration_not_match,
536            __request_id,
537            Unknown(std::string::String),
538        }
539        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
540            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
541            where
542                D: serde::Deserializer<'de>,
543            {
544                struct Visitor;
545                impl<'de> serde::de::Visitor<'de> for Visitor {
546                    type Value = __FieldTag;
547                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
548                        formatter.write_str("a field name for GetFolderRequest")
549                    }
550                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
551                    where
552                        E: serde::de::Error,
553                    {
554                        use std::result::Result::Ok;
555                        use std::string::ToString;
556                        match value {
557                            "name" => Ok(__FieldTag::__name),
558                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
559                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
560                            "ifMetagenerationNotMatch" => {
561                                Ok(__FieldTag::__if_metageneration_not_match)
562                            }
563                            "if_metageneration_not_match" => {
564                                Ok(__FieldTag::__if_metageneration_not_match)
565                            }
566                            "requestId" => Ok(__FieldTag::__request_id),
567                            "request_id" => Ok(__FieldTag::__request_id),
568                            _ => Ok(__FieldTag::Unknown(value.to_string())),
569                        }
570                    }
571                }
572                deserializer.deserialize_identifier(Visitor)
573            }
574        }
575        struct Visitor;
576        impl<'de> serde::de::Visitor<'de> for Visitor {
577            type Value = GetFolderRequest;
578            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
579                formatter.write_str("struct GetFolderRequest")
580            }
581            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
582            where
583                A: serde::de::MapAccess<'de>,
584            {
585                #[allow(unused_imports)]
586                use serde::de::Error;
587                use std::option::Option::Some;
588                let mut fields = std::collections::HashSet::new();
589                let mut result = Self::Value::new();
590                while let Some(tag) = map.next_key::<__FieldTag>()? {
591                    #[allow(clippy::match_single_binding)]
592                    match tag {
593                        __FieldTag::__name => {
594                            if !fields.insert(__FieldTag::__name) {
595                                return std::result::Result::Err(A::Error::duplicate_field(
596                                    "multiple values for name",
597                                ));
598                            }
599                            result.name = map
600                                .next_value::<std::option::Option<std::string::String>>()?
601                                .unwrap_or_default();
602                        }
603                        __FieldTag::__if_metageneration_match => {
604                            if !fields.insert(__FieldTag::__if_metageneration_match) {
605                                return std::result::Result::Err(A::Error::duplicate_field(
606                                    "multiple values for if_metageneration_match",
607                                ));
608                            }
609                            struct __With(std::option::Option<i64>);
610                            impl<'de> serde::de::Deserialize<'de> for __With {
611                                fn deserialize<D>(
612                                    deserializer: D,
613                                ) -> std::result::Result<Self, D::Error>
614                                where
615                                    D: serde::de::Deserializer<'de>,
616                                {
617                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
618                                }
619                            }
620                            result.if_metageneration_match = map.next_value::<__With>()?.0;
621                        }
622                        __FieldTag::__if_metageneration_not_match => {
623                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
624                                return std::result::Result::Err(A::Error::duplicate_field(
625                                    "multiple values for if_metageneration_not_match",
626                                ));
627                            }
628                            struct __With(std::option::Option<i64>);
629                            impl<'de> serde::de::Deserialize<'de> for __With {
630                                fn deserialize<D>(
631                                    deserializer: D,
632                                ) -> std::result::Result<Self, D::Error>
633                                where
634                                    D: serde::de::Deserializer<'de>,
635                                {
636                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
637                                }
638                            }
639                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
640                        }
641                        __FieldTag::__request_id => {
642                            if !fields.insert(__FieldTag::__request_id) {
643                                return std::result::Result::Err(A::Error::duplicate_field(
644                                    "multiple values for request_id",
645                                ));
646                            }
647                            result.request_id = map
648                                .next_value::<std::option::Option<std::string::String>>()?
649                                .unwrap_or_default();
650                        }
651                        __FieldTag::Unknown(key) => {
652                            let value = map.next_value::<serde_json::Value>()?;
653                            result._unknown_fields.insert(key, value);
654                        }
655                    }
656                }
657                std::result::Result::Ok(result)
658            }
659        }
660        deserializer.deserialize_any(Visitor)
661    }
662}
663
664#[doc(hidden)]
665impl serde::ser::Serialize for GetFolderRequest {
666    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
667    where
668        S: serde::ser::Serializer,
669    {
670        use serde::ser::SerializeMap;
671        #[allow(unused_imports)]
672        use std::option::Option::Some;
673        let mut state = serializer.serialize_map(std::option::Option::None)?;
674        if !self.name.is_empty() {
675            state.serialize_entry("name", &self.name)?;
676        }
677        if self.if_metageneration_match.is_some() {
678            struct __With<'a>(&'a std::option::Option<i64>);
679            impl<'a> serde::ser::Serialize for __With<'a> {
680                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
681                where
682                    S: serde::ser::Serializer,
683                {
684                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
685                        self.0, serializer,
686                    )
687                }
688            }
689            state.serialize_entry(
690                "ifMetagenerationMatch",
691                &__With(&self.if_metageneration_match),
692            )?;
693        }
694        if self.if_metageneration_not_match.is_some() {
695            struct __With<'a>(&'a std::option::Option<i64>);
696            impl<'a> serde::ser::Serialize for __With<'a> {
697                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
698                where
699                    S: serde::ser::Serializer,
700                {
701                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
702                        self.0, serializer,
703                    )
704                }
705            }
706            state.serialize_entry(
707                "ifMetagenerationNotMatch",
708                &__With(&self.if_metageneration_not_match),
709            )?;
710        }
711        if !self.request_id.is_empty() {
712            state.serialize_entry("requestId", &self.request_id)?;
713        }
714        if !self._unknown_fields.is_empty() {
715            for (key, value) in self._unknown_fields.iter() {
716                state.serialize_entry(key, &value)?;
717            }
718        }
719        state.end()
720    }
721}
722
723/// Request message for CreateFolder. This operation is only applicable to a
724/// hierarchical namespace enabled bucket.
725#[derive(Clone, Debug, Default, PartialEq)]
726#[non_exhaustive]
727pub struct CreateFolderRequest {
728    /// Required. Name of the bucket in which the folder will reside. The bucket
729    /// must be a hierarchical namespace enabled bucket.
730    pub parent: std::string::String,
731
732    /// Required. Properties of the new folder being created.
733    /// The bucket and name of the folder are specified in the parent and folder_id
734    /// fields, respectively. Populating those fields in `folder` will result in an
735    /// error.
736    pub folder: std::option::Option<crate::model::Folder>,
737
738    /// Required. The full name of a folder, including all its parent folders.
739    /// Folders use single '/' characters as a delimiter.
740    /// The folder_id must end with a slash.
741    /// For example, the folder_id of "books/biographies/" would create a new
742    /// "biographies/" folder under the "books/" folder.
743    pub folder_id: std::string::String,
744
745    /// Optional. If true, parent folder doesn't have to be present and all missing
746    /// ancestor folders will be created atomically.
747    pub recursive: bool,
748
749    /// Optional. A unique identifier for this request. UUID is the recommended
750    /// format, but other formats are still accepted.
751    pub request_id: std::string::String,
752
753    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
754}
755
756impl CreateFolderRequest {
757    pub fn new() -> Self {
758        std::default::Default::default()
759    }
760
761    /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
762    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
763        self.parent = v.into();
764        self
765    }
766
767    /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
768    pub fn set_folder<T>(mut self, v: T) -> Self
769    where
770        T: std::convert::Into<crate::model::Folder>,
771    {
772        self.folder = std::option::Option::Some(v.into());
773        self
774    }
775
776    /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
777    pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
778    where
779        T: std::convert::Into<crate::model::Folder>,
780    {
781        self.folder = v.map(|x| x.into());
782        self
783    }
784
785    /// Sets the value of [folder_id][crate::model::CreateFolderRequest::folder_id].
786    pub fn set_folder_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
787        self.folder_id = v.into();
788        self
789    }
790
791    /// Sets the value of [recursive][crate::model::CreateFolderRequest::recursive].
792    pub fn set_recursive<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
793        self.recursive = v.into();
794        self
795    }
796
797    /// Sets the value of [request_id][crate::model::CreateFolderRequest::request_id].
798    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
799        self.request_id = v.into();
800        self
801    }
802}
803
804impl wkt::message::Message for CreateFolderRequest {
805    fn typename() -> &'static str {
806        "type.googleapis.com/google.storage.control.v2.CreateFolderRequest"
807    }
808}
809
810#[doc(hidden)]
811impl<'de> serde::de::Deserialize<'de> for CreateFolderRequest {
812    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
813    where
814        D: serde::Deserializer<'de>,
815    {
816        #[allow(non_camel_case_types)]
817        #[doc(hidden)]
818        #[derive(PartialEq, Eq, Hash)]
819        enum __FieldTag {
820            __parent,
821            __folder,
822            __folder_id,
823            __recursive,
824            __request_id,
825            Unknown(std::string::String),
826        }
827        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
828            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
829            where
830                D: serde::Deserializer<'de>,
831            {
832                struct Visitor;
833                impl<'de> serde::de::Visitor<'de> for Visitor {
834                    type Value = __FieldTag;
835                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
836                        formatter.write_str("a field name for CreateFolderRequest")
837                    }
838                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
839                    where
840                        E: serde::de::Error,
841                    {
842                        use std::result::Result::Ok;
843                        use std::string::ToString;
844                        match value {
845                            "parent" => Ok(__FieldTag::__parent),
846                            "folder" => Ok(__FieldTag::__folder),
847                            "folderId" => Ok(__FieldTag::__folder_id),
848                            "folder_id" => Ok(__FieldTag::__folder_id),
849                            "recursive" => Ok(__FieldTag::__recursive),
850                            "requestId" => Ok(__FieldTag::__request_id),
851                            "request_id" => Ok(__FieldTag::__request_id),
852                            _ => Ok(__FieldTag::Unknown(value.to_string())),
853                        }
854                    }
855                }
856                deserializer.deserialize_identifier(Visitor)
857            }
858        }
859        struct Visitor;
860        impl<'de> serde::de::Visitor<'de> for Visitor {
861            type Value = CreateFolderRequest;
862            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
863                formatter.write_str("struct CreateFolderRequest")
864            }
865            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
866            where
867                A: serde::de::MapAccess<'de>,
868            {
869                #[allow(unused_imports)]
870                use serde::de::Error;
871                use std::option::Option::Some;
872                let mut fields = std::collections::HashSet::new();
873                let mut result = Self::Value::new();
874                while let Some(tag) = map.next_key::<__FieldTag>()? {
875                    #[allow(clippy::match_single_binding)]
876                    match tag {
877                        __FieldTag::__parent => {
878                            if !fields.insert(__FieldTag::__parent) {
879                                return std::result::Result::Err(A::Error::duplicate_field(
880                                    "multiple values for parent",
881                                ));
882                            }
883                            result.parent = map
884                                .next_value::<std::option::Option<std::string::String>>()?
885                                .unwrap_or_default();
886                        }
887                        __FieldTag::__folder => {
888                            if !fields.insert(__FieldTag::__folder) {
889                                return std::result::Result::Err(A::Error::duplicate_field(
890                                    "multiple values for folder",
891                                ));
892                            }
893                            result.folder =
894                                map.next_value::<std::option::Option<crate::model::Folder>>()?;
895                        }
896                        __FieldTag::__folder_id => {
897                            if !fields.insert(__FieldTag::__folder_id) {
898                                return std::result::Result::Err(A::Error::duplicate_field(
899                                    "multiple values for folder_id",
900                                ));
901                            }
902                            result.folder_id = map
903                                .next_value::<std::option::Option<std::string::String>>()?
904                                .unwrap_or_default();
905                        }
906                        __FieldTag::__recursive => {
907                            if !fields.insert(__FieldTag::__recursive) {
908                                return std::result::Result::Err(A::Error::duplicate_field(
909                                    "multiple values for recursive",
910                                ));
911                            }
912                            result.recursive = map
913                                .next_value::<std::option::Option<bool>>()?
914                                .unwrap_or_default();
915                        }
916                        __FieldTag::__request_id => {
917                            if !fields.insert(__FieldTag::__request_id) {
918                                return std::result::Result::Err(A::Error::duplicate_field(
919                                    "multiple values for request_id",
920                                ));
921                            }
922                            result.request_id = map
923                                .next_value::<std::option::Option<std::string::String>>()?
924                                .unwrap_or_default();
925                        }
926                        __FieldTag::Unknown(key) => {
927                            let value = map.next_value::<serde_json::Value>()?;
928                            result._unknown_fields.insert(key, value);
929                        }
930                    }
931                }
932                std::result::Result::Ok(result)
933            }
934        }
935        deserializer.deserialize_any(Visitor)
936    }
937}
938
939#[doc(hidden)]
940impl serde::ser::Serialize for CreateFolderRequest {
941    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
942    where
943        S: serde::ser::Serializer,
944    {
945        use serde::ser::SerializeMap;
946        #[allow(unused_imports)]
947        use std::option::Option::Some;
948        let mut state = serializer.serialize_map(std::option::Option::None)?;
949        if !self.parent.is_empty() {
950            state.serialize_entry("parent", &self.parent)?;
951        }
952        if self.folder.is_some() {
953            state.serialize_entry("folder", &self.folder)?;
954        }
955        if !self.folder_id.is_empty() {
956            state.serialize_entry("folderId", &self.folder_id)?;
957        }
958        if !wkt::internal::is_default(&self.recursive) {
959            state.serialize_entry("recursive", &self.recursive)?;
960        }
961        if !self.request_id.is_empty() {
962            state.serialize_entry("requestId", &self.request_id)?;
963        }
964        if !self._unknown_fields.is_empty() {
965            for (key, value) in self._unknown_fields.iter() {
966                state.serialize_entry(key, &value)?;
967            }
968        }
969        state.end()
970    }
971}
972
973/// Request message for DeleteFolder. This operation is only applicable to a
974/// hierarchical namespace enabled bucket.
975#[derive(Clone, Debug, Default, PartialEq)]
976#[non_exhaustive]
977pub struct DeleteFolderRequest {
978    /// Required. Name of the folder.
979    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
980    pub name: std::string::String,
981
982    /// Makes the operation only succeed conditional on whether the folder's
983    /// current metageneration matches the given value.
984    pub if_metageneration_match: std::option::Option<i64>,
985
986    /// Makes the operation only succeed conditional on whether the folder's
987    /// current metageneration does not match the given value.
988    pub if_metageneration_not_match: std::option::Option<i64>,
989
990    /// Optional. A unique identifier for this request. UUID is the recommended
991    /// format, but other formats are still accepted.
992    pub request_id: std::string::String,
993
994    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
995}
996
997impl DeleteFolderRequest {
998    pub fn new() -> Self {
999        std::default::Default::default()
1000    }
1001
1002    /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
1003    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1004        self.name = v.into();
1005        self
1006    }
1007
1008    /// Sets the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
1009    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1010    where
1011        T: std::convert::Into<i64>,
1012    {
1013        self.if_metageneration_match = std::option::Option::Some(v.into());
1014        self
1015    }
1016
1017    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteFolderRequest::if_metageneration_match].
1018    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1019    where
1020        T: std::convert::Into<i64>,
1021    {
1022        self.if_metageneration_match = v.map(|x| x.into());
1023        self
1024    }
1025
1026    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
1027    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1028    where
1029        T: std::convert::Into<i64>,
1030    {
1031        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1032        self
1033    }
1034
1035    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteFolderRequest::if_metageneration_not_match].
1036    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1037    where
1038        T: std::convert::Into<i64>,
1039    {
1040        self.if_metageneration_not_match = v.map(|x| x.into());
1041        self
1042    }
1043
1044    /// Sets the value of [request_id][crate::model::DeleteFolderRequest::request_id].
1045    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1046        self.request_id = v.into();
1047        self
1048    }
1049}
1050
1051impl wkt::message::Message for DeleteFolderRequest {
1052    fn typename() -> &'static str {
1053        "type.googleapis.com/google.storage.control.v2.DeleteFolderRequest"
1054    }
1055}
1056
1057#[doc(hidden)]
1058impl<'de> serde::de::Deserialize<'de> for DeleteFolderRequest {
1059    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1060    where
1061        D: serde::Deserializer<'de>,
1062    {
1063        #[allow(non_camel_case_types)]
1064        #[doc(hidden)]
1065        #[derive(PartialEq, Eq, Hash)]
1066        enum __FieldTag {
1067            __name,
1068            __if_metageneration_match,
1069            __if_metageneration_not_match,
1070            __request_id,
1071            Unknown(std::string::String),
1072        }
1073        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1074            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1075            where
1076                D: serde::Deserializer<'de>,
1077            {
1078                struct Visitor;
1079                impl<'de> serde::de::Visitor<'de> for Visitor {
1080                    type Value = __FieldTag;
1081                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1082                        formatter.write_str("a field name for DeleteFolderRequest")
1083                    }
1084                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1085                    where
1086                        E: serde::de::Error,
1087                    {
1088                        use std::result::Result::Ok;
1089                        use std::string::ToString;
1090                        match value {
1091                            "name" => Ok(__FieldTag::__name),
1092                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
1093                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
1094                            "ifMetagenerationNotMatch" => {
1095                                Ok(__FieldTag::__if_metageneration_not_match)
1096                            }
1097                            "if_metageneration_not_match" => {
1098                                Ok(__FieldTag::__if_metageneration_not_match)
1099                            }
1100                            "requestId" => Ok(__FieldTag::__request_id),
1101                            "request_id" => Ok(__FieldTag::__request_id),
1102                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1103                        }
1104                    }
1105                }
1106                deserializer.deserialize_identifier(Visitor)
1107            }
1108        }
1109        struct Visitor;
1110        impl<'de> serde::de::Visitor<'de> for Visitor {
1111            type Value = DeleteFolderRequest;
1112            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1113                formatter.write_str("struct DeleteFolderRequest")
1114            }
1115            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1116            where
1117                A: serde::de::MapAccess<'de>,
1118            {
1119                #[allow(unused_imports)]
1120                use serde::de::Error;
1121                use std::option::Option::Some;
1122                let mut fields = std::collections::HashSet::new();
1123                let mut result = Self::Value::new();
1124                while let Some(tag) = map.next_key::<__FieldTag>()? {
1125                    #[allow(clippy::match_single_binding)]
1126                    match tag {
1127                        __FieldTag::__name => {
1128                            if !fields.insert(__FieldTag::__name) {
1129                                return std::result::Result::Err(A::Error::duplicate_field(
1130                                    "multiple values for name",
1131                                ));
1132                            }
1133                            result.name = map
1134                                .next_value::<std::option::Option<std::string::String>>()?
1135                                .unwrap_or_default();
1136                        }
1137                        __FieldTag::__if_metageneration_match => {
1138                            if !fields.insert(__FieldTag::__if_metageneration_match) {
1139                                return std::result::Result::Err(A::Error::duplicate_field(
1140                                    "multiple values for if_metageneration_match",
1141                                ));
1142                            }
1143                            struct __With(std::option::Option<i64>);
1144                            impl<'de> serde::de::Deserialize<'de> for __With {
1145                                fn deserialize<D>(
1146                                    deserializer: D,
1147                                ) -> std::result::Result<Self, D::Error>
1148                                where
1149                                    D: serde::de::Deserializer<'de>,
1150                                {
1151                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
1152                                }
1153                            }
1154                            result.if_metageneration_match = map.next_value::<__With>()?.0;
1155                        }
1156                        __FieldTag::__if_metageneration_not_match => {
1157                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
1158                                return std::result::Result::Err(A::Error::duplicate_field(
1159                                    "multiple values for if_metageneration_not_match",
1160                                ));
1161                            }
1162                            struct __With(std::option::Option<i64>);
1163                            impl<'de> serde::de::Deserialize<'de> for __With {
1164                                fn deserialize<D>(
1165                                    deserializer: D,
1166                                ) -> std::result::Result<Self, D::Error>
1167                                where
1168                                    D: serde::de::Deserializer<'de>,
1169                                {
1170                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
1171                                }
1172                            }
1173                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
1174                        }
1175                        __FieldTag::__request_id => {
1176                            if !fields.insert(__FieldTag::__request_id) {
1177                                return std::result::Result::Err(A::Error::duplicate_field(
1178                                    "multiple values for request_id",
1179                                ));
1180                            }
1181                            result.request_id = map
1182                                .next_value::<std::option::Option<std::string::String>>()?
1183                                .unwrap_or_default();
1184                        }
1185                        __FieldTag::Unknown(key) => {
1186                            let value = map.next_value::<serde_json::Value>()?;
1187                            result._unknown_fields.insert(key, value);
1188                        }
1189                    }
1190                }
1191                std::result::Result::Ok(result)
1192            }
1193        }
1194        deserializer.deserialize_any(Visitor)
1195    }
1196}
1197
1198#[doc(hidden)]
1199impl serde::ser::Serialize for DeleteFolderRequest {
1200    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1201    where
1202        S: serde::ser::Serializer,
1203    {
1204        use serde::ser::SerializeMap;
1205        #[allow(unused_imports)]
1206        use std::option::Option::Some;
1207        let mut state = serializer.serialize_map(std::option::Option::None)?;
1208        if !self.name.is_empty() {
1209            state.serialize_entry("name", &self.name)?;
1210        }
1211        if self.if_metageneration_match.is_some() {
1212            struct __With<'a>(&'a std::option::Option<i64>);
1213            impl<'a> serde::ser::Serialize for __With<'a> {
1214                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1215                where
1216                    S: serde::ser::Serializer,
1217                {
1218                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
1219                        self.0, serializer,
1220                    )
1221                }
1222            }
1223            state.serialize_entry(
1224                "ifMetagenerationMatch",
1225                &__With(&self.if_metageneration_match),
1226            )?;
1227        }
1228        if self.if_metageneration_not_match.is_some() {
1229            struct __With<'a>(&'a std::option::Option<i64>);
1230            impl<'a> serde::ser::Serialize for __With<'a> {
1231                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1232                where
1233                    S: serde::ser::Serializer,
1234                {
1235                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
1236                        self.0, serializer,
1237                    )
1238                }
1239            }
1240            state.serialize_entry(
1241                "ifMetagenerationNotMatch",
1242                &__With(&self.if_metageneration_not_match),
1243            )?;
1244        }
1245        if !self.request_id.is_empty() {
1246            state.serialize_entry("requestId", &self.request_id)?;
1247        }
1248        if !self._unknown_fields.is_empty() {
1249            for (key, value) in self._unknown_fields.iter() {
1250                state.serialize_entry(key, &value)?;
1251            }
1252        }
1253        state.end()
1254    }
1255}
1256
1257/// Request message for ListFolders. This operation is only applicable to a
1258/// hierarchical namespace enabled bucket.
1259#[derive(Clone, Debug, Default, PartialEq)]
1260#[non_exhaustive]
1261pub struct ListFoldersRequest {
1262    /// Required. Name of the bucket in which to look for folders. The bucket must
1263    /// be a hierarchical namespace enabled bucket.
1264    pub parent: std::string::String,
1265
1266    /// Optional. Maximum number of folders to return in a single response. The
1267    /// service will use this parameter or 1,000 items, whichever is smaller.
1268    pub page_size: i32,
1269
1270    /// Optional. A previously-returned page token representing part of the larger
1271    /// set of results to view.
1272    pub page_token: std::string::String,
1273
1274    /// Optional. Filter results to folders whose names begin with this prefix.
1275    /// If set, the value must either be an empty string or end with a '/'.
1276    pub prefix: std::string::String,
1277
1278    /// Optional. If set, returns results in a directory-like mode. The results
1279    /// will only include folders that either exactly match the above prefix, or
1280    /// are one level below the prefix. The only supported value is '/'.
1281    pub delimiter: std::string::String,
1282
1283    /// Optional. Filter results to folders whose names are lexicographically equal
1284    /// to or after lexicographic_start. If lexicographic_end is also set, the
1285    /// folders listed have names between lexicographic_start (inclusive) and
1286    /// lexicographic_end (exclusive).
1287    pub lexicographic_start: std::string::String,
1288
1289    /// Optional. Filter results to folders whose names are lexicographically
1290    /// before lexicographic_end. If lexicographic_start is also set, the folders
1291    /// listed have names between lexicographic_start (inclusive) and
1292    /// lexicographic_end (exclusive).
1293    pub lexicographic_end: std::string::String,
1294
1295    /// Optional. A unique identifier for this request. UUID is the recommended
1296    /// format, but other formats are still accepted.
1297    pub request_id: std::string::String,
1298
1299    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1300}
1301
1302impl ListFoldersRequest {
1303    pub fn new() -> Self {
1304        std::default::Default::default()
1305    }
1306
1307    /// Sets the value of [parent][crate::model::ListFoldersRequest::parent].
1308    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1309        self.parent = v.into();
1310        self
1311    }
1312
1313    /// Sets the value of [page_size][crate::model::ListFoldersRequest::page_size].
1314    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
1315        self.page_size = v.into();
1316        self
1317    }
1318
1319    /// Sets the value of [page_token][crate::model::ListFoldersRequest::page_token].
1320    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1321        self.page_token = v.into();
1322        self
1323    }
1324
1325    /// Sets the value of [prefix][crate::model::ListFoldersRequest::prefix].
1326    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1327        self.prefix = v.into();
1328        self
1329    }
1330
1331    /// Sets the value of [delimiter][crate::model::ListFoldersRequest::delimiter].
1332    pub fn set_delimiter<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1333        self.delimiter = v.into();
1334        self
1335    }
1336
1337    /// Sets the value of [lexicographic_start][crate::model::ListFoldersRequest::lexicographic_start].
1338    pub fn set_lexicographic_start<T: std::convert::Into<std::string::String>>(
1339        mut self,
1340        v: T,
1341    ) -> Self {
1342        self.lexicographic_start = v.into();
1343        self
1344    }
1345
1346    /// Sets the value of [lexicographic_end][crate::model::ListFoldersRequest::lexicographic_end].
1347    pub fn set_lexicographic_end<T: std::convert::Into<std::string::String>>(
1348        mut self,
1349        v: T,
1350    ) -> Self {
1351        self.lexicographic_end = v.into();
1352        self
1353    }
1354
1355    /// Sets the value of [request_id][crate::model::ListFoldersRequest::request_id].
1356    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1357        self.request_id = v.into();
1358        self
1359    }
1360}
1361
1362impl wkt::message::Message for ListFoldersRequest {
1363    fn typename() -> &'static str {
1364        "type.googleapis.com/google.storage.control.v2.ListFoldersRequest"
1365    }
1366}
1367
1368#[doc(hidden)]
1369impl<'de> serde::de::Deserialize<'de> for ListFoldersRequest {
1370    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1371    where
1372        D: serde::Deserializer<'de>,
1373    {
1374        #[allow(non_camel_case_types)]
1375        #[doc(hidden)]
1376        #[derive(PartialEq, Eq, Hash)]
1377        enum __FieldTag {
1378            __parent,
1379            __page_size,
1380            __page_token,
1381            __prefix,
1382            __delimiter,
1383            __lexicographic_start,
1384            __lexicographic_end,
1385            __request_id,
1386            Unknown(std::string::String),
1387        }
1388        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1389            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1390            where
1391                D: serde::Deserializer<'de>,
1392            {
1393                struct Visitor;
1394                impl<'de> serde::de::Visitor<'de> for Visitor {
1395                    type Value = __FieldTag;
1396                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1397                        formatter.write_str("a field name for ListFoldersRequest")
1398                    }
1399                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1400                    where
1401                        E: serde::de::Error,
1402                    {
1403                        use std::result::Result::Ok;
1404                        use std::string::ToString;
1405                        match value {
1406                            "parent" => Ok(__FieldTag::__parent),
1407                            "pageSize" => Ok(__FieldTag::__page_size),
1408                            "page_size" => Ok(__FieldTag::__page_size),
1409                            "pageToken" => Ok(__FieldTag::__page_token),
1410                            "page_token" => Ok(__FieldTag::__page_token),
1411                            "prefix" => Ok(__FieldTag::__prefix),
1412                            "delimiter" => Ok(__FieldTag::__delimiter),
1413                            "lexicographicStart" => Ok(__FieldTag::__lexicographic_start),
1414                            "lexicographic_start" => Ok(__FieldTag::__lexicographic_start),
1415                            "lexicographicEnd" => Ok(__FieldTag::__lexicographic_end),
1416                            "lexicographic_end" => Ok(__FieldTag::__lexicographic_end),
1417                            "requestId" => Ok(__FieldTag::__request_id),
1418                            "request_id" => Ok(__FieldTag::__request_id),
1419                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1420                        }
1421                    }
1422                }
1423                deserializer.deserialize_identifier(Visitor)
1424            }
1425        }
1426        struct Visitor;
1427        impl<'de> serde::de::Visitor<'de> for Visitor {
1428            type Value = ListFoldersRequest;
1429            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1430                formatter.write_str("struct ListFoldersRequest")
1431            }
1432            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1433            where
1434                A: serde::de::MapAccess<'de>,
1435            {
1436                #[allow(unused_imports)]
1437                use serde::de::Error;
1438                use std::option::Option::Some;
1439                let mut fields = std::collections::HashSet::new();
1440                let mut result = Self::Value::new();
1441                while let Some(tag) = map.next_key::<__FieldTag>()? {
1442                    #[allow(clippy::match_single_binding)]
1443                    match tag {
1444                        __FieldTag::__parent => {
1445                            if !fields.insert(__FieldTag::__parent) {
1446                                return std::result::Result::Err(A::Error::duplicate_field(
1447                                    "multiple values for parent",
1448                                ));
1449                            }
1450                            result.parent = map
1451                                .next_value::<std::option::Option<std::string::String>>()?
1452                                .unwrap_or_default();
1453                        }
1454                        __FieldTag::__page_size => {
1455                            if !fields.insert(__FieldTag::__page_size) {
1456                                return std::result::Result::Err(A::Error::duplicate_field(
1457                                    "multiple values for page_size",
1458                                ));
1459                            }
1460                            struct __With(std::option::Option<i32>);
1461                            impl<'de> serde::de::Deserialize<'de> for __With {
1462                                fn deserialize<D>(
1463                                    deserializer: D,
1464                                ) -> std::result::Result<Self, D::Error>
1465                                where
1466                                    D: serde::de::Deserializer<'de>,
1467                                {
1468                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
1469                                }
1470                            }
1471                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
1472                        }
1473                        __FieldTag::__page_token => {
1474                            if !fields.insert(__FieldTag::__page_token) {
1475                                return std::result::Result::Err(A::Error::duplicate_field(
1476                                    "multiple values for page_token",
1477                                ));
1478                            }
1479                            result.page_token = map
1480                                .next_value::<std::option::Option<std::string::String>>()?
1481                                .unwrap_or_default();
1482                        }
1483                        __FieldTag::__prefix => {
1484                            if !fields.insert(__FieldTag::__prefix) {
1485                                return std::result::Result::Err(A::Error::duplicate_field(
1486                                    "multiple values for prefix",
1487                                ));
1488                            }
1489                            result.prefix = map
1490                                .next_value::<std::option::Option<std::string::String>>()?
1491                                .unwrap_or_default();
1492                        }
1493                        __FieldTag::__delimiter => {
1494                            if !fields.insert(__FieldTag::__delimiter) {
1495                                return std::result::Result::Err(A::Error::duplicate_field(
1496                                    "multiple values for delimiter",
1497                                ));
1498                            }
1499                            result.delimiter = map
1500                                .next_value::<std::option::Option<std::string::String>>()?
1501                                .unwrap_or_default();
1502                        }
1503                        __FieldTag::__lexicographic_start => {
1504                            if !fields.insert(__FieldTag::__lexicographic_start) {
1505                                return std::result::Result::Err(A::Error::duplicate_field(
1506                                    "multiple values for lexicographic_start",
1507                                ));
1508                            }
1509                            result.lexicographic_start = map
1510                                .next_value::<std::option::Option<std::string::String>>()?
1511                                .unwrap_or_default();
1512                        }
1513                        __FieldTag::__lexicographic_end => {
1514                            if !fields.insert(__FieldTag::__lexicographic_end) {
1515                                return std::result::Result::Err(A::Error::duplicate_field(
1516                                    "multiple values for lexicographic_end",
1517                                ));
1518                            }
1519                            result.lexicographic_end = map
1520                                .next_value::<std::option::Option<std::string::String>>()?
1521                                .unwrap_or_default();
1522                        }
1523                        __FieldTag::__request_id => {
1524                            if !fields.insert(__FieldTag::__request_id) {
1525                                return std::result::Result::Err(A::Error::duplicate_field(
1526                                    "multiple values for request_id",
1527                                ));
1528                            }
1529                            result.request_id = map
1530                                .next_value::<std::option::Option<std::string::String>>()?
1531                                .unwrap_or_default();
1532                        }
1533                        __FieldTag::Unknown(key) => {
1534                            let value = map.next_value::<serde_json::Value>()?;
1535                            result._unknown_fields.insert(key, value);
1536                        }
1537                    }
1538                }
1539                std::result::Result::Ok(result)
1540            }
1541        }
1542        deserializer.deserialize_any(Visitor)
1543    }
1544}
1545
1546#[doc(hidden)]
1547impl serde::ser::Serialize for ListFoldersRequest {
1548    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1549    where
1550        S: serde::ser::Serializer,
1551    {
1552        use serde::ser::SerializeMap;
1553        #[allow(unused_imports)]
1554        use std::option::Option::Some;
1555        let mut state = serializer.serialize_map(std::option::Option::None)?;
1556        if !self.parent.is_empty() {
1557            state.serialize_entry("parent", &self.parent)?;
1558        }
1559        if !wkt::internal::is_default(&self.page_size) {
1560            struct __With<'a>(&'a i32);
1561            impl<'a> serde::ser::Serialize for __With<'a> {
1562                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1563                where
1564                    S: serde::ser::Serializer,
1565                {
1566                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
1567                }
1568            }
1569            state.serialize_entry("pageSize", &__With(&self.page_size))?;
1570        }
1571        if !self.page_token.is_empty() {
1572            state.serialize_entry("pageToken", &self.page_token)?;
1573        }
1574        if !self.prefix.is_empty() {
1575            state.serialize_entry("prefix", &self.prefix)?;
1576        }
1577        if !self.delimiter.is_empty() {
1578            state.serialize_entry("delimiter", &self.delimiter)?;
1579        }
1580        if !self.lexicographic_start.is_empty() {
1581            state.serialize_entry("lexicographicStart", &self.lexicographic_start)?;
1582        }
1583        if !self.lexicographic_end.is_empty() {
1584            state.serialize_entry("lexicographicEnd", &self.lexicographic_end)?;
1585        }
1586        if !self.request_id.is_empty() {
1587            state.serialize_entry("requestId", &self.request_id)?;
1588        }
1589        if !self._unknown_fields.is_empty() {
1590            for (key, value) in self._unknown_fields.iter() {
1591                state.serialize_entry(key, &value)?;
1592            }
1593        }
1594        state.end()
1595    }
1596}
1597
1598/// Response message for ListFolders.
1599#[derive(Clone, Debug, Default, PartialEq)]
1600#[non_exhaustive]
1601pub struct ListFoldersResponse {
1602    /// The list of child folders
1603    pub folders: std::vec::Vec<crate::model::Folder>,
1604
1605    /// The continuation token, used to page through large result sets. Provide
1606    /// this value in a subsequent request to return the next page of results.
1607    pub next_page_token: std::string::String,
1608
1609    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1610}
1611
1612impl ListFoldersResponse {
1613    pub fn new() -> Self {
1614        std::default::Default::default()
1615    }
1616
1617    /// Sets the value of [folders][crate::model::ListFoldersResponse::folders].
1618    pub fn set_folders<T, V>(mut self, v: T) -> Self
1619    where
1620        T: std::iter::IntoIterator<Item = V>,
1621        V: std::convert::Into<crate::model::Folder>,
1622    {
1623        use std::iter::Iterator;
1624        self.folders = v.into_iter().map(|i| i.into()).collect();
1625        self
1626    }
1627
1628    /// Sets the value of [next_page_token][crate::model::ListFoldersResponse::next_page_token].
1629    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1630        self.next_page_token = v.into();
1631        self
1632    }
1633}
1634
1635impl wkt::message::Message for ListFoldersResponse {
1636    fn typename() -> &'static str {
1637        "type.googleapis.com/google.storage.control.v2.ListFoldersResponse"
1638    }
1639}
1640
1641#[doc(hidden)]
1642impl gax::paginator::internal::PageableResponse for ListFoldersResponse {
1643    type PageItem = crate::model::Folder;
1644
1645    fn items(self) -> std::vec::Vec<Self::PageItem> {
1646        self.folders
1647    }
1648
1649    fn next_page_token(&self) -> std::string::String {
1650        use std::clone::Clone;
1651        self.next_page_token.clone()
1652    }
1653}
1654
1655#[doc(hidden)]
1656impl<'de> serde::de::Deserialize<'de> for ListFoldersResponse {
1657    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1658    where
1659        D: serde::Deserializer<'de>,
1660    {
1661        #[allow(non_camel_case_types)]
1662        #[doc(hidden)]
1663        #[derive(PartialEq, Eq, Hash)]
1664        enum __FieldTag {
1665            __folders,
1666            __next_page_token,
1667            Unknown(std::string::String),
1668        }
1669        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1670            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1671            where
1672                D: serde::Deserializer<'de>,
1673            {
1674                struct Visitor;
1675                impl<'de> serde::de::Visitor<'de> for Visitor {
1676                    type Value = __FieldTag;
1677                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1678                        formatter.write_str("a field name for ListFoldersResponse")
1679                    }
1680                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1681                    where
1682                        E: serde::de::Error,
1683                    {
1684                        use std::result::Result::Ok;
1685                        use std::string::ToString;
1686                        match value {
1687                            "folders" => Ok(__FieldTag::__folders),
1688                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
1689                            "next_page_token" => Ok(__FieldTag::__next_page_token),
1690                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1691                        }
1692                    }
1693                }
1694                deserializer.deserialize_identifier(Visitor)
1695            }
1696        }
1697        struct Visitor;
1698        impl<'de> serde::de::Visitor<'de> for Visitor {
1699            type Value = ListFoldersResponse;
1700            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1701                formatter.write_str("struct ListFoldersResponse")
1702            }
1703            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1704            where
1705                A: serde::de::MapAccess<'de>,
1706            {
1707                #[allow(unused_imports)]
1708                use serde::de::Error;
1709                use std::option::Option::Some;
1710                let mut fields = std::collections::HashSet::new();
1711                let mut result = Self::Value::new();
1712                while let Some(tag) = map.next_key::<__FieldTag>()? {
1713                    #[allow(clippy::match_single_binding)]
1714                    match tag {
1715                        __FieldTag::__folders => {
1716                            if !fields.insert(__FieldTag::__folders) {
1717                                return std::result::Result::Err(A::Error::duplicate_field(
1718                                    "multiple values for folders",
1719                                ));
1720                            }
1721                            result.folders = map.next_value::<std::option::Option<std::vec::Vec<crate::model::Folder>>>()?.unwrap_or_default();
1722                        }
1723                        __FieldTag::__next_page_token => {
1724                            if !fields.insert(__FieldTag::__next_page_token) {
1725                                return std::result::Result::Err(A::Error::duplicate_field(
1726                                    "multiple values for next_page_token",
1727                                ));
1728                            }
1729                            result.next_page_token = map
1730                                .next_value::<std::option::Option<std::string::String>>()?
1731                                .unwrap_or_default();
1732                        }
1733                        __FieldTag::Unknown(key) => {
1734                            let value = map.next_value::<serde_json::Value>()?;
1735                            result._unknown_fields.insert(key, value);
1736                        }
1737                    }
1738                }
1739                std::result::Result::Ok(result)
1740            }
1741        }
1742        deserializer.deserialize_any(Visitor)
1743    }
1744}
1745
1746#[doc(hidden)]
1747impl serde::ser::Serialize for ListFoldersResponse {
1748    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
1749    where
1750        S: serde::ser::Serializer,
1751    {
1752        use serde::ser::SerializeMap;
1753        #[allow(unused_imports)]
1754        use std::option::Option::Some;
1755        let mut state = serializer.serialize_map(std::option::Option::None)?;
1756        if !self.folders.is_empty() {
1757            state.serialize_entry("folders", &self.folders)?;
1758        }
1759        if !self.next_page_token.is_empty() {
1760            state.serialize_entry("nextPageToken", &self.next_page_token)?;
1761        }
1762        if !self._unknown_fields.is_empty() {
1763            for (key, value) in self._unknown_fields.iter() {
1764                state.serialize_entry(key, &value)?;
1765            }
1766        }
1767        state.end()
1768    }
1769}
1770
1771/// Request message for RenameFolder. This operation is only applicable to a
1772/// hierarchical namespace enabled bucket.
1773#[derive(Clone, Debug, Default, PartialEq)]
1774#[non_exhaustive]
1775pub struct RenameFolderRequest {
1776    /// Required. Name of the source folder being renamed.
1777    /// Format: `projects/{project}/buckets/{bucket}/folders/{folder}`
1778    pub name: std::string::String,
1779
1780    /// Required. The destination folder ID, e.g. `foo/bar/`.
1781    pub destination_folder_id: std::string::String,
1782
1783    /// Makes the operation only succeed conditional on whether the source
1784    /// folder's current metageneration matches the given value.
1785    pub if_metageneration_match: std::option::Option<i64>,
1786
1787    /// Makes the operation only succeed conditional on whether the source
1788    /// folder's current metageneration does not match the given value.
1789    pub if_metageneration_not_match: std::option::Option<i64>,
1790
1791    /// Optional. A unique identifier for this request. UUID is the recommended
1792    /// format, but other formats are still accepted. This request is only
1793    /// idempotent if a `request_id` is provided.
1794    pub request_id: std::string::String,
1795
1796    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
1797}
1798
1799impl RenameFolderRequest {
1800    pub fn new() -> Self {
1801        std::default::Default::default()
1802    }
1803
1804    /// Sets the value of [name][crate::model::RenameFolderRequest::name].
1805    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1806        self.name = v.into();
1807        self
1808    }
1809
1810    /// Sets the value of [destination_folder_id][crate::model::RenameFolderRequest::destination_folder_id].
1811    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
1812        mut self,
1813        v: T,
1814    ) -> Self {
1815        self.destination_folder_id = v.into();
1816        self
1817    }
1818
1819    /// Sets the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
1820    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
1821    where
1822        T: std::convert::Into<i64>,
1823    {
1824        self.if_metageneration_match = std::option::Option::Some(v.into());
1825        self
1826    }
1827
1828    /// Sets or clears the value of [if_metageneration_match][crate::model::RenameFolderRequest::if_metageneration_match].
1829    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
1830    where
1831        T: std::convert::Into<i64>,
1832    {
1833        self.if_metageneration_match = v.map(|x| x.into());
1834        self
1835    }
1836
1837    /// Sets the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
1838    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
1839    where
1840        T: std::convert::Into<i64>,
1841    {
1842        self.if_metageneration_not_match = std::option::Option::Some(v.into());
1843        self
1844    }
1845
1846    /// Sets or clears the value of [if_metageneration_not_match][crate::model::RenameFolderRequest::if_metageneration_not_match].
1847    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
1848    where
1849        T: std::convert::Into<i64>,
1850    {
1851        self.if_metageneration_not_match = v.map(|x| x.into());
1852        self
1853    }
1854
1855    /// Sets the value of [request_id][crate::model::RenameFolderRequest::request_id].
1856    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
1857        self.request_id = v.into();
1858        self
1859    }
1860}
1861
1862impl wkt::message::Message for RenameFolderRequest {
1863    fn typename() -> &'static str {
1864        "type.googleapis.com/google.storage.control.v2.RenameFolderRequest"
1865    }
1866}
1867
1868#[doc(hidden)]
1869impl<'de> serde::de::Deserialize<'de> for RenameFolderRequest {
1870    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1871    where
1872        D: serde::Deserializer<'de>,
1873    {
1874        #[allow(non_camel_case_types)]
1875        #[doc(hidden)]
1876        #[derive(PartialEq, Eq, Hash)]
1877        enum __FieldTag {
1878            __name,
1879            __destination_folder_id,
1880            __if_metageneration_match,
1881            __if_metageneration_not_match,
1882            __request_id,
1883            Unknown(std::string::String),
1884        }
1885        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
1886            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
1887            where
1888                D: serde::Deserializer<'de>,
1889            {
1890                struct Visitor;
1891                impl<'de> serde::de::Visitor<'de> for Visitor {
1892                    type Value = __FieldTag;
1893                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1894                        formatter.write_str("a field name for RenameFolderRequest")
1895                    }
1896                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
1897                    where
1898                        E: serde::de::Error,
1899                    {
1900                        use std::result::Result::Ok;
1901                        use std::string::ToString;
1902                        match value {
1903                            "name" => Ok(__FieldTag::__name),
1904                            "destinationFolderId" => Ok(__FieldTag::__destination_folder_id),
1905                            "destination_folder_id" => Ok(__FieldTag::__destination_folder_id),
1906                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
1907                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
1908                            "ifMetagenerationNotMatch" => {
1909                                Ok(__FieldTag::__if_metageneration_not_match)
1910                            }
1911                            "if_metageneration_not_match" => {
1912                                Ok(__FieldTag::__if_metageneration_not_match)
1913                            }
1914                            "requestId" => Ok(__FieldTag::__request_id),
1915                            "request_id" => Ok(__FieldTag::__request_id),
1916                            _ => Ok(__FieldTag::Unknown(value.to_string())),
1917                        }
1918                    }
1919                }
1920                deserializer.deserialize_identifier(Visitor)
1921            }
1922        }
1923        struct Visitor;
1924        impl<'de> serde::de::Visitor<'de> for Visitor {
1925            type Value = RenameFolderRequest;
1926            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
1927                formatter.write_str("struct RenameFolderRequest")
1928            }
1929            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
1930            where
1931                A: serde::de::MapAccess<'de>,
1932            {
1933                #[allow(unused_imports)]
1934                use serde::de::Error;
1935                use std::option::Option::Some;
1936                let mut fields = std::collections::HashSet::new();
1937                let mut result = Self::Value::new();
1938                while let Some(tag) = map.next_key::<__FieldTag>()? {
1939                    #[allow(clippy::match_single_binding)]
1940                    match tag {
1941                        __FieldTag::__name => {
1942                            if !fields.insert(__FieldTag::__name) {
1943                                return std::result::Result::Err(A::Error::duplicate_field(
1944                                    "multiple values for name",
1945                                ));
1946                            }
1947                            result.name = map
1948                                .next_value::<std::option::Option<std::string::String>>()?
1949                                .unwrap_or_default();
1950                        }
1951                        __FieldTag::__destination_folder_id => {
1952                            if !fields.insert(__FieldTag::__destination_folder_id) {
1953                                return std::result::Result::Err(A::Error::duplicate_field(
1954                                    "multiple values for destination_folder_id",
1955                                ));
1956                            }
1957                            result.destination_folder_id = map
1958                                .next_value::<std::option::Option<std::string::String>>()?
1959                                .unwrap_or_default();
1960                        }
1961                        __FieldTag::__if_metageneration_match => {
1962                            if !fields.insert(__FieldTag::__if_metageneration_match) {
1963                                return std::result::Result::Err(A::Error::duplicate_field(
1964                                    "multiple values for if_metageneration_match",
1965                                ));
1966                            }
1967                            struct __With(std::option::Option<i64>);
1968                            impl<'de> serde::de::Deserialize<'de> for __With {
1969                                fn deserialize<D>(
1970                                    deserializer: D,
1971                                ) -> std::result::Result<Self, D::Error>
1972                                where
1973                                    D: serde::de::Deserializer<'de>,
1974                                {
1975                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
1976                                }
1977                            }
1978                            result.if_metageneration_match = map.next_value::<__With>()?.0;
1979                        }
1980                        __FieldTag::__if_metageneration_not_match => {
1981                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
1982                                return std::result::Result::Err(A::Error::duplicate_field(
1983                                    "multiple values for if_metageneration_not_match",
1984                                ));
1985                            }
1986                            struct __With(std::option::Option<i64>);
1987                            impl<'de> serde::de::Deserialize<'de> for __With {
1988                                fn deserialize<D>(
1989                                    deserializer: D,
1990                                ) -> std::result::Result<Self, D::Error>
1991                                where
1992                                    D: serde::de::Deserializer<'de>,
1993                                {
1994                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
1995                                }
1996                            }
1997                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
1998                        }
1999                        __FieldTag::__request_id => {
2000                            if !fields.insert(__FieldTag::__request_id) {
2001                                return std::result::Result::Err(A::Error::duplicate_field(
2002                                    "multiple values for request_id",
2003                                ));
2004                            }
2005                            result.request_id = map
2006                                .next_value::<std::option::Option<std::string::String>>()?
2007                                .unwrap_or_default();
2008                        }
2009                        __FieldTag::Unknown(key) => {
2010                            let value = map.next_value::<serde_json::Value>()?;
2011                            result._unknown_fields.insert(key, value);
2012                        }
2013                    }
2014                }
2015                std::result::Result::Ok(result)
2016            }
2017        }
2018        deserializer.deserialize_any(Visitor)
2019    }
2020}
2021
2022#[doc(hidden)]
2023impl serde::ser::Serialize for RenameFolderRequest {
2024    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2025    where
2026        S: serde::ser::Serializer,
2027    {
2028        use serde::ser::SerializeMap;
2029        #[allow(unused_imports)]
2030        use std::option::Option::Some;
2031        let mut state = serializer.serialize_map(std::option::Option::None)?;
2032        if !self.name.is_empty() {
2033            state.serialize_entry("name", &self.name)?;
2034        }
2035        if !self.destination_folder_id.is_empty() {
2036            state.serialize_entry("destinationFolderId", &self.destination_folder_id)?;
2037        }
2038        if self.if_metageneration_match.is_some() {
2039            struct __With<'a>(&'a std::option::Option<i64>);
2040            impl<'a> serde::ser::Serialize for __With<'a> {
2041                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2042                where
2043                    S: serde::ser::Serializer,
2044                {
2045                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
2046                        self.0, serializer,
2047                    )
2048                }
2049            }
2050            state.serialize_entry(
2051                "ifMetagenerationMatch",
2052                &__With(&self.if_metageneration_match),
2053            )?;
2054        }
2055        if self.if_metageneration_not_match.is_some() {
2056            struct __With<'a>(&'a std::option::Option<i64>);
2057            impl<'a> serde::ser::Serialize for __With<'a> {
2058                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2059                where
2060                    S: serde::ser::Serializer,
2061                {
2062                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
2063                        self.0, serializer,
2064                    )
2065                }
2066            }
2067            state.serialize_entry(
2068                "ifMetagenerationNotMatch",
2069                &__With(&self.if_metageneration_not_match),
2070            )?;
2071        }
2072        if !self.request_id.is_empty() {
2073            state.serialize_entry("requestId", &self.request_id)?;
2074        }
2075        if !self._unknown_fields.is_empty() {
2076            for (key, value) in self._unknown_fields.iter() {
2077                state.serialize_entry(key, &value)?;
2078            }
2079        }
2080        state.end()
2081    }
2082}
2083
2084/// The message contains metadata that is common to all Storage Control
2085/// long-running operations, present in its `google.longrunning.Operation`
2086/// messages, and accessible via `metadata.common_metadata`.
2087#[derive(Clone, Debug, Default, PartialEq)]
2088#[non_exhaustive]
2089pub struct CommonLongRunningOperationMetadata {
2090    /// Output only. The time the operation was created.
2091    pub create_time: std::option::Option<wkt::Timestamp>,
2092
2093    /// Output only. The time the operation finished running.
2094    pub end_time: std::option::Option<wkt::Timestamp>,
2095
2096    /// Output only. The time the operation was last modified.
2097    pub update_time: std::option::Option<wkt::Timestamp>,
2098
2099    /// Output only. The type of operation invoked.
2100    pub r#type: std::string::String,
2101
2102    /// Output only. Identifies whether the user has requested cancellation.
2103    pub requested_cancellation: bool,
2104
2105    /// Output only. The estimated progress of the operation in percentage [0,
2106    /// 100]. The value -1 means the progress is unknown.
2107    pub progress_percent: i32,
2108
2109    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2110}
2111
2112impl CommonLongRunningOperationMetadata {
2113    pub fn new() -> Self {
2114        std::default::Default::default()
2115    }
2116
2117    /// Sets the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
2118    pub fn set_create_time<T>(mut self, v: T) -> Self
2119    where
2120        T: std::convert::Into<wkt::Timestamp>,
2121    {
2122        self.create_time = std::option::Option::Some(v.into());
2123        self
2124    }
2125
2126    /// Sets or clears the value of [create_time][crate::model::CommonLongRunningOperationMetadata::create_time].
2127    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
2128    where
2129        T: std::convert::Into<wkt::Timestamp>,
2130    {
2131        self.create_time = v.map(|x| x.into());
2132        self
2133    }
2134
2135    /// Sets the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
2136    pub fn set_end_time<T>(mut self, v: T) -> Self
2137    where
2138        T: std::convert::Into<wkt::Timestamp>,
2139    {
2140        self.end_time = std::option::Option::Some(v.into());
2141        self
2142    }
2143
2144    /// Sets or clears the value of [end_time][crate::model::CommonLongRunningOperationMetadata::end_time].
2145    pub fn set_or_clear_end_time<T>(mut self, v: std::option::Option<T>) -> Self
2146    where
2147        T: std::convert::Into<wkt::Timestamp>,
2148    {
2149        self.end_time = v.map(|x| x.into());
2150        self
2151    }
2152
2153    /// Sets the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
2154    pub fn set_update_time<T>(mut self, v: T) -> Self
2155    where
2156        T: std::convert::Into<wkt::Timestamp>,
2157    {
2158        self.update_time = std::option::Option::Some(v.into());
2159        self
2160    }
2161
2162    /// Sets or clears the value of [update_time][crate::model::CommonLongRunningOperationMetadata::update_time].
2163    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
2164    where
2165        T: std::convert::Into<wkt::Timestamp>,
2166    {
2167        self.update_time = v.map(|x| x.into());
2168        self
2169    }
2170
2171    /// Sets the value of [r#type][crate::model::CommonLongRunningOperationMetadata::type].
2172    pub fn set_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2173        self.r#type = v.into();
2174        self
2175    }
2176
2177    /// Sets the value of [requested_cancellation][crate::model::CommonLongRunningOperationMetadata::requested_cancellation].
2178    pub fn set_requested_cancellation<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
2179        self.requested_cancellation = v.into();
2180        self
2181    }
2182
2183    /// Sets the value of [progress_percent][crate::model::CommonLongRunningOperationMetadata::progress_percent].
2184    pub fn set_progress_percent<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
2185        self.progress_percent = v.into();
2186        self
2187    }
2188}
2189
2190impl wkt::message::Message for CommonLongRunningOperationMetadata {
2191    fn typename() -> &'static str {
2192        "type.googleapis.com/google.storage.control.v2.CommonLongRunningOperationMetadata"
2193    }
2194}
2195
2196#[doc(hidden)]
2197impl<'de> serde::de::Deserialize<'de> for CommonLongRunningOperationMetadata {
2198    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2199    where
2200        D: serde::Deserializer<'de>,
2201    {
2202        #[allow(non_camel_case_types)]
2203        #[doc(hidden)]
2204        #[derive(PartialEq, Eq, Hash)]
2205        enum __FieldTag {
2206            __create_time,
2207            __end_time,
2208            __update_time,
2209            __type,
2210            __requested_cancellation,
2211            __progress_percent,
2212            Unknown(std::string::String),
2213        }
2214        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2215            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2216            where
2217                D: serde::Deserializer<'de>,
2218            {
2219                struct Visitor;
2220                impl<'de> serde::de::Visitor<'de> for Visitor {
2221                    type Value = __FieldTag;
2222                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2223                        formatter.write_str("a field name for CommonLongRunningOperationMetadata")
2224                    }
2225                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2226                    where
2227                        E: serde::de::Error,
2228                    {
2229                        use std::result::Result::Ok;
2230                        use std::string::ToString;
2231                        match value {
2232                            "createTime" => Ok(__FieldTag::__create_time),
2233                            "create_time" => Ok(__FieldTag::__create_time),
2234                            "endTime" => Ok(__FieldTag::__end_time),
2235                            "end_time" => Ok(__FieldTag::__end_time),
2236                            "updateTime" => Ok(__FieldTag::__update_time),
2237                            "update_time" => Ok(__FieldTag::__update_time),
2238                            "type" => Ok(__FieldTag::__type),
2239                            "requestedCancellation" => Ok(__FieldTag::__requested_cancellation),
2240                            "requested_cancellation" => Ok(__FieldTag::__requested_cancellation),
2241                            "progressPercent" => Ok(__FieldTag::__progress_percent),
2242                            "progress_percent" => Ok(__FieldTag::__progress_percent),
2243                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2244                        }
2245                    }
2246                }
2247                deserializer.deserialize_identifier(Visitor)
2248            }
2249        }
2250        struct Visitor;
2251        impl<'de> serde::de::Visitor<'de> for Visitor {
2252            type Value = CommonLongRunningOperationMetadata;
2253            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2254                formatter.write_str("struct CommonLongRunningOperationMetadata")
2255            }
2256            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2257            where
2258                A: serde::de::MapAccess<'de>,
2259            {
2260                #[allow(unused_imports)]
2261                use serde::de::Error;
2262                use std::option::Option::Some;
2263                let mut fields = std::collections::HashSet::new();
2264                let mut result = Self::Value::new();
2265                while let Some(tag) = map.next_key::<__FieldTag>()? {
2266                    #[allow(clippy::match_single_binding)]
2267                    match tag {
2268                        __FieldTag::__create_time => {
2269                            if !fields.insert(__FieldTag::__create_time) {
2270                                return std::result::Result::Err(A::Error::duplicate_field(
2271                                    "multiple values for create_time",
2272                                ));
2273                            }
2274                            result.create_time =
2275                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2276                        }
2277                        __FieldTag::__end_time => {
2278                            if !fields.insert(__FieldTag::__end_time) {
2279                                return std::result::Result::Err(A::Error::duplicate_field(
2280                                    "multiple values for end_time",
2281                                ));
2282                            }
2283                            result.end_time =
2284                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2285                        }
2286                        __FieldTag::__update_time => {
2287                            if !fields.insert(__FieldTag::__update_time) {
2288                                return std::result::Result::Err(A::Error::duplicate_field(
2289                                    "multiple values for update_time",
2290                                ));
2291                            }
2292                            result.update_time =
2293                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
2294                        }
2295                        __FieldTag::__type => {
2296                            if !fields.insert(__FieldTag::__type) {
2297                                return std::result::Result::Err(A::Error::duplicate_field(
2298                                    "multiple values for type",
2299                                ));
2300                            }
2301                            result.r#type = map
2302                                .next_value::<std::option::Option<std::string::String>>()?
2303                                .unwrap_or_default();
2304                        }
2305                        __FieldTag::__requested_cancellation => {
2306                            if !fields.insert(__FieldTag::__requested_cancellation) {
2307                                return std::result::Result::Err(A::Error::duplicate_field(
2308                                    "multiple values for requested_cancellation",
2309                                ));
2310                            }
2311                            result.requested_cancellation = map
2312                                .next_value::<std::option::Option<bool>>()?
2313                                .unwrap_or_default();
2314                        }
2315                        __FieldTag::__progress_percent => {
2316                            if !fields.insert(__FieldTag::__progress_percent) {
2317                                return std::result::Result::Err(A::Error::duplicate_field(
2318                                    "multiple values for progress_percent",
2319                                ));
2320                            }
2321                            struct __With(std::option::Option<i32>);
2322                            impl<'de> serde::de::Deserialize<'de> for __With {
2323                                fn deserialize<D>(
2324                                    deserializer: D,
2325                                ) -> std::result::Result<Self, D::Error>
2326                                where
2327                                    D: serde::de::Deserializer<'de>,
2328                                {
2329                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
2330                                }
2331                            }
2332                            result.progress_percent =
2333                                map.next_value::<__With>()?.0.unwrap_or_default();
2334                        }
2335                        __FieldTag::Unknown(key) => {
2336                            let value = map.next_value::<serde_json::Value>()?;
2337                            result._unknown_fields.insert(key, value);
2338                        }
2339                    }
2340                }
2341                std::result::Result::Ok(result)
2342            }
2343        }
2344        deserializer.deserialize_any(Visitor)
2345    }
2346}
2347
2348#[doc(hidden)]
2349impl serde::ser::Serialize for CommonLongRunningOperationMetadata {
2350    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2351    where
2352        S: serde::ser::Serializer,
2353    {
2354        use serde::ser::SerializeMap;
2355        #[allow(unused_imports)]
2356        use std::option::Option::Some;
2357        let mut state = serializer.serialize_map(std::option::Option::None)?;
2358        if self.create_time.is_some() {
2359            state.serialize_entry("createTime", &self.create_time)?;
2360        }
2361        if self.end_time.is_some() {
2362            state.serialize_entry("endTime", &self.end_time)?;
2363        }
2364        if self.update_time.is_some() {
2365            state.serialize_entry("updateTime", &self.update_time)?;
2366        }
2367        if !self.r#type.is_empty() {
2368            state.serialize_entry("type", &self.r#type)?;
2369        }
2370        if !wkt::internal::is_default(&self.requested_cancellation) {
2371            state.serialize_entry("requestedCancellation", &self.requested_cancellation)?;
2372        }
2373        if !wkt::internal::is_default(&self.progress_percent) {
2374            struct __With<'a>(&'a i32);
2375            impl<'a> serde::ser::Serialize for __With<'a> {
2376                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2377                where
2378                    S: serde::ser::Serializer,
2379                {
2380                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
2381                }
2382            }
2383            state.serialize_entry("progressPercent", &__With(&self.progress_percent))?;
2384        }
2385        if !self._unknown_fields.is_empty() {
2386            for (key, value) in self._unknown_fields.iter() {
2387                state.serialize_entry(key, &value)?;
2388            }
2389        }
2390        state.end()
2391    }
2392}
2393
2394/// Message returned in the metadata field of the Operation resource for
2395/// RenameFolder operations.
2396#[derive(Clone, Debug, Default, PartialEq)]
2397#[non_exhaustive]
2398pub struct RenameFolderMetadata {
2399    /// Generic metadata for the long running operation.
2400    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
2401
2402    /// The path of the source folder.
2403    pub source_folder_id: std::string::String,
2404
2405    /// The path of the destination folder.
2406    pub destination_folder_id: std::string::String,
2407
2408    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2409}
2410
2411impl RenameFolderMetadata {
2412    pub fn new() -> Self {
2413        std::default::Default::default()
2414    }
2415
2416    /// Sets the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
2417    pub fn set_common_metadata<T>(mut self, v: T) -> Self
2418    where
2419        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2420    {
2421        self.common_metadata = std::option::Option::Some(v.into());
2422        self
2423    }
2424
2425    /// Sets or clears the value of [common_metadata][crate::model::RenameFolderMetadata::common_metadata].
2426    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2427    where
2428        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
2429    {
2430        self.common_metadata = v.map(|x| x.into());
2431        self
2432    }
2433
2434    /// Sets the value of [source_folder_id][crate::model::RenameFolderMetadata::source_folder_id].
2435    pub fn set_source_folder_id<T: std::convert::Into<std::string::String>>(
2436        mut self,
2437        v: T,
2438    ) -> Self {
2439        self.source_folder_id = v.into();
2440        self
2441    }
2442
2443    /// Sets the value of [destination_folder_id][crate::model::RenameFolderMetadata::destination_folder_id].
2444    pub fn set_destination_folder_id<T: std::convert::Into<std::string::String>>(
2445        mut self,
2446        v: T,
2447    ) -> Self {
2448        self.destination_folder_id = v.into();
2449        self
2450    }
2451}
2452
2453impl wkt::message::Message for RenameFolderMetadata {
2454    fn typename() -> &'static str {
2455        "type.googleapis.com/google.storage.control.v2.RenameFolderMetadata"
2456    }
2457}
2458
2459#[doc(hidden)]
2460impl<'de> serde::de::Deserialize<'de> for RenameFolderMetadata {
2461    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2462    where
2463        D: serde::Deserializer<'de>,
2464    {
2465        #[allow(non_camel_case_types)]
2466        #[doc(hidden)]
2467        #[derive(PartialEq, Eq, Hash)]
2468        enum __FieldTag {
2469            __common_metadata,
2470            __source_folder_id,
2471            __destination_folder_id,
2472            Unknown(std::string::String),
2473        }
2474        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2475            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2476            where
2477                D: serde::Deserializer<'de>,
2478            {
2479                struct Visitor;
2480                impl<'de> serde::de::Visitor<'de> for Visitor {
2481                    type Value = __FieldTag;
2482                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2483                        formatter.write_str("a field name for RenameFolderMetadata")
2484                    }
2485                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2486                    where
2487                        E: serde::de::Error,
2488                    {
2489                        use std::result::Result::Ok;
2490                        use std::string::ToString;
2491                        match value {
2492                            "commonMetadata" => Ok(__FieldTag::__common_metadata),
2493                            "common_metadata" => Ok(__FieldTag::__common_metadata),
2494                            "sourceFolderId" => Ok(__FieldTag::__source_folder_id),
2495                            "source_folder_id" => Ok(__FieldTag::__source_folder_id),
2496                            "destinationFolderId" => Ok(__FieldTag::__destination_folder_id),
2497                            "destination_folder_id" => Ok(__FieldTag::__destination_folder_id),
2498                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2499                        }
2500                    }
2501                }
2502                deserializer.deserialize_identifier(Visitor)
2503            }
2504        }
2505        struct Visitor;
2506        impl<'de> serde::de::Visitor<'de> for Visitor {
2507            type Value = RenameFolderMetadata;
2508            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2509                formatter.write_str("struct RenameFolderMetadata")
2510            }
2511            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2512            where
2513                A: serde::de::MapAccess<'de>,
2514            {
2515                #[allow(unused_imports)]
2516                use serde::de::Error;
2517                use std::option::Option::Some;
2518                let mut fields = std::collections::HashSet::new();
2519                let mut result = Self::Value::new();
2520                while let Some(tag) = map.next_key::<__FieldTag>()? {
2521                    #[allow(clippy::match_single_binding)]
2522                    match tag {
2523                        __FieldTag::__common_metadata => {
2524                            if !fields.insert(__FieldTag::__common_metadata) {
2525                                return std::result::Result::Err(A::Error::duplicate_field(
2526                                    "multiple values for common_metadata",
2527                                ));
2528                            }
2529                            result.common_metadata = map.next_value::<std::option::Option<
2530                                crate::model::CommonLongRunningOperationMetadata,
2531                            >>()?;
2532                        }
2533                        __FieldTag::__source_folder_id => {
2534                            if !fields.insert(__FieldTag::__source_folder_id) {
2535                                return std::result::Result::Err(A::Error::duplicate_field(
2536                                    "multiple values for source_folder_id",
2537                                ));
2538                            }
2539                            result.source_folder_id = map
2540                                .next_value::<std::option::Option<std::string::String>>()?
2541                                .unwrap_or_default();
2542                        }
2543                        __FieldTag::__destination_folder_id => {
2544                            if !fields.insert(__FieldTag::__destination_folder_id) {
2545                                return std::result::Result::Err(A::Error::duplicate_field(
2546                                    "multiple values for destination_folder_id",
2547                                ));
2548                            }
2549                            result.destination_folder_id = map
2550                                .next_value::<std::option::Option<std::string::String>>()?
2551                                .unwrap_or_default();
2552                        }
2553                        __FieldTag::Unknown(key) => {
2554                            let value = map.next_value::<serde_json::Value>()?;
2555                            result._unknown_fields.insert(key, value);
2556                        }
2557                    }
2558                }
2559                std::result::Result::Ok(result)
2560            }
2561        }
2562        deserializer.deserialize_any(Visitor)
2563    }
2564}
2565
2566#[doc(hidden)]
2567impl serde::ser::Serialize for RenameFolderMetadata {
2568    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2569    where
2570        S: serde::ser::Serializer,
2571    {
2572        use serde::ser::SerializeMap;
2573        #[allow(unused_imports)]
2574        use std::option::Option::Some;
2575        let mut state = serializer.serialize_map(std::option::Option::None)?;
2576        if self.common_metadata.is_some() {
2577            state.serialize_entry("commonMetadata", &self.common_metadata)?;
2578        }
2579        if !self.source_folder_id.is_empty() {
2580            state.serialize_entry("sourceFolderId", &self.source_folder_id)?;
2581        }
2582        if !self.destination_folder_id.is_empty() {
2583            state.serialize_entry("destinationFolderId", &self.destination_folder_id)?;
2584        }
2585        if !self._unknown_fields.is_empty() {
2586            for (key, value) in self._unknown_fields.iter() {
2587                state.serialize_entry(key, &value)?;
2588            }
2589        }
2590        state.end()
2591    }
2592}
2593
2594/// The storage layout configuration of a bucket.
2595#[derive(Clone, Debug, Default, PartialEq)]
2596#[non_exhaustive]
2597pub struct StorageLayout {
2598    /// Output only. The name of the StorageLayout resource.
2599    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
2600    pub name: std::string::String,
2601
2602    /// Output only. The location of the bucket.
2603    pub location: std::string::String,
2604
2605    /// Output only. The location type of the bucket (region, dual-region,
2606    /// multi-region, etc).
2607    pub location_type: std::string::String,
2608
2609    /// Output only. The data placement configuration for custom dual region. If
2610    /// there is no configuration, this is not a custom dual region bucket.
2611    pub custom_placement_config:
2612        std::option::Option<crate::model::storage_layout::CustomPlacementConfig>,
2613
2614    /// Output only. The bucket's hierarchical namespace configuration. If there is
2615    /// no configuration, the hierarchical namespace is disabled.
2616    pub hierarchical_namespace:
2617        std::option::Option<crate::model::storage_layout::HierarchicalNamespace>,
2618
2619    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2620}
2621
2622impl StorageLayout {
2623    pub fn new() -> Self {
2624        std::default::Default::default()
2625    }
2626
2627    /// Sets the value of [name][crate::model::StorageLayout::name].
2628    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2629        self.name = v.into();
2630        self
2631    }
2632
2633    /// Sets the value of [location][crate::model::StorageLayout::location].
2634    pub fn set_location<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2635        self.location = v.into();
2636        self
2637    }
2638
2639    /// Sets the value of [location_type][crate::model::StorageLayout::location_type].
2640    pub fn set_location_type<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
2641        self.location_type = v.into();
2642        self
2643    }
2644
2645    /// Sets the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
2646    pub fn set_custom_placement_config<T>(mut self, v: T) -> Self
2647    where
2648        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
2649    {
2650        self.custom_placement_config = std::option::Option::Some(v.into());
2651        self
2652    }
2653
2654    /// Sets or clears the value of [custom_placement_config][crate::model::StorageLayout::custom_placement_config].
2655    pub fn set_or_clear_custom_placement_config<T>(mut self, v: std::option::Option<T>) -> Self
2656    where
2657        T: std::convert::Into<crate::model::storage_layout::CustomPlacementConfig>,
2658    {
2659        self.custom_placement_config = v.map(|x| x.into());
2660        self
2661    }
2662
2663    /// Sets the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
2664    pub fn set_hierarchical_namespace<T>(mut self, v: T) -> Self
2665    where
2666        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
2667    {
2668        self.hierarchical_namespace = std::option::Option::Some(v.into());
2669        self
2670    }
2671
2672    /// Sets or clears the value of [hierarchical_namespace][crate::model::StorageLayout::hierarchical_namespace].
2673    pub fn set_or_clear_hierarchical_namespace<T>(mut self, v: std::option::Option<T>) -> Self
2674    where
2675        T: std::convert::Into<crate::model::storage_layout::HierarchicalNamespace>,
2676    {
2677        self.hierarchical_namespace = v.map(|x| x.into());
2678        self
2679    }
2680}
2681
2682impl wkt::message::Message for StorageLayout {
2683    fn typename() -> &'static str {
2684        "type.googleapis.com/google.storage.control.v2.StorageLayout"
2685    }
2686}
2687
2688#[doc(hidden)]
2689impl<'de> serde::de::Deserialize<'de> for StorageLayout {
2690    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2691    where
2692        D: serde::Deserializer<'de>,
2693    {
2694        #[allow(non_camel_case_types)]
2695        #[doc(hidden)]
2696        #[derive(PartialEq, Eq, Hash)]
2697        enum __FieldTag {
2698            __name,
2699            __location,
2700            __location_type,
2701            __custom_placement_config,
2702            __hierarchical_namespace,
2703            Unknown(std::string::String),
2704        }
2705        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2706            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2707            where
2708                D: serde::Deserializer<'de>,
2709            {
2710                struct Visitor;
2711                impl<'de> serde::de::Visitor<'de> for Visitor {
2712                    type Value = __FieldTag;
2713                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2714                        formatter.write_str("a field name for StorageLayout")
2715                    }
2716                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2717                    where
2718                        E: serde::de::Error,
2719                    {
2720                        use std::result::Result::Ok;
2721                        use std::string::ToString;
2722                        match value {
2723                            "name" => Ok(__FieldTag::__name),
2724                            "location" => Ok(__FieldTag::__location),
2725                            "locationType" => Ok(__FieldTag::__location_type),
2726                            "location_type" => Ok(__FieldTag::__location_type),
2727                            "customPlacementConfig" => Ok(__FieldTag::__custom_placement_config),
2728                            "custom_placement_config" => Ok(__FieldTag::__custom_placement_config),
2729                            "hierarchicalNamespace" => Ok(__FieldTag::__hierarchical_namespace),
2730                            "hierarchical_namespace" => Ok(__FieldTag::__hierarchical_namespace),
2731                            _ => Ok(__FieldTag::Unknown(value.to_string())),
2732                        }
2733                    }
2734                }
2735                deserializer.deserialize_identifier(Visitor)
2736            }
2737        }
2738        struct Visitor;
2739        impl<'de> serde::de::Visitor<'de> for Visitor {
2740            type Value = StorageLayout;
2741            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2742                formatter.write_str("struct StorageLayout")
2743            }
2744            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2745            where
2746                A: serde::de::MapAccess<'de>,
2747            {
2748                #[allow(unused_imports)]
2749                use serde::de::Error;
2750                use std::option::Option::Some;
2751                let mut fields = std::collections::HashSet::new();
2752                let mut result = Self::Value::new();
2753                while let Some(tag) = map.next_key::<__FieldTag>()? {
2754                    #[allow(clippy::match_single_binding)]
2755                    match tag {
2756                        __FieldTag::__name => {
2757                            if !fields.insert(__FieldTag::__name) {
2758                                return std::result::Result::Err(A::Error::duplicate_field(
2759                                    "multiple values for name",
2760                                ));
2761                            }
2762                            result.name = map
2763                                .next_value::<std::option::Option<std::string::String>>()?
2764                                .unwrap_or_default();
2765                        }
2766                        __FieldTag::__location => {
2767                            if !fields.insert(__FieldTag::__location) {
2768                                return std::result::Result::Err(A::Error::duplicate_field(
2769                                    "multiple values for location",
2770                                ));
2771                            }
2772                            result.location = map
2773                                .next_value::<std::option::Option<std::string::String>>()?
2774                                .unwrap_or_default();
2775                        }
2776                        __FieldTag::__location_type => {
2777                            if !fields.insert(__FieldTag::__location_type) {
2778                                return std::result::Result::Err(A::Error::duplicate_field(
2779                                    "multiple values for location_type",
2780                                ));
2781                            }
2782                            result.location_type = map
2783                                .next_value::<std::option::Option<std::string::String>>()?
2784                                .unwrap_or_default();
2785                        }
2786                        __FieldTag::__custom_placement_config => {
2787                            if !fields.insert(__FieldTag::__custom_placement_config) {
2788                                return std::result::Result::Err(A::Error::duplicate_field(
2789                                    "multiple values for custom_placement_config",
2790                                ));
2791                            }
2792                            result.custom_placement_config = map.next_value::<std::option::Option<
2793                                crate::model::storage_layout::CustomPlacementConfig,
2794                            >>()?;
2795                        }
2796                        __FieldTag::__hierarchical_namespace => {
2797                            if !fields.insert(__FieldTag::__hierarchical_namespace) {
2798                                return std::result::Result::Err(A::Error::duplicate_field(
2799                                    "multiple values for hierarchical_namespace",
2800                                ));
2801                            }
2802                            result.hierarchical_namespace = map.next_value::<std::option::Option<
2803                                crate::model::storage_layout::HierarchicalNamespace,
2804                            >>()?;
2805                        }
2806                        __FieldTag::Unknown(key) => {
2807                            let value = map.next_value::<serde_json::Value>()?;
2808                            result._unknown_fields.insert(key, value);
2809                        }
2810                    }
2811                }
2812                std::result::Result::Ok(result)
2813            }
2814        }
2815        deserializer.deserialize_any(Visitor)
2816    }
2817}
2818
2819#[doc(hidden)]
2820impl serde::ser::Serialize for StorageLayout {
2821    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2822    where
2823        S: serde::ser::Serializer,
2824    {
2825        use serde::ser::SerializeMap;
2826        #[allow(unused_imports)]
2827        use std::option::Option::Some;
2828        let mut state = serializer.serialize_map(std::option::Option::None)?;
2829        if !self.name.is_empty() {
2830            state.serialize_entry("name", &self.name)?;
2831        }
2832        if !self.location.is_empty() {
2833            state.serialize_entry("location", &self.location)?;
2834        }
2835        if !self.location_type.is_empty() {
2836            state.serialize_entry("locationType", &self.location_type)?;
2837        }
2838        if self.custom_placement_config.is_some() {
2839            state.serialize_entry("customPlacementConfig", &self.custom_placement_config)?;
2840        }
2841        if self.hierarchical_namespace.is_some() {
2842            state.serialize_entry("hierarchicalNamespace", &self.hierarchical_namespace)?;
2843        }
2844        if !self._unknown_fields.is_empty() {
2845            for (key, value) in self._unknown_fields.iter() {
2846                state.serialize_entry(key, &value)?;
2847            }
2848        }
2849        state.end()
2850    }
2851}
2852
2853/// Defines additional types related to [StorageLayout].
2854pub mod storage_layout {
2855    #[allow(unused_imports)]
2856    use super::*;
2857
2858    /// Configuration for Custom Dual Regions.  It should specify precisely two
2859    /// eligible regions within the same Multiregion. More information on regions
2860    /// may be found [here](https://cloud.google.com/storage/docs/locations).
2861    #[derive(Clone, Debug, Default, PartialEq)]
2862    #[non_exhaustive]
2863    pub struct CustomPlacementConfig {
2864        /// List of locations to use for data placement.
2865        pub data_locations: std::vec::Vec<std::string::String>,
2866
2867        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
2868    }
2869
2870    impl CustomPlacementConfig {
2871        pub fn new() -> Self {
2872            std::default::Default::default()
2873        }
2874
2875        /// Sets the value of [data_locations][crate::model::storage_layout::CustomPlacementConfig::data_locations].
2876        pub fn set_data_locations<T, V>(mut self, v: T) -> Self
2877        where
2878            T: std::iter::IntoIterator<Item = V>,
2879            V: std::convert::Into<std::string::String>,
2880        {
2881            use std::iter::Iterator;
2882            self.data_locations = v.into_iter().map(|i| i.into()).collect();
2883            self
2884        }
2885    }
2886
2887    impl wkt::message::Message for CustomPlacementConfig {
2888        fn typename() -> &'static str {
2889            "type.googleapis.com/google.storage.control.v2.StorageLayout.CustomPlacementConfig"
2890        }
2891    }
2892
2893    #[doc(hidden)]
2894    impl<'de> serde::de::Deserialize<'de> for CustomPlacementConfig {
2895        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2896        where
2897            D: serde::Deserializer<'de>,
2898        {
2899            #[allow(non_camel_case_types)]
2900            #[doc(hidden)]
2901            #[derive(PartialEq, Eq, Hash)]
2902            enum __FieldTag {
2903                __data_locations,
2904                Unknown(std::string::String),
2905            }
2906            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
2907                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
2908                where
2909                    D: serde::Deserializer<'de>,
2910                {
2911                    struct Visitor;
2912                    impl<'de> serde::de::Visitor<'de> for Visitor {
2913                        type Value = __FieldTag;
2914                        fn expecting(
2915                            &self,
2916                            formatter: &mut std::fmt::Formatter,
2917                        ) -> std::fmt::Result {
2918                            formatter.write_str("a field name for CustomPlacementConfig")
2919                        }
2920                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
2921                        where
2922                            E: serde::de::Error,
2923                        {
2924                            use std::result::Result::Ok;
2925                            use std::string::ToString;
2926                            match value {
2927                                "dataLocations" => Ok(__FieldTag::__data_locations),
2928                                "data_locations" => Ok(__FieldTag::__data_locations),
2929                                _ => Ok(__FieldTag::Unknown(value.to_string())),
2930                            }
2931                        }
2932                    }
2933                    deserializer.deserialize_identifier(Visitor)
2934                }
2935            }
2936            struct Visitor;
2937            impl<'de> serde::de::Visitor<'de> for Visitor {
2938                type Value = CustomPlacementConfig;
2939                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
2940                    formatter.write_str("struct CustomPlacementConfig")
2941                }
2942                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
2943                where
2944                    A: serde::de::MapAccess<'de>,
2945                {
2946                    #[allow(unused_imports)]
2947                    use serde::de::Error;
2948                    use std::option::Option::Some;
2949                    let mut fields = std::collections::HashSet::new();
2950                    let mut result = Self::Value::new();
2951                    while let Some(tag) = map.next_key::<__FieldTag>()? {
2952                        #[allow(clippy::match_single_binding)]
2953                        match tag {
2954                            __FieldTag::__data_locations => {
2955                                if !fields.insert(__FieldTag::__data_locations) {
2956                                    return std::result::Result::Err(A::Error::duplicate_field(
2957                                        "multiple values for data_locations",
2958                                    ));
2959                                }
2960                                result.data_locations = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
2961                            }
2962                            __FieldTag::Unknown(key) => {
2963                                let value = map.next_value::<serde_json::Value>()?;
2964                                result._unknown_fields.insert(key, value);
2965                            }
2966                        }
2967                    }
2968                    std::result::Result::Ok(result)
2969                }
2970            }
2971            deserializer.deserialize_any(Visitor)
2972        }
2973    }
2974
2975    #[doc(hidden)]
2976    impl serde::ser::Serialize for CustomPlacementConfig {
2977        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
2978        where
2979            S: serde::ser::Serializer,
2980        {
2981            use serde::ser::SerializeMap;
2982            #[allow(unused_imports)]
2983            use std::option::Option::Some;
2984            let mut state = serializer.serialize_map(std::option::Option::None)?;
2985            if !self.data_locations.is_empty() {
2986                state.serialize_entry("dataLocations", &self.data_locations)?;
2987            }
2988            if !self._unknown_fields.is_empty() {
2989                for (key, value) in self._unknown_fields.iter() {
2990                    state.serialize_entry(key, &value)?;
2991                }
2992            }
2993            state.end()
2994        }
2995    }
2996
2997    /// Configuration for a bucket's hierarchical namespace feature.
2998    #[derive(Clone, Debug, Default, PartialEq)]
2999    #[non_exhaustive]
3000    pub struct HierarchicalNamespace {
3001        /// Enables the hierarchical namespace feature.
3002        pub enabled: bool,
3003
3004        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3005    }
3006
3007    impl HierarchicalNamespace {
3008        pub fn new() -> Self {
3009            std::default::Default::default()
3010        }
3011
3012        /// Sets the value of [enabled][crate::model::storage_layout::HierarchicalNamespace::enabled].
3013        pub fn set_enabled<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
3014            self.enabled = v.into();
3015            self
3016        }
3017    }
3018
3019    impl wkt::message::Message for HierarchicalNamespace {
3020        fn typename() -> &'static str {
3021            "type.googleapis.com/google.storage.control.v2.StorageLayout.HierarchicalNamespace"
3022        }
3023    }
3024
3025    #[doc(hidden)]
3026    impl<'de> serde::de::Deserialize<'de> for HierarchicalNamespace {
3027        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3028        where
3029            D: serde::Deserializer<'de>,
3030        {
3031            #[allow(non_camel_case_types)]
3032            #[doc(hidden)]
3033            #[derive(PartialEq, Eq, Hash)]
3034            enum __FieldTag {
3035                __enabled,
3036                Unknown(std::string::String),
3037            }
3038            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3039                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3040                where
3041                    D: serde::Deserializer<'de>,
3042                {
3043                    struct Visitor;
3044                    impl<'de> serde::de::Visitor<'de> for Visitor {
3045                        type Value = __FieldTag;
3046                        fn expecting(
3047                            &self,
3048                            formatter: &mut std::fmt::Formatter,
3049                        ) -> std::fmt::Result {
3050                            formatter.write_str("a field name for HierarchicalNamespace")
3051                        }
3052                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3053                        where
3054                            E: serde::de::Error,
3055                        {
3056                            use std::result::Result::Ok;
3057                            use std::string::ToString;
3058                            match value {
3059                                "enabled" => Ok(__FieldTag::__enabled),
3060                                _ => Ok(__FieldTag::Unknown(value.to_string())),
3061                            }
3062                        }
3063                    }
3064                    deserializer.deserialize_identifier(Visitor)
3065                }
3066            }
3067            struct Visitor;
3068            impl<'de> serde::de::Visitor<'de> for Visitor {
3069                type Value = HierarchicalNamespace;
3070                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3071                    formatter.write_str("struct HierarchicalNamespace")
3072                }
3073                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3074                where
3075                    A: serde::de::MapAccess<'de>,
3076                {
3077                    #[allow(unused_imports)]
3078                    use serde::de::Error;
3079                    use std::option::Option::Some;
3080                    let mut fields = std::collections::HashSet::new();
3081                    let mut result = Self::Value::new();
3082                    while let Some(tag) = map.next_key::<__FieldTag>()? {
3083                        #[allow(clippy::match_single_binding)]
3084                        match tag {
3085                            __FieldTag::__enabled => {
3086                                if !fields.insert(__FieldTag::__enabled) {
3087                                    return std::result::Result::Err(A::Error::duplicate_field(
3088                                        "multiple values for enabled",
3089                                    ));
3090                                }
3091                                result.enabled = map
3092                                    .next_value::<std::option::Option<bool>>()?
3093                                    .unwrap_or_default();
3094                            }
3095                            __FieldTag::Unknown(key) => {
3096                                let value = map.next_value::<serde_json::Value>()?;
3097                                result._unknown_fields.insert(key, value);
3098                            }
3099                        }
3100                    }
3101                    std::result::Result::Ok(result)
3102                }
3103            }
3104            deserializer.deserialize_any(Visitor)
3105        }
3106    }
3107
3108    #[doc(hidden)]
3109    impl serde::ser::Serialize for HierarchicalNamespace {
3110        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3111        where
3112            S: serde::ser::Serializer,
3113        {
3114            use serde::ser::SerializeMap;
3115            #[allow(unused_imports)]
3116            use std::option::Option::Some;
3117            let mut state = serializer.serialize_map(std::option::Option::None)?;
3118            if !wkt::internal::is_default(&self.enabled) {
3119                state.serialize_entry("enabled", &self.enabled)?;
3120            }
3121            if !self._unknown_fields.is_empty() {
3122                for (key, value) in self._unknown_fields.iter() {
3123                    state.serialize_entry(key, &value)?;
3124                }
3125            }
3126            state.end()
3127        }
3128    }
3129}
3130
3131/// Request message for GetStorageLayout.
3132#[derive(Clone, Debug, Default, PartialEq)]
3133#[non_exhaustive]
3134pub struct GetStorageLayoutRequest {
3135    /// Required. The name of the StorageLayout resource.
3136    /// Format: `projects/{project}/buckets/{bucket}/storageLayout`
3137    pub name: std::string::String,
3138
3139    /// An optional prefix used for permission check. It is useful when the caller
3140    /// only has limited permissions under a specific prefix.
3141    pub prefix: std::string::String,
3142
3143    /// Optional. A unique identifier for this request. UUID is the recommended
3144    /// format, but other formats are still accepted.
3145    pub request_id: std::string::String,
3146
3147    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3148}
3149
3150impl GetStorageLayoutRequest {
3151    pub fn new() -> Self {
3152        std::default::Default::default()
3153    }
3154
3155    /// Sets the value of [name][crate::model::GetStorageLayoutRequest::name].
3156    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3157        self.name = v.into();
3158        self
3159    }
3160
3161    /// Sets the value of [prefix][crate::model::GetStorageLayoutRequest::prefix].
3162    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3163        self.prefix = v.into();
3164        self
3165    }
3166
3167    /// Sets the value of [request_id][crate::model::GetStorageLayoutRequest::request_id].
3168    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3169        self.request_id = v.into();
3170        self
3171    }
3172}
3173
3174impl wkt::message::Message for GetStorageLayoutRequest {
3175    fn typename() -> &'static str {
3176        "type.googleapis.com/google.storage.control.v2.GetStorageLayoutRequest"
3177    }
3178}
3179
3180#[doc(hidden)]
3181impl<'de> serde::de::Deserialize<'de> for GetStorageLayoutRequest {
3182    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3183    where
3184        D: serde::Deserializer<'de>,
3185    {
3186        #[allow(non_camel_case_types)]
3187        #[doc(hidden)]
3188        #[derive(PartialEq, Eq, Hash)]
3189        enum __FieldTag {
3190            __name,
3191            __prefix,
3192            __request_id,
3193            Unknown(std::string::String),
3194        }
3195        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3196            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3197            where
3198                D: serde::Deserializer<'de>,
3199            {
3200                struct Visitor;
3201                impl<'de> serde::de::Visitor<'de> for Visitor {
3202                    type Value = __FieldTag;
3203                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3204                        formatter.write_str("a field name for GetStorageLayoutRequest")
3205                    }
3206                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3207                    where
3208                        E: serde::de::Error,
3209                    {
3210                        use std::result::Result::Ok;
3211                        use std::string::ToString;
3212                        match value {
3213                            "name" => Ok(__FieldTag::__name),
3214                            "prefix" => Ok(__FieldTag::__prefix),
3215                            "requestId" => Ok(__FieldTag::__request_id),
3216                            "request_id" => Ok(__FieldTag::__request_id),
3217                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3218                        }
3219                    }
3220                }
3221                deserializer.deserialize_identifier(Visitor)
3222            }
3223        }
3224        struct Visitor;
3225        impl<'de> serde::de::Visitor<'de> for Visitor {
3226            type Value = GetStorageLayoutRequest;
3227            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3228                formatter.write_str("struct GetStorageLayoutRequest")
3229            }
3230            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3231            where
3232                A: serde::de::MapAccess<'de>,
3233            {
3234                #[allow(unused_imports)]
3235                use serde::de::Error;
3236                use std::option::Option::Some;
3237                let mut fields = std::collections::HashSet::new();
3238                let mut result = Self::Value::new();
3239                while let Some(tag) = map.next_key::<__FieldTag>()? {
3240                    #[allow(clippy::match_single_binding)]
3241                    match tag {
3242                        __FieldTag::__name => {
3243                            if !fields.insert(__FieldTag::__name) {
3244                                return std::result::Result::Err(A::Error::duplicate_field(
3245                                    "multiple values for name",
3246                                ));
3247                            }
3248                            result.name = map
3249                                .next_value::<std::option::Option<std::string::String>>()?
3250                                .unwrap_or_default();
3251                        }
3252                        __FieldTag::__prefix => {
3253                            if !fields.insert(__FieldTag::__prefix) {
3254                                return std::result::Result::Err(A::Error::duplicate_field(
3255                                    "multiple values for prefix",
3256                                ));
3257                            }
3258                            result.prefix = map
3259                                .next_value::<std::option::Option<std::string::String>>()?
3260                                .unwrap_or_default();
3261                        }
3262                        __FieldTag::__request_id => {
3263                            if !fields.insert(__FieldTag::__request_id) {
3264                                return std::result::Result::Err(A::Error::duplicate_field(
3265                                    "multiple values for request_id",
3266                                ));
3267                            }
3268                            result.request_id = map
3269                                .next_value::<std::option::Option<std::string::String>>()?
3270                                .unwrap_or_default();
3271                        }
3272                        __FieldTag::Unknown(key) => {
3273                            let value = map.next_value::<serde_json::Value>()?;
3274                            result._unknown_fields.insert(key, value);
3275                        }
3276                    }
3277                }
3278                std::result::Result::Ok(result)
3279            }
3280        }
3281        deserializer.deserialize_any(Visitor)
3282    }
3283}
3284
3285#[doc(hidden)]
3286impl serde::ser::Serialize for GetStorageLayoutRequest {
3287    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3288    where
3289        S: serde::ser::Serializer,
3290    {
3291        use serde::ser::SerializeMap;
3292        #[allow(unused_imports)]
3293        use std::option::Option::Some;
3294        let mut state = serializer.serialize_map(std::option::Option::None)?;
3295        if !self.name.is_empty() {
3296            state.serialize_entry("name", &self.name)?;
3297        }
3298        if !self.prefix.is_empty() {
3299            state.serialize_entry("prefix", &self.prefix)?;
3300        }
3301        if !self.request_id.is_empty() {
3302            state.serialize_entry("requestId", &self.request_id)?;
3303        }
3304        if !self._unknown_fields.is_empty() {
3305            for (key, value) in self._unknown_fields.iter() {
3306                state.serialize_entry(key, &value)?;
3307            }
3308        }
3309        state.end()
3310    }
3311}
3312
3313/// A managed folder.
3314#[derive(Clone, Debug, Default, PartialEq)]
3315#[non_exhaustive]
3316pub struct ManagedFolder {
3317    /// Identifier. The name of this managed folder.
3318    /// Format:
3319    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
3320    pub name: std::string::String,
3321
3322    /// Output only. The metadata version of this managed folder. It increases
3323    /// whenever the metadata is updated. Used for preconditions and for detecting
3324    /// changes in metadata. Managed folders don't have a generation number.
3325    pub metageneration: i64,
3326
3327    /// Output only. The creation time of the managed folder.
3328    pub create_time: std::option::Option<wkt::Timestamp>,
3329
3330    /// Output only. The modification time of the managed folder.
3331    pub update_time: std::option::Option<wkt::Timestamp>,
3332
3333    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3334}
3335
3336impl ManagedFolder {
3337    pub fn new() -> Self {
3338        std::default::Default::default()
3339    }
3340
3341    /// Sets the value of [name][crate::model::ManagedFolder::name].
3342    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3343        self.name = v.into();
3344        self
3345    }
3346
3347    /// Sets the value of [metageneration][crate::model::ManagedFolder::metageneration].
3348    pub fn set_metageneration<T: std::convert::Into<i64>>(mut self, v: T) -> Self {
3349        self.metageneration = v.into();
3350        self
3351    }
3352
3353    /// Sets the value of [create_time][crate::model::ManagedFolder::create_time].
3354    pub fn set_create_time<T>(mut self, v: T) -> Self
3355    where
3356        T: std::convert::Into<wkt::Timestamp>,
3357    {
3358        self.create_time = std::option::Option::Some(v.into());
3359        self
3360    }
3361
3362    /// Sets or clears the value of [create_time][crate::model::ManagedFolder::create_time].
3363    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
3364    where
3365        T: std::convert::Into<wkt::Timestamp>,
3366    {
3367        self.create_time = v.map(|x| x.into());
3368        self
3369    }
3370
3371    /// Sets the value of [update_time][crate::model::ManagedFolder::update_time].
3372    pub fn set_update_time<T>(mut self, v: T) -> Self
3373    where
3374        T: std::convert::Into<wkt::Timestamp>,
3375    {
3376        self.update_time = std::option::Option::Some(v.into());
3377        self
3378    }
3379
3380    /// Sets or clears the value of [update_time][crate::model::ManagedFolder::update_time].
3381    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
3382    where
3383        T: std::convert::Into<wkt::Timestamp>,
3384    {
3385        self.update_time = v.map(|x| x.into());
3386        self
3387    }
3388}
3389
3390impl wkt::message::Message for ManagedFolder {
3391    fn typename() -> &'static str {
3392        "type.googleapis.com/google.storage.control.v2.ManagedFolder"
3393    }
3394}
3395
3396#[doc(hidden)]
3397impl<'de> serde::de::Deserialize<'de> for ManagedFolder {
3398    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3399    where
3400        D: serde::Deserializer<'de>,
3401    {
3402        #[allow(non_camel_case_types)]
3403        #[doc(hidden)]
3404        #[derive(PartialEq, Eq, Hash)]
3405        enum __FieldTag {
3406            __name,
3407            __metageneration,
3408            __create_time,
3409            __update_time,
3410            Unknown(std::string::String),
3411        }
3412        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3413            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3414            where
3415                D: serde::Deserializer<'de>,
3416            {
3417                struct Visitor;
3418                impl<'de> serde::de::Visitor<'de> for Visitor {
3419                    type Value = __FieldTag;
3420                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3421                        formatter.write_str("a field name for ManagedFolder")
3422                    }
3423                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3424                    where
3425                        E: serde::de::Error,
3426                    {
3427                        use std::result::Result::Ok;
3428                        use std::string::ToString;
3429                        match value {
3430                            "name" => Ok(__FieldTag::__name),
3431                            "metageneration" => Ok(__FieldTag::__metageneration),
3432                            "createTime" => Ok(__FieldTag::__create_time),
3433                            "create_time" => Ok(__FieldTag::__create_time),
3434                            "updateTime" => Ok(__FieldTag::__update_time),
3435                            "update_time" => Ok(__FieldTag::__update_time),
3436                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3437                        }
3438                    }
3439                }
3440                deserializer.deserialize_identifier(Visitor)
3441            }
3442        }
3443        struct Visitor;
3444        impl<'de> serde::de::Visitor<'de> for Visitor {
3445            type Value = ManagedFolder;
3446            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3447                formatter.write_str("struct ManagedFolder")
3448            }
3449            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3450            where
3451                A: serde::de::MapAccess<'de>,
3452            {
3453                #[allow(unused_imports)]
3454                use serde::de::Error;
3455                use std::option::Option::Some;
3456                let mut fields = std::collections::HashSet::new();
3457                let mut result = Self::Value::new();
3458                while let Some(tag) = map.next_key::<__FieldTag>()? {
3459                    #[allow(clippy::match_single_binding)]
3460                    match tag {
3461                        __FieldTag::__name => {
3462                            if !fields.insert(__FieldTag::__name) {
3463                                return std::result::Result::Err(A::Error::duplicate_field(
3464                                    "multiple values for name",
3465                                ));
3466                            }
3467                            result.name = map
3468                                .next_value::<std::option::Option<std::string::String>>()?
3469                                .unwrap_or_default();
3470                        }
3471                        __FieldTag::__metageneration => {
3472                            if !fields.insert(__FieldTag::__metageneration) {
3473                                return std::result::Result::Err(A::Error::duplicate_field(
3474                                    "multiple values for metageneration",
3475                                ));
3476                            }
3477                            struct __With(std::option::Option<i64>);
3478                            impl<'de> serde::de::Deserialize<'de> for __With {
3479                                fn deserialize<D>(
3480                                    deserializer: D,
3481                                ) -> std::result::Result<Self, D::Error>
3482                                where
3483                                    D: serde::de::Deserializer<'de>,
3484                                {
3485                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
3486                                }
3487                            }
3488                            result.metageneration =
3489                                map.next_value::<__With>()?.0.unwrap_or_default();
3490                        }
3491                        __FieldTag::__create_time => {
3492                            if !fields.insert(__FieldTag::__create_time) {
3493                                return std::result::Result::Err(A::Error::duplicate_field(
3494                                    "multiple values for create_time",
3495                                ));
3496                            }
3497                            result.create_time =
3498                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
3499                        }
3500                        __FieldTag::__update_time => {
3501                            if !fields.insert(__FieldTag::__update_time) {
3502                                return std::result::Result::Err(A::Error::duplicate_field(
3503                                    "multiple values for update_time",
3504                                ));
3505                            }
3506                            result.update_time =
3507                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
3508                        }
3509                        __FieldTag::Unknown(key) => {
3510                            let value = map.next_value::<serde_json::Value>()?;
3511                            result._unknown_fields.insert(key, value);
3512                        }
3513                    }
3514                }
3515                std::result::Result::Ok(result)
3516            }
3517        }
3518        deserializer.deserialize_any(Visitor)
3519    }
3520}
3521
3522#[doc(hidden)]
3523impl serde::ser::Serialize for ManagedFolder {
3524    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3525    where
3526        S: serde::ser::Serializer,
3527    {
3528        use serde::ser::SerializeMap;
3529        #[allow(unused_imports)]
3530        use std::option::Option::Some;
3531        let mut state = serializer.serialize_map(std::option::Option::None)?;
3532        if !self.name.is_empty() {
3533            state.serialize_entry("name", &self.name)?;
3534        }
3535        if !wkt::internal::is_default(&self.metageneration) {
3536            struct __With<'a>(&'a i64);
3537            impl<'a> serde::ser::Serialize for __With<'a> {
3538                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3539                where
3540                    S: serde::ser::Serializer,
3541                {
3542                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
3543                }
3544            }
3545            state.serialize_entry("metageneration", &__With(&self.metageneration))?;
3546        }
3547        if self.create_time.is_some() {
3548            state.serialize_entry("createTime", &self.create_time)?;
3549        }
3550        if self.update_time.is_some() {
3551            state.serialize_entry("updateTime", &self.update_time)?;
3552        }
3553        if !self._unknown_fields.is_empty() {
3554            for (key, value) in self._unknown_fields.iter() {
3555                state.serialize_entry(key, &value)?;
3556            }
3557        }
3558        state.end()
3559    }
3560}
3561
3562/// Request message for GetManagedFolder.
3563#[derive(Clone, Debug, Default, PartialEq)]
3564#[non_exhaustive]
3565pub struct GetManagedFolderRequest {
3566    /// Required. Name of the managed folder.
3567    /// Format:
3568    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
3569    pub name: std::string::String,
3570
3571    /// The operation succeeds conditional on the managed folder's current
3572    /// metageneration matching the value here specified.
3573    pub if_metageneration_match: std::option::Option<i64>,
3574
3575    /// The operation succeeds conditional on the managed folder's current
3576    /// metageneration NOT matching the value here specified.
3577    pub if_metageneration_not_match: std::option::Option<i64>,
3578
3579    /// Optional. A unique identifier for this request. UUID is the recommended
3580    /// format, but other formats are still accepted.
3581    pub request_id: std::string::String,
3582
3583    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3584}
3585
3586impl GetManagedFolderRequest {
3587    pub fn new() -> Self {
3588        std::default::Default::default()
3589    }
3590
3591    /// Sets the value of [name][crate::model::GetManagedFolderRequest::name].
3592    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3593        self.name = v.into();
3594        self
3595    }
3596
3597    /// Sets the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
3598    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
3599    where
3600        T: std::convert::Into<i64>,
3601    {
3602        self.if_metageneration_match = std::option::Option::Some(v.into());
3603        self
3604    }
3605
3606    /// Sets or clears the value of [if_metageneration_match][crate::model::GetManagedFolderRequest::if_metageneration_match].
3607    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
3608    where
3609        T: std::convert::Into<i64>,
3610    {
3611        self.if_metageneration_match = v.map(|x| x.into());
3612        self
3613    }
3614
3615    /// Sets the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
3616    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
3617    where
3618        T: std::convert::Into<i64>,
3619    {
3620        self.if_metageneration_not_match = std::option::Option::Some(v.into());
3621        self
3622    }
3623
3624    /// Sets or clears the value of [if_metageneration_not_match][crate::model::GetManagedFolderRequest::if_metageneration_not_match].
3625    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
3626    where
3627        T: std::convert::Into<i64>,
3628    {
3629        self.if_metageneration_not_match = v.map(|x| x.into());
3630        self
3631    }
3632
3633    /// Sets the value of [request_id][crate::model::GetManagedFolderRequest::request_id].
3634    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3635        self.request_id = v.into();
3636        self
3637    }
3638}
3639
3640impl wkt::message::Message for GetManagedFolderRequest {
3641    fn typename() -> &'static str {
3642        "type.googleapis.com/google.storage.control.v2.GetManagedFolderRequest"
3643    }
3644}
3645
3646#[doc(hidden)]
3647impl<'de> serde::de::Deserialize<'de> for GetManagedFolderRequest {
3648    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3649    where
3650        D: serde::Deserializer<'de>,
3651    {
3652        #[allow(non_camel_case_types)]
3653        #[doc(hidden)]
3654        #[derive(PartialEq, Eq, Hash)]
3655        enum __FieldTag {
3656            __name,
3657            __if_metageneration_match,
3658            __if_metageneration_not_match,
3659            __request_id,
3660            Unknown(std::string::String),
3661        }
3662        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3663            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3664            where
3665                D: serde::Deserializer<'de>,
3666            {
3667                struct Visitor;
3668                impl<'de> serde::de::Visitor<'de> for Visitor {
3669                    type Value = __FieldTag;
3670                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3671                        formatter.write_str("a field name for GetManagedFolderRequest")
3672                    }
3673                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3674                    where
3675                        E: serde::de::Error,
3676                    {
3677                        use std::result::Result::Ok;
3678                        use std::string::ToString;
3679                        match value {
3680                            "name" => Ok(__FieldTag::__name),
3681                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
3682                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
3683                            "ifMetagenerationNotMatch" => {
3684                                Ok(__FieldTag::__if_metageneration_not_match)
3685                            }
3686                            "if_metageneration_not_match" => {
3687                                Ok(__FieldTag::__if_metageneration_not_match)
3688                            }
3689                            "requestId" => Ok(__FieldTag::__request_id),
3690                            "request_id" => Ok(__FieldTag::__request_id),
3691                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3692                        }
3693                    }
3694                }
3695                deserializer.deserialize_identifier(Visitor)
3696            }
3697        }
3698        struct Visitor;
3699        impl<'de> serde::de::Visitor<'de> for Visitor {
3700            type Value = GetManagedFolderRequest;
3701            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3702                formatter.write_str("struct GetManagedFolderRequest")
3703            }
3704            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3705            where
3706                A: serde::de::MapAccess<'de>,
3707            {
3708                #[allow(unused_imports)]
3709                use serde::de::Error;
3710                use std::option::Option::Some;
3711                let mut fields = std::collections::HashSet::new();
3712                let mut result = Self::Value::new();
3713                while let Some(tag) = map.next_key::<__FieldTag>()? {
3714                    #[allow(clippy::match_single_binding)]
3715                    match tag {
3716                        __FieldTag::__name => {
3717                            if !fields.insert(__FieldTag::__name) {
3718                                return std::result::Result::Err(A::Error::duplicate_field(
3719                                    "multiple values for name",
3720                                ));
3721                            }
3722                            result.name = map
3723                                .next_value::<std::option::Option<std::string::String>>()?
3724                                .unwrap_or_default();
3725                        }
3726                        __FieldTag::__if_metageneration_match => {
3727                            if !fields.insert(__FieldTag::__if_metageneration_match) {
3728                                return std::result::Result::Err(A::Error::duplicate_field(
3729                                    "multiple values for if_metageneration_match",
3730                                ));
3731                            }
3732                            struct __With(std::option::Option<i64>);
3733                            impl<'de> serde::de::Deserialize<'de> for __With {
3734                                fn deserialize<D>(
3735                                    deserializer: D,
3736                                ) -> std::result::Result<Self, D::Error>
3737                                where
3738                                    D: serde::de::Deserializer<'de>,
3739                                {
3740                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
3741                                }
3742                            }
3743                            result.if_metageneration_match = map.next_value::<__With>()?.0;
3744                        }
3745                        __FieldTag::__if_metageneration_not_match => {
3746                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
3747                                return std::result::Result::Err(A::Error::duplicate_field(
3748                                    "multiple values for if_metageneration_not_match",
3749                                ));
3750                            }
3751                            struct __With(std::option::Option<i64>);
3752                            impl<'de> serde::de::Deserialize<'de> for __With {
3753                                fn deserialize<D>(
3754                                    deserializer: D,
3755                                ) -> std::result::Result<Self, D::Error>
3756                                where
3757                                    D: serde::de::Deserializer<'de>,
3758                                {
3759                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
3760                                }
3761                            }
3762                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
3763                        }
3764                        __FieldTag::__request_id => {
3765                            if !fields.insert(__FieldTag::__request_id) {
3766                                return std::result::Result::Err(A::Error::duplicate_field(
3767                                    "multiple values for request_id",
3768                                ));
3769                            }
3770                            result.request_id = map
3771                                .next_value::<std::option::Option<std::string::String>>()?
3772                                .unwrap_or_default();
3773                        }
3774                        __FieldTag::Unknown(key) => {
3775                            let value = map.next_value::<serde_json::Value>()?;
3776                            result._unknown_fields.insert(key, value);
3777                        }
3778                    }
3779                }
3780                std::result::Result::Ok(result)
3781            }
3782        }
3783        deserializer.deserialize_any(Visitor)
3784    }
3785}
3786
3787#[doc(hidden)]
3788impl serde::ser::Serialize for GetManagedFolderRequest {
3789    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3790    where
3791        S: serde::ser::Serializer,
3792    {
3793        use serde::ser::SerializeMap;
3794        #[allow(unused_imports)]
3795        use std::option::Option::Some;
3796        let mut state = serializer.serialize_map(std::option::Option::None)?;
3797        if !self.name.is_empty() {
3798            state.serialize_entry("name", &self.name)?;
3799        }
3800        if self.if_metageneration_match.is_some() {
3801            struct __With<'a>(&'a std::option::Option<i64>);
3802            impl<'a> serde::ser::Serialize for __With<'a> {
3803                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3804                where
3805                    S: serde::ser::Serializer,
3806                {
3807                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
3808                        self.0, serializer,
3809                    )
3810                }
3811            }
3812            state.serialize_entry(
3813                "ifMetagenerationMatch",
3814                &__With(&self.if_metageneration_match),
3815            )?;
3816        }
3817        if self.if_metageneration_not_match.is_some() {
3818            struct __With<'a>(&'a std::option::Option<i64>);
3819            impl<'a> serde::ser::Serialize for __With<'a> {
3820                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
3821                where
3822                    S: serde::ser::Serializer,
3823                {
3824                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
3825                        self.0, serializer,
3826                    )
3827                }
3828            }
3829            state.serialize_entry(
3830                "ifMetagenerationNotMatch",
3831                &__With(&self.if_metageneration_not_match),
3832            )?;
3833        }
3834        if !self.request_id.is_empty() {
3835            state.serialize_entry("requestId", &self.request_id)?;
3836        }
3837        if !self._unknown_fields.is_empty() {
3838            for (key, value) in self._unknown_fields.iter() {
3839                state.serialize_entry(key, &value)?;
3840            }
3841        }
3842        state.end()
3843    }
3844}
3845
3846/// Request message for CreateManagedFolder.
3847#[derive(Clone, Debug, Default, PartialEq)]
3848#[non_exhaustive]
3849pub struct CreateManagedFolderRequest {
3850    /// Required. Name of the bucket this managed folder belongs to.
3851    pub parent: std::string::String,
3852
3853    /// Required. Properties of the managed folder being created.
3854    /// The bucket and managed folder names are specified in the `parent` and
3855    /// `managed_folder_id` fields. Populating these fields in `managed_folder`
3856    /// will result in an error.
3857    pub managed_folder: std::option::Option<crate::model::ManagedFolder>,
3858
3859    /// Required. The name of the managed folder. It uses a single `/` as delimiter
3860    /// and leading and trailing `/` are allowed.
3861    pub managed_folder_id: std::string::String,
3862
3863    /// Optional. A unique identifier for this request. UUID is the recommended
3864    /// format, but other formats are still accepted.
3865    pub request_id: std::string::String,
3866
3867    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
3868}
3869
3870impl CreateManagedFolderRequest {
3871    pub fn new() -> Self {
3872        std::default::Default::default()
3873    }
3874
3875    /// Sets the value of [parent][crate::model::CreateManagedFolderRequest::parent].
3876    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3877        self.parent = v.into();
3878        self
3879    }
3880
3881    /// Sets the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
3882    pub fn set_managed_folder<T>(mut self, v: T) -> Self
3883    where
3884        T: std::convert::Into<crate::model::ManagedFolder>,
3885    {
3886        self.managed_folder = std::option::Option::Some(v.into());
3887        self
3888    }
3889
3890    /// Sets or clears the value of [managed_folder][crate::model::CreateManagedFolderRequest::managed_folder].
3891    pub fn set_or_clear_managed_folder<T>(mut self, v: std::option::Option<T>) -> Self
3892    where
3893        T: std::convert::Into<crate::model::ManagedFolder>,
3894    {
3895        self.managed_folder = v.map(|x| x.into());
3896        self
3897    }
3898
3899    /// Sets the value of [managed_folder_id][crate::model::CreateManagedFolderRequest::managed_folder_id].
3900    pub fn set_managed_folder_id<T: std::convert::Into<std::string::String>>(
3901        mut self,
3902        v: T,
3903    ) -> Self {
3904        self.managed_folder_id = v.into();
3905        self
3906    }
3907
3908    /// Sets the value of [request_id][crate::model::CreateManagedFolderRequest::request_id].
3909    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
3910        self.request_id = v.into();
3911        self
3912    }
3913}
3914
3915impl wkt::message::Message for CreateManagedFolderRequest {
3916    fn typename() -> &'static str {
3917        "type.googleapis.com/google.storage.control.v2.CreateManagedFolderRequest"
3918    }
3919}
3920
3921#[doc(hidden)]
3922impl<'de> serde::de::Deserialize<'de> for CreateManagedFolderRequest {
3923    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3924    where
3925        D: serde::Deserializer<'de>,
3926    {
3927        #[allow(non_camel_case_types)]
3928        #[doc(hidden)]
3929        #[derive(PartialEq, Eq, Hash)]
3930        enum __FieldTag {
3931            __parent,
3932            __managed_folder,
3933            __managed_folder_id,
3934            __request_id,
3935            Unknown(std::string::String),
3936        }
3937        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
3938            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
3939            where
3940                D: serde::Deserializer<'de>,
3941            {
3942                struct Visitor;
3943                impl<'de> serde::de::Visitor<'de> for Visitor {
3944                    type Value = __FieldTag;
3945                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3946                        formatter.write_str("a field name for CreateManagedFolderRequest")
3947                    }
3948                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
3949                    where
3950                        E: serde::de::Error,
3951                    {
3952                        use std::result::Result::Ok;
3953                        use std::string::ToString;
3954                        match value {
3955                            "parent" => Ok(__FieldTag::__parent),
3956                            "managedFolder" => Ok(__FieldTag::__managed_folder),
3957                            "managed_folder" => Ok(__FieldTag::__managed_folder),
3958                            "managedFolderId" => Ok(__FieldTag::__managed_folder_id),
3959                            "managed_folder_id" => Ok(__FieldTag::__managed_folder_id),
3960                            "requestId" => Ok(__FieldTag::__request_id),
3961                            "request_id" => Ok(__FieldTag::__request_id),
3962                            _ => Ok(__FieldTag::Unknown(value.to_string())),
3963                        }
3964                    }
3965                }
3966                deserializer.deserialize_identifier(Visitor)
3967            }
3968        }
3969        struct Visitor;
3970        impl<'de> serde::de::Visitor<'de> for Visitor {
3971            type Value = CreateManagedFolderRequest;
3972            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
3973                formatter.write_str("struct CreateManagedFolderRequest")
3974            }
3975            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
3976            where
3977                A: serde::de::MapAccess<'de>,
3978            {
3979                #[allow(unused_imports)]
3980                use serde::de::Error;
3981                use std::option::Option::Some;
3982                let mut fields = std::collections::HashSet::new();
3983                let mut result = Self::Value::new();
3984                while let Some(tag) = map.next_key::<__FieldTag>()? {
3985                    #[allow(clippy::match_single_binding)]
3986                    match tag {
3987                        __FieldTag::__parent => {
3988                            if !fields.insert(__FieldTag::__parent) {
3989                                return std::result::Result::Err(A::Error::duplicate_field(
3990                                    "multiple values for parent",
3991                                ));
3992                            }
3993                            result.parent = map
3994                                .next_value::<std::option::Option<std::string::String>>()?
3995                                .unwrap_or_default();
3996                        }
3997                        __FieldTag::__managed_folder => {
3998                            if !fields.insert(__FieldTag::__managed_folder) {
3999                                return std::result::Result::Err(A::Error::duplicate_field(
4000                                    "multiple values for managed_folder",
4001                                ));
4002                            }
4003                            result.managed_folder = map
4004                                .next_value::<std::option::Option<crate::model::ManagedFolder>>()?;
4005                        }
4006                        __FieldTag::__managed_folder_id => {
4007                            if !fields.insert(__FieldTag::__managed_folder_id) {
4008                                return std::result::Result::Err(A::Error::duplicate_field(
4009                                    "multiple values for managed_folder_id",
4010                                ));
4011                            }
4012                            result.managed_folder_id = map
4013                                .next_value::<std::option::Option<std::string::String>>()?
4014                                .unwrap_or_default();
4015                        }
4016                        __FieldTag::__request_id => {
4017                            if !fields.insert(__FieldTag::__request_id) {
4018                                return std::result::Result::Err(A::Error::duplicate_field(
4019                                    "multiple values for request_id",
4020                                ));
4021                            }
4022                            result.request_id = map
4023                                .next_value::<std::option::Option<std::string::String>>()?
4024                                .unwrap_or_default();
4025                        }
4026                        __FieldTag::Unknown(key) => {
4027                            let value = map.next_value::<serde_json::Value>()?;
4028                            result._unknown_fields.insert(key, value);
4029                        }
4030                    }
4031                }
4032                std::result::Result::Ok(result)
4033            }
4034        }
4035        deserializer.deserialize_any(Visitor)
4036    }
4037}
4038
4039#[doc(hidden)]
4040impl serde::ser::Serialize for CreateManagedFolderRequest {
4041    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4042    where
4043        S: serde::ser::Serializer,
4044    {
4045        use serde::ser::SerializeMap;
4046        #[allow(unused_imports)]
4047        use std::option::Option::Some;
4048        let mut state = serializer.serialize_map(std::option::Option::None)?;
4049        if !self.parent.is_empty() {
4050            state.serialize_entry("parent", &self.parent)?;
4051        }
4052        if self.managed_folder.is_some() {
4053            state.serialize_entry("managedFolder", &self.managed_folder)?;
4054        }
4055        if !self.managed_folder_id.is_empty() {
4056            state.serialize_entry("managedFolderId", &self.managed_folder_id)?;
4057        }
4058        if !self.request_id.is_empty() {
4059            state.serialize_entry("requestId", &self.request_id)?;
4060        }
4061        if !self._unknown_fields.is_empty() {
4062            for (key, value) in self._unknown_fields.iter() {
4063                state.serialize_entry(key, &value)?;
4064            }
4065        }
4066        state.end()
4067    }
4068}
4069
4070/// DeleteManagedFolder RPC request message.
4071#[derive(Clone, Debug, Default, PartialEq)]
4072#[non_exhaustive]
4073pub struct DeleteManagedFolderRequest {
4074    /// Required. Name of the managed folder.
4075    /// Format:
4076    /// `projects/{project}/buckets/{bucket}/managedFolders/{managedFolder}`
4077    pub name: std::string::String,
4078
4079    /// The operation succeeds conditional on the managed folder's current
4080    /// metageneration matching the value here specified.
4081    pub if_metageneration_match: std::option::Option<i64>,
4082
4083    /// The operation succeeds conditional on the managed folder's current
4084    /// metageneration NOT matching the value here specified.
4085    pub if_metageneration_not_match: std::option::Option<i64>,
4086
4087    /// Allows deletion of a managed folder even if it is not empty.
4088    /// A managed folder is empty if it manages no child managed folders or
4089    /// objects. Caller must have permission for
4090    /// storage.managedFolders.setIamPolicy.
4091    pub allow_non_empty: bool,
4092
4093    /// Optional. A unique identifier for this request. UUID is the recommended
4094    /// format, but other formats are still accepted.
4095    pub request_id: std::string::String,
4096
4097    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4098}
4099
4100impl DeleteManagedFolderRequest {
4101    pub fn new() -> Self {
4102        std::default::Default::default()
4103    }
4104
4105    /// Sets the value of [name][crate::model::DeleteManagedFolderRequest::name].
4106    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4107        self.name = v.into();
4108        self
4109    }
4110
4111    /// Sets the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
4112    pub fn set_if_metageneration_match<T>(mut self, v: T) -> Self
4113    where
4114        T: std::convert::Into<i64>,
4115    {
4116        self.if_metageneration_match = std::option::Option::Some(v.into());
4117        self
4118    }
4119
4120    /// Sets or clears the value of [if_metageneration_match][crate::model::DeleteManagedFolderRequest::if_metageneration_match].
4121    pub fn set_or_clear_if_metageneration_match<T>(mut self, v: std::option::Option<T>) -> Self
4122    where
4123        T: std::convert::Into<i64>,
4124    {
4125        self.if_metageneration_match = v.map(|x| x.into());
4126        self
4127    }
4128
4129    /// Sets the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
4130    pub fn set_if_metageneration_not_match<T>(mut self, v: T) -> Self
4131    where
4132        T: std::convert::Into<i64>,
4133    {
4134        self.if_metageneration_not_match = std::option::Option::Some(v.into());
4135        self
4136    }
4137
4138    /// Sets or clears the value of [if_metageneration_not_match][crate::model::DeleteManagedFolderRequest::if_metageneration_not_match].
4139    pub fn set_or_clear_if_metageneration_not_match<T>(mut self, v: std::option::Option<T>) -> Self
4140    where
4141        T: std::convert::Into<i64>,
4142    {
4143        self.if_metageneration_not_match = v.map(|x| x.into());
4144        self
4145    }
4146
4147    /// Sets the value of [allow_non_empty][crate::model::DeleteManagedFolderRequest::allow_non_empty].
4148    pub fn set_allow_non_empty<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
4149        self.allow_non_empty = v.into();
4150        self
4151    }
4152
4153    /// Sets the value of [request_id][crate::model::DeleteManagedFolderRequest::request_id].
4154    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4155        self.request_id = v.into();
4156        self
4157    }
4158}
4159
4160impl wkt::message::Message for DeleteManagedFolderRequest {
4161    fn typename() -> &'static str {
4162        "type.googleapis.com/google.storage.control.v2.DeleteManagedFolderRequest"
4163    }
4164}
4165
4166#[doc(hidden)]
4167impl<'de> serde::de::Deserialize<'de> for DeleteManagedFolderRequest {
4168    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4169    where
4170        D: serde::Deserializer<'de>,
4171    {
4172        #[allow(non_camel_case_types)]
4173        #[doc(hidden)]
4174        #[derive(PartialEq, Eq, Hash)]
4175        enum __FieldTag {
4176            __name,
4177            __if_metageneration_match,
4178            __if_metageneration_not_match,
4179            __allow_non_empty,
4180            __request_id,
4181            Unknown(std::string::String),
4182        }
4183        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4184            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4185            where
4186                D: serde::Deserializer<'de>,
4187            {
4188                struct Visitor;
4189                impl<'de> serde::de::Visitor<'de> for Visitor {
4190                    type Value = __FieldTag;
4191                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4192                        formatter.write_str("a field name for DeleteManagedFolderRequest")
4193                    }
4194                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4195                    where
4196                        E: serde::de::Error,
4197                    {
4198                        use std::result::Result::Ok;
4199                        use std::string::ToString;
4200                        match value {
4201                            "name" => Ok(__FieldTag::__name),
4202                            "ifMetagenerationMatch" => Ok(__FieldTag::__if_metageneration_match),
4203                            "if_metageneration_match" => Ok(__FieldTag::__if_metageneration_match),
4204                            "ifMetagenerationNotMatch" => {
4205                                Ok(__FieldTag::__if_metageneration_not_match)
4206                            }
4207                            "if_metageneration_not_match" => {
4208                                Ok(__FieldTag::__if_metageneration_not_match)
4209                            }
4210                            "allowNonEmpty" => Ok(__FieldTag::__allow_non_empty),
4211                            "allow_non_empty" => Ok(__FieldTag::__allow_non_empty),
4212                            "requestId" => Ok(__FieldTag::__request_id),
4213                            "request_id" => Ok(__FieldTag::__request_id),
4214                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4215                        }
4216                    }
4217                }
4218                deserializer.deserialize_identifier(Visitor)
4219            }
4220        }
4221        struct Visitor;
4222        impl<'de> serde::de::Visitor<'de> for Visitor {
4223            type Value = DeleteManagedFolderRequest;
4224            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4225                formatter.write_str("struct DeleteManagedFolderRequest")
4226            }
4227            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4228            where
4229                A: serde::de::MapAccess<'de>,
4230            {
4231                #[allow(unused_imports)]
4232                use serde::de::Error;
4233                use std::option::Option::Some;
4234                let mut fields = std::collections::HashSet::new();
4235                let mut result = Self::Value::new();
4236                while let Some(tag) = map.next_key::<__FieldTag>()? {
4237                    #[allow(clippy::match_single_binding)]
4238                    match tag {
4239                        __FieldTag::__name => {
4240                            if !fields.insert(__FieldTag::__name) {
4241                                return std::result::Result::Err(A::Error::duplicate_field(
4242                                    "multiple values for name",
4243                                ));
4244                            }
4245                            result.name = map
4246                                .next_value::<std::option::Option<std::string::String>>()?
4247                                .unwrap_or_default();
4248                        }
4249                        __FieldTag::__if_metageneration_match => {
4250                            if !fields.insert(__FieldTag::__if_metageneration_match) {
4251                                return std::result::Result::Err(A::Error::duplicate_field(
4252                                    "multiple values for if_metageneration_match",
4253                                ));
4254                            }
4255                            struct __With(std::option::Option<i64>);
4256                            impl<'de> serde::de::Deserialize<'de> for __With {
4257                                fn deserialize<D>(
4258                                    deserializer: D,
4259                                ) -> std::result::Result<Self, D::Error>
4260                                where
4261                                    D: serde::de::Deserializer<'de>,
4262                                {
4263                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
4264                                }
4265                            }
4266                            result.if_metageneration_match = map.next_value::<__With>()?.0;
4267                        }
4268                        __FieldTag::__if_metageneration_not_match => {
4269                            if !fields.insert(__FieldTag::__if_metageneration_not_match) {
4270                                return std::result::Result::Err(A::Error::duplicate_field(
4271                                    "multiple values for if_metageneration_not_match",
4272                                ));
4273                            }
4274                            struct __With(std::option::Option<i64>);
4275                            impl<'de> serde::de::Deserialize<'de> for __With {
4276                                fn deserialize<D>(
4277                                    deserializer: D,
4278                                ) -> std::result::Result<Self, D::Error>
4279                                where
4280                                    D: serde::de::Deserializer<'de>,
4281                                {
4282                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
4283                                }
4284                            }
4285                            result.if_metageneration_not_match = map.next_value::<__With>()?.0;
4286                        }
4287                        __FieldTag::__allow_non_empty => {
4288                            if !fields.insert(__FieldTag::__allow_non_empty) {
4289                                return std::result::Result::Err(A::Error::duplicate_field(
4290                                    "multiple values for allow_non_empty",
4291                                ));
4292                            }
4293                            result.allow_non_empty = map
4294                                .next_value::<std::option::Option<bool>>()?
4295                                .unwrap_or_default();
4296                        }
4297                        __FieldTag::__request_id => {
4298                            if !fields.insert(__FieldTag::__request_id) {
4299                                return std::result::Result::Err(A::Error::duplicate_field(
4300                                    "multiple values for request_id",
4301                                ));
4302                            }
4303                            result.request_id = map
4304                                .next_value::<std::option::Option<std::string::String>>()?
4305                                .unwrap_or_default();
4306                        }
4307                        __FieldTag::Unknown(key) => {
4308                            let value = map.next_value::<serde_json::Value>()?;
4309                            result._unknown_fields.insert(key, value);
4310                        }
4311                    }
4312                }
4313                std::result::Result::Ok(result)
4314            }
4315        }
4316        deserializer.deserialize_any(Visitor)
4317    }
4318}
4319
4320#[doc(hidden)]
4321impl serde::ser::Serialize for DeleteManagedFolderRequest {
4322    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4323    where
4324        S: serde::ser::Serializer,
4325    {
4326        use serde::ser::SerializeMap;
4327        #[allow(unused_imports)]
4328        use std::option::Option::Some;
4329        let mut state = serializer.serialize_map(std::option::Option::None)?;
4330        if !self.name.is_empty() {
4331            state.serialize_entry("name", &self.name)?;
4332        }
4333        if self.if_metageneration_match.is_some() {
4334            struct __With<'a>(&'a std::option::Option<i64>);
4335            impl<'a> serde::ser::Serialize for __With<'a> {
4336                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4337                where
4338                    S: serde::ser::Serializer,
4339                {
4340                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
4341                        self.0, serializer,
4342                    )
4343                }
4344            }
4345            state.serialize_entry(
4346                "ifMetagenerationMatch",
4347                &__With(&self.if_metageneration_match),
4348            )?;
4349        }
4350        if self.if_metageneration_not_match.is_some() {
4351            struct __With<'a>(&'a std::option::Option<i64>);
4352            impl<'a> serde::ser::Serialize for __With<'a> {
4353                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4354                where
4355                    S: serde::ser::Serializer,
4356                {
4357                    serde_with::As::<std::option::Option<wkt::internal::I64>>::serialize(
4358                        self.0, serializer,
4359                    )
4360                }
4361            }
4362            state.serialize_entry(
4363                "ifMetagenerationNotMatch",
4364                &__With(&self.if_metageneration_not_match),
4365            )?;
4366        }
4367        if !wkt::internal::is_default(&self.allow_non_empty) {
4368            state.serialize_entry("allowNonEmpty", &self.allow_non_empty)?;
4369        }
4370        if !self.request_id.is_empty() {
4371            state.serialize_entry("requestId", &self.request_id)?;
4372        }
4373        if !self._unknown_fields.is_empty() {
4374            for (key, value) in self._unknown_fields.iter() {
4375                state.serialize_entry(key, &value)?;
4376            }
4377        }
4378        state.end()
4379    }
4380}
4381
4382/// Request message for ListManagedFolders.
4383#[derive(Clone, Debug, Default, PartialEq)]
4384#[non_exhaustive]
4385pub struct ListManagedFoldersRequest {
4386    /// Required. Name of the bucket this managed folder belongs to.
4387    pub parent: std::string::String,
4388
4389    /// Optional. Maximum number of managed folders to return in a single response.
4390    /// The service will use this parameter or 1,000 items, whichever is smaller.
4391    pub page_size: i32,
4392
4393    /// Optional. A previously-returned page token representing part of the larger
4394    /// set of results to view.
4395    pub page_token: std::string::String,
4396
4397    /// Optional. Filter results to match managed folders with name starting with
4398    /// this prefix.
4399    pub prefix: std::string::String,
4400
4401    /// Optional. A unique identifier for this request. UUID is the recommended
4402    /// format, but other formats are still accepted.
4403    pub request_id: std::string::String,
4404
4405    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4406}
4407
4408impl ListManagedFoldersRequest {
4409    pub fn new() -> Self {
4410        std::default::Default::default()
4411    }
4412
4413    /// Sets the value of [parent][crate::model::ListManagedFoldersRequest::parent].
4414    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4415        self.parent = v.into();
4416        self
4417    }
4418
4419    /// Sets the value of [page_size][crate::model::ListManagedFoldersRequest::page_size].
4420    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
4421        self.page_size = v.into();
4422        self
4423    }
4424
4425    /// Sets the value of [page_token][crate::model::ListManagedFoldersRequest::page_token].
4426    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4427        self.page_token = v.into();
4428        self
4429    }
4430
4431    /// Sets the value of [prefix][crate::model::ListManagedFoldersRequest::prefix].
4432    pub fn set_prefix<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4433        self.prefix = v.into();
4434        self
4435    }
4436
4437    /// Sets the value of [request_id][crate::model::ListManagedFoldersRequest::request_id].
4438    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4439        self.request_id = v.into();
4440        self
4441    }
4442}
4443
4444impl wkt::message::Message for ListManagedFoldersRequest {
4445    fn typename() -> &'static str {
4446        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersRequest"
4447    }
4448}
4449
4450#[doc(hidden)]
4451impl<'de> serde::de::Deserialize<'de> for ListManagedFoldersRequest {
4452    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4453    where
4454        D: serde::Deserializer<'de>,
4455    {
4456        #[allow(non_camel_case_types)]
4457        #[doc(hidden)]
4458        #[derive(PartialEq, Eq, Hash)]
4459        enum __FieldTag {
4460            __parent,
4461            __page_size,
4462            __page_token,
4463            __prefix,
4464            __request_id,
4465            Unknown(std::string::String),
4466        }
4467        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4468            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4469            where
4470                D: serde::Deserializer<'de>,
4471            {
4472                struct Visitor;
4473                impl<'de> serde::de::Visitor<'de> for Visitor {
4474                    type Value = __FieldTag;
4475                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4476                        formatter.write_str("a field name for ListManagedFoldersRequest")
4477                    }
4478                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4479                    where
4480                        E: serde::de::Error,
4481                    {
4482                        use std::result::Result::Ok;
4483                        use std::string::ToString;
4484                        match value {
4485                            "parent" => Ok(__FieldTag::__parent),
4486                            "pageSize" => Ok(__FieldTag::__page_size),
4487                            "page_size" => Ok(__FieldTag::__page_size),
4488                            "pageToken" => Ok(__FieldTag::__page_token),
4489                            "page_token" => Ok(__FieldTag::__page_token),
4490                            "prefix" => Ok(__FieldTag::__prefix),
4491                            "requestId" => Ok(__FieldTag::__request_id),
4492                            "request_id" => Ok(__FieldTag::__request_id),
4493                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4494                        }
4495                    }
4496                }
4497                deserializer.deserialize_identifier(Visitor)
4498            }
4499        }
4500        struct Visitor;
4501        impl<'de> serde::de::Visitor<'de> for Visitor {
4502            type Value = ListManagedFoldersRequest;
4503            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4504                formatter.write_str("struct ListManagedFoldersRequest")
4505            }
4506            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4507            where
4508                A: serde::de::MapAccess<'de>,
4509            {
4510                #[allow(unused_imports)]
4511                use serde::de::Error;
4512                use std::option::Option::Some;
4513                let mut fields = std::collections::HashSet::new();
4514                let mut result = Self::Value::new();
4515                while let Some(tag) = map.next_key::<__FieldTag>()? {
4516                    #[allow(clippy::match_single_binding)]
4517                    match tag {
4518                        __FieldTag::__parent => {
4519                            if !fields.insert(__FieldTag::__parent) {
4520                                return std::result::Result::Err(A::Error::duplicate_field(
4521                                    "multiple values for parent",
4522                                ));
4523                            }
4524                            result.parent = map
4525                                .next_value::<std::option::Option<std::string::String>>()?
4526                                .unwrap_or_default();
4527                        }
4528                        __FieldTag::__page_size => {
4529                            if !fields.insert(__FieldTag::__page_size) {
4530                                return std::result::Result::Err(A::Error::duplicate_field(
4531                                    "multiple values for page_size",
4532                                ));
4533                            }
4534                            struct __With(std::option::Option<i32>);
4535                            impl<'de> serde::de::Deserialize<'de> for __With {
4536                                fn deserialize<D>(
4537                                    deserializer: D,
4538                                ) -> std::result::Result<Self, D::Error>
4539                                where
4540                                    D: serde::de::Deserializer<'de>,
4541                                {
4542                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
4543                                }
4544                            }
4545                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
4546                        }
4547                        __FieldTag::__page_token => {
4548                            if !fields.insert(__FieldTag::__page_token) {
4549                                return std::result::Result::Err(A::Error::duplicate_field(
4550                                    "multiple values for page_token",
4551                                ));
4552                            }
4553                            result.page_token = map
4554                                .next_value::<std::option::Option<std::string::String>>()?
4555                                .unwrap_or_default();
4556                        }
4557                        __FieldTag::__prefix => {
4558                            if !fields.insert(__FieldTag::__prefix) {
4559                                return std::result::Result::Err(A::Error::duplicate_field(
4560                                    "multiple values for prefix",
4561                                ));
4562                            }
4563                            result.prefix = map
4564                                .next_value::<std::option::Option<std::string::String>>()?
4565                                .unwrap_or_default();
4566                        }
4567                        __FieldTag::__request_id => {
4568                            if !fields.insert(__FieldTag::__request_id) {
4569                                return std::result::Result::Err(A::Error::duplicate_field(
4570                                    "multiple values for request_id",
4571                                ));
4572                            }
4573                            result.request_id = map
4574                                .next_value::<std::option::Option<std::string::String>>()?
4575                                .unwrap_or_default();
4576                        }
4577                        __FieldTag::Unknown(key) => {
4578                            let value = map.next_value::<serde_json::Value>()?;
4579                            result._unknown_fields.insert(key, value);
4580                        }
4581                    }
4582                }
4583                std::result::Result::Ok(result)
4584            }
4585        }
4586        deserializer.deserialize_any(Visitor)
4587    }
4588}
4589
4590#[doc(hidden)]
4591impl serde::ser::Serialize for ListManagedFoldersRequest {
4592    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4593    where
4594        S: serde::ser::Serializer,
4595    {
4596        use serde::ser::SerializeMap;
4597        #[allow(unused_imports)]
4598        use std::option::Option::Some;
4599        let mut state = serializer.serialize_map(std::option::Option::None)?;
4600        if !self.parent.is_empty() {
4601            state.serialize_entry("parent", &self.parent)?;
4602        }
4603        if !wkt::internal::is_default(&self.page_size) {
4604            struct __With<'a>(&'a i32);
4605            impl<'a> serde::ser::Serialize for __With<'a> {
4606                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4607                where
4608                    S: serde::ser::Serializer,
4609                {
4610                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
4611                }
4612            }
4613            state.serialize_entry("pageSize", &__With(&self.page_size))?;
4614        }
4615        if !self.page_token.is_empty() {
4616            state.serialize_entry("pageToken", &self.page_token)?;
4617        }
4618        if !self.prefix.is_empty() {
4619            state.serialize_entry("prefix", &self.prefix)?;
4620        }
4621        if !self.request_id.is_empty() {
4622            state.serialize_entry("requestId", &self.request_id)?;
4623        }
4624        if !self._unknown_fields.is_empty() {
4625            for (key, value) in self._unknown_fields.iter() {
4626                state.serialize_entry(key, &value)?;
4627            }
4628        }
4629        state.end()
4630    }
4631}
4632
4633/// Response message for ListManagedFolders.
4634#[derive(Clone, Debug, Default, PartialEq)]
4635#[non_exhaustive]
4636pub struct ListManagedFoldersResponse {
4637    /// The list of matching managed folders
4638    pub managed_folders: std::vec::Vec<crate::model::ManagedFolder>,
4639
4640    /// The continuation token, used to page through large result sets. Provide
4641    /// this value in a subsequent request to return the next page of results.
4642    pub next_page_token: std::string::String,
4643
4644    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4645}
4646
4647impl ListManagedFoldersResponse {
4648    pub fn new() -> Self {
4649        std::default::Default::default()
4650    }
4651
4652    /// Sets the value of [managed_folders][crate::model::ListManagedFoldersResponse::managed_folders].
4653    pub fn set_managed_folders<T, V>(mut self, v: T) -> Self
4654    where
4655        T: std::iter::IntoIterator<Item = V>,
4656        V: std::convert::Into<crate::model::ManagedFolder>,
4657    {
4658        use std::iter::Iterator;
4659        self.managed_folders = v.into_iter().map(|i| i.into()).collect();
4660        self
4661    }
4662
4663    /// Sets the value of [next_page_token][crate::model::ListManagedFoldersResponse::next_page_token].
4664    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
4665        self.next_page_token = v.into();
4666        self
4667    }
4668}
4669
4670impl wkt::message::Message for ListManagedFoldersResponse {
4671    fn typename() -> &'static str {
4672        "type.googleapis.com/google.storage.control.v2.ListManagedFoldersResponse"
4673    }
4674}
4675
4676#[doc(hidden)]
4677impl gax::paginator::internal::PageableResponse for ListManagedFoldersResponse {
4678    type PageItem = crate::model::ManagedFolder;
4679
4680    fn items(self) -> std::vec::Vec<Self::PageItem> {
4681        self.managed_folders
4682    }
4683
4684    fn next_page_token(&self) -> std::string::String {
4685        use std::clone::Clone;
4686        self.next_page_token.clone()
4687    }
4688}
4689
4690#[doc(hidden)]
4691impl<'de> serde::de::Deserialize<'de> for ListManagedFoldersResponse {
4692    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4693    where
4694        D: serde::Deserializer<'de>,
4695    {
4696        #[allow(non_camel_case_types)]
4697        #[doc(hidden)]
4698        #[derive(PartialEq, Eq, Hash)]
4699        enum __FieldTag {
4700            __managed_folders,
4701            __next_page_token,
4702            Unknown(std::string::String),
4703        }
4704        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4705            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4706            where
4707                D: serde::Deserializer<'de>,
4708            {
4709                struct Visitor;
4710                impl<'de> serde::de::Visitor<'de> for Visitor {
4711                    type Value = __FieldTag;
4712                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4713                        formatter.write_str("a field name for ListManagedFoldersResponse")
4714                    }
4715                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4716                    where
4717                        E: serde::de::Error,
4718                    {
4719                        use std::result::Result::Ok;
4720                        use std::string::ToString;
4721                        match value {
4722                            "managedFolders" => Ok(__FieldTag::__managed_folders),
4723                            "managed_folders" => Ok(__FieldTag::__managed_folders),
4724                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
4725                            "next_page_token" => Ok(__FieldTag::__next_page_token),
4726                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4727                        }
4728                    }
4729                }
4730                deserializer.deserialize_identifier(Visitor)
4731            }
4732        }
4733        struct Visitor;
4734        impl<'de> serde::de::Visitor<'de> for Visitor {
4735            type Value = ListManagedFoldersResponse;
4736            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4737                formatter.write_str("struct ListManagedFoldersResponse")
4738            }
4739            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4740            where
4741                A: serde::de::MapAccess<'de>,
4742            {
4743                #[allow(unused_imports)]
4744                use serde::de::Error;
4745                use std::option::Option::Some;
4746                let mut fields = std::collections::HashSet::new();
4747                let mut result = Self::Value::new();
4748                while let Some(tag) = map.next_key::<__FieldTag>()? {
4749                    #[allow(clippy::match_single_binding)]
4750                    match tag {
4751                        __FieldTag::__managed_folders => {
4752                            if !fields.insert(__FieldTag::__managed_folders) {
4753                                return std::result::Result::Err(A::Error::duplicate_field(
4754                                    "multiple values for managed_folders",
4755                                ));
4756                            }
4757                            result.managed_folders = map.next_value::<std::option::Option<std::vec::Vec<crate::model::ManagedFolder>>>()?.unwrap_or_default();
4758                        }
4759                        __FieldTag::__next_page_token => {
4760                            if !fields.insert(__FieldTag::__next_page_token) {
4761                                return std::result::Result::Err(A::Error::duplicate_field(
4762                                    "multiple values for next_page_token",
4763                                ));
4764                            }
4765                            result.next_page_token = map
4766                                .next_value::<std::option::Option<std::string::String>>()?
4767                                .unwrap_or_default();
4768                        }
4769                        __FieldTag::Unknown(key) => {
4770                            let value = map.next_value::<serde_json::Value>()?;
4771                            result._unknown_fields.insert(key, value);
4772                        }
4773                    }
4774                }
4775                std::result::Result::Ok(result)
4776            }
4777        }
4778        deserializer.deserialize_any(Visitor)
4779    }
4780}
4781
4782#[doc(hidden)]
4783impl serde::ser::Serialize for ListManagedFoldersResponse {
4784    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
4785    where
4786        S: serde::ser::Serializer,
4787    {
4788        use serde::ser::SerializeMap;
4789        #[allow(unused_imports)]
4790        use std::option::Option::Some;
4791        let mut state = serializer.serialize_map(std::option::Option::None)?;
4792        if !self.managed_folders.is_empty() {
4793            state.serialize_entry("managedFolders", &self.managed_folders)?;
4794        }
4795        if !self.next_page_token.is_empty() {
4796            state.serialize_entry("nextPageToken", &self.next_page_token)?;
4797        }
4798        if !self._unknown_fields.is_empty() {
4799            for (key, value) in self._unknown_fields.iter() {
4800                state.serialize_entry(key, &value)?;
4801            }
4802        }
4803        state.end()
4804    }
4805}
4806
4807/// Message returned in the metadata field of the Operation resource for
4808/// CreateAnywhereCache operations.
4809#[derive(Clone, Debug, Default, PartialEq)]
4810#[non_exhaustive]
4811pub struct CreateAnywhereCacheMetadata {
4812    /// Generic metadata for the long running operation.
4813    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
4814
4815    /// Anywhere Cache ID.
4816    pub anywhere_cache_id: std::option::Option<std::string::String>,
4817
4818    /// The zone in which the cache instance is running. For example,
4819    /// us-central1-a.
4820    pub zone: std::option::Option<std::string::String>,
4821
4822    /// Anywhere Cache entry's TTL. A cache-level config that is applied to all new
4823    /// cache entries on admission. Default ttl value (24hrs) is applied if not
4824    /// specified in the create request.
4825    pub ttl: std::option::Option<wkt::Duration>,
4826
4827    /// Anywhere Cache entry Admission Policy in kebab-case (e.g.,
4828    /// "admit-on-first-miss"). Default admission policy (admit-on-first-miss) is
4829    /// applied if not specified in the create request.
4830    pub admission_policy: std::option::Option<std::string::String>,
4831
4832    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
4833}
4834
4835impl CreateAnywhereCacheMetadata {
4836    pub fn new() -> Self {
4837        std::default::Default::default()
4838    }
4839
4840    /// Sets the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
4841    pub fn set_common_metadata<T>(mut self, v: T) -> Self
4842    where
4843        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
4844    {
4845        self.common_metadata = std::option::Option::Some(v.into());
4846        self
4847    }
4848
4849    /// Sets or clears the value of [common_metadata][crate::model::CreateAnywhereCacheMetadata::common_metadata].
4850    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4851    where
4852        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
4853    {
4854        self.common_metadata = v.map(|x| x.into());
4855        self
4856    }
4857
4858    /// Sets the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
4859    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
4860    where
4861        T: std::convert::Into<std::string::String>,
4862    {
4863        self.anywhere_cache_id = std::option::Option::Some(v.into());
4864        self
4865    }
4866
4867    /// Sets or clears the value of [anywhere_cache_id][crate::model::CreateAnywhereCacheMetadata::anywhere_cache_id].
4868    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
4869    where
4870        T: std::convert::Into<std::string::String>,
4871    {
4872        self.anywhere_cache_id = v.map(|x| x.into());
4873        self
4874    }
4875
4876    /// Sets the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
4877    pub fn set_zone<T>(mut self, v: T) -> Self
4878    where
4879        T: std::convert::Into<std::string::String>,
4880    {
4881        self.zone = std::option::Option::Some(v.into());
4882        self
4883    }
4884
4885    /// Sets or clears the value of [zone][crate::model::CreateAnywhereCacheMetadata::zone].
4886    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
4887    where
4888        T: std::convert::Into<std::string::String>,
4889    {
4890        self.zone = v.map(|x| x.into());
4891        self
4892    }
4893
4894    /// Sets the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
4895    pub fn set_ttl<T>(mut self, v: T) -> Self
4896    where
4897        T: std::convert::Into<wkt::Duration>,
4898    {
4899        self.ttl = std::option::Option::Some(v.into());
4900        self
4901    }
4902
4903    /// Sets or clears the value of [ttl][crate::model::CreateAnywhereCacheMetadata::ttl].
4904    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
4905    where
4906        T: std::convert::Into<wkt::Duration>,
4907    {
4908        self.ttl = v.map(|x| x.into());
4909        self
4910    }
4911
4912    /// Sets the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
4913    pub fn set_admission_policy<T>(mut self, v: T) -> Self
4914    where
4915        T: std::convert::Into<std::string::String>,
4916    {
4917        self.admission_policy = std::option::Option::Some(v.into());
4918        self
4919    }
4920
4921    /// Sets or clears the value of [admission_policy][crate::model::CreateAnywhereCacheMetadata::admission_policy].
4922    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
4923    where
4924        T: std::convert::Into<std::string::String>,
4925    {
4926        self.admission_policy = v.map(|x| x.into());
4927        self
4928    }
4929}
4930
4931impl wkt::message::Message for CreateAnywhereCacheMetadata {
4932    fn typename() -> &'static str {
4933        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheMetadata"
4934    }
4935}
4936
4937#[doc(hidden)]
4938impl<'de> serde::de::Deserialize<'de> for CreateAnywhereCacheMetadata {
4939    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4940    where
4941        D: serde::Deserializer<'de>,
4942    {
4943        #[allow(non_camel_case_types)]
4944        #[doc(hidden)]
4945        #[derive(PartialEq, Eq, Hash)]
4946        enum __FieldTag {
4947            __common_metadata,
4948            __anywhere_cache_id,
4949            __zone,
4950            __ttl,
4951            __admission_policy,
4952            Unknown(std::string::String),
4953        }
4954        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
4955            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
4956            where
4957                D: serde::Deserializer<'de>,
4958            {
4959                struct Visitor;
4960                impl<'de> serde::de::Visitor<'de> for Visitor {
4961                    type Value = __FieldTag;
4962                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4963                        formatter.write_str("a field name for CreateAnywhereCacheMetadata")
4964                    }
4965                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
4966                    where
4967                        E: serde::de::Error,
4968                    {
4969                        use std::result::Result::Ok;
4970                        use std::string::ToString;
4971                        match value {
4972                            "commonMetadata" => Ok(__FieldTag::__common_metadata),
4973                            "common_metadata" => Ok(__FieldTag::__common_metadata),
4974                            "anywhereCacheId" => Ok(__FieldTag::__anywhere_cache_id),
4975                            "anywhere_cache_id" => Ok(__FieldTag::__anywhere_cache_id),
4976                            "zone" => Ok(__FieldTag::__zone),
4977                            "ttl" => Ok(__FieldTag::__ttl),
4978                            "admissionPolicy" => Ok(__FieldTag::__admission_policy),
4979                            "admission_policy" => Ok(__FieldTag::__admission_policy),
4980                            _ => Ok(__FieldTag::Unknown(value.to_string())),
4981                        }
4982                    }
4983                }
4984                deserializer.deserialize_identifier(Visitor)
4985            }
4986        }
4987        struct Visitor;
4988        impl<'de> serde::de::Visitor<'de> for Visitor {
4989            type Value = CreateAnywhereCacheMetadata;
4990            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
4991                formatter.write_str("struct CreateAnywhereCacheMetadata")
4992            }
4993            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
4994            where
4995                A: serde::de::MapAccess<'de>,
4996            {
4997                #[allow(unused_imports)]
4998                use serde::de::Error;
4999                use std::option::Option::Some;
5000                let mut fields = std::collections::HashSet::new();
5001                let mut result = Self::Value::new();
5002                while let Some(tag) = map.next_key::<__FieldTag>()? {
5003                    #[allow(clippy::match_single_binding)]
5004                    match tag {
5005                        __FieldTag::__common_metadata => {
5006                            if !fields.insert(__FieldTag::__common_metadata) {
5007                                return std::result::Result::Err(A::Error::duplicate_field(
5008                                    "multiple values for common_metadata",
5009                                ));
5010                            }
5011                            result.common_metadata = map.next_value::<std::option::Option<
5012                                crate::model::CommonLongRunningOperationMetadata,
5013                            >>()?;
5014                        }
5015                        __FieldTag::__anywhere_cache_id => {
5016                            if !fields.insert(__FieldTag::__anywhere_cache_id) {
5017                                return std::result::Result::Err(A::Error::duplicate_field(
5018                                    "multiple values for anywhere_cache_id",
5019                                ));
5020                            }
5021                            result.anywhere_cache_id =
5022                                map.next_value::<std::option::Option<std::string::String>>()?;
5023                        }
5024                        __FieldTag::__zone => {
5025                            if !fields.insert(__FieldTag::__zone) {
5026                                return std::result::Result::Err(A::Error::duplicate_field(
5027                                    "multiple values for zone",
5028                                ));
5029                            }
5030                            result.zone =
5031                                map.next_value::<std::option::Option<std::string::String>>()?;
5032                        }
5033                        __FieldTag::__ttl => {
5034                            if !fields.insert(__FieldTag::__ttl) {
5035                                return std::result::Result::Err(A::Error::duplicate_field(
5036                                    "multiple values for ttl",
5037                                ));
5038                            }
5039                            result.ttl = map.next_value::<std::option::Option<wkt::Duration>>()?;
5040                        }
5041                        __FieldTag::__admission_policy => {
5042                            if !fields.insert(__FieldTag::__admission_policy) {
5043                                return std::result::Result::Err(A::Error::duplicate_field(
5044                                    "multiple values for admission_policy",
5045                                ));
5046                            }
5047                            result.admission_policy =
5048                                map.next_value::<std::option::Option<std::string::String>>()?;
5049                        }
5050                        __FieldTag::Unknown(key) => {
5051                            let value = map.next_value::<serde_json::Value>()?;
5052                            result._unknown_fields.insert(key, value);
5053                        }
5054                    }
5055                }
5056                std::result::Result::Ok(result)
5057            }
5058        }
5059        deserializer.deserialize_any(Visitor)
5060    }
5061}
5062
5063#[doc(hidden)]
5064impl serde::ser::Serialize for CreateAnywhereCacheMetadata {
5065    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5066    where
5067        S: serde::ser::Serializer,
5068    {
5069        use serde::ser::SerializeMap;
5070        #[allow(unused_imports)]
5071        use std::option::Option::Some;
5072        let mut state = serializer.serialize_map(std::option::Option::None)?;
5073        if self.common_metadata.is_some() {
5074            state.serialize_entry("commonMetadata", &self.common_metadata)?;
5075        }
5076        if self.anywhere_cache_id.is_some() {
5077            state.serialize_entry("anywhereCacheId", &self.anywhere_cache_id)?;
5078        }
5079        if self.zone.is_some() {
5080            state.serialize_entry("zone", &self.zone)?;
5081        }
5082        if self.ttl.is_some() {
5083            state.serialize_entry("ttl", &self.ttl)?;
5084        }
5085        if self.admission_policy.is_some() {
5086            state.serialize_entry("admissionPolicy", &self.admission_policy)?;
5087        }
5088        if !self._unknown_fields.is_empty() {
5089            for (key, value) in self._unknown_fields.iter() {
5090                state.serialize_entry(key, &value)?;
5091            }
5092        }
5093        state.end()
5094    }
5095}
5096
5097/// Message returned in the metadata field of the Operation resource for
5098/// UpdateAnywhereCache operation.
5099#[derive(Clone, Debug, Default, PartialEq)]
5100#[non_exhaustive]
5101pub struct UpdateAnywhereCacheMetadata {
5102    /// Generic metadata for the long running operation.
5103    pub common_metadata: std::option::Option<crate::model::CommonLongRunningOperationMetadata>,
5104
5105    /// Anywhere Cache ID.
5106    pub anywhere_cache_id: std::option::Option<std::string::String>,
5107
5108    /// The zone in which the cache instance is running. For example,
5109    /// us-central1-a.
5110    pub zone: std::option::Option<std::string::String>,
5111
5112    /// Anywhere Cache entry's TTL between 1h and 7days. A cache-level config that
5113    /// is applied to all new cache entries on admission. If `ttl` is pending
5114    /// update, this field equals to the new value specified in the Update request.
5115    pub ttl: std::option::Option<wkt::Duration>,
5116
5117    /// L4 Cache entry Admission Policy in kebab-case (e.g.,
5118    /// "admit-on-first-miss"). If `admission_policy` is pending
5119    /// update, this field equals to the new value specified in the Update request.
5120    pub admission_policy: std::option::Option<std::string::String>,
5121
5122    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5123}
5124
5125impl UpdateAnywhereCacheMetadata {
5126    pub fn new() -> Self {
5127        std::default::Default::default()
5128    }
5129
5130    /// Sets the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
5131    pub fn set_common_metadata<T>(mut self, v: T) -> Self
5132    where
5133        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
5134    {
5135        self.common_metadata = std::option::Option::Some(v.into());
5136        self
5137    }
5138
5139    /// Sets or clears the value of [common_metadata][crate::model::UpdateAnywhereCacheMetadata::common_metadata].
5140    pub fn set_or_clear_common_metadata<T>(mut self, v: std::option::Option<T>) -> Self
5141    where
5142        T: std::convert::Into<crate::model::CommonLongRunningOperationMetadata>,
5143    {
5144        self.common_metadata = v.map(|x| x.into());
5145        self
5146    }
5147
5148    /// Sets the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
5149    pub fn set_anywhere_cache_id<T>(mut self, v: T) -> Self
5150    where
5151        T: std::convert::Into<std::string::String>,
5152    {
5153        self.anywhere_cache_id = std::option::Option::Some(v.into());
5154        self
5155    }
5156
5157    /// Sets or clears the value of [anywhere_cache_id][crate::model::UpdateAnywhereCacheMetadata::anywhere_cache_id].
5158    pub fn set_or_clear_anywhere_cache_id<T>(mut self, v: std::option::Option<T>) -> Self
5159    where
5160        T: std::convert::Into<std::string::String>,
5161    {
5162        self.anywhere_cache_id = v.map(|x| x.into());
5163        self
5164    }
5165
5166    /// Sets the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
5167    pub fn set_zone<T>(mut self, v: T) -> Self
5168    where
5169        T: std::convert::Into<std::string::String>,
5170    {
5171        self.zone = std::option::Option::Some(v.into());
5172        self
5173    }
5174
5175    /// Sets or clears the value of [zone][crate::model::UpdateAnywhereCacheMetadata::zone].
5176    pub fn set_or_clear_zone<T>(mut self, v: std::option::Option<T>) -> Self
5177    where
5178        T: std::convert::Into<std::string::String>,
5179    {
5180        self.zone = v.map(|x| x.into());
5181        self
5182    }
5183
5184    /// Sets the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
5185    pub fn set_ttl<T>(mut self, v: T) -> Self
5186    where
5187        T: std::convert::Into<wkt::Duration>,
5188    {
5189        self.ttl = std::option::Option::Some(v.into());
5190        self
5191    }
5192
5193    /// Sets or clears the value of [ttl][crate::model::UpdateAnywhereCacheMetadata::ttl].
5194    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5195    where
5196        T: std::convert::Into<wkt::Duration>,
5197    {
5198        self.ttl = v.map(|x| x.into());
5199        self
5200    }
5201
5202    /// Sets the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
5203    pub fn set_admission_policy<T>(mut self, v: T) -> Self
5204    where
5205        T: std::convert::Into<std::string::String>,
5206    {
5207        self.admission_policy = std::option::Option::Some(v.into());
5208        self
5209    }
5210
5211    /// Sets or clears the value of [admission_policy][crate::model::UpdateAnywhereCacheMetadata::admission_policy].
5212    pub fn set_or_clear_admission_policy<T>(mut self, v: std::option::Option<T>) -> Self
5213    where
5214        T: std::convert::Into<std::string::String>,
5215    {
5216        self.admission_policy = v.map(|x| x.into());
5217        self
5218    }
5219}
5220
5221impl wkt::message::Message for UpdateAnywhereCacheMetadata {
5222    fn typename() -> &'static str {
5223        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheMetadata"
5224    }
5225}
5226
5227#[doc(hidden)]
5228impl<'de> serde::de::Deserialize<'de> for UpdateAnywhereCacheMetadata {
5229    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5230    where
5231        D: serde::Deserializer<'de>,
5232    {
5233        #[allow(non_camel_case_types)]
5234        #[doc(hidden)]
5235        #[derive(PartialEq, Eq, Hash)]
5236        enum __FieldTag {
5237            __common_metadata,
5238            __anywhere_cache_id,
5239            __zone,
5240            __ttl,
5241            __admission_policy,
5242            Unknown(std::string::String),
5243        }
5244        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5245            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5246            where
5247                D: serde::Deserializer<'de>,
5248            {
5249                struct Visitor;
5250                impl<'de> serde::de::Visitor<'de> for Visitor {
5251                    type Value = __FieldTag;
5252                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5253                        formatter.write_str("a field name for UpdateAnywhereCacheMetadata")
5254                    }
5255                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5256                    where
5257                        E: serde::de::Error,
5258                    {
5259                        use std::result::Result::Ok;
5260                        use std::string::ToString;
5261                        match value {
5262                            "commonMetadata" => Ok(__FieldTag::__common_metadata),
5263                            "common_metadata" => Ok(__FieldTag::__common_metadata),
5264                            "anywhereCacheId" => Ok(__FieldTag::__anywhere_cache_id),
5265                            "anywhere_cache_id" => Ok(__FieldTag::__anywhere_cache_id),
5266                            "zone" => Ok(__FieldTag::__zone),
5267                            "ttl" => Ok(__FieldTag::__ttl),
5268                            "admissionPolicy" => Ok(__FieldTag::__admission_policy),
5269                            "admission_policy" => Ok(__FieldTag::__admission_policy),
5270                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5271                        }
5272                    }
5273                }
5274                deserializer.deserialize_identifier(Visitor)
5275            }
5276        }
5277        struct Visitor;
5278        impl<'de> serde::de::Visitor<'de> for Visitor {
5279            type Value = UpdateAnywhereCacheMetadata;
5280            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5281                formatter.write_str("struct UpdateAnywhereCacheMetadata")
5282            }
5283            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5284            where
5285                A: serde::de::MapAccess<'de>,
5286            {
5287                #[allow(unused_imports)]
5288                use serde::de::Error;
5289                use std::option::Option::Some;
5290                let mut fields = std::collections::HashSet::new();
5291                let mut result = Self::Value::new();
5292                while let Some(tag) = map.next_key::<__FieldTag>()? {
5293                    #[allow(clippy::match_single_binding)]
5294                    match tag {
5295                        __FieldTag::__common_metadata => {
5296                            if !fields.insert(__FieldTag::__common_metadata) {
5297                                return std::result::Result::Err(A::Error::duplicate_field(
5298                                    "multiple values for common_metadata",
5299                                ));
5300                            }
5301                            result.common_metadata = map.next_value::<std::option::Option<
5302                                crate::model::CommonLongRunningOperationMetadata,
5303                            >>()?;
5304                        }
5305                        __FieldTag::__anywhere_cache_id => {
5306                            if !fields.insert(__FieldTag::__anywhere_cache_id) {
5307                                return std::result::Result::Err(A::Error::duplicate_field(
5308                                    "multiple values for anywhere_cache_id",
5309                                ));
5310                            }
5311                            result.anywhere_cache_id =
5312                                map.next_value::<std::option::Option<std::string::String>>()?;
5313                        }
5314                        __FieldTag::__zone => {
5315                            if !fields.insert(__FieldTag::__zone) {
5316                                return std::result::Result::Err(A::Error::duplicate_field(
5317                                    "multiple values for zone",
5318                                ));
5319                            }
5320                            result.zone =
5321                                map.next_value::<std::option::Option<std::string::String>>()?;
5322                        }
5323                        __FieldTag::__ttl => {
5324                            if !fields.insert(__FieldTag::__ttl) {
5325                                return std::result::Result::Err(A::Error::duplicate_field(
5326                                    "multiple values for ttl",
5327                                ));
5328                            }
5329                            result.ttl = map.next_value::<std::option::Option<wkt::Duration>>()?;
5330                        }
5331                        __FieldTag::__admission_policy => {
5332                            if !fields.insert(__FieldTag::__admission_policy) {
5333                                return std::result::Result::Err(A::Error::duplicate_field(
5334                                    "multiple values for admission_policy",
5335                                ));
5336                            }
5337                            result.admission_policy =
5338                                map.next_value::<std::option::Option<std::string::String>>()?;
5339                        }
5340                        __FieldTag::Unknown(key) => {
5341                            let value = map.next_value::<serde_json::Value>()?;
5342                            result._unknown_fields.insert(key, value);
5343                        }
5344                    }
5345                }
5346                std::result::Result::Ok(result)
5347            }
5348        }
5349        deserializer.deserialize_any(Visitor)
5350    }
5351}
5352
5353#[doc(hidden)]
5354impl serde::ser::Serialize for UpdateAnywhereCacheMetadata {
5355    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5356    where
5357        S: serde::ser::Serializer,
5358    {
5359        use serde::ser::SerializeMap;
5360        #[allow(unused_imports)]
5361        use std::option::Option::Some;
5362        let mut state = serializer.serialize_map(std::option::Option::None)?;
5363        if self.common_metadata.is_some() {
5364            state.serialize_entry("commonMetadata", &self.common_metadata)?;
5365        }
5366        if self.anywhere_cache_id.is_some() {
5367            state.serialize_entry("anywhereCacheId", &self.anywhere_cache_id)?;
5368        }
5369        if self.zone.is_some() {
5370            state.serialize_entry("zone", &self.zone)?;
5371        }
5372        if self.ttl.is_some() {
5373            state.serialize_entry("ttl", &self.ttl)?;
5374        }
5375        if self.admission_policy.is_some() {
5376            state.serialize_entry("admissionPolicy", &self.admission_policy)?;
5377        }
5378        if !self._unknown_fields.is_empty() {
5379            for (key, value) in self._unknown_fields.iter() {
5380                state.serialize_entry(key, &value)?;
5381            }
5382        }
5383        state.end()
5384    }
5385}
5386
5387/// An Anywhere Cache Instance.
5388#[derive(Clone, Debug, Default, PartialEq)]
5389#[non_exhaustive]
5390pub struct AnywhereCache {
5391    /// Immutable. The resource name of this AnywhereCache.
5392    /// Format:
5393    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
5394    pub name: std::string::String,
5395
5396    /// Immutable. The zone in which the cache instance is running. For example,
5397    /// us-central1-a.
5398    pub zone: std::string::String,
5399
5400    /// Cache entry TTL (ranges between 1h to 7d). This is a cache-level config
5401    /// that defines how long a cache entry can live. Default ttl value (24hrs)
5402    /// is applied if not specified in the create request. TTL must be in whole
5403    /// seconds.
5404    pub ttl: std::option::Option<wkt::Duration>,
5405
5406    /// Cache admission policy. Valid policies includes:
5407    /// `admit-on-first-miss` and `admit-on-second-miss`. Defaults to
5408    /// `admit-on-first-miss`. Default value is applied if not specified in the
5409    /// create request.
5410    pub admission_policy: std::string::String,
5411
5412    /// Output only. Cache state including RUNNING, CREATING, DISABLED and PAUSED.
5413    pub state: std::string::String,
5414
5415    /// Output only. Time when Anywhere cache instance is allocated.
5416    pub create_time: std::option::Option<wkt::Timestamp>,
5417
5418    /// Output only. Time when Anywhere cache instance is last updated, including
5419    /// creation.
5420    pub update_time: std::option::Option<wkt::Timestamp>,
5421
5422    /// Output only. True if there is an active update operation against this cache
5423    /// instance. Subsequential update requests will be rejected if this field is
5424    /// true. Output only.
5425    pub pending_update: bool,
5426
5427    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5428}
5429
5430impl AnywhereCache {
5431    pub fn new() -> Self {
5432        std::default::Default::default()
5433    }
5434
5435    /// Sets the value of [name][crate::model::AnywhereCache::name].
5436    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5437        self.name = v.into();
5438        self
5439    }
5440
5441    /// Sets the value of [zone][crate::model::AnywhereCache::zone].
5442    pub fn set_zone<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5443        self.zone = v.into();
5444        self
5445    }
5446
5447    /// Sets the value of [ttl][crate::model::AnywhereCache::ttl].
5448    pub fn set_ttl<T>(mut self, v: T) -> Self
5449    where
5450        T: std::convert::Into<wkt::Duration>,
5451    {
5452        self.ttl = std::option::Option::Some(v.into());
5453        self
5454    }
5455
5456    /// Sets or clears the value of [ttl][crate::model::AnywhereCache::ttl].
5457    pub fn set_or_clear_ttl<T>(mut self, v: std::option::Option<T>) -> Self
5458    where
5459        T: std::convert::Into<wkt::Duration>,
5460    {
5461        self.ttl = v.map(|x| x.into());
5462        self
5463    }
5464
5465    /// Sets the value of [admission_policy][crate::model::AnywhereCache::admission_policy].
5466    pub fn set_admission_policy<T: std::convert::Into<std::string::String>>(
5467        mut self,
5468        v: T,
5469    ) -> Self {
5470        self.admission_policy = v.into();
5471        self
5472    }
5473
5474    /// Sets the value of [state][crate::model::AnywhereCache::state].
5475    pub fn set_state<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5476        self.state = v.into();
5477        self
5478    }
5479
5480    /// Sets the value of [create_time][crate::model::AnywhereCache::create_time].
5481    pub fn set_create_time<T>(mut self, v: T) -> Self
5482    where
5483        T: std::convert::Into<wkt::Timestamp>,
5484    {
5485        self.create_time = std::option::Option::Some(v.into());
5486        self
5487    }
5488
5489    /// Sets or clears the value of [create_time][crate::model::AnywhereCache::create_time].
5490    pub fn set_or_clear_create_time<T>(mut self, v: std::option::Option<T>) -> Self
5491    where
5492        T: std::convert::Into<wkt::Timestamp>,
5493    {
5494        self.create_time = v.map(|x| x.into());
5495        self
5496    }
5497
5498    /// Sets the value of [update_time][crate::model::AnywhereCache::update_time].
5499    pub fn set_update_time<T>(mut self, v: T) -> Self
5500    where
5501        T: std::convert::Into<wkt::Timestamp>,
5502    {
5503        self.update_time = std::option::Option::Some(v.into());
5504        self
5505    }
5506
5507    /// Sets or clears the value of [update_time][crate::model::AnywhereCache::update_time].
5508    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
5509    where
5510        T: std::convert::Into<wkt::Timestamp>,
5511    {
5512        self.update_time = v.map(|x| x.into());
5513        self
5514    }
5515
5516    /// Sets the value of [pending_update][crate::model::AnywhereCache::pending_update].
5517    pub fn set_pending_update<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5518        self.pending_update = v.into();
5519        self
5520    }
5521}
5522
5523impl wkt::message::Message for AnywhereCache {
5524    fn typename() -> &'static str {
5525        "type.googleapis.com/google.storage.control.v2.AnywhereCache"
5526    }
5527}
5528
5529#[doc(hidden)]
5530impl<'de> serde::de::Deserialize<'de> for AnywhereCache {
5531    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5532    where
5533        D: serde::Deserializer<'de>,
5534    {
5535        #[allow(non_camel_case_types)]
5536        #[doc(hidden)]
5537        #[derive(PartialEq, Eq, Hash)]
5538        enum __FieldTag {
5539            __name,
5540            __zone,
5541            __ttl,
5542            __admission_policy,
5543            __state,
5544            __create_time,
5545            __update_time,
5546            __pending_update,
5547            Unknown(std::string::String),
5548        }
5549        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5550            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5551            where
5552                D: serde::Deserializer<'de>,
5553            {
5554                struct Visitor;
5555                impl<'de> serde::de::Visitor<'de> for Visitor {
5556                    type Value = __FieldTag;
5557                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5558                        formatter.write_str("a field name for AnywhereCache")
5559                    }
5560                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5561                    where
5562                        E: serde::de::Error,
5563                    {
5564                        use std::result::Result::Ok;
5565                        use std::string::ToString;
5566                        match value {
5567                            "name" => Ok(__FieldTag::__name),
5568                            "zone" => Ok(__FieldTag::__zone),
5569                            "ttl" => Ok(__FieldTag::__ttl),
5570                            "admissionPolicy" => Ok(__FieldTag::__admission_policy),
5571                            "admission_policy" => Ok(__FieldTag::__admission_policy),
5572                            "state" => Ok(__FieldTag::__state),
5573                            "createTime" => Ok(__FieldTag::__create_time),
5574                            "create_time" => Ok(__FieldTag::__create_time),
5575                            "updateTime" => Ok(__FieldTag::__update_time),
5576                            "update_time" => Ok(__FieldTag::__update_time),
5577                            "pendingUpdate" => Ok(__FieldTag::__pending_update),
5578                            "pending_update" => Ok(__FieldTag::__pending_update),
5579                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5580                        }
5581                    }
5582                }
5583                deserializer.deserialize_identifier(Visitor)
5584            }
5585        }
5586        struct Visitor;
5587        impl<'de> serde::de::Visitor<'de> for Visitor {
5588            type Value = AnywhereCache;
5589            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5590                formatter.write_str("struct AnywhereCache")
5591            }
5592            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5593            where
5594                A: serde::de::MapAccess<'de>,
5595            {
5596                #[allow(unused_imports)]
5597                use serde::de::Error;
5598                use std::option::Option::Some;
5599                let mut fields = std::collections::HashSet::new();
5600                let mut result = Self::Value::new();
5601                while let Some(tag) = map.next_key::<__FieldTag>()? {
5602                    #[allow(clippy::match_single_binding)]
5603                    match tag {
5604                        __FieldTag::__name => {
5605                            if !fields.insert(__FieldTag::__name) {
5606                                return std::result::Result::Err(A::Error::duplicate_field(
5607                                    "multiple values for name",
5608                                ));
5609                            }
5610                            result.name = map
5611                                .next_value::<std::option::Option<std::string::String>>()?
5612                                .unwrap_or_default();
5613                        }
5614                        __FieldTag::__zone => {
5615                            if !fields.insert(__FieldTag::__zone) {
5616                                return std::result::Result::Err(A::Error::duplicate_field(
5617                                    "multiple values for zone",
5618                                ));
5619                            }
5620                            result.zone = map
5621                                .next_value::<std::option::Option<std::string::String>>()?
5622                                .unwrap_or_default();
5623                        }
5624                        __FieldTag::__ttl => {
5625                            if !fields.insert(__FieldTag::__ttl) {
5626                                return std::result::Result::Err(A::Error::duplicate_field(
5627                                    "multiple values for ttl",
5628                                ));
5629                            }
5630                            result.ttl = map.next_value::<std::option::Option<wkt::Duration>>()?;
5631                        }
5632                        __FieldTag::__admission_policy => {
5633                            if !fields.insert(__FieldTag::__admission_policy) {
5634                                return std::result::Result::Err(A::Error::duplicate_field(
5635                                    "multiple values for admission_policy",
5636                                ));
5637                            }
5638                            result.admission_policy = map
5639                                .next_value::<std::option::Option<std::string::String>>()?
5640                                .unwrap_or_default();
5641                        }
5642                        __FieldTag::__state => {
5643                            if !fields.insert(__FieldTag::__state) {
5644                                return std::result::Result::Err(A::Error::duplicate_field(
5645                                    "multiple values for state",
5646                                ));
5647                            }
5648                            result.state = map
5649                                .next_value::<std::option::Option<std::string::String>>()?
5650                                .unwrap_or_default();
5651                        }
5652                        __FieldTag::__create_time => {
5653                            if !fields.insert(__FieldTag::__create_time) {
5654                                return std::result::Result::Err(A::Error::duplicate_field(
5655                                    "multiple values for create_time",
5656                                ));
5657                            }
5658                            result.create_time =
5659                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5660                        }
5661                        __FieldTag::__update_time => {
5662                            if !fields.insert(__FieldTag::__update_time) {
5663                                return std::result::Result::Err(A::Error::duplicate_field(
5664                                    "multiple values for update_time",
5665                                ));
5666                            }
5667                            result.update_time =
5668                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
5669                        }
5670                        __FieldTag::__pending_update => {
5671                            if !fields.insert(__FieldTag::__pending_update) {
5672                                return std::result::Result::Err(A::Error::duplicate_field(
5673                                    "multiple values for pending_update",
5674                                ));
5675                            }
5676                            result.pending_update = map
5677                                .next_value::<std::option::Option<bool>>()?
5678                                .unwrap_or_default();
5679                        }
5680                        __FieldTag::Unknown(key) => {
5681                            let value = map.next_value::<serde_json::Value>()?;
5682                            result._unknown_fields.insert(key, value);
5683                        }
5684                    }
5685                }
5686                std::result::Result::Ok(result)
5687            }
5688        }
5689        deserializer.deserialize_any(Visitor)
5690    }
5691}
5692
5693#[doc(hidden)]
5694impl serde::ser::Serialize for AnywhereCache {
5695    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5696    where
5697        S: serde::ser::Serializer,
5698    {
5699        use serde::ser::SerializeMap;
5700        #[allow(unused_imports)]
5701        use std::option::Option::Some;
5702        let mut state = serializer.serialize_map(std::option::Option::None)?;
5703        if !self.name.is_empty() {
5704            state.serialize_entry("name", &self.name)?;
5705        }
5706        if !self.zone.is_empty() {
5707            state.serialize_entry("zone", &self.zone)?;
5708        }
5709        if self.ttl.is_some() {
5710            state.serialize_entry("ttl", &self.ttl)?;
5711        }
5712        if !self.admission_policy.is_empty() {
5713            state.serialize_entry("admissionPolicy", &self.admission_policy)?;
5714        }
5715        if !self.state.is_empty() {
5716            state.serialize_entry("state", &self.state)?;
5717        }
5718        if self.create_time.is_some() {
5719            state.serialize_entry("createTime", &self.create_time)?;
5720        }
5721        if self.update_time.is_some() {
5722            state.serialize_entry("updateTime", &self.update_time)?;
5723        }
5724        if !wkt::internal::is_default(&self.pending_update) {
5725            state.serialize_entry("pendingUpdate", &self.pending_update)?;
5726        }
5727        if !self._unknown_fields.is_empty() {
5728            for (key, value) in self._unknown_fields.iter() {
5729                state.serialize_entry(key, &value)?;
5730            }
5731        }
5732        state.end()
5733    }
5734}
5735
5736/// Request message for CreateAnywhereCache.
5737#[derive(Clone, Debug, Default, PartialEq)]
5738#[non_exhaustive]
5739pub struct CreateAnywhereCacheRequest {
5740    /// Required. The bucket to which this cache belongs.
5741    /// Format: `projects/{project}/buckets/{bucket}`
5742    pub parent: std::string::String,
5743
5744    /// Required. Properties of the Anywhere Cache instance being created.
5745    /// The parent bucket name is specified in the `parent` field. Server uses the
5746    /// default value of `ttl` or `admission_policy` if not specified in
5747    /// request.
5748    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
5749
5750    /// Optional. A unique identifier for this request. UUID is the recommended
5751    /// format, but other formats are still accepted. This request is only
5752    /// idempotent if a `request_id` is provided.
5753    pub request_id: std::string::String,
5754
5755    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5756}
5757
5758impl CreateAnywhereCacheRequest {
5759    pub fn new() -> Self {
5760        std::default::Default::default()
5761    }
5762
5763    /// Sets the value of [parent][crate::model::CreateAnywhereCacheRequest::parent].
5764    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5765        self.parent = v.into();
5766        self
5767    }
5768
5769    /// Sets the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
5770    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
5771    where
5772        T: std::convert::Into<crate::model::AnywhereCache>,
5773    {
5774        self.anywhere_cache = std::option::Option::Some(v.into());
5775        self
5776    }
5777
5778    /// Sets or clears the value of [anywhere_cache][crate::model::CreateAnywhereCacheRequest::anywhere_cache].
5779    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
5780    where
5781        T: std::convert::Into<crate::model::AnywhereCache>,
5782    {
5783        self.anywhere_cache = v.map(|x| x.into());
5784        self
5785    }
5786
5787    /// Sets the value of [request_id][crate::model::CreateAnywhereCacheRequest::request_id].
5788    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5789        self.request_id = v.into();
5790        self
5791    }
5792}
5793
5794impl wkt::message::Message for CreateAnywhereCacheRequest {
5795    fn typename() -> &'static str {
5796        "type.googleapis.com/google.storage.control.v2.CreateAnywhereCacheRequest"
5797    }
5798}
5799
5800#[doc(hidden)]
5801impl<'de> serde::de::Deserialize<'de> for CreateAnywhereCacheRequest {
5802    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5803    where
5804        D: serde::Deserializer<'de>,
5805    {
5806        #[allow(non_camel_case_types)]
5807        #[doc(hidden)]
5808        #[derive(PartialEq, Eq, Hash)]
5809        enum __FieldTag {
5810            __parent,
5811            __anywhere_cache,
5812            __request_id,
5813            Unknown(std::string::String),
5814        }
5815        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
5816            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
5817            where
5818                D: serde::Deserializer<'de>,
5819            {
5820                struct Visitor;
5821                impl<'de> serde::de::Visitor<'de> for Visitor {
5822                    type Value = __FieldTag;
5823                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5824                        formatter.write_str("a field name for CreateAnywhereCacheRequest")
5825                    }
5826                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
5827                    where
5828                        E: serde::de::Error,
5829                    {
5830                        use std::result::Result::Ok;
5831                        use std::string::ToString;
5832                        match value {
5833                            "parent" => Ok(__FieldTag::__parent),
5834                            "anywhereCache" => Ok(__FieldTag::__anywhere_cache),
5835                            "anywhere_cache" => Ok(__FieldTag::__anywhere_cache),
5836                            "requestId" => Ok(__FieldTag::__request_id),
5837                            "request_id" => Ok(__FieldTag::__request_id),
5838                            _ => Ok(__FieldTag::Unknown(value.to_string())),
5839                        }
5840                    }
5841                }
5842                deserializer.deserialize_identifier(Visitor)
5843            }
5844        }
5845        struct Visitor;
5846        impl<'de> serde::de::Visitor<'de> for Visitor {
5847            type Value = CreateAnywhereCacheRequest;
5848            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
5849                formatter.write_str("struct CreateAnywhereCacheRequest")
5850            }
5851            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
5852            where
5853                A: serde::de::MapAccess<'de>,
5854            {
5855                #[allow(unused_imports)]
5856                use serde::de::Error;
5857                use std::option::Option::Some;
5858                let mut fields = std::collections::HashSet::new();
5859                let mut result = Self::Value::new();
5860                while let Some(tag) = map.next_key::<__FieldTag>()? {
5861                    #[allow(clippy::match_single_binding)]
5862                    match tag {
5863                        __FieldTag::__parent => {
5864                            if !fields.insert(__FieldTag::__parent) {
5865                                return std::result::Result::Err(A::Error::duplicate_field(
5866                                    "multiple values for parent",
5867                                ));
5868                            }
5869                            result.parent = map
5870                                .next_value::<std::option::Option<std::string::String>>()?
5871                                .unwrap_or_default();
5872                        }
5873                        __FieldTag::__anywhere_cache => {
5874                            if !fields.insert(__FieldTag::__anywhere_cache) {
5875                                return std::result::Result::Err(A::Error::duplicate_field(
5876                                    "multiple values for anywhere_cache",
5877                                ));
5878                            }
5879                            result.anywhere_cache = map
5880                                .next_value::<std::option::Option<crate::model::AnywhereCache>>()?;
5881                        }
5882                        __FieldTag::__request_id => {
5883                            if !fields.insert(__FieldTag::__request_id) {
5884                                return std::result::Result::Err(A::Error::duplicate_field(
5885                                    "multiple values for request_id",
5886                                ));
5887                            }
5888                            result.request_id = map
5889                                .next_value::<std::option::Option<std::string::String>>()?
5890                                .unwrap_or_default();
5891                        }
5892                        __FieldTag::Unknown(key) => {
5893                            let value = map.next_value::<serde_json::Value>()?;
5894                            result._unknown_fields.insert(key, value);
5895                        }
5896                    }
5897                }
5898                std::result::Result::Ok(result)
5899            }
5900        }
5901        deserializer.deserialize_any(Visitor)
5902    }
5903}
5904
5905#[doc(hidden)]
5906impl serde::ser::Serialize for CreateAnywhereCacheRequest {
5907    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
5908    where
5909        S: serde::ser::Serializer,
5910    {
5911        use serde::ser::SerializeMap;
5912        #[allow(unused_imports)]
5913        use std::option::Option::Some;
5914        let mut state = serializer.serialize_map(std::option::Option::None)?;
5915        if !self.parent.is_empty() {
5916            state.serialize_entry("parent", &self.parent)?;
5917        }
5918        if self.anywhere_cache.is_some() {
5919            state.serialize_entry("anywhereCache", &self.anywhere_cache)?;
5920        }
5921        if !self.request_id.is_empty() {
5922            state.serialize_entry("requestId", &self.request_id)?;
5923        }
5924        if !self._unknown_fields.is_empty() {
5925            for (key, value) in self._unknown_fields.iter() {
5926                state.serialize_entry(key, &value)?;
5927            }
5928        }
5929        state.end()
5930    }
5931}
5932
5933/// Request message for UpdateAnywhereCache.
5934#[derive(Clone, Debug, Default, PartialEq)]
5935#[non_exhaustive]
5936pub struct UpdateAnywhereCacheRequest {
5937    /// Required. The Anywhere Cache instance to be updated.
5938    pub anywhere_cache: std::option::Option<crate::model::AnywhereCache>,
5939
5940    /// Required. List of fields to be updated. Mutable fields of AnywhereCache
5941    /// include `ttl` and `admission_policy`.
5942    ///
5943    /// To specify ALL fields, specify a single field with the value `*`. Note: We
5944    /// recommend against doing this. If a new field is introduced at a later time,
5945    /// an older client updating with the `*` may accidentally reset the new
5946    /// field's value.
5947    ///
5948    /// Not specifying any fields is an error.
5949    pub update_mask: std::option::Option<wkt::FieldMask>,
5950
5951    /// Optional. A unique identifier for this request. UUID is the recommended
5952    /// format, but other formats are still accepted. This request is only
5953    /// idempotent if a `request_id` is provided.
5954    pub request_id: std::string::String,
5955
5956    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
5957}
5958
5959impl UpdateAnywhereCacheRequest {
5960    pub fn new() -> Self {
5961        std::default::Default::default()
5962    }
5963
5964    /// Sets the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
5965    pub fn set_anywhere_cache<T>(mut self, v: T) -> Self
5966    where
5967        T: std::convert::Into<crate::model::AnywhereCache>,
5968    {
5969        self.anywhere_cache = std::option::Option::Some(v.into());
5970        self
5971    }
5972
5973    /// Sets or clears the value of [anywhere_cache][crate::model::UpdateAnywhereCacheRequest::anywhere_cache].
5974    pub fn set_or_clear_anywhere_cache<T>(mut self, v: std::option::Option<T>) -> Self
5975    where
5976        T: std::convert::Into<crate::model::AnywhereCache>,
5977    {
5978        self.anywhere_cache = v.map(|x| x.into());
5979        self
5980    }
5981
5982    /// Sets the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
5983    pub fn set_update_mask<T>(mut self, v: T) -> Self
5984    where
5985        T: std::convert::Into<wkt::FieldMask>,
5986    {
5987        self.update_mask = std::option::Option::Some(v.into());
5988        self
5989    }
5990
5991    /// Sets or clears the value of [update_mask][crate::model::UpdateAnywhereCacheRequest::update_mask].
5992    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5993    where
5994        T: std::convert::Into<wkt::FieldMask>,
5995    {
5996        self.update_mask = v.map(|x| x.into());
5997        self
5998    }
5999
6000    /// Sets the value of [request_id][crate::model::UpdateAnywhereCacheRequest::request_id].
6001    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6002        self.request_id = v.into();
6003        self
6004    }
6005}
6006
6007impl wkt::message::Message for UpdateAnywhereCacheRequest {
6008    fn typename() -> &'static str {
6009        "type.googleapis.com/google.storage.control.v2.UpdateAnywhereCacheRequest"
6010    }
6011}
6012
6013#[doc(hidden)]
6014impl<'de> serde::de::Deserialize<'de> for UpdateAnywhereCacheRequest {
6015    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6016    where
6017        D: serde::Deserializer<'de>,
6018    {
6019        #[allow(non_camel_case_types)]
6020        #[doc(hidden)]
6021        #[derive(PartialEq, Eq, Hash)]
6022        enum __FieldTag {
6023            __anywhere_cache,
6024            __update_mask,
6025            __request_id,
6026            Unknown(std::string::String),
6027        }
6028        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6029            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6030            where
6031                D: serde::Deserializer<'de>,
6032            {
6033                struct Visitor;
6034                impl<'de> serde::de::Visitor<'de> for Visitor {
6035                    type Value = __FieldTag;
6036                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6037                        formatter.write_str("a field name for UpdateAnywhereCacheRequest")
6038                    }
6039                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6040                    where
6041                        E: serde::de::Error,
6042                    {
6043                        use std::result::Result::Ok;
6044                        use std::string::ToString;
6045                        match value {
6046                            "anywhereCache" => Ok(__FieldTag::__anywhere_cache),
6047                            "anywhere_cache" => Ok(__FieldTag::__anywhere_cache),
6048                            "updateMask" => Ok(__FieldTag::__update_mask),
6049                            "update_mask" => Ok(__FieldTag::__update_mask),
6050                            "requestId" => Ok(__FieldTag::__request_id),
6051                            "request_id" => Ok(__FieldTag::__request_id),
6052                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6053                        }
6054                    }
6055                }
6056                deserializer.deserialize_identifier(Visitor)
6057            }
6058        }
6059        struct Visitor;
6060        impl<'de> serde::de::Visitor<'de> for Visitor {
6061            type Value = UpdateAnywhereCacheRequest;
6062            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6063                formatter.write_str("struct UpdateAnywhereCacheRequest")
6064            }
6065            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6066            where
6067                A: serde::de::MapAccess<'de>,
6068            {
6069                #[allow(unused_imports)]
6070                use serde::de::Error;
6071                use std::option::Option::Some;
6072                let mut fields = std::collections::HashSet::new();
6073                let mut result = Self::Value::new();
6074                while let Some(tag) = map.next_key::<__FieldTag>()? {
6075                    #[allow(clippy::match_single_binding)]
6076                    match tag {
6077                        __FieldTag::__anywhere_cache => {
6078                            if !fields.insert(__FieldTag::__anywhere_cache) {
6079                                return std::result::Result::Err(A::Error::duplicate_field(
6080                                    "multiple values for anywhere_cache",
6081                                ));
6082                            }
6083                            result.anywhere_cache = map
6084                                .next_value::<std::option::Option<crate::model::AnywhereCache>>()?;
6085                        }
6086                        __FieldTag::__update_mask => {
6087                            if !fields.insert(__FieldTag::__update_mask) {
6088                                return std::result::Result::Err(A::Error::duplicate_field(
6089                                    "multiple values for update_mask",
6090                                ));
6091                            }
6092                            result.update_mask =
6093                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
6094                        }
6095                        __FieldTag::__request_id => {
6096                            if !fields.insert(__FieldTag::__request_id) {
6097                                return std::result::Result::Err(A::Error::duplicate_field(
6098                                    "multiple values for request_id",
6099                                ));
6100                            }
6101                            result.request_id = map
6102                                .next_value::<std::option::Option<std::string::String>>()?
6103                                .unwrap_or_default();
6104                        }
6105                        __FieldTag::Unknown(key) => {
6106                            let value = map.next_value::<serde_json::Value>()?;
6107                            result._unknown_fields.insert(key, value);
6108                        }
6109                    }
6110                }
6111                std::result::Result::Ok(result)
6112            }
6113        }
6114        deserializer.deserialize_any(Visitor)
6115    }
6116}
6117
6118#[doc(hidden)]
6119impl serde::ser::Serialize for UpdateAnywhereCacheRequest {
6120    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6121    where
6122        S: serde::ser::Serializer,
6123    {
6124        use serde::ser::SerializeMap;
6125        #[allow(unused_imports)]
6126        use std::option::Option::Some;
6127        let mut state = serializer.serialize_map(std::option::Option::None)?;
6128        if self.anywhere_cache.is_some() {
6129            state.serialize_entry("anywhereCache", &self.anywhere_cache)?;
6130        }
6131        if self.update_mask.is_some() {
6132            state.serialize_entry("updateMask", &self.update_mask)?;
6133        }
6134        if !self.request_id.is_empty() {
6135            state.serialize_entry("requestId", &self.request_id)?;
6136        }
6137        if !self._unknown_fields.is_empty() {
6138            for (key, value) in self._unknown_fields.iter() {
6139                state.serialize_entry(key, &value)?;
6140            }
6141        }
6142        state.end()
6143    }
6144}
6145
6146/// Request message for DisableAnywhereCache.
6147#[derive(Clone, Debug, Default, PartialEq)]
6148#[non_exhaustive]
6149pub struct DisableAnywhereCacheRequest {
6150    /// Required. The name field in the request should be:
6151    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
6152    pub name: std::string::String,
6153
6154    /// Optional. A unique identifier for this request. UUID is the recommended
6155    /// format, but other formats are still accepted. This request is only
6156    /// idempotent if a `request_id` is provided.
6157    pub request_id: std::string::String,
6158
6159    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6160}
6161
6162impl DisableAnywhereCacheRequest {
6163    pub fn new() -> Self {
6164        std::default::Default::default()
6165    }
6166
6167    /// Sets the value of [name][crate::model::DisableAnywhereCacheRequest::name].
6168    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6169        self.name = v.into();
6170        self
6171    }
6172
6173    /// Sets the value of [request_id][crate::model::DisableAnywhereCacheRequest::request_id].
6174    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6175        self.request_id = v.into();
6176        self
6177    }
6178}
6179
6180impl wkt::message::Message for DisableAnywhereCacheRequest {
6181    fn typename() -> &'static str {
6182        "type.googleapis.com/google.storage.control.v2.DisableAnywhereCacheRequest"
6183    }
6184}
6185
6186#[doc(hidden)]
6187impl<'de> serde::de::Deserialize<'de> for DisableAnywhereCacheRequest {
6188    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6189    where
6190        D: serde::Deserializer<'de>,
6191    {
6192        #[allow(non_camel_case_types)]
6193        #[doc(hidden)]
6194        #[derive(PartialEq, Eq, Hash)]
6195        enum __FieldTag {
6196            __name,
6197            __request_id,
6198            Unknown(std::string::String),
6199        }
6200        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6201            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6202            where
6203                D: serde::Deserializer<'de>,
6204            {
6205                struct Visitor;
6206                impl<'de> serde::de::Visitor<'de> for Visitor {
6207                    type Value = __FieldTag;
6208                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6209                        formatter.write_str("a field name for DisableAnywhereCacheRequest")
6210                    }
6211                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6212                    where
6213                        E: serde::de::Error,
6214                    {
6215                        use std::result::Result::Ok;
6216                        use std::string::ToString;
6217                        match value {
6218                            "name" => Ok(__FieldTag::__name),
6219                            "requestId" => Ok(__FieldTag::__request_id),
6220                            "request_id" => Ok(__FieldTag::__request_id),
6221                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6222                        }
6223                    }
6224                }
6225                deserializer.deserialize_identifier(Visitor)
6226            }
6227        }
6228        struct Visitor;
6229        impl<'de> serde::de::Visitor<'de> for Visitor {
6230            type Value = DisableAnywhereCacheRequest;
6231            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6232                formatter.write_str("struct DisableAnywhereCacheRequest")
6233            }
6234            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6235            where
6236                A: serde::de::MapAccess<'de>,
6237            {
6238                #[allow(unused_imports)]
6239                use serde::de::Error;
6240                use std::option::Option::Some;
6241                let mut fields = std::collections::HashSet::new();
6242                let mut result = Self::Value::new();
6243                while let Some(tag) = map.next_key::<__FieldTag>()? {
6244                    #[allow(clippy::match_single_binding)]
6245                    match tag {
6246                        __FieldTag::__name => {
6247                            if !fields.insert(__FieldTag::__name) {
6248                                return std::result::Result::Err(A::Error::duplicate_field(
6249                                    "multiple values for name",
6250                                ));
6251                            }
6252                            result.name = map
6253                                .next_value::<std::option::Option<std::string::String>>()?
6254                                .unwrap_or_default();
6255                        }
6256                        __FieldTag::__request_id => {
6257                            if !fields.insert(__FieldTag::__request_id) {
6258                                return std::result::Result::Err(A::Error::duplicate_field(
6259                                    "multiple values for request_id",
6260                                ));
6261                            }
6262                            result.request_id = map
6263                                .next_value::<std::option::Option<std::string::String>>()?
6264                                .unwrap_or_default();
6265                        }
6266                        __FieldTag::Unknown(key) => {
6267                            let value = map.next_value::<serde_json::Value>()?;
6268                            result._unknown_fields.insert(key, value);
6269                        }
6270                    }
6271                }
6272                std::result::Result::Ok(result)
6273            }
6274        }
6275        deserializer.deserialize_any(Visitor)
6276    }
6277}
6278
6279#[doc(hidden)]
6280impl serde::ser::Serialize for DisableAnywhereCacheRequest {
6281    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6282    where
6283        S: serde::ser::Serializer,
6284    {
6285        use serde::ser::SerializeMap;
6286        #[allow(unused_imports)]
6287        use std::option::Option::Some;
6288        let mut state = serializer.serialize_map(std::option::Option::None)?;
6289        if !self.name.is_empty() {
6290            state.serialize_entry("name", &self.name)?;
6291        }
6292        if !self.request_id.is_empty() {
6293            state.serialize_entry("requestId", &self.request_id)?;
6294        }
6295        if !self._unknown_fields.is_empty() {
6296            for (key, value) in self._unknown_fields.iter() {
6297                state.serialize_entry(key, &value)?;
6298            }
6299        }
6300        state.end()
6301    }
6302}
6303
6304/// Request message for PauseAnywhereCache.
6305#[derive(Clone, Debug, Default, PartialEq)]
6306#[non_exhaustive]
6307pub struct PauseAnywhereCacheRequest {
6308    /// Required. The name field in the request should be:
6309    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
6310    pub name: std::string::String,
6311
6312    /// Optional. A unique identifier for this request. UUID is the recommended
6313    /// format, but other formats are still accepted. This request is only
6314    /// idempotent if a `request_id` is provided.
6315    pub request_id: std::string::String,
6316
6317    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6318}
6319
6320impl PauseAnywhereCacheRequest {
6321    pub fn new() -> Self {
6322        std::default::Default::default()
6323    }
6324
6325    /// Sets the value of [name][crate::model::PauseAnywhereCacheRequest::name].
6326    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6327        self.name = v.into();
6328        self
6329    }
6330
6331    /// Sets the value of [request_id][crate::model::PauseAnywhereCacheRequest::request_id].
6332    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6333        self.request_id = v.into();
6334        self
6335    }
6336}
6337
6338impl wkt::message::Message for PauseAnywhereCacheRequest {
6339    fn typename() -> &'static str {
6340        "type.googleapis.com/google.storage.control.v2.PauseAnywhereCacheRequest"
6341    }
6342}
6343
6344#[doc(hidden)]
6345impl<'de> serde::de::Deserialize<'de> for PauseAnywhereCacheRequest {
6346    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6347    where
6348        D: serde::Deserializer<'de>,
6349    {
6350        #[allow(non_camel_case_types)]
6351        #[doc(hidden)]
6352        #[derive(PartialEq, Eq, Hash)]
6353        enum __FieldTag {
6354            __name,
6355            __request_id,
6356            Unknown(std::string::String),
6357        }
6358        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6359            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6360            where
6361                D: serde::Deserializer<'de>,
6362            {
6363                struct Visitor;
6364                impl<'de> serde::de::Visitor<'de> for Visitor {
6365                    type Value = __FieldTag;
6366                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6367                        formatter.write_str("a field name for PauseAnywhereCacheRequest")
6368                    }
6369                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6370                    where
6371                        E: serde::de::Error,
6372                    {
6373                        use std::result::Result::Ok;
6374                        use std::string::ToString;
6375                        match value {
6376                            "name" => Ok(__FieldTag::__name),
6377                            "requestId" => Ok(__FieldTag::__request_id),
6378                            "request_id" => Ok(__FieldTag::__request_id),
6379                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6380                        }
6381                    }
6382                }
6383                deserializer.deserialize_identifier(Visitor)
6384            }
6385        }
6386        struct Visitor;
6387        impl<'de> serde::de::Visitor<'de> for Visitor {
6388            type Value = PauseAnywhereCacheRequest;
6389            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6390                formatter.write_str("struct PauseAnywhereCacheRequest")
6391            }
6392            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6393            where
6394                A: serde::de::MapAccess<'de>,
6395            {
6396                #[allow(unused_imports)]
6397                use serde::de::Error;
6398                use std::option::Option::Some;
6399                let mut fields = std::collections::HashSet::new();
6400                let mut result = Self::Value::new();
6401                while let Some(tag) = map.next_key::<__FieldTag>()? {
6402                    #[allow(clippy::match_single_binding)]
6403                    match tag {
6404                        __FieldTag::__name => {
6405                            if !fields.insert(__FieldTag::__name) {
6406                                return std::result::Result::Err(A::Error::duplicate_field(
6407                                    "multiple values for name",
6408                                ));
6409                            }
6410                            result.name = map
6411                                .next_value::<std::option::Option<std::string::String>>()?
6412                                .unwrap_or_default();
6413                        }
6414                        __FieldTag::__request_id => {
6415                            if !fields.insert(__FieldTag::__request_id) {
6416                                return std::result::Result::Err(A::Error::duplicate_field(
6417                                    "multiple values for request_id",
6418                                ));
6419                            }
6420                            result.request_id = map
6421                                .next_value::<std::option::Option<std::string::String>>()?
6422                                .unwrap_or_default();
6423                        }
6424                        __FieldTag::Unknown(key) => {
6425                            let value = map.next_value::<serde_json::Value>()?;
6426                            result._unknown_fields.insert(key, value);
6427                        }
6428                    }
6429                }
6430                std::result::Result::Ok(result)
6431            }
6432        }
6433        deserializer.deserialize_any(Visitor)
6434    }
6435}
6436
6437#[doc(hidden)]
6438impl serde::ser::Serialize for PauseAnywhereCacheRequest {
6439    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6440    where
6441        S: serde::ser::Serializer,
6442    {
6443        use serde::ser::SerializeMap;
6444        #[allow(unused_imports)]
6445        use std::option::Option::Some;
6446        let mut state = serializer.serialize_map(std::option::Option::None)?;
6447        if !self.name.is_empty() {
6448            state.serialize_entry("name", &self.name)?;
6449        }
6450        if !self.request_id.is_empty() {
6451            state.serialize_entry("requestId", &self.request_id)?;
6452        }
6453        if !self._unknown_fields.is_empty() {
6454            for (key, value) in self._unknown_fields.iter() {
6455                state.serialize_entry(key, &value)?;
6456            }
6457        }
6458        state.end()
6459    }
6460}
6461
6462/// Request message for ResumeAnywhereCache.
6463#[derive(Clone, Debug, Default, PartialEq)]
6464#[non_exhaustive]
6465pub struct ResumeAnywhereCacheRequest {
6466    /// Required. The name field in the request should be:
6467    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
6468    pub name: std::string::String,
6469
6470    /// Optional. A unique identifier for this request. UUID is the recommended
6471    /// format, but other formats are still accepted. This request is only
6472    /// idempotent if a `request_id` is provided.
6473    pub request_id: std::string::String,
6474
6475    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6476}
6477
6478impl ResumeAnywhereCacheRequest {
6479    pub fn new() -> Self {
6480        std::default::Default::default()
6481    }
6482
6483    /// Sets the value of [name][crate::model::ResumeAnywhereCacheRequest::name].
6484    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6485        self.name = v.into();
6486        self
6487    }
6488
6489    /// Sets the value of [request_id][crate::model::ResumeAnywhereCacheRequest::request_id].
6490    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6491        self.request_id = v.into();
6492        self
6493    }
6494}
6495
6496impl wkt::message::Message for ResumeAnywhereCacheRequest {
6497    fn typename() -> &'static str {
6498        "type.googleapis.com/google.storage.control.v2.ResumeAnywhereCacheRequest"
6499    }
6500}
6501
6502#[doc(hidden)]
6503impl<'de> serde::de::Deserialize<'de> for ResumeAnywhereCacheRequest {
6504    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6505    where
6506        D: serde::Deserializer<'de>,
6507    {
6508        #[allow(non_camel_case_types)]
6509        #[doc(hidden)]
6510        #[derive(PartialEq, Eq, Hash)]
6511        enum __FieldTag {
6512            __name,
6513            __request_id,
6514            Unknown(std::string::String),
6515        }
6516        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6517            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6518            where
6519                D: serde::Deserializer<'de>,
6520            {
6521                struct Visitor;
6522                impl<'de> serde::de::Visitor<'de> for Visitor {
6523                    type Value = __FieldTag;
6524                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6525                        formatter.write_str("a field name for ResumeAnywhereCacheRequest")
6526                    }
6527                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6528                    where
6529                        E: serde::de::Error,
6530                    {
6531                        use std::result::Result::Ok;
6532                        use std::string::ToString;
6533                        match value {
6534                            "name" => Ok(__FieldTag::__name),
6535                            "requestId" => Ok(__FieldTag::__request_id),
6536                            "request_id" => Ok(__FieldTag::__request_id),
6537                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6538                        }
6539                    }
6540                }
6541                deserializer.deserialize_identifier(Visitor)
6542            }
6543        }
6544        struct Visitor;
6545        impl<'de> serde::de::Visitor<'de> for Visitor {
6546            type Value = ResumeAnywhereCacheRequest;
6547            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6548                formatter.write_str("struct ResumeAnywhereCacheRequest")
6549            }
6550            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6551            where
6552                A: serde::de::MapAccess<'de>,
6553            {
6554                #[allow(unused_imports)]
6555                use serde::de::Error;
6556                use std::option::Option::Some;
6557                let mut fields = std::collections::HashSet::new();
6558                let mut result = Self::Value::new();
6559                while let Some(tag) = map.next_key::<__FieldTag>()? {
6560                    #[allow(clippy::match_single_binding)]
6561                    match tag {
6562                        __FieldTag::__name => {
6563                            if !fields.insert(__FieldTag::__name) {
6564                                return std::result::Result::Err(A::Error::duplicate_field(
6565                                    "multiple values for name",
6566                                ));
6567                            }
6568                            result.name = map
6569                                .next_value::<std::option::Option<std::string::String>>()?
6570                                .unwrap_or_default();
6571                        }
6572                        __FieldTag::__request_id => {
6573                            if !fields.insert(__FieldTag::__request_id) {
6574                                return std::result::Result::Err(A::Error::duplicate_field(
6575                                    "multiple values for request_id",
6576                                ));
6577                            }
6578                            result.request_id = map
6579                                .next_value::<std::option::Option<std::string::String>>()?
6580                                .unwrap_or_default();
6581                        }
6582                        __FieldTag::Unknown(key) => {
6583                            let value = map.next_value::<serde_json::Value>()?;
6584                            result._unknown_fields.insert(key, value);
6585                        }
6586                    }
6587                }
6588                std::result::Result::Ok(result)
6589            }
6590        }
6591        deserializer.deserialize_any(Visitor)
6592    }
6593}
6594
6595#[doc(hidden)]
6596impl serde::ser::Serialize for ResumeAnywhereCacheRequest {
6597    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6598    where
6599        S: serde::ser::Serializer,
6600    {
6601        use serde::ser::SerializeMap;
6602        #[allow(unused_imports)]
6603        use std::option::Option::Some;
6604        let mut state = serializer.serialize_map(std::option::Option::None)?;
6605        if !self.name.is_empty() {
6606            state.serialize_entry("name", &self.name)?;
6607        }
6608        if !self.request_id.is_empty() {
6609            state.serialize_entry("requestId", &self.request_id)?;
6610        }
6611        if !self._unknown_fields.is_empty() {
6612            for (key, value) in self._unknown_fields.iter() {
6613                state.serialize_entry(key, &value)?;
6614            }
6615        }
6616        state.end()
6617    }
6618}
6619
6620/// Request message for GetAnywhereCache.
6621#[derive(Clone, Debug, Default, PartialEq)]
6622#[non_exhaustive]
6623pub struct GetAnywhereCacheRequest {
6624    /// Required. The name field in the request should be:
6625    /// `projects/{project}/buckets/{bucket}/anywhereCaches/{anywhere_cache}`
6626    pub name: std::string::String,
6627
6628    /// Optional. A unique identifier for this request. UUID is the recommended
6629    /// format, but other formats are still accepted.
6630    pub request_id: std::string::String,
6631
6632    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6633}
6634
6635impl GetAnywhereCacheRequest {
6636    pub fn new() -> Self {
6637        std::default::Default::default()
6638    }
6639
6640    /// Sets the value of [name][crate::model::GetAnywhereCacheRequest::name].
6641    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6642        self.name = v.into();
6643        self
6644    }
6645
6646    /// Sets the value of [request_id][crate::model::GetAnywhereCacheRequest::request_id].
6647    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6648        self.request_id = v.into();
6649        self
6650    }
6651}
6652
6653impl wkt::message::Message for GetAnywhereCacheRequest {
6654    fn typename() -> &'static str {
6655        "type.googleapis.com/google.storage.control.v2.GetAnywhereCacheRequest"
6656    }
6657}
6658
6659#[doc(hidden)]
6660impl<'de> serde::de::Deserialize<'de> for GetAnywhereCacheRequest {
6661    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6662    where
6663        D: serde::Deserializer<'de>,
6664    {
6665        #[allow(non_camel_case_types)]
6666        #[doc(hidden)]
6667        #[derive(PartialEq, Eq, Hash)]
6668        enum __FieldTag {
6669            __name,
6670            __request_id,
6671            Unknown(std::string::String),
6672        }
6673        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6674            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6675            where
6676                D: serde::Deserializer<'de>,
6677            {
6678                struct Visitor;
6679                impl<'de> serde::de::Visitor<'de> for Visitor {
6680                    type Value = __FieldTag;
6681                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6682                        formatter.write_str("a field name for GetAnywhereCacheRequest")
6683                    }
6684                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6685                    where
6686                        E: serde::de::Error,
6687                    {
6688                        use std::result::Result::Ok;
6689                        use std::string::ToString;
6690                        match value {
6691                            "name" => Ok(__FieldTag::__name),
6692                            "requestId" => Ok(__FieldTag::__request_id),
6693                            "request_id" => Ok(__FieldTag::__request_id),
6694                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6695                        }
6696                    }
6697                }
6698                deserializer.deserialize_identifier(Visitor)
6699            }
6700        }
6701        struct Visitor;
6702        impl<'de> serde::de::Visitor<'de> for Visitor {
6703            type Value = GetAnywhereCacheRequest;
6704            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6705                formatter.write_str("struct GetAnywhereCacheRequest")
6706            }
6707            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6708            where
6709                A: serde::de::MapAccess<'de>,
6710            {
6711                #[allow(unused_imports)]
6712                use serde::de::Error;
6713                use std::option::Option::Some;
6714                let mut fields = std::collections::HashSet::new();
6715                let mut result = Self::Value::new();
6716                while let Some(tag) = map.next_key::<__FieldTag>()? {
6717                    #[allow(clippy::match_single_binding)]
6718                    match tag {
6719                        __FieldTag::__name => {
6720                            if !fields.insert(__FieldTag::__name) {
6721                                return std::result::Result::Err(A::Error::duplicate_field(
6722                                    "multiple values for name",
6723                                ));
6724                            }
6725                            result.name = map
6726                                .next_value::<std::option::Option<std::string::String>>()?
6727                                .unwrap_or_default();
6728                        }
6729                        __FieldTag::__request_id => {
6730                            if !fields.insert(__FieldTag::__request_id) {
6731                                return std::result::Result::Err(A::Error::duplicate_field(
6732                                    "multiple values for request_id",
6733                                ));
6734                            }
6735                            result.request_id = map
6736                                .next_value::<std::option::Option<std::string::String>>()?
6737                                .unwrap_or_default();
6738                        }
6739                        __FieldTag::Unknown(key) => {
6740                            let value = map.next_value::<serde_json::Value>()?;
6741                            result._unknown_fields.insert(key, value);
6742                        }
6743                    }
6744                }
6745                std::result::Result::Ok(result)
6746            }
6747        }
6748        deserializer.deserialize_any(Visitor)
6749    }
6750}
6751
6752#[doc(hidden)]
6753impl serde::ser::Serialize for GetAnywhereCacheRequest {
6754    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6755    where
6756        S: serde::ser::Serializer,
6757    {
6758        use serde::ser::SerializeMap;
6759        #[allow(unused_imports)]
6760        use std::option::Option::Some;
6761        let mut state = serializer.serialize_map(std::option::Option::None)?;
6762        if !self.name.is_empty() {
6763            state.serialize_entry("name", &self.name)?;
6764        }
6765        if !self.request_id.is_empty() {
6766            state.serialize_entry("requestId", &self.request_id)?;
6767        }
6768        if !self._unknown_fields.is_empty() {
6769            for (key, value) in self._unknown_fields.iter() {
6770                state.serialize_entry(key, &value)?;
6771            }
6772        }
6773        state.end()
6774    }
6775}
6776
6777/// Request message for ListAnywhereCaches.
6778#[derive(Clone, Debug, Default, PartialEq)]
6779#[non_exhaustive]
6780pub struct ListAnywhereCachesRequest {
6781    /// Required. The bucket to which this cache belongs.
6782    pub parent: std::string::String,
6783
6784    /// Maximum number of caches to return in a single response.
6785    /// The service will use this parameter or 1,000 items, whichever is smaller.
6786    pub page_size: i32,
6787
6788    /// A previously-returned page token representing part of the larger set of
6789    /// results to view.
6790    pub page_token: std::string::String,
6791
6792    /// Optional. A unique identifier for this request. UUID is the recommended
6793    /// format, but other formats are still accepted.
6794    pub request_id: std::string::String,
6795
6796    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
6797}
6798
6799impl ListAnywhereCachesRequest {
6800    pub fn new() -> Self {
6801        std::default::Default::default()
6802    }
6803
6804    /// Sets the value of [parent][crate::model::ListAnywhereCachesRequest::parent].
6805    pub fn set_parent<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6806        self.parent = v.into();
6807        self
6808    }
6809
6810    /// Sets the value of [page_size][crate::model::ListAnywhereCachesRequest::page_size].
6811    pub fn set_page_size<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
6812        self.page_size = v.into();
6813        self
6814    }
6815
6816    /// Sets the value of [page_token][crate::model::ListAnywhereCachesRequest::page_token].
6817    pub fn set_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6818        self.page_token = v.into();
6819        self
6820    }
6821
6822    /// Sets the value of [request_id][crate::model::ListAnywhereCachesRequest::request_id].
6823    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6824        self.request_id = v.into();
6825        self
6826    }
6827}
6828
6829impl wkt::message::Message for ListAnywhereCachesRequest {
6830    fn typename() -> &'static str {
6831        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesRequest"
6832    }
6833}
6834
6835#[doc(hidden)]
6836impl<'de> serde::de::Deserialize<'de> for ListAnywhereCachesRequest {
6837    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6838    where
6839        D: serde::Deserializer<'de>,
6840    {
6841        #[allow(non_camel_case_types)]
6842        #[doc(hidden)]
6843        #[derive(PartialEq, Eq, Hash)]
6844        enum __FieldTag {
6845            __parent,
6846            __page_size,
6847            __page_token,
6848            __request_id,
6849            Unknown(std::string::String),
6850        }
6851        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
6852            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
6853            where
6854                D: serde::Deserializer<'de>,
6855            {
6856                struct Visitor;
6857                impl<'de> serde::de::Visitor<'de> for Visitor {
6858                    type Value = __FieldTag;
6859                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6860                        formatter.write_str("a field name for ListAnywhereCachesRequest")
6861                    }
6862                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
6863                    where
6864                        E: serde::de::Error,
6865                    {
6866                        use std::result::Result::Ok;
6867                        use std::string::ToString;
6868                        match value {
6869                            "parent" => Ok(__FieldTag::__parent),
6870                            "pageSize" => Ok(__FieldTag::__page_size),
6871                            "page_size" => Ok(__FieldTag::__page_size),
6872                            "pageToken" => Ok(__FieldTag::__page_token),
6873                            "page_token" => Ok(__FieldTag::__page_token),
6874                            "requestId" => Ok(__FieldTag::__request_id),
6875                            "request_id" => Ok(__FieldTag::__request_id),
6876                            _ => Ok(__FieldTag::Unknown(value.to_string())),
6877                        }
6878                    }
6879                }
6880                deserializer.deserialize_identifier(Visitor)
6881            }
6882        }
6883        struct Visitor;
6884        impl<'de> serde::de::Visitor<'de> for Visitor {
6885            type Value = ListAnywhereCachesRequest;
6886            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
6887                formatter.write_str("struct ListAnywhereCachesRequest")
6888            }
6889            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
6890            where
6891                A: serde::de::MapAccess<'de>,
6892            {
6893                #[allow(unused_imports)]
6894                use serde::de::Error;
6895                use std::option::Option::Some;
6896                let mut fields = std::collections::HashSet::new();
6897                let mut result = Self::Value::new();
6898                while let Some(tag) = map.next_key::<__FieldTag>()? {
6899                    #[allow(clippy::match_single_binding)]
6900                    match tag {
6901                        __FieldTag::__parent => {
6902                            if !fields.insert(__FieldTag::__parent) {
6903                                return std::result::Result::Err(A::Error::duplicate_field(
6904                                    "multiple values for parent",
6905                                ));
6906                            }
6907                            result.parent = map
6908                                .next_value::<std::option::Option<std::string::String>>()?
6909                                .unwrap_or_default();
6910                        }
6911                        __FieldTag::__page_size => {
6912                            if !fields.insert(__FieldTag::__page_size) {
6913                                return std::result::Result::Err(A::Error::duplicate_field(
6914                                    "multiple values for page_size",
6915                                ));
6916                            }
6917                            struct __With(std::option::Option<i32>);
6918                            impl<'de> serde::de::Deserialize<'de> for __With {
6919                                fn deserialize<D>(
6920                                    deserializer: D,
6921                                ) -> std::result::Result<Self, D::Error>
6922                                where
6923                                    D: serde::de::Deserializer<'de>,
6924                                {
6925                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
6926                                }
6927                            }
6928                            result.page_size = map.next_value::<__With>()?.0.unwrap_or_default();
6929                        }
6930                        __FieldTag::__page_token => {
6931                            if !fields.insert(__FieldTag::__page_token) {
6932                                return std::result::Result::Err(A::Error::duplicate_field(
6933                                    "multiple values for page_token",
6934                                ));
6935                            }
6936                            result.page_token = map
6937                                .next_value::<std::option::Option<std::string::String>>()?
6938                                .unwrap_or_default();
6939                        }
6940                        __FieldTag::__request_id => {
6941                            if !fields.insert(__FieldTag::__request_id) {
6942                                return std::result::Result::Err(A::Error::duplicate_field(
6943                                    "multiple values for request_id",
6944                                ));
6945                            }
6946                            result.request_id = map
6947                                .next_value::<std::option::Option<std::string::String>>()?
6948                                .unwrap_or_default();
6949                        }
6950                        __FieldTag::Unknown(key) => {
6951                            let value = map.next_value::<serde_json::Value>()?;
6952                            result._unknown_fields.insert(key, value);
6953                        }
6954                    }
6955                }
6956                std::result::Result::Ok(result)
6957            }
6958        }
6959        deserializer.deserialize_any(Visitor)
6960    }
6961}
6962
6963#[doc(hidden)]
6964impl serde::ser::Serialize for ListAnywhereCachesRequest {
6965    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6966    where
6967        S: serde::ser::Serializer,
6968    {
6969        use serde::ser::SerializeMap;
6970        #[allow(unused_imports)]
6971        use std::option::Option::Some;
6972        let mut state = serializer.serialize_map(std::option::Option::None)?;
6973        if !self.parent.is_empty() {
6974            state.serialize_entry("parent", &self.parent)?;
6975        }
6976        if !wkt::internal::is_default(&self.page_size) {
6977            struct __With<'a>(&'a i32);
6978            impl<'a> serde::ser::Serialize for __With<'a> {
6979                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
6980                where
6981                    S: serde::ser::Serializer,
6982                {
6983                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
6984                }
6985            }
6986            state.serialize_entry("pageSize", &__With(&self.page_size))?;
6987        }
6988        if !self.page_token.is_empty() {
6989            state.serialize_entry("pageToken", &self.page_token)?;
6990        }
6991        if !self.request_id.is_empty() {
6992            state.serialize_entry("requestId", &self.request_id)?;
6993        }
6994        if !self._unknown_fields.is_empty() {
6995            for (key, value) in self._unknown_fields.iter() {
6996                state.serialize_entry(key, &value)?;
6997            }
6998        }
6999        state.end()
7000    }
7001}
7002
7003/// Response message for ListAnywhereCaches.
7004#[derive(Clone, Debug, Default, PartialEq)]
7005#[non_exhaustive]
7006pub struct ListAnywhereCachesResponse {
7007    /// The list of items.
7008    pub anywhere_caches: std::vec::Vec<crate::model::AnywhereCache>,
7009
7010    /// A token, which can be sent as `page_token` to retrieve the next page.
7011    /// If this field is omitted, there are no subsequent pages.
7012    pub next_page_token: std::string::String,
7013
7014    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7015}
7016
7017impl ListAnywhereCachesResponse {
7018    pub fn new() -> Self {
7019        std::default::Default::default()
7020    }
7021
7022    /// Sets the value of [anywhere_caches][crate::model::ListAnywhereCachesResponse::anywhere_caches].
7023    pub fn set_anywhere_caches<T, V>(mut self, v: T) -> Self
7024    where
7025        T: std::iter::IntoIterator<Item = V>,
7026        V: std::convert::Into<crate::model::AnywhereCache>,
7027    {
7028        use std::iter::Iterator;
7029        self.anywhere_caches = v.into_iter().map(|i| i.into()).collect();
7030        self
7031    }
7032
7033    /// Sets the value of [next_page_token][crate::model::ListAnywhereCachesResponse::next_page_token].
7034    pub fn set_next_page_token<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7035        self.next_page_token = v.into();
7036        self
7037    }
7038}
7039
7040impl wkt::message::Message for ListAnywhereCachesResponse {
7041    fn typename() -> &'static str {
7042        "type.googleapis.com/google.storage.control.v2.ListAnywhereCachesResponse"
7043    }
7044}
7045
7046#[doc(hidden)]
7047impl gax::paginator::internal::PageableResponse for ListAnywhereCachesResponse {
7048    type PageItem = crate::model::AnywhereCache;
7049
7050    fn items(self) -> std::vec::Vec<Self::PageItem> {
7051        self.anywhere_caches
7052    }
7053
7054    fn next_page_token(&self) -> std::string::String {
7055        use std::clone::Clone;
7056        self.next_page_token.clone()
7057    }
7058}
7059
7060#[doc(hidden)]
7061impl<'de> serde::de::Deserialize<'de> for ListAnywhereCachesResponse {
7062    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7063    where
7064        D: serde::Deserializer<'de>,
7065    {
7066        #[allow(non_camel_case_types)]
7067        #[doc(hidden)]
7068        #[derive(PartialEq, Eq, Hash)]
7069        enum __FieldTag {
7070            __anywhere_caches,
7071            __next_page_token,
7072            Unknown(std::string::String),
7073        }
7074        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7075            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7076            where
7077                D: serde::Deserializer<'de>,
7078            {
7079                struct Visitor;
7080                impl<'de> serde::de::Visitor<'de> for Visitor {
7081                    type Value = __FieldTag;
7082                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7083                        formatter.write_str("a field name for ListAnywhereCachesResponse")
7084                    }
7085                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7086                    where
7087                        E: serde::de::Error,
7088                    {
7089                        use std::result::Result::Ok;
7090                        use std::string::ToString;
7091                        match value {
7092                            "anywhereCaches" => Ok(__FieldTag::__anywhere_caches),
7093                            "anywhere_caches" => Ok(__FieldTag::__anywhere_caches),
7094                            "nextPageToken" => Ok(__FieldTag::__next_page_token),
7095                            "next_page_token" => Ok(__FieldTag::__next_page_token),
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 = ListAnywhereCachesResponse;
7106            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7107                formatter.write_str("struct ListAnywhereCachesResponse")
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::__anywhere_caches => {
7122                            if !fields.insert(__FieldTag::__anywhere_caches) {
7123                                return std::result::Result::Err(A::Error::duplicate_field(
7124                                    "multiple values for anywhere_caches",
7125                                ));
7126                            }
7127                            result.anywhere_caches = map.next_value::<std::option::Option<std::vec::Vec<crate::model::AnywhereCache>>>()?.unwrap_or_default();
7128                        }
7129                        __FieldTag::__next_page_token => {
7130                            if !fields.insert(__FieldTag::__next_page_token) {
7131                                return std::result::Result::Err(A::Error::duplicate_field(
7132                                    "multiple values for next_page_token",
7133                                ));
7134                            }
7135                            result.next_page_token = map
7136                                .next_value::<std::option::Option<std::string::String>>()?
7137                                .unwrap_or_default();
7138                        }
7139                        __FieldTag::Unknown(key) => {
7140                            let value = map.next_value::<serde_json::Value>()?;
7141                            result._unknown_fields.insert(key, value);
7142                        }
7143                    }
7144                }
7145                std::result::Result::Ok(result)
7146            }
7147        }
7148        deserializer.deserialize_any(Visitor)
7149    }
7150}
7151
7152#[doc(hidden)]
7153impl serde::ser::Serialize for ListAnywhereCachesResponse {
7154    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7155    where
7156        S: serde::ser::Serializer,
7157    {
7158        use serde::ser::SerializeMap;
7159        #[allow(unused_imports)]
7160        use std::option::Option::Some;
7161        let mut state = serializer.serialize_map(std::option::Option::None)?;
7162        if !self.anywhere_caches.is_empty() {
7163            state.serialize_entry("anywhereCaches", &self.anywhere_caches)?;
7164        }
7165        if !self.next_page_token.is_empty() {
7166            state.serialize_entry("nextPageToken", &self.next_page_token)?;
7167        }
7168        if !self._unknown_fields.is_empty() {
7169            for (key, value) in self._unknown_fields.iter() {
7170                state.serialize_entry(key, &value)?;
7171            }
7172        }
7173        state.end()
7174    }
7175}
7176
7177/// The `IntelligenceConfig` resource associated with your organization, folder,
7178/// or project.
7179#[derive(Clone, Debug, Default, PartialEq)]
7180#[non_exhaustive]
7181pub struct IntelligenceConfig {
7182    /// Identifier. The name of the `IntelligenceConfig` resource associated with
7183    /// your organization, folder, or project.
7184    ///
7185    /// The name format varies based on the GCP resource hierarchy as follows:
7186    ///
7187    /// * For project:
7188    ///   `projects/{project_number}/locations/global/intelligenceConfig`
7189    /// * For organization:
7190    ///   `organizations/{org_id}/locations/global/intelligenceConfig`
7191    /// * For folder: `folders/{folder_id}/locations/global/intelligenceConfig`
7192    pub name: std::string::String,
7193
7194    /// Optional. The edition configuration of the `IntelligenceConfig` resource.
7195    pub edition_config: crate::model::intelligence_config::EditionConfig,
7196
7197    /// Output only. The time at which the `IntelligenceConfig` resource is last
7198    /// updated.
7199    pub update_time: std::option::Option<wkt::Timestamp>,
7200
7201    /// Optional. Filter over location and bucket.
7202    pub filter: std::option::Option<crate::model::intelligence_config::Filter>,
7203
7204    /// Output only. The `IntelligenceConfig` resource that is applicable for the
7205    /// resource.
7206    pub effective_intelligence_config:
7207        std::option::Option<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
7208
7209    /// The trial configuration of the `IntelligenceConfig` resource.
7210    pub trial_config: std::option::Option<crate::model::intelligence_config::TrialConfig>,
7211
7212    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7213}
7214
7215impl IntelligenceConfig {
7216    pub fn new() -> Self {
7217        std::default::Default::default()
7218    }
7219
7220    /// Sets the value of [name][crate::model::IntelligenceConfig::name].
7221    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
7222        self.name = v.into();
7223        self
7224    }
7225
7226    /// Sets the value of [edition_config][crate::model::IntelligenceConfig::edition_config].
7227    pub fn set_edition_config<
7228        T: std::convert::Into<crate::model::intelligence_config::EditionConfig>,
7229    >(
7230        mut self,
7231        v: T,
7232    ) -> Self {
7233        self.edition_config = v.into();
7234        self
7235    }
7236
7237    /// Sets the value of [update_time][crate::model::IntelligenceConfig::update_time].
7238    pub fn set_update_time<T>(mut self, v: T) -> Self
7239    where
7240        T: std::convert::Into<wkt::Timestamp>,
7241    {
7242        self.update_time = std::option::Option::Some(v.into());
7243        self
7244    }
7245
7246    /// Sets or clears the value of [update_time][crate::model::IntelligenceConfig::update_time].
7247    pub fn set_or_clear_update_time<T>(mut self, v: std::option::Option<T>) -> Self
7248    where
7249        T: std::convert::Into<wkt::Timestamp>,
7250    {
7251        self.update_time = v.map(|x| x.into());
7252        self
7253    }
7254
7255    /// Sets the value of [filter][crate::model::IntelligenceConfig::filter].
7256    pub fn set_filter<T>(mut self, v: T) -> Self
7257    where
7258        T: std::convert::Into<crate::model::intelligence_config::Filter>,
7259    {
7260        self.filter = std::option::Option::Some(v.into());
7261        self
7262    }
7263
7264    /// Sets or clears the value of [filter][crate::model::IntelligenceConfig::filter].
7265    pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
7266    where
7267        T: std::convert::Into<crate::model::intelligence_config::Filter>,
7268    {
7269        self.filter = v.map(|x| x.into());
7270        self
7271    }
7272
7273    /// Sets the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
7274    pub fn set_effective_intelligence_config<T>(mut self, v: T) -> Self
7275    where
7276        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
7277    {
7278        self.effective_intelligence_config = std::option::Option::Some(v.into());
7279        self
7280    }
7281
7282    /// Sets or clears the value of [effective_intelligence_config][crate::model::IntelligenceConfig::effective_intelligence_config].
7283    pub fn set_or_clear_effective_intelligence_config<T>(
7284        mut self,
7285        v: std::option::Option<T>,
7286    ) -> Self
7287    where
7288        T: std::convert::Into<crate::model::intelligence_config::EffectiveIntelligenceConfig>,
7289    {
7290        self.effective_intelligence_config = v.map(|x| x.into());
7291        self
7292    }
7293
7294    /// Sets the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
7295    pub fn set_trial_config<T>(mut self, v: T) -> Self
7296    where
7297        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
7298    {
7299        self.trial_config = std::option::Option::Some(v.into());
7300        self
7301    }
7302
7303    /// Sets or clears the value of [trial_config][crate::model::IntelligenceConfig::trial_config].
7304    pub fn set_or_clear_trial_config<T>(mut self, v: std::option::Option<T>) -> Self
7305    where
7306        T: std::convert::Into<crate::model::intelligence_config::TrialConfig>,
7307    {
7308        self.trial_config = v.map(|x| x.into());
7309        self
7310    }
7311}
7312
7313impl wkt::message::Message for IntelligenceConfig {
7314    fn typename() -> &'static str {
7315        "type.googleapis.com/google.storage.control.v2.IntelligenceConfig"
7316    }
7317}
7318
7319#[doc(hidden)]
7320impl<'de> serde::de::Deserialize<'de> for IntelligenceConfig {
7321    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7322    where
7323        D: serde::Deserializer<'de>,
7324    {
7325        #[allow(non_camel_case_types)]
7326        #[doc(hidden)]
7327        #[derive(PartialEq, Eq, Hash)]
7328        enum __FieldTag {
7329            __name,
7330            __edition_config,
7331            __update_time,
7332            __filter,
7333            __effective_intelligence_config,
7334            __trial_config,
7335            Unknown(std::string::String),
7336        }
7337        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7338            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7339            where
7340                D: serde::Deserializer<'de>,
7341            {
7342                struct Visitor;
7343                impl<'de> serde::de::Visitor<'de> for Visitor {
7344                    type Value = __FieldTag;
7345                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7346                        formatter.write_str("a field name for IntelligenceConfig")
7347                    }
7348                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7349                    where
7350                        E: serde::de::Error,
7351                    {
7352                        use std::result::Result::Ok;
7353                        use std::string::ToString;
7354                        match value {
7355                            "name" => Ok(__FieldTag::__name),
7356                            "editionConfig" => Ok(__FieldTag::__edition_config),
7357                            "edition_config" => Ok(__FieldTag::__edition_config),
7358                            "updateTime" => Ok(__FieldTag::__update_time),
7359                            "update_time" => Ok(__FieldTag::__update_time),
7360                            "filter" => Ok(__FieldTag::__filter),
7361                            "effectiveIntelligenceConfig" => {
7362                                Ok(__FieldTag::__effective_intelligence_config)
7363                            }
7364                            "effective_intelligence_config" => {
7365                                Ok(__FieldTag::__effective_intelligence_config)
7366                            }
7367                            "trialConfig" => Ok(__FieldTag::__trial_config),
7368                            "trial_config" => Ok(__FieldTag::__trial_config),
7369                            _ => Ok(__FieldTag::Unknown(value.to_string())),
7370                        }
7371                    }
7372                }
7373                deserializer.deserialize_identifier(Visitor)
7374            }
7375        }
7376        struct Visitor;
7377        impl<'de> serde::de::Visitor<'de> for Visitor {
7378            type Value = IntelligenceConfig;
7379            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7380                formatter.write_str("struct IntelligenceConfig")
7381            }
7382            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7383            where
7384                A: serde::de::MapAccess<'de>,
7385            {
7386                #[allow(unused_imports)]
7387                use serde::de::Error;
7388                use std::option::Option::Some;
7389                let mut fields = std::collections::HashSet::new();
7390                let mut result = Self::Value::new();
7391                while let Some(tag) = map.next_key::<__FieldTag>()? {
7392                    #[allow(clippy::match_single_binding)]
7393                    match tag {
7394                        __FieldTag::__name => {
7395                            if !fields.insert(__FieldTag::__name) {
7396                                return std::result::Result::Err(A::Error::duplicate_field(
7397                                    "multiple values for name",
7398                                ));
7399                            }
7400                            result.name = map
7401                                .next_value::<std::option::Option<std::string::String>>()?
7402                                .unwrap_or_default();
7403                        }
7404                        __FieldTag::__edition_config => {
7405                            if !fields.insert(__FieldTag::__edition_config) {
7406                                return std::result::Result::Err(A::Error::duplicate_field(
7407                                    "multiple values for edition_config",
7408                                ));
7409                            }
7410                            result.edition_config = map
7411                                .next_value::<std::option::Option<
7412                                    crate::model::intelligence_config::EditionConfig,
7413                                >>()?
7414                                .unwrap_or_default();
7415                        }
7416                        __FieldTag::__update_time => {
7417                            if !fields.insert(__FieldTag::__update_time) {
7418                                return std::result::Result::Err(A::Error::duplicate_field(
7419                                    "multiple values for update_time",
7420                                ));
7421                            }
7422                            result.update_time =
7423                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
7424                        }
7425                        __FieldTag::__filter => {
7426                            if !fields.insert(__FieldTag::__filter) {
7427                                return std::result::Result::Err(A::Error::duplicate_field(
7428                                    "multiple values for filter",
7429                                ));
7430                            }
7431                            result.filter = map.next_value::<std::option::Option<crate::model::intelligence_config::Filter>>()?
7432                                ;
7433                        }
7434                        __FieldTag::__effective_intelligence_config => {
7435                            if !fields.insert(__FieldTag::__effective_intelligence_config) {
7436                                return std::result::Result::Err(A::Error::duplicate_field(
7437                                    "multiple values for effective_intelligence_config",
7438                                ));
7439                            }
7440                            result.effective_intelligence_config = map
7441                                .next_value::<std::option::Option<
7442                                    crate::model::intelligence_config::EffectiveIntelligenceConfig,
7443                                >>()?;
7444                        }
7445                        __FieldTag::__trial_config => {
7446                            if !fields.insert(__FieldTag::__trial_config) {
7447                                return std::result::Result::Err(A::Error::duplicate_field(
7448                                    "multiple values for trial_config",
7449                                ));
7450                            }
7451                            result.trial_config = map.next_value::<std::option::Option<
7452                                crate::model::intelligence_config::TrialConfig,
7453                            >>()?;
7454                        }
7455                        __FieldTag::Unknown(key) => {
7456                            let value = map.next_value::<serde_json::Value>()?;
7457                            result._unknown_fields.insert(key, value);
7458                        }
7459                    }
7460                }
7461                std::result::Result::Ok(result)
7462            }
7463        }
7464        deserializer.deserialize_any(Visitor)
7465    }
7466}
7467
7468#[doc(hidden)]
7469impl serde::ser::Serialize for IntelligenceConfig {
7470    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7471    where
7472        S: serde::ser::Serializer,
7473    {
7474        use serde::ser::SerializeMap;
7475        #[allow(unused_imports)]
7476        use std::option::Option::Some;
7477        let mut state = serializer.serialize_map(std::option::Option::None)?;
7478        if !self.name.is_empty() {
7479            state.serialize_entry("name", &self.name)?;
7480        }
7481        if !wkt::internal::is_default(&self.edition_config) {
7482            state.serialize_entry("editionConfig", &self.edition_config)?;
7483        }
7484        if self.update_time.is_some() {
7485            state.serialize_entry("updateTime", &self.update_time)?;
7486        }
7487        if self.filter.is_some() {
7488            state.serialize_entry("filter", &self.filter)?;
7489        }
7490        if self.effective_intelligence_config.is_some() {
7491            state.serialize_entry(
7492                "effectiveIntelligenceConfig",
7493                &self.effective_intelligence_config,
7494            )?;
7495        }
7496        if self.trial_config.is_some() {
7497            state.serialize_entry("trialConfig", &self.trial_config)?;
7498        }
7499        if !self._unknown_fields.is_empty() {
7500            for (key, value) in self._unknown_fields.iter() {
7501                state.serialize_entry(key, &value)?;
7502            }
7503        }
7504        state.end()
7505    }
7506}
7507
7508/// Defines additional types related to [IntelligenceConfig].
7509pub mod intelligence_config {
7510    #[allow(unused_imports)]
7511    use super::*;
7512
7513    /// Filter over location and bucket using include or exclude semantics.
7514    /// Resources that match the include or exclude filter are exclusively included
7515    /// or excluded from the Storage Intelligence plan.
7516    #[derive(Clone, Debug, Default, PartialEq)]
7517    #[non_exhaustive]
7518    pub struct Filter {
7519        /// Bucket locations to include or exclude.
7520        pub cloud_storage_locations: std::option::Option<
7521            crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
7522        >,
7523
7524        /// Buckets to include or exclude.
7525        pub cloud_storage_buckets: std::option::Option<
7526            crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
7527        >,
7528
7529        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7530    }
7531
7532    impl Filter {
7533        pub fn new() -> Self {
7534            std::default::Default::default()
7535        }
7536
7537        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations].
7538        ///
7539        /// Note that all the setters affecting `cloud_storage_locations` are mutually
7540        /// exclusive.
7541        pub fn set_cloud_storage_locations<
7542            T: std::convert::Into<
7543                    std::option::Option<
7544                        crate::model::intelligence_config::filter::CloudStorageLocationsOneOf,
7545                    >,
7546                >,
7547        >(
7548            mut self,
7549            v: T,
7550        ) -> Self {
7551            self.cloud_storage_locations = v.into();
7552            self
7553        }
7554
7555        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
7556        /// if it holds a `IncludedCloudStorageLocations`, `None` if the field is not set or
7557        /// holds a different branch.
7558        pub fn included_cloud_storage_locations(
7559            &self,
7560        ) -> std::option::Option<
7561            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
7562        > {
7563            #[allow(unreachable_patterns)]
7564            self.cloud_storage_locations.as_ref().and_then(|v| match v {
7565                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(v) => std::option::Option::Some(v),
7566                _ => std::option::Option::None,
7567            })
7568        }
7569
7570        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
7571        /// to hold a `IncludedCloudStorageLocations`.
7572        ///
7573        /// Note that all the setters affecting `cloud_storage_locations` are
7574        /// mutually exclusive.
7575        pub fn set_included_cloud_storage_locations<
7576            T: std::convert::Into<
7577                    std::boxed::Box<
7578                        crate::model::intelligence_config::filter::CloudStorageLocations,
7579                    >,
7580                >,
7581        >(
7582            mut self,
7583            v: T,
7584        ) -> Self {
7585            self.cloud_storage_locations = std::option::Option::Some(
7586                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
7587                    v.into()
7588                )
7589            );
7590            self
7591        }
7592
7593        /// The value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
7594        /// if it holds a `ExcludedCloudStorageLocations`, `None` if the field is not set or
7595        /// holds a different branch.
7596        pub fn excluded_cloud_storage_locations(
7597            &self,
7598        ) -> std::option::Option<
7599            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
7600        > {
7601            #[allow(unreachable_patterns)]
7602            self.cloud_storage_locations.as_ref().and_then(|v| match v {
7603                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(v) => std::option::Option::Some(v),
7604                _ => std::option::Option::None,
7605            })
7606        }
7607
7608        /// Sets the value of [cloud_storage_locations][crate::model::intelligence_config::Filter::cloud_storage_locations]
7609        /// to hold a `ExcludedCloudStorageLocations`.
7610        ///
7611        /// Note that all the setters affecting `cloud_storage_locations` are
7612        /// mutually exclusive.
7613        pub fn set_excluded_cloud_storage_locations<
7614            T: std::convert::Into<
7615                    std::boxed::Box<
7616                        crate::model::intelligence_config::filter::CloudStorageLocations,
7617                    >,
7618                >,
7619        >(
7620            mut self,
7621            v: T,
7622        ) -> Self {
7623            self.cloud_storage_locations = std::option::Option::Some(
7624                crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
7625                    v.into()
7626                )
7627            );
7628            self
7629        }
7630
7631        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets].
7632        ///
7633        /// Note that all the setters affecting `cloud_storage_buckets` are mutually
7634        /// exclusive.
7635        pub fn set_cloud_storage_buckets<
7636            T: std::convert::Into<
7637                    std::option::Option<
7638                        crate::model::intelligence_config::filter::CloudStorageBucketsOneOf,
7639                    >,
7640                >,
7641        >(
7642            mut self,
7643            v: T,
7644        ) -> Self {
7645            self.cloud_storage_buckets = v.into();
7646            self
7647        }
7648
7649        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
7650        /// if it holds a `IncludedCloudStorageBuckets`, `None` if the field is not set or
7651        /// holds a different branch.
7652        pub fn included_cloud_storage_buckets(
7653            &self,
7654        ) -> std::option::Option<
7655            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
7656        > {
7657            #[allow(unreachable_patterns)]
7658            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
7659                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(v) => std::option::Option::Some(v),
7660                _ => std::option::Option::None,
7661            })
7662        }
7663
7664        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
7665        /// to hold a `IncludedCloudStorageBuckets`.
7666        ///
7667        /// Note that all the setters affecting `cloud_storage_buckets` are
7668        /// mutually exclusive.
7669        pub fn set_included_cloud_storage_buckets<
7670            T: std::convert::Into<
7671                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
7672                >,
7673        >(
7674            mut self,
7675            v: T,
7676        ) -> Self {
7677            self.cloud_storage_buckets = std::option::Option::Some(
7678                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
7679                    v.into()
7680                )
7681            );
7682            self
7683        }
7684
7685        /// The value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
7686        /// if it holds a `ExcludedCloudStorageBuckets`, `None` if the field is not set or
7687        /// holds a different branch.
7688        pub fn excluded_cloud_storage_buckets(
7689            &self,
7690        ) -> std::option::Option<
7691            &std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
7692        > {
7693            #[allow(unreachable_patterns)]
7694            self.cloud_storage_buckets.as_ref().and_then(|v| match v {
7695                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(v) => std::option::Option::Some(v),
7696                _ => std::option::Option::None,
7697            })
7698        }
7699
7700        /// Sets the value of [cloud_storage_buckets][crate::model::intelligence_config::Filter::cloud_storage_buckets]
7701        /// to hold a `ExcludedCloudStorageBuckets`.
7702        ///
7703        /// Note that all the setters affecting `cloud_storage_buckets` are
7704        /// mutually exclusive.
7705        pub fn set_excluded_cloud_storage_buckets<
7706            T: std::convert::Into<
7707                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
7708                >,
7709        >(
7710            mut self,
7711            v: T,
7712        ) -> Self {
7713            self.cloud_storage_buckets = std::option::Option::Some(
7714                crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
7715                    v.into()
7716                )
7717            );
7718            self
7719        }
7720    }
7721
7722    impl wkt::message::Message for Filter {
7723        fn typename() -> &'static str {
7724            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter"
7725        }
7726    }
7727
7728    #[doc(hidden)]
7729    impl<'de> serde::de::Deserialize<'de> for Filter {
7730        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7731        where
7732            D: serde::Deserializer<'de>,
7733        {
7734            #[allow(non_camel_case_types)]
7735            #[doc(hidden)]
7736            #[derive(PartialEq, Eq, Hash)]
7737            enum __FieldTag {
7738                __included_cloud_storage_locations,
7739                __excluded_cloud_storage_locations,
7740                __included_cloud_storage_buckets,
7741                __excluded_cloud_storage_buckets,
7742                Unknown(std::string::String),
7743            }
7744            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7745                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7746                where
7747                    D: serde::Deserializer<'de>,
7748                {
7749                    struct Visitor;
7750                    impl<'de> serde::de::Visitor<'de> for Visitor {
7751                        type Value = __FieldTag;
7752                        fn expecting(
7753                            &self,
7754                            formatter: &mut std::fmt::Formatter,
7755                        ) -> std::fmt::Result {
7756                            formatter.write_str("a field name for Filter")
7757                        }
7758                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
7759                        where
7760                            E: serde::de::Error,
7761                        {
7762                            use std::result::Result::Ok;
7763                            use std::string::ToString;
7764                            match value {
7765                                "includedCloudStorageLocations" => {
7766                                    Ok(__FieldTag::__included_cloud_storage_locations)
7767                                }
7768                                "included_cloud_storage_locations" => {
7769                                    Ok(__FieldTag::__included_cloud_storage_locations)
7770                                }
7771                                "excludedCloudStorageLocations" => {
7772                                    Ok(__FieldTag::__excluded_cloud_storage_locations)
7773                                }
7774                                "excluded_cloud_storage_locations" => {
7775                                    Ok(__FieldTag::__excluded_cloud_storage_locations)
7776                                }
7777                                "includedCloudStorageBuckets" => {
7778                                    Ok(__FieldTag::__included_cloud_storage_buckets)
7779                                }
7780                                "included_cloud_storage_buckets" => {
7781                                    Ok(__FieldTag::__included_cloud_storage_buckets)
7782                                }
7783                                "excludedCloudStorageBuckets" => {
7784                                    Ok(__FieldTag::__excluded_cloud_storage_buckets)
7785                                }
7786                                "excluded_cloud_storage_buckets" => {
7787                                    Ok(__FieldTag::__excluded_cloud_storage_buckets)
7788                                }
7789                                _ => Ok(__FieldTag::Unknown(value.to_string())),
7790                            }
7791                        }
7792                    }
7793                    deserializer.deserialize_identifier(Visitor)
7794                }
7795            }
7796            struct Visitor;
7797            impl<'de> serde::de::Visitor<'de> for Visitor {
7798                type Value = Filter;
7799                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
7800                    formatter.write_str("struct Filter")
7801                }
7802                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
7803                where
7804                    A: serde::de::MapAccess<'de>,
7805                {
7806                    #[allow(unused_imports)]
7807                    use serde::de::Error;
7808                    use std::option::Option::Some;
7809                    let mut fields = std::collections::HashSet::new();
7810                    let mut result = Self::Value::new();
7811                    while let Some(tag) = map.next_key::<__FieldTag>()? {
7812                        #[allow(clippy::match_single_binding)]
7813                        match tag {
7814                            __FieldTag::__included_cloud_storage_locations => {
7815                                if !fields.insert(__FieldTag::__included_cloud_storage_locations) {
7816                                    return std::result::Result::Err(A::Error::duplicate_field(
7817                                        "multiple values for included_cloud_storage_locations",
7818                                    ));
7819                                }
7820                                if result.cloud_storage_locations.is_some() {
7821                                    return std::result::Result::Err(A::Error::duplicate_field(
7822                                        "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",
7823                                    ));
7824                                }
7825                                result.cloud_storage_locations = std::option::Option::Some(
7826                                    crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::IncludedCloudStorageLocations(
7827                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>>>()?.unwrap_or_default()
7828                                    ),
7829                                );
7830                            }
7831                            __FieldTag::__excluded_cloud_storage_locations => {
7832                                if !fields.insert(__FieldTag::__excluded_cloud_storage_locations) {
7833                                    return std::result::Result::Err(A::Error::duplicate_field(
7834                                        "multiple values for excluded_cloud_storage_locations",
7835                                    ));
7836                                }
7837                                if result.cloud_storage_locations.is_some() {
7838                                    return std::result::Result::Err(A::Error::duplicate_field(
7839                                        "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",
7840                                    ));
7841                                }
7842                                result.cloud_storage_locations = std::option::Option::Some(
7843                                    crate::model::intelligence_config::filter::CloudStorageLocationsOneOf::ExcludedCloudStorageLocations(
7844                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>>>()?.unwrap_or_default()
7845                                    ),
7846                                );
7847                            }
7848                            __FieldTag::__included_cloud_storage_buckets => {
7849                                if !fields.insert(__FieldTag::__included_cloud_storage_buckets) {
7850                                    return std::result::Result::Err(A::Error::duplicate_field(
7851                                        "multiple values for included_cloud_storage_buckets",
7852                                    ));
7853                                }
7854                                if result.cloud_storage_buckets.is_some() {
7855                                    return std::result::Result::Err(A::Error::duplicate_field(
7856                                        "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",
7857                                    ));
7858                                }
7859                                result.cloud_storage_buckets = std::option::Option::Some(
7860                                    crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::IncludedCloudStorageBuckets(
7861                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>>>()?.unwrap_or_default()
7862                                    ),
7863                                );
7864                            }
7865                            __FieldTag::__excluded_cloud_storage_buckets => {
7866                                if !fields.insert(__FieldTag::__excluded_cloud_storage_buckets) {
7867                                    return std::result::Result::Err(A::Error::duplicate_field(
7868                                        "multiple values for excluded_cloud_storage_buckets",
7869                                    ));
7870                                }
7871                                if result.cloud_storage_buckets.is_some() {
7872                                    return std::result::Result::Err(A::Error::duplicate_field(
7873                                        "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",
7874                                    ));
7875                                }
7876                                result.cloud_storage_buckets = std::option::Option::Some(
7877                                    crate::model::intelligence_config::filter::CloudStorageBucketsOneOf::ExcludedCloudStorageBuckets(
7878                                        map.next_value::<std::option::Option<std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>>>()?.unwrap_or_default()
7879                                    ),
7880                                );
7881                            }
7882                            __FieldTag::Unknown(key) => {
7883                                let value = map.next_value::<serde_json::Value>()?;
7884                                result._unknown_fields.insert(key, value);
7885                            }
7886                        }
7887                    }
7888                    std::result::Result::Ok(result)
7889                }
7890            }
7891            deserializer.deserialize_any(Visitor)
7892        }
7893    }
7894
7895    #[doc(hidden)]
7896    impl serde::ser::Serialize for Filter {
7897        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
7898        where
7899            S: serde::ser::Serializer,
7900        {
7901            use serde::ser::SerializeMap;
7902            #[allow(unused_imports)]
7903            use std::option::Option::Some;
7904            let mut state = serializer.serialize_map(std::option::Option::None)?;
7905            if let Some(value) = self.included_cloud_storage_locations() {
7906                state.serialize_entry("includedCloudStorageLocations", value)?;
7907            }
7908            if let Some(value) = self.excluded_cloud_storage_locations() {
7909                state.serialize_entry("excludedCloudStorageLocations", value)?;
7910            }
7911            if let Some(value) = self.included_cloud_storage_buckets() {
7912                state.serialize_entry("includedCloudStorageBuckets", value)?;
7913            }
7914            if let Some(value) = self.excluded_cloud_storage_buckets() {
7915                state.serialize_entry("excludedCloudStorageBuckets", value)?;
7916            }
7917            if !self._unknown_fields.is_empty() {
7918                for (key, value) in self._unknown_fields.iter() {
7919                    state.serialize_entry(key, &value)?;
7920                }
7921            }
7922            state.end()
7923        }
7924    }
7925
7926    /// Defines additional types related to [Filter].
7927    pub mod filter {
7928        #[allow(unused_imports)]
7929        use super::*;
7930
7931        /// Collection of bucket locations.
7932        #[derive(Clone, Debug, Default, PartialEq)]
7933        #[non_exhaustive]
7934        pub struct CloudStorageLocations {
7935            /// Optional. Bucket locations. Location can be any of the Cloud Storage
7936            /// regions specified in lower case format. For example, `us-east1`,
7937            /// `us-west1`.
7938            pub locations: std::vec::Vec<std::string::String>,
7939
7940            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
7941        }
7942
7943        impl CloudStorageLocations {
7944            pub fn new() -> Self {
7945                std::default::Default::default()
7946            }
7947
7948            /// Sets the value of [locations][crate::model::intelligence_config::filter::CloudStorageLocations::locations].
7949            pub fn set_locations<T, V>(mut self, v: T) -> Self
7950            where
7951                T: std::iter::IntoIterator<Item = V>,
7952                V: std::convert::Into<std::string::String>,
7953            {
7954                use std::iter::Iterator;
7955                self.locations = v.into_iter().map(|i| i.into()).collect();
7956                self
7957            }
7958        }
7959
7960        impl wkt::message::Message for CloudStorageLocations {
7961            fn typename() -> &'static str {
7962                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageLocations"
7963            }
7964        }
7965
7966        #[doc(hidden)]
7967        impl<'de> serde::de::Deserialize<'de> for CloudStorageLocations {
7968            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7969            where
7970                D: serde::Deserializer<'de>,
7971            {
7972                #[allow(non_camel_case_types)]
7973                #[doc(hidden)]
7974                #[derive(PartialEq, Eq, Hash)]
7975                enum __FieldTag {
7976                    __locations,
7977                    Unknown(std::string::String),
7978                }
7979                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
7980                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
7981                    where
7982                        D: serde::Deserializer<'de>,
7983                    {
7984                        struct Visitor;
7985                        impl<'de> serde::de::Visitor<'de> for Visitor {
7986                            type Value = __FieldTag;
7987                            fn expecting(
7988                                &self,
7989                                formatter: &mut std::fmt::Formatter,
7990                            ) -> std::fmt::Result {
7991                                formatter.write_str("a field name for CloudStorageLocations")
7992                            }
7993                            fn visit_str<E>(
7994                                self,
7995                                value: &str,
7996                            ) -> std::result::Result<Self::Value, E>
7997                            where
7998                                E: serde::de::Error,
7999                            {
8000                                use std::result::Result::Ok;
8001                                use std::string::ToString;
8002                                match value {
8003                                    "locations" => Ok(__FieldTag::__locations),
8004                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
8005                                }
8006                            }
8007                        }
8008                        deserializer.deserialize_identifier(Visitor)
8009                    }
8010                }
8011                struct Visitor;
8012                impl<'de> serde::de::Visitor<'de> for Visitor {
8013                    type Value = CloudStorageLocations;
8014                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8015                        formatter.write_str("struct CloudStorageLocations")
8016                    }
8017                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8018                    where
8019                        A: serde::de::MapAccess<'de>,
8020                    {
8021                        #[allow(unused_imports)]
8022                        use serde::de::Error;
8023                        use std::option::Option::Some;
8024                        let mut fields = std::collections::HashSet::new();
8025                        let mut result = Self::Value::new();
8026                        while let Some(tag) = map.next_key::<__FieldTag>()? {
8027                            #[allow(clippy::match_single_binding)]
8028                            match tag {
8029                                __FieldTag::__locations => {
8030                                    if !fields.insert(__FieldTag::__locations) {
8031                                        return std::result::Result::Err(
8032                                            A::Error::duplicate_field(
8033                                                "multiple values for locations",
8034                                            ),
8035                                        );
8036                                    }
8037                                    result.locations = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8038                                }
8039                                __FieldTag::Unknown(key) => {
8040                                    let value = map.next_value::<serde_json::Value>()?;
8041                                    result._unknown_fields.insert(key, value);
8042                                }
8043                            }
8044                        }
8045                        std::result::Result::Ok(result)
8046                    }
8047                }
8048                deserializer.deserialize_any(Visitor)
8049            }
8050        }
8051
8052        #[doc(hidden)]
8053        impl serde::ser::Serialize for CloudStorageLocations {
8054            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8055            where
8056                S: serde::ser::Serializer,
8057            {
8058                use serde::ser::SerializeMap;
8059                #[allow(unused_imports)]
8060                use std::option::Option::Some;
8061                let mut state = serializer.serialize_map(std::option::Option::None)?;
8062                if !self.locations.is_empty() {
8063                    state.serialize_entry("locations", &self.locations)?;
8064                }
8065                if !self._unknown_fields.is_empty() {
8066                    for (key, value) in self._unknown_fields.iter() {
8067                        state.serialize_entry(key, &value)?;
8068                    }
8069                }
8070                state.end()
8071            }
8072        }
8073
8074        /// Collection of buckets.
8075        #[derive(Clone, Debug, Default, PartialEq)]
8076        #[non_exhaustive]
8077        pub struct CloudStorageBuckets {
8078            /// Optional. A regex pattern for matching bucket names. Regex should
8079            /// follow the syntax specified in
8080            /// [google/re2](https://github.com/google/re2). For example,
8081            /// `^sample_.*` matches all buckets of the form
8082            /// `gs://sample_bucket-1`, `gs://sample_bucket-2`,
8083            /// `gs://sample_bucket-n` but not `gs://test_sample_bucket`.
8084            /// If you want to match a single bucket, say `gs://sample_bucket`,
8085            /// use `sample_bucket`.
8086            pub bucket_id_regexes: std::vec::Vec<std::string::String>,
8087
8088            _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8089        }
8090
8091        impl CloudStorageBuckets {
8092            pub fn new() -> Self {
8093                std::default::Default::default()
8094            }
8095
8096            /// Sets the value of [bucket_id_regexes][crate::model::intelligence_config::filter::CloudStorageBuckets::bucket_id_regexes].
8097            pub fn set_bucket_id_regexes<T, V>(mut self, v: T) -> Self
8098            where
8099                T: std::iter::IntoIterator<Item = V>,
8100                V: std::convert::Into<std::string::String>,
8101            {
8102                use std::iter::Iterator;
8103                self.bucket_id_regexes = v.into_iter().map(|i| i.into()).collect();
8104                self
8105            }
8106        }
8107
8108        impl wkt::message::Message for CloudStorageBuckets {
8109            fn typename() -> &'static str {
8110                "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.Filter.CloudStorageBuckets"
8111            }
8112        }
8113
8114        #[doc(hidden)]
8115        impl<'de> serde::de::Deserialize<'de> for CloudStorageBuckets {
8116            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8117            where
8118                D: serde::Deserializer<'de>,
8119            {
8120                #[allow(non_camel_case_types)]
8121                #[doc(hidden)]
8122                #[derive(PartialEq, Eq, Hash)]
8123                enum __FieldTag {
8124                    __bucket_id_regexes,
8125                    Unknown(std::string::String),
8126                }
8127                impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8128                    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8129                    where
8130                        D: serde::Deserializer<'de>,
8131                    {
8132                        struct Visitor;
8133                        impl<'de> serde::de::Visitor<'de> for Visitor {
8134                            type Value = __FieldTag;
8135                            fn expecting(
8136                                &self,
8137                                formatter: &mut std::fmt::Formatter,
8138                            ) -> std::fmt::Result {
8139                                formatter.write_str("a field name for CloudStorageBuckets")
8140                            }
8141                            fn visit_str<E>(
8142                                self,
8143                                value: &str,
8144                            ) -> std::result::Result<Self::Value, E>
8145                            where
8146                                E: serde::de::Error,
8147                            {
8148                                use std::result::Result::Ok;
8149                                use std::string::ToString;
8150                                match value {
8151                                    "bucketIdRegexes" => Ok(__FieldTag::__bucket_id_regexes),
8152                                    "bucket_id_regexes" => Ok(__FieldTag::__bucket_id_regexes),
8153                                    _ => Ok(__FieldTag::Unknown(value.to_string())),
8154                                }
8155                            }
8156                        }
8157                        deserializer.deserialize_identifier(Visitor)
8158                    }
8159                }
8160                struct Visitor;
8161                impl<'de> serde::de::Visitor<'de> for Visitor {
8162                    type Value = CloudStorageBuckets;
8163                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8164                        formatter.write_str("struct CloudStorageBuckets")
8165                    }
8166                    fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8167                    where
8168                        A: serde::de::MapAccess<'de>,
8169                    {
8170                        #[allow(unused_imports)]
8171                        use serde::de::Error;
8172                        use std::option::Option::Some;
8173                        let mut fields = std::collections::HashSet::new();
8174                        let mut result = Self::Value::new();
8175                        while let Some(tag) = map.next_key::<__FieldTag>()? {
8176                            #[allow(clippy::match_single_binding)]
8177                            match tag {
8178                                __FieldTag::__bucket_id_regexes => {
8179                                    if !fields.insert(__FieldTag::__bucket_id_regexes) {
8180                                        return std::result::Result::Err(
8181                                            A::Error::duplicate_field(
8182                                                "multiple values for bucket_id_regexes",
8183                                            ),
8184                                        );
8185                                    }
8186                                    result.bucket_id_regexes = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
8187                                }
8188                                __FieldTag::Unknown(key) => {
8189                                    let value = map.next_value::<serde_json::Value>()?;
8190                                    result._unknown_fields.insert(key, value);
8191                                }
8192                            }
8193                        }
8194                        std::result::Result::Ok(result)
8195                    }
8196                }
8197                deserializer.deserialize_any(Visitor)
8198            }
8199        }
8200
8201        #[doc(hidden)]
8202        impl serde::ser::Serialize for CloudStorageBuckets {
8203            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8204            where
8205                S: serde::ser::Serializer,
8206            {
8207                use serde::ser::SerializeMap;
8208                #[allow(unused_imports)]
8209                use std::option::Option::Some;
8210                let mut state = serializer.serialize_map(std::option::Option::None)?;
8211                if !self.bucket_id_regexes.is_empty() {
8212                    state.serialize_entry("bucketIdRegexes", &self.bucket_id_regexes)?;
8213                }
8214                if !self._unknown_fields.is_empty() {
8215                    for (key, value) in self._unknown_fields.iter() {
8216                        state.serialize_entry(key, &value)?;
8217                    }
8218                }
8219                state.end()
8220            }
8221        }
8222
8223        /// Bucket locations to include or exclude.
8224        #[derive(Clone, Debug, PartialEq)]
8225        #[non_exhaustive]
8226        pub enum CloudStorageLocationsOneOf {
8227            /// Bucket locations to include.
8228            IncludedCloudStorageLocations(
8229                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
8230            ),
8231            /// Bucket locations to exclude.
8232            ExcludedCloudStorageLocations(
8233                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageLocations>,
8234            ),
8235        }
8236
8237        impl CloudStorageLocationsOneOf {
8238            /// Initializes the enum to the [IncludedCloudStorageLocations](Self::IncludedCloudStorageLocations) branch.
8239            pub fn from_included_cloud_storage_locations(
8240                value: impl std::convert::Into<
8241                    std::boxed::Box<
8242                        crate::model::intelligence_config::filter::CloudStorageLocations,
8243                    >,
8244                >,
8245            ) -> Self {
8246                Self::IncludedCloudStorageLocations(value.into())
8247            }
8248            /// Initializes the enum to the [ExcludedCloudStorageLocations](Self::ExcludedCloudStorageLocations) branch.
8249            pub fn from_excluded_cloud_storage_locations(
8250                value: impl std::convert::Into<
8251                    std::boxed::Box<
8252                        crate::model::intelligence_config::filter::CloudStorageLocations,
8253                    >,
8254                >,
8255            ) -> Self {
8256                Self::ExcludedCloudStorageLocations(value.into())
8257            }
8258        }
8259
8260        /// Buckets to include or exclude.
8261        #[derive(Clone, Debug, PartialEq)]
8262        #[non_exhaustive]
8263        pub enum CloudStorageBucketsOneOf {
8264            /// Buckets to include.
8265            IncludedCloudStorageBuckets(
8266                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8267            ),
8268            /// Buckets to exclude.
8269            ExcludedCloudStorageBuckets(
8270                std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8271            ),
8272        }
8273
8274        impl CloudStorageBucketsOneOf {
8275            /// Initializes the enum to the [IncludedCloudStorageBuckets](Self::IncludedCloudStorageBuckets) branch.
8276            pub fn from_included_cloud_storage_buckets(
8277                value: impl std::convert::Into<
8278                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8279                >,
8280            ) -> Self {
8281                Self::IncludedCloudStorageBuckets(value.into())
8282            }
8283            /// Initializes the enum to the [ExcludedCloudStorageBuckets](Self::ExcludedCloudStorageBuckets) branch.
8284            pub fn from_excluded_cloud_storage_buckets(
8285                value: impl std::convert::Into<
8286                    std::boxed::Box<crate::model::intelligence_config::filter::CloudStorageBuckets>,
8287                >,
8288            ) -> Self {
8289                Self::ExcludedCloudStorageBuckets(value.into())
8290            }
8291        }
8292    }
8293
8294    /// The effective `IntelligenceConfig` for the resource.
8295    #[derive(Clone, Debug, Default, PartialEq)]
8296    #[non_exhaustive]
8297    pub struct EffectiveIntelligenceConfig {
8298        /// Output only. The `IntelligenceConfig` edition that is applicable for the
8299        /// resource.
8300        pub effective_edition:
8301            crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition,
8302
8303        /// Output only. The `IntelligenceConfig` resource that is applied for the
8304        /// target resource. Format:
8305        /// `{organizations|folders|projects}/{id}/locations/{location}/intelligenceConfig`
8306        pub intelligence_config: std::string::String,
8307
8308        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8309    }
8310
8311    impl EffectiveIntelligenceConfig {
8312        pub fn new() -> Self {
8313            std::default::Default::default()
8314        }
8315
8316        /// Sets the value of [effective_edition][crate::model::intelligence_config::EffectiveIntelligenceConfig::effective_edition].
8317        pub fn set_effective_edition<T: std::convert::Into<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>(mut self, v: T) -> Self{
8318            self.effective_edition = v.into();
8319            self
8320        }
8321
8322        /// Sets the value of [intelligence_config][crate::model::intelligence_config::EffectiveIntelligenceConfig::intelligence_config].
8323        pub fn set_intelligence_config<T: std::convert::Into<std::string::String>>(
8324            mut self,
8325            v: T,
8326        ) -> Self {
8327            self.intelligence_config = v.into();
8328            self
8329        }
8330    }
8331
8332    impl wkt::message::Message for EffectiveIntelligenceConfig {
8333        fn typename() -> &'static str {
8334            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig"
8335        }
8336    }
8337
8338    #[doc(hidden)]
8339    impl<'de> serde::de::Deserialize<'de> for EffectiveIntelligenceConfig {
8340        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8341        where
8342            D: serde::Deserializer<'de>,
8343        {
8344            #[allow(non_camel_case_types)]
8345            #[doc(hidden)]
8346            #[derive(PartialEq, Eq, Hash)]
8347            enum __FieldTag {
8348                __effective_edition,
8349                __intelligence_config,
8350                Unknown(std::string::String),
8351            }
8352            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8353                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8354                where
8355                    D: serde::Deserializer<'de>,
8356                {
8357                    struct Visitor;
8358                    impl<'de> serde::de::Visitor<'de> for Visitor {
8359                        type Value = __FieldTag;
8360                        fn expecting(
8361                            &self,
8362                            formatter: &mut std::fmt::Formatter,
8363                        ) -> std::fmt::Result {
8364                            formatter.write_str("a field name for EffectiveIntelligenceConfig")
8365                        }
8366                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8367                        where
8368                            E: serde::de::Error,
8369                        {
8370                            use std::result::Result::Ok;
8371                            use std::string::ToString;
8372                            match value {
8373                                "effectiveEdition" => Ok(__FieldTag::__effective_edition),
8374                                "effective_edition" => Ok(__FieldTag::__effective_edition),
8375                                "intelligenceConfig" => Ok(__FieldTag::__intelligence_config),
8376                                "intelligence_config" => Ok(__FieldTag::__intelligence_config),
8377                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8378                            }
8379                        }
8380                    }
8381                    deserializer.deserialize_identifier(Visitor)
8382                }
8383            }
8384            struct Visitor;
8385            impl<'de> serde::de::Visitor<'de> for Visitor {
8386                type Value = EffectiveIntelligenceConfig;
8387                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8388                    formatter.write_str("struct EffectiveIntelligenceConfig")
8389                }
8390                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8391                where
8392                    A: serde::de::MapAccess<'de>,
8393                {
8394                    #[allow(unused_imports)]
8395                    use serde::de::Error;
8396                    use std::option::Option::Some;
8397                    let mut fields = std::collections::HashSet::new();
8398                    let mut result = Self::Value::new();
8399                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8400                        #[allow(clippy::match_single_binding)]
8401                        match tag {
8402                            __FieldTag::__effective_edition => {
8403                                if !fields.insert(__FieldTag::__effective_edition) {
8404                                    return std::result::Result::Err(A::Error::duplicate_field(
8405                                        "multiple values for effective_edition",
8406                                    ));
8407                                }
8408                                result.effective_edition = map.next_value::<std::option::Option<crate::model::intelligence_config::effective_intelligence_config::EffectiveEdition>>()?.unwrap_or_default();
8409                            }
8410                            __FieldTag::__intelligence_config => {
8411                                if !fields.insert(__FieldTag::__intelligence_config) {
8412                                    return std::result::Result::Err(A::Error::duplicate_field(
8413                                        "multiple values for intelligence_config",
8414                                    ));
8415                                }
8416                                result.intelligence_config = map
8417                                    .next_value::<std::option::Option<std::string::String>>()?
8418                                    .unwrap_or_default();
8419                            }
8420                            __FieldTag::Unknown(key) => {
8421                                let value = map.next_value::<serde_json::Value>()?;
8422                                result._unknown_fields.insert(key, value);
8423                            }
8424                        }
8425                    }
8426                    std::result::Result::Ok(result)
8427                }
8428            }
8429            deserializer.deserialize_any(Visitor)
8430        }
8431    }
8432
8433    #[doc(hidden)]
8434    impl serde::ser::Serialize for EffectiveIntelligenceConfig {
8435        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8436        where
8437            S: serde::ser::Serializer,
8438        {
8439            use serde::ser::SerializeMap;
8440            #[allow(unused_imports)]
8441            use std::option::Option::Some;
8442            let mut state = serializer.serialize_map(std::option::Option::None)?;
8443            if !wkt::internal::is_default(&self.effective_edition) {
8444                state.serialize_entry("effectiveEdition", &self.effective_edition)?;
8445            }
8446            if !self.intelligence_config.is_empty() {
8447                state.serialize_entry("intelligenceConfig", &self.intelligence_config)?;
8448            }
8449            if !self._unknown_fields.is_empty() {
8450                for (key, value) in self._unknown_fields.iter() {
8451                    state.serialize_entry(key, &value)?;
8452                }
8453            }
8454            state.end()
8455        }
8456    }
8457
8458    /// Defines additional types related to [EffectiveIntelligenceConfig].
8459    pub mod effective_intelligence_config {
8460        #[allow(unused_imports)]
8461        use super::*;
8462
8463        /// The effective edition of the `IntelligenceConfig` resource.
8464        ///
8465        /// # Working with unknown values
8466        ///
8467        /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8468        /// additional enum variants at any time. Adding new variants is not considered
8469        /// a breaking change. Applications should write their code in anticipation of:
8470        ///
8471        /// - New values appearing in future releases of the client library, **and**
8472        /// - New values received dynamically, without application changes.
8473        ///
8474        /// Please consult the [Working with enums] section in the user guide for some
8475        /// guidelines.
8476        ///
8477        /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8478        #[derive(Clone, Debug, PartialEq)]
8479        #[non_exhaustive]
8480        pub enum EffectiveEdition {
8481            /// This is an unknown edition of the resource.
8482            Unspecified,
8483            /// No edition.
8484            None,
8485            /// The `IntelligenceConfig` resource is of STANDARD edition.
8486            Standard,
8487            /// If set, the enum was initialized with an unknown value.
8488            ///
8489            /// Applications can examine the value using [EffectiveEdition::value] or
8490            /// [EffectiveEdition::name].
8491            UnknownValue(effective_edition::UnknownValue),
8492        }
8493
8494        #[doc(hidden)]
8495        pub mod effective_edition {
8496            #[allow(unused_imports)]
8497            use super::*;
8498            #[derive(Clone, Debug, PartialEq)]
8499            pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8500        }
8501
8502        impl EffectiveEdition {
8503            /// Gets the enum value.
8504            ///
8505            /// Returns `None` if the enum contains an unknown value deserialized from
8506            /// the string representation of enums.
8507            pub fn value(&self) -> std::option::Option<i32> {
8508                match self {
8509                    Self::Unspecified => std::option::Option::Some(0),
8510                    Self::None => std::option::Option::Some(1),
8511                    Self::Standard => std::option::Option::Some(2),
8512                    Self::UnknownValue(u) => u.0.value(),
8513                }
8514            }
8515
8516            /// Gets the enum value as a string.
8517            ///
8518            /// Returns `None` if the enum contains an unknown value deserialized from
8519            /// the integer representation of enums.
8520            pub fn name(&self) -> std::option::Option<&str> {
8521                match self {
8522                    Self::Unspecified => std::option::Option::Some("EFFECTIVE_EDITION_UNSPECIFIED"),
8523                    Self::None => std::option::Option::Some("NONE"),
8524                    Self::Standard => std::option::Option::Some("STANDARD"),
8525                    Self::UnknownValue(u) => u.0.name(),
8526                }
8527            }
8528        }
8529
8530        impl std::default::Default for EffectiveEdition {
8531            fn default() -> Self {
8532                use std::convert::From;
8533                Self::from(0)
8534            }
8535        }
8536
8537        impl std::fmt::Display for EffectiveEdition {
8538            fn fmt(
8539                &self,
8540                f: &mut std::fmt::Formatter<'_>,
8541            ) -> std::result::Result<(), std::fmt::Error> {
8542                wkt::internal::display_enum(f, self.name(), self.value())
8543            }
8544        }
8545
8546        impl std::convert::From<i32> for EffectiveEdition {
8547            fn from(value: i32) -> Self {
8548                match value {
8549                    0 => Self::Unspecified,
8550                    1 => Self::None,
8551                    2 => Self::Standard,
8552                    _ => Self::UnknownValue(effective_edition::UnknownValue(
8553                        wkt::internal::UnknownEnumValue::Integer(value),
8554                    )),
8555                }
8556            }
8557        }
8558
8559        impl std::convert::From<&str> for EffectiveEdition {
8560            fn from(value: &str) -> Self {
8561                use std::string::ToString;
8562                match value {
8563                    "EFFECTIVE_EDITION_UNSPECIFIED" => Self::Unspecified,
8564                    "NONE" => Self::None,
8565                    "STANDARD" => Self::Standard,
8566                    _ => Self::UnknownValue(effective_edition::UnknownValue(
8567                        wkt::internal::UnknownEnumValue::String(value.to_string()),
8568                    )),
8569                }
8570            }
8571        }
8572
8573        impl serde::ser::Serialize for EffectiveEdition {
8574            fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8575            where
8576                S: serde::Serializer,
8577            {
8578                match self {
8579                    Self::Unspecified => serializer.serialize_i32(0),
8580                    Self::None => serializer.serialize_i32(1),
8581                    Self::Standard => serializer.serialize_i32(2),
8582                    Self::UnknownValue(u) => u.0.serialize(serializer),
8583                }
8584            }
8585        }
8586
8587        impl<'de> serde::de::Deserialize<'de> for EffectiveEdition {
8588            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8589            where
8590                D: serde::Deserializer<'de>,
8591            {
8592                deserializer.deserialize_any(wkt::internal::EnumVisitor::<EffectiveEdition>::new(
8593                    ".google.storage.control.v2.IntelligenceConfig.EffectiveIntelligenceConfig.EffectiveEdition"))
8594            }
8595        }
8596    }
8597
8598    /// The trial configuration of the `IntelligenceConfig` resource.
8599    #[derive(Clone, Debug, Default, PartialEq)]
8600    #[non_exhaustive]
8601    pub struct TrialConfig {
8602        /// Output only. The time at which the trial expires.
8603        pub expire_time: std::option::Option<wkt::Timestamp>,
8604
8605        _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8606    }
8607
8608    impl TrialConfig {
8609        pub fn new() -> Self {
8610            std::default::Default::default()
8611        }
8612
8613        /// Sets the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
8614        pub fn set_expire_time<T>(mut self, v: T) -> Self
8615        where
8616            T: std::convert::Into<wkt::Timestamp>,
8617        {
8618            self.expire_time = std::option::Option::Some(v.into());
8619            self
8620        }
8621
8622        /// Sets or clears the value of [expire_time][crate::model::intelligence_config::TrialConfig::expire_time].
8623        pub fn set_or_clear_expire_time<T>(mut self, v: std::option::Option<T>) -> Self
8624        where
8625            T: std::convert::Into<wkt::Timestamp>,
8626        {
8627            self.expire_time = v.map(|x| x.into());
8628            self
8629        }
8630    }
8631
8632    impl wkt::message::Message for TrialConfig {
8633        fn typename() -> &'static str {
8634            "type.googleapis.com/google.storage.control.v2.IntelligenceConfig.TrialConfig"
8635        }
8636    }
8637
8638    #[doc(hidden)]
8639    impl<'de> serde::de::Deserialize<'de> for TrialConfig {
8640        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8641        where
8642            D: serde::Deserializer<'de>,
8643        {
8644            #[allow(non_camel_case_types)]
8645            #[doc(hidden)]
8646            #[derive(PartialEq, Eq, Hash)]
8647            enum __FieldTag {
8648                __expire_time,
8649                Unknown(std::string::String),
8650            }
8651            impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8652                fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8653                where
8654                    D: serde::Deserializer<'de>,
8655                {
8656                    struct Visitor;
8657                    impl<'de> serde::de::Visitor<'de> for Visitor {
8658                        type Value = __FieldTag;
8659                        fn expecting(
8660                            &self,
8661                            formatter: &mut std::fmt::Formatter,
8662                        ) -> std::fmt::Result {
8663                            formatter.write_str("a field name for TrialConfig")
8664                        }
8665                        fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
8666                        where
8667                            E: serde::de::Error,
8668                        {
8669                            use std::result::Result::Ok;
8670                            use std::string::ToString;
8671                            match value {
8672                                "expireTime" => Ok(__FieldTag::__expire_time),
8673                                "expire_time" => Ok(__FieldTag::__expire_time),
8674                                _ => Ok(__FieldTag::Unknown(value.to_string())),
8675                            }
8676                        }
8677                    }
8678                    deserializer.deserialize_identifier(Visitor)
8679                }
8680            }
8681            struct Visitor;
8682            impl<'de> serde::de::Visitor<'de> for Visitor {
8683                type Value = TrialConfig;
8684                fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
8685                    formatter.write_str("struct TrialConfig")
8686                }
8687                fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
8688                where
8689                    A: serde::de::MapAccess<'de>,
8690                {
8691                    #[allow(unused_imports)]
8692                    use serde::de::Error;
8693                    use std::option::Option::Some;
8694                    let mut fields = std::collections::HashSet::new();
8695                    let mut result = Self::Value::new();
8696                    while let Some(tag) = map.next_key::<__FieldTag>()? {
8697                        #[allow(clippy::match_single_binding)]
8698                        match tag {
8699                            __FieldTag::__expire_time => {
8700                                if !fields.insert(__FieldTag::__expire_time) {
8701                                    return std::result::Result::Err(A::Error::duplicate_field(
8702                                        "multiple values for expire_time",
8703                                    ));
8704                                }
8705                                result.expire_time =
8706                                    map.next_value::<std::option::Option<wkt::Timestamp>>()?;
8707                            }
8708                            __FieldTag::Unknown(key) => {
8709                                let value = map.next_value::<serde_json::Value>()?;
8710                                result._unknown_fields.insert(key, value);
8711                            }
8712                        }
8713                    }
8714                    std::result::Result::Ok(result)
8715                }
8716            }
8717            deserializer.deserialize_any(Visitor)
8718        }
8719    }
8720
8721    #[doc(hidden)]
8722    impl serde::ser::Serialize for TrialConfig {
8723        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8724        where
8725            S: serde::ser::Serializer,
8726        {
8727            use serde::ser::SerializeMap;
8728            #[allow(unused_imports)]
8729            use std::option::Option::Some;
8730            let mut state = serializer.serialize_map(std::option::Option::None)?;
8731            if self.expire_time.is_some() {
8732                state.serialize_entry("expireTime", &self.expire_time)?;
8733            }
8734            if !self._unknown_fields.is_empty() {
8735                for (key, value) in self._unknown_fields.iter() {
8736                    state.serialize_entry(key, &value)?;
8737                }
8738            }
8739            state.end()
8740        }
8741    }
8742
8743    /// The edition configuration of the `IntelligenceConfig` resource. This
8744    /// signifies the edition used for configuring the `IntelligenceConfig`
8745    /// resource and can only take the following values:
8746    /// `EDITION_CONFIG_UNSPECIFIED`, `INHERIT`, `DISABLED`, `STANDARD` and
8747    /// `TRIAL`.
8748    ///
8749    /// # Working with unknown values
8750    ///
8751    /// This enum is defined as `#[non_exhaustive]` because Google Cloud may add
8752    /// additional enum variants at any time. Adding new variants is not considered
8753    /// a breaking change. Applications should write their code in anticipation of:
8754    ///
8755    /// - New values appearing in future releases of the client library, **and**
8756    /// - New values received dynamically, without application changes.
8757    ///
8758    /// Please consult the [Working with enums] section in the user guide for some
8759    /// guidelines.
8760    ///
8761    /// [Working with enums]: https://google-cloud-rust.github.io/working_with_enums.html
8762    #[derive(Clone, Debug, PartialEq)]
8763    #[non_exhaustive]
8764    pub enum EditionConfig {
8765        /// This is an unknown edition of the resource.
8766        Unspecified,
8767        /// The inherited edition from the parent and filters. This is the default
8768        /// edition when there is no `IntelligenceConfig` setup for a GCP resource.
8769        Inherit,
8770        /// The edition configuration is disabled for the `IntelligenceConfig`
8771        /// resource and its children. Filters are not applicable.
8772        Disabled,
8773        /// The `IntelligenceConfig` resource is of STANDARD edition.
8774        Standard,
8775        /// The `IntelligenceConfig` resource is available in `TRIAL` edition. During
8776        /// the trial period, Cloud Storage does not charge for Storage Intelligence
8777        /// usage. You can specify the buckets to include in the trial period by
8778        /// using filters. At the end of the trial period, the `IntelligenceConfig`
8779        /// resource is upgraded to `STANDARD` edition.
8780        Trial,
8781        /// If set, the enum was initialized with an unknown value.
8782        ///
8783        /// Applications can examine the value using [EditionConfig::value] or
8784        /// [EditionConfig::name].
8785        UnknownValue(edition_config::UnknownValue),
8786    }
8787
8788    #[doc(hidden)]
8789    pub mod edition_config {
8790        #[allow(unused_imports)]
8791        use super::*;
8792        #[derive(Clone, Debug, PartialEq)]
8793        pub struct UnknownValue(pub(crate) wkt::internal::UnknownEnumValue);
8794    }
8795
8796    impl EditionConfig {
8797        /// Gets the enum value.
8798        ///
8799        /// Returns `None` if the enum contains an unknown value deserialized from
8800        /// the string representation of enums.
8801        pub fn value(&self) -> std::option::Option<i32> {
8802            match self {
8803                Self::Unspecified => std::option::Option::Some(0),
8804                Self::Inherit => std::option::Option::Some(1),
8805                Self::Disabled => std::option::Option::Some(2),
8806                Self::Standard => std::option::Option::Some(3),
8807                Self::Trial => std::option::Option::Some(5),
8808                Self::UnknownValue(u) => u.0.value(),
8809            }
8810        }
8811
8812        /// Gets the enum value as a string.
8813        ///
8814        /// Returns `None` if the enum contains an unknown value deserialized from
8815        /// the integer representation of enums.
8816        pub fn name(&self) -> std::option::Option<&str> {
8817            match self {
8818                Self::Unspecified => std::option::Option::Some("EDITION_CONFIG_UNSPECIFIED"),
8819                Self::Inherit => std::option::Option::Some("INHERIT"),
8820                Self::Disabled => std::option::Option::Some("DISABLED"),
8821                Self::Standard => std::option::Option::Some("STANDARD"),
8822                Self::Trial => std::option::Option::Some("TRIAL"),
8823                Self::UnknownValue(u) => u.0.name(),
8824            }
8825        }
8826    }
8827
8828    impl std::default::Default for EditionConfig {
8829        fn default() -> Self {
8830            use std::convert::From;
8831            Self::from(0)
8832        }
8833    }
8834
8835    impl std::fmt::Display for EditionConfig {
8836        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::result::Result<(), std::fmt::Error> {
8837            wkt::internal::display_enum(f, self.name(), self.value())
8838        }
8839    }
8840
8841    impl std::convert::From<i32> for EditionConfig {
8842        fn from(value: i32) -> Self {
8843            match value {
8844                0 => Self::Unspecified,
8845                1 => Self::Inherit,
8846                2 => Self::Disabled,
8847                3 => Self::Standard,
8848                5 => Self::Trial,
8849                _ => Self::UnknownValue(edition_config::UnknownValue(
8850                    wkt::internal::UnknownEnumValue::Integer(value),
8851                )),
8852            }
8853        }
8854    }
8855
8856    impl std::convert::From<&str> for EditionConfig {
8857        fn from(value: &str) -> Self {
8858            use std::string::ToString;
8859            match value {
8860                "EDITION_CONFIG_UNSPECIFIED" => Self::Unspecified,
8861                "INHERIT" => Self::Inherit,
8862                "DISABLED" => Self::Disabled,
8863                "STANDARD" => Self::Standard,
8864                "TRIAL" => Self::Trial,
8865                _ => Self::UnknownValue(edition_config::UnknownValue(
8866                    wkt::internal::UnknownEnumValue::String(value.to_string()),
8867                )),
8868            }
8869        }
8870    }
8871
8872    impl serde::ser::Serialize for EditionConfig {
8873        fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
8874        where
8875            S: serde::Serializer,
8876        {
8877            match self {
8878                Self::Unspecified => serializer.serialize_i32(0),
8879                Self::Inherit => serializer.serialize_i32(1),
8880                Self::Disabled => serializer.serialize_i32(2),
8881                Self::Standard => serializer.serialize_i32(3),
8882                Self::Trial => serializer.serialize_i32(5),
8883                Self::UnknownValue(u) => u.0.serialize(serializer),
8884            }
8885        }
8886    }
8887
8888    impl<'de> serde::de::Deserialize<'de> for EditionConfig {
8889        fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8890        where
8891            D: serde::Deserializer<'de>,
8892        {
8893            deserializer.deserialize_any(wkt::internal::EnumVisitor::<EditionConfig>::new(
8894                ".google.storage.control.v2.IntelligenceConfig.EditionConfig",
8895            ))
8896        }
8897    }
8898}
8899
8900/// Request message to update the `IntelligenceConfig` resource associated with
8901/// your organization.
8902///
8903/// **IAM Permissions**:
8904///
8905/// Requires `storage.intelligenceConfigs.update`
8906/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
8907/// the organization.
8908#[derive(Clone, Debug, Default, PartialEq)]
8909#[non_exhaustive]
8910pub struct UpdateOrganizationIntelligenceConfigRequest {
8911    /// Required. The `IntelligenceConfig` resource to be updated.
8912    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
8913
8914    /// Required. The `update_mask` that specifies the fields within the
8915    /// `IntelligenceConfig` resource that should be modified by this update. Only
8916    /// the listed fields are updated.
8917    pub update_mask: std::option::Option<wkt::FieldMask>,
8918
8919    /// Optional. The ID that uniquely identifies the request, preventing duplicate
8920    /// processing.
8921    pub request_id: std::string::String,
8922
8923    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
8924}
8925
8926impl UpdateOrganizationIntelligenceConfigRequest {
8927    pub fn new() -> Self {
8928        std::default::Default::default()
8929    }
8930
8931    /// Sets the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
8932    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
8933    where
8934        T: std::convert::Into<crate::model::IntelligenceConfig>,
8935    {
8936        self.intelligence_config = std::option::Option::Some(v.into());
8937        self
8938    }
8939
8940    /// Sets or clears the value of [intelligence_config][crate::model::UpdateOrganizationIntelligenceConfigRequest::intelligence_config].
8941    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
8942    where
8943        T: std::convert::Into<crate::model::IntelligenceConfig>,
8944    {
8945        self.intelligence_config = v.map(|x| x.into());
8946        self
8947    }
8948
8949    /// Sets the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
8950    pub fn set_update_mask<T>(mut self, v: T) -> Self
8951    where
8952        T: std::convert::Into<wkt::FieldMask>,
8953    {
8954        self.update_mask = std::option::Option::Some(v.into());
8955        self
8956    }
8957
8958    /// Sets or clears the value of [update_mask][crate::model::UpdateOrganizationIntelligenceConfigRequest::update_mask].
8959    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
8960    where
8961        T: std::convert::Into<wkt::FieldMask>,
8962    {
8963        self.update_mask = v.map(|x| x.into());
8964        self
8965    }
8966
8967    /// Sets the value of [request_id][crate::model::UpdateOrganizationIntelligenceConfigRequest::request_id].
8968    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8969        self.request_id = v.into();
8970        self
8971    }
8972}
8973
8974impl wkt::message::Message for UpdateOrganizationIntelligenceConfigRequest {
8975    fn typename() -> &'static str {
8976        "type.googleapis.com/google.storage.control.v2.UpdateOrganizationIntelligenceConfigRequest"
8977    }
8978}
8979
8980#[doc(hidden)]
8981impl<'de> serde::de::Deserialize<'de> for UpdateOrganizationIntelligenceConfigRequest {
8982    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8983    where
8984        D: serde::Deserializer<'de>,
8985    {
8986        #[allow(non_camel_case_types)]
8987        #[doc(hidden)]
8988        #[derive(PartialEq, Eq, Hash)]
8989        enum __FieldTag {
8990            __intelligence_config,
8991            __update_mask,
8992            __request_id,
8993            Unknown(std::string::String),
8994        }
8995        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
8996            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
8997            where
8998                D: serde::Deserializer<'de>,
8999            {
9000                struct Visitor;
9001                impl<'de> serde::de::Visitor<'de> for Visitor {
9002                    type Value = __FieldTag;
9003                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9004                        formatter.write_str(
9005                            "a field name for UpdateOrganizationIntelligenceConfigRequest",
9006                        )
9007                    }
9008                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9009                    where
9010                        E: serde::de::Error,
9011                    {
9012                        use std::result::Result::Ok;
9013                        use std::string::ToString;
9014                        match value {
9015                            "intelligenceConfig" => Ok(__FieldTag::__intelligence_config),
9016                            "intelligence_config" => Ok(__FieldTag::__intelligence_config),
9017                            "updateMask" => Ok(__FieldTag::__update_mask),
9018                            "update_mask" => Ok(__FieldTag::__update_mask),
9019                            "requestId" => Ok(__FieldTag::__request_id),
9020                            "request_id" => Ok(__FieldTag::__request_id),
9021                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9022                        }
9023                    }
9024                }
9025                deserializer.deserialize_identifier(Visitor)
9026            }
9027        }
9028        struct Visitor;
9029        impl<'de> serde::de::Visitor<'de> for Visitor {
9030            type Value = UpdateOrganizationIntelligenceConfigRequest;
9031            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9032                formatter.write_str("struct UpdateOrganizationIntelligenceConfigRequest")
9033            }
9034            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9035            where
9036                A: serde::de::MapAccess<'de>,
9037            {
9038                #[allow(unused_imports)]
9039                use serde::de::Error;
9040                use std::option::Option::Some;
9041                let mut fields = std::collections::HashSet::new();
9042                let mut result = Self::Value::new();
9043                while let Some(tag) = map.next_key::<__FieldTag>()? {
9044                    #[allow(clippy::match_single_binding)]
9045                    match tag {
9046                        __FieldTag::__intelligence_config => {
9047                            if !fields.insert(__FieldTag::__intelligence_config) {
9048                                return std::result::Result::Err(A::Error::duplicate_field(
9049                                    "multiple values for intelligence_config",
9050                                ));
9051                            }
9052                            result.intelligence_config = map.next_value::<std::option::Option<crate::model::IntelligenceConfig>>()?
9053                                ;
9054                        }
9055                        __FieldTag::__update_mask => {
9056                            if !fields.insert(__FieldTag::__update_mask) {
9057                                return std::result::Result::Err(A::Error::duplicate_field(
9058                                    "multiple values for update_mask",
9059                                ));
9060                            }
9061                            result.update_mask =
9062                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
9063                        }
9064                        __FieldTag::__request_id => {
9065                            if !fields.insert(__FieldTag::__request_id) {
9066                                return std::result::Result::Err(A::Error::duplicate_field(
9067                                    "multiple values for request_id",
9068                                ));
9069                            }
9070                            result.request_id = map
9071                                .next_value::<std::option::Option<std::string::String>>()?
9072                                .unwrap_or_default();
9073                        }
9074                        __FieldTag::Unknown(key) => {
9075                            let value = map.next_value::<serde_json::Value>()?;
9076                            result._unknown_fields.insert(key, value);
9077                        }
9078                    }
9079                }
9080                std::result::Result::Ok(result)
9081            }
9082        }
9083        deserializer.deserialize_any(Visitor)
9084    }
9085}
9086
9087#[doc(hidden)]
9088impl serde::ser::Serialize for UpdateOrganizationIntelligenceConfigRequest {
9089    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9090    where
9091        S: serde::ser::Serializer,
9092    {
9093        use serde::ser::SerializeMap;
9094        #[allow(unused_imports)]
9095        use std::option::Option::Some;
9096        let mut state = serializer.serialize_map(std::option::Option::None)?;
9097        if self.intelligence_config.is_some() {
9098            state.serialize_entry("intelligenceConfig", &self.intelligence_config)?;
9099        }
9100        if self.update_mask.is_some() {
9101            state.serialize_entry("updateMask", &self.update_mask)?;
9102        }
9103        if !self.request_id.is_empty() {
9104            state.serialize_entry("requestId", &self.request_id)?;
9105        }
9106        if !self._unknown_fields.is_empty() {
9107            for (key, value) in self._unknown_fields.iter() {
9108                state.serialize_entry(key, &value)?;
9109            }
9110        }
9111        state.end()
9112    }
9113}
9114
9115/// Request message to update the `IntelligenceConfig` resource associated with
9116/// your folder.
9117///
9118/// **IAM Permissions**:
9119///
9120/// Requires `storage.intelligenceConfigs.update`
9121/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
9122/// the folder.
9123#[derive(Clone, Debug, Default, PartialEq)]
9124#[non_exhaustive]
9125pub struct UpdateFolderIntelligenceConfigRequest {
9126    /// Required. The `IntelligenceConfig` resource to be updated.
9127    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
9128
9129    /// Required. The `update_mask` that specifies the fields within the
9130    /// `IntelligenceConfig` resource that should be modified by this update. Only
9131    /// the listed fields are updated.
9132    pub update_mask: std::option::Option<wkt::FieldMask>,
9133
9134    /// Optional. The ID that uniquely identifies the request, preventing duplicate
9135    /// processing.
9136    pub request_id: std::string::String,
9137
9138    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9139}
9140
9141impl UpdateFolderIntelligenceConfigRequest {
9142    pub fn new() -> Self {
9143        std::default::Default::default()
9144    }
9145
9146    /// Sets the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
9147    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
9148    where
9149        T: std::convert::Into<crate::model::IntelligenceConfig>,
9150    {
9151        self.intelligence_config = std::option::Option::Some(v.into());
9152        self
9153    }
9154
9155    /// Sets or clears the value of [intelligence_config][crate::model::UpdateFolderIntelligenceConfigRequest::intelligence_config].
9156    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
9157    where
9158        T: std::convert::Into<crate::model::IntelligenceConfig>,
9159    {
9160        self.intelligence_config = v.map(|x| x.into());
9161        self
9162    }
9163
9164    /// Sets the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
9165    pub fn set_update_mask<T>(mut self, v: T) -> Self
9166    where
9167        T: std::convert::Into<wkt::FieldMask>,
9168    {
9169        self.update_mask = std::option::Option::Some(v.into());
9170        self
9171    }
9172
9173    /// Sets or clears the value of [update_mask][crate::model::UpdateFolderIntelligenceConfigRequest::update_mask].
9174    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9175    where
9176        T: std::convert::Into<wkt::FieldMask>,
9177    {
9178        self.update_mask = v.map(|x| x.into());
9179        self
9180    }
9181
9182    /// Sets the value of [request_id][crate::model::UpdateFolderIntelligenceConfigRequest::request_id].
9183    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9184        self.request_id = v.into();
9185        self
9186    }
9187}
9188
9189impl wkt::message::Message for UpdateFolderIntelligenceConfigRequest {
9190    fn typename() -> &'static str {
9191        "type.googleapis.com/google.storage.control.v2.UpdateFolderIntelligenceConfigRequest"
9192    }
9193}
9194
9195#[doc(hidden)]
9196impl<'de> serde::de::Deserialize<'de> for UpdateFolderIntelligenceConfigRequest {
9197    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9198    where
9199        D: serde::Deserializer<'de>,
9200    {
9201        #[allow(non_camel_case_types)]
9202        #[doc(hidden)]
9203        #[derive(PartialEq, Eq, Hash)]
9204        enum __FieldTag {
9205            __intelligence_config,
9206            __update_mask,
9207            __request_id,
9208            Unknown(std::string::String),
9209        }
9210        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9211            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9212            where
9213                D: serde::Deserializer<'de>,
9214            {
9215                struct Visitor;
9216                impl<'de> serde::de::Visitor<'de> for Visitor {
9217                    type Value = __FieldTag;
9218                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9219                        formatter
9220                            .write_str("a field name for UpdateFolderIntelligenceConfigRequest")
9221                    }
9222                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9223                    where
9224                        E: serde::de::Error,
9225                    {
9226                        use std::result::Result::Ok;
9227                        use std::string::ToString;
9228                        match value {
9229                            "intelligenceConfig" => Ok(__FieldTag::__intelligence_config),
9230                            "intelligence_config" => Ok(__FieldTag::__intelligence_config),
9231                            "updateMask" => Ok(__FieldTag::__update_mask),
9232                            "update_mask" => Ok(__FieldTag::__update_mask),
9233                            "requestId" => Ok(__FieldTag::__request_id),
9234                            "request_id" => Ok(__FieldTag::__request_id),
9235                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9236                        }
9237                    }
9238                }
9239                deserializer.deserialize_identifier(Visitor)
9240            }
9241        }
9242        struct Visitor;
9243        impl<'de> serde::de::Visitor<'de> for Visitor {
9244            type Value = UpdateFolderIntelligenceConfigRequest;
9245            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9246                formatter.write_str("struct UpdateFolderIntelligenceConfigRequest")
9247            }
9248            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9249            where
9250                A: serde::de::MapAccess<'de>,
9251            {
9252                #[allow(unused_imports)]
9253                use serde::de::Error;
9254                use std::option::Option::Some;
9255                let mut fields = std::collections::HashSet::new();
9256                let mut result = Self::Value::new();
9257                while let Some(tag) = map.next_key::<__FieldTag>()? {
9258                    #[allow(clippy::match_single_binding)]
9259                    match tag {
9260                        __FieldTag::__intelligence_config => {
9261                            if !fields.insert(__FieldTag::__intelligence_config) {
9262                                return std::result::Result::Err(A::Error::duplicate_field(
9263                                    "multiple values for intelligence_config",
9264                                ));
9265                            }
9266                            result.intelligence_config = map.next_value::<std::option::Option<crate::model::IntelligenceConfig>>()?
9267                                ;
9268                        }
9269                        __FieldTag::__update_mask => {
9270                            if !fields.insert(__FieldTag::__update_mask) {
9271                                return std::result::Result::Err(A::Error::duplicate_field(
9272                                    "multiple values for update_mask",
9273                                ));
9274                            }
9275                            result.update_mask =
9276                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
9277                        }
9278                        __FieldTag::__request_id => {
9279                            if !fields.insert(__FieldTag::__request_id) {
9280                                return std::result::Result::Err(A::Error::duplicate_field(
9281                                    "multiple values for request_id",
9282                                ));
9283                            }
9284                            result.request_id = map
9285                                .next_value::<std::option::Option<std::string::String>>()?
9286                                .unwrap_or_default();
9287                        }
9288                        __FieldTag::Unknown(key) => {
9289                            let value = map.next_value::<serde_json::Value>()?;
9290                            result._unknown_fields.insert(key, value);
9291                        }
9292                    }
9293                }
9294                std::result::Result::Ok(result)
9295            }
9296        }
9297        deserializer.deserialize_any(Visitor)
9298    }
9299}
9300
9301#[doc(hidden)]
9302impl serde::ser::Serialize for UpdateFolderIntelligenceConfigRequest {
9303    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9304    where
9305        S: serde::ser::Serializer,
9306    {
9307        use serde::ser::SerializeMap;
9308        #[allow(unused_imports)]
9309        use std::option::Option::Some;
9310        let mut state = serializer.serialize_map(std::option::Option::None)?;
9311        if self.intelligence_config.is_some() {
9312            state.serialize_entry("intelligenceConfig", &self.intelligence_config)?;
9313        }
9314        if self.update_mask.is_some() {
9315            state.serialize_entry("updateMask", &self.update_mask)?;
9316        }
9317        if !self.request_id.is_empty() {
9318            state.serialize_entry("requestId", &self.request_id)?;
9319        }
9320        if !self._unknown_fields.is_empty() {
9321            for (key, value) in self._unknown_fields.iter() {
9322                state.serialize_entry(key, &value)?;
9323            }
9324        }
9325        state.end()
9326    }
9327}
9328
9329/// Request message to update the `IntelligenceConfig` resource associated with
9330/// your project.
9331///
9332/// **IAM Permissions**:
9333///
9334/// Requires `storage.intelligenceConfigs.update`
9335/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
9336/// the folder.
9337#[derive(Clone, Debug, Default, PartialEq)]
9338#[non_exhaustive]
9339pub struct UpdateProjectIntelligenceConfigRequest {
9340    /// Required. The `IntelligenceConfig` resource to be updated.
9341    pub intelligence_config: std::option::Option<crate::model::IntelligenceConfig>,
9342
9343    /// Required. The `update_mask` that specifies the fields within the
9344    /// `IntelligenceConfig` resource that should be modified by this update. Only
9345    /// the listed fields are updated.
9346    pub update_mask: std::option::Option<wkt::FieldMask>,
9347
9348    /// Optional. The ID that uniquely identifies the request, preventing duplicate
9349    /// processing.
9350    pub request_id: std::string::String,
9351
9352    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9353}
9354
9355impl UpdateProjectIntelligenceConfigRequest {
9356    pub fn new() -> Self {
9357        std::default::Default::default()
9358    }
9359
9360    /// Sets the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
9361    pub fn set_intelligence_config<T>(mut self, v: T) -> Self
9362    where
9363        T: std::convert::Into<crate::model::IntelligenceConfig>,
9364    {
9365        self.intelligence_config = std::option::Option::Some(v.into());
9366        self
9367    }
9368
9369    /// Sets or clears the value of [intelligence_config][crate::model::UpdateProjectIntelligenceConfigRequest::intelligence_config].
9370    pub fn set_or_clear_intelligence_config<T>(mut self, v: std::option::Option<T>) -> Self
9371    where
9372        T: std::convert::Into<crate::model::IntelligenceConfig>,
9373    {
9374        self.intelligence_config = v.map(|x| x.into());
9375        self
9376    }
9377
9378    /// Sets the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
9379    pub fn set_update_mask<T>(mut self, v: T) -> Self
9380    where
9381        T: std::convert::Into<wkt::FieldMask>,
9382    {
9383        self.update_mask = std::option::Option::Some(v.into());
9384        self
9385    }
9386
9387    /// Sets or clears the value of [update_mask][crate::model::UpdateProjectIntelligenceConfigRequest::update_mask].
9388    pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9389    where
9390        T: std::convert::Into<wkt::FieldMask>,
9391    {
9392        self.update_mask = v.map(|x| x.into());
9393        self
9394    }
9395
9396    /// Sets the value of [request_id][crate::model::UpdateProjectIntelligenceConfigRequest::request_id].
9397    pub fn set_request_id<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9398        self.request_id = v.into();
9399        self
9400    }
9401}
9402
9403impl wkt::message::Message for UpdateProjectIntelligenceConfigRequest {
9404    fn typename() -> &'static str {
9405        "type.googleapis.com/google.storage.control.v2.UpdateProjectIntelligenceConfigRequest"
9406    }
9407}
9408
9409#[doc(hidden)]
9410impl<'de> serde::de::Deserialize<'de> for UpdateProjectIntelligenceConfigRequest {
9411    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9412    where
9413        D: serde::Deserializer<'de>,
9414    {
9415        #[allow(non_camel_case_types)]
9416        #[doc(hidden)]
9417        #[derive(PartialEq, Eq, Hash)]
9418        enum __FieldTag {
9419            __intelligence_config,
9420            __update_mask,
9421            __request_id,
9422            Unknown(std::string::String),
9423        }
9424        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9425            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9426            where
9427                D: serde::Deserializer<'de>,
9428            {
9429                struct Visitor;
9430                impl<'de> serde::de::Visitor<'de> for Visitor {
9431                    type Value = __FieldTag;
9432                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9433                        formatter
9434                            .write_str("a field name for UpdateProjectIntelligenceConfigRequest")
9435                    }
9436                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9437                    where
9438                        E: serde::de::Error,
9439                    {
9440                        use std::result::Result::Ok;
9441                        use std::string::ToString;
9442                        match value {
9443                            "intelligenceConfig" => Ok(__FieldTag::__intelligence_config),
9444                            "intelligence_config" => Ok(__FieldTag::__intelligence_config),
9445                            "updateMask" => Ok(__FieldTag::__update_mask),
9446                            "update_mask" => Ok(__FieldTag::__update_mask),
9447                            "requestId" => Ok(__FieldTag::__request_id),
9448                            "request_id" => Ok(__FieldTag::__request_id),
9449                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9450                        }
9451                    }
9452                }
9453                deserializer.deserialize_identifier(Visitor)
9454            }
9455        }
9456        struct Visitor;
9457        impl<'de> serde::de::Visitor<'de> for Visitor {
9458            type Value = UpdateProjectIntelligenceConfigRequest;
9459            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9460                formatter.write_str("struct UpdateProjectIntelligenceConfigRequest")
9461            }
9462            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9463            where
9464                A: serde::de::MapAccess<'de>,
9465            {
9466                #[allow(unused_imports)]
9467                use serde::de::Error;
9468                use std::option::Option::Some;
9469                let mut fields = std::collections::HashSet::new();
9470                let mut result = Self::Value::new();
9471                while let Some(tag) = map.next_key::<__FieldTag>()? {
9472                    #[allow(clippy::match_single_binding)]
9473                    match tag {
9474                        __FieldTag::__intelligence_config => {
9475                            if !fields.insert(__FieldTag::__intelligence_config) {
9476                                return std::result::Result::Err(A::Error::duplicate_field(
9477                                    "multiple values for intelligence_config",
9478                                ));
9479                            }
9480                            result.intelligence_config = map.next_value::<std::option::Option<crate::model::IntelligenceConfig>>()?
9481                                ;
9482                        }
9483                        __FieldTag::__update_mask => {
9484                            if !fields.insert(__FieldTag::__update_mask) {
9485                                return std::result::Result::Err(A::Error::duplicate_field(
9486                                    "multiple values for update_mask",
9487                                ));
9488                            }
9489                            result.update_mask =
9490                                map.next_value::<std::option::Option<wkt::FieldMask>>()?;
9491                        }
9492                        __FieldTag::__request_id => {
9493                            if !fields.insert(__FieldTag::__request_id) {
9494                                return std::result::Result::Err(A::Error::duplicate_field(
9495                                    "multiple values for request_id",
9496                                ));
9497                            }
9498                            result.request_id = map
9499                                .next_value::<std::option::Option<std::string::String>>()?
9500                                .unwrap_or_default();
9501                        }
9502                        __FieldTag::Unknown(key) => {
9503                            let value = map.next_value::<serde_json::Value>()?;
9504                            result._unknown_fields.insert(key, value);
9505                        }
9506                    }
9507                }
9508                std::result::Result::Ok(result)
9509            }
9510        }
9511        deserializer.deserialize_any(Visitor)
9512    }
9513}
9514
9515#[doc(hidden)]
9516impl serde::ser::Serialize for UpdateProjectIntelligenceConfigRequest {
9517    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9518    where
9519        S: serde::ser::Serializer,
9520    {
9521        use serde::ser::SerializeMap;
9522        #[allow(unused_imports)]
9523        use std::option::Option::Some;
9524        let mut state = serializer.serialize_map(std::option::Option::None)?;
9525        if self.intelligence_config.is_some() {
9526            state.serialize_entry("intelligenceConfig", &self.intelligence_config)?;
9527        }
9528        if self.update_mask.is_some() {
9529            state.serialize_entry("updateMask", &self.update_mask)?;
9530        }
9531        if !self.request_id.is_empty() {
9532            state.serialize_entry("requestId", &self.request_id)?;
9533        }
9534        if !self._unknown_fields.is_empty() {
9535            for (key, value) in self._unknown_fields.iter() {
9536                state.serialize_entry(key, &value)?;
9537            }
9538        }
9539        state.end()
9540    }
9541}
9542
9543/// Request message to get the `IntelligenceConfig` resource associated with your
9544/// organization.
9545///
9546/// **IAM Permissions**
9547///
9548/// Requires `storage.intelligenceConfigs.get`
9549/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
9550/// the organization.
9551#[derive(Clone, Debug, Default, PartialEq)]
9552#[non_exhaustive]
9553pub struct GetOrganizationIntelligenceConfigRequest {
9554    /// Required. The name of the `IntelligenceConfig` resource associated with
9555    /// your organization.
9556    ///
9557    /// Format: `organizations/{org_id}/locations/global/intelligenceConfig`
9558    pub name: std::string::String,
9559
9560    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9561}
9562
9563impl GetOrganizationIntelligenceConfigRequest {
9564    pub fn new() -> Self {
9565        std::default::Default::default()
9566    }
9567
9568    /// Sets the value of [name][crate::model::GetOrganizationIntelligenceConfigRequest::name].
9569    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9570        self.name = v.into();
9571        self
9572    }
9573}
9574
9575impl wkt::message::Message for GetOrganizationIntelligenceConfigRequest {
9576    fn typename() -> &'static str {
9577        "type.googleapis.com/google.storage.control.v2.GetOrganizationIntelligenceConfigRequest"
9578    }
9579}
9580
9581#[doc(hidden)]
9582impl<'de> serde::de::Deserialize<'de> for GetOrganizationIntelligenceConfigRequest {
9583    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9584    where
9585        D: serde::Deserializer<'de>,
9586    {
9587        #[allow(non_camel_case_types)]
9588        #[doc(hidden)]
9589        #[derive(PartialEq, Eq, Hash)]
9590        enum __FieldTag {
9591            __name,
9592            Unknown(std::string::String),
9593        }
9594        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9595            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9596            where
9597                D: serde::Deserializer<'de>,
9598            {
9599                struct Visitor;
9600                impl<'de> serde::de::Visitor<'de> for Visitor {
9601                    type Value = __FieldTag;
9602                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9603                        formatter
9604                            .write_str("a field name for GetOrganizationIntelligenceConfigRequest")
9605                    }
9606                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9607                    where
9608                        E: serde::de::Error,
9609                    {
9610                        use std::result::Result::Ok;
9611                        use std::string::ToString;
9612                        match value {
9613                            "name" => Ok(__FieldTag::__name),
9614                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9615                        }
9616                    }
9617                }
9618                deserializer.deserialize_identifier(Visitor)
9619            }
9620        }
9621        struct Visitor;
9622        impl<'de> serde::de::Visitor<'de> for Visitor {
9623            type Value = GetOrganizationIntelligenceConfigRequest;
9624            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9625                formatter.write_str("struct GetOrganizationIntelligenceConfigRequest")
9626            }
9627            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9628            where
9629                A: serde::de::MapAccess<'de>,
9630            {
9631                #[allow(unused_imports)]
9632                use serde::de::Error;
9633                use std::option::Option::Some;
9634                let mut fields = std::collections::HashSet::new();
9635                let mut result = Self::Value::new();
9636                while let Some(tag) = map.next_key::<__FieldTag>()? {
9637                    #[allow(clippy::match_single_binding)]
9638                    match tag {
9639                        __FieldTag::__name => {
9640                            if !fields.insert(__FieldTag::__name) {
9641                                return std::result::Result::Err(A::Error::duplicate_field(
9642                                    "multiple values for name",
9643                                ));
9644                            }
9645                            result.name = map
9646                                .next_value::<std::option::Option<std::string::String>>()?
9647                                .unwrap_or_default();
9648                        }
9649                        __FieldTag::Unknown(key) => {
9650                            let value = map.next_value::<serde_json::Value>()?;
9651                            result._unknown_fields.insert(key, value);
9652                        }
9653                    }
9654                }
9655                std::result::Result::Ok(result)
9656            }
9657        }
9658        deserializer.deserialize_any(Visitor)
9659    }
9660}
9661
9662#[doc(hidden)]
9663impl serde::ser::Serialize for GetOrganizationIntelligenceConfigRequest {
9664    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9665    where
9666        S: serde::ser::Serializer,
9667    {
9668        use serde::ser::SerializeMap;
9669        #[allow(unused_imports)]
9670        use std::option::Option::Some;
9671        let mut state = serializer.serialize_map(std::option::Option::None)?;
9672        if !self.name.is_empty() {
9673            state.serialize_entry("name", &self.name)?;
9674        }
9675        if !self._unknown_fields.is_empty() {
9676            for (key, value) in self._unknown_fields.iter() {
9677                state.serialize_entry(key, &value)?;
9678            }
9679        }
9680        state.end()
9681    }
9682}
9683
9684/// Request message to get the `IntelligenceConfig` resource associated with your
9685/// folder.
9686///
9687/// **IAM Permissions**
9688///
9689/// Requires `storage.intelligenceConfigs.get`
9690/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission on
9691/// the folder.
9692#[derive(Clone, Debug, Default, PartialEq)]
9693#[non_exhaustive]
9694pub struct GetFolderIntelligenceConfigRequest {
9695    /// Required. The name of the `IntelligenceConfig` resource associated with
9696    /// your folder.
9697    ///
9698    /// Format: `folders/{id}/locations/global/intelligenceConfig`
9699    pub name: std::string::String,
9700
9701    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9702}
9703
9704impl GetFolderIntelligenceConfigRequest {
9705    pub fn new() -> Self {
9706        std::default::Default::default()
9707    }
9708
9709    /// Sets the value of [name][crate::model::GetFolderIntelligenceConfigRequest::name].
9710    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9711        self.name = v.into();
9712        self
9713    }
9714}
9715
9716impl wkt::message::Message for GetFolderIntelligenceConfigRequest {
9717    fn typename() -> &'static str {
9718        "type.googleapis.com/google.storage.control.v2.GetFolderIntelligenceConfigRequest"
9719    }
9720}
9721
9722#[doc(hidden)]
9723impl<'de> serde::de::Deserialize<'de> for GetFolderIntelligenceConfigRequest {
9724    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9725    where
9726        D: serde::Deserializer<'de>,
9727    {
9728        #[allow(non_camel_case_types)]
9729        #[doc(hidden)]
9730        #[derive(PartialEq, Eq, Hash)]
9731        enum __FieldTag {
9732            __name,
9733            Unknown(std::string::String),
9734        }
9735        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9736            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9737            where
9738                D: serde::Deserializer<'de>,
9739            {
9740                struct Visitor;
9741                impl<'de> serde::de::Visitor<'de> for Visitor {
9742                    type Value = __FieldTag;
9743                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9744                        formatter.write_str("a field name for GetFolderIntelligenceConfigRequest")
9745                    }
9746                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9747                    where
9748                        E: serde::de::Error,
9749                    {
9750                        use std::result::Result::Ok;
9751                        use std::string::ToString;
9752                        match value {
9753                            "name" => Ok(__FieldTag::__name),
9754                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9755                        }
9756                    }
9757                }
9758                deserializer.deserialize_identifier(Visitor)
9759            }
9760        }
9761        struct Visitor;
9762        impl<'de> serde::de::Visitor<'de> for Visitor {
9763            type Value = GetFolderIntelligenceConfigRequest;
9764            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9765                formatter.write_str("struct GetFolderIntelligenceConfigRequest")
9766            }
9767            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9768            where
9769                A: serde::de::MapAccess<'de>,
9770            {
9771                #[allow(unused_imports)]
9772                use serde::de::Error;
9773                use std::option::Option::Some;
9774                let mut fields = std::collections::HashSet::new();
9775                let mut result = Self::Value::new();
9776                while let Some(tag) = map.next_key::<__FieldTag>()? {
9777                    #[allow(clippy::match_single_binding)]
9778                    match tag {
9779                        __FieldTag::__name => {
9780                            if !fields.insert(__FieldTag::__name) {
9781                                return std::result::Result::Err(A::Error::duplicate_field(
9782                                    "multiple values for name",
9783                                ));
9784                            }
9785                            result.name = map
9786                                .next_value::<std::option::Option<std::string::String>>()?
9787                                .unwrap_or_default();
9788                        }
9789                        __FieldTag::Unknown(key) => {
9790                            let value = map.next_value::<serde_json::Value>()?;
9791                            result._unknown_fields.insert(key, value);
9792                        }
9793                    }
9794                }
9795                std::result::Result::Ok(result)
9796            }
9797        }
9798        deserializer.deserialize_any(Visitor)
9799    }
9800}
9801
9802#[doc(hidden)]
9803impl serde::ser::Serialize for GetFolderIntelligenceConfigRequest {
9804    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9805    where
9806        S: serde::ser::Serializer,
9807    {
9808        use serde::ser::SerializeMap;
9809        #[allow(unused_imports)]
9810        use std::option::Option::Some;
9811        let mut state = serializer.serialize_map(std::option::Option::None)?;
9812        if !self.name.is_empty() {
9813            state.serialize_entry("name", &self.name)?;
9814        }
9815        if !self._unknown_fields.is_empty() {
9816            for (key, value) in self._unknown_fields.iter() {
9817                state.serialize_entry(key, &value)?;
9818            }
9819        }
9820        state.end()
9821    }
9822}
9823
9824/// Request message to get the `IntelligenceConfig` resource associated with your
9825/// project.
9826///
9827/// **IAM Permissions**:
9828///
9829/// Requires `storage.intelligenceConfigs.get`
9830/// [IAM](https://cloud.google.com/iam/docs/overview#permissions) permission
9831/// on the project.
9832#[derive(Clone, Debug, Default, PartialEq)]
9833#[non_exhaustive]
9834pub struct GetProjectIntelligenceConfigRequest {
9835    /// Required. The name of the `IntelligenceConfig` resource associated with
9836    /// your project.
9837    ///
9838    /// Format: `projects/{id}/locations/global/intelligenceConfig`
9839    pub name: std::string::String,
9840
9841    _unknown_fields: serde_json::Map<std::string::String, serde_json::Value>,
9842}
9843
9844impl GetProjectIntelligenceConfigRequest {
9845    pub fn new() -> Self {
9846        std::default::Default::default()
9847    }
9848
9849    /// Sets the value of [name][crate::model::GetProjectIntelligenceConfigRequest::name].
9850    pub fn set_name<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9851        self.name = v.into();
9852        self
9853    }
9854}
9855
9856impl wkt::message::Message for GetProjectIntelligenceConfigRequest {
9857    fn typename() -> &'static str {
9858        "type.googleapis.com/google.storage.control.v2.GetProjectIntelligenceConfigRequest"
9859    }
9860}
9861
9862#[doc(hidden)]
9863impl<'de> serde::de::Deserialize<'de> for GetProjectIntelligenceConfigRequest {
9864    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9865    where
9866        D: serde::Deserializer<'de>,
9867    {
9868        #[allow(non_camel_case_types)]
9869        #[doc(hidden)]
9870        #[derive(PartialEq, Eq, Hash)]
9871        enum __FieldTag {
9872            __name,
9873            Unknown(std::string::String),
9874        }
9875        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
9876            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
9877            where
9878                D: serde::Deserializer<'de>,
9879            {
9880                struct Visitor;
9881                impl<'de> serde::de::Visitor<'de> for Visitor {
9882                    type Value = __FieldTag;
9883                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9884                        formatter.write_str("a field name for GetProjectIntelligenceConfigRequest")
9885                    }
9886                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
9887                    where
9888                        E: serde::de::Error,
9889                    {
9890                        use std::result::Result::Ok;
9891                        use std::string::ToString;
9892                        match value {
9893                            "name" => Ok(__FieldTag::__name),
9894                            _ => Ok(__FieldTag::Unknown(value.to_string())),
9895                        }
9896                    }
9897                }
9898                deserializer.deserialize_identifier(Visitor)
9899            }
9900        }
9901        struct Visitor;
9902        impl<'de> serde::de::Visitor<'de> for Visitor {
9903            type Value = GetProjectIntelligenceConfigRequest;
9904            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
9905                formatter.write_str("struct GetProjectIntelligenceConfigRequest")
9906            }
9907            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
9908            where
9909                A: serde::de::MapAccess<'de>,
9910            {
9911                #[allow(unused_imports)]
9912                use serde::de::Error;
9913                use std::option::Option::Some;
9914                let mut fields = std::collections::HashSet::new();
9915                let mut result = Self::Value::new();
9916                while let Some(tag) = map.next_key::<__FieldTag>()? {
9917                    #[allow(clippy::match_single_binding)]
9918                    match tag {
9919                        __FieldTag::__name => {
9920                            if !fields.insert(__FieldTag::__name) {
9921                                return std::result::Result::Err(A::Error::duplicate_field(
9922                                    "multiple values for name",
9923                                ));
9924                            }
9925                            result.name = map
9926                                .next_value::<std::option::Option<std::string::String>>()?
9927                                .unwrap_or_default();
9928                        }
9929                        __FieldTag::Unknown(key) => {
9930                            let value = map.next_value::<serde_json::Value>()?;
9931                            result._unknown_fields.insert(key, value);
9932                        }
9933                    }
9934                }
9935                std::result::Result::Ok(result)
9936            }
9937        }
9938        deserializer.deserialize_any(Visitor)
9939    }
9940}
9941
9942#[doc(hidden)]
9943impl serde::ser::Serialize for GetProjectIntelligenceConfigRequest {
9944    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
9945    where
9946        S: serde::ser::Serializer,
9947    {
9948        use serde::ser::SerializeMap;
9949        #[allow(unused_imports)]
9950        use std::option::Option::Some;
9951        let mut state = serializer.serialize_map(std::option::Option::None)?;
9952        if !self.name.is_empty() {
9953            state.serialize_entry("name", &self.name)?;
9954        }
9955        if !self._unknown_fields.is_empty() {
9956            for (key, value) in self._unknown_fields.iter() {
9957                state.serialize_entry(key, &value)?;
9958            }
9959        }
9960        state.end()
9961    }
9962}